Remove spurious whitespace between function name & open brackets

The libvirt coding standard is to use 'function(...args...)'
instead of 'function (...args...)'. A non-trivial number of
places did not follow this rule and are fixed in this patch.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2012-10-17 10:23:12 +01:00
parent 0211fd6e04
commit 1c04f99970
114 changed files with 1923 additions and 1928 deletions

View File

@ -885,41 +885,42 @@ static void
daemonUsage(const char *argv0, bool privileged)
{
fprintf(stderr,
_("\n\
Usage:\n\
%s [options]\n\
\n\
Options:\n\
-v | --verbose Verbose messages.\n\
-d | --daemon Run as a daemon & write PID file.\n\
-l | --listen Listen for TCP/IP connections.\n\
-t | --timeout <secs> Exit after timeout period.\n\
-f | --config <file> Configuration file.\n\
| --version Display version information.\n\
-p | --pid-file <file> Change name of PID file.\n\
\n\
libvirt management daemon:\n"), argv0);
_("\n"
"Usage:\n"
" %s [options]\n"
"\n"
"Options:\n"
" -v | --verbose Verbose messages.\n"
" -d | --daemon Run as a daemon & write PID file.\n"
" -l | --listen Listen for TCP/IP connections.\n"
" -t | --timeout <secs> Exit after timeout period.\n"
" -f | --config <file> Configuration file.\n"
" | --version Display version information.\n"
" -p | --pid-file <file> Change name of PID file.\n"
"\n"
"libvirt management daemon:\n"),
argv0);
if (privileged) {
fprintf(stderr,
_("\n\
Default paths:\n\
\n\
Configuration file (unless overridden by -f):\n\
%s/libvirt/libvirtd.conf\n\
\n\
Sockets:\n\
%s/run/libvirt/libvirt-sock\n\
%s/run/libvirt/libvirt-sock-ro\n\
\n\
TLS:\n\
CA certificate: %s/pki/CA/caert.pem\n\
Server certificate: %s/pki/libvirt/servercert.pem\n\
Server private key: %s/pki/libvirt/private/serverkey.pem\n\
\n\
PID file (unless overridden by -p):\n\
%s/run/libvirtd.pid\n\
\n"),
_("\n"
" Default paths:\n"
"\n"
" Configuration file (unless overridden by -f):\n"
" %s/libvirt/libvirtd.conf\n"
"\n"
" Sockets:\n"
" %s/run/libvirt/libvirt-sock\n"
" %s/run/libvirt/libvirt-sock-ro\n"
"\n"
" TLS:\n"
" CA certificate: %s/pki/CA/caert.pem\n"
" Server certificate: %s/pki/libvirt/servercert.pem\n"
" Server private key: %s/pki/libvirt/private/serverkey.pem\n"
"\n"
" PID file (unless overridden by -p):\n"
" %s/run/libvirtd.pid\n"
"\n"),
SYSCONFDIR,
LOCALSTATEDIR,
LOCALSTATEDIR,
@ -928,24 +929,24 @@ libvirt management daemon:\n"), argv0);
SYSCONFDIR,
LOCALSTATEDIR);
} else {
fprintf(stderr,
"%s", _("\n\
Default paths:\n\
\n\
Configuration file (unless overridden by -f):\n\
$XDG_CONFIG_HOME/libvirt/libvirtd.conf\n\
\n\
Sockets:\n\
$XDG_RUNTIME_DIR/libvirt/libvirt-sock\n\
\n\
TLS:\n\
CA certificate: $HOME/.pki/libvirt/cacert.pem\n\
Server certificate: $HOME/.pki/libvirt/servercert.pem\n\
Server private key: $HOME/.pki/libvirt/serverkey.pem\n\
\n\
PID file:\n\
$XDG_RUNTIME_DIR/libvirt/libvirtd.pid\n\
\n"));
fprintf(stderr, "%s",
_("\n"
" Default paths:\n"
"\n"
" Configuration file (unless overridden by -f):\n"
" $XDG_CONFIG_HOME/libvirt/libvirtd.conf\n"
"\n"
" Sockets:\n"
" $XDG_RUNTIME_DIR/libvirt/libvirt-sock\n"
"\n"
" TLS:\n"
" CA certificate: $HOME/.pki/libvirt/cacert.pem\n"
" Server certificate: $HOME/.pki/libvirt/servercert.pem\n"
" Server private key: $HOME/.pki/libvirt/serverkey.pem\n"
"\n"
" PID file:\n"
" $XDG_RUNTIME_DIR/libvirt/libvirtd.pid\n"
"\n"));
}
}

