[libvirt] [PATCH] Fix compiler warning while un-wraping python object to uint in libvirt_virNodeGetFreePages

Introduced by commit c8ba859bc78f5e3b0ed2590f4e8a7fa6c26ac08f On compiling libvirt-python against libvirt 1.2.6, we get: libvirt-override.c: In function ‘libvirt_virNodeGetFreePages’: libvirt-override.c:7811:9: warning: pointer targets in passing argument 2 of ‘libvirt_intUnwrap’ differ in signedness [-Wpointer-sign] if (libvirt_intUnwrap(tmp, &pages[i]) < 0) ^ In file included from libvirt-override.c:24:0: typewrappers.h:169:5: note: expected ‘int *’ but argument is of type ‘unsigned int *’ int libvirt_intUnwrap(PyObject *obj, int *val); ^ --- libvirt-override.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt-override.c b/libvirt-override.c index 04fb4cd..40aefcc 100644 --- a/libvirt-override.c +++ b/libvirt-override.c @@ -7808,7 +7808,7 @@ libvirt_virNodeGetFreePages(PyObject *self ATTRIBUTE_UNUSED, for (i = 0; i < pyobj_pagesize_size; i++) { PyObject *tmp = PyList_GetItem(pyobj_pagesize, i); - if (libvirt_intUnwrap(tmp, &pages[i]) < 0) + if (libvirt_uintUnwrap(tmp, &pages[i]) < 0) goto cleanup; } -- 1.9.3

On 06/25/2014 10:18 AM, Nehal J Wani wrote: Long subject line, and a typo. Better is: build: use correct int conversion in GetFreePages then exposing the longer details in the commit body.
Introduced by commit c8ba859bc78f5e3b0ed2590f4e8a7fa6c26ac08f
On compiling libvirt-python against libvirt 1.2.6, we get:
libvirt-override.c: In function ‘libvirt_virNodeGetFreePages’: libvirt-override.c:7811:9: warning: pointer targets in passing argument 2 of ‘libvirt_intUnwrap’ differ in signedness [-Wpointer-sign] if (libvirt_intUnwrap(tmp, &pages[i]) < 0) ^ In file included from libvirt-override.c:24:0: typewrappers.h:169:5: note: expected ‘int *’ but argument is of type ‘unsigned int *’ int libvirt_intUnwrap(PyObject *obj, int *val); ^ --- libvirt-override.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
ACK and will push shortly. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Nehal J Wani