Commit 164b1ba3 authored by Paul Eggert's avatar Paul Eggert

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
parent aaea7495
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):
......
......@@ -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)
......
......@@ -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];
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment