aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorPaul Eggert2013-07-01 17:33:04 -0700
committerPaul Eggert2013-07-01 17:33:04 -0700
commit164b1ba3f311a3c333df8bcbd4ad65ad4ec864b5 (patch)
treef73b477d03f5c8ff86f96d6a27708c17bf7f8b68 /lib-src
parentaaea7495957f5b82fe4e1c8a90a8d96cd77c0001 (diff)
downloademacs-164b1ba3f311a3c333df8bcbd4ad65ad4ec864b5.tar.gz
emacs-164b1ba3f311a3c333df8bcbd4ad65ad4ec864b5.zip
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
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog7
-rw-r--r--lib-src/ebrowse.c2
-rw-r--r--lib-src/etags.c20
-rw-r--r--lib-src/make-docfile.c2
4 files changed, 17 insertions, 14 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index e60b415ae17..00a42ccf49f 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,5 +1,12 @@
12013-06-21 Paul Eggert <eggert@cs.ucla.edu> 12013-06-21 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 Prefer plain 'static' to 'static inline' (Bug#12541).
4 I missed these instances of 'static inline' in an earlier sweep.
5 * ebrowse.c (putstr):
6 * etags.c (hash):
7 * make-docfile.c (put_char): No longer inline.
8 * etags.c (hash): Prefer int to unsigned when either will do.
9
3 Use C99-style flexible array members if available. 10 Use C99-style flexible array members if available.
4 * ebrowse.c: Include <stddef.h>, for offsetof. 11 * ebrowse.c: Include <stddef.h>, for offsetof.
5 (struct member, struct alias, struct sym): 12 (struct member, struct alias, struct sym):
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c
index 2828591ed3f..407f769afc8 100644
--- a/lib-src/ebrowse.c
+++ b/lib-src/ebrowse.c
@@ -1096,7 +1096,7 @@ leave_namespace (void)
1096/* Write string S to the output file FP in a Lisp-readable form. 1096/* Write string S to the output file FP in a Lisp-readable form.
1097 If S is null, write out `()'. */ 1097 If S is null, write out `()'. */
1098 1098
1099static inline void 1099static void
1100putstr (const char *s, FILE *fp) 1100putstr (const char *s, FILE *fp)
1101{ 1101{
1102 if (!s) 1102 if (!s)
diff --git a/lib-src/etags.c b/lib-src/etags.c
index f6b173bf465..aa8c773e357 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -2240,10 +2240,6 @@ enum sym_type
2240 st_C_struct, st_C_extern, st_C_enum, st_C_define, st_C_typedef 2240 st_C_struct, st_C_extern, st_C_enum, st_C_define, st_C_typedef
2241}; 2241};
2242 2242
2243static unsigned int hash (const char *, unsigned int);
2244static struct C_stab_entry * in_word_set (const char *, unsigned int);
2245static enum sym_type C_symtype (char *, int, int);
2246
2247/* Feed stuff between (but not including) %[ and %] lines to: 2243/* Feed stuff between (but not including) %[ and %] lines to:
2248 gperf -m 5 2244 gperf -m 5
2249%[ 2245%[
@@ -2302,10 +2298,10 @@ and replace lines between %< and %> with its output, then:
2302struct C_stab_entry { const char *name; int c_ext; enum sym_type type; }; 2298struct C_stab_entry { const char *name; int c_ext; enum sym_type type; };
2303/* maximum key range = 33, duplicates = 0 */ 2299/* maximum key range = 33, duplicates = 0 */
2304 2300
2305static inline unsigned int 2301static int
2306hash (register const char *str, register unsigned int len) 2302hash (const char *str, int len)
2307{ 2303{
2308 static unsigned char asso_values[] = 2304 static char const asso_values[] =
2309 { 2305 {
2310 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 2306 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
2311 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 2307 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
@@ -2334,15 +2330,15 @@ hash (register const char *str, register unsigned int len)
2334 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 2330 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,
2335 35, 35, 35, 35, 35, 35 2331 35, 35, 35, 35, 35, 35
2336 }; 2332 };
2337 register int hval = len; 2333 int hval = len;
2338 2334
2339 switch (hval) 2335 switch (hval)
2340 { 2336 {
2341 default: 2337 default:
2342 hval += asso_values[(unsigned char)str[2]]; 2338 hval += asso_values[(unsigned char) str[2]];
2343 /*FALLTHROUGH*/ 2339 /*FALLTHROUGH*/
2344 case 2: 2340 case 2:
2345 hval += asso_values[(unsigned char)str[1]]; 2341 hval += asso_values[(unsigned char) str[1]];
2346 break; 2342 break;
2347 } 2343 }
2348 return hval; 2344 return hval;
@@ -2400,11 +2396,11 @@ in_word_set (register const char *str, register unsigned int len)
2400 2396
2401 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) 2397 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
2402 { 2398 {
2403 register int key = hash (str, len); 2399 int key = hash (str, len);
2404 2400
2405 if (key <= MAX_HASH_VALUE && key >= 0) 2401 if (key <= MAX_HASH_VALUE && key >= 0)
2406 { 2402 {
2407 register const char *s = wordlist[key].name; 2403 const char *s = wordlist[key].name;
2408 2404
2409 if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0') 2405 if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
2410 return &wordlist[key]; 2406 return &wordlist[key];
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index 8fa70dd430e..9bc91bc4f77 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -276,7 +276,7 @@ struct rcsoc_state
276/* Output CH to the file or buffer in STATE. Any pending newlines or 276/* Output CH to the file or buffer in STATE. Any pending newlines or
277 spaces are output first. */ 277 spaces are output first. */
278 278
279static inline void 279static void
280put_char (int ch, struct rcsoc_state *state) 280put_char (int ch, struct rcsoc_state *state)
281{ 281{
282 int out_ch; 282 int out_ch;