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/sbus/sssd_dbus_common.c | |
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/sbus/sssd_dbus_common.c')
-rw-r--r-- | src/sbus/sssd_dbus_common.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/sbus/sssd_dbus_common.c b/src/sbus/sssd_dbus_common.c index baf74ec54..d754ed6bc 100644 --- a/src/sbus/sssd_dbus_common.c +++ b/src/sbus/sssd_dbus_common.c @@ -130,7 +130,7 @@ dbus_bool_t sbus_add_watch(DBusWatch *dbus_watch, void *data) /* does not exist, allocate new one */ watch = talloc_zero(conn, struct sbus_watch_ctx); if (!watch) { - DEBUG(0, ("Out of Memory!\n")); + DEBUG(0, "Out of Memory!\n"); return FALSE; } watch->conn = conn; @@ -170,7 +170,7 @@ dbus_bool_t sbus_add_watch(DBusWatch *dbus_watch, void *data) watch, fd, event_flags, sbus_watch_handler, watch); if (!watch->fde) { - DEBUG(0, ("Failed to set up fd event!\n")); + DEBUG(0, "Failed to set up fd event!\n"); talloc_zfree(watch); return FALSE; } @@ -178,11 +178,11 @@ dbus_bool_t sbus_add_watch(DBusWatch *dbus_watch, void *data) DLIST_ADD(conn->watch_list, watch); talloc_set_destructor((TALLOC_CTX *)watch, watch_destructor); - DEBUG(8, ("%p/%p (%d), %s/%s (%s)\n", + DEBUG(8, "%p/%p (%d), %s/%s (%s)\n", watch, dbus_watch, fd, ((flags & DBUS_WATCH_READABLE)?"R":"-"), ((flags & DBUS_WATCH_WRITABLE)?"W":"-"), - enabled?"enabled":"disabled")); + enabled?"enabled":"disabled"); return TRUE; } @@ -206,7 +206,7 @@ void sbus_toggle_watch(DBusWatch *dbus_watch, void *data) watch_data = dbus_watch_get_data(dbus_watch); watch = talloc_get_type(watch_data, struct sbus_watch_ctx); if (!watch) { - DEBUG(2, ("[%p] does not carry watch context?!\n", dbus_watch)); + DEBUG(2, "[%p] does not carry watch context?!\n", dbus_watch); /* abort ? */ return; } @@ -235,11 +235,11 @@ void sbus_toggle_watch(DBusWatch *dbus_watch, void *data) #endif } DEBUG(SSSDBG_TRACE_ALL, - ("%p/%p (%d), %s/%s (%s)\n", + "%p/%p (%d), %s/%s (%s)\n", watch, dbus_watch, fd, ((flags & DBUS_WATCH_READABLE)?"R":"-"), ((flags & DBUS_WATCH_WRITABLE)?"W":"-"), - enabled?"enabled":"disabled")); + enabled?"enabled":"disabled"); } /* @@ -255,10 +255,10 @@ void sbus_remove_watch(DBusWatch *dbus_watch, void *data) watch_data = dbus_watch_get_data(dbus_watch); watch = talloc_get_type(watch_data, struct sbus_watch_ctx); - DEBUG(8, ("%p/%p\n", watch, dbus_watch)); + DEBUG(8, "%p/%p\n", watch, dbus_watch); if (!watch) { - DEBUG(2, ("DBUS trying to remove unknown watch!\n")); + DEBUG(2, "DBUS trying to remove unknown watch!\n"); return; } @@ -314,7 +314,7 @@ dbus_bool_t sbus_add_timeout(DBusTimeout *dbus_timeout, void *data) struct sbus_timeout_ctx *timeout; struct timeval tv; - DEBUG(8, ("%p\n", dbus_timeout)); + DEBUG(8, "%p\n", dbus_timeout); if (!dbus_timeout_get_enabled(dbus_timeout)) { return TRUE; @@ -324,7 +324,7 @@ dbus_bool_t sbus_add_timeout(DBusTimeout *dbus_timeout, void *data) timeout = talloc_zero(conn, struct sbus_timeout_ctx); if (!timeout) { - DEBUG(0, ("Out of Memory!\n")); + DEBUG(0, "Out of Memory!\n"); return FALSE; } timeout->dbus_timeout = dbus_timeout; @@ -333,7 +333,7 @@ dbus_bool_t sbus_add_timeout(DBusTimeout *dbus_timeout, void *data) timeout->te = tevent_add_timer(conn->ev, timeout, tv, sbus_timeout_handler, timeout); if (!timeout->te) { - DEBUG(0, ("Failed to set up timeout event!\n")); + DEBUG(0, "Failed to set up timeout event!\n"); return FALSE; } @@ -350,7 +350,7 @@ dbus_bool_t sbus_add_timeout(DBusTimeout *dbus_timeout, void *data) */ void sbus_toggle_timeout(DBusTimeout *dbus_timeout, void *data) { - DEBUG(8, ("%p\n", dbus_timeout)); + DEBUG(8, "%p\n", dbus_timeout); if (dbus_timeout_get_enabled(dbus_timeout)) { sbus_add_timeout(dbus_timeout, data); @@ -367,7 +367,7 @@ void sbus_remove_timeout(DBusTimeout *dbus_timeout, void *data) { void *timeout; - DEBUG(8, ("%p\n", dbus_timeout)); + DEBUG(8, "%p\n", dbus_timeout); timeout = dbus_timeout_get_data(dbus_timeout); |