From a5884a88fc57174c43d2ae9b50b437a60f6baf0b Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 17 Nov 2010 15:54:06 +0000 Subject: [PATCH] generator: Make trace flag an explicit variable. This is just code motion. --- generator/generator_c.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/generator/generator_c.ml b/generator/generator_c.ml index 0194e0c..658d76d 100644 --- a/generator/generator_c.ml +++ b/generator/generator_c.ml @@ -712,7 +712,7 @@ check_state (guestfs_h *g, const char *caller) (* Generate code to generate guestfish call traces. *) let trace_call shortname (ret, args, optargs) = - pr " if (guestfs__get_trace (g)) {\n"; + pr " if (trace_flag) {\n"; let needs_i = List.exists (function @@ -802,6 +802,8 @@ check_state (guestfs_h *g, const char *caller) ~handle:"g" ~prefix:"guestfs_" ~suffix:"_argv" ~optarg_proto:Argv shortname style; pr "{\n"; + pr " int trace_flag = g->trace;\n"; + pr "\n"; check_null_strings shortname style; reject_unknown_optargs shortname style; trace_call shortname style; @@ -852,6 +854,7 @@ check_state (guestfs_h *g, const char *caller) pr " int serial;\n"; pr " int r;\n"; + pr " int trace_flag = g->trace;\n"; pr "\n"; check_null_strings shortname style; reject_unknown_optargs shortname style; -- 1.8.3.1