diff options
| author | Paul Eggert | 2019-08-24 11:42:28 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-08-24 15:55:08 -0700 |
| commit | b62eac0f870754bc75b1162246f9901a04910044 (patch) | |
| tree | 4b392cfe5a8c36c6a735fd25228d3622ccbd17b5 /src | |
| parent | aa49aa884053d0e8b33efe265f2aade19d1f3f3d (diff) | |
| download | emacs-b62eac0f870754bc75b1162246f9901a04910044.tar.gz emacs-b62eac0f870754bc75b1162246f9901a04910044.zip | |
extern function cleanup
Most of these functions can be static. A few are unused.
* src/coding.c (encode_string_utf_8, decode_string_utf_8):
Define only if ENABLE_UTF_8_CONVERTER_TEST, as they're
not needed otherwise.
* src/coding.c (encode_string_utf_8, decode_string_utf_8):
* src/data.c (integer_mod):
* src/fns.c (base64_encode_region_1, base64_encode_string_1):
* src/ftfont.c (ftfont_get_fc_charset):
Now static.
* src/sysdep.c (verrprintf): Remove; unused.
Diffstat (limited to 'src')
| -rw-r--r-- | src/coding.c | 12 | ||||
| -rw-r--r-- | src/coding.h | 4 | ||||
| -rw-r--r-- | src/data.c | 2 | ||||
| -rw-r--r-- | src/fns.c | 32 | ||||
| -rw-r--r-- | src/ftfont.c | 2 | ||||
| -rw-r--r-- | src/ftfont.h | 1 | ||||
| -rw-r--r-- | src/lisp.h | 1 | ||||
| -rw-r--r-- | src/sysdep.c | 6 | ||||
| -rw-r--r-- | src/sysstdio.h | 1 |
9 files changed, 23 insertions, 38 deletions
diff --git a/src/coding.c b/src/coding.c index 2ddd34eb7b6..1c6475828df 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -9516,6 +9516,10 @@ code_convert_string_norecord (Lisp_Object string, Lisp_Object coding_system, | |||
| 9516 | } | 9516 | } |
| 9517 | 9517 | ||
| 9518 | 9518 | ||
| 9519 | /* #define ENABLE_UTF_8_CONVERTER_TEST */ | ||
| 9520 | |||
| 9521 | #ifdef ENABLE_UTF_8_CONVERTER_TEST | ||
| 9522 | |||
| 9519 | /* Return the gap address of BUFFER. If the gap size is less than | 9523 | /* Return the gap address of BUFFER. If the gap size is less than |
| 9520 | NBYTES, enlarge the gap in advance. */ | 9524 | NBYTES, enlarge the gap in advance. */ |
| 9521 | 9525 | ||
| @@ -9618,7 +9622,7 @@ get_char_bytes (int c, int *len) | |||
| 9618 | If the two arguments are Qnil, return Qnil if STRING has a | 9622 | If the two arguments are Qnil, return Qnil if STRING has a |
| 9619 | non-Unicode character. */ | 9623 | non-Unicode character. */ |
| 9620 | 9624 | ||
| 9621 | Lisp_Object | 9625 | static Lisp_Object |
| 9622 | encode_string_utf_8 (Lisp_Object string, Lisp_Object buffer, | 9626 | encode_string_utf_8 (Lisp_Object string, Lisp_Object buffer, |
| 9623 | bool nocopy, Lisp_Object handle_8_bit, | 9627 | bool nocopy, Lisp_Object handle_8_bit, |
| 9624 | Lisp_Object handle_over_uni) | 9628 | Lisp_Object handle_over_uni) |
| @@ -9873,7 +9877,7 @@ encode_string_utf_8 (Lisp_Object string, Lisp_Object buffer, | |||
| 9873 | If the two arguments are Qnil, return Qnil if STRING has an invalid | 9877 | If the two arguments are Qnil, return Qnil if STRING has an invalid |
| 9874 | sequence. */ | 9878 | sequence. */ |
| 9875 | 9879 | ||
| 9876 | Lisp_Object | 9880 | static Lisp_Object |
| 9877 | decode_string_utf_8 (Lisp_Object string, Lisp_Object buffer, | 9881 | decode_string_utf_8 (Lisp_Object string, Lisp_Object buffer, |
| 9878 | bool nocopy, Lisp_Object handle_8_bit, | 9882 | bool nocopy, Lisp_Object handle_8_bit, |
| 9879 | Lisp_Object handle_over_uni) | 9883 | Lisp_Object handle_over_uni) |
| @@ -10111,10 +10115,6 @@ decode_string_utf_8 (Lisp_Object string, Lisp_Object buffer, | |||
| 10111 | return val; | 10115 | return val; |
| 10112 | } | 10116 | } |
| 10113 | 10117 | ||
| 10114 | /* #define ENABLE_UTF_8_CONVERTER_TEST */ | ||
| 10115 | |||
| 10116 | #ifdef ENABLE_UTF_8_CONVERTER_TEST | ||
| 10117 | |||
| 10118 | /* These functions are useful for testing and benchmarking | 10118 | /* These functions are useful for testing and benchmarking |
| 10119 | encode_string_utf_8 and decode_string_utf_8. */ | 10119 | encode_string_utf_8 and decode_string_utf_8. */ |
| 10120 | 10120 | ||
diff --git a/src/coding.h b/src/coding.h index 8efddbf55c4..70690d42d30 100644 --- a/src/coding.h +++ b/src/coding.h | |||
| @@ -689,10 +689,6 @@ extern Lisp_Object code_convert_string (Lisp_Object, Lisp_Object, | |||
| 689 | Lisp_Object, bool, bool, bool); | 689 | Lisp_Object, bool, bool, bool); |
| 690 | extern Lisp_Object code_convert_string_norecord (Lisp_Object, Lisp_Object, | 690 | extern Lisp_Object code_convert_string_norecord (Lisp_Object, Lisp_Object, |
| 691 | bool); | 691 | bool); |
| 692 | extern Lisp_Object encode_string_utf_8 (Lisp_Object, Lisp_Object, bool, | ||
| 693 | Lisp_Object, Lisp_Object); | ||
| 694 | extern Lisp_Object decode_string_utf_8 (Lisp_Object, Lisp_Object, bool, | ||
| 695 | Lisp_Object, Lisp_Object); | ||
| 696 | extern Lisp_Object encode_file_name (Lisp_Object); | 692 | extern Lisp_Object encode_file_name (Lisp_Object); |
| 697 | extern Lisp_Object decode_file_name (Lisp_Object); | 693 | extern Lisp_Object decode_file_name (Lisp_Object); |
| 698 | extern Lisp_Object raw_text_coding_system (Lisp_Object); | 694 | extern Lisp_Object raw_text_coding_system (Lisp_Object); |
diff --git a/src/data.c b/src/data.c index 2797adfcdc8..38968359a50 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -3079,7 +3079,7 @@ Both must be integers or markers. */) | |||
| 3079 | } | 3079 | } |
| 3080 | 3080 | ||
| 3081 | /* Return X mod Y. Both must be integers and Y must be nonzero. */ | 3081 | /* Return X mod Y. Both must be integers and Y must be nonzero. */ |
| 3082 | Lisp_Object | 3082 | static Lisp_Object |
| 3083 | integer_mod (Lisp_Object x, Lisp_Object y) | 3083 | integer_mod (Lisp_Object x, Lisp_Object y) |
| 3084 | { | 3084 | { |
| 3085 | if (FIXNUMP (x) && FIXNUMP (y)) | 3085 | if (FIXNUMP (x) && FIXNUMP (y)) |
| @@ -3280,11 +3280,11 @@ static ptrdiff_t base64_encode_1 (const char *, char *, ptrdiff_t, bool, bool, | |||
| 3280 | static ptrdiff_t base64_decode_1 (const char *, char *, ptrdiff_t, bool, | 3280 | static ptrdiff_t base64_decode_1 (const char *, char *, ptrdiff_t, bool, |
| 3281 | bool, ptrdiff_t *); | 3281 | bool, ptrdiff_t *); |
| 3282 | 3282 | ||
| 3283 | Lisp_Object base64_encode_region_1 (Lisp_Object, Lisp_Object, bool, | 3283 | static Lisp_Object base64_encode_region_1 (Lisp_Object, Lisp_Object, bool, |
| 3284 | bool, bool); | 3284 | bool, bool); |
| 3285 | 3285 | ||
| 3286 | Lisp_Object base64_encode_string_1(Lisp_Object, bool, | 3286 | static Lisp_Object base64_encode_string_1 (Lisp_Object, bool, |
| 3287 | bool, bool); | 3287 | bool, bool); |
| 3288 | 3288 | ||
| 3289 | 3289 | ||
| 3290 | DEFUN ("base64-encode-region", Fbase64_encode_region, Sbase64_encode_region, | 3290 | DEFUN ("base64-encode-region", Fbase64_encode_region, Sbase64_encode_region, |
| @@ -3295,7 +3295,7 @@ Optional third argument NO-LINE-BREAK means do not break long lines | |||
| 3295 | into shorter lines. */) | 3295 | into shorter lines. */) |
| 3296 | (Lisp_Object beg, Lisp_Object end, Lisp_Object no_line_break) | 3296 | (Lisp_Object beg, Lisp_Object end, Lisp_Object no_line_break) |
| 3297 | { | 3297 | { |
| 3298 | return base64_encode_region_1(beg, end, NILP (no_line_break), true, false); | 3298 | return base64_encode_region_1 (beg, end, NILP (no_line_break), true, false); |
| 3299 | } | 3299 | } |
| 3300 | 3300 | ||
| 3301 | 3301 | ||
| @@ -3308,10 +3308,10 @@ Optional second argument NO-PAD means do not add padding char =. | |||
| 3308 | This produces the URL variant of base 64 encoding defined in RFC 4648. */) | 3308 | This produces the URL variant of base 64 encoding defined in RFC 4648. */) |
| 3309 | (Lisp_Object beg, Lisp_Object end, Lisp_Object no_pad) | 3309 | (Lisp_Object beg, Lisp_Object end, Lisp_Object no_pad) |
| 3310 | { | 3310 | { |
| 3311 | return base64_encode_region_1(beg, end, false, NILP(no_pad), true); | 3311 | return base64_encode_region_1 (beg, end, false, NILP(no_pad), true); |
| 3312 | } | 3312 | } |
| 3313 | 3313 | ||
| 3314 | Lisp_Object | 3314 | static Lisp_Object |
| 3315 | base64_encode_region_1 (Lisp_Object beg, Lisp_Object end, bool line_break, | 3315 | base64_encode_region_1 (Lisp_Object beg, Lisp_Object end, bool line_break, |
| 3316 | bool pad, bool base64url) | 3316 | bool pad, bool base64url) |
| 3317 | { | 3317 | { |
| @@ -3376,11 +3376,11 @@ into shorter lines. */) | |||
| 3376 | (Lisp_Object string, Lisp_Object no_line_break) | 3376 | (Lisp_Object string, Lisp_Object no_line_break) |
| 3377 | { | 3377 | { |
| 3378 | 3378 | ||
| 3379 | return base64_encode_string_1(string, NILP (no_line_break), true, false); | 3379 | return base64_encode_string_1 (string, NILP (no_line_break), true, false); |
| 3380 | } | 3380 | } |
| 3381 | 3381 | ||
| 3382 | DEFUN ("base64url-encode-string", Fbase64url_encode_string, Sbase64url_encode_string, | 3382 | DEFUN ("base64url-encode-string", Fbase64url_encode_string, |
| 3383 | 1, 2, 0, | 3383 | Sbase64url_encode_string, 1, 2, 0, |
| 3384 | doc: /* Base64url-encode STRING and return the result. | 3384 | doc: /* Base64url-encode STRING and return the result. |
| 3385 | Optional second argument NO-PAD means do not add padding char =. | 3385 | Optional second argument NO-PAD means do not add padding char =. |
| 3386 | 3386 | ||
| @@ -3388,12 +3388,12 @@ This produces the URL variant of base 64 encoding defined in RFC 4648. */) | |||
| 3388 | (Lisp_Object string, Lisp_Object no_pad) | 3388 | (Lisp_Object string, Lisp_Object no_pad) |
| 3389 | { | 3389 | { |
| 3390 | 3390 | ||
| 3391 | return base64_encode_string_1(string, false, NILP(no_pad), true); | 3391 | return base64_encode_string_1 (string, false, NILP(no_pad), true); |
| 3392 | } | 3392 | } |
| 3393 | 3393 | ||
| 3394 | Lisp_Object | 3394 | static Lisp_Object |
| 3395 | base64_encode_string_1(Lisp_Object string, bool line_break, | 3395 | base64_encode_string_1 (Lisp_Object string, bool line_break, |
| 3396 | bool pad, bool base64url) | 3396 | bool pad, bool base64url) |
| 3397 | { | 3397 | { |
| 3398 | ptrdiff_t allength, length, encoded_length; | 3398 | ptrdiff_t allength, length, encoded_length; |
| 3399 | char *encoded; | 3399 | char *encoded; |
| @@ -3510,9 +3510,7 @@ base64_encode_1 (const char *from, char *to, ptrdiff_t length, | |||
| 3510 | { | 3510 | { |
| 3511 | *e++ = b64_value_to_char[value]; | 3511 | *e++ = b64_value_to_char[value]; |
| 3512 | if (pad) | 3512 | if (pad) |
| 3513 | { | 3513 | *e++ = '='; |
| 3514 | *e++ = '='; | ||
| 3515 | } | ||
| 3516 | break; | 3514 | break; |
| 3517 | } | 3515 | } |
| 3518 | 3516 | ||
diff --git a/src/ftfont.c b/src/ftfont.c index 16b18de6867..77a4cf5de5c 100644 --- a/src/ftfont.c +++ b/src/ftfont.c | |||
| @@ -433,7 +433,7 @@ ftfont_lookup_cache (Lisp_Object key, enum ftfont_cache_for cache_for) | |||
| 433 | return cache; | 433 | return cache; |
| 434 | } | 434 | } |
| 435 | 435 | ||
| 436 | FcCharSet * | 436 | static FcCharSet * |
| 437 | ftfont_get_fc_charset (Lisp_Object entity) | 437 | ftfont_get_fc_charset (Lisp_Object entity) |
| 438 | { | 438 | { |
| 439 | Lisp_Object val, cache; | 439 | Lisp_Object val, cache; |
diff --git a/src/ftfont.h b/src/ftfont.h index b2280e9aab9..f771dc159b0 100644 --- a/src/ftfont.h +++ b/src/ftfont.h | |||
| @@ -41,7 +41,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 41 | #endif /* HAVE_M17N_FLT */ | 41 | #endif /* HAVE_M17N_FLT */ |
| 42 | #endif /* HAVE_LIBOTF */ | 42 | #endif /* HAVE_LIBOTF */ |
| 43 | 43 | ||
| 44 | extern FcCharSet *ftfont_get_fc_charset (Lisp_Object); | ||
| 45 | extern void ftfont_fix_match (FcPattern *, FcPattern *); | 44 | extern void ftfont_fix_match (FcPattern *, FcPattern *); |
| 46 | extern void ftfont_add_rendering_parameters (FcPattern *, Lisp_Object); | 45 | extern void ftfont_add_rendering_parameters (FcPattern *, Lisp_Object); |
| 47 | extern FcPattern *ftfont_entity_pattern (Lisp_Object, int); | 46 | extern FcPattern *ftfont_entity_pattern (Lisp_Object, int); |
diff --git a/src/lisp.h b/src/lisp.h index ae5a81e7b5e..a7b19ab576e 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3615,7 +3615,6 @@ extern void set_default_internal (Lisp_Object, Lisp_Object, | |||
| 3615 | extern Lisp_Object expt_integer (Lisp_Object, Lisp_Object); | 3615 | extern Lisp_Object expt_integer (Lisp_Object, Lisp_Object); |
| 3616 | extern void syms_of_data (void); | 3616 | extern void syms_of_data (void); |
| 3617 | extern void swap_in_global_binding (struct Lisp_Symbol *); | 3617 | extern void swap_in_global_binding (struct Lisp_Symbol *); |
| 3618 | extern Lisp_Object integer_mod (Lisp_Object, Lisp_Object); | ||
| 3619 | 3618 | ||
| 3620 | /* Defined in cmds.c */ | 3619 | /* Defined in cmds.c */ |
| 3621 | extern void syms_of_cmds (void); | 3620 | extern void syms_of_cmds (void); |
diff --git a/src/sysdep.c b/src/sysdep.c index f7478253a35..aa18ee22fd5 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -2810,12 +2810,6 @@ errputc (int c) | |||
| 2810 | } | 2810 | } |
| 2811 | 2811 | ||
| 2812 | void | 2812 | void |
| 2813 | verrprintf (char const *fmt, va_list ap) | ||
| 2814 | { | ||
| 2815 | vfprintf (errstream (), fmt, ap); | ||
| 2816 | } | ||
| 2817 | |||
| 2818 | void | ||
| 2819 | errwrite (void const *buf, ptrdiff_t nbuf) | 2813 | errwrite (void const *buf, ptrdiff_t nbuf) |
| 2820 | { | 2814 | { |
| 2821 | fwrite_unlocked (buf, 1, nbuf, errstream ()); | 2815 | fwrite_unlocked (buf, 1, nbuf, errstream ()); |
diff --git a/src/sysstdio.h b/src/sysstdio.h index f402bd633d4..1e1180a4d31 100644 --- a/src/sysstdio.h +++ b/src/sysstdio.h | |||
| @@ -28,7 +28,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 28 | 28 | ||
| 29 | extern FILE *emacs_fopen (char const *, char const *); | 29 | extern FILE *emacs_fopen (char const *, char const *); |
| 30 | extern void errputc (int); | 30 | extern void errputc (int); |
| 31 | extern void verrprintf (char const *, va_list) ATTRIBUTE_FORMAT_PRINTF (1, 0); | ||
| 32 | extern void errwrite (void const *, ptrdiff_t); | 31 | extern void errwrite (void const *, ptrdiff_t); |
| 33 | extern void close_output_streams (void); | 32 | extern void close_output_streams (void); |
| 34 | 33 | ||