diff --git a/sip/siplib/sip.h b/sip/siplib/sip.h index 04d1463b..dea45b87 100644 --- a/sip/siplib/sip.h +++ b/sip/siplib/sip.h @@ -55,7 +55,7 @@ extern "C" { * Define the SIP version number. */ #define SIP_VERSION 0x040c00 -#define SIP_VERSION_STR "4.12-snapshot-24f170d5c2dd" +#define SIP_VERSION_STR "4.12-snapshot-93040d2c716c" /* @@ -298,13 +298,6 @@ typedef int sip_gilstate_t; * Some convenient function pointers. */ - -/* - * forward declare these structures - */ -struct _sipSimpleWrapper; -struct _sipTypeDef; - /* * The operation an access function is being asked to perform. */ @@ -315,6 +308,9 @@ typedef enum ReleaseGuard /* Release the guard, if any. */ } AccessFuncOp; +struct _sipSimpleWrapper; +struct _sipTypeDef; + typedef void *(*sipInitFunc)(struct _sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **); typedef void *(*sipAccessFunc)(struct _sipSimpleWrapper *, AccessFuncOp); diff --git a/sip/siplib/siplib.c b/sip/siplib/siplib.c index e0a0e9af..1919d3ae 100644 --- a/sip/siplib/siplib.c +++ b/sip/siplib/siplib.c @@ -6068,13 +6068,17 @@ static PyObject *create_property(sipVariableDef *vd) doc = Py_None; Py_INCREF(doc); } +#if PY_MAJOR_VERSION >= 3 + else if ((doc = PyUnicode_FromString(vd->vd_docstring)) == NULL) +#else else if ((doc = PyString_FromString(vd->vd_docstring)) == NULL) +#endif { goto done; } - descr = PyObject_CallFunctionObjArgs(&PyProperty_Type, fget, fset, fdel, - doc, NULL); + descr = PyObject_CallFunctionObjArgs((PyObject *)&PyProperty_Type, fget, + fset, fdel, doc, NULL); done: Py_XDECREF(fget); @@ -8031,9 +8035,9 @@ static int compareTypeDef(const void *key, const void *el) /* Find which external type it is. */ while (etd->et_nr >= 0) { - const sipTypeDef **tdp = &module_searched->em_types[etd->et_nr]; + const void *tdp = &module_searched->em_types[etd->et_nr]; - if (tdp == (const sipTypeDef **)el) + if (tdp == el) { s2 = etd->et_name; break; diff --git a/sip/siplib/voidptr.c b/sip/siplib/voidptr.c index 77e386df..d6e88560 100644 --- a/sip/siplib/voidptr.c +++ b/sip/siplib/voidptr.c @@ -438,7 +438,7 @@ static PyObject *sipVoidPtr_subscript(PyObject *self, PyObject *key) return NULL; } - return make_voidptr(v->voidptr + start, slicelength, v->rw); + return make_voidptr((char *)v->voidptr + start, slicelength, v->rw); } bad_key(key); @@ -522,7 +522,7 @@ static int sipVoidPtr_ass_subscript(PyObject *self, PyObject *key, return -1; } - memmove(v->voidptr + start, value_view.buf, size); + memmove((char *)v->voidptr + start, value_view.buf, size); PyBuffer_Release(&value_view); #else @@ -532,7 +532,7 @@ static int sipVoidPtr_ass_subscript(PyObject *self, PyObject *key, if (check_slice_size(size, value_size) < 0) return -1; - memmove(v->voidptr + start, value_ptr, size); + memmove((char *)v->voidptr + start, value_ptr, size); #endif return 0; @@ -638,7 +638,7 @@ static PyBufferProcs sipVoidPtr_BufferProcs = { sipVoidPtr_getwritebuffer, /* bf_getwritebuffer */ sipVoidPtr_getsegcount, /* bf_getsegcount */ #if PY_VERSION_HEX >= 0x02050000 - sipVoidPtr_getreadbuffer, /* bf_getcharbuffer */ + (charbufferproc)sipVoidPtr_getreadbuffer, /* bf_getcharbuffer */ #if PY_VERSION_HEX >= 0x02060000 sipVoidPtr_getbuffer, /* bf_getbuffer */ 0 /* bf_releasebuffer */