diff options
| author | Dan Nicolaescu | 2010-07-02 17:50:23 -0700 |
|---|---|---|
| committer | Dan Nicolaescu | 2010-07-02 17:50:23 -0700 |
| commit | 873fbd0b84997863af25e3ddae23b6c078a3e6f5 (patch) | |
| tree | c128a27ee29666a3d1acb584bc5eab96a047e067 /lib-src | |
| parent | a6ed0e289873ac982d7a9b0215d17a4626375b43 (diff) | |
| download | emacs-873fbd0b84997863af25e3ddae23b6c078a3e6f5.tar.gz emacs-873fbd0b84997863af25e3ddae23b6c078a3e6f5.zip | |
Convert function definitions to standard C.
* lib-src/update-game-score.c: Convert function definitions to standard C.
* lib-src/sorted-doc.c:
* lib-src/profile.c:
* lib-src/pop.c:
* lib-src/movemail.c:
* lib-src/make-docfile.c:
* lib-src/hexl.c:
* lib-src/fakemail.c:
* lib-src/etags.c:
* lib-src/ebrowse.c:
* lib-src/digest-doc.c:
* lib-src/b2m.c: Likewise.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ChangeLog | 15 | ||||
| -rw-r--r-- | lib-src/b2m.c | 23 | ||||
| -rw-r--r-- | lib-src/digest-doc.c | 2 | ||||
| -rw-r--r-- | lib-src/ebrowse.c | 223 | ||||
| -rw-r--r-- | lib-src/emacsclient.c | 47 | ||||
| -rw-r--r-- | lib-src/etags.c | 371 | ||||
| -rw-r--r-- | lib-src/fakemail.c | 81 | ||||
| -rw-r--r-- | lib-src/hexl.c | 8 | ||||
| -rw-r--r-- | lib-src/make-docfile.c | 51 | ||||
| -rw-r--r-- | lib-src/movemail.c | 73 | ||||
| -rw-r--r-- | lib-src/pop.c | 105 | ||||
| -rw-r--r-- | lib-src/profile.c | 6 | ||||
| -rw-r--r-- | lib-src/sorted-doc.c | 18 | ||||
| -rw-r--r-- | lib-src/update-game-score.c | 58 |
14 files changed, 347 insertions, 734 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 32da17388f3..f9f43ad41e6 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,18 @@ | |||
| 1 | 2010-07-03 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | * update-game-score.c: Convert function definitions to standard C. | ||
| 4 | * sorted-doc.c: | ||
| 5 | * profile.c: | ||
| 6 | * pop.c: | ||
| 7 | * movemail.c: | ||
| 8 | * make-docfile.c: | ||
| 9 | * hexl.c: | ||
| 10 | * fakemail.c: | ||
| 11 | * etags.c: | ||
| 12 | * ebrowse.c: | ||
| 13 | * digest-doc.c: | ||
| 14 | * b2m.c: Likewise. | ||
| 15 | |||
| 1 | 2010-07-02 Dan Nicolaescu <dann@ics.uci.edu> | 16 | 2010-07-02 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 17 | ||
| 3 | * make-docfile.c (xmalloc, xrealloc, concat, readline, fatal): | 18 | * make-docfile.c (xmalloc, xrealloc, concat, readline, fatal): |
diff --git a/lib-src/b2m.c b/lib-src/b2m.c index 2741a984093..733cd276653 100644 --- a/lib-src/b2m.c +++ b/lib-src/b2m.c | |||
| @@ -64,7 +64,7 @@ struct linebuffer | |||
| 64 | char *buffer; | 64 | char *buffer; |
| 65 | }; | 65 | }; |
| 66 | 66 | ||
| 67 | extern char *strtok(); | 67 | extern char *strtok(char *, const char *); |
| 68 | 68 | ||
| 69 | long *xmalloc (unsigned int size); | 69 | long *xmalloc (unsigned int size); |
| 70 | long *xrealloc (char *ptr, unsigned int size); | 70 | long *xrealloc (char *ptr, unsigned int size); |
| @@ -91,9 +91,7 @@ struct option longopts[] = | |||
| 91 | extern int optind; | 91 | extern int optind; |
| 92 | 92 | ||
| 93 | int | 93 | int |
| 94 | main (argc, argv) | 94 | main (int argc, char **argv) |
| 95 | int argc; | ||
| 96 | char **argv; | ||
| 97 | { | 95 | { |
| 98 | logical labels_saved, printing, header, first, last_was_blank_line; | 96 | logical labels_saved, printing, header, first, last_was_blank_line; |
| 99 | time_t ltoday; | 97 | time_t ltoday; |
| @@ -220,8 +218,7 @@ main (argc, argv) | |||
| 220 | * concatenate those of s1, s2, s3. | 218 | * concatenate those of s1, s2, s3. |
| 221 | */ | 219 | */ |
| 222 | char * | 220 | char * |
| 223 | concat (s1, s2, s3) | 221 | concat (char *s1, char *s2, char *s3) |
| 224 | char *s1, *s2, *s3; | ||
| 225 | { | 222 | { |
| 226 | int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); | 223 | int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); |
| 227 | char *result = xnew (len1 + len2 + len3 + 1, char); | 224 | char *result = xnew (len1 + len2 + len3 + 1, char); |
| @@ -240,9 +237,7 @@ concat (s1, s2, s3) | |||
| 240 | * which is the length of the line including the newline, if any. | 237 | * which is the length of the line including the newline, if any. |
| 241 | */ | 238 | */ |
| 242 | long | 239 | long |
| 243 | readline (linebuffer, stream) | 240 | readline (struct linebuffer *linebuffer, register FILE *stream) |
| 244 | struct linebuffer *linebuffer; | ||
| 245 | register FILE *stream; | ||
| 246 | { | 241 | { |
| 247 | char *buffer = linebuffer->buffer; | 242 | char *buffer = linebuffer->buffer; |
| 248 | register char *p = linebuffer->buffer; | 243 | register char *p = linebuffer->buffer; |
| @@ -292,8 +287,7 @@ readline (linebuffer, stream) | |||
| 292 | * Like malloc but get fatal error if memory is exhausted. | 287 | * Like malloc but get fatal error if memory is exhausted. |
| 293 | */ | 288 | */ |
| 294 | long * | 289 | long * |
| 295 | xmalloc (size) | 290 | xmalloc (unsigned int size) |
| 296 | unsigned int size; | ||
| 297 | { | 291 | { |
| 298 | long *result = (long *) malloc (size); | 292 | long *result = (long *) malloc (size); |
| 299 | if (result == NULL) | 293 | if (result == NULL) |
| @@ -302,9 +296,7 @@ xmalloc (size) | |||
| 302 | } | 296 | } |
| 303 | 297 | ||
| 304 | long * | 298 | long * |
| 305 | xrealloc (ptr, size) | 299 | xrealloc (char *ptr, unsigned int size) |
| 306 | char *ptr; | ||
| 307 | unsigned int size; | ||
| 308 | { | 300 | { |
| 309 | long *result = (long *) realloc (ptr, size); | 301 | long *result = (long *) realloc (ptr, size); |
| 310 | if (result == NULL) | 302 | if (result == NULL) |
| @@ -313,8 +305,7 @@ xrealloc (ptr, size) | |||
| 313 | } | 305 | } |
| 314 | 306 | ||
| 315 | void | 307 | void |
| 316 | fatal (message) | 308 | fatal (char *message) |
| 317 | char *message; | ||
| 318 | { | 309 | { |
| 319 | fprintf (stderr, "%s: %s\n", progname, message); | 310 | fprintf (stderr, "%s: %s\n", progname, message); |
| 320 | exit (EXIT_FAILURE); | 311 | exit (EXIT_FAILURE); |
diff --git a/lib-src/digest-doc.c b/lib-src/digest-doc.c index d8c6e620a19..b3cb58e6d99 100644 --- a/lib-src/digest-doc.c +++ b/lib-src/digest-doc.c | |||
| @@ -31,7 +31,7 @@ but in texinfo format and sorted by function/variable name. */ | |||
| 31 | #endif | 31 | #endif |
| 32 | 32 | ||
| 33 | int | 33 | int |
| 34 | main () | 34 | main (void) |
| 35 | { | 35 | { |
| 36 | register int ch; | 36 | register int ch; |
| 37 | register int notfirst = 0; | 37 | register int notfirst = 0; |
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c index c850b11bbc3..2f122cbc21d 100644 --- a/lib-src/ebrowse.c +++ b/lib-src/ebrowse.c | |||
| @@ -534,7 +534,7 @@ void parse_qualified_param_ident_or_type (char **); | |||
| 534 | int globals (int); | 534 | int globals (int); |
| 535 | void yyerror (char *, char *); | 535 | void yyerror (char *, char *); |
| 536 | void usage (int) NO_RETURN; | 536 | void usage (int) NO_RETURN; |
| 537 | void version () NO_RETURN; | 537 | void version (void) NO_RETURN; |
| 538 | 538 | ||
| 539 | 539 | ||
| 540 | 540 | ||
| @@ -546,8 +546,7 @@ void version () NO_RETURN; | |||
| 546 | name and line number. */ | 546 | name and line number. */ |
| 547 | 547 | ||
| 548 | void | 548 | void |
| 549 | yyerror (format, s) | 549 | yyerror (char *format, char *s) |
| 550 | char *format, *s; | ||
| 551 | { | 550 | { |
| 552 | fprintf (stderr, "%s:%d: ", filename, yyline); | 551 | fprintf (stderr, "%s:%d: ", filename, yyline); |
| 553 | fprintf (stderr, format, s); | 552 | fprintf (stderr, format, s); |
| @@ -559,8 +558,7 @@ yyerror (format, s) | |||
| 559 | available. */ | 558 | available. */ |
| 560 | 559 | ||
| 561 | void * | 560 | void * |
| 562 | xmalloc (nbytes) | 561 | xmalloc (int nbytes) |
| 563 | int nbytes; | ||
| 564 | { | 562 | { |
| 565 | void *p = malloc (nbytes); | 563 | void *p = malloc (nbytes); |
| 566 | if (p == NULL) | 564 | if (p == NULL) |
| @@ -575,9 +573,7 @@ xmalloc (nbytes) | |||
| 575 | /* Like realloc but print an error and exit if out of memory. */ | 573 | /* Like realloc but print an error and exit if out of memory. */ |
| 576 | 574 | ||
| 577 | void * | 575 | void * |
| 578 | xrealloc (p, sz) | 576 | xrealloc (void *p, int sz) |
| 579 | void *p; | ||
| 580 | int sz; | ||
| 581 | { | 577 | { |
| 582 | p = realloc (p, sz); | 578 | p = realloc (p, sz); |
| 583 | if (p == NULL) | 579 | if (p == NULL) |
| @@ -593,8 +589,7 @@ xrealloc (p, sz) | |||
| 593 | available.. If S is null, return null. */ | 589 | available.. If S is null, return null. */ |
| 594 | 590 | ||
| 595 | char * | 591 | char * |
| 596 | xstrdup (s) | 592 | xstrdup (char *s) |
| 597 | char *s; | ||
| 598 | { | 593 | { |
| 599 | if (s) | 594 | if (s) |
| 600 | s = strcpy (xmalloc (strlen (s) + 1), s); | 595 | s = strcpy (xmalloc (strlen (s) + 1), s); |
| @@ -611,7 +606,7 @@ xstrdup (s) | |||
| 611 | special symbol for globals (`*Globals*'). */ | 606 | special symbol for globals (`*Globals*'). */ |
| 612 | 607 | ||
| 613 | void | 608 | void |
| 614 | init_sym () | 609 | init_sym (void) |
| 615 | { | 610 | { |
| 616 | global_symbols = add_sym (GLOBALS_NAME, NULL); | 611 | global_symbols = add_sym (GLOBALS_NAME, NULL); |
| 617 | } | 612 | } |
| @@ -625,9 +620,7 @@ init_sym () | |||
| 625 | create a new symbol and set it to default values. */ | 620 | create a new symbol and set it to default values. */ |
| 626 | 621 | ||
| 627 | struct sym * | 622 | struct sym * |
| 628 | add_sym (name, nested_in_class) | 623 | add_sym (char *name, struct sym *nested_in_class) |
| 629 | char *name; | ||
| 630 | struct sym *nested_in_class; | ||
| 631 | { | 624 | { |
| 632 | struct sym *sym; | 625 | struct sym *sym; |
| 633 | unsigned h; | 626 | unsigned h; |
| @@ -668,8 +661,7 @@ add_sym (name, nested_in_class) | |||
| 668 | /* Add links between superclass SUPER and subclass SUB. */ | 661 | /* Add links between superclass SUPER and subclass SUB. */ |
| 669 | 662 | ||
| 670 | void | 663 | void |
| 671 | add_link (super, sub) | 664 | add_link (struct sym *super, struct sym *sub) |
| 672 | struct sym *super, *sub; | ||
| 673 | { | 665 | { |
| 674 | struct link *lnk, *lnk2, *p, *prev; | 666 | struct link *lnk, *lnk2, *p, *prev; |
| 675 | 667 | ||
| @@ -709,11 +701,7 @@ add_link (super, sub) | |||
| 709 | found or null if not found. */ | 701 | found or null if not found. */ |
| 710 | 702 | ||
| 711 | struct member * | 703 | struct member * |
| 712 | find_member (cls, name, var, sc, hash) | 704 | find_member (struct sym *cls, char *name, int var, int sc, unsigned int hash) |
| 713 | struct sym *cls; | ||
| 714 | char *name; | ||
| 715 | int var, sc; | ||
| 716 | unsigned hash; | ||
| 717 | { | 705 | { |
| 718 | struct member **list; | 706 | struct member **list; |
| 719 | struct member *p; | 707 | struct member *p; |
| @@ -763,16 +751,7 @@ find_member (cls, name, var, sc, hash) | |||
| 763 | F_* defines). */ | 751 | F_* defines). */ |
| 764 | 752 | ||
| 765 | void | 753 | void |
| 766 | add_member_decl (cls, name, regexp, pos, hash, var, sc, vis, flags) | 754 | add_member_decl (struct sym *cls, char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int vis, int flags) |
| 767 | struct sym *cls; | ||
| 768 | char *name; | ||
| 769 | char *regexp; | ||
| 770 | int pos; | ||
| 771 | unsigned hash; | ||
| 772 | int var; | ||
| 773 | int sc; | ||
| 774 | int vis; | ||
| 775 | int flags; | ||
| 776 | { | 755 | { |
| 777 | struct member *m; | 756 | struct member *m; |
| 778 | 757 | ||
| @@ -820,15 +799,7 @@ add_member_decl (cls, name, regexp, pos, hash, var, sc, vis, flags) | |||
| 820 | F_* defines). */ | 799 | F_* defines). */ |
| 821 | 800 | ||
| 822 | void | 801 | void |
| 823 | add_member_defn (cls, name, regexp, pos, hash, var, sc, flags) | 802 | add_member_defn (struct sym *cls, char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int flags) |
| 824 | struct sym *cls; | ||
| 825 | char *name; | ||
| 826 | char *regexp; | ||
| 827 | int pos; | ||
| 828 | unsigned hash; | ||
| 829 | int var; | ||
| 830 | int sc; | ||
| 831 | int flags; | ||
| 832 | { | 803 | { |
| 833 | struct member *m; | 804 | struct member *m; |
| 834 | 805 | ||
| @@ -870,9 +841,7 @@ add_member_defn (cls, name, regexp, pos, hash, var, sc, flags) | |||
| 870 | if it is non-null. POS is the position in the file. */ | 841 | if it is non-null. POS is the position in the file. */ |
| 871 | 842 | ||
| 872 | void | 843 | void |
| 873 | add_define (name, regexp, pos) | 844 | add_define (char *name, char *regexp, int pos) |
| 874 | char *name, *regexp; | ||
| 875 | int pos; | ||
| 876 | { | 845 | { |
| 877 | add_global_defn (name, regexp, pos, 0, 1, SC_FRIEND, F_DEFINE); | 846 | add_global_defn (name, regexp, pos, 0, 1, SC_FRIEND, F_DEFINE); |
| 878 | add_global_decl (name, regexp, pos, 0, 1, SC_FRIEND, F_DEFINE); | 847 | add_global_decl (name, regexp, pos, 0, 1, SC_FRIEND, F_DEFINE); |
| @@ -890,13 +859,7 @@ add_define (name, regexp, pos) | |||
| 890 | F_* defines). */ | 859 | F_* defines). */ |
| 891 | 860 | ||
| 892 | void | 861 | void |
| 893 | add_global_defn (name, regexp, pos, hash, var, sc, flags) | 862 | add_global_defn (char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int flags) |
| 894 | char *name, *regexp; | ||
| 895 | int pos; | ||
| 896 | unsigned hash; | ||
| 897 | int var; | ||
| 898 | int sc; | ||
| 899 | int flags; | ||
| 900 | { | 863 | { |
| 901 | int i; | 864 | int i; |
| 902 | struct sym *sym; | 865 | struct sym *sym; |
| @@ -927,13 +890,7 @@ add_global_defn (name, regexp, pos, hash, var, sc, flags) | |||
| 927 | F_* defines). */ | 890 | F_* defines). */ |
| 928 | 891 | ||
| 929 | void | 892 | void |
| 930 | add_global_decl (name, regexp, pos, hash, var, sc, flags) | 893 | add_global_decl (char *name, char *regexp, int pos, unsigned int hash, int var, int sc, int flags) |
| 931 | char *name, *regexp; | ||
| 932 | int pos; | ||
| 933 | unsigned hash; | ||
| 934 | int var; | ||
| 935 | int sc; | ||
| 936 | int flags; | ||
| 937 | { | 894 | { |
| 938 | /* Add declaration only if not already declared. Header files must | 895 | /* Add declaration only if not already declared. Header files must |
| 939 | be processed before source files for this to have the right effect. | 896 | be processed before source files for this to have the right effect. |
| @@ -972,12 +929,7 @@ add_global_decl (name, regexp, pos, hash, var, sc, flags) | |||
| 972 | Value is a pointer to the member's structure. */ | 929 | Value is a pointer to the member's structure. */ |
| 973 | 930 | ||
| 974 | struct member * | 931 | struct member * |
| 975 | add_member (cls, name, var, sc, hash) | 932 | add_member (struct sym *cls, char *name, int var, int sc, unsigned int hash) |
| 976 | struct sym *cls; | ||
| 977 | char *name; | ||
| 978 | int var; | ||
| 979 | int sc; | ||
| 980 | unsigned hash; | ||
| 981 | { | 933 | { |
| 982 | struct member *m = (struct member *) xmalloc (sizeof *m + strlen (name)); | 934 | struct member *m = (struct member *) xmalloc (sizeof *m + strlen (name)); |
| 983 | struct member **list; | 935 | struct member **list; |
| @@ -1048,8 +1000,7 @@ add_member (cls, name, var, sc, hash) | |||
| 1048 | in base classes. */ | 1000 | in base classes. */ |
| 1049 | 1001 | ||
| 1050 | void | 1002 | void |
| 1051 | mark_virtual (r) | 1003 | mark_virtual (struct sym *r) |
| 1052 | struct sym *r; | ||
| 1053 | { | 1004 | { |
| 1054 | struct link *p; | 1005 | struct link *p; |
| 1055 | struct member *m, *m2; | 1006 | struct member *m, *m2; |
| @@ -1073,7 +1024,7 @@ mark_virtual (r) | |||
| 1073 | are virtual because of a virtual declaration in a base class. */ | 1024 | are virtual because of a virtual declaration in a base class. */ |
| 1074 | 1025 | ||
| 1075 | void | 1026 | void |
| 1076 | mark_inherited_virtual () | 1027 | mark_inherited_virtual (void) |
| 1077 | { | 1028 | { |
| 1078 | struct sym *r; | 1029 | struct sym *r; |
| 1079 | int i; | 1030 | int i; |
| @@ -1088,9 +1039,7 @@ mark_inherited_virtual () | |||
| 1088 | /* Create and return a symbol for a namespace with name NAME. */ | 1039 | /* Create and return a symbol for a namespace with name NAME. */ |
| 1089 | 1040 | ||
| 1090 | struct sym * | 1041 | struct sym * |
| 1091 | make_namespace (name, context) | 1042 | make_namespace (char *name, struct sym *context) |
| 1092 | char *name; | ||
| 1093 | struct sym *context; | ||
| 1094 | { | 1043 | { |
| 1095 | struct sym *s = (struct sym *) xmalloc (sizeof *s + strlen (name)); | 1044 | struct sym *s = (struct sym *) xmalloc (sizeof *s + strlen (name)); |
| 1096 | bzero (s, sizeof *s); | 1045 | bzero (s, sizeof *s); |
| @@ -1105,9 +1054,7 @@ make_namespace (name, context) | |||
| 1105 | /* Find the symbol for namespace NAME. If not found, retrun NULL */ | 1054 | /* Find the symbol for namespace NAME. If not found, retrun NULL */ |
| 1106 | 1055 | ||
| 1107 | struct sym * | 1056 | struct sym * |
| 1108 | check_namespace (name, context) | 1057 | check_namespace (char *name, struct sym *context) |
| 1109 | char *name; | ||
| 1110 | struct sym *context; | ||
| 1111 | { | 1058 | { |
| 1112 | struct sym *p = NULL; | 1059 | struct sym *p = NULL; |
| 1113 | 1060 | ||
| @@ -1124,9 +1071,7 @@ check_namespace (name, context) | |||
| 1124 | for NAME to all_namespaces. */ | 1071 | for NAME to all_namespaces. */ |
| 1125 | 1072 | ||
| 1126 | struct sym * | 1073 | struct sym * |
| 1127 | find_namespace (name, context) | 1074 | find_namespace (char *name, struct sym *context) |
| 1128 | char *name; | ||
| 1129 | struct sym *context; | ||
| 1130 | { | 1075 | { |
| 1131 | struct sym *p = check_namespace (name, context); | 1076 | struct sym *p = check_namespace (name, context); |
| 1132 | 1077 | ||
| @@ -1140,8 +1085,7 @@ find_namespace (name, context) | |||
| 1140 | /* Find namespace alias with name NAME. If not found return NULL. */ | 1085 | /* Find namespace alias with name NAME. If not found return NULL. */ |
| 1141 | 1086 | ||
| 1142 | struct link * | 1087 | struct link * |
| 1143 | check_namespace_alias (name) | 1088 | check_namespace_alias (char *name) |
| 1144 | char *name; | ||
| 1145 | { | 1089 | { |
| 1146 | struct link *p = NULL; | 1090 | struct link *p = NULL; |
| 1147 | struct alias *al; | 1091 | struct alias *al; |
| @@ -1165,9 +1109,7 @@ check_namespace_alias (name) | |||
| 1165 | /* Register the name NEW_NAME as an alias for namespace list OLD_NAME. */ | 1109 | /* Register the name NEW_NAME as an alias for namespace list OLD_NAME. */ |
| 1166 | 1110 | ||
| 1167 | void | 1111 | void |
| 1168 | register_namespace_alias (new_name, old_name) | 1112 | register_namespace_alias (char *new_name, struct link *old_name) |
| 1169 | char *new_name; | ||
| 1170 | struct link *old_name; | ||
| 1171 | { | 1113 | { |
| 1172 | unsigned h; | 1114 | unsigned h; |
| 1173 | char *s; | 1115 | char *s; |
| @@ -1195,8 +1137,7 @@ register_namespace_alias (new_name, old_name) | |||
| 1195 | /* Enter namespace with name NAME. */ | 1137 | /* Enter namespace with name NAME. */ |
| 1196 | 1138 | ||
| 1197 | void | 1139 | void |
| 1198 | enter_namespace (name) | 1140 | enter_namespace (char *name) |
| 1199 | char *name; | ||
| 1200 | { | 1141 | { |
| 1201 | struct sym *p = find_namespace (name, current_namespace); | 1142 | struct sym *p = find_namespace (name, current_namespace); |
| 1202 | 1143 | ||
| @@ -1217,7 +1158,7 @@ enter_namespace (name) | |||
| 1217 | /* Leave the current namespace. */ | 1158 | /* Leave the current namespace. */ |
| 1218 | 1159 | ||
| 1219 | void | 1160 | void |
| 1220 | leave_namespace () | 1161 | leave_namespace (void) |
| 1221 | { | 1162 | { |
| 1222 | assert (namespace_sp > 0); | 1163 | assert (namespace_sp > 0); |
| 1223 | current_namespace = namespace_stack[--namespace_sp]; | 1164 | current_namespace = namespace_stack[--namespace_sp]; |
| @@ -1259,8 +1200,7 @@ int scope_buffer_len; | |||
| 1259 | /* Make sure scope_buffer has enough room to add LEN chars to it. */ | 1200 | /* Make sure scope_buffer has enough room to add LEN chars to it. */ |
| 1260 | 1201 | ||
| 1261 | void | 1202 | void |
| 1262 | ensure_scope_buffer_room (len) | 1203 | ensure_scope_buffer_room (int len) |
| 1263 | int len; | ||
| 1264 | { | 1204 | { |
| 1265 | if (scope_buffer_len + len >= scope_buffer_size) | 1205 | if (scope_buffer_len + len >= scope_buffer_size) |
| 1266 | { | 1206 | { |
| @@ -1276,8 +1216,7 @@ ensure_scope_buffer_room (len) | |||
| 1276 | scope name constructed. */ | 1216 | scope name constructed. */ |
| 1277 | 1217 | ||
| 1278 | char * | 1218 | char * |
| 1279 | sym_scope_1 (p) | 1219 | sym_scope_1 (struct sym *p) |
| 1280 | struct sym *p; | ||
| 1281 | { | 1220 | { |
| 1282 | int len; | 1221 | int len; |
| 1283 | 1222 | ||
| @@ -1311,8 +1250,7 @@ sym_scope_1 (p) | |||
| 1311 | as it would appear in a C*+ source file. */ | 1250 | as it would appear in a C*+ source file. */ |
| 1312 | 1251 | ||
| 1313 | char * | 1252 | char * |
| 1314 | sym_scope (p) | 1253 | sym_scope (struct sym *p) |
| 1315 | struct sym *p; | ||
| 1316 | { | 1254 | { |
| 1317 | if (!scope_buffer) | 1255 | if (!scope_buffer) |
| 1318 | { | 1256 | { |
| @@ -1334,9 +1272,7 @@ sym_scope (p) | |||
| 1334 | list. */ | 1272 | list. */ |
| 1335 | 1273 | ||
| 1336 | int | 1274 | int |
| 1337 | dump_members (fp, m) | 1275 | dump_members (FILE *fp, struct member *m) |
| 1338 | FILE *fp; | ||
| 1339 | struct member *m; | ||
| 1340 | { | 1276 | { |
| 1341 | int n; | 1277 | int n; |
| 1342 | 1278 | ||
| @@ -1369,9 +1305,7 @@ dump_members (fp, m) | |||
| 1369 | /* Dump class ROOT to stream FP. */ | 1305 | /* Dump class ROOT to stream FP. */ |
| 1370 | 1306 | ||
| 1371 | void | 1307 | void |
| 1372 | dump_sym (fp, root) | 1308 | dump_sym (FILE *fp, struct sym *root) |
| 1373 | FILE *fp; | ||
| 1374 | struct sym *root; | ||
| 1375 | { | 1309 | { |
| 1376 | fputs (CLASS_STRUCT, fp); | 1310 | fputs (CLASS_STRUCT, fp); |
| 1377 | PUTSTR (root->name, fp); | 1311 | PUTSTR (root->name, fp); |
| @@ -1397,9 +1331,7 @@ dump_sym (fp, root) | |||
| 1397 | number of classes written. */ | 1331 | number of classes written. */ |
| 1398 | 1332 | ||
| 1399 | int | 1333 | int |
| 1400 | dump_tree (fp, root) | 1334 | dump_tree (FILE *fp, struct sym *root) |
| 1401 | FILE *fp; | ||
| 1402 | struct sym *root; | ||
| 1403 | { | 1335 | { |
| 1404 | struct link *lk; | 1336 | struct link *lk; |
| 1405 | unsigned n = 0; | 1337 | unsigned n = 0; |
| @@ -1446,8 +1378,7 @@ dump_tree (fp, root) | |||
| 1446 | /* Dump the entire class tree to file FP. */ | 1378 | /* Dump the entire class tree to file FP. */ |
| 1447 | 1379 | ||
| 1448 | void | 1380 | void |
| 1449 | dump_roots (fp) | 1381 | dump_roots (FILE *fp) |
| 1450 | FILE *fp; | ||
| 1451 | { | 1382 | { |
| 1452 | int i, n = 0; | 1383 | int i, n = 0; |
| 1453 | struct sym *r; | 1384 | struct sym *r; |
| @@ -1521,7 +1452,7 @@ do { \ | |||
| 1521 | input buffer not consumed. */ | 1452 | input buffer not consumed. */ |
| 1522 | 1453 | ||
| 1523 | int | 1454 | int |
| 1524 | process_pp_line () | 1455 | process_pp_line (void) |
| 1525 | { | 1456 | { |
| 1526 | int in_comment = 0, in_string = 0; | 1457 | int in_comment = 0, in_string = 0; |
| 1527 | int c; | 1458 | int c; |
| @@ -1592,7 +1523,7 @@ process_pp_line () | |||
| 1592 | /* Value is the next token from the input buffer. */ | 1523 | /* Value is the next token from the input buffer. */ |
| 1593 | 1524 | ||
| 1594 | int | 1525 | int |
| 1595 | yylex () | 1526 | yylex (void) |
| 1596 | { | 1527 | { |
| 1597 | int c; | 1528 | int c; |
| 1598 | char end_char; | 1529 | char end_char; |
| @@ -2009,7 +1940,7 @@ static char *matching_regexp_buffer, *matching_regexp_end_buf; | |||
| 2009 | shorter than min_regexp. */ | 1940 | shorter than min_regexp. */ |
| 2010 | 1941 | ||
| 2011 | char * | 1942 | char * |
| 2012 | matching_regexp () | 1943 | matching_regexp (void) |
| 2013 | { | 1944 | { |
| 2014 | char *p; | 1945 | char *p; |
| 2015 | char *s; | 1946 | char *s; |
| @@ -2060,8 +1991,7 @@ matching_regexp () | |||
| 2060 | /* Return a printable representation of token T. */ | 1991 | /* Return a printable representation of token T. */ |
| 2061 | 1992 | ||
| 2062 | char * | 1993 | char * |
| 2063 | token_string (t) | 1994 | token_string (int t) |
| 2064 | int t; | ||
| 2065 | { | 1995 | { |
| 2066 | static char b[3]; | 1996 | static char b[3]; |
| 2067 | 1997 | ||
| @@ -2178,7 +2108,7 @@ token_string (t) | |||
| 2178 | /* Reinitialize the scanner for a new input file. */ | 2108 | /* Reinitialize the scanner for a new input file. */ |
| 2179 | 2109 | ||
| 2180 | void | 2110 | void |
| 2181 | re_init_scanner () | 2111 | re_init_scanner (void) |
| 2182 | { | 2112 | { |
| 2183 | in = inbuffer; | 2113 | in = inbuffer; |
| 2184 | yyline = 1; | 2114 | yyline = 1; |
| @@ -2196,9 +2126,7 @@ re_init_scanner () | |||
| 2196 | table. */ | 2126 | table. */ |
| 2197 | 2127 | ||
| 2198 | void | 2128 | void |
| 2199 | insert_keyword (name, tk) | 2129 | insert_keyword (char *name, int tk) |
| 2200 | char *name; | ||
| 2201 | int tk; | ||
| 2202 | { | 2130 | { |
| 2203 | char *s; | 2131 | char *s; |
| 2204 | unsigned h = 0; | 2132 | unsigned h = 0; |
| @@ -2219,7 +2147,7 @@ insert_keyword (name, tk) | |||
| 2219 | character class vectors and fills the keyword hash table. */ | 2147 | character class vectors and fills the keyword hash table. */ |
| 2220 | 2148 | ||
| 2221 | void | 2149 | void |
| 2222 | init_scanner () | 2150 | init_scanner (void) |
| 2223 | { | 2151 | { |
| 2224 | int i; | 2152 | int i; |
| 2225 | 2153 | ||
| @@ -2363,8 +2291,7 @@ init_scanner () | |||
| 2363 | the current lookahead token after skipping. */ | 2291 | the current lookahead token after skipping. */ |
| 2364 | 2292 | ||
| 2365 | int | 2293 | int |
| 2366 | skip_to (token) | 2294 | skip_to (int token) |
| 2367 | int token; | ||
| 2368 | { | 2295 | { |
| 2369 | while (!LOOKING_AT2 (YYEOF, token)) | 2296 | while (!LOOKING_AT2 (YYEOF, token)) |
| 2370 | MATCH (); | 2297 | MATCH (); |
| @@ -2375,7 +2302,7 @@ skip_to (token) | |||
| 2375 | angle brackets, curly brackets) matching the current lookahead. */ | 2302 | angle brackets, curly brackets) matching the current lookahead. */ |
| 2376 | 2303 | ||
| 2377 | void | 2304 | void |
| 2378 | skip_matching () | 2305 | skip_matching (void) |
| 2379 | { | 2306 | { |
| 2380 | int open, close, n; | 2307 | int open, close, n; |
| 2381 | 2308 | ||
| @@ -2418,7 +2345,7 @@ skip_matching () | |||
| 2418 | } | 2345 | } |
| 2419 | 2346 | ||
| 2420 | void | 2347 | void |
| 2421 | skip_initializer () | 2348 | skip_initializer (void) |
| 2422 | { | 2349 | { |
| 2423 | for (;;) | 2350 | for (;;) |
| 2424 | { | 2351 | { |
| @@ -2445,7 +2372,7 @@ skip_initializer () | |||
| 2445 | /* Build qualified namespace alias (A::B::c) and return it. */ | 2372 | /* Build qualified namespace alias (A::B::c) and return it. */ |
| 2446 | 2373 | ||
| 2447 | struct link * | 2374 | struct link * |
| 2448 | match_qualified_namespace_alias () | 2375 | match_qualified_namespace_alias (void) |
| 2449 | { | 2376 | { |
| 2450 | struct link *head = NULL; | 2377 | struct link *head = NULL; |
| 2451 | struct link *cur = NULL; | 2378 | struct link *cur = NULL; |
| @@ -2482,7 +2409,7 @@ match_qualified_namespace_alias () | |||
| 2482 | /* Re-initialize the parser by resetting the lookahead token. */ | 2409 | /* Re-initialize the parser by resetting the lookahead token. */ |
| 2483 | 2410 | ||
| 2484 | void | 2411 | void |
| 2485 | re_init_parser () | 2412 | re_init_parser (void) |
| 2486 | { | 2413 | { |
| 2487 | tk = -1; | 2414 | tk = -1; |
| 2488 | } | 2415 | } |
| @@ -2495,8 +2422,7 @@ re_init_parser () | |||
| 2495 | distinguish between overloaded functions. */ | 2422 | distinguish between overloaded functions. */ |
| 2496 | 2423 | ||
| 2497 | unsigned | 2424 | unsigned |
| 2498 | parm_list (flags) | 2425 | parm_list (int *flags) |
| 2499 | int *flags; | ||
| 2500 | { | 2426 | { |
| 2501 | unsigned hash = 0; | 2427 | unsigned hash = 0; |
| 2502 | int type_seen = 0; | 2428 | int type_seen = 0; |
| @@ -2609,7 +2535,7 @@ parm_list (flags) | |||
| 2609 | /* Print position info to stdout. */ | 2535 | /* Print position info to stdout. */ |
| 2610 | 2536 | ||
| 2611 | void | 2537 | void |
| 2612 | print_info () | 2538 | print_info (void) |
| 2613 | { | 2539 | { |
| 2614 | if (info_position >= 0 && BUFFER_POS () <= info_position) | 2540 | if (info_position >= 0 && BUFFER_POS () <= info_position) |
| 2615 | if (info_cls) | 2541 | if (info_cls) |
| @@ -2624,9 +2550,7 @@ print_info () | |||
| 2624 | public). */ | 2550 | public). */ |
| 2625 | 2551 | ||
| 2626 | void | 2552 | void |
| 2627 | member (cls, vis) | 2553 | member (struct sym *cls, int vis) |
| 2628 | struct sym *cls; | ||
| 2629 | int vis; | ||
| 2630 | { | 2554 | { |
| 2631 | char *id = NULL; | 2555 | char *id = NULL; |
| 2632 | int sc = SC_MEMBER; | 2556 | int sc = SC_MEMBER; |
| @@ -2835,9 +2759,7 @@ member (cls, vis) | |||
| 2835 | union, class). */ | 2759 | union, class). */ |
| 2836 | 2760 | ||
| 2837 | void | 2761 | void |
| 2838 | class_body (cls, tag) | 2762 | class_body (struct sym *cls, int tag) |
| 2839 | struct sym *cls; | ||
| 2840 | int tag; | ||
| 2841 | { | 2763 | { |
| 2842 | int vis = tag == CLASS ? PRIVATE : PUBLIC; | 2764 | int vis = tag == CLASS ? PRIVATE : PUBLIC; |
| 2843 | int temp; | 2765 | int temp; |
| @@ -2898,7 +2820,7 @@ class_body (cls, tag) | |||
| 2898 | symbol for that class. */ | 2820 | symbol for that class. */ |
| 2899 | 2821 | ||
| 2900 | struct sym * | 2822 | struct sym * |
| 2901 | parse_classname () | 2823 | parse_classname (void) |
| 2902 | { | 2824 | { |
| 2903 | struct sym *last_class = NULL; | 2825 | struct sym *last_class = NULL; |
| 2904 | 2826 | ||
| @@ -2928,8 +2850,7 @@ parse_classname () | |||
| 2928 | a static buffer holding the constructed operator name string. */ | 2850 | a static buffer holding the constructed operator name string. */ |
| 2929 | 2851 | ||
| 2930 | char * | 2852 | char * |
| 2931 | operator_name (sc) | 2853 | operator_name (int *sc) |
| 2932 | int *sc; | ||
| 2933 | { | 2854 | { |
| 2934 | static int id_size = 0; | 2855 | static int id_size = 0; |
| 2935 | static char *id = NULL; | 2856 | static char *id = NULL; |
| @@ -3019,8 +2940,7 @@ operator_name (sc) | |||
| 3019 | symbol structure for the ident. */ | 2940 | symbol structure for the ident. */ |
| 3020 | 2941 | ||
| 3021 | struct sym * | 2942 | struct sym * |
| 3022 | parse_qualified_ident_or_type (last_id) | 2943 | parse_qualified_ident_or_type (char **last_id) |
| 3023 | char **last_id; | ||
| 3024 | { | 2944 | { |
| 3025 | struct sym *cls = NULL; | 2945 | struct sym *cls = NULL; |
| 3026 | char *id = NULL; | 2946 | char *id = NULL; |
| @@ -3085,8 +3005,7 @@ parse_qualified_ident_or_type (last_id) | |||
| 3085 | symbol structure for the ident. */ | 3005 | symbol structure for the ident. */ |
| 3086 | 3006 | ||
| 3087 | void | 3007 | void |
| 3088 | parse_qualified_param_ident_or_type (last_id) | 3008 | parse_qualified_param_ident_or_type (char **last_id) |
| 3089 | char **last_id; | ||
| 3090 | { | 3009 | { |
| 3091 | struct sym *cls = NULL; | 3010 | struct sym *cls = NULL; |
| 3092 | static char *id = NULL; | 3011 | static char *id = NULL; |
| @@ -3128,11 +3047,7 @@ parse_qualified_param_ident_or_type (last_id) | |||
| 3128 | Current lookahead is the class name. */ | 3047 | Current lookahead is the class name. */ |
| 3129 | 3048 | ||
| 3130 | void | 3049 | void |
| 3131 | class_definition (containing, tag, flags, nested) | 3050 | class_definition (struct sym *containing, int tag, int flags, int nested) |
| 3132 | struct sym *containing; | ||
| 3133 | int tag; | ||
| 3134 | int flags; | ||
| 3135 | int nested; | ||
| 3136 | { | 3051 | { |
| 3137 | struct sym *current; | 3052 | struct sym *current; |
| 3138 | struct sym *base_class; | 3053 | struct sym *base_class; |
| @@ -3229,10 +3144,7 @@ class_definition (containing, tag, flags, nested) | |||
| 3229 | information about the member (see the F_* defines). */ | 3144 | information about the member (see the F_* defines). */ |
| 3230 | 3145 | ||
| 3231 | void | 3146 | void |
| 3232 | add_declarator (cls, id, flags, sc) | 3147 | add_declarator (struct sym **cls, char **id, int flags, int sc) |
| 3233 | struct sym **cls; | ||
| 3234 | char **id; | ||
| 3235 | int flags, sc; | ||
| 3236 | { | 3148 | { |
| 3237 | if (LOOKING_AT2 (';', ',')) | 3149 | if (LOOKING_AT2 (';', ',')) |
| 3238 | { | 3150 | { |
| @@ -3275,8 +3187,7 @@ add_declarator (cls, id, flags, sc) | |||
| 3275 | /* Parse a declaration. */ | 3187 | /* Parse a declaration. */ |
| 3276 | 3188 | ||
| 3277 | void | 3189 | void |
| 3278 | declaration (flags) | 3190 | declaration (int flags) |
| 3279 | int flags; | ||
| 3280 | { | 3191 | { |
| 3281 | char *id = NULL; | 3192 | char *id = NULL; |
| 3282 | struct sym *cls = NULL; | 3193 | struct sym *cls = NULL; |
| @@ -3430,8 +3341,7 @@ declaration (flags) | |||
| 3430 | otherwise. */ | 3341 | otherwise. */ |
| 3431 | 3342 | ||
| 3432 | int | 3343 | int |
| 3433 | globals (start_flags) | 3344 | globals (int start_flags) |
| 3434 | int start_flags; | ||
| 3435 | { | 3345 | { |
| 3436 | int anonymous; | 3346 | int anonymous; |
| 3437 | int class_tk; | 3347 | int class_tk; |
| @@ -3549,7 +3459,7 @@ globals (start_flags) | |||
| 3549 | /* Parse the current input file. */ | 3459 | /* Parse the current input file. */ |
| 3550 | 3460 | ||
| 3551 | void | 3461 | void |
| 3552 | yyparse () | 3462 | yyparse (void) |
| 3553 | { | 3463 | { |
| 3554 | while (globals (0) == 0) | 3464 | while (globals (0) == 0) |
| 3555 | MATCH_IF ('}'); | 3465 | MATCH_IF ('}'); |
| @@ -3565,8 +3475,7 @@ yyparse () | |||
| 3565 | input files. */ | 3475 | input files. */ |
| 3566 | 3476 | ||
| 3567 | void | 3477 | void |
| 3568 | add_search_path (path_list) | 3478 | add_search_path (char *path_list) |
| 3569 | char *path_list; | ||
| 3570 | { | 3479 | { |
| 3571 | while (*path_list) | 3480 | while (*path_list) |
| 3572 | { | 3481 | { |
| @@ -3601,8 +3510,7 @@ add_search_path (path_list) | |||
| 3601 | unchanged file name. */ | 3510 | unchanged file name. */ |
| 3602 | 3511 | ||
| 3603 | FILE * | 3512 | FILE * |
| 3604 | open_file (file) | 3513 | open_file (char *file) |
| 3605 | char *file; | ||
| 3606 | { | 3514 | { |
| 3607 | FILE *fp = NULL; | 3515 | FILE *fp = NULL; |
| 3608 | static char *buffer; | 3516 | static char *buffer; |
| @@ -3661,8 +3569,7 @@ Usage: ebrowse [options] {files}\n\ | |||
| 3661 | " | 3569 | " |
| 3662 | 3570 | ||
| 3663 | void | 3571 | void |
| 3664 | usage (error) | 3572 | usage (int error) |
| 3665 | int error; | ||
| 3666 | { | 3573 | { |
| 3667 | puts (USAGE); | 3574 | puts (USAGE); |
| 3668 | exit (error ? EXIT_FAILURE : EXIT_SUCCESS); | 3575 | exit (error ? EXIT_FAILURE : EXIT_SUCCESS); |
| @@ -3677,7 +3584,7 @@ usage (error) | |||
| 3677 | #endif | 3584 | #endif |
| 3678 | 3585 | ||
| 3679 | void | 3586 | void |
| 3680 | version () | 3587 | version (void) |
| 3681 | { | 3588 | { |
| 3682 | /* Makes it easier to update automatically. */ | 3589 | /* Makes it easier to update automatically. */ |
| 3683 | char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc."; | 3590 | char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc."; |
| @@ -3693,8 +3600,7 @@ version () | |||
| 3693 | table. */ | 3600 | table. */ |
| 3694 | 3601 | ||
| 3695 | void | 3602 | void |
| 3696 | process_file (file) | 3603 | process_file (char *file) |
| 3697 | char *file; | ||
| 3698 | { | 3604 | { |
| 3699 | FILE *fp; | 3605 | FILE *fp; |
| 3700 | 3606 | ||
| @@ -3749,8 +3655,7 @@ process_file (file) | |||
| 3749 | is null when EOF is reached. */ | 3655 | is null when EOF is reached. */ |
| 3750 | 3656 | ||
| 3751 | char * | 3657 | char * |
| 3752 | read_line (fp) | 3658 | read_line (FILE *fp) |
| 3753 | FILE *fp; | ||
| 3754 | { | 3659 | { |
| 3755 | static char *buffer; | 3660 | static char *buffer; |
| 3756 | static int buffer_size; | 3661 | static int buffer_size; |
| @@ -3786,9 +3691,7 @@ read_line (fp) | |||
| 3786 | /* Main entry point. */ | 3691 | /* Main entry point. */ |
| 3787 | 3692 | ||
| 3788 | int | 3693 | int |
| 3789 | main (argc, argv) | 3694 | main (int argc, char **argv) |
| 3790 | int argc; | ||
| 3791 | char **argv; | ||
| 3792 | { | 3695 | { |
| 3793 | int i; | 3696 | int i; |
| 3794 | int any_inputfiles = 0; | 3697 | int any_inputfiles = 0; |
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 3172ebb8cd1..d96925d2a3c 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c | |||
| @@ -81,7 +81,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 81 | #include <errno.h> | 81 | #include <errno.h> |
| 82 | 82 | ||
| 83 | 83 | ||
| 84 | char *getenv (), *getwd (); | 84 | char *getenv (const char *), *getwd (char *); |
| 85 | char *(getcwd) (); | 85 | char *(getcwd) (); |
| 86 | 86 | ||
| 87 | #ifdef WINDOWSNT | 87 | #ifdef WINDOWSNT |
| @@ -157,7 +157,7 @@ char *server_file = NULL; | |||
| 157 | /* PID of the Emacs server process. */ | 157 | /* PID of the Emacs server process. */ |
| 158 | int emacs_pid = 0; | 158 | int emacs_pid = 0; |
| 159 | 159 | ||
| 160 | void print_help_and_exit () NO_RETURN; | 160 | void print_help_and_exit (void) NO_RETURN; |
| 161 | 161 | ||
| 162 | struct option longopts[] = | 162 | struct option longopts[] = |
| 163 | { | 163 | { |
| @@ -184,8 +184,7 @@ struct option longopts[] = | |||
| 184 | /* Like malloc but get fatal error if memory is exhausted. */ | 184 | /* Like malloc but get fatal error if memory is exhausted. */ |
| 185 | 185 | ||
| 186 | long * | 186 | long * |
| 187 | xmalloc (size) | 187 | xmalloc (unsigned int size) |
| 188 | unsigned int size; | ||
| 189 | { | 188 | { |
| 190 | long *result = (long *) malloc (size); | 189 | long *result = (long *) malloc (size); |
| 191 | if (result == NULL) | 190 | if (result == NULL) |
| @@ -517,9 +516,7 @@ message (int is_error, char *message, ...) | |||
| 517 | The global variable `optind' will say how many arguments we used up. */ | 516 | The global variable `optind' will say how many arguments we used up. */ |
| 518 | 517 | ||
| 519 | void | 518 | void |
| 520 | decode_options (argc, argv) | 519 | decode_options (int argc, char **argv) |
| 521 | int argc; | ||
| 522 | char **argv; | ||
| 523 | { | 520 | { |
| 524 | alternate_editor = egetenv ("ALTERNATE_EDITOR"); | 521 | alternate_editor = egetenv ("ALTERNATE_EDITOR"); |
| 525 | 522 | ||
| @@ -645,7 +642,7 @@ an empty string"); | |||
| 645 | 642 | ||
| 646 | 643 | ||
| 647 | void | 644 | void |
| 648 | print_help_and_exit () | 645 | print_help_and_exit (void) |
| 649 | { | 646 | { |
| 650 | /* Spaces and tabs are significant in this message; they're chosen so the | 647 | /* Spaces and tabs are significant in this message; they're chosen so the |
| 651 | message aligns properly both in a tty and in a Windows message box. | 648 | message aligns properly both in a tty and in a Windows message box. |
| @@ -732,7 +729,7 @@ main (argc, argv) | |||
| 732 | #define AUTH_KEY_LENGTH 64 | 729 | #define AUTH_KEY_LENGTH 64 |
| 733 | #define SEND_BUFFER_SIZE 4096 | 730 | #define SEND_BUFFER_SIZE 4096 |
| 734 | 731 | ||
| 735 | extern char *strerror (); | 732 | extern char *strerror (int); |
| 736 | 733 | ||
| 737 | /* Buffer to accumulate data to send in TCP connections. */ | 734 | /* Buffer to accumulate data to send in TCP connections. */ |
| 738 | char send_buffer[SEND_BUFFER_SIZE + 1]; | 735 | char send_buffer[SEND_BUFFER_SIZE + 1]; |
| @@ -743,8 +740,7 @@ HSOCKET emacs_socket = 0; | |||
| 743 | /* On Windows, the socket library was historically separate from the standard | 740 | /* On Windows, the socket library was historically separate from the standard |
| 744 | C library, so errors are handled differently. */ | 741 | C library, so errors are handled differently. */ |
| 745 | void | 742 | void |
| 746 | sock_err_message (function_name) | 743 | sock_err_message (char *function_name) |
| 747 | char *function_name; | ||
| 748 | { | 744 | { |
| 749 | #ifdef WINDOWSNT | 745 | #ifdef WINDOWSNT |
| 750 | char* msg = NULL; | 746 | char* msg = NULL; |
| @@ -768,9 +764,7 @@ sock_err_message (function_name) | |||
| 768 | - the buffer is full (but this shouldn't happen) | 764 | - the buffer is full (but this shouldn't happen) |
| 769 | Otherwise, we just accumulate it. */ | 765 | Otherwise, we just accumulate it. */ |
| 770 | void | 766 | void |
| 771 | send_to_emacs (s, data) | 767 | send_to_emacs (int s, char *data) |
| 772 | HSOCKET s; | ||
| 773 | char *data; | ||
| 774 | { | 768 | { |
| 775 | while (data) | 769 | while (data) |
| 776 | { | 770 | { |
| @@ -809,9 +803,7 @@ send_to_emacs (s, data) | |||
| 809 | 803 | ||
| 810 | Does not change the string. Outputs the result to STREAM. */ | 804 | Does not change the string. Outputs the result to STREAM. */ |
| 811 | void | 805 | void |
| 812 | quote_argument (s, str) | 806 | quote_argument (int s, char *str) |
| 813 | HSOCKET s; | ||
| 814 | char *str; | ||
| 815 | { | 807 | { |
| 816 | char *copy = (char *) xmalloc (strlen (str) * 2 + 1); | 808 | char *copy = (char *) xmalloc (strlen (str) * 2 + 1); |
| 817 | char *p, *q; | 809 | char *p, *q; |
| @@ -851,8 +843,7 @@ quote_argument (s, str) | |||
| 851 | modifying the string in place. Returns STR. */ | 843 | modifying the string in place. Returns STR. */ |
| 852 | 844 | ||
| 853 | char * | 845 | char * |
| 854 | unquote_argument (str) | 846 | unquote_argument (char *str) |
| 855 | char *str; | ||
| 856 | { | 847 | { |
| 857 | char *p, *q; | 848 | char *p, *q; |
| 858 | 849 | ||
| @@ -883,8 +874,7 @@ unquote_argument (str) | |||
| 883 | 874 | ||
| 884 | 875 | ||
| 885 | int | 876 | int |
| 886 | file_name_absolute_p (filename) | 877 | file_name_absolute_p (const unsigned char *filename) |
| 887 | const unsigned char *filename; | ||
| 888 | { | 878 | { |
| 889 | /* Sanity check, it shouldn't happen. */ | 879 | /* Sanity check, it shouldn't happen. */ |
| 890 | if (! filename) return FALSE; | 880 | if (! filename) return FALSE; |
| @@ -938,9 +928,7 @@ initialize_sockets () | |||
| 938 | * the Emacs server: host, port, pid and authentication string. | 928 | * the Emacs server: host, port, pid and authentication string. |
| 939 | */ | 929 | */ |
| 940 | int | 930 | int |
| 941 | get_server_config (server, authentication) | 931 | get_server_config (struct sockaddr_in *server, char *authentication) |
| 942 | struct sockaddr_in *server; | ||
| 943 | char *authentication; | ||
| 944 | { | 932 | { |
| 945 | char dotted[32]; | 933 | char dotted[32]; |
| 946 | char *port; | 934 | char *port; |
| @@ -1005,7 +993,7 @@ get_server_config (server, authentication) | |||
| 1005 | } | 993 | } |
| 1006 | 994 | ||
| 1007 | HSOCKET | 995 | HSOCKET |
| 1008 | set_tcp_socket () | 996 | set_tcp_socket (void) |
| 1009 | { | 997 | { |
| 1010 | HSOCKET s; | 998 | HSOCKET s; |
| 1011 | struct sockaddr_in server; | 999 | struct sockaddr_in server; |
| @@ -1119,8 +1107,7 @@ find_tty (char **tty_type, char **tty_name, int noabort) | |||
| 1119 | 0 - success: none of the above */ | 1107 | 0 - success: none of the above */ |
| 1120 | 1108 | ||
| 1121 | static int | 1109 | static int |
| 1122 | socket_status (socket_name) | 1110 | socket_status (char *socket_name) |
| 1123 | char *socket_name; | ||
| 1124 | { | 1111 | { |
| 1125 | struct stat statbfr; | 1112 | struct stat statbfr; |
| 1126 | 1113 | ||
| @@ -1223,7 +1210,7 @@ init_signals (void) | |||
| 1223 | 1210 | ||
| 1224 | 1211 | ||
| 1225 | HSOCKET | 1212 | HSOCKET |
| 1226 | set_local_socket () | 1213 | set_local_socket (void) |
| 1227 | { | 1214 | { |
| 1228 | HSOCKET s; | 1215 | HSOCKET s; |
| 1229 | struct sockaddr_un server; | 1216 | struct sockaddr_un server; |
| @@ -1526,9 +1513,7 @@ start_daemon_and_retry_set_socket (void) | |||
| 1526 | } | 1513 | } |
| 1527 | 1514 | ||
| 1528 | int | 1515 | int |
| 1529 | main (argc, argv) | 1516 | main (int argc, char **argv) |
| 1530 | int argc; | ||
| 1531 | char **argv; | ||
| 1532 | { | 1517 | { |
| 1533 | int i, rl, needlf = 0; | 1518 | int i, rl, needlf = 0; |
| 1534 | char *cwd, *str; | 1519 | char *cwd, *str; |
diff --git a/lib-src/etags.c b/lib-src/etags.c index 34d1a2ba341..79475fe9922 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c | |||
| @@ -848,7 +848,7 @@ static language lang_names [] = | |||
| 848 | 848 | ||
| 849 | 849 | ||
| 850 | static void | 850 | static void |
| 851 | print_language_names () | 851 | print_language_names (void) |
| 852 | { | 852 | { |
| 853 | language *lang; | 853 | language *lang; |
| 854 | char **name, **ext; | 854 | char **name, **ext; |
| @@ -887,7 +887,7 @@ etags --help --lang=ada."); | |||
| 887 | # define VERSION "17.38.1.4" | 887 | # define VERSION "17.38.1.4" |
| 888 | #endif | 888 | #endif |
| 889 | static void | 889 | static void |
| 890 | print_version () | 890 | print_version (void) |
| 891 | { | 891 | { |
| 892 | /* Makes it easier to update automatically. */ | 892 | /* Makes it easier to update automatically. */ |
| 893 | char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc."; | 893 | char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc."; |
| @@ -904,8 +904,7 @@ print_version () | |||
| 904 | #endif | 904 | #endif |
| 905 | 905 | ||
| 906 | static void | 906 | static void |
| 907 | print_help (argbuffer) | 907 | print_help (argument *argbuffer) |
| 908 | argument *argbuffer; | ||
| 909 | { | 908 | { |
| 910 | bool help_for_lang = FALSE; | 909 | bool help_for_lang = FALSE; |
| 911 | 910 | ||
| @@ -1082,9 +1081,7 @@ Relative ones are stored relative to the output file's directory.\n"); | |||
| 1082 | 1081 | ||
| 1083 | 1082 | ||
| 1084 | int | 1083 | int |
| 1085 | main (argc, argv) | 1084 | main (int argc, char **argv) |
| 1086 | int argc; | ||
| 1087 | char *argv[]; | ||
| 1088 | { | 1085 | { |
| 1089 | int i; | 1086 | int i; |
| 1090 | unsigned int nincluded_files; | 1087 | unsigned int nincluded_files; |
| @@ -1409,9 +1406,7 @@ main (argc, argv) | |||
| 1409 | * Idea by Vladimir Alexiev <vladimir@cs.ualberta.ca> (1998) | 1406 | * Idea by Vladimir Alexiev <vladimir@cs.ualberta.ca> (1998) |
| 1410 | */ | 1407 | */ |
| 1411 | static compressor * | 1408 | static compressor * |
| 1412 | get_compressor_from_suffix (file, extptr) | 1409 | get_compressor_from_suffix (char *file, char **extptr) |
| 1413 | char *file; | ||
| 1414 | char **extptr; | ||
| 1415 | { | 1410 | { |
| 1416 | compressor *compr; | 1411 | compressor *compr; |
| 1417 | char *slash, *suffix; | 1412 | char *slash, *suffix; |
| @@ -1447,8 +1442,7 @@ get_compressor_from_suffix (file, extptr) | |||
| 1447 | * Return a language given the name. | 1442 | * Return a language given the name. |
| 1448 | */ | 1443 | */ |
| 1449 | static language * | 1444 | static language * |
| 1450 | get_language_from_langname (name) | 1445 | get_language_from_langname (const char *name) |
| 1451 | const char *name; | ||
| 1452 | { | 1446 | { |
| 1453 | language *lang; | 1447 | language *lang; |
| 1454 | 1448 | ||
| @@ -1470,8 +1464,7 @@ get_language_from_langname (name) | |||
| 1470 | * Return a language given the interpreter name. | 1464 | * Return a language given the interpreter name. |
| 1471 | */ | 1465 | */ |
| 1472 | static language * | 1466 | static language * |
| 1473 | get_language_from_interpreter (interpreter) | 1467 | get_language_from_interpreter (char *interpreter) |
| 1474 | char *interpreter; | ||
| 1475 | { | 1468 | { |
| 1476 | language *lang; | 1469 | language *lang; |
| 1477 | char **iname; | 1470 | char **iname; |
| @@ -1493,9 +1486,7 @@ get_language_from_interpreter (interpreter) | |||
| 1493 | * Return a language given the file name. | 1486 | * Return a language given the file name. |
| 1494 | */ | 1487 | */ |
| 1495 | static language * | 1488 | static language * |
| 1496 | get_language_from_filename (file, case_sensitive) | 1489 | get_language_from_filename (char *file, int case_sensitive) |
| 1497 | char *file; | ||
| 1498 | bool case_sensitive; | ||
| 1499 | { | 1490 | { |
| 1500 | language *lang; | 1491 | language *lang; |
| 1501 | char **name, **ext, *suffix; | 1492 | char **name, **ext, *suffix; |
| @@ -1529,9 +1520,7 @@ get_language_from_filename (file, case_sensitive) | |||
| 1529 | * This routine is called on each file argument. | 1520 | * This routine is called on each file argument. |
| 1530 | */ | 1521 | */ |
| 1531 | static void | 1522 | static void |
| 1532 | process_file_name (file, lang) | 1523 | process_file_name (char *file, language *lang) |
| 1533 | char *file; | ||
| 1534 | language *lang; | ||
| 1535 | { | 1524 | { |
| 1536 | struct stat stat_buf; | 1525 | struct stat stat_buf; |
| 1537 | FILE *inf; | 1526 | FILE *inf; |
| @@ -1653,10 +1642,7 @@ process_file_name (file, lang) | |||
| 1653 | } | 1642 | } |
| 1654 | 1643 | ||
| 1655 | static void | 1644 | static void |
| 1656 | process_file (fh, fn, lang) | 1645 | process_file (FILE *fh, char *fn, language *lang) |
| 1657 | FILE *fh; | ||
| 1658 | char *fn; | ||
| 1659 | language *lang; | ||
| 1660 | { | 1646 | { |
| 1661 | static const fdesc emptyfdesc; | 1647 | static const fdesc emptyfdesc; |
| 1662 | fdesc *fdp; | 1648 | fdesc *fdp; |
| @@ -1733,7 +1719,7 @@ process_file (fh, fn, lang) | |||
| 1733 | * of a char is TRUE if it is the string "white", else FALSE. | 1719 | * of a char is TRUE if it is the string "white", else FALSE. |
| 1734 | */ | 1720 | */ |
| 1735 | static void | 1721 | static void |
| 1736 | init () | 1722 | init (void) |
| 1737 | { | 1723 | { |
| 1738 | register char *sp; | 1724 | register char *sp; |
| 1739 | register int i; | 1725 | register int i; |
| @@ -1756,8 +1742,7 @@ init () | |||
| 1756 | * which finds the function and type definitions. | 1742 | * which finds the function and type definitions. |
| 1757 | */ | 1743 | */ |
| 1758 | static void | 1744 | static void |
| 1759 | find_entries (inf) | 1745 | find_entries (FILE *inf) |
| 1760 | FILE *inf; | ||
| 1761 | { | 1746 | { |
| 1762 | char *cp; | 1747 | char *cp; |
| 1763 | language *lang = curfdp->lang; | 1748 | language *lang = curfdp->lang; |
| @@ -1915,14 +1900,14 @@ find_entries (inf) | |||
| 1915 | * etags.el needs to use the same characters that are in NONAM. | 1900 | * etags.el needs to use the same characters that are in NONAM. |
| 1916 | */ | 1901 | */ |
| 1917 | static void | 1902 | static void |
| 1918 | make_tag (name, namelen, is_func, linestart, linelen, lno, cno) | 1903 | make_tag (char *name, int namelen, int is_func, char *linestart, int linelen, int lno, long int cno) |
| 1919 | char *name; /* tag name, or NULL if unnamed */ | 1904 | /* tag name, or NULL if unnamed */ |
| 1920 | int namelen; /* tag length */ | 1905 | /* tag length */ |
| 1921 | bool is_func; /* tag is a function */ | 1906 | /* tag is a function */ |
| 1922 | char *linestart; /* start of the line where tag is */ | 1907 | /* start of the line where tag is */ |
| 1923 | int linelen; /* length of the line where tag is */ | 1908 | /* length of the line where tag is */ |
| 1924 | int lno; /* line number */ | 1909 | /* line number */ |
| 1925 | long cno; /* character number */ | 1910 | /* character number */ |
| 1926 | { | 1911 | { |
| 1927 | bool named = (name != NULL && namelen > 0); | 1912 | bool named = (name != NULL && namelen > 0); |
| 1928 | 1913 | ||
| @@ -1958,13 +1943,13 @@ make_tag (name, namelen, is_func, linestart, linelen, lno, cno) | |||
| 1958 | 1943 | ||
| 1959 | /* Record a tag. */ | 1944 | /* Record a tag. */ |
| 1960 | static void | 1945 | static void |
| 1961 | pfnote (name, is_func, linestart, linelen, lno, cno) | 1946 | pfnote (char *name, int is_func, char *linestart, int linelen, int lno, long int cno) |
| 1962 | char *name; /* tag name, or NULL if unnamed */ | 1947 | /* tag name, or NULL if unnamed */ |
| 1963 | bool is_func; /* tag is a function */ | 1948 | /* tag is a function */ |
| 1964 | char *linestart; /* start of the line where tag is */ | 1949 | /* start of the line where tag is */ |
| 1965 | int linelen; /* length of the line where tag is */ | 1950 | /* length of the line where tag is */ |
| 1966 | int lno; /* line number */ | 1951 | /* line number */ |
| 1967 | long cno; /* character number */ | 1952 | /* character number */ |
| 1968 | { | 1953 | { |
| 1969 | register node *np; | 1954 | register node *np; |
| 1970 | 1955 | ||
| @@ -2018,8 +2003,7 @@ pfnote (name, is_func, linestart, linelen, lno, cno) | |||
| 2018 | * recurse on left children, iterate on right children. | 2003 | * recurse on left children, iterate on right children. |
| 2019 | */ | 2004 | */ |
| 2020 | static void | 2005 | static void |
| 2021 | free_tree (np) | 2006 | free_tree (register node *np) |
| 2022 | register node *np; | ||
| 2023 | { | 2007 | { |
| 2024 | while (np) | 2008 | while (np) |
| 2025 | { | 2009 | { |
| @@ -2037,8 +2021,7 @@ free_tree (np) | |||
| 2037 | * delete a file description | 2021 | * delete a file description |
| 2038 | */ | 2022 | */ |
| 2039 | static void | 2023 | static void |
| 2040 | free_fdesc (fdp) | 2024 | free_fdesc (register fdesc *fdp) |
| 2041 | register fdesc *fdp; | ||
| 2042 | { | 2025 | { |
| 2043 | free (fdp->infname); | 2026 | free (fdp->infname); |
| 2044 | free (fdp->infabsname); | 2027 | free (fdp->infabsname); |
| @@ -2058,8 +2041,7 @@ free_fdesc (fdp) | |||
| 2058 | * maintain state. | 2041 | * maintain state. |
| 2059 | */ | 2042 | */ |
| 2060 | static void | 2043 | static void |
| 2061 | add_node (np, cur_node_p) | 2044 | add_node (node *np, node **cur_node_p) |
| 2062 | node *np, **cur_node_p; | ||
| 2063 | { | 2045 | { |
| 2064 | register int dif; | 2046 | register int dif; |
| 2065 | register node *cur_node = *cur_node_p; | 2047 | register node *cur_node = *cur_node_p; |
| @@ -2139,9 +2121,7 @@ add_node (np, cur_node_p) | |||
| 2139 | * given file description (CTAGS case) or free them (ETAGS case). | 2121 | * given file description (CTAGS case) or free them (ETAGS case). |
| 2140 | */ | 2122 | */ |
| 2141 | static void | 2123 | static void |
| 2142 | invalidate_nodes (badfdp, npp) | 2124 | invalidate_nodes (fdesc *badfdp, node **npp) |
| 2143 | fdesc *badfdp; | ||
| 2144 | node **npp; | ||
| 2145 | { | 2125 | { |
| 2146 | node *np = *npp; | 2126 | node *np = *npp; |
| 2147 | 2127 | ||
| @@ -2178,8 +2158,7 @@ static int number_len (long); | |||
| 2178 | 2158 | ||
| 2179 | /* Length of a non-negative number's decimal representation. */ | 2159 | /* Length of a non-negative number's decimal representation. */ |
| 2180 | static int | 2160 | static int |
| 2181 | number_len (num) | 2161 | number_len (long int num) |
| 2182 | long num; | ||
| 2183 | { | 2162 | { |
| 2184 | int len = 1; | 2163 | int len = 1; |
| 2185 | while ((num /= 10) > 0) | 2164 | while ((num /= 10) > 0) |
| @@ -2194,8 +2173,7 @@ number_len (num) | |||
| 2194 | * but is still supplied for backward compatibility. | 2173 | * but is still supplied for backward compatibility. |
| 2195 | */ | 2174 | */ |
| 2196 | static int | 2175 | static int |
| 2197 | total_size_of_entries (np) | 2176 | total_size_of_entries (register node *np) |
| 2198 | register node *np; | ||
| 2199 | { | 2177 | { |
| 2200 | register int total = 0; | 2178 | register int total = 0; |
| 2201 | 2179 | ||
| @@ -2215,8 +2193,7 @@ total_size_of_entries (np) | |||
| 2215 | } | 2193 | } |
| 2216 | 2194 | ||
| 2217 | static void | 2195 | static void |
| 2218 | put_entries (np) | 2196 | put_entries (register node *np) |
| 2219 | register node *np; | ||
| 2220 | { | 2197 | { |
| 2221 | register char *sp; | 2198 | register char *sp; |
| 2222 | static fdesc *fdp = NULL; | 2199 | static fdesc *fdp = NULL; |
| @@ -2395,9 +2372,7 @@ inline | |||
| 2395 | #endif | 2372 | #endif |
| 2396 | #endif | 2373 | #endif |
| 2397 | static unsigned int | 2374 | static unsigned int |
| 2398 | hash (str, len) | 2375 | hash (register const char *str, register unsigned int len) |
| 2399 | register const char *str; | ||
| 2400 | register unsigned int len; | ||
| 2401 | { | 2376 | { |
| 2402 | static unsigned char asso_values[] = | 2377 | static unsigned char asso_values[] = |
| 2403 | { | 2378 | { |
| @@ -2443,9 +2418,7 @@ hash (str, len) | |||
| 2443 | } | 2418 | } |
| 2444 | 2419 | ||
| 2445 | static struct C_stab_entry * | 2420 | static struct C_stab_entry * |
| 2446 | in_word_set (str, len) | 2421 | in_word_set (register const char *str, register unsigned int len) |
| 2447 | register const char *str; | ||
| 2448 | register unsigned int len; | ||
| 2449 | { | 2422 | { |
| 2450 | enum | 2423 | enum |
| 2451 | { | 2424 | { |
| @@ -2511,10 +2484,7 @@ in_word_set (str, len) | |||
| 2511 | /*%>*/ | 2484 | /*%>*/ |
| 2512 | 2485 | ||
| 2513 | static enum sym_type | 2486 | static enum sym_type |
| 2514 | C_symtype (str, len, c_ext) | 2487 | C_symtype (char *str, int len, int c_ext) |
| 2515 | char *str; | ||
| 2516 | int len; | ||
| 2517 | int c_ext; | ||
| 2518 | { | 2488 | { |
| 2519 | register struct C_stab_entry *se = in_word_set (str, len); | 2489 | register struct C_stab_entry *se = in_word_set (str, len); |
| 2520 | 2490 | ||
| @@ -2658,10 +2628,7 @@ static struct { | |||
| 2658 | && bracelev == cstack.bracelev[nestlev-1] + 1) | 2628 | && bracelev == cstack.bracelev[nestlev-1] + 1) |
| 2659 | 2629 | ||
| 2660 | static void | 2630 | static void |
| 2661 | pushclass_above (bracelev, str, len) | 2631 | pushclass_above (int bracelev, char *str, int len) |
| 2662 | int bracelev; | ||
| 2663 | char *str; | ||
| 2664 | int len; | ||
| 2665 | { | 2632 | { |
| 2666 | int nl; | 2633 | int nl; |
| 2667 | 2634 | ||
| @@ -2680,8 +2647,7 @@ pushclass_above (bracelev, str, len) | |||
| 2680 | } | 2647 | } |
| 2681 | 2648 | ||
| 2682 | static void | 2649 | static void |
| 2683 | popclass_above (bracelev) | 2650 | popclass_above (int bracelev) |
| 2684 | int bracelev; | ||
| 2685 | { | 2651 | { |
| 2686 | int nl; | 2652 | int nl; |
| 2687 | 2653 | ||
| @@ -2695,9 +2661,7 @@ popclass_above (bracelev) | |||
| 2695 | } | 2661 | } |
| 2696 | 2662 | ||
| 2697 | static void | 2663 | static void |
| 2698 | write_classname (cn, qualifier) | 2664 | write_classname (linebuffer *cn, char *qualifier) |
| 2699 | linebuffer *cn; | ||
| 2700 | char *qualifier; | ||
| 2701 | { | 2665 | { |
| 2702 | int i, len; | 2666 | int i, len; |
| 2703 | int qlen = strlen (qualifier); | 2667 | int qlen = strlen (qualifier); |
| @@ -2752,14 +2716,14 @@ static void make_C_tag (bool); | |||
| 2752 | */ | 2716 | */ |
| 2753 | 2717 | ||
| 2754 | static bool | 2718 | static bool |
| 2755 | consider_token (str, len, c, c_extp, bracelev, parlev, is_func_or_var) | 2719 | consider_token (register char *str, register int len, register int c, int *c_extp, int bracelev, int parlev, int *is_func_or_var) |
| 2756 | register char *str; /* IN: token pointer */ | 2720 | /* IN: token pointer */ |
| 2757 | register int len; /* IN: token length */ | 2721 | /* IN: token length */ |
| 2758 | register int c; /* IN: first char after the token */ | 2722 | /* IN: first char after the token */ |
| 2759 | int *c_extp; /* IN, OUT: C extensions mask */ | 2723 | /* IN, OUT: C extensions mask */ |
| 2760 | int bracelev; /* IN: brace level */ | 2724 | /* IN: brace level */ |
| 2761 | int parlev; /* IN: parenthesis level */ | 2725 | /* IN: parenthesis level */ |
| 2762 | bool *is_func_or_var; /* OUT: function or variable found */ | 2726 | /* OUT: function or variable found */ |
| 2763 | { | 2727 | { |
| 2764 | /* When structdef is stagseen, scolonseen, or snone with bracelev > 0, | 2728 | /* When structdef is stagseen, scolonseen, or snone with bracelev > 0, |
| 2765 | structtype is the type of the preceding struct-like keyword, and | 2729 | structtype is the type of the preceding struct-like keyword, and |
| @@ -3093,8 +3057,7 @@ do { \ | |||
| 3093 | 3057 | ||
| 3094 | 3058 | ||
| 3095 | static void | 3059 | static void |
| 3096 | make_C_tag (isfun) | 3060 | make_C_tag (int isfun) |
| 3097 | bool isfun; | ||
| 3098 | { | 3061 | { |
| 3099 | /* This function is never called when token.valid is FALSE, but | 3062 | /* This function is never called when token.valid is FALSE, but |
| 3100 | we must protect against invalid input or internal errors. */ | 3063 | we must protect against invalid input or internal errors. */ |
| @@ -3120,9 +3083,9 @@ make_C_tag (isfun) | |||
| 3120 | * C syntax and adds them to the list. | 3083 | * C syntax and adds them to the list. |
| 3121 | */ | 3084 | */ |
| 3122 | static void | 3085 | static void |
| 3123 | C_entries (c_ext, inf) | 3086 | C_entries (int c_ext, FILE *inf) |
| 3124 | int c_ext; /* extension of C */ | 3087 | /* extension of C */ |
| 3125 | FILE *inf; /* input file */ | 3088 | /* input file */ |
| 3126 | { | 3089 | { |
| 3127 | register char c; /* latest char read; '\0' for end of line */ | 3090 | register char c; /* latest char read; '\0' for end of line */ |
| 3128 | register char *lp; /* pointer one beyond the character `c' */ | 3091 | register char *lp; /* pointer one beyond the character `c' */ |
| @@ -3952,48 +3915,42 @@ C_entries (c_ext, inf) | |||
| 3952 | * of a global flag. | 3915 | * of a global flag. |
| 3953 | */ | 3916 | */ |
| 3954 | static void | 3917 | static void |
| 3955 | default_C_entries (inf) | 3918 | default_C_entries (FILE *inf) |
| 3956 | FILE *inf; | ||
| 3957 | { | 3919 | { |
| 3958 | C_entries (cplusplus ? C_PLPL : C_AUTO, inf); | 3920 | C_entries (cplusplus ? C_PLPL : C_AUTO, inf); |
| 3959 | } | 3921 | } |
| 3960 | 3922 | ||
| 3961 | /* Always do plain C. */ | 3923 | /* Always do plain C. */ |
| 3962 | static void | 3924 | static void |
| 3963 | plain_C_entries (inf) | 3925 | plain_C_entries (FILE *inf) |
| 3964 | FILE *inf; | ||
| 3965 | { | 3926 | { |
| 3966 | C_entries (0, inf); | 3927 | C_entries (0, inf); |
| 3967 | } | 3928 | } |
| 3968 | 3929 | ||
| 3969 | /* Always do C++. */ | 3930 | /* Always do C++. */ |
| 3970 | static void | 3931 | static void |
| 3971 | Cplusplus_entries (inf) | 3932 | Cplusplus_entries (FILE *inf) |
| 3972 | FILE *inf; | ||
| 3973 | { | 3933 | { |
| 3974 | C_entries (C_PLPL, inf); | 3934 | C_entries (C_PLPL, inf); |
| 3975 | } | 3935 | } |
| 3976 | 3936 | ||
| 3977 | /* Always do Java. */ | 3937 | /* Always do Java. */ |
| 3978 | static void | 3938 | static void |
| 3979 | Cjava_entries (inf) | 3939 | Cjava_entries (FILE *inf) |
| 3980 | FILE *inf; | ||
| 3981 | { | 3940 | { |
| 3982 | C_entries (C_JAVA, inf); | 3941 | C_entries (C_JAVA, inf); |
| 3983 | } | 3942 | } |
| 3984 | 3943 | ||
| 3985 | /* Always do C*. */ | 3944 | /* Always do C*. */ |
| 3986 | static void | 3945 | static void |
| 3987 | Cstar_entries (inf) | 3946 | Cstar_entries (FILE *inf) |
| 3988 | FILE *inf; | ||
| 3989 | { | 3947 | { |
| 3990 | C_entries (C_STAR, inf); | 3948 | C_entries (C_STAR, inf); |
| 3991 | } | 3949 | } |
| 3992 | 3950 | ||
| 3993 | /* Always do Yacc. */ | 3951 | /* Always do Yacc. */ |
| 3994 | static void | 3952 | static void |
| 3995 | Yacc_entries (inf) | 3953 | Yacc_entries (FILE *inf) |
| 3996 | FILE *inf; | ||
| 3997 | { | 3954 | { |
| 3998 | C_entries (YACC, inf); | 3955 | C_entries (YACC, inf); |
| 3999 | } | 3956 | } |
| @@ -4026,8 +3983,7 @@ Yacc_entries (inf) | |||
| 4026 | * matching on files that have no language defined. | 3983 | * matching on files that have no language defined. |
| 4027 | */ | 3984 | */ |
| 4028 | static void | 3985 | static void |
| 4029 | just_read_file (inf) | 3986 | just_read_file (FILE *inf) |
| 4030 | FILE *inf; | ||
| 4031 | { | 3987 | { |
| 4032 | register char *dummy; | 3988 | register char *dummy; |
| 4033 | 3989 | ||
| @@ -4042,7 +3998,7 @@ static void F_takeprec (void); | |||
| 4042 | static void F_getit (FILE *); | 3998 | static void F_getit (FILE *); |
| 4043 | 3999 | ||
| 4044 | static void | 4000 | static void |
| 4045 | F_takeprec () | 4001 | F_takeprec (void) |
| 4046 | { | 4002 | { |
| 4047 | dbp = skip_spaces (dbp); | 4003 | dbp = skip_spaces (dbp); |
| 4048 | if (*dbp != '*') | 4004 | if (*dbp != '*') |
| @@ -4065,8 +4021,7 @@ F_takeprec () | |||
| 4065 | } | 4021 | } |
| 4066 | 4022 | ||
| 4067 | static void | 4023 | static void |
| 4068 | F_getit (inf) | 4024 | F_getit (FILE *inf) |
| 4069 | FILE *inf; | ||
| 4070 | { | 4025 | { |
| 4071 | register char *cp; | 4026 | register char *cp; |
| 4072 | 4027 | ||
| @@ -4090,8 +4045,7 @@ F_getit (inf) | |||
| 4090 | 4045 | ||
| 4091 | 4046 | ||
| 4092 | static void | 4047 | static void |
| 4093 | Fortran_functions (inf) | 4048 | Fortran_functions (FILE *inf) |
| 4094 | FILE *inf; | ||
| 4095 | { | 4049 | { |
| 4096 | LOOP_ON_INPUT_LINES (inf, lb, dbp) | 4050 | LOOP_ON_INPUT_LINES (inf, lb, dbp) |
| 4097 | { | 4051 | { |
| @@ -4178,9 +4132,7 @@ static void Ada_getit (FILE *, char *); | |||
| 4178 | /* Once we are positioned after an "interesting" keyword, let's get | 4132 | /* Once we are positioned after an "interesting" keyword, let's get |
| 4179 | the real tag value necessary. */ | 4133 | the real tag value necessary. */ |
| 4180 | static void | 4134 | static void |
| 4181 | Ada_getit (inf, name_qualifier) | 4135 | Ada_getit (FILE *inf, char *name_qualifier) |
| 4182 | FILE *inf; | ||
| 4183 | char *name_qualifier; | ||
| 4184 | { | 4136 | { |
| 4185 | register char *cp; | 4137 | register char *cp; |
| 4186 | char *name; | 4138 | char *name; |
| @@ -4243,8 +4195,7 @@ Ada_getit (inf, name_qualifier) | |||
| 4243 | } | 4195 | } |
| 4244 | 4196 | ||
| 4245 | static void | 4197 | static void |
| 4246 | Ada_funcs (inf) | 4198 | Ada_funcs (FILE *inf) |
| 4247 | FILE *inf; | ||
| 4248 | { | 4199 | { |
| 4249 | bool inquote = FALSE; | 4200 | bool inquote = FALSE; |
| 4250 | bool skip_till_semicolumn = FALSE; | 4201 | bool skip_till_semicolumn = FALSE; |
| @@ -4357,8 +4308,7 @@ Ada_funcs (inf) | |||
| 4357 | * Idea by Bob Weiner, Motorola Inc. (1994) | 4308 | * Idea by Bob Weiner, Motorola Inc. (1994) |
| 4358 | */ | 4309 | */ |
| 4359 | static void | 4310 | static void |
| 4360 | Asm_labels (inf) | 4311 | Asm_labels (FILE *inf) |
| 4361 | FILE *inf; | ||
| 4362 | { | 4312 | { |
| 4363 | register char *cp; | 4313 | register char *cp; |
| 4364 | 4314 | ||
| @@ -4390,8 +4340,7 @@ Asm_labels (inf) | |||
| 4390 | * Ideas by Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> (2001) | 4340 | * Ideas by Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> (2001) |
| 4391 | */ | 4341 | */ |
| 4392 | static void | 4342 | static void |
| 4393 | Perl_functions (inf) | 4343 | Perl_functions (FILE *inf) |
| 4394 | FILE *inf; | ||
| 4395 | { | 4344 | { |
| 4396 | char *package = savestr ("main"); /* current package name */ | 4345 | char *package = savestr ("main"); /* current package name */ |
| 4397 | register char *cp; | 4346 | register char *cp; |
| @@ -4473,8 +4422,7 @@ Perl_functions (inf) | |||
| 4473 | * More ideas by seb bacon <seb@jamkit.com> (2002) | 4422 | * More ideas by seb bacon <seb@jamkit.com> (2002) |
| 4474 | */ | 4423 | */ |
| 4475 | static void | 4424 | static void |
| 4476 | Python_functions (inf) | 4425 | Python_functions (FILE *inf) |
| 4477 | FILE *inf; | ||
| 4478 | { | 4426 | { |
| 4479 | register char *cp; | 4427 | register char *cp; |
| 4480 | 4428 | ||
| @@ -4504,8 +4452,7 @@ Python_functions (inf) | |||
| 4504 | * Idea by Diez B. Roggisch (2001) | 4452 | * Idea by Diez B. Roggisch (2001) |
| 4505 | */ | 4453 | */ |
| 4506 | static void | 4454 | static void |
| 4507 | PHP_functions (inf) | 4455 | PHP_functions (FILE *inf) |
| 4508 | FILE *inf; | ||
| 4509 | { | 4456 | { |
| 4510 | register char *cp, *name; | 4457 | register char *cp, *name; |
| 4511 | bool search_identifier = FALSE; | 4458 | bool search_identifier = FALSE; |
| @@ -4584,8 +4531,7 @@ PHP_functions (inf) | |||
| 4584 | * Idea by Corny de Souza (1993) | 4531 | * Idea by Corny de Souza (1993) |
| 4585 | */ | 4532 | */ |
| 4586 | static void | 4533 | static void |
| 4587 | Cobol_paragraphs (inf) | 4534 | Cobol_paragraphs (FILE *inf) |
| 4588 | FILE *inf; | ||
| 4589 | { | 4535 | { |
| 4590 | register char *bp, *ep; | 4536 | register char *bp, *ep; |
| 4591 | 4537 | ||
| @@ -4613,8 +4559,7 @@ Cobol_paragraphs (inf) | |||
| 4613 | * Ideas by Assar Westerlund <assar@sics.se> (2001) | 4559 | * Ideas by Assar Westerlund <assar@sics.se> (2001) |
| 4614 | */ | 4560 | */ |
| 4615 | static void | 4561 | static void |
| 4616 | Makefile_targets (inf) | 4562 | Makefile_targets (FILE *inf) |
| 4617 | FILE *inf; | ||
| 4618 | { | 4563 | { |
| 4619 | register char *bp; | 4564 | register char *bp; |
| 4620 | 4565 | ||
| @@ -4649,8 +4594,7 @@ Makefile_targets (inf) | |||
| 4649 | * the tag is skipped. | 4594 | * the tag is skipped. |
| 4650 | */ | 4595 | */ |
| 4651 | static void | 4596 | static void |
| 4652 | Pascal_functions (inf) | 4597 | Pascal_functions (FILE *inf) |
| 4653 | FILE *inf; | ||
| 4654 | { | 4598 | { |
| 4655 | linebuffer tline; /* mostly copied from C_entries */ | 4599 | linebuffer tline; /* mostly copied from C_entries */ |
| 4656 | long save_lcno; | 4600 | long save_lcno; |
| @@ -4830,7 +4774,7 @@ Pascal_functions (inf) | |||
| 4830 | static void L_getit (void); | 4774 | static void L_getit (void); |
| 4831 | 4775 | ||
| 4832 | static void | 4776 | static void |
| 4833 | L_getit () | 4777 | L_getit (void) |
| 4834 | { | 4778 | { |
| 4835 | if (*dbp == '\'') /* Skip prefix quote */ | 4779 | if (*dbp == '\'') /* Skip prefix quote */ |
| 4836 | dbp++; | 4780 | dbp++; |
| @@ -4846,8 +4790,7 @@ L_getit () | |||
| 4846 | } | 4790 | } |
| 4847 | 4791 | ||
| 4848 | static void | 4792 | static void |
| 4849 | Lisp_functions (inf) | 4793 | Lisp_functions (FILE *inf) |
| 4850 | FILE *inf; | ||
| 4851 | { | 4794 | { |
| 4852 | LOOP_ON_INPUT_LINES (inf, lb, dbp) | 4795 | LOOP_ON_INPUT_LINES (inf, lb, dbp) |
| 4853 | { | 4796 | { |
| @@ -4891,8 +4834,7 @@ Lisp_functions (inf) | |||
| 4891 | * "function" and "local function" are tags if they start at column 1. | 4834 | * "function" and "local function" are tags if they start at column 1. |
| 4892 | */ | 4835 | */ |
| 4893 | static void | 4836 | static void |
| 4894 | Lua_functions (inf) | 4837 | Lua_functions (FILE *inf) |
| 4895 | FILE *inf; | ||
| 4896 | { | 4838 | { |
| 4897 | register char *bp; | 4839 | register char *bp; |
| 4898 | 4840 | ||
| @@ -4918,8 +4860,7 @@ Lua_functions (inf) | |||
| 4918 | * Masatake Yamato <masata-y@is.aist-nara.ac.jp> (1999) | 4860 | * Masatake Yamato <masata-y@is.aist-nara.ac.jp> (1999) |
| 4919 | */ | 4861 | */ |
| 4920 | static void | 4862 | static void |
| 4921 | PS_functions (inf) | 4863 | PS_functions (FILE *inf) |
| 4922 | FILE *inf; | ||
| 4923 | { | 4864 | { |
| 4924 | register char *bp, *ep; | 4865 | register char *bp, *ep; |
| 4925 | 4866 | ||
| @@ -4949,8 +4890,7 @@ PS_functions (inf) | |||
| 4949 | * Ideas by Eduardo Horvath <eeh@netbsd.org> (2004) | 4890 | * Ideas by Eduardo Horvath <eeh@netbsd.org> (2004) |
| 4950 | */ | 4891 | */ |
| 4951 | static void | 4892 | static void |
| 4952 | Forth_words (inf) | 4893 | Forth_words (FILE *inf) |
| 4953 | FILE *inf; | ||
| 4954 | { | 4894 | { |
| 4955 | register char *bp; | 4895 | register char *bp; |
| 4956 | 4896 | ||
| @@ -4986,8 +4926,7 @@ Forth_words (inf) | |||
| 4986 | * Original code by Ken Haase (1985?) | 4926 | * Original code by Ken Haase (1985?) |
| 4987 | */ | 4927 | */ |
| 4988 | static void | 4928 | static void |
| 4989 | Scheme_functions (inf) | 4929 | Scheme_functions (FILE *inf) |
| 4990 | FILE *inf; | ||
| 4991 | { | 4930 | { |
| 4992 | register char *bp; | 4931 | register char *bp; |
| 4993 | 4932 | ||
| @@ -5038,8 +4977,7 @@ static char TEX_clgrp = '}'; | |||
| 5038 | * TeX/LaTeX scanning loop. | 4977 | * TeX/LaTeX scanning loop. |
| 5039 | */ | 4978 | */ |
| 5040 | static void | 4979 | static void |
| 5041 | TeX_commands (inf) | 4980 | TeX_commands (FILE *inf) |
| 5042 | FILE *inf; | ||
| 5043 | { | 4981 | { |
| 5044 | char *cp; | 4982 | char *cp; |
| 5045 | linebuffer *key; | 4983 | linebuffer *key; |
| @@ -5103,8 +5041,7 @@ TeX_commands (inf) | |||
| 5103 | /* Figure out whether TeX's escapechar is '\\' or '!' and set grouping | 5041 | /* Figure out whether TeX's escapechar is '\\' or '!' and set grouping |
| 5104 | chars accordingly. */ | 5042 | chars accordingly. */ |
| 5105 | static void | 5043 | static void |
| 5106 | TEX_mode (inf) | 5044 | TEX_mode (FILE *inf) |
| 5107 | FILE *inf; | ||
| 5108 | { | 5045 | { |
| 5109 | int c; | 5046 | int c; |
| 5110 | 5047 | ||
| @@ -5138,9 +5075,7 @@ TEX_mode (inf) | |||
| 5138 | /* Read environment and prepend it to the default string. | 5075 | /* Read environment and prepend it to the default string. |
| 5139 | Build token table. */ | 5076 | Build token table. */ |
| 5140 | static void | 5077 | static void |
| 5141 | TEX_decode_env (evarname, defenv) | 5078 | TEX_decode_env (char *evarname, char *defenv) |
| 5142 | char *evarname; | ||
| 5143 | char *defenv; | ||
| 5144 | { | 5079 | { |
| 5145 | register char *env, *p; | 5080 | register char *env, *p; |
| 5146 | int i, len; | 5081 | int i, len; |
| @@ -5188,8 +5123,7 @@ TEX_decode_env (evarname, defenv) | |||
| 5188 | 5123 | ||
| 5189 | /* Texinfo support. Dave Love, Mar. 2000. */ | 5124 | /* Texinfo support. Dave Love, Mar. 2000. */ |
| 5190 | static void | 5125 | static void |
| 5191 | Texinfo_nodes (inf) | 5126 | Texinfo_nodes (FILE *inf) |
| 5192 | FILE * inf; | ||
| 5193 | { | 5127 | { |
| 5194 | char *cp, *start; | 5128 | char *cp, *start; |
| 5195 | LOOP_ON_INPUT_LINES (inf, lb, cp) | 5129 | LOOP_ON_INPUT_LINES (inf, lb, cp) |
| @@ -5212,8 +5146,7 @@ Texinfo_nodes (inf) | |||
| 5212 | * Francesco Potortì, 2002. | 5146 | * Francesco Potortì, 2002. |
| 5213 | */ | 5147 | */ |
| 5214 | static void | 5148 | static void |
| 5215 | HTML_labels (inf) | 5149 | HTML_labels (FILE *inf) |
| 5216 | FILE * inf; | ||
| 5217 | { | 5150 | { |
| 5218 | bool getnext = FALSE; /* next text outside of HTML tags is a tag */ | 5151 | bool getnext = FALSE; /* next text outside of HTML tags is a tag */ |
| 5219 | bool skiptag = FALSE; /* skip to the end of the current HTML tag */ | 5152 | bool skiptag = FALSE; /* skip to the end of the current HTML tag */ |
| @@ -5338,8 +5271,7 @@ static void prolog_skip_comment (linebuffer *, FILE *); | |||
| 5338 | static int prolog_atom (char *, int); | 5271 | static int prolog_atom (char *, int); |
| 5339 | 5272 | ||
| 5340 | static void | 5273 | static void |
| 5341 | Prolog_functions (inf) | 5274 | Prolog_functions (FILE *inf) |
| 5342 | FILE *inf; | ||
| 5343 | { | 5275 | { |
| 5344 | char *cp, *last; | 5276 | char *cp, *last; |
| 5345 | int len; | 5277 | int len; |
| @@ -5375,9 +5307,7 @@ Prolog_functions (inf) | |||
| 5375 | 5307 | ||
| 5376 | 5308 | ||
| 5377 | static void | 5309 | static void |
| 5378 | prolog_skip_comment (plb, inf) | 5310 | prolog_skip_comment (linebuffer *plb, FILE *inf) |
| 5379 | linebuffer *plb; | ||
| 5380 | FILE *inf; | ||
| 5381 | { | 5311 | { |
| 5382 | char *cp; | 5312 | char *cp; |
| 5383 | 5313 | ||
| @@ -5403,9 +5333,9 @@ prolog_skip_comment (plb, inf) | |||
| 5403 | * header was found. | 5333 | * header was found. |
| 5404 | */ | 5334 | */ |
| 5405 | static int | 5335 | static int |
| 5406 | prolog_pr (s, last) | 5336 | prolog_pr (char *s, char *last) |
| 5407 | char *s; | 5337 | |
| 5408 | char *last; /* Name of last clause. */ | 5338 | /* Name of last clause. */ |
| 5409 | { | 5339 | { |
| 5410 | int pos; | 5340 | int pos; |
| 5411 | int len; | 5341 | int len; |
| @@ -5441,9 +5371,7 @@ prolog_pr (s, last) | |||
| 5441 | * Backslash quotes everything. | 5371 | * Backslash quotes everything. |
| 5442 | */ | 5372 | */ |
| 5443 | static int | 5373 | static int |
| 5444 | prolog_atom (s, pos) | 5374 | prolog_atom (char *s, int pos) |
| 5445 | char *s; | ||
| 5446 | int pos; | ||
| 5447 | { | 5375 | { |
| 5448 | int origpos; | 5376 | int origpos; |
| 5449 | 5377 | ||
| @@ -5503,8 +5431,7 @@ static void erlang_attribute (char *); | |||
| 5503 | static int erlang_atom (char *); | 5431 | static int erlang_atom (char *); |
| 5504 | 5432 | ||
| 5505 | static void | 5433 | static void |
| 5506 | Erlang_functions (inf) | 5434 | Erlang_functions (FILE *inf) |
| 5507 | FILE *inf; | ||
| 5508 | { | 5435 | { |
| 5509 | char *cp, *last; | 5436 | char *cp, *last; |
| 5510 | int len; | 5437 | int len; |
| @@ -5563,9 +5490,9 @@ Erlang_functions (inf) | |||
| 5563 | * was found. | 5490 | * was found. |
| 5564 | */ | 5491 | */ |
| 5565 | static int | 5492 | static int |
| 5566 | erlang_func (s, last) | 5493 | erlang_func (char *s, char *last) |
| 5567 | char *s; | 5494 | |
| 5568 | char *last; /* Name of last clause. */ | 5495 | /* Name of last clause. */ |
| 5569 | { | 5496 | { |
| 5570 | int pos; | 5497 | int pos; |
| 5571 | int len; | 5498 | int len; |
| @@ -5601,8 +5528,7 @@ erlang_func (s, last) | |||
| 5601 | * -record(graph, {vtab = notable, cyclic = true}). | 5528 | * -record(graph, {vtab = notable, cyclic = true}). |
| 5602 | */ | 5529 | */ |
| 5603 | static void | 5530 | static void |
| 5604 | erlang_attribute (s) | 5531 | erlang_attribute (char *s) |
| 5605 | char *s; | ||
| 5606 | { | 5532 | { |
| 5607 | char *cp = s; | 5533 | char *cp = s; |
| 5608 | 5534 | ||
| @@ -5622,8 +5548,7 @@ erlang_attribute (s) | |||
| 5622 | * Return the number of bytes consumed, or -1 if there was an error. | 5548 | * Return the number of bytes consumed, or -1 if there was an error. |
| 5623 | */ | 5549 | */ |
| 5624 | static int | 5550 | static int |
| 5625 | erlang_atom (s) | 5551 | erlang_atom (char *s) |
| 5626 | char *s; | ||
| 5627 | { | 5552 | { |
| 5628 | int pos = 0; | 5553 | int pos = 0; |
| 5629 | 5554 | ||
| @@ -5661,8 +5586,7 @@ static char *substitute (char *, char *, struct re_registers *); | |||
| 5661 | * unterminated regexps. | 5586 | * unterminated regexps. |
| 5662 | */ | 5587 | */ |
| 5663 | static char * | 5588 | static char * |
| 5664 | scan_separators (name) | 5589 | scan_separators (char *name) |
| 5665 | char *name; | ||
| 5666 | { | 5590 | { |
| 5667 | char sep = name[0]; | 5591 | char sep = name[0]; |
| 5668 | char *copyto = name; | 5592 | char *copyto = name; |
| @@ -5714,8 +5638,7 @@ scan_separators (name) | |||
| 5714 | /* Look at the argument of --regex or --no-regex and do the right | 5638 | /* Look at the argument of --regex or --no-regex and do the right |
| 5715 | thing. Same for each line of a regexp file. */ | 5639 | thing. Same for each line of a regexp file. */ |
| 5716 | static void | 5640 | static void |
| 5717 | analyse_regex (regex_arg) | 5641 | analyse_regex (char *regex_arg) |
| 5718 | char *regex_arg; | ||
| 5719 | { | 5642 | { |
| 5720 | if (regex_arg == NULL) | 5643 | if (regex_arg == NULL) |
| 5721 | { | 5644 | { |
| @@ -5786,9 +5709,7 @@ analyse_regex (regex_arg) | |||
| 5786 | /* Separate the regexp pattern, compile it, | 5709 | /* Separate the regexp pattern, compile it, |
| 5787 | and care for optional name and modifiers. */ | 5710 | and care for optional name and modifiers. */ |
| 5788 | static void | 5711 | static void |
| 5789 | add_regex (regexp_pattern, lang) | 5712 | add_regex (char *regexp_pattern, language *lang) |
| 5790 | char *regexp_pattern; | ||
| 5791 | language *lang; | ||
| 5792 | { | 5713 | { |
| 5793 | static struct re_pattern_buffer zeropattern; | 5714 | static struct re_pattern_buffer zeropattern; |
| 5794 | char sep, *pat, *name, *modifiers; | 5715 | char sep, *pat, *name, *modifiers; |
| @@ -5905,9 +5826,7 @@ add_regex (regexp_pattern, lang) | |||
| 5905 | * arguments. | 5826 | * arguments. |
| 5906 | */ | 5827 | */ |
| 5907 | static char * | 5828 | static char * |
| 5908 | substitute (in, out, regs) | 5829 | substitute (char *in, char *out, struct re_registers *regs) |
| 5909 | char *in, *out; | ||
| 5910 | struct re_registers *regs; | ||
| 5911 | { | 5830 | { |
| 5912 | char *result, *t; | 5831 | char *result, *t; |
| 5913 | int size, dig, diglen; | 5832 | int size, dig, diglen; |
| @@ -5954,7 +5873,7 @@ substitute (in, out, regs) | |||
| 5954 | 5873 | ||
| 5955 | /* Deallocate all regexps. */ | 5874 | /* Deallocate all regexps. */ |
| 5956 | static void | 5875 | static void |
| 5957 | free_regexps () | 5876 | free_regexps (void) |
| 5958 | { | 5877 | { |
| 5959 | regexp *rp; | 5878 | regexp *rp; |
| 5960 | while (p_head != NULL) | 5879 | while (p_head != NULL) |
| @@ -5976,7 +5895,7 @@ free_regexps () | |||
| 5976 | * Idea by Ben Wing <ben@666.com> (2002). | 5895 | * Idea by Ben Wing <ben@666.com> (2002). |
| 5977 | */ | 5896 | */ |
| 5978 | static void | 5897 | static void |
| 5979 | regex_tag_multiline () | 5898 | regex_tag_multiline (void) |
| 5980 | { | 5899 | { |
| 5981 | char *buffer = filebuf.buffer; | 5900 | char *buffer = filebuf.buffer; |
| 5982 | regexp *rp; | 5901 | regexp *rp; |
| @@ -6053,8 +5972,7 @@ regex_tag_multiline () | |||
| 6053 | 5972 | ||
| 6054 | 5973 | ||
| 6055 | static bool | 5974 | static bool |
| 6056 | nocase_tail (cp) | 5975 | nocase_tail (char *cp) |
| 6057 | char *cp; | ||
| 6058 | { | 5976 | { |
| 6059 | register int len = 0; | 5977 | register int len = 0; |
| 6060 | 5978 | ||
| @@ -6069,9 +5987,7 @@ nocase_tail (cp) | |||
| 6069 | } | 5987 | } |
| 6070 | 5988 | ||
| 6071 | static void | 5989 | static void |
| 6072 | get_tag (bp, namepp) | 5990 | get_tag (register char *bp, char **namepp) |
| 6073 | register char *bp; | ||
| 6074 | char **namepp; | ||
| 6075 | { | 5991 | { |
| 6076 | register char *cp = bp; | 5992 | register char *cp = bp; |
| 6077 | 5993 | ||
| @@ -6102,9 +6018,7 @@ get_tag (bp, namepp) | |||
| 6102 | * appended to `filebuf'. | 6018 | * appended to `filebuf'. |
| 6103 | */ | 6019 | */ |
| 6104 | static long | 6020 | static long |
| 6105 | readline_internal (lbp, stream) | 6021 | readline_internal (linebuffer *lbp, register FILE *stream) |
| 6106 | linebuffer *lbp; | ||
| 6107 | register FILE *stream; | ||
| 6108 | { | 6022 | { |
| 6109 | char *buffer = lbp->buffer; | 6023 | char *buffer = lbp->buffer; |
| 6110 | register char *p = lbp->buffer; | 6024 | register char *p = lbp->buffer; |
| @@ -6182,9 +6096,7 @@ readline_internal (lbp, stream) | |||
| 6182 | * directives. | 6096 | * directives. |
| 6183 | */ | 6097 | */ |
| 6184 | static void | 6098 | static void |
| 6185 | readline (lbp, stream) | 6099 | readline (linebuffer *lbp, FILE *stream) |
| 6186 | linebuffer *lbp; | ||
| 6187 | FILE *stream; | ||
| 6188 | { | 6100 | { |
| 6189 | long result; | 6101 | long result; |
| 6190 | 6102 | ||
| @@ -6377,8 +6289,7 @@ readline (lbp, stream) | |||
| 6377 | * with xnew where the string CP has been copied. | 6289 | * with xnew where the string CP has been copied. |
| 6378 | */ | 6290 | */ |
| 6379 | static char * | 6291 | static char * |
| 6380 | savestr (cp) | 6292 | savestr (char *cp) |
| 6381 | char *cp; | ||
| 6382 | { | 6293 | { |
| 6383 | return savenstr (cp, strlen (cp)); | 6294 | return savenstr (cp, strlen (cp)); |
| 6384 | } | 6295 | } |
| @@ -6388,9 +6299,7 @@ savestr (cp) | |||
| 6388 | * the string CP has been copied for at most the first LEN characters. | 6299 | * the string CP has been copied for at most the first LEN characters. |
| 6389 | */ | 6300 | */ |
| 6390 | static char * | 6301 | static char * |
| 6391 | savenstr (cp, len) | 6302 | savenstr (char *cp, int len) |
| 6392 | char *cp; | ||
| 6393 | int len; | ||
| 6394 | { | 6303 | { |
| 6395 | register char *dp; | 6304 | register char *dp; |
| 6396 | 6305 | ||
| @@ -6407,9 +6316,7 @@ savenstr (cp, len) | |||
| 6407 | * Identical to POSIX strrchr, included for portability. | 6316 | * Identical to POSIX strrchr, included for portability. |
| 6408 | */ | 6317 | */ |
| 6409 | static char * | 6318 | static char * |
| 6410 | etags_strrchr (sp, c) | 6319 | etags_strrchr (register const char *sp, register int c) |
| 6411 | register const char *sp; | ||
| 6412 | register int c; | ||
| 6413 | { | 6320 | { |
| 6414 | register const char *r; | 6321 | register const char *r; |
| 6415 | 6322 | ||
| @@ -6429,9 +6336,7 @@ etags_strrchr (sp, c) | |||
| 6429 | * Identical to POSIX strchr, included for portability. | 6336 | * Identical to POSIX strchr, included for portability. |
| 6430 | */ | 6337 | */ |
| 6431 | static char * | 6338 | static char * |
| 6432 | etags_strchr (sp, c) | 6339 | etags_strchr (register const char *sp, register int c) |
| 6433 | register const char *sp; | ||
| 6434 | register int c; | ||
| 6435 | { | 6340 | { |
| 6436 | do | 6341 | do |
| 6437 | { | 6342 | { |
| @@ -6447,9 +6352,7 @@ etags_strchr (sp, c) | |||
| 6447 | * Same as BSD's strcasecmp, included for portability. | 6352 | * Same as BSD's strcasecmp, included for portability. |
| 6448 | */ | 6353 | */ |
| 6449 | static int | 6354 | static int |
| 6450 | etags_strcasecmp (s1, s2) | 6355 | etags_strcasecmp (register const char *s1, register const char *s2) |
| 6451 | register const char *s1; | ||
| 6452 | register const char *s2; | ||
| 6453 | { | 6356 | { |
| 6454 | while (*s1 != '\0' | 6357 | while (*s1 != '\0' |
| 6455 | && (ISALPHA (*s1) && ISALPHA (*s2) | 6358 | && (ISALPHA (*s1) && ISALPHA (*s2) |
| @@ -6469,10 +6372,7 @@ etags_strcasecmp (s1, s2) | |||
| 6469 | * Same as BSD's strncasecmp, included for portability. | 6372 | * Same as BSD's strncasecmp, included for portability. |
| 6470 | */ | 6373 | */ |
| 6471 | static int | 6374 | static int |
| 6472 | etags_strncasecmp (s1, s2, n) | 6375 | etags_strncasecmp (register const char *s1, register const char *s2, register int n) |
| 6473 | register const char *s1; | ||
| 6474 | register const char *s2; | ||
| 6475 | register int n; | ||
| 6476 | { | 6376 | { |
| 6477 | while (*s1 != '\0' && n-- > 0 | 6377 | while (*s1 != '\0' && n-- > 0 |
| 6478 | && (ISALPHA (*s1) && ISALPHA (*s2) | 6378 | && (ISALPHA (*s1) && ISALPHA (*s2) |
| @@ -6490,8 +6390,7 @@ etags_strncasecmp (s1, s2, n) | |||
| 6490 | 6390 | ||
| 6491 | /* Skip spaces (end of string is not space), return new pointer. */ | 6391 | /* Skip spaces (end of string is not space), return new pointer. */ |
| 6492 | static char * | 6392 | static char * |
| 6493 | skip_spaces (cp) | 6393 | skip_spaces (char *cp) |
| 6494 | char *cp; | ||
| 6495 | { | 6394 | { |
| 6496 | while (iswhite (*cp)) | 6395 | while (iswhite (*cp)) |
| 6497 | cp++; | 6396 | cp++; |
| @@ -6500,8 +6399,7 @@ skip_spaces (cp) | |||
| 6500 | 6399 | ||
| 6501 | /* Skip non spaces, except end of string, return new pointer. */ | 6400 | /* Skip non spaces, except end of string, return new pointer. */ |
| 6502 | static char * | 6401 | static char * |
| 6503 | skip_non_spaces (cp) | 6402 | skip_non_spaces (char *cp) |
| 6504 | char *cp; | ||
| 6505 | { | 6403 | { |
| 6506 | while (*cp != '\0' && !iswhite (*cp)) | 6404 | while (*cp != '\0' && !iswhite (*cp)) |
| 6507 | cp++; | 6405 | cp++; |
| @@ -6510,23 +6408,21 @@ skip_non_spaces (cp) | |||
| 6510 | 6408 | ||
| 6511 | /* Print error message and exit. */ | 6409 | /* Print error message and exit. */ |
| 6512 | void | 6410 | void |
| 6513 | fatal (s1, s2) | 6411 | fatal (char *s1, char *s2) |
| 6514 | char *s1, *s2; | ||
| 6515 | { | 6412 | { |
| 6516 | error (s1, s2); | 6413 | error (s1, s2); |
| 6517 | exit (EXIT_FAILURE); | 6414 | exit (EXIT_FAILURE); |
| 6518 | } | 6415 | } |
| 6519 | 6416 | ||
| 6520 | static void | 6417 | static void |
| 6521 | pfatal (s1) | 6418 | pfatal (char *s1) |
| 6522 | char *s1; | ||
| 6523 | { | 6419 | { |
| 6524 | perror (s1); | 6420 | perror (s1); |
| 6525 | exit (EXIT_FAILURE); | 6421 | exit (EXIT_FAILURE); |
| 6526 | } | 6422 | } |
| 6527 | 6423 | ||
| 6528 | static void | 6424 | static void |
| 6529 | suggest_asking_for_help () | 6425 | suggest_asking_for_help (void) |
| 6530 | { | 6426 | { |
| 6531 | fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n", | 6427 | fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n", |
| 6532 | progname, NO_LONG_OPTIONS ? "-h" : "--help"); | 6428 | progname, NO_LONG_OPTIONS ? "-h" : "--help"); |
| @@ -6535,8 +6431,7 @@ suggest_asking_for_help () | |||
| 6535 | 6431 | ||
| 6536 | /* Print error message. `s1' is printf control string, `s2' is arg for it. */ | 6432 | /* Print error message. `s1' is printf control string, `s2' is arg for it. */ |
| 6537 | static void | 6433 | static void |
| 6538 | error (s1, s2) | 6434 | error (const char *s1, const char *s2) |
| 6539 | const char *s1, *s2; | ||
| 6540 | { | 6435 | { |
| 6541 | fprintf (stderr, "%s: ", progname); | 6436 | fprintf (stderr, "%s: ", progname); |
| 6542 | fprintf (stderr, s1, s2); | 6437 | fprintf (stderr, s1, s2); |
| @@ -6546,8 +6441,7 @@ error (s1, s2) | |||
| 6546 | /* Return a newly-allocated string whose contents | 6441 | /* Return a newly-allocated string whose contents |
| 6547 | concatenate those of s1, s2, s3. */ | 6442 | concatenate those of s1, s2, s3. */ |
| 6548 | static char * | 6443 | static char * |
| 6549 | concat (s1, s2, s3) | 6444 | concat (char *s1, char *s2, char *s3) |
| 6550 | char *s1, *s2, *s3; | ||
| 6551 | { | 6445 | { |
| 6552 | int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); | 6446 | int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); |
| 6553 | char *result = xnew (len1 + len2 + len3 + 1, char); | 6447 | char *result = xnew (len1 + len2 + len3 + 1, char); |
| @@ -6564,7 +6458,7 @@ concat (s1, s2, s3) | |||
| 6564 | /* Does the same work as the system V getcwd, but does not need to | 6458 | /* Does the same work as the system V getcwd, but does not need to |
| 6565 | guess the buffer size in advance. */ | 6459 | guess the buffer size in advance. */ |
| 6566 | static char * | 6460 | static char * |
| 6567 | etags_getcwd () | 6461 | etags_getcwd (void) |
| 6568 | { | 6462 | { |
| 6569 | #ifdef HAVE_GETCWD | 6463 | #ifdef HAVE_GETCWD |
| 6570 | int bufsize = 200; | 6464 | int bufsize = 200; |
| @@ -6614,8 +6508,7 @@ etags_getcwd () | |||
| 6614 | /* Return a newly allocated string containing the file name of FILE | 6508 | /* Return a newly allocated string containing the file name of FILE |
| 6615 | relative to the absolute directory DIR (which should end with a slash). */ | 6509 | relative to the absolute directory DIR (which should end with a slash). */ |
| 6616 | static char * | 6510 | static char * |
| 6617 | relative_filename (file, dir) | 6511 | relative_filename (char *file, char *dir) |
| 6618 | char *file, *dir; | ||
| 6619 | { | 6512 | { |
| 6620 | char *fp, *dp, *afn, *res; | 6513 | char *fp, *dp, *afn, *res; |
| 6621 | int i; | 6514 | int i; |
| @@ -6654,8 +6547,7 @@ relative_filename (file, dir) | |||
| 6654 | /* Return a newly allocated string containing the absolute file name | 6547 | /* Return a newly allocated string containing the absolute file name |
| 6655 | of FILE given DIR (which should end with a slash). */ | 6548 | of FILE given DIR (which should end with a slash). */ |
| 6656 | static char * | 6549 | static char * |
| 6657 | absolute_filename (file, dir) | 6550 | absolute_filename (char *file, char *dir) |
| 6658 | char *file, *dir; | ||
| 6659 | { | 6551 | { |
| 6660 | char *slashp, *cp, *res; | 6552 | char *slashp, *cp, *res; |
| 6661 | 6553 | ||
| @@ -6728,8 +6620,7 @@ absolute_filename (file, dir) | |||
| 6728 | file name of dir where FILE resides given DIR (which should | 6620 | file name of dir where FILE resides given DIR (which should |
| 6729 | end with a slash). */ | 6621 | end with a slash). */ |
| 6730 | static char * | 6622 | static char * |
| 6731 | absolute_dirname (file, dir) | 6623 | absolute_dirname (char *file, char *dir) |
| 6732 | char *file, *dir; | ||
| 6733 | { | 6624 | { |
| 6734 | char *slashp, *res; | 6625 | char *slashp, *res; |
| 6735 | char save; | 6626 | char save; |
| @@ -6748,8 +6639,7 @@ absolute_dirname (file, dir) | |||
| 6748 | /* Whether the argument string is an absolute file name. The argument | 6639 | /* Whether the argument string is an absolute file name. The argument |
| 6749 | string must have been canonicalized with canonicalize_filename. */ | 6640 | string must have been canonicalized with canonicalize_filename. */ |
| 6750 | static bool | 6641 | static bool |
| 6751 | filename_is_absolute (fn) | 6642 | filename_is_absolute (char *fn) |
| 6752 | char *fn; | ||
| 6753 | { | 6643 | { |
| 6754 | return (fn[0] == '/' | 6644 | return (fn[0] == '/' |
| 6755 | #ifdef DOS_NT | 6645 | #ifdef DOS_NT |
| @@ -6761,8 +6651,7 @@ filename_is_absolute (fn) | |||
| 6761 | /* Upcase DOS drive letter and collapse separators into single slashes. | 6651 | /* Upcase DOS drive letter and collapse separators into single slashes. |
| 6762 | Works in place. */ | 6652 | Works in place. */ |
| 6763 | static void | 6653 | static void |
| 6764 | canonicalize_filename (fn) | 6654 | canonicalize_filename (register char *fn) |
| 6765 | register char *fn; | ||
| 6766 | { | 6655 | { |
| 6767 | register char* cp; | 6656 | register char* cp; |
| 6768 | char sep = '/'; | 6657 | char sep = '/'; |
| @@ -6791,8 +6680,7 @@ canonicalize_filename (fn) | |||
| 6791 | 6680 | ||
| 6792 | /* Initialize a linebuffer for use. */ | 6681 | /* Initialize a linebuffer for use. */ |
| 6793 | static void | 6682 | static void |
| 6794 | linebuffer_init (lbp) | 6683 | linebuffer_init (linebuffer *lbp) |
| 6795 | linebuffer *lbp; | ||
| 6796 | { | 6684 | { |
| 6797 | lbp->size = (DEBUG) ? 3 : 200; | 6685 | lbp->size = (DEBUG) ? 3 : 200; |
| 6798 | lbp->buffer = xnew (lbp->size, char); | 6686 | lbp->buffer = xnew (lbp->size, char); |
| @@ -6802,9 +6690,7 @@ linebuffer_init (lbp) | |||
| 6802 | 6690 | ||
| 6803 | /* Set the minimum size of a string contained in a linebuffer. */ | 6691 | /* Set the minimum size of a string contained in a linebuffer. */ |
| 6804 | static void | 6692 | static void |
| 6805 | linebuffer_setlen (lbp, toksize) | 6693 | linebuffer_setlen (linebuffer *lbp, int toksize) |
| 6806 | linebuffer *lbp; | ||
| 6807 | int toksize; | ||
| 6808 | { | 6694 | { |
| 6809 | while (lbp->size <= toksize) | 6695 | while (lbp->size <= toksize) |
| 6810 | { | 6696 | { |
| @@ -6816,8 +6702,7 @@ linebuffer_setlen (lbp, toksize) | |||
| 6816 | 6702 | ||
| 6817 | /* Like malloc but get fatal error if memory is exhausted. */ | 6703 | /* Like malloc but get fatal error if memory is exhausted. */ |
| 6818 | static PTR | 6704 | static PTR |
| 6819 | xmalloc (size) | 6705 | xmalloc (unsigned int size) |
| 6820 | unsigned int size; | ||
| 6821 | { | 6706 | { |
| 6822 | PTR result = (PTR) malloc (size); | 6707 | PTR result = (PTR) malloc (size); |
| 6823 | if (result == NULL) | 6708 | if (result == NULL) |
| @@ -6826,9 +6711,7 @@ xmalloc (size) | |||
| 6826 | } | 6711 | } |
| 6827 | 6712 | ||
| 6828 | static PTR | 6713 | static PTR |
| 6829 | xrealloc (ptr, size) | 6714 | xrealloc (char *ptr, unsigned int size) |
| 6830 | char *ptr; | ||
| 6831 | unsigned int size; | ||
| 6832 | { | 6715 | { |
| 6833 | PTR result = (PTR) realloc (ptr, size); | 6716 | PTR result = (PTR) realloc (ptr, size); |
| 6834 | if (result == NULL) | 6717 | if (result == NULL) |
diff --git a/lib-src/fakemail.c b/lib-src/fakemail.c index f98fb749476..ec5abb71aeb 100644 --- a/lib-src/fakemail.c +++ b/lib-src/fakemail.c | |||
| @@ -147,8 +147,8 @@ static line_list file_preface; | |||
| 147 | static stream_list the_streams; | 147 | static stream_list the_streams; |
| 148 | static boolean no_problems = true; | 148 | static boolean no_problems = true; |
| 149 | 149 | ||
| 150 | extern FILE *popen (); | 150 | extern FILE *popen (const char *, const char *); |
| 151 | extern int fclose (), pclose (); | 151 | extern int fclose (FILE *), pclose (FILE *); |
| 152 | 152 | ||
| 153 | #ifdef CURRENT_USER | 153 | #ifdef CURRENT_USER |
| 154 | extern struct passwd *getpwuid (); | 154 | extern struct passwd *getpwuid (); |
| @@ -164,8 +164,7 @@ static struct passwd *my_entry; | |||
| 164 | /* Print error message. `s1' is printf control string, `s2' is arg for it. */ | 164 | /* Print error message. `s1' is printf control string, `s2' is arg for it. */ |
| 165 | 165 | ||
| 166 | static void | 166 | static void |
| 167 | error (s1, s2) | 167 | error (char *s1, char *s2) |
| 168 | char *s1, *s2; | ||
| 169 | { | 168 | { |
| 170 | printf ("%s: ", my_name); | 169 | printf ("%s: ", my_name); |
| 171 | printf (s1, s2); | 170 | printf (s1, s2); |
| @@ -176,8 +175,7 @@ error (s1, s2) | |||
| 176 | /* Print error message and exit. */ | 175 | /* Print error message and exit. */ |
| 177 | 176 | ||
| 178 | static void | 177 | static void |
| 179 | fatal (s1) | 178 | fatal (char *s1) |
| 180 | char *s1; | ||
| 181 | { | 179 | { |
| 182 | error ("%s", s1); | 180 | error ("%s", s1); |
| 183 | exit (EXIT_FAILURE); | 181 | exit (EXIT_FAILURE); |
| @@ -186,8 +184,7 @@ fatal (s1) | |||
| 186 | /* Like malloc but get fatal error if memory is exhausted. */ | 184 | /* Like malloc but get fatal error if memory is exhausted. */ |
| 187 | 185 | ||
| 188 | static long * | 186 | static long * |
| 189 | xmalloc (size) | 187 | xmalloc (int size) |
| 190 | int size; | ||
| 191 | { | 188 | { |
| 192 | long *result = (long *) malloc (((unsigned) size)); | 189 | long *result = (long *) malloc (((unsigned) size)); |
| 193 | if (result == ((long *) NULL)) | 190 | if (result == ((long *) NULL)) |
| @@ -196,9 +193,7 @@ xmalloc (size) | |||
| 196 | } | 193 | } |
| 197 | 194 | ||
| 198 | static long * | 195 | static long * |
| 199 | xrealloc (ptr, size) | 196 | xrealloc (long int *ptr, int size) |
| 200 | long *ptr; | ||
| 201 | int size; | ||
| 202 | { | 197 | { |
| 203 | long *result = (long *) realloc (ptr, ((unsigned) size)); | 198 | long *result = (long *) realloc (ptr, ((unsigned) size)); |
| 204 | if (result == ((long *) NULL)) | 199 | if (result == ((long *) NULL)) |
| @@ -209,8 +204,7 @@ xrealloc (ptr, size) | |||
| 209 | /* Initialize a linebuffer for use */ | 204 | /* Initialize a linebuffer for use */ |
| 210 | 205 | ||
| 211 | void | 206 | void |
| 212 | init_linebuffer (linebuffer) | 207 | init_linebuffer (struct linebuffer *linebuffer) |
| 213 | struct linebuffer *linebuffer; | ||
| 214 | { | 208 | { |
| 215 | linebuffer->size = INITIAL_LINE_SIZE; | 209 | linebuffer->size = INITIAL_LINE_SIZE; |
| 216 | linebuffer->buffer = ((char *) xmalloc (INITIAL_LINE_SIZE)); | 210 | linebuffer->buffer = ((char *) xmalloc (INITIAL_LINE_SIZE)); |
| @@ -220,9 +214,7 @@ init_linebuffer (linebuffer) | |||
| 220 | Return the length of the line. */ | 214 | Return the length of the line. */ |
| 221 | 215 | ||
| 222 | long | 216 | long |
| 223 | readline (linebuffer, stream) | 217 | readline (struct linebuffer *linebuffer, FILE *stream) |
| 224 | struct linebuffer *linebuffer; | ||
| 225 | FILE *stream; | ||
| 226 | { | 218 | { |
| 227 | char *buffer = linebuffer->buffer; | 219 | char *buffer = linebuffer->buffer; |
| 228 | char *p = linebuffer->buffer; | 220 | char *p = linebuffer->buffer; |
| @@ -257,9 +249,7 @@ readline (linebuffer, stream) | |||
| 257 | If there is no keyword, return NULL and don't alter *REST. */ | 249 | If there is no keyword, return NULL and don't alter *REST. */ |
| 258 | 250 | ||
| 259 | char * | 251 | char * |
| 260 | get_keyword (field, rest) | 252 | get_keyword (register char *field, char **rest) |
| 261 | register char *field; | ||
| 262 | char **rest; | ||
| 263 | { | 253 | { |
| 264 | static char keyword[KEYWORD_SIZE]; | 254 | static char keyword[KEYWORD_SIZE]; |
| 265 | register char *ptr; | 255 | register char *ptr; |
| @@ -284,8 +274,7 @@ get_keyword (field, rest) | |||
| 284 | /* Nonzero if the string FIELD starts with a colon-terminated keyword. */ | 274 | /* Nonzero if the string FIELD starts with a colon-terminated keyword. */ |
| 285 | 275 | ||
| 286 | boolean | 276 | boolean |
| 287 | has_keyword (field) | 277 | has_keyword (char *field) |
| 288 | char *field; | ||
| 289 | { | 278 | { |
| 290 | char *ignored; | 279 | char *ignored; |
| 291 | return (get_keyword (field, &ignored) != ((char *) NULL)); | 280 | return (get_keyword (field, &ignored) != ((char *) NULL)); |
| @@ -302,9 +291,7 @@ has_keyword (field) | |||
| 302 | the caller has to make it big enough. */ | 291 | the caller has to make it big enough. */ |
| 303 | 292 | ||
| 304 | char * | 293 | char * |
| 305 | add_field (the_list, field, where) | 294 | add_field (line_list the_list, register char *field, register char *where) |
| 306 | line_list the_list; | ||
| 307 | register char *field, *where; | ||
| 308 | { | 295 | { |
| 309 | register char c; | 296 | register char c; |
| 310 | while (true) | 297 | while (true) |
| @@ -360,7 +347,7 @@ add_field (the_list, field, where) | |||
| 360 | } | 347 | } |
| 361 | 348 | ||
| 362 | line_list | 349 | line_list |
| 363 | make_file_preface () | 350 | make_file_preface (void) |
| 364 | { | 351 | { |
| 365 | char *the_string, *temp; | 352 | char *the_string, *temp; |
| 366 | long idiotic_interface; | 353 | long idiotic_interface; |
| @@ -404,9 +391,7 @@ make_file_preface () | |||
| 404 | } | 391 | } |
| 405 | 392 | ||
| 406 | void | 393 | void |
| 407 | write_line_list (the_list, the_stream) | 394 | write_line_list (register line_list the_list, FILE *the_stream) |
| 408 | register line_list the_list; | ||
| 409 | FILE *the_stream; | ||
| 410 | { | 395 | { |
| 411 | for ( ; | 396 | for ( ; |
| 412 | the_list != ((line_list) NULL) ; | 397 | the_list != ((line_list) NULL) ; |
| @@ -419,7 +404,7 @@ write_line_list (the_list, the_stream) | |||
| 419 | } | 404 | } |
| 420 | 405 | ||
| 421 | int | 406 | int |
| 422 | close_the_streams () | 407 | close_the_streams (void) |
| 423 | { | 408 | { |
| 424 | register stream_list rem; | 409 | register stream_list rem; |
| 425 | for (rem = the_streams; | 410 | for (rem = the_streams; |
| @@ -432,9 +417,7 @@ close_the_streams () | |||
| 432 | } | 417 | } |
| 433 | 418 | ||
| 434 | void | 419 | void |
| 435 | add_a_stream (the_stream, closing_action) | 420 | add_a_stream (FILE *the_stream, int (*closing_action) (/* ??? */)) |
| 436 | FILE *the_stream; | ||
| 437 | int (*closing_action)(); | ||
| 438 | { | 421 | { |
| 439 | stream_list old = the_streams; | 422 | stream_list old = the_streams; |
| 440 | the_streams = new_stream (); | 423 | the_streams = new_stream (); |
| @@ -445,8 +428,7 @@ add_a_stream (the_stream, closing_action) | |||
| 445 | } | 428 | } |
| 446 | 429 | ||
| 447 | int | 430 | int |
| 448 | my_fclose (the_file) | 431 | my_fclose (FILE *the_file) |
| 449 | FILE *the_file; | ||
| 450 | { | 432 | { |
| 451 | putc ('\n', the_file); | 433 | putc ('\n', the_file); |
| 452 | fflush (the_file); | 434 | fflush (the_file); |
| @@ -454,8 +436,7 @@ my_fclose (the_file) | |||
| 454 | } | 436 | } |
| 455 | 437 | ||
| 456 | boolean | 438 | boolean |
| 457 | open_a_file (name) | 439 | open_a_file (char *name) |
| 458 | char *name; | ||
| 459 | { | 440 | { |
| 460 | FILE *the_stream = fopen (name, "a"); | 441 | FILE *the_stream = fopen (name, "a"); |
| 461 | if (the_stream != ((FILE *) NULL)) | 442 | if (the_stream != ((FILE *) NULL)) |
| @@ -470,8 +451,7 @@ open_a_file (name) | |||
| 470 | } | 451 | } |
| 471 | 452 | ||
| 472 | void | 453 | void |
| 473 | put_string (s) | 454 | put_string (char *s) |
| 474 | char *s; | ||
| 475 | { | 455 | { |
| 476 | register stream_list rem; | 456 | register stream_list rem; |
| 477 | for (rem = the_streams; | 457 | for (rem = the_streams; |
| @@ -482,8 +462,7 @@ put_string (s) | |||
| 482 | } | 462 | } |
| 483 | 463 | ||
| 484 | void | 464 | void |
| 485 | put_line (string) | 465 | put_line (char *string) |
| 486 | char *string; | ||
| 487 | { | 466 | { |
| 488 | register stream_list rem; | 467 | register stream_list rem; |
| 489 | for (rem = the_streams; | 468 | for (rem = the_streams; |
| @@ -543,9 +522,7 @@ put_line (string) | |||
| 543 | Call open_a_file for each file. */ | 522 | Call open_a_file for each file. */ |
| 544 | 523 | ||
| 545 | void | 524 | void |
| 546 | setup_files (the_list, field) | 525 | setup_files (register line_list the_list, register char *field) |
| 547 | register line_list the_list; | ||
| 548 | register char *field; | ||
| 549 | { | 526 | { |
| 550 | register char *start; | 527 | register char *start; |
| 551 | register char c; | 528 | register char c; |
| @@ -581,8 +558,7 @@ setup_files (the_list, field) | |||
| 581 | The result says how big to make the buffer to pass to parse_header. */ | 558 | The result says how big to make the buffer to pass to parse_header. */ |
| 582 | 559 | ||
| 583 | int | 560 | int |
| 584 | args_size (the_header) | 561 | args_size (header the_header) |
| 585 | header the_header; | ||
| 586 | { | 562 | { |
| 587 | register header old = the_header; | 563 | register header old = the_header; |
| 588 | register line_list rem; | 564 | register line_list rem; |
| @@ -613,9 +589,7 @@ args_size (the_header) | |||
| 613 | Also, if the header has any FCC fields, call setup_files for each one. */ | 589 | Also, if the header has any FCC fields, call setup_files for each one. */ |
| 614 | 590 | ||
| 615 | void | 591 | void |
| 616 | parse_header (the_header, where) | 592 | parse_header (header the_header, register char *where) |
| 617 | header the_header; | ||
| 618 | register char *where; | ||
| 619 | { | 593 | { |
| 620 | register header old = the_header; | 594 | register header old = the_header; |
| 621 | do | 595 | do |
| @@ -647,7 +621,7 @@ parse_header (the_header, where) | |||
| 647 | Continuation lines are grouped in the headers they continue. */ | 621 | Continuation lines are grouped in the headers they continue. */ |
| 648 | 622 | ||
| 649 | header | 623 | header |
| 650 | read_header () | 624 | read_header (void) |
| 651 | { | 625 | { |
| 652 | register header the_header = ((header) NULL); | 626 | register header the_header = ((header) NULL); |
| 653 | register line_list *next_line = ((line_list *) NULL); | 627 | register line_list *next_line = ((line_list *) NULL); |
| @@ -701,8 +675,7 @@ read_header () | |||
| 701 | } | 675 | } |
| 702 | 676 | ||
| 703 | void | 677 | void |
| 704 | write_header (the_header) | 678 | write_header (header the_header) |
| 705 | header the_header; | ||
| 706 | { | 679 | { |
| 707 | register header old = the_header; | 680 | register header old = the_header; |
| 708 | do | 681 | do |
| @@ -719,9 +692,7 @@ write_header (the_header) | |||
| 719 | } | 692 | } |
| 720 | 693 | ||
| 721 | int | 694 | int |
| 722 | main (argc, argv) | 695 | main (int argc, char **argv) |
| 723 | int argc; | ||
| 724 | char **argv; | ||
| 725 | { | 696 | { |
| 726 | char *command_line; | 697 | char *command_line; |
| 727 | header the_header; | 698 | header the_header; |
| @@ -731,7 +702,7 @@ main (argc, argv) | |||
| 731 | register int size; | 702 | register int size; |
| 732 | FILE *the_pipe; | 703 | FILE *the_pipe; |
| 733 | 704 | ||
| 734 | extern char *getenv (); | 705 | extern char *getenv (const char *); |
| 735 | 706 | ||
| 736 | mail_program_name = getenv ("FAKEMAILER"); | 707 | mail_program_name = getenv ("FAKEMAILER"); |
| 737 | if (!(mail_program_name && *mail_program_name)) | 708 | if (!(mail_program_name && *mail_program_name)) |
diff --git a/lib-src/hexl.c b/lib-src/hexl.c index 91fadd81f5a..d730cac6814 100644 --- a/lib-src/hexl.c +++ b/lib-src/hexl.c | |||
| @@ -49,12 +49,10 @@ int base = DEFAULT_BASE, un_flag = FALSE, iso_flag = FALSE, endian = 1; | |||
| 49 | int group_by = DEFAULT_GROUPING; | 49 | int group_by = DEFAULT_GROUPING; |
| 50 | char *progname; | 50 | char *progname; |
| 51 | 51 | ||
| 52 | void usage(); | 52 | void usage(void); |
| 53 | 53 | ||
| 54 | int | 54 | int |
| 55 | main (argc, argv) | 55 | main (int argc, char **argv) |
| 56 | int argc; | ||
| 57 | char *argv[]; | ||
| 58 | { | 56 | { |
| 59 | register long address; | 57 | register long address; |
| 60 | char string[18]; | 58 | char string[18]; |
| @@ -278,7 +276,7 @@ main (argc, argv) | |||
| 278 | } | 276 | } |
| 279 | 277 | ||
| 280 | void | 278 | void |
| 281 | usage () | 279 | usage (void) |
| 282 | { | 280 | { |
| 283 | fprintf (stderr, "usage: %s [-de] [-iso]\n", progname); | 281 | fprintf (stderr, "usage: %s [-de] [-iso]\n", progname); |
| 284 | exit (EXIT_FAILURE); | 282 | exit (EXIT_FAILURE); |
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index 973c7e31f70..b3b6b190e48 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c | |||
| @@ -91,8 +91,7 @@ char *progname; | |||
| 91 | 91 | ||
| 92 | /* VARARGS1 */ | 92 | /* VARARGS1 */ |
| 93 | void | 93 | void |
| 94 | error (s1, s2) | 94 | error (char *s1, char *s2) |
| 95 | char *s1, *s2; | ||
| 96 | { | 95 | { |
| 97 | fprintf (stderr, "%s: ", progname); | 96 | fprintf (stderr, "%s: ", progname); |
| 98 | fprintf (stderr, s1, s2); | 97 | fprintf (stderr, s1, s2); |
| @@ -103,8 +102,7 @@ error (s1, s2) | |||
| 103 | 102 | ||
| 104 | /* VARARGS1 */ | 103 | /* VARARGS1 */ |
| 105 | void | 104 | void |
| 106 | fatal (s1, s2) | 105 | fatal (char *s1, char *s2) |
| 107 | char *s1, *s2; | ||
| 108 | { | 106 | { |
| 109 | error (s1, s2); | 107 | error (s1, s2); |
| 110 | exit (EXIT_FAILURE); | 108 | exit (EXIT_FAILURE); |
| @@ -113,8 +111,7 @@ fatal (s1, s2) | |||
| 113 | /* Like malloc but get fatal error if memory is exhausted. */ | 111 | /* Like malloc but get fatal error if memory is exhausted. */ |
| 114 | 112 | ||
| 115 | void * | 113 | void * |
| 116 | xmalloc (size) | 114 | xmalloc (unsigned int size) |
| 117 | unsigned int size; | ||
| 118 | { | 115 | { |
| 119 | void *result = (void *) malloc (size); | 116 | void *result = (void *) malloc (size); |
| 120 | if (result == NULL) | 117 | if (result == NULL) |
| @@ -123,9 +120,7 @@ xmalloc (size) | |||
| 123 | } | 120 | } |
| 124 | 121 | ||
| 125 | int | 122 | int |
| 126 | main (argc, argv) | 123 | main (int argc, char **argv) |
| 127 | int argc; | ||
| 128 | char **argv; | ||
| 129 | { | 124 | { |
| 130 | int i; | 125 | int i; |
| 131 | int err_count = 0; | 126 | int err_count = 0; |
| @@ -187,8 +182,7 @@ main (argc, argv) | |||
| 187 | 182 | ||
| 188 | /* Add a source file name boundary marker in the output file. */ | 183 | /* Add a source file name boundary marker in the output file. */ |
| 189 | void | 184 | void |
| 190 | put_filename (filename) | 185 | put_filename (char *filename) |
| 191 | char *filename; | ||
| 192 | { | 186 | { |
| 193 | char *tmp; | 187 | char *tmp; |
| 194 | 188 | ||
| @@ -207,8 +201,7 @@ put_filename (filename) | |||
| 207 | /* Return 1 if file is not found, 0 if it is found. */ | 201 | /* Return 1 if file is not found, 0 if it is found. */ |
| 208 | 202 | ||
| 209 | int | 203 | int |
| 210 | scan_file (filename) | 204 | scan_file (char *filename) |
| 211 | char *filename; | ||
| 212 | { | 205 | { |
| 213 | int len = strlen (filename); | 206 | int len = strlen (filename); |
| 214 | 207 | ||
| @@ -251,9 +244,7 @@ struct rcsoc_state | |||
| 251 | spaces are output first. */ | 244 | spaces are output first. */ |
| 252 | 245 | ||
| 253 | static INLINE void | 246 | static INLINE void |
| 254 | put_char (ch, state) | 247 | put_char (int ch, struct rcsoc_state *state) |
| 255 | int ch; | ||
| 256 | struct rcsoc_state *state; | ||
| 257 | { | 248 | { |
| 258 | int out_ch; | 249 | int out_ch; |
| 259 | do | 250 | do |
| @@ -286,9 +277,7 @@ put_char (ch, state) | |||
| 286 | keyword, but were in fact not. */ | 277 | keyword, but were in fact not. */ |
| 287 | 278 | ||
| 288 | static void | 279 | static void |
| 289 | scan_keyword_or_put_char (ch, state) | 280 | scan_keyword_or_put_char (int ch, struct rcsoc_state *state) |
| 290 | int ch; | ||
| 291 | struct rcsoc_state *state; | ||
| 292 | { | 281 | { |
| 293 | if (state->keyword | 282 | if (state->keyword |
| 294 | && *state->cur_keyword_ptr == ch | 283 | && *state->cur_keyword_ptr == ch |
| @@ -359,11 +348,7 @@ scan_keyword_or_put_char (ch, state) | |||
| 359 | true if any were encountered. */ | 348 | true if any were encountered. */ |
| 360 | 349 | ||
| 361 | int | 350 | int |
| 362 | read_c_string_or_comment (infile, printflag, comment, saw_usage) | 351 | read_c_string_or_comment (FILE *infile, int printflag, int comment, int *saw_usage) |
| 363 | FILE *infile; | ||
| 364 | int printflag; | ||
| 365 | int *saw_usage; | ||
| 366 | int comment; | ||
| 367 | { | 352 | { |
| 368 | register int c; | 353 | register int c; |
| 369 | struct rcsoc_state state; | 354 | struct rcsoc_state state; |
| @@ -451,10 +436,7 @@ read_c_string_or_comment (infile, printflag, comment, saw_usage) | |||
| 451 | MINARGS and MAXARGS are the minimum and maximum number of arguments. */ | 436 | MINARGS and MAXARGS are the minimum and maximum number of arguments. */ |
| 452 | 437 | ||
| 453 | void | 438 | void |
| 454 | write_c_args (out, func, buf, minargs, maxargs) | 439 | write_c_args (FILE *out, char *func, char *buf, int minargs, int maxargs) |
| 455 | FILE *out; | ||
| 456 | char *func, *buf; | ||
| 457 | int minargs, maxargs; | ||
| 458 | { | 440 | { |
| 459 | register char *p; | 441 | register char *p; |
| 460 | int in_ident = 0; | 442 | int in_ident = 0; |
| @@ -538,8 +520,7 @@ write_c_args (out, func, buf, minargs, maxargs) | |||
| 538 | Accepts any word starting DEF... so it finds DEFSIMPLE and DEFPRED. */ | 520 | Accepts any word starting DEF... so it finds DEFSIMPLE and DEFPRED. */ |
| 539 | 521 | ||
| 540 | int | 522 | int |
| 541 | scan_c_file (filename, mode) | 523 | scan_c_file (char *filename, char *mode) |
| 542 | char *filename, *mode; | ||
| 543 | { | 524 | { |
| 544 | FILE *infile; | 525 | FILE *infile; |
| 545 | register int c; | 526 | register int c; |
| @@ -815,8 +796,7 @@ scan_c_file (filename, mode) | |||
| 815 | */ | 796 | */ |
| 816 | 797 | ||
| 817 | void | 798 | void |
| 818 | skip_white (infile) | 799 | skip_white (FILE *infile) |
| 819 | FILE *infile; | ||
| 820 | { | 800 | { |
| 821 | char c = ' '; | 801 | char c = ' '; |
| 822 | while (c == ' ' || c == '\t' || c == '\n' || c == '\r') | 802 | while (c == ' ' || c == '\t' || c == '\n' || c == '\r') |
| @@ -825,9 +805,7 @@ skip_white (infile) | |||
| 825 | } | 805 | } |
| 826 | 806 | ||
| 827 | void | 807 | void |
| 828 | read_lisp_symbol (infile, buffer) | 808 | read_lisp_symbol (FILE *infile, char *buffer) |
| 829 | FILE *infile; | ||
| 830 | char *buffer; | ||
| 831 | { | 809 | { |
| 832 | char c; | 810 | char c; |
| 833 | char *fillp = buffer; | 811 | char *fillp = buffer; |
| @@ -855,8 +833,7 @@ read_lisp_symbol (infile, buffer) | |||
| 855 | } | 833 | } |
| 856 | 834 | ||
| 857 | int | 835 | int |
| 858 | scan_lisp_file (filename, mode) | 836 | scan_lisp_file (char *filename, char *mode) |
| 859 | char *filename, *mode; | ||
| 860 | { | 837 | { |
| 861 | FILE *infile; | 838 | FILE *infile; |
| 862 | register int c; | 839 | register int c; |
diff --git a/lib-src/movemail.c b/lib-src/movemail.c index f267418d8bb..733303455b0 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c | |||
| @@ -140,7 +140,7 @@ static char *mail_spool_name (); | |||
| 140 | #endif | 140 | #endif |
| 141 | #endif | 141 | #endif |
| 142 | 142 | ||
| 143 | char *strerror (); | 143 | char *strerror (int); |
| 144 | #ifdef HAVE_INDEX | 144 | #ifdef HAVE_INDEX |
| 145 | extern char *index (const char *, int); | 145 | extern char *index (const char *, int); |
| 146 | #endif | 146 | #endif |
| @@ -148,25 +148,23 @@ extern char *index (const char *, int); | |||
| 148 | extern char *rindex (const char *, int); | 148 | extern char *rindex (const char *, int); |
| 149 | #endif | 149 | #endif |
| 150 | 150 | ||
| 151 | void fatal (); | 151 | void fatal (char *s1, char *s2, char *s3); |
| 152 | void error (); | 152 | void error (char *s1, char *s2, char *s3); |
| 153 | void pfatal_with_name (); | 153 | void pfatal_with_name (char *name); |
| 154 | void pfatal_and_delete (); | 154 | void pfatal_and_delete (char *name); |
| 155 | char *concat (); | 155 | char *concat (char *s1, char *s2, char *s3); |
| 156 | long *xmalloc (); | 156 | long *xmalloc (unsigned int size); |
| 157 | int popmail (); | 157 | int popmail (char *mailbox, char *outfile, int preserve, char *password, int reverse_order); |
| 158 | int pop_retr (); | 158 | int pop_retr (popserver server, int msgno, FILE *arg); |
| 159 | int mbx_write (); | 159 | int mbx_write (char *line, int len, FILE *mbf); |
| 160 | int mbx_delimit_begin (); | 160 | int mbx_delimit_begin (FILE *mbf); |
| 161 | int mbx_delimit_end (); | 161 | int mbx_delimit_end (FILE *mbf); |
| 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 | char *delete_lockname; |
| 165 | 165 | ||
| 166 | int | 166 | int |
| 167 | main (argc, argv) | 167 | main (int argc, char **argv) |
| 168 | int argc; | ||
| 169 | char **argv; | ||
| 170 | { | 168 | { |
| 171 | char *inname, *outname; | 169 | char *inname, *outname; |
| 172 | int indesc, outdesc; | 170 | int indesc, outdesc; |
| @@ -590,8 +588,7 @@ mail_spool_name (inname) | |||
| 590 | /* Print error message and exit. */ | 588 | /* Print error message and exit. */ |
| 591 | 589 | ||
| 592 | void | 590 | void |
| 593 | fatal (s1, s2, s3) | 591 | fatal (char *s1, char *s2, char *s3) |
| 594 | char *s1, *s2, *s3; | ||
| 595 | { | 592 | { |
| 596 | if (delete_lockname) | 593 | if (delete_lockname) |
| 597 | unlink (delete_lockname); | 594 | unlink (delete_lockname); |
| @@ -603,8 +600,7 @@ fatal (s1, s2, s3) | |||
| 603 | are args for it or null. */ | 600 | are args for it or null. */ |
| 604 | 601 | ||
| 605 | void | 602 | void |
| 606 | error (s1, s2, s3) | 603 | error (char *s1, char *s2, char *s3) |
| 607 | char *s1, *s2, *s3; | ||
| 608 | { | 604 | { |
| 609 | fprintf (stderr, "movemail: "); | 605 | fprintf (stderr, "movemail: "); |
| 610 | if (s3) | 606 | if (s3) |
| @@ -617,15 +613,13 @@ error (s1, s2, s3) | |||
| 617 | } | 613 | } |
| 618 | 614 | ||
| 619 | void | 615 | void |
| 620 | pfatal_with_name (name) | 616 | pfatal_with_name (char *name) |
| 621 | char *name; | ||
| 622 | { | 617 | { |
| 623 | fatal ("%s for %s", strerror (errno), name); | 618 | fatal ("%s for %s", strerror (errno), name); |
| 624 | } | 619 | } |
| 625 | 620 | ||
| 626 | void | 621 | void |
| 627 | pfatal_and_delete (name) | 622 | pfatal_and_delete (char *name) |
| 628 | char *name; | ||
| 629 | { | 623 | { |
| 630 | char *s = strerror (errno); | 624 | char *s = strerror (errno); |
| 631 | unlink (name); | 625 | unlink (name); |
| @@ -635,8 +629,7 @@ pfatal_and_delete (name) | |||
| 635 | /* Return a newly-allocated string whose contents concatenate those of s1, s2, s3. */ | 629 | /* Return a newly-allocated string whose contents concatenate those of s1, s2, s3. */ |
| 636 | 630 | ||
| 637 | char * | 631 | char * |
| 638 | concat (s1, s2, s3) | 632 | concat (char *s1, char *s2, char *s3) |
| 639 | char *s1, *s2, *s3; | ||
| 640 | { | 633 | { |
| 641 | int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); | 634 | int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); |
| 642 | char *result = (char *) xmalloc (len1 + len2 + len3 + 1); | 635 | char *result = (char *) xmalloc (len1 + len2 + len3 + 1); |
| @@ -652,8 +645,7 @@ concat (s1, s2, s3) | |||
| 652 | /* Like malloc but get fatal error if memory is exhausted. */ | 645 | /* Like malloc but get fatal error if memory is exhausted. */ |
| 653 | 646 | ||
| 654 | long * | 647 | long * |
| 655 | xmalloc (size) | 648 | xmalloc (unsigned int size) |
| 656 | unsigned size; | ||
| 657 | { | 649 | { |
| 658 | long *result = (long *) malloc (size); | 650 | long *result = (long *) malloc (size); |
| 659 | if (!result) | 651 | if (!result) |
| @@ -703,18 +695,13 @@ char Errmsg[200]; /* POP errors, at least, can exceed | |||
| 703 | */ | 695 | */ |
| 704 | 696 | ||
| 705 | int | 697 | int |
| 706 | popmail (mailbox, outfile, preserve, password, reverse_order) | 698 | popmail (char *mailbox, char *outfile, int preserve, char *password, int reverse_order) |
| 707 | char *mailbox; | ||
| 708 | char *outfile; | ||
| 709 | int preserve; | ||
| 710 | char *password; | ||
| 711 | int reverse_order; | ||
| 712 | { | 699 | { |
| 713 | int nmsgs, nbytes; | 700 | int nmsgs, nbytes; |
| 714 | register int i; | 701 | register int i; |
| 715 | int mbfi; | 702 | int mbfi; |
| 716 | FILE *mbf; | 703 | FILE *mbf; |
| 717 | char *getenv (); | 704 | char *getenv (const char *); |
| 718 | popserver server; | 705 | popserver server; |
| 719 | int start, end, increment; | 706 | int start, end, increment; |
| 720 | char *user, *hostname; | 707 | char *user, *hostname; |
| @@ -834,12 +821,9 @@ popmail (mailbox, outfile, preserve, password, reverse_order) | |||
| 834 | } | 821 | } |
| 835 | 822 | ||
| 836 | int | 823 | int |
| 837 | pop_retr (server, msgno, arg) | 824 | pop_retr (popserver server, int msgno, FILE *arg) |
| 838 | popserver server; | ||
| 839 | int msgno; | ||
| 840 | FILE *arg; | ||
| 841 | { | 825 | { |
| 842 | extern char *strerror (); | 826 | extern char *strerror (int); |
| 843 | char *line; | 827 | char *line; |
| 844 | int ret; | 828 | int ret; |
| 845 | 829 | ||
| @@ -885,10 +869,7 @@ pop_retr (server, msgno, arg) | |||
| 885 | && (a[4] == ' ')) | 869 | && (a[4] == ' ')) |
| 886 | 870 | ||
| 887 | int | 871 | int |
| 888 | mbx_write (line, len, mbf) | 872 | mbx_write (char *line, int len, FILE *mbf) |
| 889 | char *line; | ||
| 890 | int len; | ||
| 891 | FILE *mbf; | ||
| 892 | { | 873 | { |
| 893 | #ifdef MOVEMAIL_QUOTE_POP_FROM_LINES | 874 | #ifdef MOVEMAIL_QUOTE_POP_FROM_LINES |
| 894 | if (IS_FROM_LINE (line)) | 875 | if (IS_FROM_LINE (line)) |
| @@ -912,8 +893,7 @@ mbx_write (line, len, mbf) | |||
| 912 | } | 893 | } |
| 913 | 894 | ||
| 914 | int | 895 | int |
| 915 | mbx_delimit_begin (mbf) | 896 | mbx_delimit_begin (FILE *mbf) |
| 916 | FILE *mbf; | ||
| 917 | { | 897 | { |
| 918 | time_t now; | 898 | time_t now; |
| 919 | struct tm *ltime; | 899 | struct tm *ltime; |
| @@ -930,8 +910,7 @@ mbx_delimit_begin (mbf) | |||
| 930 | } | 910 | } |
| 931 | 911 | ||
| 932 | int | 912 | int |
| 933 | mbx_delimit_end (mbf) | 913 | mbx_delimit_end (FILE *mbf) |
| 934 | FILE *mbf; | ||
| 935 | { | 914 | { |
| 936 | if (putc ('\n', mbf) == EOF) | 915 | if (putc ('\n', mbf) == EOF) |
| 937 | return (NOTOK); | 916 | return (NOTOK); |
diff --git a/lib-src/pop.c b/lib-src/pop.c index 59ec84c627c..bbfdd3fc71f 100644 --- a/lib-src/pop.c +++ b/lib-src/pop.c | |||
| @@ -166,11 +166,7 @@ int pop_debug = 0; | |||
| 166 | * explanation of the error. | 166 | * explanation of the error. |
| 167 | */ | 167 | */ |
| 168 | popserver | 168 | popserver |
| 169 | pop_open (host, username, password, flags) | 169 | pop_open (char *host, char *username, char *password, int flags) |
| 170 | char *host; | ||
| 171 | char *username; | ||
| 172 | char *password; | ||
| 173 | int flags; | ||
| 174 | { | 170 | { |
| 175 | int sock; | 171 | int sock; |
| 176 | popserver server; | 172 | popserver server; |
| @@ -337,10 +333,7 @@ pop_open (host, username, password, flags) | |||
| 337 | * connection impossible. | 333 | * connection impossible. |
| 338 | */ | 334 | */ |
| 339 | int | 335 | int |
| 340 | pop_stat (server, count, size) | 336 | pop_stat (popserver server, int *count, int *size) |
| 341 | popserver server; | ||
| 342 | int *count; | ||
| 343 | int *size; | ||
| 344 | { | 337 | { |
| 345 | char *fromserver; | 338 | char *fromserver; |
| 346 | char *end_ptr; | 339 | char *end_ptr; |
| @@ -413,11 +406,7 @@ pop_stat (server, count, size) | |||
| 413 | * connection impossible. | 406 | * connection impossible. |
| 414 | */ | 407 | */ |
| 415 | int | 408 | int |
| 416 | pop_list (server, message, IDs, sizes) | 409 | pop_list (popserver server, int message, int **IDs, int **sizes) |
| 417 | popserver server; | ||
| 418 | int message; | ||
| 419 | int **IDs; | ||
| 420 | int **sizes; | ||
| 421 | { | 410 | { |
| 422 | int how_many, i; | 411 | int how_many, i; |
| 423 | char *fromserver; | 412 | char *fromserver; |
| @@ -559,11 +548,7 @@ pop_list (server, message, IDs, sizes) | |||
| 559 | * Side effects: May kill connection on error. | 548 | * Side effects: May kill connection on error. |
| 560 | */ | 549 | */ |
| 561 | int | 550 | int |
| 562 | pop_retrieve (server, message, markfrom, msg_buf) | 551 | pop_retrieve (popserver server, int message, int markfrom, char **msg_buf) |
| 563 | popserver server; | ||
| 564 | int message; | ||
| 565 | int markfrom; | ||
| 566 | char **msg_buf; | ||
| 567 | { | 552 | { |
| 568 | int *IDs, *sizes, bufsize, fromcount = 0, cp = 0; | 553 | int *IDs, *sizes, bufsize, fromcount = 0, cp = 0; |
| 569 | char *ptr, *fromserver; | 554 | char *ptr, *fromserver; |
| @@ -637,10 +622,7 @@ pop_retrieve (server, message, markfrom, msg_buf) | |||
| 637 | } | 622 | } |
| 638 | 623 | ||
| 639 | int | 624 | int |
| 640 | pop_retrieve_first (server, message, response) | 625 | pop_retrieve_first (popserver server, int message, char **response) |
| 641 | popserver server; | ||
| 642 | int message; | ||
| 643 | char **response; | ||
| 644 | { | 626 | { |
| 645 | sprintf (pop_error, "RETR %d", message); | 627 | sprintf (pop_error, "RETR %d", message); |
| 646 | return (pop_multi_first (server, pop_error, response)); | 628 | return (pop_multi_first (server, pop_error, response)); |
| @@ -655,25 +637,19 @@ pop_retrieve_first (server, message, response) | |||
| 655 | */ | 637 | */ |
| 656 | 638 | ||
| 657 | int | 639 | int |
| 658 | pop_retrieve_next (server, line) | 640 | pop_retrieve_next (popserver server, char **line) |
| 659 | popserver server; | ||
| 660 | char **line; | ||
| 661 | { | 641 | { |
| 662 | return (pop_multi_next (server, line)); | 642 | return (pop_multi_next (server, line)); |
| 663 | } | 643 | } |
| 664 | 644 | ||
| 665 | int | 645 | int |
| 666 | pop_retrieve_flush (server) | 646 | pop_retrieve_flush (popserver server) |
| 667 | popserver server; | ||
| 668 | { | 647 | { |
| 669 | return (pop_multi_flush (server)); | 648 | return (pop_multi_flush (server)); |
| 670 | } | 649 | } |
| 671 | 650 | ||
| 672 | int | 651 | int |
| 673 | pop_top_first (server, message, lines, response) | 652 | pop_top_first (popserver server, int message, int lines, char **response) |
| 674 | popserver server; | ||
| 675 | int message, lines; | ||
| 676 | char **response; | ||
| 677 | { | 653 | { |
| 678 | sprintf (pop_error, "TOP %d %d", message, lines); | 654 | sprintf (pop_error, "TOP %d %d", message, lines); |
| 679 | return (pop_multi_first (server, pop_error, response)); | 655 | return (pop_multi_first (server, pop_error, response)); |
| @@ -688,25 +664,19 @@ pop_top_first (server, message, lines, response) | |||
| 688 | */ | 664 | */ |
| 689 | 665 | ||
| 690 | int | 666 | int |
| 691 | pop_top_next (server, line) | 667 | pop_top_next (popserver server, char **line) |
| 692 | popserver server; | ||
| 693 | char **line; | ||
| 694 | { | 668 | { |
| 695 | return (pop_multi_next (server, line)); | 669 | return (pop_multi_next (server, line)); |
| 696 | } | 670 | } |
| 697 | 671 | ||
| 698 | int | 672 | int |
| 699 | pop_top_flush (server) | 673 | pop_top_flush (popserver server) |
| 700 | popserver server; | ||
| 701 | { | 674 | { |
| 702 | return (pop_multi_flush (server)); | 675 | return (pop_multi_flush (server)); |
| 703 | } | 676 | } |
| 704 | 677 | ||
| 705 | int | 678 | int |
| 706 | pop_multi_first (server, command, response) | 679 | pop_multi_first (popserver server, char *command, char **response) |
| 707 | popserver server; | ||
| 708 | char *command; | ||
| 709 | char **response; | ||
| 710 | { | 680 | { |
| 711 | if (server->in_multi) | 681 | if (server->in_multi) |
| 712 | { | 682 | { |
| @@ -749,9 +719,7 @@ pop_multi_first (server, command, response) | |||
| 749 | 0, LINE is set to null. */ | 719 | 0, LINE is set to null. */ |
| 750 | 720 | ||
| 751 | int | 721 | int |
| 752 | pop_multi_next (server, line) | 722 | pop_multi_next (popserver server, char **line) |
| 753 | popserver server; | ||
| 754 | char **line; | ||
| 755 | { | 723 | { |
| 756 | char *fromserver; | 724 | char *fromserver; |
| 757 | int ret; | 725 | int ret; |
| @@ -789,8 +757,7 @@ pop_multi_next (server, line) | |||
| 789 | } | 757 | } |
| 790 | 758 | ||
| 791 | int | 759 | int |
| 792 | pop_multi_flush (server) | 760 | pop_multi_flush (popserver server) |
| 793 | popserver server; | ||
| 794 | { | 761 | { |
| 795 | char *line; | 762 | char *line; |
| 796 | int ret; | 763 | int ret; |
| @@ -821,9 +788,7 @@ pop_multi_flush (server) | |||
| 821 | * otherwise. | 788 | * otherwise. |
| 822 | */ | 789 | */ |
| 823 | int | 790 | int |
| 824 | pop_delete (server, message) | 791 | pop_delete (popserver server, int message) |
| 825 | popserver server; | ||
| 826 | int message; | ||
| 827 | { | 792 | { |
| 828 | if (server->in_multi) | 793 | if (server->in_multi) |
| 829 | { | 794 | { |
| @@ -853,8 +818,7 @@ pop_delete (server, message) | |||
| 853 | * Side effects: Closes connection on error. | 818 | * Side effects: Closes connection on error. |
| 854 | */ | 819 | */ |
| 855 | int | 820 | int |
| 856 | pop_noop (server) | 821 | pop_noop (popserver server) |
| 857 | popserver server; | ||
| 858 | { | 822 | { |
| 859 | if (server->in_multi) | 823 | if (server->in_multi) |
| 860 | { | 824 | { |
| @@ -883,8 +847,7 @@ pop_noop (server) | |||
| 883 | * Side effects: Closes the connection on error. | 847 | * Side effects: Closes the connection on error. |
| 884 | */ | 848 | */ |
| 885 | int | 849 | int |
| 886 | pop_last (server) | 850 | pop_last (popserver server) |
| 887 | popserver server; | ||
| 888 | { | 851 | { |
| 889 | char *fromserver; | 852 | char *fromserver; |
| 890 | 853 | ||
| @@ -941,8 +904,7 @@ pop_last (server) | |||
| 941 | * Side effects: Closes the connection on error. | 904 | * Side effects: Closes the connection on error. |
| 942 | */ | 905 | */ |
| 943 | int | 906 | int |
| 944 | pop_reset (server) | 907 | pop_reset (popserver server) |
| 945 | popserver server; | ||
| 946 | { | 908 | { |
| 947 | if (pop_retrieve_flush (server)) | 909 | if (pop_retrieve_flush (server)) |
| 948 | { | 910 | { |
| @@ -970,8 +932,7 @@ pop_reset (server) | |||
| 970 | * function is called, even if an error occurs. | 932 | * function is called, even if an error occurs. |
| 971 | */ | 933 | */ |
| 972 | int | 934 | int |
| 973 | pop_quit (server) | 935 | pop_quit (popserver server) |
| 974 | popserver server; | ||
| 975 | { | 936 | { |
| 976 | int ret = 0; | 937 | int ret = 0; |
| 977 | 938 | ||
| @@ -1015,9 +976,7 @@ static int have_winsock = 0; | |||
| 1015 | * into pop_error. | 976 | * into pop_error. |
| 1016 | */ | 977 | */ |
| 1017 | static int | 978 | static int |
| 1018 | socket_connection (host, flags) | 979 | socket_connection (char *host, int flags) |
| 1019 | char *host; | ||
| 1020 | int flags; | ||
| 1021 | { | 980 | { |
| 1022 | #ifdef HAVE_GETADDRINFO | 981 | #ifdef HAVE_GETADDRINFO |
| 1023 | struct addrinfo *res, *it; | 982 | struct addrinfo *res, *it; |
| @@ -1327,9 +1286,7 @@ socket_connection (host, flags) | |||
| 1327 | * THE RETURNED LINE MAY CONTAIN EMBEDDED NULLS! | 1286 | * THE RETURNED LINE MAY CONTAIN EMBEDDED NULLS! |
| 1328 | */ | 1287 | */ |
| 1329 | static int | 1288 | static int |
| 1330 | pop_getline (server, line) | 1289 | pop_getline (popserver server, char **line) |
| 1331 | popserver server; | ||
| 1332 | char **line; | ||
| 1333 | { | 1290 | { |
| 1334 | #define GETLINE_ERROR "Error reading from server: " | 1291 | #define GETLINE_ERROR "Error reading from server: " |
| 1335 | 1292 | ||
| @@ -1459,9 +1416,7 @@ pop_getline (server, line) | |||
| 1459 | * Side effects: Closes the connection on error. | 1416 | * Side effects: Closes the connection on error. |
| 1460 | */ | 1417 | */ |
| 1461 | static int | 1418 | static int |
| 1462 | sendline (server, line) | 1419 | sendline (popserver server, char *line) |
| 1463 | popserver server; | ||
| 1464 | char *line; | ||
| 1465 | { | 1420 | { |
| 1466 | #define SENDLINE_ERROR "Error writing to POP server: " | 1421 | #define SENDLINE_ERROR "Error writing to POP server: " |
| 1467 | int ret; | 1422 | int ret; |
| @@ -1508,10 +1463,7 @@ sendline (server, line) | |||
| 1508 | * Return value: Same as write. Pop_error is not set. | 1463 | * Return value: Same as write. Pop_error is not set. |
| 1509 | */ | 1464 | */ |
| 1510 | static int | 1465 | static int |
| 1511 | fullwrite (fd, buf, nbytes) | 1466 | fullwrite (int fd, char *buf, int nbytes) |
| 1512 | int fd; | ||
| 1513 | char *buf; | ||
| 1514 | int nbytes; | ||
| 1515 | { | 1467 | { |
| 1516 | char *cp; | 1468 | char *cp; |
| 1517 | int ret = 0; | 1469 | int ret = 0; |
| @@ -1541,8 +1493,7 @@ fullwrite (fd, buf, nbytes) | |||
| 1541 | * Side effects: On failure, may make the connection unusable. | 1493 | * Side effects: On failure, may make the connection unusable. |
| 1542 | */ | 1494 | */ |
| 1543 | static int | 1495 | static int |
| 1544 | getok (server) | 1496 | getok (popserver server) |
| 1545 | popserver server; | ||
| 1546 | { | 1497 | { |
| 1547 | char *fromline; | 1498 | char *fromline; |
| 1548 | 1499 | ||
| @@ -1613,8 +1564,7 @@ gettermination (server) | |||
| 1613 | * since the last pop_reset) may be lost. | 1564 | * since the last pop_reset) may be lost. |
| 1614 | */ | 1565 | */ |
| 1615 | void | 1566 | void |
| 1616 | pop_close (server) | 1567 | pop_close (popserver server) |
| 1617 | popserver server; | ||
| 1618 | { | 1568 | { |
| 1619 | pop_trash (server); | 1569 | pop_trash (server); |
| 1620 | free ((char *) server); | 1570 | free ((char *) server); |
| @@ -1630,8 +1580,7 @@ pop_close (server) | |||
| 1630 | * pop_close or pop_quit after this function has been called. | 1580 | * pop_close or pop_quit after this function has been called. |
| 1631 | */ | 1581 | */ |
| 1632 | static void | 1582 | static void |
| 1633 | pop_trash (server) | 1583 | pop_trash (popserver server) |
| 1634 | popserver server; | ||
| 1635 | { | 1584 | { |
| 1636 | if (server->file >= 0) | 1585 | if (server->file >= 0) |
| 1637 | { | 1586 | { |
| @@ -1663,9 +1612,7 @@ pop_trash (server) | |||
| 1663 | null, or 0 if it does not contain one. */ | 1612 | null, or 0 if it does not contain one. */ |
| 1664 | 1613 | ||
| 1665 | static char * | 1614 | static char * |
| 1666 | find_crlf (in_string, len) | 1615 | find_crlf (char *in_string, int len) |
| 1667 | char *in_string; | ||
| 1668 | int len; | ||
| 1669 | { | 1616 | { |
| 1670 | while (len--) | 1617 | while (len--) |
| 1671 | { | 1618 | { |
diff --git a/lib-src/profile.c b/lib-src/profile.c index 0347350a799..37653e63c49 100644 --- a/lib-src/profile.c +++ b/lib-src/profile.c | |||
| @@ -40,7 +40,7 @@ static char time_string[30]; | |||
| 40 | /* Reset the stopwatch to zero. */ | 40 | /* Reset the stopwatch to zero. */ |
| 41 | 41 | ||
| 42 | void | 42 | void |
| 43 | reset_watch () | 43 | reset_watch (void) |
| 44 | { | 44 | { |
| 45 | EMACS_GET_TIME (TV1); | 45 | EMACS_GET_TIME (TV1); |
| 46 | watch_not_started = 0; | 46 | watch_not_started = 0; |
| @@ -51,7 +51,7 @@ reset_watch () | |||
| 51 | If reset_watch was not called yet, exit. */ | 51 | If reset_watch was not called yet, exit. */ |
| 52 | 52 | ||
| 53 | char * | 53 | char * |
| 54 | get_time () | 54 | get_time (void) |
| 55 | { | 55 | { |
| 56 | if (watch_not_started) | 56 | if (watch_not_started) |
| 57 | exit (EXIT_FAILURE); /* call reset_watch first ! */ | 57 | exit (EXIT_FAILURE); /* call reset_watch first ! */ |
| @@ -79,7 +79,7 @@ gettimeofday (tp, tzp) | |||
| 79 | #endif | 79 | #endif |
| 80 | 80 | ||
| 81 | int | 81 | int |
| 82 | main () | 82 | main (void) |
| 83 | { | 83 | { |
| 84 | int c; | 84 | int c; |
| 85 | while ((c = getchar ()) != EOF) | 85 | while ((c = getchar ()) != EOF) |
diff --git a/lib-src/sorted-doc.c b/lib-src/sorted-doc.c index ce58529193a..828e8db9a0b 100644 --- a/lib-src/sorted-doc.c +++ b/lib-src/sorted-doc.c | |||
| @@ -65,8 +65,7 @@ struct docstr /* Allocated thing for an entry. */ | |||
| 65 | /* Print error message. `s1' is printf control string, `s2' is arg for it. */ | 65 | /* Print error message. `s1' is printf control string, `s2' is arg for it. */ |
| 66 | 66 | ||
| 67 | void | 67 | void |
| 68 | error (s1, s2) | 68 | error (char *s1, char *s2) |
| 69 | char *s1, *s2; | ||
| 70 | { | 69 | { |
| 71 | fprintf (stderr, "sorted-doc: "); | 70 | fprintf (stderr, "sorted-doc: "); |
| 72 | fprintf (stderr, s1, s2); | 71 | fprintf (stderr, s1, s2); |
| @@ -76,8 +75,7 @@ error (s1, s2) | |||
| 76 | /* Print error message and exit. */ | 75 | /* Print error message and exit. */ |
| 77 | 76 | ||
| 78 | void | 77 | void |
| 79 | fatal (s1, s2) | 78 | fatal (char *s1, char *s2) |
| 80 | char *s1, *s2; | ||
| 81 | { | 79 | { |
| 82 | error (s1, s2); | 80 | error (s1, s2); |
| 83 | exit (EXIT_FAILURE); | 81 | exit (EXIT_FAILURE); |
| @@ -86,8 +84,7 @@ fatal (s1, s2) | |||
| 86 | /* Like malloc but get fatal error if memory is exhausted. */ | 84 | /* Like malloc but get fatal error if memory is exhausted. */ |
| 87 | 85 | ||
| 88 | char * | 86 | char * |
| 89 | xmalloc (size) | 87 | xmalloc (int size) |
| 90 | int size; | ||
| 91 | { | 88 | { |
| 92 | char *result = malloc ((unsigned)size); | 89 | char *result = malloc ((unsigned)size); |
| 93 | if (result == NULL) | 90 | if (result == NULL) |
| @@ -96,8 +93,7 @@ xmalloc (size) | |||
| 96 | } | 93 | } |
| 97 | 94 | ||
| 98 | char * | 95 | char * |
| 99 | xstrdup (str) | 96 | xstrdup (char *str) |
| 100 | char * str; | ||
| 101 | { | 97 | { |
| 102 | char *buf = xmalloc (strlen (str) + 1); | 98 | char *buf = xmalloc (strlen (str) + 1); |
| 103 | (void) strcpy (buf, str); | 99 | (void) strcpy (buf, str); |
| @@ -107,9 +103,7 @@ xstrdup (str) | |||
| 107 | /* Comparison function for qsort to call. */ | 103 | /* Comparison function for qsort to call. */ |
| 108 | 104 | ||
| 109 | int | 105 | int |
| 110 | cmpdoc (a, b) | 106 | cmpdoc (DOCSTR **a, DOCSTR **b) |
| 111 | DOCSTR **a; | ||
| 112 | DOCSTR **b; | ||
| 113 | { | 107 | { |
| 114 | register int val = strcmp ((*a)->name, (*b)->name); | 108 | register int val = strcmp ((*a)->name, (*b)->name); |
| 115 | if (val) return val; | 109 | if (val) return val; |
| @@ -128,7 +122,7 @@ char *states[] = | |||
| 128 | }; | 122 | }; |
| 129 | 123 | ||
| 130 | int | 124 | int |
| 131 | main () | 125 | main (void) |
| 132 | { | 126 | { |
| 133 | register DOCSTR *dp = NULL; /* allocated DOCSTR */ | 127 | register DOCSTR *dp = NULL; /* allocated DOCSTR */ |
| 134 | register LINE *lp = NULL; /* allocated line */ | 128 | register LINE *lp = NULL; /* allocated line */ |
diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c index e023001aebe..ba619450198 100644 --- a/lib-src/update-game-score.c +++ b/lib-src/update-game-score.c | |||
| @@ -77,8 +77,7 @@ extern int optind, opterr; | |||
| 77 | #endif | 77 | #endif |
| 78 | 78 | ||
| 79 | int | 79 | int |
| 80 | usage (err) | 80 | usage (int err) |
| 81 | int err; | ||
| 82 | { | 81 | { |
| 83 | fprintf (stdout, "Usage: update-game-score [-m MAX ] [ -r ] game/scorefile SCORE DATA\n"); | 82 | fprintf (stdout, "Usage: update-game-score [-m MAX ] [ -r ] game/scorefile SCORE DATA\n"); |
| 84 | fprintf (stdout, " update-game-score -h\n"); | 83 | fprintf (stdout, " update-game-score -h\n"); |
| @@ -110,8 +109,7 @@ int write_scores (const char *filename, const struct score_entry *scores, | |||
| 110 | void lose (const char *msg) NO_RETURN; | 109 | void lose (const char *msg) NO_RETURN; |
| 111 | 110 | ||
| 112 | void | 111 | void |
| 113 | lose (msg) | 112 | lose (const char *msg) |
| 114 | const char *msg; | ||
| 115 | { | 113 | { |
| 116 | fprintf (stderr, "%s\n", msg); | 114 | fprintf (stderr, "%s\n", msg); |
| 117 | exit (EXIT_FAILURE); | 115 | exit (EXIT_FAILURE); |
| @@ -137,8 +135,7 @@ strerror (errnum) | |||
| 137 | #endif /* ! HAVE_STRERROR */ | 135 | #endif /* ! HAVE_STRERROR */ |
| 138 | 136 | ||
| 139 | void | 137 | void |
| 140 | lose_syserr (msg) | 138 | lose_syserr (const char *msg) |
| 141 | const char *msg; | ||
| 142 | { | 139 | { |
| 143 | fprintf (stderr, "%s: %s\n", msg, strerror (errno)); | 140 | fprintf (stderr, "%s: %s\n", msg, strerror (errno)); |
| 144 | exit (EXIT_FAILURE); | 141 | exit (EXIT_FAILURE); |
| @@ -166,9 +163,7 @@ get_user_id (void) | |||
| 166 | } | 163 | } |
| 167 | 164 | ||
| 168 | char * | 165 | char * |
| 169 | get_prefix (running_suid, user_prefix) | 166 | get_prefix (int running_suid, char *user_prefix) |
| 170 | int running_suid; | ||
| 171 | char *user_prefix; | ||
| 172 | { | 167 | { |
| 173 | if (!running_suid && user_prefix == NULL) | 168 | if (!running_suid && user_prefix == NULL) |
| 174 | lose ("Not using a shared game directory, and no prefix given."); | 169 | lose ("Not using a shared game directory, and no prefix given."); |
| @@ -184,9 +179,7 @@ get_prefix (running_suid, user_prefix) | |||
| 184 | } | 179 | } |
| 185 | 180 | ||
| 186 | int | 181 | int |
| 187 | main (argc, argv) | 182 | main (int argc, char **argv) |
| 188 | int argc; | ||
| 189 | char **argv; | ||
| 190 | { | 183 | { |
| 191 | int c, running_suid; | 184 | int c, running_suid; |
| 192 | void *lockstate; | 185 | void *lockstate; |
| @@ -273,9 +266,7 @@ main (argc, argv) | |||
| 273 | } | 266 | } |
| 274 | 267 | ||
| 275 | int | 268 | int |
| 276 | read_score (f, score) | 269 | read_score (FILE *f, struct score_entry *score) |
| 277 | FILE *f; | ||
| 278 | struct score_entry *score; | ||
| 279 | { | 270 | { |
| 280 | int c; | 271 | int c; |
| 281 | if (feof (f)) | 272 | if (feof (f)) |
| @@ -359,10 +350,7 @@ read_score (f, score) | |||
| 359 | } | 350 | } |
| 360 | 351 | ||
| 361 | int | 352 | int |
| 362 | read_scores (filename, scores, count) | 353 | read_scores (const char *filename, struct score_entry **scores, int *count) |
| 363 | const char *filename; | ||
| 364 | struct score_entry **scores; | ||
| 365 | int *count; | ||
| 366 | { | 354 | { |
| 367 | int readval, scorecount, cursize; | 355 | int readval, scorecount, cursize; |
| 368 | struct score_entry *ret; | 356 | struct score_entry *ret; |
| @@ -395,9 +383,7 @@ read_scores (filename, scores, count) | |||
| 395 | } | 383 | } |
| 396 | 384 | ||
| 397 | int | 385 | int |
| 398 | score_compare (a, b) | 386 | score_compare (const void *a, const void *b) |
| 399 | const void *a; | ||
| 400 | const void *b; | ||
| 401 | { | 387 | { |
| 402 | const struct score_entry *sa = (const struct score_entry *) a; | 388 | const struct score_entry *sa = (const struct score_entry *) a; |
| 403 | const struct score_entry *sb = (const struct score_entry *) b; | 389 | const struct score_entry *sb = (const struct score_entry *) b; |
| @@ -405,9 +391,7 @@ score_compare (a, b) | |||
| 405 | } | 391 | } |
| 406 | 392 | ||
| 407 | int | 393 | int |
| 408 | score_compare_reverse (a, b) | 394 | score_compare_reverse (const void *a, const void *b) |
| 409 | const void *a; | ||
| 410 | const void *b; | ||
| 411 | { | 395 | { |
| 412 | const struct score_entry *sa = (const struct score_entry *) a; | 396 | const struct score_entry *sa = (const struct score_entry *) a; |
| 413 | const struct score_entry *sb = (const struct score_entry *) b; | 397 | const struct score_entry *sb = (const struct score_entry *) b; |
| @@ -415,11 +399,7 @@ score_compare_reverse (a, b) | |||
| 415 | } | 399 | } |
| 416 | 400 | ||
| 417 | int | 401 | int |
| 418 | push_score (scores, count, newscore, username, newdata) | 402 | push_score (struct score_entry **scores, int *count, int newscore, char *username, char *newdata) |
| 419 | struct score_entry **scores; | ||
| 420 | int *count; int newscore; | ||
| 421 | char *username; | ||
| 422 | char *newdata; | ||
| 423 | { | 403 | { |
| 424 | struct score_entry *newscores | 404 | struct score_entry *newscores |
| 425 | = (struct score_entry *) realloc (*scores, | 405 | = (struct score_entry *) realloc (*scores, |
| @@ -435,20 +415,14 @@ push_score (scores, count, newscore, username, newdata) | |||
| 435 | } | 415 | } |
| 436 | 416 | ||
| 437 | void | 417 | void |
| 438 | sort_scores (scores, count, reverse) | 418 | sort_scores (struct score_entry *scores, int count, int reverse) |
| 439 | struct score_entry *scores; | ||
| 440 | int count; | ||
| 441 | int reverse; | ||
| 442 | { | 419 | { |
| 443 | qsort (scores, count, sizeof (struct score_entry), | 420 | qsort (scores, count, sizeof (struct score_entry), |
| 444 | reverse ? score_compare_reverse : score_compare); | 421 | reverse ? score_compare_reverse : score_compare); |
| 445 | } | 422 | } |
| 446 | 423 | ||
| 447 | int | 424 | int |
| 448 | write_scores (filename, scores, count) | 425 | write_scores (const char *filename, const struct score_entry *scores, int count) |
| 449 | const char *filename; | ||
| 450 | const struct score_entry * scores; | ||
| 451 | int count; | ||
| 452 | { | 426 | { |
| 453 | FILE *f; | 427 | FILE *f; |
| 454 | int i; | 428 | int i; |
| @@ -477,9 +451,7 @@ write_scores (filename, scores, count) | |||
| 477 | } | 451 | } |
| 478 | 452 | ||
| 479 | int | 453 | int |
| 480 | lock_file (filename, state) | 454 | lock_file (const char *filename, void **state) |
| 481 | const char *filename; | ||
| 482 | void **state; | ||
| 483 | { | 455 | { |
| 484 | int fd; | 456 | int fd; |
| 485 | struct stat buf; | 457 | struct stat buf; |
| @@ -520,9 +492,7 @@ lock_file (filename, state) | |||
| 520 | } | 492 | } |
| 521 | 493 | ||
| 522 | int | 494 | int |
| 523 | unlock_file (filename, state) | 495 | unlock_file (const char *filename, void *state) |
| 524 | const char *filename; | ||
| 525 | void *state; | ||
| 526 | { | 496 | { |
| 527 | char *lockpath = (char *) state; | 497 | char *lockpath = (char *) state; |
| 528 | int ret = unlink (lockpath); | 498 | int ret = unlink (lockpath); |