diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index de2d82cbbc45c89e1e162ddc31645b615724245a..8f417715a91105b67e1b022017b41d531b19f3c3 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -1471,7 +1471,7 @@ elsif ($mode eq "client") { } if ($single_ret_as_list) { - print " int i;\n"; + print " size_t i;\n"; } if ($call->{streamflag} ne "none") { @@ -1590,8 +1590,9 @@ elsif ($mode eq "client") { print " for (i = 0; i < ret.$single_ret_list_name.${single_ret_list_name}_len; ++i) {\n"; print " if (VIR_STRDUP(${single_ret_list_name}[i],\n"; print " ret.$single_ret_list_name.${single_ret_list_name}_val[i]) < 0) {\n"; - print " for (--i; i >= 0; --i)\n"; - print " VIR_FREE(${single_ret_list_name}[i]);\n"; + print " size_t j;\n"; + print " for (j = 0; j < i; j++)\n"; + print " VIR_FREE(${single_ret_list_name}[j]);\n"; print "\n"; print " goto cleanup;\n"; print " }\n"; diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index bc282f820b3a13052267c5358234113fc49b018b..fb5c1083708f6db0321eeef7144f7e675b327b8f 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -592,7 +592,7 @@ bool virNetClientHasPassFD(virNetClientPtr client) void virNetClientDispose(void *obj) { virNetClientPtr client = obj; - int i; + size_t i; PROBE(RPC_CLIENT_DISPOSE, "client=%p", client); diff --git a/src/rpc/virnetclientprogram.c b/src/rpc/virnetclientprogram.c index 1c4e4ba7a9c65ea02bd18ead89b9c294dee30ce6..cbd628a66bc9a080bbfdad8288f64cf10318e8f0 100644 --- a/src/rpc/virnetclientprogram.c +++ b/src/rpc/virnetclientprogram.c @@ -195,7 +195,7 @@ cleanup: static virNetClientProgramEventPtr virNetClientProgramGetEvent(virNetClientProgramPtr prog, int procedure) { - int i; + size_t i; for (i = 0; i < prog->nevents; i++) { if (prog->events[i].proc == procedure) diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c index c8b0ba4950f0540f8e462979aa648e8f4e77e325..cb770c3bf34ce3365b49e14b409580e1a0342fc2 100644 --- a/src/rpc/virnetserver.c +++ b/src/rpc/virnetserver.c @@ -852,7 +852,7 @@ virNetServerSignalEvent(int watch, void *opaque) { virNetServerPtr srv = opaque; siginfo_t siginfo; - int i; + size_t i; virObjectLock(srv); @@ -1037,7 +1037,7 @@ static void virNetServerAutoShutdownTimer(int timerid ATTRIBUTE_UNUSED, void virNetServerUpdateServices(virNetServerPtr srv, bool enabled) { - int i; + size_t i; virObjectLock(srv); for (i = 0; i < srv->nservices; i++) @@ -1051,7 +1051,7 @@ void virNetServerRun(virNetServerPtr srv) { int timerid = -1; bool timerActive = false; - int i; + size_t i; virObjectLock(srv); @@ -1147,7 +1147,7 @@ void virNetServerQuit(virNetServerPtr srv) void virNetServerDispose(void *obj) { virNetServerPtr srv = obj; - int i; + size_t i; VIR_FORCE_CLOSE(srv->autoShutdownInhibitFd); @@ -1186,7 +1186,7 @@ void virNetServerDispose(void *obj) void virNetServerClose(virNetServerPtr srv) { - int i; + size_t i; if (!srv) return; diff --git a/src/rpc/virnetserverservice.c b/src/rpc/virnetserverservice.c index 53f78ab477f4634be0201635bc9df167e1ab9675..632f03d39f26b9828ed84e8f85a86f3ada1bf30b 100644 --- a/src/rpc/virnetserverservice.c +++ b/src/rpc/virnetserverservice.c @@ -158,7 +158,7 @@ virNetServerServicePtr virNetServerServiceNewUNIX(const char *path, size_t nrequests_client_max) { virNetServerServicePtr svc; - int i; + size_t i; if (virNetServerServiceInitialize() < 0) return NULL; @@ -218,7 +218,7 @@ virNetServerServicePtr virNetServerServiceNewFD(int fd, size_t nrequests_client_max) { virNetServerServicePtr svc; - int i; + size_t i; if (virNetServerServiceInitialize() < 0) return NULL; @@ -429,7 +429,7 @@ void virNetServerServiceSetDispatcher(virNetServerServicePtr svc, void virNetServerServiceDispose(void *obj) { virNetServerServicePtr svc = obj; - int i; + size_t i; for (i = 0; i < svc->nsocks; i++) virObjectUnref(svc->socks[i]); @@ -443,7 +443,7 @@ void virNetServerServiceDispose(void *obj) void virNetServerServiceToggle(virNetServerServicePtr svc, bool enabled) { - int i; + size_t i; for (i = 0; i < svc->nsocks; i++) virNetSocketUpdateIOCallback(svc->socks[i], @@ -454,7 +454,7 @@ void virNetServerServiceToggle(virNetServerServicePtr svc, void virNetServerServiceClose(virNetServerServicePtr svc) { - int i; + size_t i; if (!svc) return; diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index 45dd8b4483c9c43e18ac5cbc81787b8a4dc98afc..1bfd87bf8577d16d79c4c037863aad5481631098 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -223,7 +223,7 @@ int virNetSocketNewListenTCP(const char *nodename, struct addrinfo *ai = NULL; struct addrinfo hints; int fd = -1; - int i; + size_t i; int addrInUse = false; *retsocks = NULL; diff --git a/src/rpc/virnetsshsession.c b/src/rpc/virnetsshsession.c index 77b5c88bf41004bd5107ed80490a5e42054b4f33..211b7d75e831552e5e39e4c6ce23018dbfab454f 100644 --- a/src/rpc/virnetsshsession.c +++ b/src/rpc/virnetsshsession.c @@ -114,7 +114,7 @@ struct _virNetSSHSession { static void virNetSSHSessionAuthMethodsFree(virNetSSHSessionPtr sess) { - int i; + size_t i; for (i = 0; i < sess->nauths; i++) { VIR_FREE(sess->auths[i]->username); @@ -205,7 +205,7 @@ virNetSSHKbIntCb(const char *name ATTRIBUTE_UNUSED, { virNetSSHSessionPtr priv = *opaque; virConnectCredentialPtr askcred = NULL; - int i; + size_t i; int credtype_echo = -1; int credtype_noecho = -1; char *tmp; @@ -294,7 +294,7 @@ virNetSSHCheckHostKey(virNetSSHSessionPtr sess) virBuffer buff = VIR_BUFFER_INITIALIZER; virConnectCredential askKey; struct libssh2_knownhost *knownHostEntry = NULL; - int i; + size_t i; char *hostnameStr = NULL; if (sess->hostKeyVerify == VIR_NET_SSH_HOSTKEY_VERIFY_IGNORE) @@ -584,7 +584,7 @@ virNetSSHAuthenticatePrivkey(virNetSSHSessionPtr sess, virNetSSHAuthMethodPtr priv) { virConnectCredential retr_passphrase; - int i; + size_t i; char *errmsg; int ret; @@ -780,7 +780,7 @@ virNetSSHAuthenticate(virNetSSHSessionPtr sess) bool auth_failed = false; char *auth_list; char *errmsg; - int i; + size_t i; int ret; if (!sess->nauths) { diff --git a/src/rpc/virnettlscontext.c b/src/rpc/virnettlscontext.c index 482c86094e30c9e6b5e3247978dd6e5565e05456..af0ec2145479ea9bc9b108c94622a4efce594377 100644 --- a/src/rpc/virnettlscontext.c +++ b/src/rpc/virnettlscontext.c @@ -287,7 +287,7 @@ static int virNetTLSContextCheckCertKeyPurpose(gnutls_x509_crt_t cert, bool isServer) { int status; - int i; + size_t i; unsigned int purposeCritical; unsigned int critical; char *buffer = NULL; @@ -300,7 +300,7 @@ static int virNetTLSContextCheckCertKeyPurpose(gnutls_x509_crt_t cert, status = gnutls_x509_crt_get_key_purpose_oid(cert, i, buffer, &size, NULL); if (status == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) { - VIR_DEBUG("No key purpose data available at slot %d", i); + VIR_DEBUG("No key purpose data available at slot %zu", i); /* If there is no data at all, then we must allow client/server to pass */ if (i == 0) @@ -950,7 +950,8 @@ static int virNetTLSContextValidCertificate(virNetTLSContextPtr ctxt, int ret; unsigned int status; const gnutls_datum_t *certs; - unsigned int nCerts, i; + unsigned int nCerts; + size_t i; char dname[256]; char *dnameptr = dname; size_t dnamesize = sizeof(dname);