diff options
Diffstat (limited to 'lib-src/ebrowse.c')
| -rw-r--r-- | lib-src/ebrowse.c | 71 |
1 files changed, 37 insertions, 34 deletions
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c index f2894d5a0c2..113b6fdfe40 100644 --- a/lib-src/ebrowse.c +++ b/lib-src/ebrowse.c | |||
| @@ -77,7 +77,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 77 | #define TREE_HEADER_STRUCT "[ebrowse-hs " | 77 | #define TREE_HEADER_STRUCT "[ebrowse-hs " |
| 78 | #define TREE_STRUCT "[ebrowse-ts " | 78 | #define TREE_STRUCT "[ebrowse-ts " |
| 79 | #define MEMBER_STRUCT "[ebrowse-ms " | 79 | #define MEMBER_STRUCT "[ebrowse-ms " |
| 80 | #define BROWSE_STRUCT "[ebrowse-bs " | ||
| 81 | #define CLASS_STRUCT "[ebrowse-cs " | 80 | #define CLASS_STRUCT "[ebrowse-cs " |
| 82 | 81 | ||
| 83 | /* The name of the symbol table entry for global functions, variables, | 82 | /* The name of the symbol table entry for global functions, variables, |
| @@ -1108,22 +1107,23 @@ leave_namespace (void) | |||
| 1108 | /* Write string S to the output file FP in a Lisp-readable form. | 1107 | /* Write string S to the output file FP in a Lisp-readable form. |
| 1109 | If S is null, write out `()'. */ | 1108 | If S is null, write out `()'. */ |
| 1110 | 1109 | ||
| 1111 | #define PUTSTR(s, fp) \ | 1110 | static inline void |
| 1112 | do { \ | 1111 | putstr (const char *s, FILE *fp) |
| 1113 | if (!s) \ | 1112 | { |
| 1114 | { \ | 1113 | if (!s) |
| 1115 | putc ('(', fp); \ | 1114 | { |
| 1116 | putc (')', fp); \ | 1115 | putc ('(', fp); |
| 1117 | putc (' ', fp); \ | 1116 | putc (')', fp); |
| 1118 | } \ | 1117 | putc (' ', fp); |
| 1119 | else \ | 1118 | } |
| 1120 | { \ | 1119 | else |
| 1121 | putc ('"', fp); \ | 1120 | { |
| 1122 | fputs (s, fp); \ | 1121 | putc ('"', fp); |
| 1123 | putc ('"', fp); \ | 1122 | fputs (s, fp); |
| 1124 | putc (' ', fp); \ | 1123 | putc ('"', fp); |
| 1125 | } \ | 1124 | putc (' ', fp); |
| 1126 | } while (0) | 1125 | } |
| 1126 | } | ||
| 1127 | 1127 | ||
| 1128 | /* A dynamically allocated buffer for constructing a scope name. */ | 1128 | /* A dynamically allocated buffer for constructing a scope name. */ |
| 1129 | 1129 | ||
| @@ -1216,16 +1216,16 @@ dump_members (FILE *fp, struct member *m) | |||
| 1216 | for (n = 0; m; m = m->next, ++n) | 1216 | for (n = 0; m; m = m->next, ++n) |
| 1217 | { | 1217 | { |
| 1218 | fputs (MEMBER_STRUCT, fp); | 1218 | fputs (MEMBER_STRUCT, fp); |
| 1219 | PUTSTR (m->name, fp); | 1219 | putstr (m->name, fp); |
| 1220 | PUTSTR (NULL, fp); /* FIXME? scope for globals */ | 1220 | putstr (NULL, fp); /* FIXME? scope for globals */ |
| 1221 | fprintf (fp, "%u ", (unsigned) m->flags); | 1221 | fprintf (fp, "%u ", (unsigned) m->flags); |
| 1222 | PUTSTR (m->filename, fp); | 1222 | putstr (m->filename, fp); |
| 1223 | PUTSTR (m->regexp, fp); | 1223 | putstr (m->regexp, fp); |
| 1224 | fprintf (fp, "%u ", (unsigned) m->pos); | 1224 | fprintf (fp, "%u ", (unsigned) m->pos); |
| 1225 | fprintf (fp, "%u ", (unsigned) m->vis); | 1225 | fprintf (fp, "%u ", (unsigned) m->vis); |
| 1226 | putc (' ', fp); | 1226 | putc (' ', fp); |
| 1227 | PUTSTR (m->def_filename, fp); | 1227 | putstr (m->def_filename, fp); |
| 1228 | PUTSTR (m->def_regexp, fp); | 1228 | putstr (m->def_regexp, fp); |
| 1229 | fprintf (fp, "%u", (unsigned) m->def_pos); | 1229 | fprintf (fp, "%u", (unsigned) m->def_pos); |
| 1230 | putc (']', fp); | 1230 | putc (']', fp); |
| 1231 | putc ('\n', fp); | 1231 | putc ('\n', fp); |
| @@ -1243,20 +1243,20 @@ static void | |||
| 1243 | dump_sym (FILE *fp, struct sym *root) | 1243 | dump_sym (FILE *fp, struct sym *root) |
| 1244 | { | 1244 | { |
| 1245 | fputs (CLASS_STRUCT, fp); | 1245 | fputs (CLASS_STRUCT, fp); |
| 1246 | PUTSTR (root->name, fp); | 1246 | putstr (root->name, fp); |
| 1247 | 1247 | ||
| 1248 | /* Print scope, if any. */ | 1248 | /* Print scope, if any. */ |
| 1249 | if (root->namesp) | 1249 | if (root->namesp) |
| 1250 | PUTSTR (sym_scope (root), fp); | 1250 | putstr (sym_scope (root), fp); |
| 1251 | else | 1251 | else |
| 1252 | PUTSTR (NULL, fp); | 1252 | putstr (NULL, fp); |
| 1253 | 1253 | ||
| 1254 | /* Print flags. */ | 1254 | /* Print flags. */ |
| 1255 | fprintf (fp, "%u", root->flags); | 1255 | fprintf (fp, "%u", root->flags); |
| 1256 | PUTSTR (root->filename, fp); | 1256 | putstr (root->filename, fp); |
| 1257 | PUTSTR (root->regexp, fp); | 1257 | putstr (root->regexp, fp); |
| 1258 | fprintf (fp, "%u", (unsigned) root->pos); | 1258 | fprintf (fp, "%u", (unsigned) root->pos); |
| 1259 | PUTSTR (root->sfilename, fp); | 1259 | putstr (root->sfilename, fp); |
| 1260 | putc (']', fp); | 1260 | putc (']', fp); |
| 1261 | putc ('\n', fp); | 1261 | putc ('\n', fp); |
| 1262 | } | 1262 | } |
| @@ -1323,7 +1323,7 @@ dump_roots (FILE *fp) | |||
| 1323 | if (!f_append) | 1323 | if (!f_append) |
| 1324 | { | 1324 | { |
| 1325 | fputs (TREE_HEADER_STRUCT, fp); | 1325 | fputs (TREE_HEADER_STRUCT, fp); |
| 1326 | PUTSTR (EBROWSE_FILE_VERSION, fp); | 1326 | putstr (EBROWSE_FILE_VERSION, fp); |
| 1327 | 1327 | ||
| 1328 | putc ('\"', fp); | 1328 | putc ('\"', fp); |
| 1329 | if (!f_structs) | 1329 | if (!f_structs) |
| @@ -2062,11 +2062,11 @@ re_init_scanner (void) | |||
| 2062 | } | 2062 | } |
| 2063 | 2063 | ||
| 2064 | 2064 | ||
| 2065 | /* Insert a keyword NAME with token value TK into the keyword hash | 2065 | /* Insert a keyword NAME with token value TKV into the keyword hash |
| 2066 | table. */ | 2066 | table. */ |
| 2067 | 2067 | ||
| 2068 | static void | 2068 | static void |
| 2069 | insert_keyword (const char *name, int tk) | 2069 | insert_keyword (const char *name, int tkv) |
| 2070 | { | 2070 | { |
| 2071 | const char *s; | 2071 | const char *s; |
| 2072 | unsigned h = 0; | 2072 | unsigned h = 0; |
| @@ -2077,7 +2077,7 @@ insert_keyword (const char *name, int tk) | |||
| 2077 | 2077 | ||
| 2078 | h %= KEYWORD_TABLE_SIZE; | 2078 | h %= KEYWORD_TABLE_SIZE; |
| 2079 | k->name = name; | 2079 | k->name = name; |
| 2080 | k->tk = tk; | 2080 | k->tk = tkv; |
| 2081 | k->next = keyword_table[h]; | 2081 | k->next = keyword_table[h]; |
| 2082 | keyword_table[h] = k; | 2082 | keyword_table[h] = k; |
| 2083 | } | 2083 | } |
| @@ -2951,7 +2951,9 @@ parse_qualified_param_ident_or_type (char **last_id) | |||
| 2951 | static char *id = NULL; | 2951 | static char *id = NULL; |
| 2952 | static int id_size = 0; | 2952 | static int id_size = 0; |
| 2953 | 2953 | ||
| 2954 | while (LOOKING_AT (IDENT)) | 2954 | assert (LOOKING_AT (IDENT)); |
| 2955 | |||
| 2956 | do | ||
| 2955 | { | 2957 | { |
| 2956 | int len = strlen (yytext) + 1; | 2958 | int len = strlen (yytext) + 1; |
| 2957 | if (len > id_size) | 2959 | if (len > id_size) |
| @@ -2974,6 +2976,7 @@ parse_qualified_param_ident_or_type (char **last_id) | |||
| 2974 | else | 2976 | else |
| 2975 | break; | 2977 | break; |
| 2976 | } | 2978 | } |
| 2979 | while (LOOKING_AT (IDENT)); | ||
| 2977 | } | 2980 | } |
| 2978 | 2981 | ||
| 2979 | 2982 | ||