[libxml2] python: Fix compiler warnings when building python3 bindings



commit 6eea2f2c60e6a97491920cdf86b847869a2411dd
Author: Armin K <krejzi email com>
Date:   Thu May 30 19:00:50 2013 +0200

    python: Fix compiler warnings when building python3 bindings

 python/libxml.c |    4 ++--
 python/types.c  |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/python/libxml.c b/python/libxml.c
index 3338b83..30b71f3 100644
--- a/python/libxml.c
+++ b/python/libxml.c
@@ -296,7 +296,7 @@ xmlPythonFileReadRaw (void * context, char * buffer, int len) {
 #ifdef PyUnicode_Check
     } else if PyUnicode_Check (ret) {
 #if PY_VERSION_HEX >= 0x03030000
-        size_t size;
+        Py_ssize_t size;
        const char *tmp;
 
        /* tmp doesn't need to be deallocated */
@@ -361,7 +361,7 @@ xmlPythonFileRead (void * context, char * buffer, int len) {
 #ifdef PyUnicode_Check
     } else if PyUnicode_Check (ret) {
 #if PY_VERSION_HEX >= 0x03030000
-        size_t size;
+        Py_ssize_t size;
        const char *tmp;
 
        /* tmp doesn't need to be deallocated */
diff --git a/python/types.c b/python/types.c
index 31c909a..f237677 100644
--- a/python/types.c
+++ b/python/types.c
@@ -594,7 +594,7 @@ libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj)
 }
 
 xmlXPathObjectPtr
-libxml_xmlXPathObjectPtrConvert(PyObject * obj)
+libxml_xmlXPathObjectPtrConvert(PyObject *obj)
 {
     xmlXPathObjectPtr ret = NULL;
 
@@ -633,11 +633,11 @@ libxml_xmlXPathObjectPtrConvert(PyObject * obj)
 #if PY_VERSION_HEX >= 0x03030000
         xmlChar *str;
        const char *tmp;
-       size_t size;
+       Py_ssize_t size;
 
        /* tmp doesn't need to be deallocated */
         tmp = PyUnicode_AsUTF8AndSize(obj, &size);
-        str = xmlStrndup(tmp, (int) size);
+        str = xmlStrndup((const xmlChar *) tmp, (int) size);
         ret = xmlXPathWrapString(str);
 #else
         xmlChar *str = NULL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]