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.
This commit is contained in:
Jim Meyering 2008-10-28 17:48:06 +00:00
parent a6c7f474eb
commit 487d57b341
2 changed files with 9 additions and 1 deletions

View File

@ -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> Tue Oct 28 13:29:14 +0100 2008 Jim Meyering <meyering@redhat.com>
avoid many mingw-specific warnings avoid many mingw-specific warnings

View File

@ -82,13 +82,14 @@ static virStorageBackendPtr backends[] = {
#if WITH_STORAGE_DISK #if WITH_STORAGE_DISK
&virStorageBackendDisk, &virStorageBackendDisk,
#endif #endif
NULL
}; };
virStorageBackendPtr virStorageBackendPtr
virStorageBackendForType(int type) { virStorageBackendForType(int type) {
unsigned int i; unsigned int i;
for (i = 0 ; i < ARRAY_CARDINALITY(backends); i++) for (i = 0; backends[i]; i++)
if (backends[i]->type == type) if (backends[i]->type == type)
return backends[i]; return backends[i];