From 5bcf1990f4d5d2498d15ce7006a2aff6bdfa7081 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Thu, 18 Jun 2009 10:03:38 +0000 Subject: enable compiler warnings git-svn-id: svn://tug.org/texlive/trunk@13810 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/otps/ChangeLog | 11 ++- Build/source/texk/web2c/otps/Makefile.am | 1 + Build/source/texk/web2c/otps/Makefile.in | 1 + Build/source/texk/web2c/otps/otp-lexer.c | 66 ++++++------- Build/source/texk/web2c/otps/otp-lexer.l | 6 -- Build/source/texk/web2c/otps/otp-parser.c | 155 +++++++++++++++--------------- Build/source/texk/web2c/otps/otp-parser.y | 3 +- Build/source/texk/web2c/otps/otp2ocp.c | 16 +-- Build/source/texk/web2c/otps/outocp.c | 16 +-- Build/source/texk/web2c/otps/routines.c | 68 ++++++------- Build/source/texk/web2c/otps/routines.h | 80 +++++++-------- 11 files changed, 211 insertions(+), 212 deletions(-) (limited to 'Build/source/texk/web2c') diff --git a/Build/source/texk/web2c/otps/ChangeLog b/Build/source/texk/web2c/otps/ChangeLog index 249d89de62b..f7cfc750a25 100644 --- a/Build/source/texk/web2c/otps/ChangeLog +++ b/Build/source/texk/web2c/otps/ChangeLog @@ -1,7 +1,14 @@ +2009-06-17 Peter Breitenlohner + + * Makefile.am (AM_CFLAGS): enable compiler warnings. + * Use ANSI C prototypes for functions. + * otp-parser.y (yyerror): declare as static. + * otp2ocp.c (output, otp_read): declare as static. + * outocp.c (ctp_get, ctp_read, ctp_explain): declare as static. + 2009-06-16 Peter Breitenlohner - * otp-lexer.l (yywrap): define as static function. - * Makefile.am: no more need for $(LEXLIB). + * Makefile.am: otp2ocp.c provides yywrap, no need for $(LEXLIB). 2008-01-29 Peter Breitenlohner diff --git a/Build/source/texk/web2c/otps/Makefile.am b/Build/source/texk/web2c/otps/Makefile.am index 9629e5b1c22..4fbb75903e2 100644 --- a/Build/source/texk/web2c/otps/Makefile.am +++ b/Build/source/texk/web2c/otps/Makefile.am @@ -4,6 +4,7 @@ ## You may freely use, modify and/or distribute this file. ## INCLUDES = -I$(top_builddir)/.. -I$(top_srcdir) $(KPATHSEA_INCLUDES) +AM_CFLAGS = $(WARNING_CFLAGS) AM_YFLAGS = -d -v proglib = ../lib/lib.a diff --git a/Build/source/texk/web2c/otps/Makefile.in b/Build/source/texk/web2c/otps/Makefile.in index bd85265fe66..4fd7a95e43c 100644 --- a/Build/source/texk/web2c/otps/Makefile.in +++ b/Build/source/texk/web2c/otps/Makefile.in @@ -317,6 +317,7 @@ wlibs = @wlibs@ x_ext_lib = @x_ext_lib@ x_tool_libs = @x_tool_libs@ INCLUDES = -I$(top_builddir)/.. -I$(top_srcdir) $(KPATHSEA_INCLUDES) +AM_CFLAGS = $(WARNING_CFLAGS) AM_YFLAGS = -d -v proglib = ../lib/lib.a otps_programs = otp2ocp outocp diff --git a/Build/source/texk/web2c/otps/otp-lexer.c b/Build/source/texk/web2c/otps/otp-lexer.c index fbef4e283b8..0bbc4df5337 100644 --- a/Build/source/texk/web2c/otps/otp-lexer.c +++ b/Build/source/texk/web2c/otps/otp-lexer.c @@ -607,13 +607,7 @@ along with Omega; if not, write to the Free Software Foundation, Inc., int line_number = 1; int i,j,last; extern YYSTYPE yylval; - -static int -yywrap (void) -{ - return 1; -} -#line 617 "otp-lexer.c" +#line 611 "otp-lexer.c" #define INITIAL 0 @@ -795,9 +789,9 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 50 "otp-lexer.l" +#line 44 "otp-lexer.l" -#line 801 "otp-lexer.c" +#line 795 "otp-lexer.c" if ( !(yy_init) ) { @@ -901,24 +895,24 @@ do_action: /* This label is used only to access EOF actions. */ { /* beginning of action switch */ case 1: YY_RULE_SETUP -#line 51 "otp-lexer.l" +#line 45 "otp-lexer.l" {} YY_BREAK case 2: /* rule 2 can match eol */ YY_RULE_SETUP -#line 52 "otp-lexer.l" +#line 46 "otp-lexer.l" { line_number++;} YY_BREAK case 3: /* rule 3 can match eol */ YY_RULE_SETUP -#line 53 "otp-lexer.l" +#line 47 "otp-lexer.l" { line_number++;} YY_BREAK case 4: YY_RULE_SETUP -#line 54 "otp-lexer.l" +#line 48 "otp-lexer.l" { yylval.yint=0; for (i=2; i $$ =", yyr1[yyn], &yyval, &yyloc); @@ -2182,6 +2183,6 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 330 "otp-parser.y" +#line 331 "otp-parser.y" diff --git a/Build/source/texk/web2c/otps/otp-parser.y b/Build/source/texk/web2c/otps/otp-parser.y index a67c6a1c06d..7870a3269a2 100644 --- a/Build/source/texk/web2c/otps/otp-parser.y +++ b/Build/source/texk/web2c/otps/otp-parser.y @@ -28,7 +28,8 @@ along with Omega; if not, write to the Free Software Foundation, Inc., #include "yystype.h" int k, len; -void yyerror(char * msg) +static void +yyerror(char * msg) { fprintf(stderr, "line %d: %s\n", line_number, msg); } diff --git a/Build/source/texk/web2c/otps/otp2ocp.c b/Build/source/texk/web2c/otps/otp2ocp.c index d9b7ef10ab4..4037fc21e9e 100644 --- a/Build/source/texk/web2c/otps/otp2ocp.c +++ b/Build/source/texk/web2c/otps/otp2ocp.c @@ -32,14 +32,14 @@ along with Omega; if not, write to the Free Software Foundation, Inc., #include "routines.h" extern FILE *yyin; -int yywrap -P1H (void) +int +yywrap(void) { return 1; } -void output -P2C (FILE *, output_file, int, i) +static void +output(FILE *output_file, int i) { /* make sure output is in big-endian form */ char j; @@ -57,8 +57,8 @@ P2C (FILE *, output_file, int, i) fwrite (&j, 1, 1, output_file); } -void otp_read -P2C (string, input_name, string, output_name) +static void +otp_read(string input_name, string output_name) { int i, j, len, no_words; int *table, *instrs; @@ -118,8 +118,8 @@ P2C (string, input_name, string, output_name) } } -int main -P2C (int, argc, string *, argv) +int +main(int argc, string *argv) { string input_name, full_input_name; string output_name; diff --git a/Build/source/texk/web2c/otps/outocp.c b/Build/source/texk/web2c/otps/outocp.c index 9e8afd6913b..0b8447877b5 100644 --- a/Build/source/texk/web2c/otps/outocp.c +++ b/Build/source/texk/web2c/otps/outocp.c @@ -73,8 +73,8 @@ char *otp_names[] = { int no_words_read = 0; -int ctp_get -P1C (FILE *, input_file) +static int +ctp_get(FILE *input_file) { int ctpchar; ctpchar = getc (input_file); @@ -85,8 +85,8 @@ P1C (FILE *, input_file) return ctpchar; } -int ctp_read -P1C (FILE *, input_file) +static int +ctp_read(FILE *input_file) { int ctpword; no_words_read++; @@ -101,8 +101,8 @@ P1C (FILE *, input_file) return ctpword; } -void ctp_explain -P1C (FILE *, input_file) +static void +ctp_explain(FILE *input_file) { int i, j, arg, entry, instruction; int ctp_length, real_ctp_length, ctp_input, ctp_output, @@ -191,8 +191,8 @@ P1C (FILE *, input_file) no_words_read, no_words_read); } -int main -P2C (int, argc, string *, argv) +int +main(int argc, string *argv) { string input_name, full_input_name; FILE *input_file; diff --git a/Build/source/texk/web2c/otps/routines.c b/Build/source/texk/web2c/otps/routines.c index 6ee5d54188d..d22f304ba16 100644 --- a/Build/source/texk/web2c/otps/routines.c +++ b/Build/source/texk/web2c/otps/routines.c @@ -54,7 +54,7 @@ alias_pair aliases[OTP_MAXALIASES]; /* cons = [x] + L */ list -cons P2C(int, x, list, L) +cons(int x, list L) { list temp; temp = (list) malloc(sizeof(cell)); @@ -65,7 +65,7 @@ return temp; /* list1 = [x] */ list -list1 P1C(int, x) +list1(int x) { list temp; temp = (list) malloc(sizeof(cell)); @@ -76,7 +76,7 @@ return temp; /* list2 = [x, y] */ list -list2 P2C(int, x, int, y) +list2(int x, int y) { list temp, temp1; temp = (list) malloc(sizeof(cell)); @@ -90,7 +90,7 @@ return temp; /* append = copy(K) + L */ list -append P2C(list, K, list, L) +append(list K, list L) { if (K==nil) return L; return cons(K->val, append(K->ptr, L)); @@ -98,14 +98,14 @@ return cons(K->val, append(K->ptr, L)); /* append1 = copy(L) + [x] */ list -append1 P2C(list, L, int, x) +append1(list L, int x) { return (append(L,list1(x))); } /* lcons = [x] + L */ llist -lcons P2C(left, x, llist, L) +lcons(left x, llist L) { llist temp; temp = (llist) malloc(sizeof(lcell)); @@ -116,7 +116,7 @@ return temp; /* llist1 = [x] */ llist -llist1 P1C(left, x) +llist1(left x) { llist temp; temp = (llist) malloc(sizeof(lcell)); @@ -127,7 +127,7 @@ return temp; /* llist2 = [x, y] */ llist -llist2 P2C(left, x, left, y) +llist2(left x, left y) { llist temp, temp1; temp = (llist) malloc(sizeof(lcell)); @@ -141,7 +141,7 @@ return temp; /* lappend = copy(K) + L */ llist -lappend P2C(llist, K, llist, L) +lappend(llist K, llist L) { if (K==nil) return L; return lcons(K->val, lappend(K->ptr, L)); @@ -149,13 +149,13 @@ return lcons(K->val, lappend(K->ptr, L)); /* lappend1 = copy(L) + [x] */ llist -lappend1 P2C(llist, L, left, x) +lappend1(llist L, left x) { return (lappend(L,llist1(x))); } left -WildCard P1H(void) +WildCard(void) { left temp; temp = (left) malloc(sizeof(lft_cell)); @@ -164,7 +164,7 @@ return temp; } left -StringLeft P1C(char *, x) +StringLeft(char *x) { left temp; temp = (left) malloc(sizeof(lft_cell)); @@ -174,7 +174,7 @@ return temp; } left -SingleLeft P1C(int, x) +SingleLeft(int x) { left temp; temp = (left) malloc(sizeof(lft_cell)); @@ -184,7 +184,7 @@ return temp; } left -DoubleLeft P2C(int, x, int, y) +DoubleLeft(int x, int y) { left temp; temp = (left) malloc(sizeof(lft_cell)); @@ -195,7 +195,7 @@ return temp; } left -ChoiceLeft P1C(llist, L) +ChoiceLeft(llist L) { left temp; temp = (left) malloc(sizeof(lft_cell)); @@ -205,7 +205,7 @@ return temp; } left -NotChoiceLeft P1C(llist, L) +NotChoiceLeft(llist L) { left temp; temp = (left) malloc(sizeof(lft_cell)); @@ -215,7 +215,7 @@ return temp; } left -PlusLeft P2C(left, l, int, n) +PlusLeft(left l, int n) { left temp; if (n == 0) { FATAL ("plusleft's argument must be non-zero"); } @@ -227,7 +227,7 @@ return temp; } left -CompleteLeft P3C(left, l, int, n, int, m) +CompleteLeft(left l, int n, int m) { left temp; if (n == 0) { FATAL ("completeleft's first argument must be non-zero"); } @@ -240,7 +240,7 @@ return temp; } left -BeginningLeft P1H(void) +BeginningLeft(void) { left temp; temp = (left) malloc(sizeof(lft_cell)); @@ -249,7 +249,7 @@ return temp; } left -EndLeft P1H(void) +EndLeft(void) { left temp; temp = (left) malloc(sizeof(lft_cell)); @@ -258,7 +258,7 @@ return temp; } list -gen_left P1C(left, arg) +gen_left(left arg) { int save_ptr, k; list holes, false_holes, true_holes, backup_holes; @@ -397,7 +397,7 @@ default: } void -store_alias P2C(string, str, left, l) +store_alias(string str, left l) { int i; for (i=0; i=(1<<24)) { FATAL1 ("Argument (%d) of instruction too big", val); @@ -481,7 +481,7 @@ add_to_state((instr<<24)+val); } void -store_state P1C(string, str) +store_state(string str) { int i; for (i=0; i