View File

@ -269,7 +269,7 @@ winsock_init (void)
#endif
static int virTLSMutexInit(void **priv)
{ \
{
virMutexPtr lock = NULL;
if (VIR_ALLOC(lock) < 0)

View File

@ -1721,7 +1721,7 @@ static int lxcContainerDropCapabilities(bool keepReboot ATTRIBUTE_UNUSED)
CAP_AUDIT_CONTROL, /* No messing with auditing status */
CAP_MAC_ADMIN, /* No messing with LSM config */
keepReboot ? -1 : CAP_SYS_BOOT, /* No use of reboot */
-1 /* sentinal */)) < 0) {
-1)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to remove capabilities: %d"), ret);
return -1;

View File

@ -459,23 +459,23 @@ cleanup:
static unsigned long
qedGetHeaderUL(const unsigned char *loc)
{
return ( ((unsigned long)loc[3] << 24)
| ((unsigned long)loc[2] << 16)
| ((unsigned long)loc[1] << 8)
| ((unsigned long)loc[0] << 0));
return (((unsigned long)loc[3] << 24) |
((unsigned long)loc[2] << 16) |
((unsigned long)loc[1] << 8) |
((unsigned long)loc[0] << 0));
}
static unsigned long long
qedGetHeaderULL(const unsigned char *loc)
{
return ( ((unsigned long long)loc[7] << 56)
| ((unsigned long long)loc[6] << 48)
| ((unsigned long long)loc[5] << 40)
| ((unsigned long long)loc[4] << 32)
| ((unsigned long long)loc[3] << 24)
| ((unsigned long long)loc[2] << 16)
| ((unsigned long long)loc[1] << 8)
| ((unsigned long long)loc[0] << 0));
return (((unsigned long long)loc[7] << 56) |
((unsigned long long)loc[6] << 48) |
((unsigned long long)loc[5] << 40) |
((unsigned long long)loc[4] << 32) |
((unsigned long long)loc[3] << 24) |
((unsigned long long)loc[2] << 16) |
((unsigned long long)loc[1] << 8) |
((unsigned long long)loc[0] << 0));
}
static int

View File

