File python-opengl-2.0.1.09-ssize.patch of Package python-opengl
--- interface/complex_typemaps.inc
+++ interface/complex_typemaps.inc
@@ -47,7 +47,7 @@
/* and hence is fragile. */
#define ARRAY_LEN(NUMBER)\
-%typemap(python,ignore) int n_##NUMBER, unsigned int n_##NUMBER, GLint n_##NUMBER\
+%typemap(python,in,numinputs=0) int n_##NUMBER, unsigned int n_##NUMBER, GLint n_##NUMBER\
{\
}\
%typemap(python,check) int n_##NUMBER, unsigned int n_##NUMBER, GLint n_##NUMBER\
@@ -56,7 +56,7 @@
}
#define ARRAY2_LEN(NUMBER, NUMBER2)\
-%typemap(python,ignore) int n_##NUMBER, unsigned int n_##NUMBER, GLint n_##NUMBER\
+%typemap(python,in,numinputs=0) int n_##NUMBER, unsigned int n_##NUMBER, GLint n_##NUMBER\
{\
}\
%typemap(python,check) int n_##NUMBER, unsigned int n_##NUMBER, GLint n_##NUMBER\
@@ -89,7 +89,7 @@
/* and hence is fragile. */
#define ARRAY_DIM(NUMBER, DIM)\
-%typemap(python,ignore) int d_##NUMBER##_##DIM, unsigned int d_##NUMBER##_##DIM\
+%typemap(python,in,numinputs=0) int d_##NUMBER##_##DIM, unsigned int d_##NUMBER##_##DIM\
{\
}\
%typemap(python,check) int d_##NUMBER##_##DIM, unsigned int d_##NUMBER##_##DIM\
@@ -98,7 +98,7 @@
}
#define ARRAY2_DIM(NUMBER, DIM, NUMBER2)\
-%typemap(python,ignore) int d_##NUMBER##_##DIM, unsigned int d_##NUMBER##_##DIM\
+%typemap(python,in,numinputs=0) int d_##NUMBER##_##DIM, unsigned int d_##NUMBER##_##DIM\
{\
}\
%typemap(python,check) int d_##NUMBER##_##DIM, unsigned int d_##NUMBER##_##DIM\
@@ -293,7 +293,7 @@
#define ARRAY_OUT(NAME, TYPE, SIZE, DEFAULT, PY_OBJECT)\
-%typemap(python,ignore) TYPE[SIZE] (TYPE temp_[SIZE])\
+%typemap(python,in,numinputs=0) TYPE[SIZE] (TYPE temp_[SIZE])\
{\
int i;\
$1 = temp_;\
--- interface/simple_typemaps.inc
+++ interface/simple_typemaps.inc
@@ -92,47 +92,47 @@
-%typemap(python,ignore) GLenum type_UNSIGNED_BYTE
+%typemap(python,in,numinputs=0) GLenum type_UNSIGNED_BYTE
{
$1 = GL_UNSIGNED_BYTE;
}
-%typemap(python,ignore) GLenum type_BYTE
+%typemap(python,in,numinputs=0) GLenum type_BYTE
{
$1 = GL_BYTE;
}
-%typemap(python,ignore) GLenum type_UNSIGNED_SHORT
+%typemap(python,in,numinputs=0) GLenum type_UNSIGNED_SHORT
{
$1 = GL_UNSIGNED_SHORT;
}
-%typemap(python,ignore) GLenum type_SHORT
+%typemap(python,in,numinputs=0) GLenum type_SHORT
{
$1 = GL_SHORT;
}
-%typemap(python,ignore) GLenum type_UNSIGNED_INT
+%typemap(python,in,numinputs=0) GLenum type_UNSIGNED_INT
{
$1 = GL_UNSIGNED_INT;
}
-%typemap(python,ignore) GLenum type_INT
+%typemap(python,in,numinputs=0) GLenum type_INT
{
$1 = GL_INT;
}
-%typemap(python,ignore) GLenum type_FLOAT
+%typemap(python,in,numinputs=0) GLenum type_FLOAT
{
$1 = GL_FLOAT;
}
-%typemap(python,ignore) GLenum type_DOUBLE
+%typemap(python,in,numinputs=0) GLenum type_DOUBLE
{
$1 = GL_DOUBLE;
}
-%typemap(python,ignore) GLsizei stride_0, GLint stride_0, GLint ustride_0, GLint vstride_0
+%typemap(python,in,numinputs=0) GLsizei stride_0, GLint stride_0, GLint ustride_0, GLint vstride_0
{
$1 = 0;
}
--- src/interface_util/interface_util.c
+++ src/interface_util/interface_util.c
@@ -5,10 +5,10 @@
#endif
#define _PyTuple_From(NAME, BASE, PY_OBJECT)\
-PyObject* _PyTuple_From##NAME(int len, BASE* data)\
+PyObject* _PyTuple_From##NAME(Py_ssize_t len, BASE* data)\
{\
PyObject* result;\
- int i;\
+ Py_ssize_t i;\
\
switch (len)\
{\
@@ -44,10 +44,10 @@
#define STRING_PyObject_From(PREFIX, NAME, BASE)\
-PyObject* __PyObject_From##NAME(int nd, int* dims, BASE* data)\
+PyObject* __PyObject_From##NAME(Py_ssize_t nd, int* dims, BASE* data)\
{\
PyObject *result;\
- int i, l;\
+ Py_ssize_t i, l;\
\
if (nd > 1)\
{\
@@ -60,7 +60,7 @@
return result;\
}\
\
-PyObject* PREFIX##PyObject_From##NAME(int nd, int* dims, BASE* data, int own)\
+PyObject* PREFIX##PyObject_From##NAME(Py_ssize_t nd, int* dims, BASE* data, int own)\
{\
PyObject* result = __PyObject_From##NAME(nd, dims, data);\
if (own) PyMem_Del(data);\
@@ -69,10 +69,10 @@
#define _PyObject_From(PREFIX, NAME, BASE, PY_OBJECT)\
-PyObject* __PyObject_From##NAME(int nd, int* dims, BASE* data)\
+PyObject* __PyObject_From##NAME(Py_ssize_t nd, int* dims, BASE* data)\
{\
PyObject *result;\
- int i, l;\
+ Py_ssize_t i, l;\
\
if (nd)\
{\
@@ -87,7 +87,7 @@
return result;\
}\
\
-PyObject* PREFIX##PyObject_From##NAME(int nd, int* dims, BASE* data, int own)\
+PyObject* PREFIX##PyObject_From##NAME(Py_ssize_t nd, int* dims, BASE* data, int own)\
{\
PyObject* result = __PyObject_From##NAME(nd, dims, data);\
if (own) PyMem_Del(data);\
@@ -95,12 +95,12 @@
}
#define NUMERIC_PyObject_From(NAME, BASE, TYPECODE)\
-PyObject* _PyObject_From##NAME(int nd, int* dims, BASE* data, int own)\
+PyObject* _PyObject_From##NAME(Py_ssize_t nd, int* dims, BASE* data, int own)\
{\
if (PyArray_API)\
{\
BASE* my;\
- int i, l;\
+ Py_ssize_t i, l;\
PyObject * result;\
result = PyArray_FromDims(nd, dims, TYPECODE);\
/* get total length */\
@@ -552,9 +552,9 @@
}
}
-int __PyObject_AsArray_Size(PyObject* x)
+Py_ssize_t __PyObject_AsArray_Size(PyObject* x)
{
- int i, l, n, p;
+ Py_ssize_t i, l, n, p;
PyObject* item;
if (PyString_Check(x))
@@ -592,7 +592,7 @@
#define __PyObject_As(NAME, BASE, PY_NUMBER_CAST, NUMBER_CAST)\
int __PyObject_As##NAME(BASE* dest, PyObject* src)\
{\
- int i, n, l, p;\
+ Py_ssize_t i, n, l, p;\
char* b;\
PyObject* item;\
\
@@ -735,7 +735,7 @@
void* _PyObject_AsPointer(PyObject* x)
{
- int len;
+ Py_ssize_t len;
char *buffer, *bufferCopy;
PyString_AsStringAndSize(x = PyObject_Str(x), &buffer, &len);
@@ -746,7 +746,7 @@
return (void*)bufferCopy;
}
-int __PyObject_Dimension(PyObject* x, int rank)
+Py_ssize_t __PyObject_Dimension(PyObject* x, int rank)
{
PyObject *item;
int n;