From: Wolfgang Bumiller Date: Thu, 20 Dec 2012 15:53:09 +0000 (+0100) Subject: -Werror- should actually use opts_setwerror X-Git-Tag: 0.1.9~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6cd821d4594ba94ad387c9346119d71897f0489e;p=xonotic%2Fgmqcc.git -Werror- should actually use opts_setwerror --- diff --git a/gmqcc.h b/gmqcc.h index fdcb56b..af3d2c1 100644 --- a/gmqcc.h +++ b/gmqcc.h @@ -826,9 +826,10 @@ typedef struct { longbit bit; } opts_flag_def; -bool opts_setflag (const char *, bool); -bool opts_setwarn (const char *, bool); -bool opts_setoptim(const char *, bool); +bool opts_setflag (const char *, bool); +bool opts_setwarn (const char *, bool); +bool opts_setwerror(const char *, bool); +bool opts_setoptim (const char *, bool); void opts_init (const char *, int, size_t); void opts_set (uint32_t *, size_t, bool); diff --git a/main.c b/main.c index 36fe844..8394df4 100644 --- a/main.c +++ b/main.c @@ -345,13 +345,13 @@ static bool options_parse(int argc, char **argv) { break; } else if (!strncmp(argv[0]+2, "ERROR_", 6)) { - if (!opts_setwarn(argv[0]+8, true)) { + if (!opts_setwerror(argv[0]+8, true)) { con_out("unknown warning: %s\n", argv[0]+2); return false; } } else if (!strncmp(argv[0]+2, "NO_ERROR_", 9)) { - if (!opts_setwarn(argv[0]+11, false)) { + if (!opts_setwerror(argv[0]+11, false)) { con_out("unknown warning: %s\n", argv[0]+2); return false; } diff --git a/opts.c b/opts.c index b8abedd..a8e3e6c 100644 --- a/opts.c +++ b/opts.c @@ -88,16 +88,16 @@ static bool opts_setflag_all(const char *name, bool on, uint32_t *flags, const o } return false; } -bool opts_setflag (const char *name, bool on) { +bool opts_setflag (const char *name, bool on) { return opts_setflag_all(name, on, opts.flags, opts_flag_list, COUNT_FLAGS); } -bool opts_setwarn (const char *name, bool on) { +bool opts_setwarn (const char *name, bool on) { return opts_setflag_all(name, on, opts.warn, opts_warn_list, COUNT_WARNINGS); } bool opts_setwerror(const char *name, bool on) { return opts_setflag_all(name, on, opts.werror, opts_warn_list, COUNT_WARNINGS); } -bool opts_setoptim(const char *name, bool on) { +bool opts_setoptim (const char *name, bool on) { return opts_setflag_all(name, on, opts.optimization, opts_opt_list, COUNT_OPTIMIZATIONS); }