summaryrefslogtreecommitdiffstats
path: root/include/debug.h
diff options
context:
space:
mode:
authorKarel Zak2014-03-21 11:21:56 +0100
committerKarel Zak2014-03-21 11:21:56 +0100
commitd282c88df5cef3978546d9b6ce894d18421d9615 (patch)
tree51db7bb1e88f98cbbb6e4c1396196fb70a1decf2 /include/debug.h
parentMerge branch 'common_debug' of https://github.com/ooprala/util-linux (diff)
downloadkernel-qcow2-util-linux-d282c88df5cef3978546d9b6ce894d18421d9615.tar.gz
kernel-qcow2-util-linux-d282c88df5cef3978546d9b6ce894d18421d9615.tar.xz
kernel-qcow2-util-linux-d282c88df5cef3978546d9b6ce894d18421d9615.zip
include/debug: fix coding style
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include/debug.h')
-rw-r--r--include/debug.h43
1 files changed, 22 insertions, 21 deletions
diff --git a/include/debug.h b/include/debug.h
index dfb640f6b..069447967 100644
--- a/include/debug.h
+++ b/include/debug.h
@@ -17,28 +17,29 @@
/* l - library name, p - flag prefix, m - flag postfix, x - function */
# define __UL_DBG(l, p, m, x) \
- do { \
- if ((p ## m) & l ## _debug_mask) { \
- fprintf(stderr, "%d: %s: %8s: ", getpid(), # l, # m); \
- x; \
- } \
- } while (0)
+ do { \
+ if ((p ## m) & l ## _debug_mask) { \
+ fprintf(stderr, "%d: %s: %8s: ", getpid(), # l, # m); \
+ x; \
+ } \
+ } while (0)
-#define __UL_INIT_DEBUG(lib, pref, mask, env) do { \
- if (lib ## _debug_mask & pref ## INIT) \
- ; \
- else if (!mask) { \
- char *str = getenv(# env); \
- if (str) \
- lib ## _debug_mask = strtoul(str, 0, 0); \
- } else \
- lib ## _debug_mask = mask; \
- lib ## _debug_mask |= pref ## INIT; \
- if (lib ## _debug_mask != pref ## INIT) { \
- __UL_DBG(lib, pref, INIT, ul_debug("library debug mask: 0x%04x", \
- lib ## _debug_mask)); \
- } \
-} while (0)
+#define __UL_INIT_DEBUG(lib, pref, mask, env) \
+ do { \
+ if (lib ## _debug_mask & pref ## INIT) \
+ ; \
+ else if (!mask) { \
+ char *str = getenv(# env); \
+ if (str) \
+ lib ## _debug_mask = strtoul(str, 0, 0); \
+ } else \
+ lib ## _debug_mask = mask; \
+ lib ## _debug_mask |= pref ## INIT; \
+ if (lib ## _debug_mask != pref ## INIT) { \
+ __UL_DBG(lib, pref, INIT, ul_debug("library debug mask: 0x%04x", \
+ lib ## _debug_mask)); \
+ } \
+ } while (0)
static inline void __attribute__ ((__format__ (__printf__, 1, 2)))
ul_debug(const char *mesg, ...)