@ -290,13 +290,9 @@ virSocketAddrSetPort(virSocketAddrPtr addr, int port) {
if (addr->data.stor.ss_family == AF_INET) {
addr->data.inet4.sin_port = port;
}
else if(addr->data.stor.ss_family == AF_INET6) {
} else if (addr->data.stor.ss_family == AF_INET6) {
addr->data.inet6.sin6_port = port;
}
else {
} else {
return -1;
}
@ -317,9 +313,7 @@ virSocketAddrGetPort(virSocketAddrPtr addr) {
if (addr->data.stor.ss_family == AF_INET) {
return ntohs(addr->data.inet4.sin_port);
}
else if(addr->data.stor.ss_family == AF_INET6) {
} else if (addr->data.stor.ss_family == AF_INET6) {
return ntohs(addr->data.inet6.sin6_port);
}

View File

@ -594,12 +594,12 @@ static char *vboxGenerateMediumName(PRUint32 storageBus,
PRUint32 maxPortPerInst = 0;
PRUint32 maxSlotPerPort = 0;
if ( !aMaxPortPerInst
|| !aMaxSlotPerPort)
if (!aMaxPortPerInst ||
!aMaxSlotPerPort)
return NULL;
if ( (storageBus < StorageBus_IDE)
|| (storageBus > StorageBus_Floppy))
if ((storageBus < StorageBus_IDE) ||
(storageBus > StorageBus_Floppy))
return NULL;
maxPortPerInst = aMaxPortPerInst[storageBus];
@ -610,8 +610,8 @@ static char *vboxGenerateMediumName(PRUint32 storageBus,
if (storageBus == StorageBus_IDE) {
prefix = "hd";
} else if ( (storageBus == StorageBus_SATA)
|| (storageBus == StorageBus_SCSI)) {
} else if ((storageBus == StorageBus_SATA) ||
(storageBus == StorageBus_SCSI)) {
prefix = "sd";
} else if (storageBus == StorageBus_Floppy) {
prefix = "fd";
@ -653,16 +653,16 @@ static bool vboxGetDeviceDetails(const char *deviceName,
PRUint32 maxPortPerInst = 0;
PRUint32 maxSlotPerPort = 0;
if ( !deviceName
|| !deviceInst
|| !devicePort
|| !deviceSlot
|| !aMaxPortPerInst
|| !aMaxSlotPerPort)
if (!deviceName ||
!deviceInst ||
!devicePort ||
!deviceSlot ||
!aMaxPortPerInst ||
!aMaxSlotPerPort)
return false;
if ( (storageBus < StorageBus_IDE)
|| (storageBus > StorageBus_Floppy))
if ((storageBus < StorageBus_IDE) ||
(storageBus > StorageBus_Floppy))
return false;
total = virDiskNameToIndex(deviceName);
@ -670,9 +670,9 @@ static bool vboxGetDeviceDetails(const char *deviceName,
maxPortPerInst = aMaxPortPerInst[storageBus];
maxSlotPerPort = aMaxSlotPerPort[storageBus];
if ( !maxPortPerInst
|| !maxSlotPerPort
|| (total < 0))
if (!maxPortPerInst ||
!maxSlotPerPort ||
(total < 0))
return false;
*deviceInst = total / (maxPortPerInst * maxSlotPerPort);
@ -1135,8 +1135,8 @@ static int vboxListDomains(virConnectPtr conn, int *ids, int nids) {
machine->vtbl->GetAccessible(machine, &isAccessible);
if (isAccessible) {
machine->vtbl->GetState(machine, &state);
if ( (state >= MachineState_FirstOnline)
&& (state <= MachineState_LastOnline) ) {
if ((state >= MachineState_FirstOnline) &&
(state <= MachineState_LastOnline)) {
ret++;
ids[j++] = i + 1;
}
@ -1172,8 +1172,8 @@ static int vboxNumOfDomains(virConnectPtr conn) {
machine->vtbl->GetAccessible(machine, &isAccessible);
if (isAccessible) {
machine->vtbl->GetState(machine, &state);
if ( (state >= MachineState_FirstOnline)
&& (state <= MachineState_LastOnline) )
if ((state >= MachineState_FirstOnline) &&
(state <= MachineState_LastOnline))
ret++;
}
}
@ -1243,8 +1243,8 @@ static virDomainPtr vboxDomainLookupByID(virConnectPtr conn, int id) {
machine->vtbl->GetAccessible(machine, &isAccessible);
if (isAccessible) {
machine->vtbl->GetState(machine, &state);
if ( (state >= MachineState_FirstOnline)
&& (state <= MachineState_LastOnline) ) {
if ((state >= MachineState_FirstOnline) &&
(state <= MachineState_LastOnline)) {
PRUnichar *machineNameUtf16 = NULL;
char *machineNameUtf8 = NULL;
@ -1329,9 +1329,9 @@ static virDomainPtr vboxDomainLookupByUUID(virConnectPtr conn, const unsigned ch
*/
ret = virGetDomain(conn, machineNameUtf8, iid_as_uuid);
if ( ret
&& (state >= MachineState_FirstOnline)
&& (state <= MachineState_LastOnline) )
if (ret &&
(state >= MachineState_FirstOnline) &&
(state <= MachineState_LastOnline))
ret->id = i + 1;
}
@ -1397,9 +1397,9 @@ static virDomainPtr vboxDomainLookupByName(virConnectPtr conn, const char *name)
*/
ret = virGetDomain(conn, machineNameUtf8, uuid);
if ( ret
&& (state >= MachineState_FirstOnline)
&& (state <= MachineState_LastOnline) )
if (ret &&
(state >= MachineState_FirstOnline) &&
(state <= MachineState_LastOnline))
ret->id = i + 1;
}
@ -1466,8 +1466,8 @@ static int vboxDomainIsActive(virDomainPtr dom) {
machine->vtbl->GetState(machine, &state);
if ( (state >= MachineState_FirstOnline)
&& (state <= MachineState_LastOnline) )
if ((state >= MachineState_FirstOnline) &&
(state <= MachineState_LastOnline))
ret = 1;
else
ret = 0;
@ -3462,8 +3462,8 @@ static int vboxListDefinedDomains(virConnectPtr conn, char ** const names, int m
machine->vtbl->GetAccessible(machine, &isAccessible);
if (isAccessible) {
machine->vtbl->GetState(machine, &state);
if ( (state < MachineState_FirstOnline)
|| (state > MachineState_LastOnline) ) {
if ((state < MachineState_FirstOnline) ||
(state > MachineState_LastOnline)) {
machine->vtbl->GetName(machine, &machineNameUtf16);
VBOX_UTF16_TO_UTF8(machineNameUtf16, &machineName);
names[j] = strdup(machineName);
@ -3512,8 +3512,8 @@ static int vboxNumOfDefinedDomains(virConnectPtr conn) {
machine->vtbl->GetAccessible(machine, &isAccessible);
if (isAccessible) {
machine->vtbl->GetState(machine, &state);
if ( (state < MachineState_FirstOnline)
|| (state > MachineState_LastOnline) ) {
if ((state < MachineState_FirstOnline) ||
(state > MachineState_LastOnline)) {
ret++;
}
}
@ -7174,8 +7174,8 @@ vboxCallbackQueryInterface(nsISupports *pThis, const nsID *iid, void **resultp)
static const nsID isupportIID = NS_ISUPPORTS_IID;
/* Match UUID for IVirtualBoxCallback class */
if ( memcmp(iid, &ivirtualboxCallbackUUID, sizeof(nsID)) == 0
|| memcmp(iid, &isupportIID, sizeof(nsID)) == 0) {
if (memcmp(iid, &ivirtualboxCallbackUUID, sizeof(nsID)) == 0 ||
memcmp(iid, &isupportIID, sizeof(nsID)) == 0) {
g_pVBoxGlobalData->vboxCallBackRefCount++;
*resultp = that;
@ -7723,9 +7723,9 @@ static virNetworkPtr vboxNetworkDefineCreateXML(virConnectPtr conn, const char *
virNetworkIpDefPtr ipdef;
virSocketAddr netmask;
if ( (!def)
|| (def->forwardType != VIR_NETWORK_FORWARD_NONE)
|| (def->nips == 0 || !def->ips))
if ((!def) ||
(def->forwardType != VIR_NETWORK_FORWARD_NONE) ||
(def->nips == 0 || !def->ips))
goto cleanup;
/* Look for the first IPv4 IP address definition and use that.
@ -8628,8 +8628,8 @@ static virStorageVolPtr vboxStorageVolCreateXML(virStoragePoolPtr pool,
if ((def = virStorageVolDefParseString(&poolDef, xml)) == NULL)
goto cleanup;
if ( !def->name
|| (def->type != VIR_STORAGE_VOL_FILE))
if (!def->name ||
(def->type != VIR_STORAGE_VOL_FILE))
goto cleanup;
/* TODO: for now only the vmdk, vpc and vdi type harddisk

View File

@ -36,7 +36,7 @@ testTypes(const void *data ATTRIBUTE_UNUSED)
bool res;
#define virAssertCmpInt(a, op, b) \
if (!((a) op (b))) \
if (!(a op b)) \
return -1;
virAtomicIntSet(&u, 5);
u2 = virAtomicIntGet(&u);