aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2019-08-24 11:42:28 -0700
committerPaul Eggert2019-08-24 15:55:08 -0700
commitb62eac0f870754bc75b1162246f9901a04910044 (patch)
tree4b392cfe5a8c36c6a735fd25228d3622ccbd17b5 /src
parentaa49aa884053d0e8b33efe265f2aade19d1f3f3d (diff)
downloademacs-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.c12
-rw-r--r--src/coding.h4
-rw-r--r--src/data.c2
-rw-r--r--src/fns.c32
-rw-r--r--src/ftfont.c2
-rw-r--r--src/ftfont.h1
-rw-r--r--src/lisp.h1
-rw-r--r--src/sysdep.c6
-rw-r--r--src/sysstdio.h1
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
9621Lisp_Object 9625static Lisp_Object
9622encode_string_utf_8 (Lisp_Object string, Lisp_Object buffer, 9626encode_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
9876Lisp_Object 9880static Lisp_Object
9877decode_string_utf_8 (Lisp_Object string, Lisp_Object buffer, 9881decode_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);
690extern Lisp_Object code_convert_string_norecord (Lisp_Object, Lisp_Object, 690extern Lisp_Object code_convert_string_norecord (Lisp_Object, Lisp_Object,
691 bool); 691 bool);
692extern Lisp_Object encode_string_utf_8 (Lisp_Object, Lisp_Object, bool,
693 Lisp_Object, Lisp_Object);
694extern Lisp_Object decode_string_utf_8 (Lisp_Object, Lisp_Object, bool,
695 Lisp_Object, Lisp_Object);
696extern Lisp_Object encode_file_name (Lisp_Object); 692extern Lisp_Object encode_file_name (Lisp_Object);
697extern Lisp_Object decode_file_name (Lisp_Object); 693extern Lisp_Object decode_file_name (Lisp_Object);
698extern Lisp_Object raw_text_coding_system (Lisp_Object); 694extern 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. */
3082Lisp_Object 3082static Lisp_Object
3083integer_mod (Lisp_Object x, Lisp_Object y) 3083integer_mod (Lisp_Object x, Lisp_Object y)
3084{ 3084{
3085 if (FIXNUMP (x) && FIXNUMP (y)) 3085 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,
3280static ptrdiff_t base64_decode_1 (const char *, char *, ptrdiff_t, bool, 3280static ptrdiff_t base64_decode_1 (const char *, char *, ptrdiff_t, bool,
3281 bool, ptrdiff_t *); 3281 bool, ptrdiff_t *);
3282 3282
3283Lisp_Object base64_encode_region_1 (Lisp_Object, Lisp_Object, bool, 3283static Lisp_Object base64_encode_region_1 (Lisp_Object, Lisp_Object, bool,
3284 bool, bool); 3284 bool, bool);
3285 3285
3286Lisp_Object base64_encode_string_1(Lisp_Object, bool, 3286static Lisp_Object base64_encode_string_1 (Lisp_Object, bool,
3287 bool, bool); 3287 bool, bool);
3288 3288
3289 3289
3290DEFUN ("base64-encode-region", Fbase64_encode_region, Sbase64_encode_region, 3290DEFUN ("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
3295into shorter lines. */) 3295into 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 =.
3308This produces the URL variant of base 64 encoding defined in RFC 4648. */) 3308This 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
3314Lisp_Object 3314static Lisp_Object
3315base64_encode_region_1 (Lisp_Object beg, Lisp_Object end, bool line_break, 3315base64_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
3382DEFUN ("base64url-encode-string", Fbase64url_encode_string, Sbase64url_encode_string, 3382DEFUN ("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.
3385Optional second argument NO-PAD means do not add padding char =. 3385Optional 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
3394Lisp_Object 3394static Lisp_Object
3395base64_encode_string_1(Lisp_Object string, bool line_break, 3395base64_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
436FcCharSet * 436static FcCharSet *
437ftfont_get_fc_charset (Lisp_Object entity) 437ftfont_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
44extern FcCharSet *ftfont_get_fc_charset (Lisp_Object);
45extern void ftfont_fix_match (FcPattern *, FcPattern *); 44extern void ftfont_fix_match (FcPattern *, FcPattern *);
46extern void ftfont_add_rendering_parameters (FcPattern *, Lisp_Object); 45extern void ftfont_add_rendering_parameters (FcPattern *, Lisp_Object);
47extern FcPattern *ftfont_entity_pattern (Lisp_Object, int); 46extern 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,
3615extern Lisp_Object expt_integer (Lisp_Object, Lisp_Object); 3615extern Lisp_Object expt_integer (Lisp_Object, Lisp_Object);
3616extern void syms_of_data (void); 3616extern void syms_of_data (void);
3617extern void swap_in_global_binding (struct Lisp_Symbol *); 3617extern void swap_in_global_binding (struct Lisp_Symbol *);
3618extern Lisp_Object integer_mod (Lisp_Object, Lisp_Object);
3619 3618
3620/* Defined in cmds.c */ 3619/* Defined in cmds.c */
3621extern void syms_of_cmds (void); 3620extern 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
2812void 2812void
2813verrprintf (char const *fmt, va_list ap)
2814{
2815 vfprintf (errstream (), fmt, ap);
2816}
2817
2818void
2819errwrite (void const *buf, ptrdiff_t nbuf) 2813errwrite (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
29extern FILE *emacs_fopen (char const *, char const *); 29extern FILE *emacs_fopen (char const *, char const *);
30extern void errputc (int); 30extern void errputc (int);
31extern void verrprintf (char const *, va_list) ATTRIBUTE_FORMAT_PRINTF (1, 0);
32extern void errwrite (void const *, ptrdiff_t); 31extern void errwrite (void const *, ptrdiff_t);
33extern void close_output_streams (void); 32extern void close_output_streams (void);
34 33