X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/929aeac608c271b2448dffec29aeea85c69d6bff..d350e350eaf4872d123e0ab873c4a095099013c9:/lib-src/etags.c?ds=sidebyside diff --git a/lib-src/etags.c b/lib-src/etags.c index ec96f45fc9..aa8c773e35 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -1,4 +1,4 @@ -/* Tags file maker to go with GNU Emacs -*- coding: latin-1 -*- +/* Tags file maker to go with GNU Emacs -*- coding: utf-8 -*- Copyright (C) 1984 The Regents of the University of California @@ -64,12 +64,12 @@ University of California, as described above. */ * 1985 Emacs TAGS format by Richard Stallman. * 1989 Sam Kendall added C++. * 1992 Joseph B. Wells improved C and C++ parsing. - * 1993 Francesco Potortì reorganized C and C++. + * 1993 Francesco Potortì reorganized C and C++. * 1994 Line-by-line regexp tags by Tom Tromey. - * 2001 Nested classes by Francesco Potortì (concept by Mykola Dzyuba). - * 2002 #line directives by Francesco Potortì. + * 2001 Nested classes by Francesco Potortì (concept by Mykola Dzyuba). + * 2002 #line directives by Francesco Potortì. * - * Francesco Potortì has maintained and improved it since 1993. + * Francesco Potortì has maintained and improved it since 1993. */ /* @@ -316,15 +316,7 @@ static void Texinfo_nodes (FILE *); static void Yacc_entries (FILE *); static void just_read_file (FILE *); -static void print_language_names (void); -static void print_version (void); -static void print_help (argument *); -int main (int, char **); - -static compressor *get_compressor_from_suffix (char *, char **); static language *get_language_from_langname (const char *); -static language *get_language_from_interpreter (char *); -static language *get_language_from_filename (char *, bool); static void readline (linebuffer *, FILE *); static long readline_internal (linebuffer *, FILE *); static bool nocase_tail (const char *); @@ -346,7 +338,6 @@ static void find_entries (FILE *); static void free_tree (node *); static void free_fdesc (fdesc *); static void pfnote (char *, bool, char *, int, int, long); -static void make_tag (const char *, int, bool, char *, int, int, long); static void invalidate_nodes (fdesc *, node **); static void put_entries (node *); @@ -816,7 +807,7 @@ etags --help --lang=ada."); #ifndef VERSION # define VERSION "17.38.1.4" #endif -static void +static _Noreturn void print_version (void) { char emacs_copyright[] = COPYRIGHT; @@ -832,7 +823,7 @@ print_version (void) # define PRINT_UNDOCUMENTED_OPTIONS_HELP FALSE #endif -static void +static _Noreturn void print_help (argument *argbuffer) { bool help_for_lang = FALSE; @@ -2249,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 %[ @@ -2311,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, @@ -2343,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; @@ -2409,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]; @@ -4275,7 +4262,7 @@ Asm_labels (FILE *inf) * Perl variable names: /^(my|local).../ * Original code by Bart Robinson (1995) * Additions by Michael Ernst (1997) - * Ideas by Kai Großjohann (2001) + * Ideas by Kai Großjohann (2001) */ static void Perl_functions (FILE *inf) @@ -5105,7 +5092,7 @@ Texinfo_nodes (FILE *inf) * Contents of , <h1>, <h2>, <h3> are tags. * Contents of <a name=xxx> are tags with name xxx. * - * Francesco Potortì, 2002. + * Francesco Potortì, 2002. */ static void HTML_labels (FILE *inf) @@ -5628,10 +5615,7 @@ analyse_regex (char *regex_arg) /* regexfile is a file containing regexps, one per line. */ regexfp = fopen (regexfile, "r"); if (regexfp == NULL) - { - pfatal (regexfile); - return; - } + pfatal (regexfile); linebuffer_init (®exbuf); while (readline_internal (®exbuf, regexfp) > 0) analyse_regex (regexbuf.buffer);