From 84f285302aab8cafe307bedb86993d9f3393d590 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. (cherry picked from commit a5884a88fc57174c43d2ae9b50b437a60f6baf0b) --- 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 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; -- 1.8.3.1