diff options
| author | Paul Eggert | 2011-02-06 20:43:35 -0800 |
|---|---|---|
| committer | Paul Eggert | 2011-02-06 20:43:35 -0800 |
| commit | f1e598241997f026c8895fa045a740c34aa76093 (patch) | |
| tree | cb252b2caa9ca548f21715fbcb71206345ff47ce /src | |
| parent | a2db99828caf787cfc6da0be36052e00e8851bb3 (diff) | |
| download | emacs-f1e598241997f026c8895fa045a740c34aa76093.tar.gz emacs-f1e598241997f026c8895fa045a740c34aa76093.zip | |
* fns.c: conform to C89 pointer rules
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/fns.c | 25 |
2 files changed, 17 insertions, 12 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index d8fd7f6130c..e1ef917a977 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -16,6 +16,10 @@ | |||
| 16 | (Fuser_full_name, Fsubst_char_in_region, Ftranslate_region_internal): | 16 | (Fuser_full_name, Fsubst_char_in_region, Ftranslate_region_internal): |
| 17 | (Fformat): Likewise. | 17 | (Fformat): Likewise. |
| 18 | * callint.c (Fcall_interactively): Likewise. | 18 | * callint.c (Fcall_interactively): Likewise. |
| 19 | * fns.c (string_make_multibyte, string_to_multibyte): | ||
| 20 | (string_make_unibyte, Fstring_as_unibyte, Fstring_to_unibyte): | ||
| 21 | (Fbase64_encode_region, base64_encode_1, Fbase64_decode_region, Fmd5): | ||
| 22 | Likewise. | ||
| 19 | 23 | ||
| 20 | 2011-02-06 Paul Eggert <eggert@cs.ucla.edu> | 24 | 2011-02-06 Paul Eggert <eggert@cs.ucla.edu> |
| 21 | 25 | ||
| @@ -882,7 +882,7 @@ string_make_multibyte (Lisp_Object string) | |||
| 882 | copy_text (SDATA (string), buf, SBYTES (string), | 882 | copy_text (SDATA (string), buf, SBYTES (string), |
| 883 | 0, 1); | 883 | 0, 1); |
| 884 | 884 | ||
| 885 | ret = make_multibyte_string (buf, SCHARS (string), nbytes); | 885 | ret = make_multibyte_string ((char *) buf, SCHARS (string), nbytes); |
| 886 | SAFE_FREE (); | 886 | SAFE_FREE (); |
| 887 | 887 | ||
| 888 | return ret; | 888 | return ret; |
| @@ -914,7 +914,7 @@ string_to_multibyte (Lisp_Object string) | |||
| 914 | memcpy (buf, SDATA (string), SBYTES (string)); | 914 | memcpy (buf, SDATA (string), SBYTES (string)); |
| 915 | str_to_multibyte (buf, nbytes, SBYTES (string)); | 915 | str_to_multibyte (buf, nbytes, SBYTES (string)); |
| 916 | 916 | ||
| 917 | ret = make_multibyte_string (buf, SCHARS (string), nbytes); | 917 | ret = make_multibyte_string ((char *) buf, SCHARS (string), nbytes); |
| 918 | SAFE_FREE (); | 918 | SAFE_FREE (); |
| 919 | 919 | ||
| 920 | return ret; | 920 | return ret; |
| @@ -940,7 +940,7 @@ string_make_unibyte (Lisp_Object string) | |||
| 940 | copy_text (SDATA (string), buf, SBYTES (string), | 940 | copy_text (SDATA (string), buf, SBYTES (string), |
| 941 | 1, 0); | 941 | 1, 0); |
| 942 | 942 | ||
| 943 | ret = make_unibyte_string (buf, nchars); | 943 | ret = make_unibyte_string ((char *) buf, nchars); |
| 944 | SAFE_FREE (); | 944 | SAFE_FREE (); |
| 945 | 945 | ||
| 946 | return ret; | 946 | return ret; |
| @@ -996,7 +996,7 @@ If STRING is multibyte and contains a character of charset | |||
| 996 | 996 | ||
| 997 | memcpy (str, SDATA (string), bytes); | 997 | memcpy (str, SDATA (string), bytes); |
| 998 | bytes = str_as_unibyte (str, bytes); | 998 | bytes = str_as_unibyte (str, bytes); |
| 999 | string = make_unibyte_string (str, bytes); | 999 | string = make_unibyte_string ((char *) str, bytes); |
| 1000 | xfree (str); | 1000 | xfree (str); |
| 1001 | } | 1001 | } |
| 1002 | return string; | 1002 | return string; |
| @@ -1079,7 +1079,7 @@ an error is signaled. */) | |||
| 1079 | 1079 | ||
| 1080 | if (converted < chars) | 1080 | if (converted < chars) |
| 1081 | error ("Can't convert the %dth character to unibyte", converted); | 1081 | error ("Can't convert the %dth character to unibyte", converted); |
| 1082 | string = make_unibyte_string (str, chars); | 1082 | string = make_unibyte_string ((char *) str, chars); |
| 1083 | xfree (str); | 1083 | xfree (str); |
| 1084 | } | 1084 | } |
| 1085 | return string; | 1085 | return string; |
| @@ -2982,8 +2982,8 @@ into shorter lines. */) | |||
| 2982 | allength += allength / MIME_LINE_LENGTH + 1 + 6; | 2982 | allength += allength / MIME_LINE_LENGTH + 1 + 6; |
| 2983 | 2983 | ||
| 2984 | SAFE_ALLOCA (encoded, char *, allength); | 2984 | SAFE_ALLOCA (encoded, char *, allength); |
| 2985 | encoded_length = base64_encode_1 (BYTE_POS_ADDR (ibeg), encoded, length, | 2985 | encoded_length = base64_encode_1 ((char *) BYTE_POS_ADDR (ibeg), |
| 2986 | NILP (no_line_break), | 2986 | encoded, length, NILP (no_line_break), |
| 2987 | !NILP (current_buffer->enable_multibyte_characters)); | 2987 | !NILP (current_buffer->enable_multibyte_characters)); |
| 2988 | if (encoded_length > allength) | 2988 | if (encoded_length > allength) |
| 2989 | abort (); | 2989 | abort (); |
| @@ -3072,7 +3072,7 @@ base64_encode_1 (const char *from, char *to, EMACS_INT length, | |||
| 3072 | { | 3072 | { |
| 3073 | if (multibyte) | 3073 | if (multibyte) |
| 3074 | { | 3074 | { |
| 3075 | c = STRING_CHAR_AND_LENGTH (from + i, bytes); | 3075 | c = STRING_CHAR_AND_LENGTH ((unsigned char *) from + i, bytes); |
| 3076 | if (CHAR_BYTE8_P (c)) | 3076 | if (CHAR_BYTE8_P (c)) |
| 3077 | c = CHAR_TO_BYTE8 (c); | 3077 | c = CHAR_TO_BYTE8 (c); |
| 3078 | else if (c >= 256) | 3078 | else if (c >= 256) |
| @@ -3112,7 +3112,7 @@ base64_encode_1 (const char *from, char *to, EMACS_INT length, | |||
| 3112 | 3112 | ||
| 3113 | if (multibyte) | 3113 | if (multibyte) |
| 3114 | { | 3114 | { |
| 3115 | c = STRING_CHAR_AND_LENGTH (from + i, bytes); | 3115 | c = STRING_CHAR_AND_LENGTH ((unsigned char *) from + i, bytes); |
| 3116 | if (CHAR_BYTE8_P (c)) | 3116 | if (CHAR_BYTE8_P (c)) |
| 3117 | c = CHAR_TO_BYTE8 (c); | 3117 | c = CHAR_TO_BYTE8 (c); |
| 3118 | else if (c >= 256) | 3118 | else if (c >= 256) |
| @@ -3136,7 +3136,7 @@ base64_encode_1 (const char *from, char *to, EMACS_INT length, | |||
| 3136 | 3136 | ||
| 3137 | if (multibyte) | 3137 | if (multibyte) |
| 3138 | { | 3138 | { |
| 3139 | c = STRING_CHAR_AND_LENGTH (from + i, bytes); | 3139 | c = STRING_CHAR_AND_LENGTH ((unsigned char *) from + i, bytes); |
| 3140 | if (CHAR_BYTE8_P (c)) | 3140 | if (CHAR_BYTE8_P (c)) |
| 3141 | c = CHAR_TO_BYTE8 (c); | 3141 | c = CHAR_TO_BYTE8 (c); |
| 3142 | else if (c >= 256) | 3142 | else if (c >= 256) |
| @@ -3183,7 +3183,8 @@ If the region can't be decoded, signal an error and don't modify the buffer. */ | |||
| 3183 | SAFE_ALLOCA (decoded, char *, allength); | 3183 | SAFE_ALLOCA (decoded, char *, allength); |
| 3184 | 3184 | ||
| 3185 | move_gap_both (XFASTINT (beg), ibeg); | 3185 | move_gap_both (XFASTINT (beg), ibeg); |
| 3186 | decoded_length = base64_decode_1 (BYTE_POS_ADDR (ibeg), decoded, length, | 3186 | decoded_length = base64_decode_1 ((char *) BYTE_POS_ADDR (ibeg), |
| 3187 | decoded, length, | ||
| 3187 | multibyte, &inserted_chars); | 3188 | multibyte, &inserted_chars); |
| 3188 | if (decoded_length > allength) | 3189 | if (decoded_length > allength) |
| 3189 | abort (); | 3190 | abort (); |
| @@ -4566,7 +4567,7 @@ guesswork fails. Normally, an error is signaled in such case. */) | |||
| 4566 | (Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object noerror) | 4567 | (Lisp_Object object, Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object noerror) |
| 4567 | { | 4568 | { |
| 4568 | unsigned char digest[16]; | 4569 | unsigned char digest[16]; |
| 4569 | unsigned char value[33]; | 4570 | char value[33]; |
| 4570 | int i; | 4571 | int i; |
| 4571 | EMACS_INT size; | 4572 | EMACS_INT size; |
| 4572 | EMACS_INT size_byte = 0; | 4573 | EMACS_INT size_byte = 0; |