updated siplib

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@66271 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2010-11-27 08:43:57 +00:00
parent f765afe0c3
commit 2279df7926
2 changed files with 110 additions and 13 deletions

View File

@@ -55,7 +55,7 @@ extern "C" {
* Define the SIP version number.
*/
#define SIP_VERSION 0x040c00
#define SIP_VERSION_STR "4.12-snapshot-93040d2c716c"
#define SIP_VERSION_STR "4.12-snapshot-d92b54039599"
/*
@@ -178,7 +178,7 @@ extern "C" {
/* The name of the sip module. */
#define SIP_MODULE_NAME "wx.siplib"
#define SIP_MODULE_NAME "wxPhoenix.siplib"
/*

View File

@@ -1911,13 +1911,12 @@ static PyObject *buildObject(PyObject *obj, const char *fmt, va_list va)
break;
case 'd':
case 'f':
el = PyFloat_FromDouble(va_arg(va,double));
case 'd': // double
case 'f': // float
el = PyFloat_FromDouble(va_arg(va, double));
break;
case 'e':
case 'h':
case 'i':
#if PY_MAJOR_VERSION >= 3
el = PyLong_FromLong(va_arg(va, int));
@@ -1926,6 +1925,22 @@ static PyObject *buildObject(PyObject *obj, const char *fmt, va_list va)
#endif
break;
case 'L':
#if PY_MAJOR_VERSION >= 3
el = PyLong_FromLong(va_arg(va, int));
#else
el = PyInt_FromLong(va_arg(va, int));
#endif
break;
case 'h':
#if PY_MAJOR_VERSION >= 3
el = PyLong_FromLong(va_arg(va, int));
#else
el = PyInt_FromLong(va_arg(va, int));
#endif
break;
case 'l':
el = PyLong_FromLong(va_arg(va, long));
break;
@@ -2006,8 +2021,9 @@ static PyObject *buildObject(PyObject *obj, const char *fmt, va_list va)
break;
case 't':
case 'u':
case 'u': /* unsigned */
case 'M': /* unsigned char */
case 't': /* unsigned short */
el = PyLong_FromUnsignedLong(va_arg(va, unsigned));
break;
@@ -2129,6 +2145,7 @@ static int sip_api_parse_result(int *isErr, PyObject *method, PyObject *res,
{
char ch;
const char *cp = ++fmt;
int sub_format = FALSE;
tupsz = 0;
@@ -2142,12 +2159,18 @@ static int sip_api_parse_result(int *isErr, PyObject *method, PyObject *res,
break;
}
/*
* Some format characters have a sub-format so skip the character
* and count the sub-format character next time round.
*/
if (strchr("HDC", ch) == NULL)
if (sub_format)
{
sub_format = FALSE;
}
else
{
++tupsz;
/* Some format characters have a sub-format. */
if (strchr("aAHDC", ch) != NULL)
sub_format = TRUE;
}
}
if (rc == 0)
@@ -2325,6 +2348,30 @@ static int sip_api_parse_result(int *isErr, PyObject *method, PyObject *res,
break;
case 'L':
{
signed char v = SIPLong_AsLong(arg);
if (PyErr_Occurred())
invalid = TRUE;
else
*va_arg(va, signed char *) = v;
}
break;
case 'M':
{
unsigned char v = sip_api_long_as_unsigned_long(arg);
if (PyErr_Occurred())
invalid = TRUE;
else
*va_arg(va, unsigned char *) = v;
}
break;
case 'h':
{
short v = SIPLong_AsLong(arg);
@@ -4041,6 +4088,56 @@ static int parsePass1(PyObject **parseErrp, sipSimpleWrapper **selfp,
break;
}
case 'L':
{
/* Signed char. */
signed char *p = va_arg(va, signed char *);
if (arg != NULL)
{
signed char v = SIPLong_AsLong(arg);
if (PyErr_Occurred())
{
failure.reason = WrongType;
failure.detail_obj = arg;
Py_INCREF(arg);
}
else
{
*p = v;
}
}
break;
}
case 'M':
{
/* Unsigned char. */
unsigned char *p = va_arg(va, unsigned char *);
if (arg != NULL)
{
unsigned char v = sip_api_long_as_unsigned_long(arg);
if (PyErr_Occurred())
{
failure.reason = WrongType;
failure.detail_obj = arg;
Py_INCREF(arg);
}
else
{
*p = v;
}
}
break;
}
case 'h':
{
/* Short integer. */