[libvirt] [PATCH] maint: drop spurious semicolons

Eric Blake eblake at redhat.com
Mon Aug 25 22:31:07 UTC 2014


I noticed a line 'int nparams = 0;;' in remote_dispatch.h, and
tracked down where it was generated.  While at it, I found a
couple of other double semicolons.  Additionally, I noticed that
commit df0b57a95 left a stale reference to the file name
remote_dispatch_bodies.h.

* src/conf/numatune_conf.c (virDomainNumatuneNodeParseXML): Drop
empty statement.
* tests/virdbustest.c (testMessageStruct, testMessageSimple):
Likewise.
* src/rpc/gendispatch.pl (remote_dispatch_bodies.h): Likewise, and
update stale comments.

Signed-off-by: Eric Blake <eblake at redhat.com>
---

Pushing under the trivial rule.

Syntax check can't easily catch this, because we want to allow
'for (int i = 0;; i++)' on a loop that uses break to exit, so
this is just done by manual inspection.

 src/conf/numatune_conf.c | 2 +-
 src/rpc/gendispatch.pl   | 4 ++--
 tests/virdbustest.c      | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/conf/numatune_conf.c b/src/conf/numatune_conf.c
index ff0f3eb..21d9a64 100644
--- a/src/conf/numatune_conf.c
+++ b/src/conf/numatune_conf.c
@@ -81,7 +81,7 @@ virDomainNumatuneNodeParseXML(virDomainNumatunePtr *numatunePtr,
                               xmlXPathContextPtr ctxt)
 {
     char *tmp = NULL;
-    int n = 0;;
+    int n = 0;
     int ret = -1;
     size_t i = 0;
     virDomainNumatunePtr numatune = *numatunePtr;
diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl
index d820d0e..27093d2 100755
--- a/src/rpc/gendispatch.pl
+++ b/src/rpc/gendispatch.pl
@@ -380,7 +380,7 @@ if ($mode eq "debug") {
     }
 }

-# Bodies for dispatch functions ("remote_dispatch_bodies.h").
+# Bodies for dispatch functions ("remote_dispatch.h").
 elsif ($mode eq "server") {
     my %generate = map { $_ => 1 } @autogen;
     my @keys = sort (keys %calls);
@@ -537,7 +537,7 @@ elsif ($mode eq "server") {
                     push(@args_list, "args->$1.$1_len");
                 } elsif ($args_member =~ m/^remote_typed_param (\S+)<(\S+)>;/) {
                     push(@vars_list, "virTypedParameterPtr $1 = NULL");
-                    push(@vars_list, "int n$1 = 0;");
+                    push(@vars_list, "int n$1 = 0");
                     if ($call->{ProcName} eq "NodeSetMemoryParameters") {
                         push(@args_list, "priv->conn");
                     }
diff --git a/tests/virdbustest.c b/tests/virdbustest.c
index a798fbe..0079b41 100644
--- a/tests/virdbustest.c
+++ b/tests/virdbustest.c
@@ -62,7 +62,7 @@ static int testMessageSimple(const void *args ATTRIBUTE_UNUSED)
     unsigned int in_uint32 = 200000000, out_uint32 = 0;
     long long in_int64 = 1000000000000LL, out_int64 = 0;
     unsigned long long in_uint64 = 2000000000000LL, out_uint64 = 0;
-    double in_double = 3.14159265359, out_double = 0;;
+    double in_double = 3.14159265359, out_double = 0;
     const char *in_string = "Hello World";
     char *out_string = NULL;
     const char *in_objectpath = "/org/libvirt/test";
@@ -338,7 +338,7 @@ static int testMessageStruct(const void *args ATTRIBUTE_UNUSED)
     unsigned int in_uint32 = 200000000, out_uint32 = 0;
     long long in_int64 = -1000000000000LL, out_int64 = 0;
     unsigned long long in_uint64 = 2000000000000LL, out_uint64 = 0;
-    double in_double = 3.14159265359, out_double = 0;;
+    double in_double = 3.14159265359, out_double = 0;
     const char *in_string = "Hello World";
     char *out_string = NULL;
     const char *in_objectpath = "/org/libvirt/test";
-- 
1.9.3




More information about the libvir-list mailing list