aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog9
-rw-r--r--lib-src/ebrowse.c185
-rw-r--r--lib-src/emacsclient.c48
-rw-r--r--lib-src/fakemail.c36
-rw-r--r--lib-src/make-docfile.c42
-rw-r--r--lib-src/movemail.c14
-rw-r--r--lib-src/profile.c4
-rw-r--r--lib-src/test-distrib.c8
-rw-r--r--lib-src/update-game-score.c50
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 @@
12011-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
12011-02-20 Juanma Barranquero <lekktu@gmail.com> 102011-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
468int yylex (void); 468static char *matching_regexp (void);
469void yyparse (void); 469static struct sym *add_sym (const char *, struct sym *);
470void re_init_parser (void); 470static void add_global_defn (char *, char *, int, unsigned, int, int, int);
471const char *token_string (int); 471static void add_global_decl (char *, char *, int, unsigned, int, int, int);
472char *matching_regexp (void); 472static struct member *add_member (struct sym *, char *, int, int, unsigned);
473void init_sym (void); 473static void class_definition (struct sym *, int, int, int);
474struct sym *add_sym (const char *, struct sym *); 474static char *operator_name (int *);
475void add_link (struct sym *, struct sym *); 475static void parse_qualified_param_ident_or_type (char **);
476void add_member_defn (struct sym *, char *, char *, 476static void usage (int) NO_RETURN;
477 int, unsigned, int, int, int); 477static void version (void) NO_RETURN;
478void add_member_decl (struct sym *, char *, char *, int,
479 unsigned, int, int, int, int);
480void dump_roots (FILE *);
481void *xmalloc (int);
482void xfree (void *);
483void add_global_defn (char *, char *, int, unsigned, int, int, int);
484void add_global_decl (char *, char *, int, unsigned, int, int, int);
485void add_define (char *, char *, int);
486void mark_inherited_virtual (void);
487void leave_namespace (void);
488void enter_namespace (char *);
489void register_namespace_alias (char *, struct link *);
490void insert_keyword (const char *, int);
491void re_init_scanner (void);
492void init_scanner (void);
493void process_file (char *);
494void add_search_path (char *);
495FILE *open_file (char *);
496int process_pp_line (void);
497int dump_members (FILE *, struct member *);
498void dump_sym (FILE *, struct sym *);
499int dump_tree (FILE *, struct sym *);
500struct member *find_member (struct sym *, char *, int, int, unsigned);
501struct member *add_member (struct sym *, char *, int, int, unsigned);
502void mark_virtual (struct sym *);
503struct sym *make_namespace (char *, struct sym *);
504char *sym_scope (struct sym *);
505char *sym_scope_1 (struct sym *);
506int skip_to (int);
507void skip_matching (void);
508void member (struct sym *, int);
509void class_body (struct sym *, int);
510void class_definition (struct sym *, int, int, int);
511void declaration (int);
512unsigned parm_list (int *);
513char *operator_name (int *);
514struct sym *parse_classname (void);
515struct sym *parse_qualified_ident_or_type (char **);
516void parse_qualified_param_ident_or_type (char **);
517int globals (int);
518void yyerror (const char *, const char *);
519void usage (int) NO_RETURN;
520void 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
531void 488static void
532yyerror (const char *format, const char *s) 489yyerror (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
543void * 500static void *
544xmalloc (int nbytes) 501xmalloc (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
558void * 515static void *
559xrealloc (void *p, int sz) 516xrealloc (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
574char * 531static char *
575xstrdup (char *s) 532xstrdup (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
591void 548static void
592init_sym (void) 549init_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
605struct sym * 562static struct sym *
606add_sym (const char *name, struct sym *nested_in_class) 563add_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
646void 603static void
647add_link (struct sym *super, struct sym *sub) 604add_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
686struct member * 643static struct member *
687find_member (struct sym *cls, char *name, int var, int sc, unsigned int hash) 644find_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
736void 693static void
737add_member_decl (struct sym *cls, char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int vis, int flags) 694add_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
784void 741static void
785add_member_defn (struct sym *cls, char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int flags) 742add_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
826void 783static void
827add_define (char *name, char *regexp, int pos) 784add_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
844void 801static void
845add_global_defn (char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int flags) 802add_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
875void 832static void
876add_global_decl (char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int flags) 833add_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
914struct member * 871static struct member *
915add_member (struct sym *cls, char *name, int var, int sc, unsigned int hash) 872add_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
985void 942static void
986mark_virtual (struct sym *r) 943mark_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
1009void 966static void
1010mark_inherited_virtual (void) 967mark_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
1024struct sym * 981static struct sym *
1025make_namespace (char *name, struct sym *context) 982make_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
1039struct sym * 996static struct sym *
1040check_namespace (char *name, struct sym *context) 997check_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
1056struct sym * 1013static struct sym *
1057find_namespace (char *name, struct sym *context) 1014find_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
1070struct link * 1027static struct link *
1071check_namespace_alias (char *name) 1028check_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
1094void 1051static void
1095register_namespace_alias (char *new_name, struct link *old_name) 1052register_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
1122void 1079static void
1123enter_namespace (char *name) 1080enter_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
1143void 1100static void
1144leave_namespace (void) 1101leave_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
1185void 1142static void
1186ensure_scope_buffer_room (int len) 1143ensure_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
1201char * 1158static char *
1202sym_scope_1 (struct sym *p) 1159sym_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
1235char * 1192static char *
1236sym_scope (struct sym *p) 1193sym_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
1257int 1214static int
1258dump_members (FILE *fp, struct member *m) 1215dump_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
1290void 1247static void
1291dump_sym (FILE *fp, struct sym *root) 1248dump_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
1316int 1273static int
1317dump_tree (FILE *fp, struct sym *root) 1274dump_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
1363void 1320static void
1364dump_roots (FILE *fp) 1321dump_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
1437int 1394static int
1438process_pp_line (void) 1395process_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
1508int 1465static int
1509yylex (void) 1466yylex (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
1930char * 1887static char *
1931matching_regexp (void) 1888matching_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
1981const char * 1938static const char *
1982token_string (int t) 1939token_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
2098void 2055static void
2099re_init_scanner (void) 2056re_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
2116void 2073static void
2117insert_keyword (const char *name, int tk) 2074insert_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
2137void 2094static void
2138init_scanner (void) 2095init_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
2281int 2238static int
2282skip_to (int token) 2239skip_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
2292void 2249static void
2293skip_matching (void) 2250skip_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
2335void 2292static void
2336skip_initializer (void) 2293skip_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
2362struct link * 2319static struct link *
2363match_qualified_namespace_alias (void) 2320match_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
2399void 2356static void
2400re_init_parser (void) 2357re_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
2412unsigned 2369static unsigned
2413parm_list (int *flags) 2370parm_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
2525void 2482static void
2526print_info (void) 2483print_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
2540void 2497static void
2541member (struct sym *cls, int vis) 2498member (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
2749void 2706static void
2750class_body (struct sym *cls, int tag) 2707class_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
2810struct sym * 2767static struct sym *
2811parse_classname (void) 2768parse_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
2840char * 2797static char *
2841operator_name (int *sc) 2798operator_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
2930struct sym * 2887static struct sym *
2931parse_qualified_ident_or_type (char **last_id) 2888parse_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
2995void 2952static void
2996parse_qualified_param_ident_or_type (char **last_id) 2953parse_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
3037void 2994static void
3038class_definition (struct sym *containing, int tag, int flags, int nested) 2995class_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
3134void 3091static void
3135add_declarator (struct sym **cls, char **id, int flags, int sc) 3092add_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
3177void 3134static void
3178declaration (int flags) 3135declaration (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
3331int 3288static int
3332globals (int start_flags) 3289globals (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
3449void 3406static void
3450yyparse (void) 3407yyparse (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
3465void 3422static void
3466add_search_path (char *path_list) 3423add_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
3500FILE * 3457static FILE *
3501open_file (char *file) 3458open_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
3559void 3516static void
3560usage (int error) 3517usage (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
3574void 3531static void
3575version (void) 3532version (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
3590void 3547static void
3591process_file (char *file) 3548process_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
3645char * 3602static char *
3646read_line (FILE *fp) 3603read_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. */
151int emacs_pid = 0; 151int emacs_pid = 0;
152 152
153void print_help_and_exit (void) NO_RETURN; 153static void print_help_and_exit (void) NO_RETURN;
154void fail (void) NO_RETURN; 154static void fail (void) NO_RETURN;
155 155
156 156
157struct option longopts[] = 157struct 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
181long * 181static long *
182xmalloc (unsigned int size) 182xmalloc (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
195char * 195static char *
196xstrdup (const char *s) 196xstrdup (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. */
476void 476static void
477message (int is_error, const char *message, ...) 477message (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
507void 507static void
508decode_options (int argc, char **argv) 508decode_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
633void 633static void
634print_help_and_exit (void) 634print_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*/
678void 678static void
679fail (void) 679fail (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. */
721void 721static void
722sock_err_message (const char *function_name) 722sock_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. */
745void 745static void
746send_to_emacs (HSOCKET s, const char *data) 746send_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. */
784void 784static void
785quote_argument (HSOCKET s, const char *str) 785quote_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
825char * 825static char *
826unquote_argument (char *str) 826unquote_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
856int 856static int
857file_name_absolute_p (const char *filename) 857file_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 */
910int 910static int
911get_server_config (struct sockaddr_in *server, char *authentication) 911get_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
968HSOCKET 968static HSOCKET
969set_tcp_socket (void) 969set_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
1027int 1027static int
1028find_tty (char **tty_type, char **tty_name, int noabort) 1028find_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
1100SIGTYPE 1100static SIGTYPE
1101pass_signal_to_emacs (int signalnum) 1101pass_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
1115SIGTYPE 1115static SIGTYPE
1116handle_sigcont (int signalnum) 1116handle_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
1141SIGTYPE 1141static SIGTYPE
1142handle_sigtstp (int signalnum) 1142handle_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
1165void 1165static void
1166init_signals (void) 1166init_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
1185HSOCKET 1185static HSOCKET
1186set_local_socket (void) 1186set_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
1334HSOCKET 1334static HSOCKET
1335set_socket (int no_exit_if_error) 1335set_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
1450void 1450static void
1451start_daemon_and_retry_set_socket (void) 1451start_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
201void 201static void
202init_linebuffer (struct linebuffer *linebuffer) 202init_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
211long 211static long
212readline (struct linebuffer *linebuffer, FILE *stream) 212readline (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
246char * 246static char *
247get_keyword (register char *field, char **rest) 247get_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
271boolean 271static boolean
272has_keyword (char *field) 272has_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
288char * 288static char *
289add_field (line_list the_list, register char *field, register char *where) 289add_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
344line_list 344static line_list
345make_file_preface (void) 345make_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
388void 388static void
389write_line_list (register line_list the_list, FILE *the_stream) 389write_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
401int 401static int
402close_the_streams (void) 402close_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
414void 414static void
415add_a_stream (FILE *the_stream, int (*closing_action) (FILE *)) 415add_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
425int 425static int
426my_fclose (FILE *the_file) 426my_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
433boolean 433static boolean
434open_a_file (char *name) 434open_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
448void 448static void
449put_string (char *s) 449put_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
459void 459static void
460put_line (const char *string) 460put_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
519void 519static void
520setup_files (register line_list the_list, register char *field) 520setup_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
555int 555static int
556args_size (header the_header) 556args_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
586void 586static void
587parse_header (header the_header, register char *where) 587parse_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
618header 618static header
619read_header (void) 619read_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
672void 672static void
673write_header (header the_header) 673write_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
69int scan_file (char *filename); 69static int scan_file (char *filename);
70int scan_lisp_file (const char *filename, const char *mode); 70static int scan_lisp_file (const char *filename, const char *mode);
71int scan_c_file (char *filename, const char *mode); 71static int scan_c_file (char *filename, const char *mode);
72void fatal (const char *s1, const char *s2) NO_RETURN; 72static void fatal (const char *s1, const char *s2) NO_RETURN;
73void start_globals (void); 73static void start_globals (void);
74void write_globals (void); 74static 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 */
96void 96static void
97error (const char *s1, const char *s2) 97error (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 */
107void 107static void
108fatal (const char *s1, const char *s2) 108fatal (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
116void * 116static void *
117xmalloc (unsigned int size) 117xmalloc (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
127void * 127static void *
128xrealloc (void *arg, unsigned int size) 128xrealloc (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. */
215void 215static void
216put_filename (char *filename) 216put_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
234int 234static int
235scan_file (char *filename) 235scan_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
250void 250static void
251start_globals (void) 251start_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
258char buf[128]; 258static 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'. */
261struct rcsoc_state 261struct 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
391int 391static int
392read_c_string_or_comment (FILE *infile, int printflag, int comment, int *saw_usage) 392read_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
479void 479static void
480write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs) 480write_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
613void 613static void
614write_globals (void) 614write_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
655int 655static int
656scan_c_file (char *filename, const char *mode) 656scan_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
982void 982static void
983skip_white (FILE *infile) 983skip_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
991void 991static void
992read_lisp_symbol (FILE *infile, char *buffer) 992read_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
1019int 1019static int
1020scan_lisp_file (const char *filename, const char *mode) 1020scan_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. */
164char *delete_lockname; 164static char *delete_lockname;
165 165
166int 166int
167main (int argc, char **argv) 167main (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
675char *progname; 675static char *progname;
676FILE *sfi; 676static FILE *sfi;
677FILE *sfo; 677static FILE *sfo;
678char ibuffer[BUFSIZ]; 678static char ibuffer[BUFSIZ];
679char obuffer[BUFSIZ]; 679static char obuffer[BUFSIZ];
680char Errmsg[200]; /* POP errors, at least, can exceed 680static 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
41void 41static void
42reset_watch (void) 42reset_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
52char * 52static char *
53get_time (void) 53get_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
29char string1[] = "Testing distribution of nonprinting chars:\n\ 29static char string1[] = "Testing distribution of nonprinting chars:\n\
30Should be 0177: \177 Should be 0377: \377 Should be 0212: \212.\n\ 30Should be 0177: \177 Should be 0377: \377 Should be 0212: \212.\n\
31Should be 0000: "; 31Should be 0000: ";
32 32
33char string2[] = ".\n\ 33static char string2[] = ".\n\
34This file is read by the `test-distribution' program.\n\ 34This file is read by the `test-distribution' program.\n\
35If you change it, you will make that program fail.\n"; 35If you change it, you will make that program fail.\n";
36 36
37char buf[300]; 37static 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. */
40int 40static int
41cool_read (int fd, char *buf, size_t size) 41cool_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/>. */
57extern char *optarg; 57extern char *optarg;
58extern int optind, opterr; 58extern int optind, opterr;
59 59
60int usage (int err) NO_RETURN; 60static 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
71int 71static int
72usage (int err) 72usage (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
83int lock_file (const char *filename, void **state); 83static int lock_file (const char *filename, void **state);
84int unlock_file (const char *filename, void *state); 84static int unlock_file (const char *filename, void *state);
85 85
86struct score_entry 86struct score_entry
87{ 87{
@@ -90,24 +90,24 @@ struct score_entry
90 char *data; 90 char *data;
91}; 91};
92 92
93int read_scores (const char *filename, struct score_entry **scores, 93static int read_scores (const char *filename, struct score_entry **scores,
94 int *count); 94 int *count);
95int push_score (struct score_entry **scores, int *count, 95static int push_score (struct score_entry **scores, int *count,
96 int newscore, char *username, char *newdata); 96 int newscore, char *username, char *newdata);
97void sort_scores (struct score_entry *scores, int count, int reverse); 97static void sort_scores (struct score_entry *scores, int count, int reverse);
98int write_scores (const char *filename, const struct score_entry *scores, 98static int write_scores (const char *filename,
99 int count); 99 const struct score_entry *scores, int count);
100 100
101void lose (const char *msg) NO_RETURN; 101static void lose (const char *msg) NO_RETURN;
102 102
103void 103static void
104lose (const char *msg) 104lose (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
110void lose_syserr (const char *msg) NO_RETURN; 110static 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
129void 129static void
130lose_syserr (const char *msg) 130lose_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
136char * 136static char *
137get_user_id (void) 137get_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
157const char * 157static const char *
158get_prefix (int running_suid, const char *user_prefix) 158get_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
261int 261static int
262read_score (FILE *f, struct score_entry *score) 262read_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
345int 345static int
346read_scores (const char *filename, struct score_entry **scores, int *count) 346read_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
378int 378static int
379score_compare (const void *a, const void *b) 379score_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
386int 386static int
387score_compare_reverse (const void *a, const void *b) 387score_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
410void 410static void
411sort_scores (struct score_entry *scores, int count, int reverse) 411sort_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
417int 417static int
418write_scores (const char *filename, const struct score_entry *scores, int count) 418write_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
446int 446static int
447lock_file (const char *filename, void **state) 447lock_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
487int 487static int
488unlock_file (const char *filename, void *state) 488unlock_file (const char *filename, void *state)
489{ 489{
490 char *lockpath = (char *) state; 490 char *lockpath = (char *) state;