]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: silence compiler warning about signedness
authorEric Blake <eblake@redhat.com>
Fri, 26 Oct 2012 20:28:40 +0000 (14:28 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 26 Oct 2012 20:29:51 +0000 (14:29 -0600)
Commit 246143b fixed a warning on older gcc, but caused a warning
on newer gcc.

../../src/rpc/virnetserverservice.c: In function 'virNetServerServiceNewPostExecRestart':
../../src/rpc/virnetserverservice.c:277:41: error: pointer targets in passing argument 3 of 'virJSONValueObjectGetNumberUint' differ in signedness [-Werror=pointer-sign]

* src/rpc/virnetserverservice.c: Use correct types.

src/rpc/virnetserverservice.c

index 31a9424d81313aaa9b6afdc6eadce15d8fb47c43..a9362adaf5f87661ca4461866b9b92c6db8404fc 100644 (file)
@@ -256,6 +256,7 @@ virNetServerServicePtr virNetServerServiceNewPostExecRestart(virJSONValuePtr obj
     virJSONValuePtr socks;
     size_t i;
     int n;
+    unsigned int max;
 
     if (virNetServerServiceInitialize() < 0)
         return NULL;
@@ -274,12 +275,12 @@ virNetServerServicePtr virNetServerServiceNewPostExecRestart(virJSONValuePtr obj
         goto error;
     }
     if (virJSONValueObjectGetNumberUint(object, "nrequests_client_max",
-                                        &n) < 0) {
+                                        &max) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("Missing nrequests_client_max field in JSON state document"));
         goto error;
     }
-    svc->nrequests_client_max = n;
+    svc->nrequests_client_max = max;
 
     if (!(socks = virJSONValueObjectGet(object, "socks"))) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",