mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 22:55:23 +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) {
|
if ($single_ret_as_list) {
|
||||||
print " int i;\n";
|
print " size_t i;\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($call->{streamflag} ne "none") {
|
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 " 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 " if (VIR_STRDUP(${single_ret_list_name}[i],\n";
|
||||||
print " ret.$single_ret_list_name.${single_ret_list_name}_val[i]) < 0) {\n";
|
print " ret.$single_ret_list_name.${single_ret_list_name}_val[i]) < 0) {\n";
|
||||||
print " for (--i; i >= 0; --i)\n";
|
print " size_t j;\n";
|
||||||
print " VIR_FREE(${single_ret_list_name}[i]);\n";
|
print " for (j = 0; j < i; j++)\n";
|
||||||
|
print " VIR_FREE(${single_ret_list_name}[j]);\n";
|
||||||
print "\n";
|
print "\n";
|
||||||
print " goto cleanup;\n";
|
print " goto cleanup;\n";
|
||||||
print " }\n";
|
print " }\n";
|
||||||
|
@ -592,7 +592,7 @@ bool virNetClientHasPassFD(virNetClientPtr client)
|
|||||||
void virNetClientDispose(void *obj)
|
void virNetClientDispose(void *obj)
|
||||||
{
|
{
|
||||||
virNetClientPtr client = obj;
|
virNetClientPtr client = obj;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
PROBE(RPC_CLIENT_DISPOSE,
|
PROBE(RPC_CLIENT_DISPOSE,
|
||||||
"client=%p", client);
|
"client=%p", client);
|
||||||
|
@ -195,7 +195,7 @@ cleanup:
|
|||||||
static virNetClientProgramEventPtr virNetClientProgramGetEvent(virNetClientProgramPtr prog,
|
static virNetClientProgramEventPtr virNetClientProgramGetEvent(virNetClientProgramPtr prog,
|
||||||
int procedure)
|
int procedure)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < prog->nevents; i++) {
|
for (i = 0; i < prog->nevents; i++) {
|
||||||
if (prog->events[i].proc == procedure)
|
if (prog->events[i].proc == procedure)
|
||||||
|
@ -852,7 +852,7 @@ virNetServerSignalEvent(int watch,
|
|||||||
void *opaque) {
|
void *opaque) {
|
||||||
virNetServerPtr srv = opaque;
|
virNetServerPtr srv = opaque;
|
||||||
siginfo_t siginfo;
|
siginfo_t siginfo;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
virObjectLock(srv);
|
virObjectLock(srv);
|
||||||
|
|
||||||
@ -1037,7 +1037,7 @@ static void virNetServerAutoShutdownTimer(int timerid ATTRIBUTE_UNUSED,
|
|||||||
void virNetServerUpdateServices(virNetServerPtr srv,
|
void virNetServerUpdateServices(virNetServerPtr srv,
|
||||||
bool enabled)
|
bool enabled)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
virObjectLock(srv);
|
virObjectLock(srv);
|
||||||
for (i = 0; i < srv->nservices; i++)
|
for (i = 0; i < srv->nservices; i++)
|
||||||
@ -1051,7 +1051,7 @@ void virNetServerRun(virNetServerPtr srv)
|
|||||||
{
|
{
|
||||||
int timerid = -1;
|
int timerid = -1;
|
||||||
bool timerActive = false;
|
bool timerActive = false;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
virObjectLock(srv);
|
virObjectLock(srv);
|
||||||
|
|
||||||
@ -1147,7 +1147,7 @@ void virNetServerQuit(virNetServerPtr srv)
|
|||||||
void virNetServerDispose(void *obj)
|
void virNetServerDispose(void *obj)
|
||||||
{
|
{
|
||||||
virNetServerPtr srv = obj;
|
virNetServerPtr srv = obj;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
VIR_FORCE_CLOSE(srv->autoShutdownInhibitFd);
|
VIR_FORCE_CLOSE(srv->autoShutdownInhibitFd);
|
||||||
|
|
||||||
@ -1186,7 +1186,7 @@ void virNetServerDispose(void *obj)
|
|||||||
|
|
||||||
void virNetServerClose(virNetServerPtr srv)
|
void virNetServerClose(virNetServerPtr srv)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
if (!srv)
|
if (!srv)
|
||||||
return;
|
return;
|
||||||
|
@ -158,7 +158,7 @@ virNetServerServicePtr virNetServerServiceNewUNIX(const char *path,
|
|||||||
size_t nrequests_client_max)
|
size_t nrequests_client_max)
|
||||||
{
|
{
|
||||||
virNetServerServicePtr svc;
|
virNetServerServicePtr svc;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
if (virNetServerServiceInitialize() < 0)
|
if (virNetServerServiceInitialize() < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -218,7 +218,7 @@ virNetServerServicePtr virNetServerServiceNewFD(int fd,
|
|||||||
size_t nrequests_client_max)
|
size_t nrequests_client_max)
|
||||||
{
|
{
|
||||||
virNetServerServicePtr svc;
|
virNetServerServicePtr svc;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
if (virNetServerServiceInitialize() < 0)
|
if (virNetServerServiceInitialize() < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -429,7 +429,7 @@ void virNetServerServiceSetDispatcher(virNetServerServicePtr svc,
|
|||||||
void virNetServerServiceDispose(void *obj)
|
void virNetServerServiceDispose(void *obj)
|
||||||
{
|
{
|
||||||
virNetServerServicePtr svc = obj;
|
virNetServerServicePtr svc = obj;
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < svc->nsocks; i++)
|
for (i = 0; i < svc->nsocks; i++)
|
||||||
virObjectUnref(svc->socks[i]);
|
virObjectUnref(svc->socks[i]);
|
||||||
@ -443,7 +443,7 @@ void virNetServerServiceDispose(void *obj)
|
|||||||
void virNetServerServiceToggle(virNetServerServicePtr svc,
|
void virNetServerServiceToggle(virNetServerServicePtr svc,
|
||||||
bool enabled)
|
bool enabled)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < svc->nsocks; i++)
|
for (i = 0; i < svc->nsocks; i++)
|
||||||
virNetSocketUpdateIOCallback(svc->socks[i],
|
virNetSocketUpdateIOCallback(svc->socks[i],
|
||||||
@ -454,7 +454,7 @@ void virNetServerServiceToggle(virNetServerServicePtr svc,
|
|||||||
|
|
||||||
void virNetServerServiceClose(virNetServerServicePtr svc)
|
void virNetServerServiceClose(virNetServerServicePtr svc)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
if (!svc)
|
if (!svc)
|
||||||
return;
|
return;
|
||||||
|
@ -223,7 +223,7 @@ int virNetSocketNewListenTCP(const char *nodename,
|
|||||||
struct addrinfo *ai = NULL;
|
struct addrinfo *ai = NULL;
|
||||||
struct addrinfo hints;
|
struct addrinfo hints;
|
||||||
int fd = -1;
|
int fd = -1;
|
||||||
int i;
|
size_t i;
|
||||||
int addrInUse = false;
|
int addrInUse = false;
|
||||||
|
|
||||||
*retsocks = NULL;
|
*retsocks = NULL;
|
||||||
|
@ -114,7 +114,7 @@ struct _virNetSSHSession {
|
|||||||
static void
|
static void
|
||||||
virNetSSHSessionAuthMethodsFree(virNetSSHSessionPtr sess)
|
virNetSSHSessionAuthMethodsFree(virNetSSHSessionPtr sess)
|
||||||
{
|
{
|
||||||
int i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < sess->nauths; i++) {
|
for (i = 0; i < sess->nauths; i++) {
|
||||||
VIR_FREE(sess->auths[i]->username);
|
VIR_FREE(sess->auths[i]->username);
|
||||||
@ -205,7 +205,7 @@ virNetSSHKbIntCb(const char *name ATTRIBUTE_UNUSED,
|
|||||||
{
|
{
|
||||||
virNetSSHSessionPtr priv = *opaque;
|
virNetSSHSessionPtr priv = *opaque;
|
||||||
virConnectCredentialPtr askcred = NULL;
|
virConnectCredentialPtr askcred = NULL;
|
||||||
int i;
|
size_t i;
|
||||||
int credtype_echo = -1;
|
int credtype_echo = -1;
|
||||||
int credtype_noecho = -1;
|
int credtype_noecho = -1;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
@ -294,7 +294,7 @@ virNetSSHCheckHostKey(virNetSSHSessionPtr sess)
|
|||||||
virBuffer buff = VIR_BUFFER_INITIALIZER;
|
virBuffer buff = VIR_BUFFER_INITIALIZER;
|
||||||
virConnectCredential askKey;
|
virConnectCredential askKey;
|
||||||
struct libssh2_knownhost *knownHostEntry = NULL;
|
struct libssh2_knownhost *knownHostEntry = NULL;
|
||||||
int i;
|
size_t i;
|
||||||
char *hostnameStr = NULL;
|
char *hostnameStr = NULL;
|
||||||
|
|
||||||
if (sess->hostKeyVerify == VIR_NET_SSH_HOSTKEY_VERIFY_IGNORE)
|
if (sess->hostKeyVerify == VIR_NET_SSH_HOSTKEY_VERIFY_IGNORE)
|
||||||
@ -584,7 +584,7 @@ virNetSSHAuthenticatePrivkey(virNetSSHSessionPtr sess,
|
|||||||
virNetSSHAuthMethodPtr priv)
|
virNetSSHAuthMethodPtr priv)
|
||||||
{
|
{
|
||||||
virConnectCredential retr_passphrase;
|
virConnectCredential retr_passphrase;
|
||||||
int i;
|
size_t i;
|
||||||
char *errmsg;
|
char *errmsg;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -780,7 +780,7 @@ virNetSSHAuthenticate(virNetSSHSessionPtr sess)
|
|||||||
bool auth_failed = false;
|
bool auth_failed = false;
|
||||||
char *auth_list;
|
char *auth_list;
|
||||||
char *errmsg;
|
char *errmsg;
|
||||||
int i;
|
size_t i;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!sess->nauths) {
|
if (!sess->nauths) {
|
||||||
|
@ -287,7 +287,7 @@ static int virNetTLSContextCheckCertKeyPurpose(gnutls_x509_crt_t cert,
|
|||||||
bool isServer)
|
bool isServer)
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
int i;
|
size_t i;
|
||||||
unsigned int purposeCritical;
|
unsigned int purposeCritical;
|
||||||
unsigned int critical;
|
unsigned int critical;
|
||||||
char *buffer = NULL;
|
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);
|
status = gnutls_x509_crt_get_key_purpose_oid(cert, i, buffer, &size, NULL);
|
||||||
|
|
||||||
if (status == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) {
|
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 there is no data at all, then we must allow client/server to pass */
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
@ -950,7 +950,8 @@ static int virNetTLSContextValidCertificate(virNetTLSContextPtr ctxt,
|
|||||||
int ret;
|
int ret;
|
||||||
unsigned int status;
|
unsigned int status;
|
||||||
const gnutls_datum_t *certs;
|
const gnutls_datum_t *certs;
|
||||||
unsigned int nCerts, i;
|
unsigned int nCerts;
|
||||||
|
size_t i;
|
||||||
char dname[256];
|
char dname[256];
|
||||||
char *dnameptr = dname;
|
char *dnameptr = dname;
|
||||||
size_t dnamesize = sizeof(dname);
|
size_t dnamesize = sizeof(dname);
|
||||||
|
Loading…
Reference in New Issue
Block a user