emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master b62eac0 1/5: extern function cleanup


From: Paul Eggert
Subject: [Emacs-diffs] master b62eac0 1/5: extern function cleanup
Date: Sat, 24 Aug 2019 18:55:17 -0400 (EDT)

branch: master
commit b62eac0f870754bc75b1162246f9901a04910044
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    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.
---
 src/coding.c   | 12 ++++++------
 src/coding.h   |  4 ----
 src/data.c     |  2 +-
 src/fns.c      | 32 +++++++++++++++-----------------
 src/ftfont.c   |  2 +-
 src/ftfont.h   |  1 -
 src/lisp.h     |  1 -
 src/sysdep.c   |  6 ------
 src/sysstdio.h |  1 -
 9 files changed, 23 insertions(+), 38 deletions(-)

diff --git a/src/coding.c b/src/coding.c
index 2ddd34e..1c64758 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 8efddbf..70690d4 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 2797adf..3896835 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 4fb3350..df921e2 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 16b18de..77a4cf5 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 b2280e9..f771dc1 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 ae5a81e..a7b19ab 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 f747825..aa18ee2 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 f402bd6..1e1180a 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);
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]