Skip to content

Commit 6eea2f2

Browse files
elkrejziveillard
authored andcommitted
python: Fix compiler warnings when building python3 bindings
1 parent dcc1950 commit 6eea2f2

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

python/libxml.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ xmlPythonFileReadRaw (void * context, char * buffer, int len) {
296296
#ifdef PyUnicode_Check
297297
} else if PyUnicode_Check (ret) {
298298
#if PY_VERSION_HEX >= 0x03030000
299-
size_t size;
299+
Py_ssize_t size;
300300
const char *tmp;
301301

302302
/* tmp doesn't need to be deallocated */
@@ -361,7 +361,7 @@ xmlPythonFileRead (void * context, char * buffer, int len) {
361361
#ifdef PyUnicode_Check
362362
} else if PyUnicode_Check (ret) {
363363
#if PY_VERSION_HEX >= 0x03030000
364-
size_t size;
364+
Py_ssize_t size;
365365
const char *tmp;
366366

367367
/* tmp doesn't need to be deallocated */

python/types.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ libxml_xmlXPathObjectPtrWrap(xmlXPathObjectPtr obj)
594594
}
595595

596596
xmlXPathObjectPtr
597-
libxml_xmlXPathObjectPtrConvert(PyObject * obj)
597+
libxml_xmlXPathObjectPtrConvert(PyObject *obj)
598598
{
599599
xmlXPathObjectPtr ret = NULL;
600600

@@ -633,11 +633,11 @@ libxml_xmlXPathObjectPtrConvert(PyObject * obj)
633633
#if PY_VERSION_HEX >= 0x03030000
634634
xmlChar *str;
635635
const char *tmp;
636-
size_t size;
636+
Py_ssize_t size;
637637

638638
/* tmp doesn't need to be deallocated */
639639
tmp = PyUnicode_AsUTF8AndSize(obj, &size);
640-
str = xmlStrndup(tmp, (int) size);
640+
str = xmlStrndup((const xmlChar *) tmp, (int) size);
641641
ret = xmlXPathWrapString(str);
642642
#else
643643
xmlChar *str = NULL;

0 commit comments

Comments
 (0)