From 3b8c2974a13a4c73b2a31a8e84d446ef56574897 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Mon, 5 Dec 2011 01:39:04 +0400 Subject: Use proper bracing on setting warnings in comman line parsing Signed-off-by: Cyrill Gorcunov --- nasm.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'nasm.c') diff --git a/nasm.c b/nasm.c index ed49a3e..da6f8bf 100644 --- a/nasm.c +++ b/nasm.c @@ -868,20 +868,22 @@ static bool process_arg(char *p, char *q) param++; set_warning: - for (i = 0; i <= ERR_WARN_MAX; i++) - if (!nasm_stricmp(param, warnings[i].name)) - break; - if (i <= ERR_WARN_MAX) - warning_on_global[i] = do_warn; - else if (!nasm_stricmp(param, "all")) - for (i = 1; i <= ERR_WARN_MAX; i++) - warning_on_global[i] = do_warn; - else if (!nasm_stricmp(param, "none")) - for (i = 1; i <= ERR_WARN_MAX; i++) - warning_on_global[i] = !do_warn; - else - nasm_error(ERR_NONFATAL | ERR_NOFILE | ERR_USAGE, - "invalid warning `%s'", param); + for (i = 0; i <= ERR_WARN_MAX; i++) { + if (!nasm_stricmp(param, warnings[i].name)) + break; + } + if (i <= ERR_WARN_MAX) { + warning_on_global[i] = do_warn; + } else if (!nasm_stricmp(param, "all")) { + for (i = 1; i <= ERR_WARN_MAX; i++) + warning_on_global[i] = do_warn; + } else if (!nasm_stricmp(param, "none")) { + for (i = 1; i <= ERR_WARN_MAX; i++) + warning_on_global[i] = !do_warn; + } else { + nasm_error(ERR_NONFATAL | ERR_NOFILE | ERR_USAGE, + "invalid warning `%s'", param); + } break; case 'M': -- cgit v1.2.3