diff options
| author | Paul Eggert | 2019-12-09 17:30:42 -0800 |
|---|---|---|
| committer | Paul Eggert | 2019-12-09 17:32:07 -0800 |
| commit | 28578f87b52ead4d31479fdcfba028118dfa6987 (patch) | |
| tree | ad5feb4f01d3b7026a50e27ab4182aa3af3a5642 /lib-src | |
| parent | eec809e98361eec5053ed6c6dd6f3a1a27ef2b6e (diff) | |
| download | emacs-28578f87b52ead4d31479fdcfba028118dfa6987.tar.gz emacs-28578f87b52ead4d31479fdcfba028118dfa6987.zip | |
Prefer static to extern in ebrowse
* lib-src/ebrowse.c (info_where, info_cls, info_member)
(info_position, options, yyival, yytext, yytext_end, yyout)
(yyline, filename, is_ident, is_digit, is_white, f_append)
(f_verbose, f_very_verbose, f_structs, f_regexps)
(f_nested_classes, min_regexp, max_regexp, inbuffer, in)
(inbuffer_size, string_start, class_table, member_table)
(namespace_alias_table, global_symbols, current_namespace)
(all_namespaces, namespace_stack, namespace_stack_size)
(namespace_sp, tk, keyword_table, search_path)
(search_path_tail, scope_buffer, scope_buffer_size)
(scope_buffer_len): Now static.
(options): Now const.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ebrowse.c | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c index aaa0893ea44..9ac5412650c 100644 --- a/lib-src/ebrowse.c +++ b/lib-src/ebrowse.c | |||
| @@ -306,19 +306,19 @@ struct sym | |||
| 306 | #define P_DEFN 1 | 306 | #define P_DEFN 1 |
| 307 | #define P_DECL 2 | 307 | #define P_DECL 2 |
| 308 | 308 | ||
| 309 | int info_where; | 309 | static int info_where; |
| 310 | struct sym *info_cls = NULL; | 310 | static struct sym *info_cls = NULL; |
| 311 | struct member *info_member = NULL; | 311 | static struct member *info_member = NULL; |
| 312 | 312 | ||
| 313 | /* Experimental. For option `--position-info', the buffer position we | 313 | /* Experimental. For option `--position-info', the buffer position we |
| 314 | are interested in. When this position is reached, print out | 314 | are interested in. When this position is reached, print out |
| 315 | information about what we know about that point. */ | 315 | information about what we know about that point. */ |
| 316 | 316 | ||
| 317 | int info_position = -1; | 317 | static int info_position = -1; |
| 318 | 318 | ||
| 319 | /* Command line options structure for getopt_long. */ | 319 | /* Command line options structure for getopt_long. */ |
| 320 | 320 | ||
| 321 | struct option options[] = | 321 | static struct option const options[] = |
| 322 | { | 322 | { |
| 323 | {"append", no_argument, NULL, 'a'}, | 323 | {"append", no_argument, NULL, 'a'}, |
| 324 | {"files", required_argument, NULL, 'f'}, | 324 | {"files", required_argument, NULL, 'f'}, |
| @@ -339,28 +339,28 @@ struct option options[] = | |||
| 339 | 339 | ||
| 340 | /* Semantic values of tokens. Set by yylex.. */ | 340 | /* Semantic values of tokens. Set by yylex.. */ |
| 341 | 341 | ||
| 342 | unsigned yyival; /* Set for token CINT. */ | 342 | static unsigned yyival; /* Set for token CINT. */ |
| 343 | char *yytext; /* Set for token IDENT. */ | 343 | static char *yytext; /* Set for token IDENT. */ |
| 344 | char *yytext_end; | 344 | static char *yytext_end; |
| 345 | 345 | ||
| 346 | /* Output file. */ | 346 | /* Output file. */ |
| 347 | 347 | ||
| 348 | FILE *yyout; | 348 | static FILE *yyout; |
| 349 | 349 | ||
| 350 | /* Current line number. */ | 350 | /* Current line number. */ |
| 351 | 351 | ||
| 352 | int yyline; | 352 | static int yyline; |
| 353 | 353 | ||
| 354 | /* The name of the current input file. */ | 354 | /* The name of the current input file. */ |
| 355 | 355 | ||
| 356 | const char *filename; | 356 | static const char *filename; |
| 357 | 357 | ||
| 358 | /* Three character class vectors, and macros to test membership | 358 | /* Three character class vectors, and macros to test membership |
| 359 | of characters. */ | 359 | of characters. */ |
| 360 | 360 | ||
| 361 | char is_ident[255]; | 361 | static char is_ident[255]; |
| 362 | char is_digit[255]; | 362 | static char is_digit[255]; |
| 363 | char is_white[255]; | 363 | static char is_white[255]; |
| 364 | 364 | ||
| 365 | #define IDENTP(C) is_ident[(unsigned char) (C)] | 365 | #define IDENTP(C) is_ident[(unsigned char) (C)] |
| 366 | #define DIGITP(C) is_digit[(unsigned char) (C)] | 366 | #define DIGITP(C) is_digit[(unsigned char) (C)] |
| @@ -368,25 +368,25 @@ char is_white[255]; | |||
| 368 | 368 | ||
| 369 | /* Command line flags. */ | 369 | /* Command line flags. */ |
| 370 | 370 | ||
| 371 | int f_append; | 371 | static int f_append; |
| 372 | int f_verbose; | 372 | static int f_verbose; |
| 373 | int f_very_verbose; | 373 | static int f_very_verbose; |
| 374 | int f_structs = 1; | 374 | static int f_structs = 1; |
| 375 | int f_regexps = 1; | 375 | static int f_regexps = 1; |
| 376 | int f_nested_classes = 1; | 376 | static int f_nested_classes = 1; |
| 377 | 377 | ||
| 378 | /* Maximum and minimum lengths of regular expressions matching a | 378 | /* Maximum and minimum lengths of regular expressions matching a |
| 379 | member, class etc., for writing them to the output file. These are | 379 | member, class etc., for writing them to the output file. These are |
| 380 | overridable from the command line. */ | 380 | overridable from the command line. */ |
| 381 | 381 | ||
| 382 | int min_regexp = 5; | 382 | static int min_regexp = 5; |
| 383 | int max_regexp = 50; | 383 | static int max_regexp = 50; |
| 384 | 384 | ||
| 385 | /* Input buffer. */ | 385 | /* Input buffer. */ |
| 386 | 386 | ||
| 387 | char *inbuffer; | 387 | static char *inbuffer; |
| 388 | char *in; | 388 | static char *in; |
| 389 | size_t inbuffer_size; | 389 | static size_t inbuffer_size; |
| 390 | 390 | ||
| 391 | /* Return the current buffer position in the input file. */ | 391 | /* Return the current buffer position in the input file. */ |
| 392 | 392 | ||
| @@ -396,7 +396,7 @@ size_t inbuffer_size; | |||
| 396 | first character in the string constant. Used for recognizing | 396 | first character in the string constant. Used for recognizing |
| 397 | extern "C". */ | 397 | extern "C". */ |
| 398 | 398 | ||
| 399 | char *string_start; | 399 | static char *string_start; |
| 400 | 400 | ||
| 401 | /* The size of the hash tables for classes.and members. Should be | 401 | /* The size of the hash tables for classes.and members. Should be |
| 402 | prime. */ | 402 | prime. */ |
| @@ -405,40 +405,40 @@ char *string_start; | |||
| 405 | 405 | ||
| 406 | /* The hash table for class symbols. */ | 406 | /* The hash table for class symbols. */ |
| 407 | 407 | ||
| 408 | struct sym *class_table[TABLE_SIZE]; | 408 | static struct sym *class_table[TABLE_SIZE]; |
| 409 | 409 | ||
| 410 | /* Hash table containing all member structures. This is generally | 410 | /* Hash table containing all member structures. This is generally |
| 411 | faster for member lookup than traversing the member lists of a | 411 | faster for member lookup than traversing the member lists of a |
| 412 | `struct sym'. */ | 412 | `struct sym'. */ |
| 413 | 413 | ||
| 414 | struct member *member_table[TABLE_SIZE]; | 414 | static struct member *member_table[TABLE_SIZE]; |
| 415 | 415 | ||
| 416 | /* Hash table for namespace aliases */ | 416 | /* Hash table for namespace aliases */ |
| 417 | 417 | ||
| 418 | struct alias *namespace_alias_table[TABLE_SIZE]; | 418 | static struct alias *namespace_alias_table[TABLE_SIZE]; |
| 419 | 419 | ||
| 420 | /* The special class symbol used to hold global functions, | 420 | /* The special class symbol used to hold global functions, |
| 421 | variables etc. */ | 421 | variables etc. */ |
| 422 | 422 | ||
| 423 | struct sym *global_symbols; | 423 | static struct sym *global_symbols; |
| 424 | 424 | ||
| 425 | /* The current namespace. */ | 425 | /* The current namespace. */ |
| 426 | 426 | ||
| 427 | struct sym *current_namespace; | 427 | static struct sym *current_namespace; |
| 428 | 428 | ||
| 429 | /* The list of all known namespaces. */ | 429 | /* The list of all known namespaces. */ |
| 430 | 430 | ||
| 431 | struct sym *all_namespaces; | 431 | static struct sym *all_namespaces; |
| 432 | 432 | ||
| 433 | /* Stack of namespaces we're currently nested in, during the parse. */ | 433 | /* Stack of namespaces we're currently nested in, during the parse. */ |
| 434 | 434 | ||
| 435 | struct sym **namespace_stack; | 435 | static struct sym **namespace_stack; |
| 436 | int namespace_stack_size; | 436 | static int namespace_stack_size; |
| 437 | int namespace_sp; | 437 | static int namespace_sp; |
| 438 | 438 | ||
| 439 | /* The current lookahead token. */ | 439 | /* The current lookahead token. */ |
| 440 | 440 | ||
| 441 | int tk = -1; | 441 | static int tk = -1; |
| 442 | 442 | ||
| 443 | /* Structure describing a keyword. */ | 443 | /* Structure describing a keyword. */ |
| 444 | 444 | ||
| @@ -452,7 +452,7 @@ struct kw | |||
| 452 | /* Keywords are lookup up in a hash table of their own. */ | 452 | /* Keywords are lookup up in a hash table of their own. */ |
| 453 | 453 | ||
| 454 | #define KEYWORD_TABLE_SIZE 1001 | 454 | #define KEYWORD_TABLE_SIZE 1001 |
| 455 | struct kw *keyword_table[KEYWORD_TABLE_SIZE]; | 455 | static struct kw *keyword_table[KEYWORD_TABLE_SIZE]; |
| 456 | 456 | ||
| 457 | /* Search path. */ | 457 | /* Search path. */ |
| 458 | 458 | ||
| @@ -462,8 +462,8 @@ struct search_path | |||
| 462 | struct search_path *next; | 462 | struct search_path *next; |
| 463 | }; | 463 | }; |
| 464 | 464 | ||
| 465 | struct search_path *search_path; | 465 | static struct search_path *search_path; |
| 466 | struct search_path *search_path_tail; | 466 | static struct search_path *search_path_tail; |
| 467 | 467 | ||
| 468 | /* Function prototypes. */ | 468 | /* Function prototypes. */ |
| 469 | 469 | ||
| @@ -1132,9 +1132,9 @@ putstr (const char *s, FILE *fp) | |||
| 1132 | 1132 | ||
| 1133 | /* A dynamically allocated buffer for constructing a scope name. */ | 1133 | /* A dynamically allocated buffer for constructing a scope name. */ |
| 1134 | 1134 | ||
| 1135 | char *scope_buffer; | 1135 | static char *scope_buffer; |
| 1136 | int scope_buffer_size; | 1136 | static int scope_buffer_size; |
| 1137 | int scope_buffer_len; | 1137 | static int scope_buffer_len; |
| 1138 | 1138 | ||
| 1139 | 1139 | ||
| 1140 | /* Make sure scope_buffer has enough room to add LEN chars to it. */ | 1140 | /* Make sure scope_buffer has enough room to add LEN chars to it. */ |