aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-07-01 23:32:06 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-07-02 21:08:00 +0200
commit5784e53b392cbda40e2828d7dcdee38ee589a18a (patch)
treeb7314423d1a11c708467139d419e3848073b1626
parenta717e30bdf1ade23a28b644d1cb9f1161030d3b3 (diff)
downloadsparse-5784e53b392cbda40e2828d7dcdee38ee589a18a.tar.gz
options: add a small helper: handle_switch_finalize()
This is just to isolate the details about which switch need an extra 'finalization' in a separate function in preparation to moving all the parsing code in a separate file. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--lib.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib.c b/lib.c
index b3bacb18..a56efcaa 100644
--- a/lib.c
+++ b/lib.c
@@ -1220,6 +1220,12 @@ static char **handle_switch(char *arg, char **next)
return next;
}
+static void handle_switch_finalize(void)
+{
+ handle_switch_v_finalize();
+ handle_switch_W_finalize();
+}
+
////////////////////////////////////////////////////////////////////////////////
// Predefines
@@ -1576,8 +1582,7 @@ struct symbol_list *sparse_initialize(int argc, char **argv, struct string_list
}
add_ptr_list(filelist, arg);
}
- handle_switch_W_finalize();
- handle_switch_v_finalize();
+ handle_switch_finalize();
// Redirect stdout if needed
if (dump_macro_defs || preprocess_only)