]> xenbits.xensource.com Git - libvirt.git/commitdiff
avoid compiler warning when all storage backends are disabled
authorJim Meyering <meyering@redhat.com>
Tue, 28 Oct 2008 17:48:06 +0000 (17:48 +0000)
committerJim Meyering <meyering@redhat.com>
Tue, 28 Oct 2008 17:48:06 +0000 (17:48 +0000)
* src/storage_backend.c (backends): Add a NULL terminator.
(virStorageBackendForType): Use NULL terminator rather than
warning-provoking (possibly 0) array size.

ChangeLog
src/storage_backend.c

index dda2563569cfa519c047be9a73612befb5555e73..e3cf7cd3b5a93a1f54a7ecaf0554e7090301f71f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Tue Oct 28 13:29:14 +0100 2008 Jim Meyering <meyering@redhat.com>
+
+       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 <meyering@redhat.com>
 
        avoid many mingw-specific warnings
index e33f98c0511b2238b7ddfd2a34c8fd70d7f26eba..1f4ed10a72d7a21719ed150d5087e4617390758a 100644 (file)
@@ -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];