diff options
| author | Eli Zaretskii | 2010-09-24 07:55:44 -0400 |
|---|---|---|
| committer | Eli Zaretskii | 2010-09-24 07:55:44 -0400 |
| commit | e6d4aefa01a591c7198b8e50c3544b83a34edf25 (patch) | |
| tree | f9fd18e7ecc10029544d72ca8fbdbe77a90df5c7 /src | |
| parent | 5843126b45d053c3d153c4157230462094a7e505 (diff) | |
| download | emacs-e6d4aefa01a591c7198b8e50c3544b83a34edf25.tar.gz emacs-e6d4aefa01a591c7198b8e50c3544b83a34edf25.zip | |
Fix int/EMACS_INT usage in fns.c.
fns.c (Fcompare_strings, Fstring_lessp, concat)
(string_make_unibyte, Fstring_as_unibyte, Fsubstring)
(Fsubstring_no_properties, substring_both, Ffillarray)
(Fclear_string, mapcar1, Fmapconcat, Fmapcar, Fmapc)
(Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
(Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
(Fmd5): Use EMACS_INT for buffer and string positions and length
variables and arguments.
<struct textprop_rec>: Use EMACS_INT for positions.
lisp.h (substring_both): Adjust prototype.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 13 | ||||
| -rw-r--r-- | src/fns.c | 137 | ||||
| -rw-r--r-- | src/lisp.h | 3 |
3 files changed, 87 insertions, 66 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index b783d6b80fd..47cc7a76d25 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,16 @@ | |||
| 1 | 2010-09-24 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * fns.c (Fcompare_strings, Fstring_lessp, concat) | ||
| 4 | (string_make_unibyte, Fstring_as_unibyte, Fsubstring) | ||
| 5 | (Fsubstring_no_properties, substring_both, Ffillarray) | ||
| 6 | (Fclear_string, mapcar1, Fmapconcat, Fmapcar, Fmapc) | ||
| 7 | (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1) | ||
| 8 | (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1) | ||
| 9 | (Fmd5): Use EMACS_INT for buffer and string positions and length | ||
| 10 | variables and arguments. | ||
| 11 | |||
| 12 | * lisp.h (substring_both): Adjust prototype. | ||
| 13 | |||
| 1 | 2010-09-24 Juanma Barranquero <lekktu@gmail.com> | 14 | 2010-09-24 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 15 | ||
| 3 | Remove W32 API function pointer unused since 2005-02-15 (revno 2005-02-15T23:19:26Z!jasonr@gnu.org). | 16 | Remove W32 API function pointer unused since 2005-02-15 (revno 2005-02-15T23:19:26Z!jasonr@gnu.org). |
| @@ -241,8 +241,8 @@ If string STR1 is greater, the value is a positive number N; | |||
| 241 | N - 1 is the number of characters that match at the beginning. */) | 241 | N - 1 is the number of characters that match at the beginning. */) |
| 242 | (Lisp_Object str1, Lisp_Object start1, Lisp_Object end1, Lisp_Object str2, Lisp_Object start2, Lisp_Object end2, Lisp_Object ignore_case) | 242 | (Lisp_Object str1, Lisp_Object start1, Lisp_Object end1, Lisp_Object str2, Lisp_Object start2, Lisp_Object end2, Lisp_Object ignore_case) |
| 243 | { | 243 | { |
| 244 | register int end1_char, end2_char; | 244 | register EMACS_INT end1_char, end2_char; |
| 245 | register int i1, i1_byte, i2, i2_byte; | 245 | register EMACS_INT i1, i1_byte, i2, i2_byte; |
| 246 | 246 | ||
| 247 | CHECK_STRING (str1); | 247 | CHECK_STRING (str1); |
| 248 | CHECK_STRING (str2); | 248 | CHECK_STRING (str2); |
| @@ -332,8 +332,8 @@ Case is significant. | |||
| 332 | Symbols are also allowed; their print names are used instead. */) | 332 | Symbols are also allowed; their print names are used instead. */) |
| 333 | (register Lisp_Object s1, Lisp_Object s2) | 333 | (register Lisp_Object s1, Lisp_Object s2) |
| 334 | { | 334 | { |
| 335 | register int end; | 335 | register EMACS_INT end; |
| 336 | register int i1, i1_byte, i2, i2_byte; | 336 | register EMACS_INT i1, i1_byte, i2, i2_byte; |
| 337 | 337 | ||
| 338 | if (SYMBOLP (s1)) | 338 | if (SYMBOLP (s1)) |
| 339 | s1 = SYMBOL_NAME (s1); | 339 | s1 = SYMBOL_NAME (s1); |
| @@ -456,8 +456,8 @@ with the original. */) | |||
| 456 | struct textprop_rec | 456 | struct textprop_rec |
| 457 | { | 457 | { |
| 458 | int argnum; /* refer to ARGS (arguments of `concat') */ | 458 | int argnum; /* refer to ARGS (arguments of `concat') */ |
| 459 | int from; /* refer to ARGS[argnum] (argument string) */ | 459 | EMACS_INT from; /* refer to ARGS[argnum] (argument string) */ |
| 460 | int to; /* refer to VAL (the target string) */ | 460 | EMACS_INT to; /* refer to VAL (the target string) */ |
| 461 | }; | 461 | }; |
| 462 | 462 | ||
| 463 | static Lisp_Object | 463 | static Lisp_Object |
| @@ -466,10 +466,10 @@ concat (int nargs, Lisp_Object *args, enum Lisp_Type target_type, int last_speci | |||
| 466 | Lisp_Object val; | 466 | Lisp_Object val; |
| 467 | register Lisp_Object tail; | 467 | register Lisp_Object tail; |
| 468 | register Lisp_Object this; | 468 | register Lisp_Object this; |
| 469 | int toindex; | 469 | EMACS_INT toindex; |
| 470 | int toindex_byte = 0; | 470 | EMACS_INT toindex_byte = 0; |
| 471 | register int result_len; | 471 | register EMACS_INT result_len; |
| 472 | register int result_len_byte; | 472 | register EMACS_INT result_len_byte; |
| 473 | register int argnum; | 473 | register int argnum; |
| 474 | Lisp_Object last_tail; | 474 | Lisp_Object last_tail; |
| 475 | Lisp_Object prev; | 475 | Lisp_Object prev; |
| @@ -513,16 +513,16 @@ concat (int nargs, Lisp_Object *args, enum Lisp_Type target_type, int last_speci | |||
| 513 | some_multibyte = 0; | 513 | some_multibyte = 0; |
| 514 | for (argnum = 0; argnum < nargs; argnum++) | 514 | for (argnum = 0; argnum < nargs; argnum++) |
| 515 | { | 515 | { |
| 516 | int len; | 516 | EMACS_INT len; |
| 517 | this = args[argnum]; | 517 | this = args[argnum]; |
| 518 | len = XFASTINT (Flength (this)); | 518 | len = XFASTINT (Flength (this)); |
| 519 | if (target_type == Lisp_String) | 519 | if (target_type == Lisp_String) |
| 520 | { | 520 | { |
| 521 | /* We must count the number of bytes needed in the string | 521 | /* We must count the number of bytes needed in the string |
| 522 | as well as the number of characters. */ | 522 | as well as the number of characters. */ |
| 523 | int i; | 523 | EMACS_INT i; |
| 524 | Lisp_Object ch; | 524 | Lisp_Object ch; |
| 525 | int this_len_byte; | 525 | EMACS_INT this_len_byte; |
| 526 | 526 | ||
| 527 | if (VECTORP (this)) | 527 | if (VECTORP (this)) |
| 528 | for (i = 0; i < len; i++) | 528 | for (i = 0; i < len; i++) |
| @@ -594,9 +594,9 @@ concat (int nargs, Lisp_Object *args, enum Lisp_Type target_type, int last_speci | |||
| 594 | for (argnum = 0; argnum < nargs; argnum++) | 594 | for (argnum = 0; argnum < nargs; argnum++) |
| 595 | { | 595 | { |
| 596 | Lisp_Object thislen; | 596 | Lisp_Object thislen; |
| 597 | int thisleni = 0; | 597 | EMACS_INT thisleni = 0; |
| 598 | register unsigned int thisindex = 0; | 598 | register EMACS_INT thisindex = 0; |
| 599 | register unsigned int thisindex_byte = 0; | 599 | register EMACS_INT thisindex_byte = 0; |
| 600 | 600 | ||
| 601 | this = args[argnum]; | 601 | this = args[argnum]; |
| 602 | if (!CONSP (this)) | 602 | if (!CONSP (this)) |
| @@ -606,7 +606,7 @@ concat (int nargs, Lisp_Object *args, enum Lisp_Type target_type, int last_speci | |||
| 606 | if (STRINGP (this) && STRINGP (val) | 606 | if (STRINGP (this) && STRINGP (val) |
| 607 | && STRING_MULTIBYTE (this) == some_multibyte) | 607 | && STRING_MULTIBYTE (this) == some_multibyte) |
| 608 | { | 608 | { |
| 609 | int thislen_byte = SBYTES (this); | 609 | EMACS_INT thislen_byte = SBYTES (this); |
| 610 | 610 | ||
| 611 | memcpy (SDATA (val) + toindex_byte, SDATA (this), SBYTES (this)); | 611 | memcpy (SDATA (val) + toindex_byte, SDATA (this), SBYTES (this)); |
| 612 | if (! NULL_INTERVAL_P (STRING_INTERVALS (this))) | 612 | if (! NULL_INTERVAL_P (STRING_INTERVALS (this))) |
| @@ -713,7 +713,7 @@ concat (int nargs, Lisp_Object *args, enum Lisp_Type target_type, int last_speci | |||
| 713 | if (num_textprops > 0) | 713 | if (num_textprops > 0) |
| 714 | { | 714 | { |
| 715 | Lisp_Object props; | 715 | Lisp_Object props; |
| 716 | int last_to_end = -1; | 716 | EMACS_INT last_to_end = -1; |
| 717 | 717 | ||
| 718 | for (argnum = 0; argnum < num_textprops; argnum++) | 718 | for (argnum = 0; argnum < num_textprops; argnum++) |
| 719 | { | 719 | { |
| @@ -938,7 +938,7 @@ string_to_multibyte (Lisp_Object string) | |||
| 938 | Lisp_Object | 938 | Lisp_Object |
| 939 | string_make_unibyte (Lisp_Object string) | 939 | string_make_unibyte (Lisp_Object string) |
| 940 | { | 940 | { |
| 941 | int nchars; | 941 | EMACS_INT nchars; |
| 942 | unsigned char *buf; | 942 | unsigned char *buf; |
| 943 | Lisp_Object ret; | 943 | Lisp_Object ret; |
| 944 | USE_SAFE_ALLOCA; | 944 | USE_SAFE_ALLOCA; |
| @@ -1003,7 +1003,7 @@ If STRING is multibyte and contains a character of charset | |||
| 1003 | 1003 | ||
| 1004 | if (STRING_MULTIBYTE (string)) | 1004 | if (STRING_MULTIBYTE (string)) |
| 1005 | { | 1005 | { |
| 1006 | int bytes = SBYTES (string); | 1006 | EMACS_INT bytes = SBYTES (string); |
| 1007 | unsigned char *str = (unsigned char *) xmalloc (bytes); | 1007 | unsigned char *str = (unsigned char *) xmalloc (bytes); |
| 1008 | 1008 | ||
| 1009 | memcpy (str, SDATA (string), bytes); | 1009 | memcpy (str, SDATA (string), bytes); |
| @@ -1138,10 +1138,10 @@ value is a new vector that contains the elements between index FROM | |||
| 1138 | (Lisp_Object string, register Lisp_Object from, Lisp_Object to) | 1138 | (Lisp_Object string, register Lisp_Object from, Lisp_Object to) |
| 1139 | { | 1139 | { |
| 1140 | Lisp_Object res; | 1140 | Lisp_Object res; |
| 1141 | int size; | 1141 | EMACS_INT size; |
| 1142 | int size_byte = 0; | 1142 | EMACS_INT size_byte = 0; |
| 1143 | int from_char, to_char; | 1143 | EMACS_INT from_char, to_char; |
| 1144 | int from_byte = 0, to_byte = 0; | 1144 | EMACS_INT from_byte = 0, to_byte = 0; |
| 1145 | 1145 | ||
| 1146 | CHECK_VECTOR_OR_STRING (string); | 1146 | CHECK_VECTOR_OR_STRING (string); |
| 1147 | CHECK_NUMBER (from); | 1147 | CHECK_NUMBER (from); |
| @@ -1206,9 +1206,9 @@ If FROM or TO is negative, it counts from the end. | |||
| 1206 | With one argument, just copy STRING without its properties. */) | 1206 | With one argument, just copy STRING without its properties. */) |
| 1207 | (Lisp_Object string, register Lisp_Object from, Lisp_Object to) | 1207 | (Lisp_Object string, register Lisp_Object from, Lisp_Object to) |
| 1208 | { | 1208 | { |
| 1209 | int size, size_byte; | 1209 | EMACS_INT size, size_byte; |
| 1210 | int from_char, to_char; | 1210 | EMACS_INT from_char, to_char; |
| 1211 | int from_byte, to_byte; | 1211 | EMACS_INT from_byte, to_byte; |
| 1212 | 1212 | ||
| 1213 | CHECK_STRING (string); | 1213 | CHECK_STRING (string); |
| 1214 | 1214 | ||
| @@ -1256,11 +1256,12 @@ With one argument, just copy STRING without its properties. */) | |||
| 1256 | both in characters and in bytes. */ | 1256 | both in characters and in bytes. */ |
| 1257 | 1257 | ||
| 1258 | Lisp_Object | 1258 | Lisp_Object |
| 1259 | substring_both (Lisp_Object string, int from, int from_byte, int to, int to_byte) | 1259 | substring_both (Lisp_Object string, EMACS_INT from, EMACS_INT from_byte, |
| 1260 | EMACS_INT to, EMACS_INT to_byte) | ||
| 1260 | { | 1261 | { |
| 1261 | Lisp_Object res; | 1262 | Lisp_Object res; |
| 1262 | int size; | 1263 | EMACS_INT size; |
| 1263 | int size_byte; | 1264 | EMACS_INT size_byte; |
| 1264 | 1265 | ||
| 1265 | CHECK_VECTOR_OR_STRING (string); | 1266 | CHECK_VECTOR_OR_STRING (string); |
| 1266 | 1267 | ||
| @@ -2147,7 +2148,9 @@ DEFUN ("fillarray", Ffillarray, Sfillarray, 2, 2, 0, | |||
| 2147 | ARRAY is a vector, string, char-table, or bool-vector. */) | 2148 | ARRAY is a vector, string, char-table, or bool-vector. */) |
| 2148 | (Lisp_Object array, Lisp_Object item) | 2149 | (Lisp_Object array, Lisp_Object item) |
| 2149 | { | 2150 | { |
| 2150 | register int size, index, charval; | 2151 | register EMACS_INT size, index; |
| 2152 | int charval; | ||
| 2153 | |||
| 2151 | if (VECTORP (array)) | 2154 | if (VECTORP (array)) |
| 2152 | { | 2155 | { |
| 2153 | register Lisp_Object *p = XVECTOR (array)->contents; | 2156 | register Lisp_Object *p = XVECTOR (array)->contents; |
| @@ -2173,7 +2176,7 @@ ARRAY is a vector, string, char-table, or bool-vector. */) | |||
| 2173 | { | 2176 | { |
| 2174 | unsigned char str[MAX_MULTIBYTE_LENGTH]; | 2177 | unsigned char str[MAX_MULTIBYTE_LENGTH]; |
| 2175 | int len = CHAR_STRING (charval, str); | 2178 | int len = CHAR_STRING (charval, str); |
| 2176 | int size_byte = SBYTES (array); | 2179 | EMACS_INT size_byte = SBYTES (array); |
| 2177 | unsigned char *p1 = p, *endp = p + size_byte; | 2180 | unsigned char *p1 = p, *endp = p + size_byte; |
| 2178 | int i; | 2181 | int i; |
| 2179 | 2182 | ||
| @@ -2221,7 +2224,7 @@ DEFUN ("clear-string", Fclear_string, Sclear_string, | |||
| 2221 | This makes STRING unibyte and may change its length. */) | 2224 | This makes STRING unibyte and may change its length. */) |
| 2222 | (Lisp_Object string) | 2225 | (Lisp_Object string) |
| 2223 | { | 2226 | { |
| 2224 | int len; | 2227 | EMACS_INT len; |
| 2225 | CHECK_STRING (string); | 2228 | CHECK_STRING (string); |
| 2226 | len = SBYTES (string); | 2229 | len = SBYTES (string); |
| 2227 | memset (SDATA (string), 0, len); | 2230 | memset (SDATA (string), 0, len); |
| @@ -2285,11 +2288,11 @@ usage: (nconc &rest LISTS) */) | |||
| 2285 | LENI is the length of VALS, which should also be the length of SEQ. */ | 2288 | LENI is the length of VALS, which should also be the length of SEQ. */ |
| 2286 | 2289 | ||
| 2287 | static void | 2290 | static void |
| 2288 | mapcar1 (int leni, Lisp_Object *vals, Lisp_Object fn, Lisp_Object seq) | 2291 | mapcar1 (EMACS_INT leni, Lisp_Object *vals, Lisp_Object fn, Lisp_Object seq) |
| 2289 | { | 2292 | { |
| 2290 | register Lisp_Object tail; | 2293 | register Lisp_Object tail; |
| 2291 | Lisp_Object dummy; | 2294 | Lisp_Object dummy; |
| 2292 | register int i; | 2295 | register EMACS_INT i; |
| 2293 | struct gcpro gcpro1, gcpro2, gcpro3; | 2296 | struct gcpro gcpro1, gcpro2, gcpro3; |
| 2294 | 2297 | ||
| 2295 | if (vals) | 2298 | if (vals) |
| @@ -2331,12 +2334,12 @@ mapcar1 (int leni, Lisp_Object *vals, Lisp_Object fn, Lisp_Object seq) | |||
| 2331 | } | 2334 | } |
| 2332 | else if (STRINGP (seq)) | 2335 | else if (STRINGP (seq)) |
| 2333 | { | 2336 | { |
| 2334 | int i_byte; | 2337 | EMACS_INT i_byte; |
| 2335 | 2338 | ||
| 2336 | for (i = 0, i_byte = 0; i < leni;) | 2339 | for (i = 0, i_byte = 0; i < leni;) |
| 2337 | { | 2340 | { |
| 2338 | int c; | 2341 | int c; |
| 2339 | int i_before = i; | 2342 | EMACS_INT i_before = i; |
| 2340 | 2343 | ||
| 2341 | FETCH_STRING_CHAR_ADVANCE (c, seq, i, i_byte); | 2344 | FETCH_STRING_CHAR_ADVANCE (c, seq, i, i_byte); |
| 2342 | XSETFASTINT (dummy, c); | 2345 | XSETFASTINT (dummy, c); |
| @@ -2368,10 +2371,10 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */) | |||
| 2368 | (Lisp_Object function, Lisp_Object sequence, Lisp_Object separator) | 2371 | (Lisp_Object function, Lisp_Object sequence, Lisp_Object separator) |
| 2369 | { | 2372 | { |
| 2370 | Lisp_Object len; | 2373 | Lisp_Object len; |
| 2371 | register int leni; | 2374 | register EMACS_INT leni; |
| 2372 | int nargs; | 2375 | int nargs; |
| 2373 | register Lisp_Object *args; | 2376 | register Lisp_Object *args; |
| 2374 | register int i; | 2377 | register EMACS_INT i; |
| 2375 | struct gcpro gcpro1; | 2378 | struct gcpro gcpro1; |
| 2376 | Lisp_Object ret; | 2379 | Lisp_Object ret; |
| 2377 | USE_SAFE_ALLOCA; | 2380 | USE_SAFE_ALLOCA; |
| @@ -2408,7 +2411,7 @@ SEQUENCE may be a list, a vector, a bool-vector, or a string. */) | |||
| 2408 | (Lisp_Object function, Lisp_Object sequence) | 2411 | (Lisp_Object function, Lisp_Object sequence) |
| 2409 | { | 2412 | { |
| 2410 | register Lisp_Object len; | 2413 | register Lisp_Object len; |
| 2411 | register int leni; | 2414 | register EMACS_INT leni; |
| 2412 | register Lisp_Object *args; | 2415 | register Lisp_Object *args; |
| 2413 | Lisp_Object ret; | 2416 | Lisp_Object ret; |
| 2414 | USE_SAFE_ALLOCA; | 2417 | USE_SAFE_ALLOCA; |
| @@ -2434,7 +2437,7 @@ Unlike `mapcar', don't accumulate the results. Return SEQUENCE. | |||
| 2434 | SEQUENCE may be a list, a vector, a bool-vector, or a string. */) | 2437 | SEQUENCE may be a list, a vector, a bool-vector, or a string. */) |
| 2435 | (Lisp_Object function, Lisp_Object sequence) | 2438 | (Lisp_Object function, Lisp_Object sequence) |
| 2436 | { | 2439 | { |
| 2437 | register int leni; | 2440 | register EMACS_INT leni; |
| 2438 | 2441 | ||
| 2439 | leni = XFASTINT (Flength (sequence)); | 2442 | leni = XFASTINT (Flength (sequence)); |
| 2440 | if (CHAR_TABLE_P (sequence)) | 2443 | if (CHAR_TABLE_P (sequence)) |
| @@ -2958,8 +2961,9 @@ static const short base64_char_to_value[128] = | |||
| 2958 | base64 characters. */ | 2961 | base64 characters. */ |
| 2959 | 2962 | ||
| 2960 | 2963 | ||
| 2961 | static int base64_encode_1 (const char *, char *, int, int, int); | 2964 | static EMACS_INT base64_encode_1 (const char *, char *, EMACS_INT, int, int); |
| 2962 | static int base64_decode_1 (const char *, char *, int, int, int *); | 2965 | static EMACS_INT base64_decode_1 (const char *, char *, EMACS_INT, int, |
| 2966 | EMACS_INT *); | ||
| 2963 | 2967 | ||
| 2964 | DEFUN ("base64-encode-region", Fbase64_encode_region, Sbase64_encode_region, | 2968 | DEFUN ("base64-encode-region", Fbase64_encode_region, Sbase64_encode_region, |
| 2965 | 2, 3, "r", | 2969 | 2, 3, "r", |
| @@ -2970,9 +2974,9 @@ into shorter lines. */) | |||
| 2970 | (Lisp_Object beg, Lisp_Object end, Lisp_Object no_line_break) | 2974 | (Lisp_Object beg, Lisp_Object end, Lisp_Object no_line_break) |
| 2971 | { | 2975 | { |
| 2972 | char *encoded; | 2976 | char *encoded; |
| 2973 | int allength, length; | 2977 | EMACS_INT allength, length; |
| 2974 | int ibeg, iend, encoded_length; | 2978 | EMACS_INT ibeg, iend, encoded_length; |
| 2975 | int old_pos = PT; | 2979 | EMACS_INT old_pos = PT; |
| 2976 | USE_SAFE_ALLOCA; | 2980 | USE_SAFE_ALLOCA; |
| 2977 | 2981 | ||
| 2978 | validate_region (&beg, &end); | 2982 | validate_region (&beg, &end); |
| @@ -3028,7 +3032,7 @@ Optional second argument NO-LINE-BREAK means do not break long lines | |||
| 3028 | into shorter lines. */) | 3032 | into shorter lines. */) |
| 3029 | (Lisp_Object string, Lisp_Object no_line_break) | 3033 | (Lisp_Object string, Lisp_Object no_line_break) |
| 3030 | { | 3034 | { |
| 3031 | int allength, length, encoded_length; | 3035 | EMACS_INT allength, length, encoded_length; |
| 3032 | char *encoded; | 3036 | char *encoded; |
| 3033 | Lisp_Object encoded_string; | 3037 | Lisp_Object encoded_string; |
| 3034 | USE_SAFE_ALLOCA; | 3038 | USE_SAFE_ALLOCA; |
| @@ -3064,10 +3068,12 @@ into shorter lines. */) | |||
| 3064 | return encoded_string; | 3068 | return encoded_string; |
| 3065 | } | 3069 | } |
| 3066 | 3070 | ||
| 3067 | static int | 3071 | static EMACS_INT |
| 3068 | base64_encode_1 (const char *from, char *to, int length, int line_break, int multibyte) | 3072 | base64_encode_1 (const char *from, char *to, EMACS_INT length, |
| 3073 | int line_break, int multibyte) | ||
| 3069 | { | 3074 | { |
| 3070 | int counter = 0, i = 0; | 3075 | int counter = 0; |
| 3076 | EMACS_INT i = 0; | ||
| 3071 | char *e = to; | 3077 | char *e = to; |
| 3072 | int c; | 3078 | int c; |
| 3073 | unsigned int value; | 3079 | unsigned int value; |
| @@ -3166,11 +3172,11 @@ Return the length of the decoded text. | |||
| 3166 | If the region can't be decoded, signal an error and don't modify the buffer. */) | 3172 | If the region can't be decoded, signal an error and don't modify the buffer. */) |
| 3167 | (Lisp_Object beg, Lisp_Object end) | 3173 | (Lisp_Object beg, Lisp_Object end) |
| 3168 | { | 3174 | { |
| 3169 | int ibeg, iend, length, allength; | 3175 | EMACS_INT ibeg, iend, length, allength; |
| 3170 | char *decoded; | 3176 | char *decoded; |
| 3171 | int old_pos = PT; | 3177 | EMACS_INT old_pos = PT; |
| 3172 | int decoded_length; | 3178 | EMACS_INT decoded_length; |
| 3173 | int inserted_chars; | 3179 | EMACS_INT inserted_chars; |
| 3174 | int multibyte = !NILP (current_buffer->enable_multibyte_characters); | 3180 | int multibyte = !NILP (current_buffer->enable_multibyte_characters); |
| 3175 | USE_SAFE_ALLOCA; | 3181 | USE_SAFE_ALLOCA; |
| 3176 | 3182 | ||
| @@ -3227,7 +3233,7 @@ DEFUN ("base64-decode-string", Fbase64_decode_string, Sbase64_decode_string, | |||
| 3227 | (Lisp_Object string) | 3233 | (Lisp_Object string) |
| 3228 | { | 3234 | { |
| 3229 | char *decoded; | 3235 | char *decoded; |
| 3230 | int length, decoded_length; | 3236 | EMACS_INT length, decoded_length; |
| 3231 | Lisp_Object decoded_string; | 3237 | Lisp_Object decoded_string; |
| 3232 | USE_SAFE_ALLOCA; | 3238 | USE_SAFE_ALLOCA; |
| 3233 | 3239 | ||
| @@ -3259,14 +3265,15 @@ DEFUN ("base64-decode-string", Fbase64_decode_string, Sbase64_decode_string, | |||
| 3259 | form. If NCHARS_RETRUN is not NULL, store the number of produced | 3265 | form. If NCHARS_RETRUN is not NULL, store the number of produced |
| 3260 | characters in *NCHARS_RETURN. */ | 3266 | characters in *NCHARS_RETURN. */ |
| 3261 | 3267 | ||
| 3262 | static int | 3268 | static EMACS_INT |
| 3263 | base64_decode_1 (const char *from, char *to, int length, int multibyte, int *nchars_return) | 3269 | base64_decode_1 (const char *from, char *to, EMACS_INT length, |
| 3270 | int multibyte, EMACS_INT *nchars_return) | ||
| 3264 | { | 3271 | { |
| 3265 | int i = 0; | 3272 | EMACS_INT i = 0; /* Used inside READ_QUADRUPLET_BYTE */ |
| 3266 | char *e = to; | 3273 | char *e = to; |
| 3267 | unsigned char c; | 3274 | unsigned char c; |
| 3268 | unsigned long value; | 3275 | unsigned long value; |
| 3269 | int nchars = 0; | 3276 | EMACS_INT nchars = 0; |
| 3270 | 3277 | ||
| 3271 | while (1) | 3278 | while (1) |
| 3272 | { | 3279 | { |
| @@ -4572,13 +4579,13 @@ guesswork fails. Normally, an error is signaled in such case. */) | |||
| 4572 | unsigned char digest[16]; | 4579 | unsigned char digest[16]; |
| 4573 | unsigned char value[33]; | 4580 | unsigned char value[33]; |
| 4574 | int i; | 4581 | int i; |
| 4575 | int size; | 4582 | EMACS_INT size; |
| 4576 | int size_byte = 0; | 4583 | EMACS_INT size_byte = 0; |
| 4577 | int start_char = 0, end_char = 0; | 4584 | EMACS_INT start_char = 0, end_char = 0; |
| 4578 | int start_byte = 0, end_byte = 0; | 4585 | EMACS_INT start_byte = 0, end_byte = 0; |
| 4579 | register int b, e; | 4586 | register EMACS_INT b, e; |
| 4580 | register struct buffer *bp; | 4587 | register struct buffer *bp; |
| 4581 | int temp; | 4588 | EMACS_INT temp; |
| 4582 | 4589 | ||
| 4583 | if (STRINGP (object)) | 4590 | if (STRINGP (object)) |
| 4584 | { | 4591 | { |
diff --git a/src/lisp.h b/src/lisp.h index 4baa72f4435..10ee13f1e4f 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2495,7 +2495,8 @@ EXFUN (Fstring_as_unibyte, 1); | |||
| 2495 | EXFUN (Fstring_to_multibyte, 1); | 2495 | EXFUN (Fstring_to_multibyte, 1); |
| 2496 | EXFUN (Fstring_to_unibyte, 1); | 2496 | EXFUN (Fstring_to_unibyte, 1); |
| 2497 | EXFUN (Fsubstring, 3); | 2497 | EXFUN (Fsubstring, 3); |
| 2498 | extern Lisp_Object substring_both (Lisp_Object, int, int, int, int); | 2498 | extern Lisp_Object substring_both (Lisp_Object, EMACS_INT, EMACS_INT, |
| 2499 | EMACS_INT, EMACS_INT); | ||
| 2499 | EXFUN (Fnth, 2); | 2500 | EXFUN (Fnth, 2); |
| 2500 | EXFUN (Fnthcdr, 2); | 2501 | EXFUN (Fnthcdr, 2); |
| 2501 | EXFUN (Fmemq, 2); | 2502 | EXFUN (Fmemq, 2); |