]> xenbits.xensource.com Git - libvirt.git/commitdiff
examples: Resolve sign-compare warnings
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 20 Dec 2016 09:29:52 +0000 (10:29 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 20 Dec 2016 12:11:25 +0000 (13:11 +0100)
For instance:

hellolibvirt/hellolibvirt.c: In function 'showDomains':
hellolibvirt/hellolibvirt.c:100:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (i = 0; i < numNames; i++) {
                   ^

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
examples/admin/client_info.c
examples/admin/client_limits.c
examples/admin/list_clients.c
examples/admin/list_servers.c
examples/admin/threadpool_params.c
examples/domsuspend/suspend.c
examples/domtop/domtop.c
examples/hellolibvirt/hellolibvirt.c
examples/openauth/openauth.c

index 314a0902be0aa09cded2fa2464f23056998f4d20..57e9cd71efca375adb9b4eb1393e2d8ff1ede367 100644 (file)
@@ -102,7 +102,7 @@ int main(int argc, char **argv)
     virAdmClientPtr clnt = NULL;   /* which client get identity for */
     virTypedParameterPtr params = NULL;     /* where to store identity info */
     int nparams = 0;
-    size_t i = 0;
+    ssize_t i = 0;
     char *timestr = NULL;
 
     if (argc != 3) {
index 2d5b7548965083c28fa2864c80d1dc508c584dbe..2a1d6314ca7f129d2393908c2b788063a7d85820 100644 (file)
@@ -9,7 +9,7 @@ int main(int argc, char **argv)
     virAdmServerPtr srv = NULL;     /* which server to work with */
     virTypedParameterPtr params = NULL;
     int nparams = 0;
-    size_t i;
+    ssize_t i;
 
     if (argc != 2) {
         fprintf(stderr, "One argument specifying the server which to work "
index 3b4496e3037533536dbcc2bea843873960ffdcbc..21ea4d818e5865e33abbbd8572c9869fe49b9ac8 100644 (file)
@@ -50,7 +50,7 @@ int main(int argc, char **argv)
     virAdmConnectPtr conn = NULL;
     virAdmServerPtr srv = NULL;      /* which server list the clients from */
     virAdmClientPtr *clients = NULL;    /* where to store the servers */
-    size_t i = 0;
+    ssize_t i = 0;
     int count = 0;
 
     if (argc != 2) {
index 1f6f4c6cf36c4a89d71656157f7727c3fd9298d9..420fd5fb7b60ee7492e5c8c93b29cd1f46337e6d 100644 (file)
@@ -8,7 +8,7 @@ int main(void)
     virAdmConnectPtr conn = NULL;
     virAdmServerPtr *servers = NULL;    /* where to store the servers */
     virAdmServerPtr *tmp = NULL;
-    size_t i = 0;
+    ssize_t i = 0;
     int count = 0;
 
     /* first, open a connection to the daemon */
index ee9ce83c1c3053ef1af4ff0ce4820c8f7f1ab178..43c71184a00f7edebfd424a579581d6e39f5c9eb 100644 (file)
@@ -9,7 +9,7 @@ int main(int argc, char **argv)
     virAdmServerPtr srv = NULL;     /* which server to work with */
     virTypedParameterPtr params = NULL;
     int nparams = 0;
-    size_t i;
+    ssize_t i;
 
     if (argc != 2) {
         fprintf(stderr, "One argument specifying the server which to work "
index 3e3f70e235780b0aba9c9b3b6b93179b94acb5f3..493a4b7b215c3d18e70684addd232928820e3616 100644 (file)
@@ -156,7 +156,7 @@ fetch_domains(virConnectPtr conn)
 {
     int num_domains, ret = -1;
     virDomainPtr *domains = NULL;
-    size_t i;
+    ssize_t i;
     const int list_flags = VIR_CONNECT_LIST_DOMAINS_ACTIVE;
 
     DEBUG("Fetching list of running domains");
index 22839947d087a4b533a2f9364adcdd893246d95e..d449bacd70376816b7e889497bd45190425c08c3 100644 (file)
@@ -161,7 +161,7 @@ fetch_domains(virConnectPtr conn)
 {
     int num_domains, ret = -1;
     virDomainPtr *domains = NULL;
-    size_t i;
+    ssize_t i;
     const int list_flags = VIR_CONNECT_LIST_DOMAINS_ACTIVE;
 
     DEBUG("Fetching list of running domains");
index c64fa96580e462bf4a7b38129bab5046c3a763fd..02c4401987c28d3dd5703baa99e8a023ac13d10c 100644 (file)
@@ -55,7 +55,7 @@ static int
 showDomains(virConnectPtr conn)
 {
     int ret = 0, numNames, numInactiveDomains, numActiveDomains;
-    size_t i;
+    ssize_t i;
     int flags = VIR_CONNECT_LIST_DOMAINS_ACTIVE |
                 VIR_CONNECT_LIST_DOMAINS_INACTIVE;
     virDomainPtr *nameList = NULL;
index 0be977ef818e039771cd92c4171a75f59da0299f..7a8254bb1cd584a31f0d9a3fb001bfc3b087e66b 100644 (file)
@@ -91,7 +91,7 @@ static int
 showDomains(virConnectPtr conn)
 {
     int ret = 0, numNames, numInactiveDomains, numActiveDomains;
-    size_t i;
+    ssize_t i;
     char **nameList = NULL;
 
     numActiveDomains = virConnectNumOfDomains(conn);