From: Paul Eggert Date: Tue, 2 Jul 2013 00:33:04 +0000 (-0700) Subject: Prefer plain 'static' to 'static inline'. X-Git-Url: http://git.hcoop.net/bpt/emacs.git/commitdiff_plain/164b1ba3f311a3c333df8bcbd4ad65ad4ec864b5 Prefer plain 'static' to 'static inline'. 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 --- diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index e60b415ae1..00a42ccf49 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,5 +1,12 @@ 2013-06-21 Paul Eggert + 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 , for offsetof. (struct member, struct alias, struct sym): diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c index 2828591ed3..407f769afc 100644 --- a/lib-src/ebrowse.c +++ b/lib-src/ebrowse.c @@ -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) diff --git a/lib-src/etags.c b/lib-src/etags.c index f6b173bf46..aa8c773e35 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -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]; diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index 8fa70dd430..9bc91bc4f7 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -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;