more warning cleanup (trunk only)

More warning bits that never got committed.
More appropriate compiler flags for warning checks (macosx only for the moment).
The changes in dgn*[lc] just rename line_number to nh_line_number to avoid a
clash, so no need to regenerate the lex output.
This commit is contained in:
keni
2008-04-18 17:37:33 +00:00
parent 0b3e8bbd88
commit 7b2fb4d0b5
7 changed files with 20 additions and 18 deletions
+2 -3
View File
@@ -160,7 +160,7 @@ STATIC_DCL char FDECL(cmd_from_func, (int NDECL((*))));
STATIC_PTR int NDECL(doattributes); STATIC_PTR int NDECL(doattributes);
STATIC_PTR int NDECL(doconduct); /**/ STATIC_PTR int NDECL(doconduct); /**/
STATIC_DCL void FDECL(enlght_line, (const char *,const char *,const char *,char *)); STATIC_DCL void FDECL(enlght_line, (const char *,const char *,const char *,const char *));
STATIC_DCL char *FDECL(enlght_combatinc, (const char *,int,int,char *)); STATIC_DCL char *FDECL(enlght_combatinc, (const char *,int,int,char *));
STATIC_DCL void FDECL(enlght_halfdmg, (int,int)); STATIC_DCL void FDECL(enlght_halfdmg, (int,int));
STATIC_DCL boolean NDECL(walking_on_water); STATIC_DCL boolean NDECL(walking_on_water);
@@ -991,8 +991,7 @@ static const char
static void static void
enlght_line(start, middle, end, ps) enlght_line(start, middle, end, ps)
const char *start, *middle, *end; const char *start, *middle, *end, *ps;
char *ps;
{ {
char buf[BUFSZ]; char buf[BUFSZ];
+1 -1
View File
@@ -2069,7 +2069,7 @@ recalc_mapseen()
{ {
mapseen *mptr; mapseen *mptr;
struct monst *shkp; struct monst *shkp;
int x, y, ridx; unsigned int x, y, ridx;
/* Should not happen in general, but possible if in the process /* Should not happen in general, but possible if in the process
* of being booted from the quest. The mapseen object gets * of being booted from the quest. The mapseen object gets
+6 -6
View File
@@ -2553,7 +2553,7 @@ parse_sym_line(buf, which_set)
char *buf; char *buf;
int which_set; int which_set;
{ {
int i, val; int val;
struct symparse *symp = (struct symparse *)0; struct symparse *symp = (struct symparse *)0;
char *bufp, *commentp, *altp; char *bufp, *commentp, *altp;
@@ -2715,10 +2715,10 @@ int which_set;
break; break;
case 5: /* restrictions: xxxx*/ case 5: /* restrictions: xxxx*/
if (chosen_symset_start) { if (chosen_symset_start) {
i = 0; int n = 0;
while (known_restrictions[i]) { while (known_restrictions[n]) {
if (!strcmpi(known_restrictions[i], bufp)) { if (!strcmpi(known_restrictions[n], bufp)) {
switch(i) { switch(n) {
case 0: symset[which_set].primary = 1; case 0: symset[which_set].primary = 1;
break; break;
case 1: symset[which_set].rogue = 1; case 1: symset[which_set].rogue = 1;
@@ -2728,7 +2728,7 @@ int which_set;
} }
break; /* while loop */ break; /* while loop */
} }
i++; n++;
} }
/* Don't allow unicode set if code can't handle it */ /* Don't allow unicode set if code can't handle it */
if (symset[which_set].unicode && if (symset[which_set].unicode &&
+1 -1
View File
@@ -54,7 +54,7 @@ struct termios termio;
struct termio termio; struct termio termio;
# endif # endif
# endif # endif
# ifdef AMIX # if defined(AMIX) || defined(__APPLE__)
#include <sys/ioctl.h> #include <sys/ioctl.h>
# endif /* AMIX */ # endif /* AMIX */
#endif #endif
+3
View File
@@ -44,6 +44,9 @@ GAMEUID = games
GAMEGRP = $(GAMEUID) GAMEGRP = $(GAMEUID)
#CC=gcc -W -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN
CC=gcc -Wall -Wextra -Wno-missing-field-initializers -Wimplicit -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -DGCC_WARN
# #
# You shouldn't need to change anything below here. # You shouldn't need to change anything below here.
# #
+3 -3
View File
@@ -73,7 +73,7 @@ void FDECL(init_yyout, (FILE *));
extern YYSTYPE yylval; extern YYSTYPE yylval;
int line_number = 1; int nh_line_number = 1;
%} %}
%% %%
@@ -110,8 +110,8 @@ RNDCHLEVEL return(RNDCHLEVEL);
yylval.str = (char *) alloc(strlen(yytext+1)+1); yylval.str = (char *) alloc(strlen(yytext+1)+1);
Strcpy(yylval.str, yytext+1); /* Discard the first \" */ Strcpy(yylval.str, yytext+1); /* Discard the first \" */
return(STRING); } return(STRING); }
^#.*\n { line_number++; } ^#.*\n { nh_line_number++; }
\r?\n { line_number++; } \r?\n { nh_line_number++; }
[ \t]+ ; /* skip trailing tabs & spaces */ [ \t]+ ; /* skip trailing tabs & spaces */
. { return yytext[0]; } . { return yytext[0]; }
%% %%
+4 -4
View File
@@ -33,7 +33,7 @@
#define MAX_ERRORS 25 #define MAX_ERRORS 25
extern int NDECL (yyparse); extern int NDECL (yyparse);
extern int line_number; extern int nh_line_number;
const char *fname = "(stdin)"; const char *fname = "(stdin)";
int fatal_error = 0; int fatal_error = 0;
@@ -135,7 +135,7 @@ char **argv;
init_yyin(fin); init_yyin(fin);
init_yyout(fout); init_yyout(fout);
(void) yyparse(); (void) yyparse();
line_number = 1; nh_line_number = 1;
if (fatal_error > 0) { if (fatal_error > 0) {
errors_encountered = TRUE; errors_encountered = TRUE;
fatal_error = 0; fatal_error = 0;
@@ -161,7 +161,7 @@ char **argv;
void yyerror(s) void yyerror(s)
const char *s; const char *s;
{ {
(void) fprintf(stderr,"%s : line %d : %s\n",fname,line_number, s); (void) fprintf(stderr,"%s : line %d : %s\n",fname,nh_line_number, s);
if (++fatal_error > MAX_ERRORS) { if (++fatal_error > MAX_ERRORS) {
(void) fprintf(stderr,"Too many errors, good bye!\n"); (void) fprintf(stderr,"Too many errors, good bye!\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
@@ -175,7 +175,7 @@ const char *s;
void yywarning(s) void yywarning(s)
const char *s; const char *s;
{ {
(void) fprintf(stderr,"%s : line %d : WARNING : %s\n",fname,line_number,s); (void) fprintf(stderr,"%s : line %d : WARNING : %s\n",fname,nh_line_number,s);
} }
int yywrap() int yywrap()