diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-08-24 11:42:28 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-08-24 15:55:08 -0700 |
commit | b62eac0f870754bc75b1162246f9901a04910044 (patch) | |
tree | 4b392cfe5a8c36c6a735fd25228d3622ccbd17b5 | |
parent | aa49aa884053d0e8b33efe265f2aade19d1f3f3d (diff) | |
download | emacs-b62eac0f870754bc75b1162246f9901a04910044.tar.gz |
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.
-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, } +/* #define ENABLE_UTF_8_CONVERTER_TEST */ + +#ifdef ENABLE_UTF_8_CONVERTER_TEST + /* Return the gap address of BUFFER. If the gap size is less than NBYTES, enlarge the gap in advance. */ @@ -9618,7 +9622,7 @@ get_char_bytes (int c, int *len) If the two arguments are Qnil, return Qnil if STRING has a non-Unicode character. */ -Lisp_Object +static Lisp_Object encode_string_utf_8 (Lisp_Object string, Lisp_Object buffer, bool nocopy, Lisp_Object handle_8_bit, Lisp_Object handle_over_uni) @@ -9873,7 +9877,7 @@ encode_string_utf_8 (Lisp_Object string, Lisp_Object buffer, If the two arguments are Qnil, return Qnil if STRING has an invalid sequence. */ -Lisp_Object +static Lisp_Object decode_string_utf_8 (Lisp_Object string, Lisp_Object buffer, bool nocopy, Lisp_Object handle_8_bit, Lisp_Object handle_over_uni) @@ -10111,10 +10115,6 @@ decode_string_utf_8 (Lisp_Object string, Lisp_Object buffer, return val; } -/* #define ENABLE_UTF_8_CONVERTER_TEST */ - -#ifdef ENABLE_UTF_8_CONVERTER_TEST - /* These functions are useful for testing and benchmarking encode_string_utf_8 and decode_string_utf_8. */ 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, Lisp_Object, bool, bool, bool); extern Lisp_Object code_convert_string_norecord (Lisp_Object, Lisp_Object, bool); -extern Lisp_Object encode_string_utf_8 (Lisp_Object, Lisp_Object, bool, - Lisp_Object, Lisp_Object); -extern Lisp_Object decode_string_utf_8 (Lisp_Object, Lisp_Object, bool, - Lisp_Object, Lisp_Object); extern Lisp_Object encode_file_name (Lisp_Object); extern Lisp_Object decode_file_name (Lisp_Object); 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. */) } /* Return X mod Y. Both must be integers and Y must be nonzero. */ -Lisp_Object +static Lisp_Object integer_mod (Lisp_Object x, Lisp_Object y) { if (FIXNUMP (x) && FIXNUMP (y)) diff --git a/src/fns.c b/src/fns.c index 4fb33500bf5..df921e28f3b 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3280,11 +3280,11 @@ static ptrdiff_t base64_encode_1 (const char *, char *, ptrdiff_t, bool, bool, static ptrdiff_t base64_decode_1 (const char *, char *, ptrdiff_t, bool, bool, ptrdiff_t *); -Lisp_Object base64_encode_region_1 (Lisp_Object, Lisp_Object, bool, - bool, bool); +static Lisp_Object base64_encode_region_1 (Lisp_Object, Lisp_Object, bool, + bool, bool); -Lisp_Object base64_encode_string_1(Lisp_Object, bool, - bool, bool); +static Lisp_Object base64_encode_string_1 (Lisp_Object, bool, + bool, bool); 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 into shorter lines. */) (Lisp_Object beg, Lisp_Object end, Lisp_Object no_line_break) { - return base64_encode_region_1(beg, end, NILP (no_line_break), true, false); + return base64_encode_region_1 (beg, end, NILP (no_line_break), true, false); } @@ -3308,10 +3308,10 @@ Optional second argument NO-PAD means do not add padding char =. This produces the URL variant of base 64 encoding defined in RFC 4648. */) (Lisp_Object beg, Lisp_Object end, Lisp_Object no_pad) { - return base64_encode_region_1(beg, end, false, NILP(no_pad), true); + return base64_encode_region_1 (beg, end, false, NILP(no_pad), true); } -Lisp_Object +static Lisp_Object base64_encode_region_1 (Lisp_Object beg, Lisp_Object end, bool line_break, bool pad, bool base64url) { @@ -3376,11 +3376,11 @@ into shorter lines. */) (Lisp_Object string, Lisp_Object no_line_break) { - return base64_encode_string_1(string, NILP (no_line_break), true, false); + return base64_encode_string_1 (string, NILP (no_line_break), true, false); } -DEFUN ("base64url-encode-string", Fbase64url_encode_string, Sbase64url_encode_string, - 1, 2, 0, +DEFUN ("base64url-encode-string", Fbase64url_encode_string, + Sbase64url_encode_string, 1, 2, 0, doc: /* Base64url-encode STRING and return the result. Optional second argument NO-PAD means do not add padding char =. @@ -3388,12 +3388,12 @@ This produces the URL variant of base 64 encoding defined in RFC 4648. */) (Lisp_Object string, Lisp_Object no_pad) { - return base64_encode_string_1(string, false, NILP(no_pad), true); + return base64_encode_string_1 (string, false, NILP(no_pad), true); } -Lisp_Object -base64_encode_string_1(Lisp_Object string, bool line_break, - bool pad, bool base64url) +static Lisp_Object +base64_encode_string_1 (Lisp_Object string, bool line_break, + bool pad, bool base64url) { ptrdiff_t allength, length, encoded_length; char *encoded; @@ -3510,9 +3510,7 @@ base64_encode_1 (const char *from, char *to, ptrdiff_t length, { *e++ = b64_value_to_char[value]; if (pad) - { - *e++ = '='; - } + *e++ = '='; break; } 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) return cache; } -FcCharSet * +static FcCharSet * ftfont_get_fc_charset (Lisp_Object entity) { 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/>. */ #endif /* HAVE_M17N_FLT */ #endif /* HAVE_LIBOTF */ -extern FcCharSet *ftfont_get_fc_charset (Lisp_Object); extern void ftfont_fix_match (FcPattern *, FcPattern *); extern void ftfont_add_rendering_parameters (FcPattern *, Lisp_Object); 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, extern Lisp_Object expt_integer (Lisp_Object, Lisp_Object); extern void syms_of_data (void); extern void swap_in_global_binding (struct Lisp_Symbol *); -extern Lisp_Object integer_mod (Lisp_Object, Lisp_Object); /* Defined in cmds.c */ 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) } void -verrprintf (char const *fmt, va_list ap) -{ - vfprintf (errstream (), fmt, ap); -} - -void errwrite (void const *buf, ptrdiff_t nbuf) { 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/>. */ extern FILE *emacs_fopen (char const *, char const *); extern void errputc (int); -extern void verrprintf (char const *, va_list) ATTRIBUTE_FORMAT_PRINTF (1, 0); extern void errwrite (void const *, ptrdiff_t); extern void close_output_streams (void); |