Prefer plain 'static' to 'static inline'.
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 2 Jul 2013 00:33:04 +0000 (17:33 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 2 Jul 2013 00:33:04 +0000 (17:33 -0700)
I missed these instances of 'static inline' in an earlier sweep.
* ebrowse.c (putstr):
* etags.c (hash):
* make-docfile.c (put_char): No longer inline.
* etags.c (hash): Prefer int to unsigned when either will do.

Fixes: debbugs:12541

lib-src/ChangeLog
lib-src/ebrowse.c
lib-src/etags.c
lib-src/make-docfile.c

index e60b415..00a42cc 100644 (file)
@@ -1,5 +1,12 @@
 2013-06-21  Paul Eggert  <eggert@cs.ucla.edu>
 
+       Prefer plain 'static' to 'static inline' (Bug#12541).
+       I missed these instances of 'static inline' in an earlier sweep.
+       * ebrowse.c (putstr):
+       * etags.c (hash):
+       * make-docfile.c (put_char): No longer inline.
+       * etags.c (hash): Prefer int to unsigned when either will do.
+
        Use C99-style flexible array members if available.
        * ebrowse.c: Include <stddef.h>, for offsetof.
        (struct member, struct alias, struct sym):
index 2828591..407f769 100644 (file)
@@ -1096,7 +1096,7 @@ leave_namespace (void)
 /* Write string S to the output file FP in a Lisp-readable form.
    If S is null, write out `()'.  */
 
-static inline void
+static void
 putstr (const char *s, FILE *fp)
 {
   if (!s)
index f6b173b..aa8c773 100644 (file)
@@ -2240,10 +2240,6 @@ enum sym_type
   st_C_struct, st_C_extern, st_C_enum, st_C_define, st_C_typedef
 };
 
-static unsigned int hash (const char *, unsigned int);
-static struct C_stab_entry * in_word_set (const char *, unsigned int);
-static enum sym_type C_symtype (char *, int, int);
-
 /* Feed stuff between (but not including) %[ and %] lines to:
      gperf -m 5
 %[
@@ -2302,10 +2298,10 @@ and replace lines between %< and %> with its output, then:
 struct C_stab_entry { const char *name; int c_ext; enum sym_type type; };
 /* maximum key range = 33, duplicates = 0 */
 
-static inline unsigned int
-hash (register const char *str, register unsigned int len)
+static int
+hash (const char *str, int len)
 {
-  static unsigned char asso_values[] =
+  static char const asso_values[] =
     {
       35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
       35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
@@ -2334,15 +2330,15 @@ hash (register const char *str, register unsigned int len)
       35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
       35, 35, 35, 35, 35, 35
     };
-  register int hval = len;
+  int hval = len;
 
   switch (hval)
     {
       default:
-        hval += asso_values[(unsigned char)str[2]];
+        hval += asso_values[(unsigned char) str[2]];
       /*FALLTHROUGH*/
       case 2:
-        hval += asso_values[(unsigned char)str[1]];
+        hval += asso_values[(unsigned char) str[1]];
         break;
     }
   return hval;
@@ -2400,11 +2396,11 @@ in_word_set (register const char *str, register unsigned int len)
 
   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
     {
-      register int key = hash (str, len);
+      int key = hash (str, len);
 
       if (key <= MAX_HASH_VALUE && key >= 0)
         {
-          register const char *s = wordlist[key].name;
+          const char *s = wordlist[key].name;
 
           if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
             return &wordlist[key];
index 8fa70dd..9bc91bc 100644 (file)
@@ -276,7 +276,7 @@ struct rcsoc_state
 /* Output CH to the file or buffer in STATE.  Any pending newlines or
    spaces are output first.  */
 
-static inline void
+static void
 put_char (int ch, struct rcsoc_state *state)
 {
   int out_ch;