diff options
author | Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> | 2014-02-12 10:12:04 -0500 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-02-12 22:30:55 +0100 |
commit | a3c8390d19593b1e5277d95bfb4ab206d4785150 (patch) | |
tree | 2eb4e5432f4f79a75589c03b1513b656879ebf9c /src/util/util.h | |
parent | cc026fd9ba386f2197e3217940d597dcad1a26fe (diff) | |
download | sssd-a3c8390d19593b1e5277d95bfb4ab206d4785150.tar.gz sssd-a3c8390d19593b1e5277d95bfb4ab206d4785150.tar.xz sssd-a3c8390d19593b1e5277d95bfb4ab206d4785150.zip |
Make DEBUG macro invocations variadic
Use a script to update DEBUG macro invocations to use it as a variadic
macro, supplying format string and its arguments directly, instead of
wrapping them in parens.
This script was used to update the code:
grep -rwl --include '*.[hc]' DEBUG . |
while read f; do
mv "$f"{,.orig}
perl -e \
'use strict;
use File::Slurp;
my $text=read_file(\*STDIN);
$text=~s#(\bDEBUG\s*\([^(]+)\((.*?)\)\s*\)\s*;#$1$2);#gs;
print $text;' < "$f.orig" > "$f"
rm "$f.orig"
done
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'src/util/util.h')
-rw-r--r-- | src/util/util.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/util.h b/src/util/util.h index 9cc53f880..207d603c9 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -126,7 +126,7 @@ errno_t set_debug_file_from_fd(const int fd); newline-terminated message \param ... the debug message format arguments */ -#define DEBUG(level, format, ...) do { \ +#define DEBUGlevel, format, ...) do { \ int __debug_macro_newlevel = debug_get_level(level); \ if (DEBUG_IS_SET(__debug_macro_newlevel)) \ debug_fn(__FUNCTION__, __debug_macro_newlevel, format, ##__VA_ARGS__); \ @@ -173,7 +173,7 @@ errno_t set_debug_file_from_fd(const int fd); #define FLAGS_PID_FILE 0x0004 #ifndef talloc_zfree -#define talloc_zfree(ptr) do { talloc_free(discard_const(ptr)); ptr = NULL; } while(0) +#define talloc_zfree(ptr) do { talloc_free(discard_const(ptr); ptr = NULL; } while(0) #endif #ifndef discard_const_p |