diff options
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ChangeLog | 9 | ||||
| -rw-r--r-- | lib-src/ebrowse.c | 185 | ||||
| -rw-r--r-- | lib-src/emacsclient.c | 48 | ||||
| -rw-r--r-- | lib-src/fakemail.c | 36 | ||||
| -rw-r--r-- | lib-src/make-docfile.c | 42 | ||||
| -rw-r--r-- | lib-src/movemail.c | 14 | ||||
| -rw-r--r-- | lib-src/profile.c | 4 | ||||
| -rw-r--r-- | lib-src/test-distrib.c | 8 | ||||
| -rw-r--r-- | lib-src/update-game-score.c | 50 |
9 files changed, 181 insertions, 215 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index c2abbc11925..698e7b60a7a 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2011-02-21 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Declare file-scope functions and variables static if not exported. | ||
| 4 | This is more consistent, and is nicer with gcc -Wstrict-prototypes. | ||
| 5 | * ebrowse.c, emacsclient.c, fakemail.c, make-docfile.c, movemail.c: | ||
| 6 | * profile.c, test-distrib.c, update-game-score.c: | ||
| 7 | Declare non-'main' functions and variables to be static. | ||
| 8 | * ebrowse.c: Omit redundant function prototypes. | ||
| 9 | |||
| 1 | 2011-02-20 Juanma Barranquero <lekktu@gmail.com> | 10 | 2011-02-20 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 11 | ||
| 3 | * makefile.w32-in (obj): Remove md5.o. | 12 | * makefile.w32-in (obj): Remove md5.o. |
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c index 59a1dde7634..2cb656ae53a 100644 --- a/lib-src/ebrowse.c +++ b/lib-src/ebrowse.c | |||
| @@ -465,59 +465,16 @@ struct search_path *search_path_tail; | |||
| 465 | 465 | ||
| 466 | /* Function prototypes. */ | 466 | /* Function prototypes. */ |
| 467 | 467 | ||
| 468 | int yylex (void); | 468 | static char *matching_regexp (void); |
| 469 | void yyparse (void); | 469 | static struct sym *add_sym (const char *, struct sym *); |
| 470 | void re_init_parser (void); | 470 | static void add_global_defn (char *, char *, int, unsigned, int, int, int); |
| 471 | const char *token_string (int); | 471 | static void add_global_decl (char *, char *, int, unsigned, int, int, int); |
| 472 | char *matching_regexp (void); | 472 | static struct member *add_member (struct sym *, char *, int, int, unsigned); |
| 473 | void init_sym (void); | 473 | static void class_definition (struct sym *, int, int, int); |
| 474 | struct sym *add_sym (const char *, struct sym *); | 474 | static char *operator_name (int *); |
| 475 | void add_link (struct sym *, struct sym *); | 475 | static void parse_qualified_param_ident_or_type (char **); |
| 476 | void add_member_defn (struct sym *, char *, char *, | 476 | static void usage (int) NO_RETURN; |
| 477 | int, unsigned, int, int, int); | 477 | static void version (void) NO_RETURN; |
| 478 | void add_member_decl (struct sym *, char *, char *, int, | ||
| 479 | unsigned, int, int, int, int); | ||
| 480 | void dump_roots (FILE *); | ||
| 481 | void *xmalloc (int); | ||
| 482 | void xfree (void *); | ||
| 483 | void add_global_defn (char *, char *, int, unsigned, int, int, int); | ||
| 484 | void add_global_decl (char *, char *, int, unsigned, int, int, int); | ||
| 485 | void add_define (char *, char *, int); | ||
| 486 | void mark_inherited_virtual (void); | ||
| 487 | void leave_namespace (void); | ||
| 488 | void enter_namespace (char *); | ||
| 489 | void register_namespace_alias (char *, struct link *); | ||
| 490 | void insert_keyword (const char *, int); | ||
| 491 | void re_init_scanner (void); | ||
| 492 | void init_scanner (void); | ||
| 493 | void process_file (char *); | ||
| 494 | void add_search_path (char *); | ||
| 495 | FILE *open_file (char *); | ||
| 496 | int process_pp_line (void); | ||
| 497 | int dump_members (FILE *, struct member *); | ||
| 498 | void dump_sym (FILE *, struct sym *); | ||
| 499 | int dump_tree (FILE *, struct sym *); | ||
| 500 | struct member *find_member (struct sym *, char *, int, int, unsigned); | ||
| 501 | struct member *add_member (struct sym *, char *, int, int, unsigned); | ||
| 502 | void mark_virtual (struct sym *); | ||
| 503 | struct sym *make_namespace (char *, struct sym *); | ||
| 504 | char *sym_scope (struct sym *); | ||
| 505 | char *sym_scope_1 (struct sym *); | ||
| 506 | int skip_to (int); | ||
| 507 | void skip_matching (void); | ||
| 508 | void member (struct sym *, int); | ||
| 509 | void class_body (struct sym *, int); | ||
| 510 | void class_definition (struct sym *, int, int, int); | ||
| 511 | void declaration (int); | ||
| 512 | unsigned parm_list (int *); | ||
| 513 | char *operator_name (int *); | ||
| 514 | struct sym *parse_classname (void); | ||
| 515 | struct sym *parse_qualified_ident_or_type (char **); | ||
| 516 | void parse_qualified_param_ident_or_type (char **); | ||
| 517 | int globals (int); | ||
| 518 | void yyerror (const char *, const char *); | ||
| 519 | void usage (int) NO_RETURN; | ||
| 520 | void version (void) NO_RETURN; | ||
| 521 | 478 | ||
| 522 | 479 | ||
| 523 | 480 | ||
| @@ -528,7 +485,7 @@ void version (void) NO_RETURN; | |||
| 528 | /* Print an error in a printf-like style with the current input file | 485 | /* Print an error in a printf-like style with the current input file |
| 529 | name and line number. */ | 486 | name and line number. */ |
| 530 | 487 | ||
| 531 | void | 488 | static void |
| 532 | yyerror (const char *format, const char *s) | 489 | yyerror (const char *format, const char *s) |
| 533 | { | 490 | { |
| 534 | fprintf (stderr, "%s:%d: ", filename, yyline); | 491 | fprintf (stderr, "%s:%d: ", filename, yyline); |
| @@ -540,7 +497,7 @@ yyerror (const char *format, const char *s) | |||
| 540 | /* Like malloc but print an error and exit if not enough memory is | 497 | /* Like malloc but print an error and exit if not enough memory is |
| 541 | available. */ | 498 | available. */ |
| 542 | 499 | ||
| 543 | void * | 500 | static void * |
| 544 | xmalloc (int nbytes) | 501 | xmalloc (int nbytes) |
| 545 | { | 502 | { |
| 546 | void *p = malloc (nbytes); | 503 | void *p = malloc (nbytes); |
| @@ -555,7 +512,7 @@ xmalloc (int nbytes) | |||
| 555 | 512 | ||
| 556 | /* Like realloc but print an error and exit if out of memory. */ | 513 | /* Like realloc but print an error and exit if out of memory. */ |
| 557 | 514 | ||
| 558 | void * | 515 | static void * |
| 559 | xrealloc (void *p, int sz) | 516 | xrealloc (void *p, int sz) |
| 560 | { | 517 | { |
| 561 | p = realloc (p, sz); | 518 | p = realloc (p, sz); |
| @@ -571,7 +528,7 @@ xrealloc (void *p, int sz) | |||
| 571 | /* Like strdup, but print an error and exit if not enough memory is | 528 | /* Like strdup, but print an error and exit if not enough memory is |
| 572 | available.. If S is null, return null. */ | 529 | available.. If S is null, return null. */ |
| 573 | 530 | ||
| 574 | char * | 531 | static char * |
| 575 | xstrdup (char *s) | 532 | xstrdup (char *s) |
| 576 | { | 533 | { |
| 577 | if (s) | 534 | if (s) |
| @@ -588,7 +545,7 @@ xstrdup (char *s) | |||
| 588 | /* Initialize the symbol table. This currently only sets up the | 545 | /* Initialize the symbol table. This currently only sets up the |
| 589 | special symbol for globals (`*Globals*'). */ | 546 | special symbol for globals (`*Globals*'). */ |
| 590 | 547 | ||
| 591 | void | 548 | static void |
| 592 | init_sym (void) | 549 | init_sym (void) |
| 593 | { | 550 | { |
| 594 | global_symbols = add_sym (GLOBALS_NAME, NULL); | 551 | global_symbols = add_sym (GLOBALS_NAME, NULL); |
| @@ -602,7 +559,7 @@ init_sym (void) | |||
| 602 | If a symbol for NAME already exists, return that. Otherwise | 559 | If a symbol for NAME already exists, return that. Otherwise |
| 603 | create a new symbol and set it to default values. */ | 560 | create a new symbol and set it to default values. */ |
| 604 | 561 | ||
| 605 | struct sym * | 562 | static struct sym * |
| 606 | add_sym (const char *name, struct sym *nested_in_class) | 563 | add_sym (const char *name, struct sym *nested_in_class) |
| 607 | { | 564 | { |
| 608 | struct sym *sym; | 565 | struct sym *sym; |
| @@ -643,7 +600,7 @@ add_sym (const char *name, struct sym *nested_in_class) | |||
| 643 | 600 | ||
| 644 | /* Add links between superclass SUPER and subclass SUB. */ | 601 | /* Add links between superclass SUPER and subclass SUB. */ |
| 645 | 602 | ||
| 646 | void | 603 | static void |
| 647 | add_link (struct sym *super, struct sym *sub) | 604 | add_link (struct sym *super, struct sym *sub) |
| 648 | { | 605 | { |
| 649 | struct link *lnk, *lnk2, *p, *prev; | 606 | struct link *lnk, *lnk2, *p, *prev; |
| @@ -683,7 +640,7 @@ add_link (struct sym *super, struct sym *sub) | |||
| 683 | parameter types of functions. Value is a pointer to the member | 640 | parameter types of functions. Value is a pointer to the member |
| 684 | found or null if not found. */ | 641 | found or null if not found. */ |
| 685 | 642 | ||
| 686 | struct member * | 643 | static struct member * |
| 687 | find_member (struct sym *cls, char *name, int var, int sc, unsigned int hash) | 644 | find_member (struct sym *cls, char *name, int var, int sc, unsigned int hash) |
| 688 | { | 645 | { |
| 689 | struct member **list; | 646 | struct member **list; |
| @@ -733,7 +690,7 @@ find_member (struct sym *cls, char *name, int var, int sc, unsigned int hash) | |||
| 733 | a bit set giving additional information about the member (see the | 690 | a bit set giving additional information about the member (see the |
| 734 | F_* defines). */ | 691 | F_* defines). */ |
| 735 | 692 | ||
| 736 | void | 693 | static void |
| 737 | add_member_decl (struct sym *cls, char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int vis, int flags) | 694 | add_member_decl (struct sym *cls, char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int vis, int flags) |
| 738 | { | 695 | { |
| 739 | struct member *m; | 696 | struct member *m; |
| @@ -781,7 +738,7 @@ add_member_decl (struct sym *cls, char *name, char *regexp, int pos, unsigned in | |||
| 781 | a bit set giving additional information about the member (see the | 738 | a bit set giving additional information about the member (see the |
| 782 | F_* defines). */ | 739 | F_* defines). */ |
| 783 | 740 | ||
| 784 | void | 741 | static void |
| 785 | add_member_defn (struct sym *cls, char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int flags) | 742 | add_member_defn (struct sym *cls, char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int flags) |
| 786 | { | 743 | { |
| 787 | struct member *m; | 744 | struct member *m; |
| @@ -823,7 +780,7 @@ add_member_defn (struct sym *cls, char *name, char *regexp, int pos, unsigned in | |||
| 823 | REGEXP is a regular expression matching the define in the source, | 780 | REGEXP is a regular expression matching the define in the source, |
| 824 | if it is non-null. POS is the position in the file. */ | 781 | if it is non-null. POS is the position in the file. */ |
| 825 | 782 | ||
| 826 | void | 783 | static void |
| 827 | add_define (char *name, char *regexp, int pos) | 784 | add_define (char *name, char *regexp, int pos) |
| 828 | { | 785 | { |
| 829 | add_global_defn (name, regexp, pos, 0, 1, SC_FRIEND, F_DEFINE); | 786 | add_global_defn (name, regexp, pos, 0, 1, SC_FRIEND, F_DEFINE); |
| @@ -841,7 +798,7 @@ add_define (char *name, char *regexp, int pos) | |||
| 841 | a bit set giving additional information about the member (see the | 798 | a bit set giving additional information about the member (see the |
| 842 | F_* defines). */ | 799 | F_* defines). */ |
| 843 | 800 | ||
| 844 | void | 801 | static void |
| 845 | add_global_defn (char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int flags) | 802 | add_global_defn (char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int flags) |
| 846 | { | 803 | { |
| 847 | int i; | 804 | int i; |
| @@ -872,7 +829,7 @@ add_global_defn (char *name, char *regexp, int pos, unsigned int hash, int var, | |||
| 872 | a bit set giving additional information about the member (see the | 829 | a bit set giving additional information about the member (see the |
| 873 | F_* defines). */ | 830 | F_* defines). */ |
| 874 | 831 | ||
| 875 | void | 832 | static void |
| 876 | add_global_decl (char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int flags) | 833 | add_global_decl (char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int flags) |
| 877 | { | 834 | { |
| 878 | /* Add declaration only if not already declared. Header files must | 835 | /* Add declaration only if not already declared. Header files must |
| @@ -911,7 +868,7 @@ add_global_decl (char *name, char *regexp, int pos, unsigned int hash, int var, | |||
| 911 | member. HASH is a hash code for the parameter types of a function. | 868 | member. HASH is a hash code for the parameter types of a function. |
| 912 | Value is a pointer to the member's structure. */ | 869 | Value is a pointer to the member's structure. */ |
| 913 | 870 | ||
| 914 | struct member * | 871 | static struct member * |
| 915 | add_member (struct sym *cls, char *name, int var, int sc, unsigned int hash) | 872 | add_member (struct sym *cls, char *name, int var, int sc, unsigned int hash) |
| 916 | { | 873 | { |
| 917 | struct member *m = (struct member *) xmalloc (sizeof *m + strlen (name)); | 874 | struct member *m = (struct member *) xmalloc (sizeof *m + strlen (name)); |
| @@ -982,7 +939,7 @@ add_member (struct sym *cls, char *name, int var, int sc, unsigned int hash) | |||
| 982 | recursively, marking functions as virtual that are declared virtual | 939 | recursively, marking functions as virtual that are declared virtual |
| 983 | in base classes. */ | 940 | in base classes. */ |
| 984 | 941 | ||
| 985 | void | 942 | static void |
| 986 | mark_virtual (struct sym *r) | 943 | mark_virtual (struct sym *r) |
| 987 | { | 944 | { |
| 988 | struct link *p; | 945 | struct link *p; |
| @@ -1006,7 +963,7 @@ mark_virtual (struct sym *r) | |||
| 1006 | /* For all roots of the class tree, mark functions as virtual that | 963 | /* For all roots of the class tree, mark functions as virtual that |
| 1007 | are virtual because of a virtual declaration in a base class. */ | 964 | are virtual because of a virtual declaration in a base class. */ |
| 1008 | 965 | ||
| 1009 | void | 966 | static void |
| 1010 | mark_inherited_virtual (void) | 967 | mark_inherited_virtual (void) |
| 1011 | { | 968 | { |
| 1012 | struct sym *r; | 969 | struct sym *r; |
| @@ -1021,7 +978,7 @@ mark_inherited_virtual (void) | |||
| 1021 | 978 | ||
| 1022 | /* Create and return a symbol for a namespace with name NAME. */ | 979 | /* Create and return a symbol for a namespace with name NAME. */ |
| 1023 | 980 | ||
| 1024 | struct sym * | 981 | static struct sym * |
| 1025 | make_namespace (char *name, struct sym *context) | 982 | make_namespace (char *name, struct sym *context) |
| 1026 | { | 983 | { |
| 1027 | struct sym *s = (struct sym *) xmalloc (sizeof *s + strlen (name)); | 984 | struct sym *s = (struct sym *) xmalloc (sizeof *s + strlen (name)); |
| @@ -1036,7 +993,7 @@ make_namespace (char *name, struct sym *context) | |||
| 1036 | 993 | ||
| 1037 | /* Find the symbol for namespace NAME. If not found, retrun NULL */ | 994 | /* Find the symbol for namespace NAME. If not found, retrun NULL */ |
| 1038 | 995 | ||
| 1039 | struct sym * | 996 | static struct sym * |
| 1040 | check_namespace (char *name, struct sym *context) | 997 | check_namespace (char *name, struct sym *context) |
| 1041 | { | 998 | { |
| 1042 | struct sym *p = NULL; | 999 | struct sym *p = NULL; |
| @@ -1053,7 +1010,7 @@ check_namespace (char *name, struct sym *context) | |||
| 1053 | /* Find the symbol for namespace NAME. If not found, add a new symbol | 1010 | /* Find the symbol for namespace NAME. If not found, add a new symbol |
| 1054 | for NAME to all_namespaces. */ | 1011 | for NAME to all_namespaces. */ |
| 1055 | 1012 | ||
| 1056 | struct sym * | 1013 | static struct sym * |
| 1057 | find_namespace (char *name, struct sym *context) | 1014 | find_namespace (char *name, struct sym *context) |
| 1058 | { | 1015 | { |
| 1059 | struct sym *p = check_namespace (name, context); | 1016 | struct sym *p = check_namespace (name, context); |
| @@ -1067,7 +1024,7 @@ find_namespace (char *name, struct sym *context) | |||
| 1067 | 1024 | ||
| 1068 | /* Find namespace alias with name NAME. If not found return NULL. */ | 1025 | /* Find namespace alias with name NAME. If not found return NULL. */ |
| 1069 | 1026 | ||
| 1070 | struct link * | 1027 | static struct link * |
| 1071 | check_namespace_alias (char *name) | 1028 | check_namespace_alias (char *name) |
| 1072 | { | 1029 | { |
| 1073 | struct link *p = NULL; | 1030 | struct link *p = NULL; |
| @@ -1091,7 +1048,7 @@ check_namespace_alias (char *name) | |||
| 1091 | 1048 | ||
| 1092 | /* Register the name NEW_NAME as an alias for namespace list OLD_NAME. */ | 1049 | /* Register the name NEW_NAME as an alias for namespace list OLD_NAME. */ |
| 1093 | 1050 | ||
| 1094 | void | 1051 | static void |
| 1095 | register_namespace_alias (char *new_name, struct link *old_name) | 1052 | register_namespace_alias (char *new_name, struct link *old_name) |
| 1096 | { | 1053 | { |
| 1097 | unsigned h; | 1054 | unsigned h; |
| @@ -1119,7 +1076,7 @@ register_namespace_alias (char *new_name, struct link *old_name) | |||
| 1119 | 1076 | ||
| 1120 | /* Enter namespace with name NAME. */ | 1077 | /* Enter namespace with name NAME. */ |
| 1121 | 1078 | ||
| 1122 | void | 1079 | static void |
| 1123 | enter_namespace (char *name) | 1080 | enter_namespace (char *name) |
| 1124 | { | 1081 | { |
| 1125 | struct sym *p = find_namespace (name, current_namespace); | 1082 | struct sym *p = find_namespace (name, current_namespace); |
| @@ -1140,7 +1097,7 @@ enter_namespace (char *name) | |||
| 1140 | 1097 | ||
| 1141 | /* Leave the current namespace. */ | 1098 | /* Leave the current namespace. */ |
| 1142 | 1099 | ||
| 1143 | void | 1100 | static void |
| 1144 | leave_namespace (void) | 1101 | leave_namespace (void) |
| 1145 | { | 1102 | { |
| 1146 | assert (namespace_sp > 0); | 1103 | assert (namespace_sp > 0); |
| @@ -1182,7 +1139,7 @@ int scope_buffer_len; | |||
| 1182 | 1139 | ||
| 1183 | /* 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. */ |
| 1184 | 1141 | ||
| 1185 | void | 1142 | static void |
| 1186 | ensure_scope_buffer_room (int len) | 1143 | ensure_scope_buffer_room (int len) |
| 1187 | { | 1144 | { |
| 1188 | if (scope_buffer_len + len >= scope_buffer_size) | 1145 | if (scope_buffer_len + len >= scope_buffer_size) |
| @@ -1198,7 +1155,7 @@ ensure_scope_buffer_room (int len) | |||
| 1198 | namespaces to scope_buffer. Value is a pointer to the complete | 1155 | namespaces to scope_buffer. Value is a pointer to the complete |
| 1199 | scope name constructed. */ | 1156 | scope name constructed. */ |
| 1200 | 1157 | ||
| 1201 | char * | 1158 | static char * |
| 1202 | sym_scope_1 (struct sym *p) | 1159 | sym_scope_1 (struct sym *p) |
| 1203 | { | 1160 | { |
| 1204 | int len; | 1161 | int len; |
| @@ -1232,7 +1189,7 @@ sym_scope_1 (struct sym *p) | |||
| 1232 | /* Return the scope of symbol P in printed representation, i.e. | 1189 | /* Return the scope of symbol P in printed representation, i.e. |
| 1233 | as it would appear in a C*+ source file. */ | 1190 | as it would appear in a C*+ source file. */ |
| 1234 | 1191 | ||
| 1235 | char * | 1192 | static char * |
| 1236 | sym_scope (struct sym *p) | 1193 | sym_scope (struct sym *p) |
| 1237 | { | 1194 | { |
| 1238 | if (!scope_buffer) | 1195 | if (!scope_buffer) |
| @@ -1254,7 +1211,7 @@ sym_scope (struct sym *p) | |||
| 1254 | /* Dump the list of members M to file FP. Value is the length of the | 1211 | /* Dump the list of members M to file FP. Value is the length of the |
| 1255 | list. */ | 1212 | list. */ |
| 1256 | 1213 | ||
| 1257 | int | 1214 | static int |
| 1258 | dump_members (FILE *fp, struct member *m) | 1215 | dump_members (FILE *fp, struct member *m) |
| 1259 | { | 1216 | { |
| 1260 | int n; | 1217 | int n; |
| @@ -1287,7 +1244,7 @@ dump_members (FILE *fp, struct member *m) | |||
| 1287 | 1244 | ||
| 1288 | /* Dump class ROOT to stream FP. */ | 1245 | /* Dump class ROOT to stream FP. */ |
| 1289 | 1246 | ||
| 1290 | void | 1247 | static void |
| 1291 | dump_sym (FILE *fp, struct sym *root) | 1248 | dump_sym (FILE *fp, struct sym *root) |
| 1292 | { | 1249 | { |
| 1293 | fputs (CLASS_STRUCT, fp); | 1250 | fputs (CLASS_STRUCT, fp); |
| @@ -1313,7 +1270,7 @@ dump_sym (FILE *fp, struct sym *root) | |||
| 1313 | /* Dump class ROOT and its subclasses to file FP. Value is the | 1270 | /* Dump class ROOT and its subclasses to file FP. Value is the |
| 1314 | number of classes written. */ | 1271 | number of classes written. */ |
| 1315 | 1272 | ||
| 1316 | int | 1273 | static int |
| 1317 | dump_tree (FILE *fp, struct sym *root) | 1274 | dump_tree (FILE *fp, struct sym *root) |
| 1318 | { | 1275 | { |
| 1319 | struct link *lk; | 1276 | struct link *lk; |
| @@ -1360,7 +1317,7 @@ dump_tree (FILE *fp, struct sym *root) | |||
| 1360 | 1317 | ||
| 1361 | /* Dump the entire class tree to file FP. */ | 1318 | /* Dump the entire class tree to file FP. */ |
| 1362 | 1319 | ||
| 1363 | void | 1320 | static void |
| 1364 | dump_roots (FILE *fp) | 1321 | dump_roots (FILE *fp) |
| 1365 | { | 1322 | { |
| 1366 | int i, n = 0; | 1323 | int i, n = 0; |
| @@ -1434,7 +1391,7 @@ do { \ | |||
| 1434 | /* Process a preprocessor line. Value is the next character from the | 1391 | /* Process a preprocessor line. Value is the next character from the |
| 1435 | input buffer not consumed. */ | 1392 | input buffer not consumed. */ |
| 1436 | 1393 | ||
| 1437 | int | 1394 | static int |
| 1438 | process_pp_line (void) | 1395 | process_pp_line (void) |
| 1439 | { | 1396 | { |
| 1440 | int in_comment = 0, in_string = 0; | 1397 | int in_comment = 0, in_string = 0; |
| @@ -1505,7 +1462,7 @@ process_pp_line (void) | |||
| 1505 | 1462 | ||
| 1506 | /* Value is the next token from the input buffer. */ | 1463 | /* Value is the next token from the input buffer. */ |
| 1507 | 1464 | ||
| 1508 | int | 1465 | static int |
| 1509 | yylex (void) | 1466 | yylex (void) |
| 1510 | { | 1467 | { |
| 1511 | int c; | 1468 | int c; |
| @@ -1927,7 +1884,7 @@ static char *matching_regexp_buffer, *matching_regexp_end_buf; | |||
| 1927 | position in the input buffer, or maybe a bit more if that string is | 1884 | position in the input buffer, or maybe a bit more if that string is |
| 1928 | shorter than min_regexp. */ | 1885 | shorter than min_regexp. */ |
| 1929 | 1886 | ||
| 1930 | char * | 1887 | static char * |
| 1931 | matching_regexp (void) | 1888 | matching_regexp (void) |
| 1932 | { | 1889 | { |
| 1933 | char *p; | 1890 | char *p; |
| @@ -1978,7 +1935,7 @@ matching_regexp (void) | |||
| 1978 | 1935 | ||
| 1979 | /* Return a printable representation of token T. */ | 1936 | /* Return a printable representation of token T. */ |
| 1980 | 1937 | ||
| 1981 | const char * | 1938 | static const char * |
| 1982 | token_string (int t) | 1939 | token_string (int t) |
| 1983 | { | 1940 | { |
| 1984 | static char b[3]; | 1941 | static char b[3]; |
| @@ -2095,7 +2052,7 @@ token_string (int t) | |||
| 2095 | 2052 | ||
| 2096 | /* Reinitialize the scanner for a new input file. */ | 2053 | /* Reinitialize the scanner for a new input file. */ |
| 2097 | 2054 | ||
| 2098 | void | 2055 | static void |
| 2099 | re_init_scanner (void) | 2056 | re_init_scanner (void) |
| 2100 | { | 2057 | { |
| 2101 | in = inbuffer; | 2058 | in = inbuffer; |
| @@ -2113,7 +2070,7 @@ re_init_scanner (void) | |||
| 2113 | /* Insert a keyword NAME with token value TK into the keyword hash | 2070 | /* Insert a keyword NAME with token value TK into the keyword hash |
| 2114 | table. */ | 2071 | table. */ |
| 2115 | 2072 | ||
| 2116 | void | 2073 | static void |
| 2117 | insert_keyword (const char *name, int tk) | 2074 | insert_keyword (const char *name, int tk) |
| 2118 | { | 2075 | { |
| 2119 | const char *s; | 2076 | const char *s; |
| @@ -2134,7 +2091,7 @@ insert_keyword (const char *name, int tk) | |||
| 2134 | /* Initialize the scanner for the first file. This sets up the | 2091 | /* Initialize the scanner for the first file. This sets up the |
| 2135 | character class vectors and fills the keyword hash table. */ | 2092 | character class vectors and fills the keyword hash table. */ |
| 2136 | 2093 | ||
| 2137 | void | 2094 | static void |
| 2138 | init_scanner (void) | 2095 | init_scanner (void) |
| 2139 | { | 2096 | { |
| 2140 | int i; | 2097 | int i; |
| @@ -2278,7 +2235,7 @@ init_scanner (void) | |||
| 2278 | /* Skip forward until a given token TOKEN or YYEOF is seen and return | 2235 | /* Skip forward until a given token TOKEN or YYEOF is seen and return |
| 2279 | the current lookahead token after skipping. */ | 2236 | the current lookahead token after skipping. */ |
| 2280 | 2237 | ||
| 2281 | int | 2238 | static int |
| 2282 | skip_to (int token) | 2239 | skip_to (int token) |
| 2283 | { | 2240 | { |
| 2284 | while (!LOOKING_AT2 (YYEOF, token)) | 2241 | while (!LOOKING_AT2 (YYEOF, token)) |
| @@ -2289,7 +2246,7 @@ skip_to (int token) | |||
| 2289 | /* Skip over pairs of tokens (parentheses, square brackets, | 2246 | /* Skip over pairs of tokens (parentheses, square brackets, |
| 2290 | angle brackets, curly brackets) matching the current lookahead. */ | 2247 | angle brackets, curly brackets) matching the current lookahead. */ |
| 2291 | 2248 | ||
| 2292 | void | 2249 | static void |
| 2293 | skip_matching (void) | 2250 | skip_matching (void) |
| 2294 | { | 2251 | { |
| 2295 | int open, close, n; | 2252 | int open, close, n; |
| @@ -2332,7 +2289,7 @@ skip_matching (void) | |||
| 2332 | } | 2289 | } |
| 2333 | } | 2290 | } |
| 2334 | 2291 | ||
| 2335 | void | 2292 | static void |
| 2336 | skip_initializer (void) | 2293 | skip_initializer (void) |
| 2337 | { | 2294 | { |
| 2338 | for (;;) | 2295 | for (;;) |
| @@ -2359,7 +2316,7 @@ skip_initializer (void) | |||
| 2359 | 2316 | ||
| 2360 | /* Build qualified namespace alias (A::B::c) and return it. */ | 2317 | /* Build qualified namespace alias (A::B::c) and return it. */ |
| 2361 | 2318 | ||
| 2362 | struct link * | 2319 | static struct link * |
| 2363 | match_qualified_namespace_alias (void) | 2320 | match_qualified_namespace_alias (void) |
| 2364 | { | 2321 | { |
| 2365 | struct link *head = NULL; | 2322 | struct link *head = NULL; |
| @@ -2396,7 +2353,7 @@ match_qualified_namespace_alias (void) | |||
| 2396 | 2353 | ||
| 2397 | /* Re-initialize the parser by resetting the lookahead token. */ | 2354 | /* Re-initialize the parser by resetting the lookahead token. */ |
| 2398 | 2355 | ||
| 2399 | void | 2356 | static void |
| 2400 | re_init_parser (void) | 2357 | re_init_parser (void) |
| 2401 | { | 2358 | { |
| 2402 | tk = -1; | 2359 | tk = -1; |
| @@ -2409,7 +2366,7 @@ re_init_parser (void) | |||
| 2409 | Returns a hash code for the parameter types. This value is used to | 2366 | Returns a hash code for the parameter types. This value is used to |
| 2410 | distinguish between overloaded functions. */ | 2367 | distinguish between overloaded functions. */ |
| 2411 | 2368 | ||
| 2412 | unsigned | 2369 | static unsigned |
| 2413 | parm_list (int *flags) | 2370 | parm_list (int *flags) |
| 2414 | { | 2371 | { |
| 2415 | unsigned hash = 0; | 2372 | unsigned hash = 0; |
| @@ -2522,7 +2479,7 @@ parm_list (int *flags) | |||
| 2522 | 2479 | ||
| 2523 | /* Print position info to stdout. */ | 2480 | /* Print position info to stdout. */ |
| 2524 | 2481 | ||
| 2525 | void | 2482 | static void |
| 2526 | print_info (void) | 2483 | print_info (void) |
| 2527 | { | 2484 | { |
| 2528 | if (info_position >= 0 && BUFFER_POS () <= info_position) | 2485 | if (info_position >= 0 && BUFFER_POS () <= info_position) |
| @@ -2537,7 +2494,7 @@ print_info (void) | |||
| 2537 | the access specifier for the member (private, protected, | 2494 | the access specifier for the member (private, protected, |
| 2538 | public). */ | 2495 | public). */ |
| 2539 | 2496 | ||
| 2540 | void | 2497 | static void |
| 2541 | member (struct sym *cls, int vis) | 2498 | member (struct sym *cls, int vis) |
| 2542 | { | 2499 | { |
| 2543 | char *id = NULL; | 2500 | char *id = NULL; |
| @@ -2746,7 +2703,7 @@ member (struct sym *cls, int vis) | |||
| 2746 | /* Parse the body of class CLS. TAG is the tag of the class (struct, | 2703 | /* Parse the body of class CLS. TAG is the tag of the class (struct, |
| 2747 | union, class). */ | 2704 | union, class). */ |
| 2748 | 2705 | ||
| 2749 | void | 2706 | static void |
| 2750 | class_body (struct sym *cls, int tag) | 2707 | class_body (struct sym *cls, int tag) |
| 2751 | { | 2708 | { |
| 2752 | int vis = tag == CLASS ? PRIVATE : PUBLIC; | 2709 | int vis = tag == CLASS ? PRIVATE : PUBLIC; |
| @@ -2807,7 +2764,7 @@ class_body (struct sym *cls, int tag) | |||
| 2807 | qualified ident has the form `X<..>::Y<...>::T<...>. Returns a | 2764 | qualified ident has the form `X<..>::Y<...>::T<...>. Returns a |
| 2808 | symbol for that class. */ | 2765 | symbol for that class. */ |
| 2809 | 2766 | ||
| 2810 | struct sym * | 2767 | static struct sym * |
| 2811 | parse_classname (void) | 2768 | parse_classname (void) |
| 2812 | { | 2769 | { |
| 2813 | struct sym *last_class = NULL; | 2770 | struct sym *last_class = NULL; |
| @@ -2837,7 +2794,7 @@ parse_classname (void) | |||
| 2837 | implicitly static operator has been parsed. Value is a pointer to | 2794 | implicitly static operator has been parsed. Value is a pointer to |
| 2838 | a static buffer holding the constructed operator name string. */ | 2795 | a static buffer holding the constructed operator name string. */ |
| 2839 | 2796 | ||
| 2840 | char * | 2797 | static char * |
| 2841 | operator_name (int *sc) | 2798 | operator_name (int *sc) |
| 2842 | { | 2799 | { |
| 2843 | static int id_size = 0; | 2800 | static int id_size = 0; |
| @@ -2927,7 +2884,7 @@ operator_name (int *sc) | |||
| 2927 | `X::Y::z'. This IDENT is returned in LAST_ID. Value is the | 2884 | `X::Y::z'. This IDENT is returned in LAST_ID. Value is the |
| 2928 | symbol structure for the ident. */ | 2885 | symbol structure for the ident. */ |
| 2929 | 2886 | ||
| 2930 | struct sym * | 2887 | static struct sym * |
| 2931 | parse_qualified_ident_or_type (char **last_id) | 2888 | parse_qualified_ident_or_type (char **last_id) |
| 2932 | { | 2889 | { |
| 2933 | struct sym *cls = NULL; | 2890 | struct sym *cls = NULL; |
| @@ -2992,7 +2949,7 @@ parse_qualified_ident_or_type (char **last_id) | |||
| 2992 | `X::Y::z'. This IDENT is returned in LAST_ID. Value is the | 2949 | `X::Y::z'. This IDENT is returned in LAST_ID. Value is the |
| 2993 | symbol structure for the ident. */ | 2950 | symbol structure for the ident. */ |
| 2994 | 2951 | ||
| 2995 | void | 2952 | static void |
| 2996 | parse_qualified_param_ident_or_type (char **last_id) | 2953 | parse_qualified_param_ident_or_type (char **last_id) |
| 2997 | { | 2954 | { |
| 2998 | struct sym *cls = NULL; | 2955 | struct sym *cls = NULL; |
| @@ -3034,7 +2991,7 @@ parse_qualified_param_ident_or_type (char **last_id) | |||
| 3034 | 2991 | ||
| 3035 | Current lookahead is the class name. */ | 2992 | Current lookahead is the class name. */ |
| 3036 | 2993 | ||
| 3037 | void | 2994 | static void |
| 3038 | class_definition (struct sym *containing, int tag, int flags, int nested) | 2995 | class_definition (struct sym *containing, int tag, int flags, int nested) |
| 3039 | { | 2996 | { |
| 3040 | struct sym *current; | 2997 | struct sym *current; |
| @@ -3131,7 +3088,7 @@ class_definition (struct sym *containing, int tag, int flags, int nested) | |||
| 3131 | the storage class of *ID. FLAGS is a bit set giving additional | 3088 | the storage class of *ID. FLAGS is a bit set giving additional |
| 3132 | information about the member (see the F_* defines). */ | 3089 | information about the member (see the F_* defines). */ |
| 3133 | 3090 | ||
| 3134 | void | 3091 | static void |
| 3135 | add_declarator (struct sym **cls, char **id, int flags, int sc) | 3092 | add_declarator (struct sym **cls, char **id, int flags, int sc) |
| 3136 | { | 3093 | { |
| 3137 | if (LOOKING_AT2 (';', ',')) | 3094 | if (LOOKING_AT2 (';', ',')) |
| @@ -3174,7 +3131,7 @@ add_declarator (struct sym **cls, char **id, int flags, int sc) | |||
| 3174 | 3131 | ||
| 3175 | /* Parse a declaration. */ | 3132 | /* Parse a declaration. */ |
| 3176 | 3133 | ||
| 3177 | void | 3134 | static void |
| 3178 | declaration (int flags) | 3135 | declaration (int flags) |
| 3179 | { | 3136 | { |
| 3180 | char *id = NULL; | 3137 | char *id = NULL; |
| @@ -3328,7 +3285,7 @@ declaration (int flags) | |||
| 3328 | parsing in an `extern "C"' block. Value is 1 if EOF is reached, 0 | 3285 | parsing in an `extern "C"' block. Value is 1 if EOF is reached, 0 |
| 3329 | otherwise. */ | 3286 | otherwise. */ |
| 3330 | 3287 | ||
| 3331 | int | 3288 | static int |
| 3332 | globals (int start_flags) | 3289 | globals (int start_flags) |
| 3333 | { | 3290 | { |
| 3334 | int anonymous; | 3291 | int anonymous; |
| @@ -3446,7 +3403,7 @@ globals (int start_flags) | |||
| 3446 | 3403 | ||
| 3447 | /* Parse the current input file. */ | 3404 | /* Parse the current input file. */ |
| 3448 | 3405 | ||
| 3449 | void | 3406 | static void |
| 3450 | yyparse (void) | 3407 | yyparse (void) |
| 3451 | { | 3408 | { |
| 3452 | while (globals (0) == 0) | 3409 | while (globals (0) == 0) |
| @@ -3462,7 +3419,7 @@ yyparse (void) | |||
| 3462 | /* Add the list of paths PATH_LIST to the current search path for | 3419 | /* Add the list of paths PATH_LIST to the current search path for |
| 3463 | input files. */ | 3420 | input files. */ |
| 3464 | 3421 | ||
| 3465 | void | 3422 | static void |
| 3466 | add_search_path (char *path_list) | 3423 | add_search_path (char *path_list) |
| 3467 | { | 3424 | { |
| 3468 | while (*path_list) | 3425 | while (*path_list) |
| @@ -3497,7 +3454,7 @@ add_search_path (char *path_list) | |||
| 3497 | opened. Try to find FILE in search_path first, then try the | 3454 | opened. Try to find FILE in search_path first, then try the |
| 3498 | unchanged file name. */ | 3455 | unchanged file name. */ |
| 3499 | 3456 | ||
| 3500 | FILE * | 3457 | static FILE * |
| 3501 | open_file (char *file) | 3458 | open_file (char *file) |
| 3502 | { | 3459 | { |
| 3503 | FILE *fp = NULL; | 3460 | FILE *fp = NULL; |
| @@ -3556,7 +3513,7 @@ Usage: ebrowse [options] {files}\n\ | |||
| 3556 | --version display version info\n\ | 3513 | --version display version info\n\ |
| 3557 | " | 3514 | " |
| 3558 | 3515 | ||
| 3559 | void | 3516 | static void |
| 3560 | usage (int error) | 3517 | usage (int error) |
| 3561 | { | 3518 | { |
| 3562 | puts (USAGE); | 3519 | puts (USAGE); |
| @@ -3571,7 +3528,7 @@ usage (int error) | |||
| 3571 | # define VERSION "21" | 3528 | # define VERSION "21" |
| 3572 | #endif | 3529 | #endif |
| 3573 | 3530 | ||
| 3574 | void | 3531 | static void |
| 3575 | version (void) | 3532 | version (void) |
| 3576 | { | 3533 | { |
| 3577 | /* Makes it easier to update automatically. */ | 3534 | /* Makes it easier to update automatically. */ |
| @@ -3587,7 +3544,7 @@ version (void) | |||
| 3587 | /* Parse one input file FILE, adding classes and members to the symbol | 3544 | /* Parse one input file FILE, adding classes and members to the symbol |
| 3588 | table. */ | 3545 | table. */ |
| 3589 | 3546 | ||
| 3590 | void | 3547 | static void |
| 3591 | process_file (char *file) | 3548 | process_file (char *file) |
| 3592 | { | 3549 | { |
| 3593 | FILE *fp; | 3550 | FILE *fp; |
| @@ -3642,7 +3599,7 @@ process_file (char *file) | |||
| 3642 | containing its contents without the terminating newline. Value | 3599 | containing its contents without the terminating newline. Value |
| 3643 | is null when EOF is reached. */ | 3600 | is null when EOF is reached. */ |
| 3644 | 3601 | ||
| 3645 | char * | 3602 | static char * |
| 3646 | read_line (FILE *fp) | 3603 | read_line (FILE *fp) |
| 3647 | { | 3604 | { |
| 3648 | static char *buffer; | 3605 | static char *buffer; |
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 3670e68e3b3..8d5f0482637 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c | |||
| @@ -150,8 +150,8 @@ const char *server_file = NULL; | |||
| 150 | /* PID of the Emacs server process. */ | 150 | /* PID of the Emacs server process. */ |
| 151 | int emacs_pid = 0; | 151 | int emacs_pid = 0; |
| 152 | 152 | ||
| 153 | void print_help_and_exit (void) NO_RETURN; | 153 | static void print_help_and_exit (void) NO_RETURN; |
| 154 | void fail (void) NO_RETURN; | 154 | static void fail (void) NO_RETURN; |
| 155 | 155 | ||
| 156 | 156 | ||
| 157 | struct option longopts[] = | 157 | struct option longopts[] = |
| @@ -178,7 +178,7 @@ struct option longopts[] = | |||
| 178 | 178 | ||
| 179 | /* Like malloc but get fatal error if memory is exhausted. */ | 179 | /* Like malloc but get fatal error if memory is exhausted. */ |
| 180 | 180 | ||
| 181 | long * | 181 | static long * |
| 182 | xmalloc (unsigned int size) | 182 | xmalloc (unsigned int size) |
| 183 | { | 183 | { |
| 184 | long *result = (long *) malloc (size); | 184 | long *result = (long *) malloc (size); |
| @@ -192,7 +192,7 @@ xmalloc (unsigned int size) | |||
| 192 | 192 | ||
| 193 | /* Like strdup but get a fatal error if memory is exhausted. */ | 193 | /* Like strdup but get a fatal error if memory is exhausted. */ |
| 194 | 194 | ||
| 195 | char * | 195 | static char * |
| 196 | xstrdup (const char *s) | 196 | xstrdup (const char *s) |
| 197 | { | 197 | { |
| 198 | char *result = strdup (s); | 198 | char *result = strdup (s); |
| @@ -473,7 +473,7 @@ ttyname (int fd) | |||
| 473 | 473 | ||
| 474 | /* Display a normal or error message. | 474 | /* Display a normal or error message. |
| 475 | On Windows, use a message box if compiled as a Windows app. */ | 475 | On Windows, use a message box if compiled as a Windows app. */ |
| 476 | void | 476 | static void |
| 477 | message (int is_error, const char *message, ...) | 477 | message (int is_error, const char *message, ...) |
| 478 | { | 478 | { |
| 479 | char msg[2048]; | 479 | char msg[2048]; |
| @@ -504,7 +504,7 @@ message (int is_error, const char *message, ...) | |||
| 504 | /* Decode the options from argv and argc. | 504 | /* Decode the options from argv and argc. |
| 505 | The global variable `optind' will say how many arguments we used up. */ | 505 | The global variable `optind' will say how many arguments we used up. */ |
| 506 | 506 | ||
| 507 | void | 507 | static void |
| 508 | decode_options (int argc, char **argv) | 508 | decode_options (int argc, char **argv) |
| 509 | { | 509 | { |
| 510 | alternate_editor = egetenv ("ALTERNATE_EDITOR"); | 510 | alternate_editor = egetenv ("ALTERNATE_EDITOR"); |
| @@ -630,7 +630,7 @@ an empty string"); | |||
| 630 | } | 630 | } |
| 631 | 631 | ||
| 632 | 632 | ||
| 633 | void | 633 | static void |
| 634 | print_help_and_exit (void) | 634 | print_help_and_exit (void) |
| 635 | { | 635 | { |
| 636 | /* Spaces and tabs are significant in this message; they're chosen so the | 636 | /* Spaces and tabs are significant in this message; they're chosen so the |
| @@ -675,7 +675,7 @@ Report bugs with M-x report-emacs-bug.\n", progname); | |||
| 675 | defined-- exit with an errorcode. | 675 | defined-- exit with an errorcode. |
| 676 | Uses argv, but gets it from the global variable main_argv. | 676 | Uses argv, but gets it from the global variable main_argv. |
| 677 | */ | 677 | */ |
| 678 | void | 678 | static void |
| 679 | fail (void) | 679 | fail (void) |
| 680 | { | 680 | { |
| 681 | if (alternate_editor) | 681 | if (alternate_editor) |
| @@ -718,7 +718,7 @@ HSOCKET emacs_socket = 0; | |||
| 718 | 718 | ||
| 719 | /* On Windows, the socket library was historically separate from the standard | 719 | /* On Windows, the socket library was historically separate from the standard |
| 720 | C library, so errors are handled differently. */ | 720 | C library, so errors are handled differently. */ |
| 721 | void | 721 | static void |
| 722 | sock_err_message (const char *function_name) | 722 | sock_err_message (const char *function_name) |
| 723 | { | 723 | { |
| 724 | #ifdef WINDOWSNT | 724 | #ifdef WINDOWSNT |
| @@ -742,7 +742,7 @@ sock_err_message (const char *function_name) | |||
| 742 | - the data ends in "\n", or | 742 | - the data ends in "\n", or |
| 743 | - the buffer is full (but this shouldn't happen) | 743 | - the buffer is full (but this shouldn't happen) |
| 744 | Otherwise, we just accumulate it. */ | 744 | Otherwise, we just accumulate it. */ |
| 745 | void | 745 | static void |
| 746 | send_to_emacs (HSOCKET s, const char *data) | 746 | send_to_emacs (HSOCKET s, const char *data) |
| 747 | { | 747 | { |
| 748 | while (data) | 748 | while (data) |
| @@ -781,7 +781,7 @@ send_to_emacs (HSOCKET s, const char *data) | |||
| 781 | return value never contains a space. | 781 | return value never contains a space. |
| 782 | 782 | ||
| 783 | Does not change the string. Outputs the result to S. */ | 783 | Does not change the string. Outputs the result to S. */ |
| 784 | void | 784 | static void |
| 785 | quote_argument (HSOCKET s, const char *str) | 785 | quote_argument (HSOCKET s, const char *str) |
| 786 | { | 786 | { |
| 787 | char *copy = (char *) xmalloc (strlen (str) * 2 + 1); | 787 | char *copy = (char *) xmalloc (strlen (str) * 2 + 1); |
| @@ -822,7 +822,7 @@ quote_argument (HSOCKET s, const char *str) | |||
| 822 | /* The inverse of quote_argument. Removes quoting in string STR by | 822 | /* The inverse of quote_argument. Removes quoting in string STR by |
| 823 | modifying the string in place. Returns STR. */ | 823 | modifying the string in place. Returns STR. */ |
| 824 | 824 | ||
| 825 | char * | 825 | static char * |
| 826 | unquote_argument (char *str) | 826 | unquote_argument (char *str) |
| 827 | { | 827 | { |
| 828 | char *p, *q; | 828 | char *p, *q; |
| @@ -853,7 +853,7 @@ unquote_argument (char *str) | |||
| 853 | } | 853 | } |
| 854 | 854 | ||
| 855 | 855 | ||
| 856 | int | 856 | static int |
| 857 | file_name_absolute_p (const char *filename) | 857 | file_name_absolute_p (const char *filename) |
| 858 | { | 858 | { |
| 859 | /* Sanity check, it shouldn't happen. */ | 859 | /* Sanity check, it shouldn't happen. */ |
| @@ -907,7 +907,7 @@ initialize_sockets (void) | |||
| 907 | * Read the information needed to set up a TCP comm channel with | 907 | * Read the information needed to set up a TCP comm channel with |
| 908 | * the Emacs server: host, port, and authentication string. | 908 | * the Emacs server: host, port, and authentication string. |
| 909 | */ | 909 | */ |
| 910 | int | 910 | static int |
| 911 | get_server_config (struct sockaddr_in *server, char *authentication) | 911 | get_server_config (struct sockaddr_in *server, char *authentication) |
| 912 | { | 912 | { |
| 913 | char dotted[32]; | 913 | char dotted[32]; |
| @@ -965,7 +965,7 @@ get_server_config (struct sockaddr_in *server, char *authentication) | |||
| 965 | return TRUE; | 965 | return TRUE; |
| 966 | } | 966 | } |
| 967 | 967 | ||
| 968 | HSOCKET | 968 | static HSOCKET |
| 969 | set_tcp_socket (void) | 969 | set_tcp_socket (void) |
| 970 | { | 970 | { |
| 971 | HSOCKET s; | 971 | HSOCKET s; |
| @@ -1024,7 +1024,7 @@ strprefix (const char *prefix, const char *string) | |||
| 1024 | and the name in TTY_NAME, and return 1. Otherwise, fail if NOABORT | 1024 | and the name in TTY_NAME, and return 1. Otherwise, fail if NOABORT |
| 1025 | is zero, or return 0 if NOABORT is non-zero. */ | 1025 | is zero, or return 0 if NOABORT is non-zero. */ |
| 1026 | 1026 | ||
| 1027 | int | 1027 | static int |
| 1028 | find_tty (char **tty_type, char **tty_name, int noabort) | 1028 | find_tty (char **tty_type, char **tty_name, int noabort) |
| 1029 | { | 1029 | { |
| 1030 | char *type = egetenv ("TERM"); | 1030 | char *type = egetenv ("TERM"); |
| @@ -1097,7 +1097,7 @@ socket_status (char *socket_name) | |||
| 1097 | /* A signal handler that passes the signal to the Emacs process. | 1097 | /* A signal handler that passes the signal to the Emacs process. |
| 1098 | Useful for SIGWINCH. */ | 1098 | Useful for SIGWINCH. */ |
| 1099 | 1099 | ||
| 1100 | SIGTYPE | 1100 | static SIGTYPE |
| 1101 | pass_signal_to_emacs (int signalnum) | 1101 | pass_signal_to_emacs (int signalnum) |
| 1102 | { | 1102 | { |
| 1103 | int old_errno = errno; | 1103 | int old_errno = errno; |
| @@ -1112,7 +1112,7 @@ pass_signal_to_emacs (int signalnum) | |||
| 1112 | /* Signal handler for SIGCONT; notify the Emacs process that it can | 1112 | /* Signal handler for SIGCONT; notify the Emacs process that it can |
| 1113 | now resume our tty frame. */ | 1113 | now resume our tty frame. */ |
| 1114 | 1114 | ||
| 1115 | SIGTYPE | 1115 | static SIGTYPE |
| 1116 | handle_sigcont (int signalnum) | 1116 | handle_sigcont (int signalnum) |
| 1117 | { | 1117 | { |
| 1118 | int old_errno = errno; | 1118 | int old_errno = errno; |
| @@ -1138,7 +1138,7 @@ handle_sigcont (int signalnum) | |||
| 1138 | reality, we may get a SIGTSTP on C-z. Handling this signal and | 1138 | reality, we may get a SIGTSTP on C-z. Handling this signal and |
| 1139 | notifying Emacs about it should get things under control again. */ | 1139 | notifying Emacs about it should get things under control again. */ |
| 1140 | 1140 | ||
| 1141 | SIGTYPE | 1141 | static SIGTYPE |
| 1142 | handle_sigtstp (int signalnum) | 1142 | handle_sigtstp (int signalnum) |
| 1143 | { | 1143 | { |
| 1144 | int old_errno = errno; | 1144 | int old_errno = errno; |
| @@ -1162,7 +1162,7 @@ handle_sigtstp (int signalnum) | |||
| 1162 | 1162 | ||
| 1163 | /* Set up signal handlers before opening a frame on the current tty. */ | 1163 | /* Set up signal handlers before opening a frame on the current tty. */ |
| 1164 | 1164 | ||
| 1165 | void | 1165 | static void |
| 1166 | init_signals (void) | 1166 | init_signals (void) |
| 1167 | { | 1167 | { |
| 1168 | /* Set up signal handlers. */ | 1168 | /* Set up signal handlers. */ |
| @@ -1182,7 +1182,7 @@ init_signals (void) | |||
| 1182 | } | 1182 | } |
| 1183 | 1183 | ||
| 1184 | 1184 | ||
| 1185 | HSOCKET | 1185 | static HSOCKET |
| 1186 | set_local_socket (void) | 1186 | set_local_socket (void) |
| 1187 | { | 1187 | { |
| 1188 | HSOCKET s; | 1188 | HSOCKET s; |
| @@ -1331,7 +1331,7 @@ To start the server in Emacs, type \"M-x server-start\".\n", | |||
| 1331 | } | 1331 | } |
| 1332 | #endif /* ! NO_SOCKETS_IN_FILE_SYSTEM */ | 1332 | #endif /* ! NO_SOCKETS_IN_FILE_SYSTEM */ |
| 1333 | 1333 | ||
| 1334 | HSOCKET | 1334 | static HSOCKET |
| 1335 | set_socket (int no_exit_if_error) | 1335 | set_socket (int no_exit_if_error) |
| 1336 | { | 1336 | { |
| 1337 | HSOCKET s; | 1337 | HSOCKET s; |
| @@ -1447,7 +1447,7 @@ w32_give_focus (void) | |||
| 1447 | 1447 | ||
| 1448 | /* Start the emacs daemon and try to connect to it. */ | 1448 | /* Start the emacs daemon and try to connect to it. */ |
| 1449 | 1449 | ||
| 1450 | void | 1450 | static void |
| 1451 | start_daemon_and_retry_set_socket (void) | 1451 | start_daemon_and_retry_set_socket (void) |
| 1452 | { | 1452 | { |
| 1453 | #ifndef WINDOWSNT | 1453 | #ifndef WINDOWSNT |
| @@ -1722,7 +1722,7 @@ main (int argc, char **argv) | |||
| 1722 | 1722 | ||
| 1723 | if (rl <= 0) | 1723 | if (rl <= 0) |
| 1724 | break; | 1724 | break; |
| 1725 | 1725 | ||
| 1726 | string[rl] = '\0'; | 1726 | string[rl] = '\0'; |
| 1727 | 1727 | ||
| 1728 | p = string + strlen (string) - 1; | 1728 | p = string + strlen (string) - 1; |
diff --git a/lib-src/fakemail.c b/lib-src/fakemail.c index 4289e009e44..26375a61654 100644 --- a/lib-src/fakemail.c +++ b/lib-src/fakemail.c | |||
| @@ -198,7 +198,7 @@ xrealloc (long int *ptr, int size) | |||
| 198 | 198 | ||
| 199 | /* Initialize a linebuffer for use */ | 199 | /* Initialize a linebuffer for use */ |
| 200 | 200 | ||
| 201 | void | 201 | static void |
| 202 | init_linebuffer (struct linebuffer *linebuffer) | 202 | init_linebuffer (struct linebuffer *linebuffer) |
| 203 | { | 203 | { |
| 204 | linebuffer->size = INITIAL_LINE_SIZE; | 204 | linebuffer->size = INITIAL_LINE_SIZE; |
| @@ -208,7 +208,7 @@ init_linebuffer (struct linebuffer *linebuffer) | |||
| 208 | /* Read a line of text from `stream' into `linebuffer'. | 208 | /* Read a line of text from `stream' into `linebuffer'. |
| 209 | Return the length of the line. */ | 209 | Return the length of the line. */ |
| 210 | 210 | ||
| 211 | long | 211 | static long |
| 212 | readline (struct linebuffer *linebuffer, FILE *stream) | 212 | readline (struct linebuffer *linebuffer, FILE *stream) |
| 213 | { | 213 | { |
| 214 | char *buffer = linebuffer->buffer; | 214 | char *buffer = linebuffer->buffer; |
| @@ -243,7 +243,7 @@ readline (struct linebuffer *linebuffer, FILE *stream) | |||
| 243 | 243 | ||
| 244 | If there is no keyword, return NULL and don't alter *REST. */ | 244 | If there is no keyword, return NULL and don't alter *REST. */ |
| 245 | 245 | ||
| 246 | char * | 246 | static char * |
| 247 | get_keyword (register char *field, char **rest) | 247 | get_keyword (register char *field, char **rest) |
| 248 | { | 248 | { |
| 249 | static char keyword[KEYWORD_SIZE]; | 249 | static char keyword[KEYWORD_SIZE]; |
| @@ -268,7 +268,7 @@ get_keyword (register char *field, char **rest) | |||
| 268 | 268 | ||
| 269 | /* Nonzero if the string FIELD starts with a colon-terminated keyword. */ | 269 | /* Nonzero if the string FIELD starts with a colon-terminated keyword. */ |
| 270 | 270 | ||
| 271 | boolean | 271 | static boolean |
| 272 | has_keyword (char *field) | 272 | has_keyword (char *field) |
| 273 | { | 273 | { |
| 274 | char *ignored; | 274 | char *ignored; |
| @@ -285,7 +285,7 @@ has_keyword (char *field) | |||
| 285 | We don't pay attention to overflowing WHERE; | 285 | We don't pay attention to overflowing WHERE; |
| 286 | the caller has to make it big enough. */ | 286 | the caller has to make it big enough. */ |
| 287 | 287 | ||
| 288 | char * | 288 | static char * |
| 289 | add_field (line_list the_list, register char *field, register char *where) | 289 | add_field (line_list the_list, register char *field, register char *where) |
| 290 | { | 290 | { |
| 291 | register char c; | 291 | register char c; |
| @@ -341,7 +341,7 @@ add_field (line_list the_list, register char *field, register char *where) | |||
| 341 | return where; | 341 | return where; |
| 342 | } | 342 | } |
| 343 | 343 | ||
| 344 | line_list | 344 | static line_list |
| 345 | make_file_preface (void) | 345 | make_file_preface (void) |
| 346 | { | 346 | { |
| 347 | char *the_string, *temp; | 347 | char *the_string, *temp; |
| @@ -385,7 +385,7 @@ make_file_preface (void) | |||
| 385 | return result; | 385 | return result; |
| 386 | } | 386 | } |
| 387 | 387 | ||
| 388 | void | 388 | static void |
| 389 | write_line_list (register line_list the_list, FILE *the_stream) | 389 | write_line_list (register line_list the_list, FILE *the_stream) |
| 390 | { | 390 | { |
| 391 | for ( ; | 391 | for ( ; |
| @@ -398,7 +398,7 @@ write_line_list (register line_list the_list, FILE *the_stream) | |||
| 398 | return; | 398 | return; |
| 399 | } | 399 | } |
| 400 | 400 | ||
| 401 | int | 401 | static int |
| 402 | close_the_streams (void) | 402 | close_the_streams (void) |
| 403 | { | 403 | { |
| 404 | register stream_list rem; | 404 | register stream_list rem; |
| @@ -411,7 +411,7 @@ close_the_streams (void) | |||
| 411 | return (no_problems ? EXIT_SUCCESS : EXIT_FAILURE); | 411 | return (no_problems ? EXIT_SUCCESS : EXIT_FAILURE); |
| 412 | } | 412 | } |
| 413 | 413 | ||
| 414 | void | 414 | static void |
| 415 | add_a_stream (FILE *the_stream, int (*closing_action) (FILE *)) | 415 | add_a_stream (FILE *the_stream, int (*closing_action) (FILE *)) |
| 416 | { | 416 | { |
| 417 | stream_list old = the_streams; | 417 | stream_list old = the_streams; |
| @@ -422,7 +422,7 @@ add_a_stream (FILE *the_stream, int (*closing_action) (FILE *)) | |||
| 422 | return; | 422 | return; |
| 423 | } | 423 | } |
| 424 | 424 | ||
| 425 | int | 425 | static int |
| 426 | my_fclose (FILE *the_file) | 426 | my_fclose (FILE *the_file) |
| 427 | { | 427 | { |
| 428 | putc ('\n', the_file); | 428 | putc ('\n', the_file); |
| @@ -430,7 +430,7 @@ my_fclose (FILE *the_file) | |||
| 430 | return fclose (the_file); | 430 | return fclose (the_file); |
| 431 | } | 431 | } |
| 432 | 432 | ||
| 433 | boolean | 433 | static boolean |
| 434 | open_a_file (char *name) | 434 | open_a_file (char *name) |
| 435 | { | 435 | { |
| 436 | FILE *the_stream = fopen (name, "a"); | 436 | FILE *the_stream = fopen (name, "a"); |
| @@ -445,7 +445,7 @@ open_a_file (char *name) | |||
| 445 | return false; | 445 | return false; |
| 446 | } | 446 | } |
| 447 | 447 | ||
| 448 | void | 448 | static void |
| 449 | put_string (char *s) | 449 | put_string (char *s) |
| 450 | { | 450 | { |
| 451 | register stream_list rem; | 451 | register stream_list rem; |
| @@ -456,7 +456,7 @@ put_string (char *s) | |||
| 456 | return; | 456 | return; |
| 457 | } | 457 | } |
| 458 | 458 | ||
| 459 | void | 459 | static void |
| 460 | put_line (const char *string) | 460 | put_line (const char *string) |
| 461 | { | 461 | { |
| 462 | register stream_list rem; | 462 | register stream_list rem; |
| @@ -516,7 +516,7 @@ put_line (const char *string) | |||
| 516 | the header name), and THE_LIST holds the continuation lines if any. | 516 | the header name), and THE_LIST holds the continuation lines if any. |
| 517 | Call open_a_file for each file. */ | 517 | Call open_a_file for each file. */ |
| 518 | 518 | ||
| 519 | void | 519 | static void |
| 520 | setup_files (register line_list the_list, register char *field) | 520 | setup_files (register line_list the_list, register char *field) |
| 521 | { | 521 | { |
| 522 | register char *start; | 522 | register char *start; |
| @@ -552,7 +552,7 @@ setup_files (register line_list the_list, register char *field) | |||
| 552 | /* Compute the total size of all recipient names stored in THE_HEADER. | 552 | /* Compute the total size of all recipient names stored in THE_HEADER. |
| 553 | The result says how big to make the buffer to pass to parse_header. */ | 553 | The result says how big to make the buffer to pass to parse_header. */ |
| 554 | 554 | ||
| 555 | int | 555 | static int |
| 556 | args_size (header the_header) | 556 | args_size (header the_header) |
| 557 | { | 557 | { |
| 558 | register header old = the_header; | 558 | register header old = the_header; |
| @@ -583,7 +583,7 @@ args_size (header the_header) | |||
| 583 | 583 | ||
| 584 | Also, if the header has any FCC fields, call setup_files for each one. */ | 584 | Also, if the header has any FCC fields, call setup_files for each one. */ |
| 585 | 585 | ||
| 586 | void | 586 | static void |
| 587 | parse_header (header the_header, register char *where) | 587 | parse_header (header the_header, register char *where) |
| 588 | { | 588 | { |
| 589 | register header old = the_header; | 589 | register header old = the_header; |
| @@ -615,7 +615,7 @@ parse_header (header the_header, register char *where) | |||
| 615 | one for each line in that field. | 615 | one for each line in that field. |
| 616 | Continuation lines are grouped in the headers they continue. */ | 616 | Continuation lines are grouped in the headers they continue. */ |
| 617 | 617 | ||
| 618 | header | 618 | static header |
| 619 | read_header (void) | 619 | read_header (void) |
| 620 | { | 620 | { |
| 621 | register header the_header = ((header) NULL); | 621 | register header the_header = ((header) NULL); |
| @@ -669,7 +669,7 @@ read_header (void) | |||
| 669 | return the_header->next; | 669 | return the_header->next; |
| 670 | } | 670 | } |
| 671 | 671 | ||
| 672 | void | 672 | static void |
| 673 | write_header (header the_header) | 673 | write_header (header the_header) |
| 674 | { | 674 | { |
| 675 | register header old = the_header; | 675 | register header old = the_header; |
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index 93994c1ed3e..4dd6e8efb14 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c | |||
| @@ -66,12 +66,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 66 | #define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP) | 66 | #define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP) |
| 67 | #endif | 67 | #endif |
| 68 | 68 | ||
| 69 | int scan_file (char *filename); | 69 | static int scan_file (char *filename); |
| 70 | int scan_lisp_file (const char *filename, const char *mode); | 70 | static int scan_lisp_file (const char *filename, const char *mode); |
| 71 | int scan_c_file (char *filename, const char *mode); | 71 | static int scan_c_file (char *filename, const char *mode); |
| 72 | void fatal (const char *s1, const char *s2) NO_RETURN; | 72 | static void fatal (const char *s1, const char *s2) NO_RETURN; |
| 73 | void start_globals (void); | 73 | static void start_globals (void); |
| 74 | void write_globals (void); | 74 | static void write_globals (void); |
| 75 | 75 | ||
| 76 | #ifdef MSDOS | 76 | #ifdef MSDOS |
| 77 | /* s/msdos.h defines this as sys_chdir, but we're not linking with the | 77 | /* s/msdos.h defines this as sys_chdir, but we're not linking with the |
| @@ -93,7 +93,7 @@ int generate_globals; | |||
| 93 | /* Print error message. `s1' is printf control string, `s2' is arg for it. */ | 93 | /* Print error message. `s1' is printf control string, `s2' is arg for it. */ |
| 94 | 94 | ||
| 95 | /* VARARGS1 */ | 95 | /* VARARGS1 */ |
| 96 | void | 96 | static void |
| 97 | error (const char *s1, const char *s2) | 97 | error (const char *s1, const char *s2) |
| 98 | { | 98 | { |
| 99 | fprintf (stderr, "%s: ", progname); | 99 | fprintf (stderr, "%s: ", progname); |
| @@ -104,7 +104,7 @@ error (const char *s1, const char *s2) | |||
| 104 | /* Print error message and exit. */ | 104 | /* Print error message and exit. */ |
| 105 | 105 | ||
| 106 | /* VARARGS1 */ | 106 | /* VARARGS1 */ |
| 107 | void | 107 | static void |
| 108 | fatal (const char *s1, const char *s2) | 108 | fatal (const char *s1, const char *s2) |
| 109 | { | 109 | { |
| 110 | error (s1, s2); | 110 | error (s1, s2); |
| @@ -113,7 +113,7 @@ fatal (const char *s1, const char *s2) | |||
| 113 | 113 | ||
| 114 | /* Like malloc but get fatal error if memory is exhausted. */ | 114 | /* Like malloc but get fatal error if memory is exhausted. */ |
| 115 | 115 | ||
| 116 | void * | 116 | static void * |
| 117 | xmalloc (unsigned int size) | 117 | xmalloc (unsigned int size) |
| 118 | { | 118 | { |
| 119 | void *result = (void *) malloc (size); | 119 | void *result = (void *) malloc (size); |
| @@ -124,7 +124,7 @@ xmalloc (unsigned int size) | |||
| 124 | 124 | ||
| 125 | /* Like realloc but get fatal error if memory is exhausted. */ | 125 | /* Like realloc but get fatal error if memory is exhausted. */ |
| 126 | 126 | ||
| 127 | void * | 127 | static void * |
| 128 | xrealloc (void *arg, unsigned int size) | 128 | xrealloc (void *arg, unsigned int size) |
| 129 | { | 129 | { |
| 130 | void *result = (void *) realloc (arg, size); | 130 | void *result = (void *) realloc (arg, size); |
| @@ -212,7 +212,7 @@ main (int argc, char **argv) | |||
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | /* Add a source file name boundary marker in the output file. */ | 214 | /* Add a source file name boundary marker in the output file. */ |
| 215 | void | 215 | static void |
| 216 | put_filename (char *filename) | 216 | put_filename (char *filename) |
| 217 | { | 217 | { |
| 218 | char *tmp; | 218 | char *tmp; |
| @@ -231,7 +231,7 @@ put_filename (char *filename) | |||
| 231 | /* Read file FILENAME and output its doc strings to outfile. */ | 231 | /* Read file FILENAME and output its doc strings to outfile. */ |
| 232 | /* Return 1 if file is not found, 0 if it is found. */ | 232 | /* Return 1 if file is not found, 0 if it is found. */ |
| 233 | 233 | ||
| 234 | int | 234 | static int |
| 235 | scan_file (char *filename) | 235 | scan_file (char *filename) |
| 236 | { | 236 | { |
| 237 | 237 | ||
| @@ -247,7 +247,7 @@ scan_file (char *filename) | |||
| 247 | return scan_c_file (filename, READ_TEXT); | 247 | return scan_c_file (filename, READ_TEXT); |
| 248 | } | 248 | } |
| 249 | 249 | ||
| 250 | void | 250 | static void |
| 251 | start_globals (void) | 251 | start_globals (void) |
| 252 | { | 252 | { |
| 253 | fprintf (outfile, "/* This file was auto-generated by make-docfile. */\n"); | 253 | fprintf (outfile, "/* This file was auto-generated by make-docfile. */\n"); |
| @@ -255,7 +255,7 @@ start_globals (void) | |||
| 255 | fprintf (outfile, "struct emacs_globals {\n"); | 255 | fprintf (outfile, "struct emacs_globals {\n"); |
| 256 | } | 256 | } |
| 257 | 257 | ||
| 258 | char buf[128]; | 258 | static char buf[128]; |
| 259 | 259 | ||
| 260 | /* Some state during the execution of `read_c_string_or_comment'. */ | 260 | /* Some state during the execution of `read_c_string_or_comment'. */ |
| 261 | struct rcsoc_state | 261 | struct rcsoc_state |
| @@ -388,7 +388,7 @@ scan_keyword_or_put_char (int ch, struct rcsoc_state *state) | |||
| 388 | at the beginning of a line will be removed, and *SAW_USAGE set to | 388 | at the beginning of a line will be removed, and *SAW_USAGE set to |
| 389 | true if any were encountered. */ | 389 | true if any were encountered. */ |
| 390 | 390 | ||
| 391 | int | 391 | static int |
| 392 | read_c_string_or_comment (FILE *infile, int printflag, int comment, int *saw_usage) | 392 | read_c_string_or_comment (FILE *infile, int printflag, int comment, int *saw_usage) |
| 393 | { | 393 | { |
| 394 | register int c; | 394 | register int c; |
| @@ -476,7 +476,7 @@ read_c_string_or_comment (FILE *infile, int printflag, int comment, int *saw_usa | |||
| 476 | /* Write to file OUT the argument names of function FUNC, whose text is in BUF. | 476 | /* Write to file OUT the argument names of function FUNC, whose text is in BUF. |
| 477 | MINARGS and MAXARGS are the minimum and maximum number of arguments. */ | 477 | MINARGS and MAXARGS are the minimum and maximum number of arguments. */ |
| 478 | 478 | ||
| 479 | void | 479 | static void |
| 480 | write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs) | 480 | write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs) |
| 481 | { | 481 | { |
| 482 | register char *p; | 482 | register char *p; |
| @@ -610,7 +610,7 @@ compare_globals (const void *a, const void *b) | |||
| 610 | return strcmp (ga->name, gb->name); | 610 | return strcmp (ga->name, gb->name); |
| 611 | } | 611 | } |
| 612 | 612 | ||
| 613 | void | 613 | static void |
| 614 | write_globals (void) | 614 | write_globals (void) |
| 615 | { | 615 | { |
| 616 | int i; | 616 | int i; |
| @@ -652,7 +652,7 @@ write_globals (void) | |||
| 652 | Looks for DEFUN constructs such as are defined in ../src/lisp.h. | 652 | Looks for DEFUN constructs such as are defined in ../src/lisp.h. |
| 653 | Accepts any word starting DEF... so it finds DEFSIMPLE and DEFPRED. */ | 653 | Accepts any word starting DEF... so it finds DEFSIMPLE and DEFPRED. */ |
| 654 | 654 | ||
| 655 | int | 655 | static int |
| 656 | scan_c_file (char *filename, const char *mode) | 656 | scan_c_file (char *filename, const char *mode) |
| 657 | { | 657 | { |
| 658 | FILE *infile; | 658 | FILE *infile; |
| @@ -979,7 +979,7 @@ scan_c_file (char *filename, const char *mode) | |||
| 979 | An entry is output only if DOCSTRING has \ newline just after the opening " | 979 | An entry is output only if DOCSTRING has \ newline just after the opening " |
| 980 | */ | 980 | */ |
| 981 | 981 | ||
| 982 | void | 982 | static void |
| 983 | skip_white (FILE *infile) | 983 | skip_white (FILE *infile) |
| 984 | { | 984 | { |
| 985 | char c = ' '; | 985 | char c = ' '; |
| @@ -988,7 +988,7 @@ skip_white (FILE *infile) | |||
| 988 | ungetc (c, infile); | 988 | ungetc (c, infile); |
| 989 | } | 989 | } |
| 990 | 990 | ||
| 991 | void | 991 | static void |
| 992 | read_lisp_symbol (FILE *infile, char *buffer) | 992 | read_lisp_symbol (FILE *infile, char *buffer) |
| 993 | { | 993 | { |
| 994 | char c; | 994 | char c; |
| @@ -1016,7 +1016,7 @@ read_lisp_symbol (FILE *infile, char *buffer) | |||
| 1016 | skip_white (infile); | 1016 | skip_white (infile); |
| 1017 | } | 1017 | } |
| 1018 | 1018 | ||
| 1019 | int | 1019 | static int |
| 1020 | scan_lisp_file (const char *filename, const char *mode) | 1020 | scan_lisp_file (const char *filename, const char *mode) |
| 1021 | { | 1021 | { |
| 1022 | FILE *infile; | 1022 | FILE *infile; |
diff --git a/lib-src/movemail.c b/lib-src/movemail.c index 682aa10aa39..a63e858613c 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c | |||
| @@ -161,7 +161,7 @@ static int mbx_delimit_end (FILE *mbf); | |||
| 161 | #endif | 161 | #endif |
| 162 | 162 | ||
| 163 | /* Nonzero means this is name of a lock file to delete on fatal error. */ | 163 | /* Nonzero means this is name of a lock file to delete on fatal error. */ |
| 164 | char *delete_lockname; | 164 | static char *delete_lockname; |
| 165 | 165 | ||
| 166 | int | 166 | int |
| 167 | main (int argc, char **argv) | 167 | main (int argc, char **argv) |
| @@ -672,12 +672,12 @@ xmalloc (unsigned int size) | |||
| 672 | #define OK 0 | 672 | #define OK 0 |
| 673 | #define DONE 1 | 673 | #define DONE 1 |
| 674 | 674 | ||
| 675 | char *progname; | 675 | static char *progname; |
| 676 | FILE *sfi; | 676 | static FILE *sfi; |
| 677 | FILE *sfo; | 677 | static FILE *sfo; |
| 678 | char ibuffer[BUFSIZ]; | 678 | static char ibuffer[BUFSIZ]; |
| 679 | char obuffer[BUFSIZ]; | 679 | static char obuffer[BUFSIZ]; |
| 680 | char Errmsg[200]; /* POP errors, at least, can exceed | 680 | static char Errmsg[200]; /* POP errors, at least, can exceed |
| 681 | the original length of 80. */ | 681 | the original length of 80. */ |
| 682 | 682 | ||
| 683 | /* | 683 | /* |
diff --git a/lib-src/profile.c b/lib-src/profile.c index 9ce9993f4b1..086d8cc3e9d 100644 --- a/lib-src/profile.c +++ b/lib-src/profile.c | |||
| @@ -38,7 +38,7 @@ static char time_string[30]; | |||
| 38 | 38 | ||
| 39 | /* Reset the stopwatch to zero. */ | 39 | /* Reset the stopwatch to zero. */ |
| 40 | 40 | ||
| 41 | void | 41 | static void |
| 42 | reset_watch (void) | 42 | reset_watch (void) |
| 43 | { | 43 | { |
| 44 | EMACS_GET_TIME (TV1); | 44 | EMACS_GET_TIME (TV1); |
| @@ -49,7 +49,7 @@ reset_watch (void) | |||
| 49 | is returned as a string with the format <seconds>.<micro-seconds> | 49 | is returned as a string with the format <seconds>.<micro-seconds> |
| 50 | If reset_watch was not called yet, exit. */ | 50 | If reset_watch was not called yet, exit. */ |
| 51 | 51 | ||
| 52 | char * | 52 | static char * |
| 53 | get_time (void) | 53 | get_time (void) |
| 54 | { | 54 | { |
| 55 | if (watch_not_started) | 55 | if (watch_not_started) |
diff --git a/lib-src/test-distrib.c b/lib-src/test-distrib.c index acfb147325b..c27f0e35b07 100644 --- a/lib-src/test-distrib.c +++ b/lib-src/test-distrib.c | |||
| @@ -26,18 +26,18 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 26 | /* Break string in two parts to avoid buggy C compilers that ignore characters | 26 | /* Break string in two parts to avoid buggy C compilers that ignore characters |
| 27 | after nulls in strings. */ | 27 | after nulls in strings. */ |
| 28 | 28 | ||
| 29 | char string1[] = "Testing distribution of nonprinting chars:\n\ | 29 | static char string1[] = "Testing distribution of nonprinting chars:\n\ |
| 30 | Should be 0177: \177 Should be 0377: \377 Should be 0212: \212.\n\ | 30 | Should be 0177: \177 Should be 0377: \377 Should be 0212: \212.\n\ |
| 31 | Should be 0000: "; | 31 | Should be 0000: "; |
| 32 | 32 | ||
| 33 | char string2[] = ".\n\ | 33 | static char string2[] = ".\n\ |
| 34 | This file is read by the `test-distribution' program.\n\ | 34 | This file is read by the `test-distribution' program.\n\ |
| 35 | If you change it, you will make that program fail.\n"; | 35 | If you change it, you will make that program fail.\n"; |
| 36 | 36 | ||
| 37 | char buf[300]; | 37 | static char buf[300]; |
| 38 | 38 | ||
| 39 | /* Like `read' but keeps trying until it gets SIZE bytes or reaches eof. */ | 39 | /* Like `read' but keeps trying until it gets SIZE bytes or reaches eof. */ |
| 40 | int | 40 | static int |
| 41 | cool_read (int fd, char *buf, size_t size) | 41 | cool_read (int fd, char *buf, size_t size) |
| 42 | { | 42 | { |
| 43 | ssize_t num; | 43 | ssize_t num; |
diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c index 9466bf7b149..70b79a64f91 100644 --- a/lib-src/update-game-score.c +++ b/lib-src/update-game-score.c | |||
| @@ -57,7 +57,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 57 | extern char *optarg; | 57 | extern char *optarg; |
| 58 | extern int optind, opterr; | 58 | extern int optind, opterr; |
| 59 | 59 | ||
| 60 | int usage (int err) NO_RETURN; | 60 | static int usage (int err) NO_RETURN; |
| 61 | 61 | ||
| 62 | #define MAX_ATTEMPTS 5 | 62 | #define MAX_ATTEMPTS 5 |
| 63 | #define MAX_SCORES 200 | 63 | #define MAX_SCORES 200 |
| @@ -68,7 +68,7 @@ int usage (int err) NO_RETURN; | |||
| 68 | #define difftime(t1, t0) (double)((t1) - (t0)) | 68 | #define difftime(t1, t0) (double)((t1) - (t0)) |
| 69 | #endif | 69 | #endif |
| 70 | 70 | ||
| 71 | int | 71 | static int |
| 72 | usage (int err) | 72 | usage (int err) |
| 73 | { | 73 | { |
| 74 | fprintf (stdout, "Usage: update-game-score [-m MAX ] [ -r ] game/scorefile SCORE DATA\n"); | 74 | fprintf (stdout, "Usage: update-game-score [-m MAX ] [ -r ] game/scorefile SCORE DATA\n"); |
| @@ -80,8 +80,8 @@ usage (int err) | |||
| 80 | exit (err); | 80 | exit (err); |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | int lock_file (const char *filename, void **state); | 83 | static int lock_file (const char *filename, void **state); |
| 84 | int unlock_file (const char *filename, void *state); | 84 | static int unlock_file (const char *filename, void *state); |
| 85 | 85 | ||
| 86 | struct score_entry | 86 | struct score_entry |
| 87 | { | 87 | { |
| @@ -90,24 +90,24 @@ struct score_entry | |||
| 90 | char *data; | 90 | char *data; |
| 91 | }; | 91 | }; |
| 92 | 92 | ||
| 93 | int read_scores (const char *filename, struct score_entry **scores, | 93 | static int read_scores (const char *filename, struct score_entry **scores, |
| 94 | int *count); | 94 | int *count); |
| 95 | int push_score (struct score_entry **scores, int *count, | 95 | static int push_score (struct score_entry **scores, int *count, |
| 96 | int newscore, char *username, char *newdata); | 96 | int newscore, char *username, char *newdata); |
| 97 | void sort_scores (struct score_entry *scores, int count, int reverse); | 97 | static void sort_scores (struct score_entry *scores, int count, int reverse); |
| 98 | int write_scores (const char *filename, const struct score_entry *scores, | 98 | static int write_scores (const char *filename, |
| 99 | int count); | 99 | const struct score_entry *scores, int count); |
| 100 | 100 | ||
| 101 | void lose (const char *msg) NO_RETURN; | 101 | static void lose (const char *msg) NO_RETURN; |
| 102 | 102 | ||
| 103 | void | 103 | static void |
| 104 | lose (const char *msg) | 104 | lose (const char *msg) |
| 105 | { | 105 | { |
| 106 | fprintf (stderr, "%s\n", msg); | 106 | fprintf (stderr, "%s\n", msg); |
| 107 | exit (EXIT_FAILURE); | 107 | exit (EXIT_FAILURE); |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | void lose_syserr (const char *msg) NO_RETURN; | 110 | static void lose_syserr (const char *msg) NO_RETURN; |
| 111 | 111 | ||
| 112 | /* Taken from sysdep.c. */ | 112 | /* Taken from sysdep.c. */ |
| 113 | #ifndef HAVE_STRERROR | 113 | #ifndef HAVE_STRERROR |
| @@ -126,14 +126,14 @@ strerror (errnum) | |||
| 126 | #endif /* not WINDOWSNT */ | 126 | #endif /* not WINDOWSNT */ |
| 127 | #endif /* ! HAVE_STRERROR */ | 127 | #endif /* ! HAVE_STRERROR */ |
| 128 | 128 | ||
| 129 | void | 129 | static void |
| 130 | lose_syserr (const char *msg) | 130 | lose_syserr (const char *msg) |
| 131 | { | 131 | { |
| 132 | fprintf (stderr, "%s: %s\n", msg, strerror (errno)); | 132 | fprintf (stderr, "%s: %s\n", msg, strerror (errno)); |
| 133 | exit (EXIT_FAILURE); | 133 | exit (EXIT_FAILURE); |
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | char * | 136 | static char * |
| 137 | get_user_id (void) | 137 | get_user_id (void) |
| 138 | { | 138 | { |
| 139 | char *name; | 139 | char *name; |
| @@ -154,7 +154,7 @@ get_user_id (void) | |||
| 154 | return buf->pw_name; | 154 | return buf->pw_name; |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | const char * | 157 | static const char * |
| 158 | get_prefix (int running_suid, const char *user_prefix) | 158 | get_prefix (int running_suid, const char *user_prefix) |
| 159 | { | 159 | { |
| 160 | if (!running_suid && user_prefix == NULL) | 160 | if (!running_suid && user_prefix == NULL) |
| @@ -258,7 +258,7 @@ main (int argc, char **argv) | |||
| 258 | exit (EXIT_SUCCESS); | 258 | exit (EXIT_SUCCESS); |
| 259 | } | 259 | } |
| 260 | 260 | ||
| 261 | int | 261 | static int |
| 262 | read_score (FILE *f, struct score_entry *score) | 262 | read_score (FILE *f, struct score_entry *score) |
| 263 | { | 263 | { |
| 264 | int c; | 264 | int c; |
| @@ -342,7 +342,7 @@ read_score (FILE *f, struct score_entry *score) | |||
| 342 | return 0; | 342 | return 0; |
| 343 | } | 343 | } |
| 344 | 344 | ||
| 345 | int | 345 | static int |
| 346 | read_scores (const char *filename, struct score_entry **scores, int *count) | 346 | read_scores (const char *filename, struct score_entry **scores, int *count) |
| 347 | { | 347 | { |
| 348 | int readval, scorecount, cursize; | 348 | int readval, scorecount, cursize; |
| @@ -375,7 +375,7 @@ read_scores (const char *filename, struct score_entry **scores, int *count) | |||
| 375 | return 0; | 375 | return 0; |
| 376 | } | 376 | } |
| 377 | 377 | ||
| 378 | int | 378 | static int |
| 379 | score_compare (const void *a, const void *b) | 379 | score_compare (const void *a, const void *b) |
| 380 | { | 380 | { |
| 381 | const struct score_entry *sa = (const struct score_entry *) a; | 381 | const struct score_entry *sa = (const struct score_entry *) a; |
| @@ -383,7 +383,7 @@ score_compare (const void *a, const void *b) | |||
| 383 | return (sb->score > sa->score) - (sb->score < sa->score); | 383 | return (sb->score > sa->score) - (sb->score < sa->score); |
| 384 | } | 384 | } |
| 385 | 385 | ||
| 386 | int | 386 | static int |
| 387 | score_compare_reverse (const void *a, const void *b) | 387 | score_compare_reverse (const void *a, const void *b) |
| 388 | { | 388 | { |
| 389 | const struct score_entry *sa = (const struct score_entry *) a; | 389 | const struct score_entry *sa = (const struct score_entry *) a; |
| @@ -407,14 +407,14 @@ push_score (struct score_entry **scores, int *count, int newscore, char *usernam | |||
| 407 | return 0; | 407 | return 0; |
| 408 | } | 408 | } |
| 409 | 409 | ||
| 410 | void | 410 | static void |
| 411 | sort_scores (struct score_entry *scores, int count, int reverse) | 411 | sort_scores (struct score_entry *scores, int count, int reverse) |
| 412 | { | 412 | { |
| 413 | qsort (scores, count, sizeof (struct score_entry), | 413 | qsort (scores, count, sizeof (struct score_entry), |
| 414 | reverse ? score_compare_reverse : score_compare); | 414 | reverse ? score_compare_reverse : score_compare); |
| 415 | } | 415 | } |
| 416 | 416 | ||
| 417 | int | 417 | static int |
| 418 | write_scores (const char *filename, const struct score_entry *scores, int count) | 418 | write_scores (const char *filename, const struct score_entry *scores, int count) |
| 419 | { | 419 | { |
| 420 | FILE *f; | 420 | FILE *f; |
| @@ -443,7 +443,7 @@ write_scores (const char *filename, const struct score_entry *scores, int count) | |||
| 443 | return 0; | 443 | return 0; |
| 444 | } | 444 | } |
| 445 | 445 | ||
| 446 | int | 446 | static int |
| 447 | lock_file (const char *filename, void **state) | 447 | lock_file (const char *filename, void **state) |
| 448 | { | 448 | { |
| 449 | int fd; | 449 | int fd; |
| @@ -484,7 +484,7 @@ lock_file (const char *filename, void **state) | |||
| 484 | return 0; | 484 | return 0; |
| 485 | } | 485 | } |
| 486 | 486 | ||
| 487 | int | 487 | static int |
| 488 | unlock_file (const char *filename, void *state) | 488 | unlock_file (const char *filename, void *state) |
| 489 | { | 489 | { |
| 490 | char *lockpath = (char *) state; | 490 | char *lockpath = (char *) state; |