]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ot: renamed the variable dbg_indent_level to flt_ot_dbg_indent_level
authorMiroslav Zagorac <mzagorac@haproxy.com>
Fri, 20 Jan 2023 23:44:13 +0000 (00:44 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Mon, 13 Apr 2026 07:23:30 +0000 (09:23 +0200)
The thread-local variable dbg_indent_level used a generic name that could
collide with identifiers in other compilation units.  Renamed it to
flt_ot_dbg_indent_level so that it carried the flt_ot_ prefix consistent
with the rest of the OpenTracing filter namespace.  The rename covered the
declaration, definition, and all macro references in debug.h, parser.c and
util.c.

addons/ot/include/debug.h
addons/ot/src/parser.c
addons/ot/src/util.c

index c749960c8f376b5ae2a317285176d024b91a87ba..667adc20b30b9b315407a8e2a9da8cf0dce0ef3a 100644 (file)
        do {                                                                               \
                if (!(l) || (flt_ot_debug.level & (1 << (l))))                             \
                        (void)fprintf(stderr, FLT_OT_DBG_FMT("%.*s" f "\n"),               \
-                                     dbg_indent_level, FLT_OT_DBG_INDENT, ##__VA_ARGS__); \
+                                     flt_ot_dbg_indent_level, FLT_OT_DBG_INDENT, ##__VA_ARGS__); \
        } while (0)
-#  define FLT_OT_FUNC(f, ...)       do { FLT_OT_DBG(1, "%s(" f ") {", __func__, ##__VA_ARGS__); dbg_indent_level += 3; } while (0)
-#  define FLT_OT_RETURN(a)          do { dbg_indent_level -= 3; FLT_OT_DBG(1, "}"); return a; } while (0)
-#  define FLT_OT_RETURN_EX(a,t,f)   do { dbg_indent_level -= 3; { t _r = (a); FLT_OT_DBG(1, "} = " f, _r); return _r; } } while (0)
+#  define FLT_OT_FUNC(f, ...)       do { FLT_OT_DBG(1, "%s(" f ") {", __func__, ##__VA_ARGS__); flt_ot_dbg_indent_level += 3; } while (0)
+#  define FLT_OT_RETURN(a)          do { flt_ot_dbg_indent_level -= 3; FLT_OT_DBG(1, "}"); return a; } while (0)
+#  define FLT_OT_RETURN_EX(a,t,f)   do { flt_ot_dbg_indent_level -= 3; { t _r = (a); FLT_OT_DBG(1, "} = " f, _r); return _r; } } while (0)
 #  define FLT_OT_RETURN_INT(a)      FLT_OT_RETURN_EX((a), int, "%d")
 #  define FLT_OT_RETURN_PTR(a)      FLT_OT_RETURN_EX((a), void *, "%p")
 #  define FLT_OT_DBG_IFDEF(a,b)     a
@@ -54,7 +54,7 @@ struct flt_ot_debug {
 };
 
 
-extern THREAD_LOCAL int    dbg_indent_level;
+extern THREAD_LOCAL int    flt_ot_dbg_indent_level;
 extern struct flt_ot_debug flt_ot_debug;
 
 #else
index f3b4df3f1db5c8afaee760e4ceeac836bbaf4928..f0ec59a553d2f378cb0775262f7c89c223e06571 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifdef DEBUG_OT
 struct flt_ot_debug               flt_ot_debug;
-THREAD_LOCAL int                  dbg_indent_level = 0;
+THREAD_LOCAL int                  flt_ot_dbg_indent_level = 0;
 #endif
 
 #ifdef OTC_DBG_MEM
index fee6d377f67384def44cf7ea7009cb0cd89980c3..e572c9c64eb5b769d7c80db80c7da856916a417a 100644 (file)
@@ -41,7 +41,7 @@ void flt_ot_args_dump(char **args)
 
        argc = flt_ot_args_count(args);
 
-       (void)fprintf(stderr, FLT_OT_DBG_FMT("%.*sargs[%d]: { '%s' "), dbg_indent_level, FLT_OT_DBG_INDENT, argc, args[0]);
+       (void)fprintf(stderr, FLT_OT_DBG_FMT("%.*sargs[%d]: { '%s' "), flt_ot_dbg_indent_level, FLT_OT_DBG_INDENT, argc, args[0]);
 
        for (i = 1; i < argc; i++)
                (void)fprintf(stderr, "'%s' ", args[i]);