From: Richard W.M. Jones Date: Wed, 17 Nov 2010 15:54:06 +0000 (+0000) Subject: generator: Make trace flag an explicit variable. X-Git-Tag: 1.6.2~2 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=84f285302aab8cafe307bedb86993d9f3393d590;p=libguestfs.git generator: Make trace flag an explicit variable. This is just code motion. (cherry picked from commit a5884a88fc57174c43d2ae9b50b437a60f6baf0b) --- diff --git a/generator/generator_c.ml b/generator/generator_c.ml index b06ab40..a2860d4 100644 --- a/generator/generator_c.ml +++ b/generator/generator_c.ml @@ -589,7 +589,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 @@ -679,6 +679,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; @@ -729,6 +731,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;