From 487d57b341bcbe0ec97e574c085858dab9c48fa3 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 28 Oct 2008 17:48:06 +0000 Subject: [PATCH] avoid compiler warning when all storage backends are disabled * src/storage_backend.c (backends): Add a NULL terminator. (virStorageBackendForType): Use NULL terminator rather than warning-provoking (possibly 0) array size. --- ChangeLog | 7 +++++++ src/storage_backend.c | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index dda2563569..e3cf7cd3b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Tue Oct 28 13:29:14 +0100 2008 Jim Meyering + + avoid compiler warning when all storage backends are disabled + * src/storage_backend.c (backends): Add a NULL terminator. + (virStorageBackendForType): Use NULL terminator rather than + warning-provoking (possibly 0) array size. + Tue Oct 28 13:29:14 +0100 2008 Jim Meyering avoid many mingw-specific warnings diff --git a/src/storage_backend.c b/src/storage_backend.c index e33f98c051..1f4ed10a72 100644 --- a/src/storage_backend.c +++ b/src/storage_backend.c @@ -82,13 +82,14 @@ static virStorageBackendPtr backends[] = { #if WITH_STORAGE_DISK &virStorageBackendDisk, #endif + NULL }; virStorageBackendPtr virStorageBackendForType(int type) { unsigned int i; - for (i = 0 ; i < ARRAY_CARDINALITY(backends); i++) + for (i = 0; backends[i]; i++) if (backends[i]->type == type) return backends[i];