From: Eric Blake Date: Tue, 19 Nov 2013 22:50:56 +0000 (-0700) Subject: maint: fix comma style issues: tests, tools X-Git-Tag: v1.2.0-rc1~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57682aea3697f50095629088ec6098841792897e;p=thirdparty%2Flibvirt.git maint: fix comma style issues: tests, tools Most of our code base uses space after comma but not before; fix the remaining uses before adding a syntax check. * tests/sysinfotest.c: Consistently use commas. * tests/viratomictest.c: Likewise. * tests/vircgroupmock.c: Likewise. * tools/virsh-domain.c: Likewise. * tools/virsh-volume.c: Likewise. Signed-off-by: Eric Blake --- diff --git a/tests/sysinfotest.c b/tests/sysinfotest.c index 6d287b1c7e..83577012b8 100644 --- a/tests/sysinfotest.c +++ b/tests/sysinfotest.c @@ -1,6 +1,7 @@ /* * sysinfotest.c: Testcase(s) for virSysinfoRead * + * Copyright (C) 2013 Red Hat, Inc. * Copyright IBM Corp. 2012 * * This library is free software; you can redistribute it and/or @@ -75,7 +76,7 @@ testSysinfo(const void *data) goto cleanup; } - if (virSysinfoFormat(&buf,ret) < 0) + if (virSysinfoFormat(&buf, ret) < 0) goto cleanup; if (!(sysfsActualData = virBufferCurrentContent(&buf))) diff --git a/tests/viratomictest.c b/tests/viratomictest.c index d092b95b15..49dd388332 100644 --- a/tests/viratomictest.c +++ b/tests/viratomictest.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2012 Red Hat, Inc. + * Copyright (C) 2011-2013 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -123,7 +123,7 @@ thread_func(void *data) bucket[idx] += d; virAtomicIntAdd(&atomic, d); #ifdef WIN32 - SleepEx(0,0); + SleepEx(0, 0); #else sched_yield(); #endif diff --git a/tests/vircgroupmock.c b/tests/vircgroupmock.c index 3167a5ced3..6542973f88 100644 --- a/tests/vircgroupmock.c +++ b/tests/vircgroupmock.c @@ -399,7 +399,7 @@ static void init_sysfs(void) # define MAKE_CONTROLLER(subpath) \ do { \ char *path; \ - if (asprintf(&path,"%s/%s", fakesysfsdir, subpath) < 0) \ + if (asprintf(&path, "%s/%s", fakesysfsdir, subpath) < 0)\ abort(); \ if (make_controller(path, 0755) < 0) { \ fprintf(stderr, "Cannot initialize %s\n", path); \ diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 60abd3da9d..1fe138c5b4 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -2568,7 +2568,7 @@ cmdDomIftune(vshControl *ctl, const vshCmd *cmd) goto cleanup; if (vshCommandOptStringReq(ctl, cmd, "inbound", &inboundStr) < 0 || - vshCommandOptStringReq(ctl,cmd, "outbound", &outboundStr) < 0) + vshCommandOptStringReq(ctl, cmd, "outbound", &outboundStr) < 0) goto cleanup; memset(&inbound, 0, sizeof(inbound)); diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index 55a99d00f7..cbdb3f0fa2 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -1,7 +1,7 @@ /* * virsh-volume.c: Commands to manage storage volume * - * Copyright (C) 2005, 2007-2012 Red Hat, Inc. + * Copyright (C) 2005, 2007-2013 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -211,7 +211,7 @@ cmdVolCreateAs(vshControl *ctl, const vshCmd *cmd) if (format) { virBufferAddLit(&buf, " \n"); - virBufferAsprintf(&buf, " \n",format); + virBufferAsprintf(&buf, " \n", format); virBufferAddLit(&buf, " \n"); } @@ -265,9 +265,10 @@ cmdVolCreateAs(vshControl *ctl, const vshCmd *cmd) /* Create XML for the backing store */ virBufferAddLit(&buf, " \n"); - virBufferAsprintf(&buf, " %s\n",snapshotStrVolPath); + virBufferAsprintf(&buf, " %s\n", snapshotStrVolPath); if (snapshotStrFormat) - virBufferAsprintf(&buf, " \n",snapshotStrFormat); + virBufferAsprintf(&buf, " \n", + snapshotStrFormat); virBufferAddLit(&buf, " \n"); /* Cleanup snapshot allocations */