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.7.10~3 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=a5884a88fc57174c43d2ae9b50b437a60f6baf0b;p=libguestfs.git generator: Make trace flag an explicit variable. This is just code motion. --- 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;