mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-07 08:21:59 +00:00
expr.c:
warn for int const / int const. this will probably want an option for newer games qfcc.c: clean up temp files when errors have occured
This commit is contained in:
parent
75f3f27a22
commit
6d1671950a
2 changed files with 6 additions and 3 deletions
|
@ -135,7 +135,7 @@ warning (expr_t *e, const char *fmt, ...)
|
||||||
file = e->file;
|
file = e->file;
|
||||||
line = e->line;
|
line = e->line;
|
||||||
}
|
}
|
||||||
fprintf (stderr, "%s:%d: warning:", strings + file, line);
|
fprintf (stderr, "%s:%d: warning: ", strings + file, line);
|
||||||
vfprintf (stderr, fmt, args);
|
vfprintf (stderr, fmt, args);
|
||||||
fputs ("\n", stderr);
|
fputs ("\n", stderr);
|
||||||
va_end (args);
|
va_end (args);
|
||||||
|
@ -519,6 +519,7 @@ do_op_integer (int op, expr_t *e1, expr_t *e2)
|
||||||
e1->e.integer_val *= i2;
|
e1->e.integer_val *= i2;
|
||||||
break;
|
break;
|
||||||
case '/':
|
case '/':
|
||||||
|
warning (e2, "%d / %d == %d", i1, i2, i1 / i2);
|
||||||
e1->e.integer_val /= i2;
|
e1->e.integer_val /= i2;
|
||||||
break;
|
break;
|
||||||
case '&':
|
case '&':
|
||||||
|
|
|
@ -1026,6 +1026,7 @@ Options: \n\
|
||||||
char tempname[1024];
|
char tempname[1024];
|
||||||
int tempfd;
|
int tempfd;
|
||||||
#endif
|
#endif
|
||||||
|
int error;
|
||||||
extern FILE *yyin;
|
extern FILE *yyin;
|
||||||
int yyparse(void);
|
int yyparse(void);
|
||||||
extern void clear_frame_macros (void);
|
extern void clear_frame_macros (void);
|
||||||
|
@ -1096,8 +1097,7 @@ Options: \n\
|
||||||
s_file = ReuseString (filename);
|
s_file = ReuseString (filename);
|
||||||
pr_source_line = 1;
|
pr_source_line = 1;
|
||||||
clear_frame_macros ();
|
clear_frame_macros ();
|
||||||
if (yyparse () || pr_error_count)
|
error = yyparse () || pr_error_count;
|
||||||
return 1;
|
|
||||||
fclose (yyin);
|
fclose (yyin);
|
||||||
#ifdef USE_CPP
|
#ifdef USE_CPP
|
||||||
if (!no_cpp) {
|
if (!no_cpp) {
|
||||||
|
@ -1107,6 +1107,8 @@ Options: \n\
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
if (error)
|
||||||
|
return 1;
|
||||||
#else
|
#else
|
||||||
char *src2;
|
char *src2;
|
||||||
sprintf (filename, "%s%c%s", sourcedir, PATH_SEPARATOR, com_token);
|
sprintf (filename, "%s%c%s", sourcedir, PATH_SEPARATOR, com_token);
|
||||||
|
|
Loading…
Reference in a new issue