From 7e6084ad8293c2172362eac9e140a478f2883a9f Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 12 Jul 2007 13:27:07 +0300 Subject: One last fix for const qualifier discarding complaint in python. OTOH we need to call PyCObject_FromVoidPtr() with non-const cast.. --- python/rpmmodule.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'python') diff --git a/python/rpmmodule.c b/python/rpmmodule.c index 4372ea1e5..9443e2826 100644 --- a/python/rpmmodule.c +++ b/python/rpmmodule.c @@ -192,7 +192,7 @@ void init_rpm(void) PyObject * d, *o, * tag = NULL, * dict; int i; const struct headerSprintfExtension_s * extensions = rpmHeaderFormats; - struct headerSprintfExtension_s * ext; + const struct headerSprintfExtension_s * ext; PyObject * m; #if Py_TPFLAGS_HAVE_ITER /* XXX backport to python-1.5.2 */ @@ -294,7 +294,8 @@ void init_rpm(void) while (extensions->name) { if (extensions->type == HEADER_EXT_TAG) { ext = extensions; - PyDict_SetItemString(d, (char *) extensions->name, o=PyCObject_FromVoidPtr(ext, NULL)); + o = PyCObject_FromVoidPtr((struct headerSprintfExtension_s *) ext, NULL); + PyDict_SetItemString(d, (char *) extensions->name, o); Py_DECREF(o); PyDict_SetItem(dict, tag, o=PyString_FromString(ext->name + 7)); Py_DECREF(o); -- cgit v1.2.3