aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2019-12-09 17:30:42 -0800
committerPaul Eggert2019-12-09 17:32:07 -0800
commit28578f87b52ead4d31479fdcfba028118dfa6987 (patch)
treead5feb4f01d3b7026a50e27ab4182aa3af3a5642
parenteec809e98361eec5053ed6c6dd6f3a1a27ef2b6e (diff)
downloademacs-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.
-rw-r--r--lib-src/ebrowse.c84
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
309int info_where; 309static int info_where;
310struct sym *info_cls = NULL; 310static struct sym *info_cls = NULL;
311struct member *info_member = NULL; 311static 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
317int info_position = -1; 317static int info_position = -1;
318 318
319/* Command line options structure for getopt_long. */ 319/* Command line options structure for getopt_long. */
320 320
321struct option options[] = 321static 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
342unsigned yyival; /* Set for token CINT. */ 342static unsigned yyival; /* Set for token CINT. */
343char *yytext; /* Set for token IDENT. */ 343static char *yytext; /* Set for token IDENT. */
344char *yytext_end; 344static char *yytext_end;
345 345
346/* Output file. */ 346/* Output file. */
347 347
348FILE *yyout; 348static FILE *yyout;
349 349
350/* Current line number. */ 350/* Current line number. */
351 351
352int yyline; 352static int yyline;
353 353
354/* The name of the current input file. */ 354/* The name of the current input file. */
355 355
356const char *filename; 356static 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
361char is_ident[255]; 361static char is_ident[255];
362char is_digit[255]; 362static char is_digit[255];
363char is_white[255]; 363static 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
371int f_append; 371static int f_append;
372int f_verbose; 372static int f_verbose;
373int f_very_verbose; 373static int f_very_verbose;
374int f_structs = 1; 374static int f_structs = 1;
375int f_regexps = 1; 375static int f_regexps = 1;
376int f_nested_classes = 1; 376static 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
382int min_regexp = 5; 382static int min_regexp = 5;
383int max_regexp = 50; 383static int max_regexp = 50;
384 384
385/* Input buffer. */ 385/* Input buffer. */
386 386
387char *inbuffer; 387static char *inbuffer;
388char *in; 388static char *in;
389size_t inbuffer_size; 389static 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
399char *string_start; 399static 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
408struct sym *class_table[TABLE_SIZE]; 408static 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
414struct member *member_table[TABLE_SIZE]; 414static struct member *member_table[TABLE_SIZE];
415 415
416/* Hash table for namespace aliases */ 416/* Hash table for namespace aliases */
417 417
418struct alias *namespace_alias_table[TABLE_SIZE]; 418static 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
423struct sym *global_symbols; 423static struct sym *global_symbols;
424 424
425/* The current namespace. */ 425/* The current namespace. */
426 426
427struct sym *current_namespace; 427static struct sym *current_namespace;
428 428
429/* The list of all known namespaces. */ 429/* The list of all known namespaces. */
430 430
431struct sym *all_namespaces; 431static 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
435struct sym **namespace_stack; 435static struct sym **namespace_stack;
436int namespace_stack_size; 436static int namespace_stack_size;
437int namespace_sp; 437static int namespace_sp;
438 438
439/* The current lookahead token. */ 439/* The current lookahead token. */
440 440
441int tk = -1; 441static 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
455struct kw *keyword_table[KEYWORD_TABLE_SIZE]; 455static 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
465struct search_path *search_path; 465static struct search_path *search_path;
466struct search_path *search_path_tail; 466static 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
1135char *scope_buffer; 1135static char *scope_buffer;
1136int scope_buffer_size; 1136static int scope_buffer_size;
1137int scope_buffer_len; 1137static 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. */