[qfcc] Clean up warning and notice return types

They never needed to return expr.
This commit is contained in:
Bill Currie 2024-02-18 19:14:20 +09:00
parent 1df7674c65
commit b9aad99381
3 changed files with 8 additions and 10 deletions

View file

@ -54,13 +54,13 @@ void _internal_error (const expr_t *e, const char *file, int line,
__attribute__ ((format (PRINTF, 5, 6), noreturn)); __attribute__ ((format (PRINTF, 5, 6), noreturn));
#define internal_error(e, fmt...) _internal_error(e, __FILE__, __LINE__, __FUNCTION__, fmt) #define internal_error(e, fmt...) _internal_error(e, __FILE__, __LINE__, __FUNCTION__, fmt)
const expr_t *_warning (const expr_t *e, const char *file, void _warning (const expr_t *e, const char *file, int line, const char *func,
int line, const char *func, const char *fmt, ...) const char *fmt, ...)
__attribute__ ((format (PRINTF, 5, 6))); __attribute__ ((format (PRINTF, 5, 6)));
#define warning(e, fmt...) _warning(e, __FILE__, __LINE__, __FUNCTION__, fmt) #define warning(e, fmt...) _warning(e, __FILE__, __LINE__, __FUNCTION__, fmt)
const expr_t *_notice (const expr_t *e, const char *file, void _notice (const expr_t *e, const char *file, int line, const char *func,
int line, const char *func, const char *fmt, ...) const char *fmt, ...)
__attribute__ ((format (PRINTF, 5, 6))); __attribute__ ((format (PRINTF, 5, 6)));
#define notice(e, fmt...) _notice(e, __FILE__, __LINE__, __FUNCTION__, fmt) #define notice(e, fmt...) _notice(e, __FILE__, __LINE__, __FUNCTION__, fmt)

View file

@ -208,14 +208,14 @@ _bug (const expr_t *e, const char *file, int line, const char *func,
va_end (args); va_end (args);
} }
const expr_t * const void
_notice (const expr_t *e, const char *file, int line, const char *func, _notice (const expr_t *e, const char *file, int line, const char *func,
const char *fmt, ...) const char *fmt, ...)
{ {
va_list args; va_list args;
if (options.notices.silent) if (options.notices.silent)
return e; return;
va_start (args, fmt); va_start (args, fmt);
if (options.notices.promote) { if (options.notices.promote) {
@ -237,10 +237,9 @@ _notice (const expr_t *e, const char *file, int line, const char *func,
dstring_delete (message); dstring_delete (message);
} }
va_end (args); va_end (args);
return e;
} }
const expr_t * const void
_warning (const expr_t *e, const char *file, int line, const char *func, _warning (const expr_t *e, const char *file, int line, const char *func,
const char *fmt, ...) const char *fmt, ...)
{ {
@ -249,7 +248,6 @@ _warning (const expr_t *e, const char *file, int line, const char *func,
va_start (args, fmt); va_start (args, fmt);
__warning (e, file, line, func, fmt, args); __warning (e, file, line, func, fmt, args);
va_end (args); va_end (args);
return e;
} }
void void

View file

@ -55,7 +55,7 @@ void codespace_addcode (codespace_t *codespace, struct dstatement_s *code, int s
__attribute__((const)) int function_parms (function_t *f, byte *parm_size) {return 0;} __attribute__((const)) int function_parms (function_t *f, byte *parm_size) {return 0;}
void def_to_ddef (def_t *def, ddef_t *ddef, int aux) {} void def_to_ddef (def_t *def, ddef_t *ddef, int aux) {}
__attribute__((noreturn)) void _internal_error (const expr_t *e, const char *file, int line, const char *func, const char *fmt, ...) {abort();} __attribute__((noreturn)) void _internal_error (const expr_t *e, const char *file, int line, const char *func, const char *fmt, ...) {abort();}
__attribute__((const)) const expr_t *_warning (const expr_t *e, const char *file, int line, const char *func, const char *fmt, ...) {return 0;} void _warning (const expr_t *e, const char *file, int line, const char *func, const char *fmt, ...) {}
__attribute__((const)) const expr_t *_error (const expr_t *e, const char *file, int line, const char *func, const char *fmt, ...) {return 0;} __attribute__((const)) const expr_t *_error (const expr_t *e, const char *file, int line, const char *func, const char *fmt, ...) {return 0;}
__attribute__((const)) symbol_t *make_structure (const char *name, int su, struct_def_t *defs, const type_t *type) {return 0;} __attribute__((const)) symbol_t *make_structure (const char *name, int su, struct_def_t *defs, const type_t *type) {return 0;}
__attribute__((const)) symbol_t *symtab_addsymbol (symtab_t *symtab, symbol_t *symbol) {return 0;} __attribute__((const)) symbol_t *symtab_addsymbol (symtab_t *symtab, symbol_t *symbol) {return 0;}