From 458ecbb60bb7e8e32aca62a562586d921d5396aa Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 10 May 2010 21:11:35 -0400 Subject: [PATCH] Fix tracing order --- src/hb-open-type-private.hh | 14 +++++--------- src/hb-ot-layout-gsubgpos-private.hh | 3 +-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index c7b087e..eabe1b8 100644 --- a/src/hb-open-type-private.hh +++ b/src/hb-open-type-private.hh @@ -146,22 +146,19 @@ ASSERT_STATIC (Type::min_size + 1 <= sizeof (_Null##Type)) template struct hb_trace_t { - explicit hb_trace_t (unsigned int *pdepth) : pdepth(pdepth) { if (max_depth) ++*pdepth; } - ~hb_trace_t (void) { if (max_depth) --*pdepth; } - - inline void log (const char *what, const char *function, const void *obj) - { + explicit hb_trace_t (unsigned int *pdepth, const char *what, const char *function, const void *obj) : pdepth(pdepth) { if (*pdepth < max_depth) fprintf (stderr, "%s(%p) %-*d-> %s\n", what, obj, *pdepth, *pdepth, function); + if (max_depth) ++*pdepth; } + ~hb_trace_t (void) { if (max_depth) --*pdepth; } private: unsigned int *pdepth; }; template <> /* Optimize when tracing is disabled */ struct hb_trace_t<0> { - explicit hb_trace_t (unsigned int *p) {} - inline void log (const char *what, const char *function, const void *obj) {}; + explicit hb_trace_t (unsigned int *pdepth, const char *what, const char *function, const void *obj) {} }; @@ -176,8 +173,7 @@ struct hb_trace_t<0> { #define TRACE_SANITIZE() \ - hb_trace_t trace (&context->debug_depth); \ - trace.log ("SANITIZE", HB_FUNC, this); + hb_trace_t trace (&context->debug_depth, "SANITIZE", HB_FUNC, this); \ struct hb_sanitize_context_t diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index 488ab1d..09c817d 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -36,8 +36,7 @@ #endif #define TRACE_APPLY() \ - hb_trace_t trace (&context->debug_depth); \ - trace.log ("APPLY", HB_FUNC, this); + hb_trace_t trace (&context->debug_depth, "APPLY", HB_FUNC, this); \ struct hb_apply_context_t -- 2.7.4