On Mon, Oct 27, 2008 at 07:49:17PM +0100, Jim Meyering wrote: > One more warning question: > Compiling with all storage backends disabled, I get this: > > storage_backend.c:91: warning: comparison of unsigned expression < 0 is always false > [...] > The above loses because ARRAY_CARDINALITY(backends) is 0. > [...] > Another way is to add a NULL pointer at the end > and change the loop not to use the array size at all: > > for (i = 0; backends[i]; i++) > if (backends[i]->type == type) > return backends[i]; > > I chose the latter: yup, sounds better to me too, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@xxxxxxxxxxxx | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ -- Libvir-list mailing list Libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list