mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 06:35:24 +00:00
Convert 'int i' to 'size_t i' in src/rpc/ files
Convert the type of loop iterators named 'i', 'j', k', 'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or 'unsigned int', also santizing 'ii', 'jj', 'kk' to use the normal 'i', 'j', 'k' naming Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
8ae0528571
commit
792f81a40e
@ -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";
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user