mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 05:17:59 +03:00
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:
parent
a6c7f474eb
commit
487d57b341
@ -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
|
||||
|
@ -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];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user