mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 06:10:56 +00:00
[qfcc] Make internal_error const correct
This way it can be used with const expr objects.
This commit is contained in:
parent
d865095d0b
commit
365e298908
3 changed files with 7 additions and 6 deletions
|
@ -49,7 +49,7 @@ struct expr_s *_error (struct expr_s *e, const char *file, int line,
|
|||
__attribute__ ((format (PRINTF, 4, 5)));
|
||||
#define error(e, fmt...) _error(e, __FILE__, __LINE__, fmt)
|
||||
|
||||
void _internal_error (struct expr_s *e, const char *file, int line,
|
||||
void _internal_error (const struct expr_s *e, const char *file, int line,
|
||||
const char *fmt, ...)
|
||||
__attribute__ ((format (PRINTF, 4, 5), noreturn));
|
||||
#define internal_error(e, fmt...) _internal_error(e, __FILE__, __LINE__, fmt)
|
||||
|
|
|
@ -47,7 +47,7 @@ diagnostic_hook warning_hook;
|
|||
diagnostic_hook notice_hook;
|
||||
|
||||
static void
|
||||
report_function (expr_t *e)
|
||||
report_function (const expr_t *e)
|
||||
{
|
||||
static function_t *last_func = (function_t *)-1L;
|
||||
static string_t last_file;
|
||||
|
@ -78,7 +78,7 @@ report_function (expr_t *e)
|
|||
}
|
||||
|
||||
static __attribute__((format(PRINTF, 4, 0))) void
|
||||
format_message (dstring_t *message, const char *msg_type, expr_t *e,
|
||||
format_message (dstring_t *message, const char *msg_type, const expr_t *e,
|
||||
const char *fmt, va_list args)
|
||||
{
|
||||
string_t file = pr.source_file;
|
||||
|
@ -147,7 +147,7 @@ _debug (expr_t *e, const char *file, int line, const char *fmt, ...)
|
|||
}
|
||||
|
||||
static __attribute__((noreturn, format(PRINTF, 4, 0))) void
|
||||
__internal_error (expr_t *e, const char *file, int line,
|
||||
__internal_error (const expr_t *e, const char *file, int line,
|
||||
const char *fmt, va_list args)
|
||||
{
|
||||
dstring_t *message = dstring_new ();
|
||||
|
@ -234,7 +234,8 @@ _warning (expr_t *e, const char *file, int line, const char *fmt, ...)
|
|||
}
|
||||
|
||||
void
|
||||
_internal_error (expr_t *e, const char *file, int line, const char *fmt, ...)
|
||||
_internal_error (const expr_t *e, const char *file, int line,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ __attribute__((const)) codespace_t *codespace_new (void) {return 0;}
|
|||
void codespace_addcode (codespace_t *codespace, struct dstatement_s *code, int size) {}
|
||||
__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) {}
|
||||
__attribute__((noreturn)) void _internal_error (expr_t *e, const char *file, int line, const char *fmt, ...) {abort();}
|
||||
__attribute__((noreturn)) void _internal_error (const expr_t *e, const char *file, int line, const char *fmt, ...) {abort();}
|
||||
__attribute__((const)) expr_t *_warning (expr_t *e, const char *file, int line, const char *fmt, ...) {return 0;}
|
||||
__attribute__((const)) expr_t *_error (expr_t *e, const char *file, int line, const char *fmt, ...) {return 0;}
|
||||
__attribute__((const)) symbol_t *make_structure (const char *name, int su, struct_def_t *defs, type_t *type) {return 0;}
|
||||
|
|
Loading…
Reference in a new issue