[libvirt] [PATCH] Fix more printf("%s", NULL) usage

# HG changeset patch # User john.levon@sun.com # Date 1233580871 28800 # Node ID e61a2e486a59394ea422d90e1104f805ceabd0be # Parent 430096efc257a704fdd6294829686d05f38da68e Fix more printf("%s", NULL) usage Signed-off-by: John Levon <john.levon@sun.com> diff --git a/src/libvirt.c b/src/libvirt.c --- a/src/libvirt.c +++ b/src/libvirt.c @@ -2871,7 +2871,9 @@ virDomainMigratePrepare (virConnectPtr d const char *dname, unsigned long bandwidth) { - DEBUG("dconn=%p, cookie=%p, cookielen=%p, uri_in=%s, uri_out=%p, flags=%lu, dname=%s, bandwidth=%lu", dconn, cookie, cookielen, uri_in, uri_out, flags, dname, bandwidth); + VIR_DEBUG("dconn=%p, cookie=%p, cookielen=%p, uri_in=%s, uri_out=%p, " + "flags=%lu, dname=%s, bandwidth=%lu", dconn, cookie, cookielen, + NULLSTR(uri_in), uri_out, flags, NULLSTR(dname), bandwidth); virResetLastError(); @@ -2917,7 +2919,9 @@ virDomainMigratePerform (virDomainPtr do unsigned long bandwidth) { virConnectPtr conn; - DEBUG("domain=%p, cookie=%p, cookielen=%d, uri=%s, flags=%lu, dname=%s, bandwidth=%lu", domain, cookie, cookielen, uri, flags, dname, bandwidth); + VIR_DEBUG("domain=%p, cookie=%p, cookielen=%d, uri=%s, flags=%lu, " + "dname=%s, bandwidth=%lu", domain, cookie, cookielen, uri, flags, + NULLSTR(dname), bandwidth); virResetLastError(); @@ -2962,7 +2966,8 @@ virDomainMigrateFinish (virConnectPtr dc const char *uri, unsigned long flags) { - DEBUG("dconn=%p, dname=%s, cookie=%p, cookielen=%d, uri=%s, flags=%lu", dconn, dname, cookie, cookielen, uri, flags); + VIR_DEBUG("dconn=%p, dname=%s, cookie=%p, cookielen=%d, uri=%s, " + "flags=%lu", dconn, NULLSTR(dname), cookie, cookielen, uri, flags); virResetLastError(); @@ -3010,7 +3015,9 @@ virDomainMigratePrepare2 (virConnectPtr unsigned long bandwidth, const char *dom_xml) { - DEBUG("dconn=%p, cookie=%p, cookielen=%p, uri_in=%s, uri_out=%p, flags=%lu, dname=%s, bandwidth=%lu, dom_xml=%s", dconn, cookie, cookielen, uri_in, uri_out, flags, dname, bandwidth, dom_xml); + VIR_DEBUG("dconn=%p, cookie=%p, cookielen=%p, uri_in=%s, uri_out=%p," + "flags=%lu, dname=%s, bandwidth=%lu, dom_xml=%s", dconn, cookie, + cookielen, uri_in, uri_out, flags, NULLSTR(dname), bandwidth, dom_xml); virResetLastError(); @@ -3056,7 +3063,9 @@ virDomainMigrateFinish2 (virConnectPtr d unsigned long flags, int retcode) { - DEBUG("dconn=%p, dname=%s, cookie=%p, cookielen=%d, uri=%s, flags=%lu, retcode=%d", dconn, dname, cookie, cookielen, uri, flags, retcode); + VIR_DEBUG("dconn=%p, dname=%s, cookie=%p, cookielen=%d, uri=%s, " + "flags=%lu, retcode=%d", dconn, NULLSTR(dname), cookie, + cookielen, uri, flags, retcode); virResetLastError();

john.levon@sun.com wrote:
diff --git a/src/libvirt.c b/src/libvirt.c --- a/src/libvirt.c +++ b/src/libvirt.c @@ -2871,7 +2871,9 @@ virDomainMigratePrepare (virConnectPtr d const char *dname, unsigned long bandwidth) { - DEBUG("dconn=%p, cookie=%p, cookielen=%p, uri_in=%s, uri_out=%p, flags=%lu, dname=%s, bandwidth=%lu", dconn, cookie, cookielen, uri_in, uri_out, flags, dname, bandwidth); + VIR_DEBUG("dconn=%p, cookie=%p, cookielen=%p, uri_in=%s, uri_out=%p, " + "flags=%lu, dname=%s, bandwidth=%lu", dconn, cookie, cookielen, + NULLSTR(uri_in), uri_out, flags, NULLSTR(dname), bandwidth);
virResetLastError();
ACK. Limited-width side-by-side comparators thank you for splitting the long lines. Thought note that we like continuation lines to be aligned with the opening parenthesis, i.e., VIR_DEBUG("dconn=%p, cookie=%p, cookielen=%p, uri_in=%s, uri_out=%p, " "flags=%lu, dname=%s, bandwidth=%lu", dconn, cookie, cookielen, NULLSTR(uri_in), uri_out, flags, NULLSTR(dname), bandwidth); because that's what most automatic indenters do.

On Mon, Feb 02, 2009 at 07:17:29PM +0100, Jim Meyering wrote:
Thought note that we like continuation lines to be aligned with the opening parenthesis, i.e.,
VIR_DEBUG("dconn=%p, cookie=%p, cookielen=%p, uri_in=%s, uri_out=%p, " "flags=%lu, dname=%s, bandwidth=%lu", dconn, cookie, cookielen, NULLSTR(uri_in), uri_out, flags, NULLSTR(dname), bandwidth);
OK I'll fix that (it's not Sun style because it just leads to more lines). regards john

On Mon, Feb 02, 2009 at 05:43:37AM -0800, john.levon@sun.com wrote:
# HG changeset patch # User john.levon@sun.com # Date 1233580871 28800 # Node ID e61a2e486a59394ea422d90e1104f805ceabd0be # Parent 430096efc257a704fdd6294829686d05f38da68e Fix more printf("%s", NULL) usage
Signed-off-by: John Levon <john.levon@sun.com>
ACK. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (4)
-
Daniel P. Berrange
-
Jim Meyering
-
John Levon
-
john.levon@sun.com