]> xenbits.xensource.com Git - libvirt.git/commitdiff
maint: use hanging curly braces
authorEric Blake <eblake@redhat.com>
Wed, 3 Sep 2014 22:24:43 +0000 (16:24 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 4 Sep 2014 21:18:43 +0000 (15:18 -0600)
Our style overwhelmingly uses hanging braces (the open brace
hangs at the end of the compound condition, rather than on
its own line), with the primary exception of the top level function
body.  Fix the few remaining outliers, before adding a syntax
check in a later patch.

* src/interface/interface_backend_netcf.c (netcfStateReload)
(netcfInterfaceClose, netcf_to_vir_err): Correct use of { in
compound statement.
* src/conf/domain_conf.c (virDomainHostdevDefFormatSubsys)
(virDomainHostdevDefFormatCaps): Likewise.
* src/network/bridge_driver.c (networkAllocateActualDevice):
Likewise.
* src/util/virfile.c (virBuildPathInternal): Likewise.
* src/util/virnetdev.c (virNetDevGetVirtualFunctions): Likewise.
* src/util/virnetdevmacvlan.c
(virNetDevMacVLanVPortProfileCallback): Likewise.
* src/util/virtypedparam.c (virTypedParameterAssign): Likewise.
* src/util/virutil.c (virGetWin32DirectoryRoot)
(virFileWaitForDevices): Likewise.
* src/vbox/vbox_common.c (vboxDumpNetwork): Likewise.
* tests/seclabeltest.c (main): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/conf/domain_conf.c
src/interface/interface_backend_netcf.c
src/network/bridge_driver.c
src/util/virfile.c
src/util/virnetdev.c
src/util/virnetdevmacvlan.c
src/util/virtypedparam.c
src/util/virutil.c
src/vbox/vbox_common.c
tests/seclabeltest.c

index 508de2184481a586ef96dfddf69a9258311b3426..efc2eb02869bbfb4067e9738254990c79b29a056 100644 (file)
@@ -16068,8 +16068,7 @@ virDomainHostdevDefFormatSubsys(virBufferPtr buf,
     virBufferAddLit(buf, ">\n");
 
     virBufferAdjustIndent(buf, 2);
-    switch (def->source.subsys.type)
-    {
+    switch (def->source.subsys.type) {
     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB:
         if (usbsrc->vendor) {
             virBufferAsprintf(buf, "<vendor id='0x%.4x'/>\n", usbsrc->vendor);
@@ -16146,8 +16145,7 @@ virDomainHostdevDefFormatCaps(virBufferPtr buf,
     virBufferAddLit(buf, "<source>\n");
 
     virBufferAdjustIndent(buf, 2);
-    switch (def->source.caps.type)
-    {
+    switch (def->source.caps.type) {
     case VIR_DOMAIN_HOSTDEV_CAPS_TYPE_STORAGE:
         virBufferEscapeString(buf, "<block>%s</block>\n",
                               def->source.caps.u.storage.block);
index 1b9ace533056e7a2422f86350c429de8b66243f7..c55a080082f924f0877e48e1cc09e53bc8482782 100644 (file)
@@ -126,8 +126,7 @@ netcfStateReload(void)
 
     virObjectLock(driverState);
     ncf_close(driverState->netcf);
-    if (ncf_init(&driverState->netcf, NULL) != 0)
-    {
+    if (ncf_init(&driverState->netcf, NULL) != 0) {
         /* this isn't a good situation, because we can't shut down the
          * driver as there may still be connections to it. If we set
          * the netcf handle to NULL, any subsequent calls to netcf
@@ -178,8 +177,7 @@ netcfGetMinimalDefForDevice(struct netcf_if *iface)
 
 static int netcf_to_vir_err(int netcf_errcode)
 {
-    switch (netcf_errcode)
-    {
+    switch (netcf_errcode) {
         case NETCF_NOERROR:
             /* no error, everything ok */
             return VIR_ERR_OK;
@@ -285,8 +283,7 @@ static int
 netcfInterfaceClose(virConnectPtr conn)
 {
 
-    if (conn->interfacePrivateData != NULL)
-    {
+    if (conn->interfacePrivateData != NULL) {
         virObjectUnref(conn->interfacePrivateData);
         conn->interfacePrivateData = NULL;
     }
index 2886866a7d5eaad2f232c48433c9f6e354443bb4..0bc4a4dd010ac9e8738cfdc37414b4a39c5348e9 100644 (file)
@@ -3871,8 +3871,7 @@ networkAllocateActualDevice(virDomainDefPtr dom,
         iface->data.network.actual->data.hostdev.def.source.subsys.type = dev->type;
         iface->data.network.actual->data.hostdev.def.source.subsys.u.pci.addr = dev->device.pci;
 
-        switch (netdef->forward.driverName)
-        {
+        switch (netdef->forward.driverName) {
         case VIR_NETWORK_FORWARD_DRIVER_NAME_DEFAULT:
             backend = VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT;
             break;
index b6f5e3f2cbbcc6768d764009b238b2349bee3fee..cfb6cc10246a1926bd7a381153c6cd75ec94c444 100644 (file)
@@ -1172,8 +1172,7 @@ virBuildPathInternal(char **path, ...)
     path_component = va_arg(ap, char *);
     virBufferAdd(&buf, path_component, -1);
 
-    while ((path_component = va_arg(ap, char *)) != NULL)
-    {
+    while ((path_component = va_arg(ap, char *)) != NULL) {
         virBufferAddChar(&buf, '/');
         virBufferAdd(&buf, path_component, -1);
     }
index 6a8c6aef839042a58d38abd55643c92bc331ff91..8815e1881958cf019f70286ca38c02b46c3a4309 100644 (file)
@@ -1132,8 +1132,7 @@ virNetDevGetVirtualFunctions(const char *pfname,
     if (VIR_ALLOC_N(*vfname, *n_vfname) < 0)
         goto cleanup;
 
-    for (i = 0; i < *n_vfname; i++)
-    {
+    for (i = 0; i < *n_vfname; i++) {
         if (virPCIGetAddrString((*virt_fns)[i]->domain,
                                 (*virt_fns)[i]->bus,
                                 (*virt_fns)[i]->slot,
index 50aabc58cca8d324a3a41e403c1d05b893e54d9b..c83341c0d7806040ce4d73eca3ed059e2f63c5b7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2013 Red Hat, Inc.
+ * Copyright (C) 2010-2014 Red Hat, Inc.
  * Copyright (C) 2010-2012 IBM Corporation
  *
  * This library is free software; you can redistribute it and/or
@@ -583,8 +583,7 @@ virNetDevMacVLanVPortProfileCallback(struct nlmsghdr *hdr,
             VIR_DEBUG("IFLA_VF_MAC = %2x:%2x:%2x:%2x:%2x:%2x",
                       m[0], m[1], m[2], m[3], m[4], m[5]);
 
-            if (virMacAddrCmpRaw(&calld->macaddress, mac->mac))
-            {
+            if (virMacAddrCmpRaw(&calld->macaddress, mac->mac)) {
                 /* Repeat the same check for a broadcast mac */
                 size_t i;
 
index 668a7df8eeb32b86aca22b8be93c39039fbaa597..de2d447fd8ae89ac5e5c8798e283087dd9acd078 100644 (file)
@@ -195,8 +195,7 @@ virTypedParameterAssign(virTypedParameterPtr param, const char *name,
         goto cleanup;
     }
     param->type = type;
-    switch (type)
-    {
+    switch (type) {
     case VIR_TYPED_PARAM_INT:
         param->value.i = va_arg(ap, int);
         break;
index 2edbec5c5dc510e8befe4ee7b85e96732740da15..04113bbe554dac35e0a3c53d2bc13075b866555b 100644 (file)
@@ -1153,8 +1153,7 @@ virGetWin32DirectoryRoot(char **path)
 
     *path = NULL;
 
-    if (GetWindowsDirectory(windowsdir, ARRAY_CARDINALITY(windowsdir)))
-    {
+    if (GetWindowsDirectory(windowsdir, ARRAY_CARDINALITY(windowsdir))) {
         const char *tmp;
         /* Usually X:\Windows, but in terminal server environments
          * might be an UNC path, AFAIK.
@@ -1499,8 +1498,7 @@ void virFileWaitForDevices(void)
      * If this fails for any reason, we still have the backup of polling for
      * 5 seconds for device nodes.
      */
-    if (virRun(settleprog, &exitstatus) < 0)
-    {}
+    ignore_value(virRun(settleprog, &exitstatus));
 }
 #else
 void virFileWaitForDevices(void)
index eecfff6c041e510b779f5c522b4dbe4bdea36500..b9858ee0e803f48a33e466d83dc69f28d710772d 100644 (file)
@@ -3576,8 +3576,8 @@ vboxDumpNetwork(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine, PR
                          MACAddress[8], MACAddress[9], MACAddress[10], MACAddress[11]);
 
                 /* XXX some real error handling here some day ... */
-                if (virMacAddrParse(macaddr, &def->nets[netAdpIncCnt]->mac) < 0)
-                {}
+                ignore_value(virMacAddrParse(macaddr,
+                                             &def->nets[netAdpIncCnt]->mac));
 
                 netAdpIncCnt++;
 
index cd34b6b57c869a383eccd7901864ab471f384111..51765c9ec4b843b5cdf324d68d1f02eb8113cf76 100644 (file)
@@ -24,16 +24,14 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
     }
 
     model = virSecurityManagerGetModel(mgr);
-    if (!model)
-    {
+    if (!model) {
         fprintf(stderr, "Failed to copy secModel model: %s",
                 strerror(errno));
         return EXIT_FAILURE;
     }
 
     doi = virSecurityManagerGetDOI(mgr);
-    if (!doi)
-    {
+    if (!doi) {
         fprintf(stderr, "Failed to copy secModel DOI: %s",
                 strerror(errno));
         return EXIT_FAILURE;