From 41183cf7bbf5c8ff57dc9d93ce3e79750024e06f Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 30 Oct 2013 15:42:31 -0600 Subject: [PATCH] storage: use correct type for array count Using size_t counts will let us use VIR_APPEND_ELEMENT and friends. * src/conf/storage_conf.h (_virStoragePoolObjList) (_virStorageVolDefList): Track list sizes with size_t. * src/storage/storage_backend_rbd.c (virStorageBackendRBDRefreshPool): Fix type fallout. Signed-off-by: Eric Blake --- src/conf/storage_conf.h | 4 ++-- src/storage/storage_backend_rbd.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h index 62ff1fd93e..f062bd8213 100644 --- a/src/conf/storage_conf.h +++ b/src/conf/storage_conf.h @@ -112,7 +112,7 @@ struct _virStorageVolDef { typedef struct _virStorageVolDefList virStorageVolDefList; typedef virStorageVolDefList *virStorageVolDefListPtr; struct _virStorageVolDefList { - unsigned int count; + size_t count; virStorageVolDefPtr *objs; }; @@ -340,7 +340,7 @@ struct _virStoragePoolObj { typedef struct _virStoragePoolObjList virStoragePoolObjList; typedef virStoragePoolObjList *virStoragePoolObjListPtr; struct _virStoragePoolObjList { - unsigned int count; + size_t count; virStoragePoolObjPtr *objs; }; diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c index 4e18bf9fc5..b7a41c249d 100644 --- a/src/storage/storage_backend_rbd.c +++ b/src/storage/storage_backend_rbd.c @@ -381,7 +381,7 @@ static int virStorageBackendRBDRefreshPool(virConnectPtr conn, pool->volumes.objs[pool->volumes.count++] = vol; } - VIR_DEBUG("Found %d images in RBD pool %s", + VIR_DEBUG("Found %zu images in RBD pool %s", pool->volumes.count, pool->def->source.name); ret = 0; -- GitLab