[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 06/32] Convert 'int i' to 'size_t i' in src/{xen, xenapi, xenxs} files



On 07/08/2013 10:21 PM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange"<berrange redhat com>

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>
---
  src/xen/block_stats.c      |  4 ++--
  src/xen/xen_driver.c       |  4 ++--
  src/xen/xen_hypervisor.c   | 14 ++++++++------
  src/xen/xen_inotify.c      |  4 ++--
  src/xen/xend_internal.c    | 12 +++++++-----
  src/xen/xm_internal.c      |  5 +++--
  src/xen/xs_internal.c      | 27 +++++++++++++++++----------
  src/xenapi/xenapi_driver.c | 30 ++++++++++++++++++------------
  src/xenapi/xenapi_utils.c  | 14 +++++++-------
  src/xenxs/xen_sxpr.c       | 10 +++++-----
  src/xenxs/xen_xm.c         |  6 +++---
  11 files changed, 74 insertions(+), 56 deletions(-)


--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -1267,7 +1267,7 @@ xenHypervisorSetSchedulerParameters(virConnectPtr conn,
                                      virTypedParameterPtr params,
                                      int nparams)
  {
-    int i;
+    size_t i;
      unsigned int val;
      xenUnifiedPrivatePtr priv = conn->privateData;
      char buf[256];
@@ -2043,7 +2043,7 @@ xenHypervisorBuildCapabilities(virConnectPtr conn, virArch hostarch,
                                 int nr_guest_archs)
  {
      virCapsPtr caps;
-    int i;
+    size_t i;
      int hv_major = hv_versions.hv >> 16;
      int hv_minor = hv_versions.hv & 0xFFFF;
@@ -2223,7 +2223,7 @@ static virCapsPtr
  xenHypervisorMakeCapabilitiesSunOS(virConnectPtr conn)
  {
      struct guest_arch guest_arches[32];
-    int i = 0;
+    size_t i = 0;
      virCapsPtr caps = NULL;
      int pae, longmode;
      const char *hvm;
@@ -2293,7 +2293,7 @@ xenHypervisorMakeCapabilitiesInternal(virConnectPtr conn,
      char line[1024], *str, *token;
      regmatch_t subs[4];
      char *saveptr = NULL;
-    int i;
+    size_t i;
char hvm_type[4] = ""; /* "vmx" or "svm" (or "" if not in CPU). */
      int host_pae = 0;
@@ -2846,7 +2846,8 @@ xenHypervisorNodeGetCellsFreeMemory(virConnectPtr conn,
                                      int maxCells)
  {
      xen_op_v2_sys op_sys;
-    int i, j, ret;
+    size_t i, j;
+    int ret;
      xenUnifiedPrivatePtr priv = conn->privateData;
if (priv->nbNodeCells < 0) {
@@ -2976,7 +2977,8 @@ xenHypervisorGetVcpus(virConnectPtr conn,
      int ret;
      xenUnifiedPrivatePtr priv = conn->privateData;
      virVcpuInfoPtr ipt;
-    int nbinfo, i;
+    int nbinfo;
+    size_t i;
if (sizeof(cpumap_t) & 7) {
          virReportError(VIR_ERR_INTERNAL_ERROR, "%s",

  Missed int i in xenHypervisorLookupDomainByUUID()

  Guannan


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]