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

View File

@@ -160,7 +160,7 @@ STATIC_DCL char FDECL(cmd_from_func, (int NDECL((*))));
STATIC_PTR int NDECL(doattributes);
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 void FDECL(enlght_halfdmg, (int,int));
STATIC_DCL boolean NDECL(walking_on_water);
@@ -991,8 +991,7 @@ static const char
static void
enlght_line(start, middle, end, ps)
const char *start, *middle, *end;
char *ps;
const char *start, *middle, *end, *ps;
{
char buf[BUFSZ];

View File

@@ -2069,7 +2069,7 @@ recalc_mapseen()
{
mapseen *mptr;
struct monst *shkp;
int x, y, ridx;
unsigned int x, y, ridx;
/* Should not happen in general, but possible if in the process
* of being booted from the quest. The mapseen object gets

View File

@@ -2553,7 +2553,7 @@ parse_sym_line(buf, which_set)
char *buf;
int which_set;
{
int i, val;
int val;
struct symparse *symp = (struct symparse *)0;
char *bufp, *commentp, *altp;
@@ -2715,10 +2715,10 @@ int which_set;
break;
case 5: /* restrictions: xxxx*/
if (chosen_symset_start) {
i = 0;
while (known_restrictions[i]) {
if (!strcmpi(known_restrictions[i], bufp)) {
switch(i) {
int n = 0;
while (known_restrictions[n]) {
if (!strcmpi(known_restrictions[n], bufp)) {
switch(n) {
case 0: symset[which_set].primary = 1;
break;
case 1: symset[which_set].rogue = 1;
@@ -2728,7 +2728,7 @@ int which_set;
}
break; /* while loop */
}
i++;
n++;
}
/* Don't allow unicode set if code can't handle it */
if (symset[which_set].unicode &&

View File

@@ -54,7 +54,7 @@ struct termios termio;
struct termio termio;
# endif
# endif
# ifdef AMIX
# if defined(AMIX) || defined(__APPLE__)
#include <sys/ioctl.h>
# endif /* AMIX */
#endif

View File

@@ -44,6 +44,9 @@ GAMEUID = games
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.
#

View File

@@ -73,7 +73,7 @@ void FDECL(init_yyout, (FILE *));
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);
Strcpy(yylval.str, yytext+1); /* Discard the first \" */
return(STRING); }
^#.*\n { line_number++; }
\r?\n { line_number++; }
^#.*\n { nh_line_number++; }
\r?\n { nh_line_number++; }
[ \t]+ ; /* skip trailing tabs & spaces */
. { return yytext[0]; }
%%

View File

@@ -33,7 +33,7 @@
#define MAX_ERRORS 25
extern int NDECL (yyparse);
extern int line_number;
extern int nh_line_number;
const char *fname = "(stdin)";
int fatal_error = 0;
@@ -135,7 +135,7 @@ char **argv;
init_yyin(fin);
init_yyout(fout);
(void) yyparse();
line_number = 1;
nh_line_number = 1;
if (fatal_error > 0) {
errors_encountered = TRUE;
fatal_error = 0;
@@ -161,7 +161,7 @@ char **argv;
void yyerror(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) {
(void) fprintf(stderr,"Too many errors, good bye!\n");
exit(EXIT_FAILURE);
@@ -175,7 +175,7 @@ const char *s;
void yywarning(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()