File python-opengl-2.0.1.09-pep353.patch of Package python-opengl

--- interface/simple_typemaps.inc
+++ interface/simple_typemaps.inc
@@ -33,7 +33,7 @@
 
 %typemap(python, in) const void *buffer
 {
-	int len;
+	Py_ssize_t len;
 	PyObject* str;
 	if ($input == Py_None) 
 	{
--- src/config.h
+++ src/config.h
@@ -6,7 +6,7 @@
 #endif
 
 #if PY_VERSION_HEX < 0x02000000
-extern int PyString_AsStringAndSize(PyObject *obj, char **s, int *len);
+extern Py_ssize_t PyString_AsStringAndSize(PyObject *obj, char **s, int *len);
 
 /* Python 1.5 doesn't define these and Python 1.6 defines buggy ones */
 #undef PyMem_New
--- src/interface/GL.ARB.texture_compression.0103.inc
+++ src/interface/GL.ARB.texture_compression.0103.inc
@@ -999,7 +999,7 @@
     arg3 = (GLenum) PyInt_AsLong(obj2);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj7 == Py_None) 
         {
@@ -1046,7 +1046,7 @@
     arg3 = (GLenum) PyInt_AsLong(obj2);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj6 == Py_None) 
         {
@@ -1092,7 +1092,7 @@
     arg3 = (GLenum) PyInt_AsLong(obj2);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj5 == Py_None) 
         {
@@ -1142,7 +1142,7 @@
     arg9 = (GLenum) PyInt_AsLong(obj8);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj9 == Py_None) 
         {
@@ -1190,7 +1190,7 @@
     arg7 = (GLenum) PyInt_AsLong(obj6);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj7 == Py_None) 
         {
@@ -1233,7 +1233,7 @@
     arg1 = (GLenum) PyInt_AsLong(obj0);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj5 == Py_None) 
         {
--- src/interface/GL.EXT.color_table.0120.inc
+++ src/interface/GL.EXT.color_table.0120.inc
@@ -1037,7 +1037,7 @@
     arg5 = (GLenum) PyInt_AsLong(obj4);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj5 == Py_None) 
         {
--- src/interface/GL.EXT.draw_range_elements.0100.inc
+++ src/interface/GL.EXT.draw_range_elements.0100.inc
@@ -949,7 +949,7 @@
     arg5 = (GLenum) PyInt_AsLong(obj4);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj5 == Py_None) 
         {
--- src/interface/GL.EXT.subtexture.0111.inc
+++ src/interface/GL.EXT.subtexture.0111.inc
@@ -997,7 +997,7 @@
     arg6 = (GLenum) PyInt_AsLong(obj5);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj6 == Py_None) 
         {
@@ -1337,7 +1337,7 @@
     arg8 = (GLenum) PyInt_AsLong(obj7);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj8 == Py_None) 
         {
@@ -1728,7 +1728,7 @@
     arg10 = (GLenum) PyInt_AsLong(obj9);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj10 == Py_None) 
         {
--- src/interface/GL.EXT.texture3D.0116.inc
+++ src/interface/GL.EXT.texture3D.0116.inc
@@ -967,7 +967,7 @@
     arg9 = (GLenum) PyInt_AsLong(obj8);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj9 == Py_None) 
         {
--- src/interface/GL.GL__init___.0100.inc
+++ src/interface/GL.GL__init___.0100.inc
@@ -6242,7 +6242,7 @@
     arg4 = (GLenum) PyInt_AsLong(obj3);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj4 == Py_None) 
         {
@@ -8923,7 +8923,7 @@
     
     if(!PyArg_ParseTuple(args,(char *)"O:glPolygonStipple",&obj0)) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj0 == Py_None) 
         {
@@ -10759,7 +10759,7 @@
     arg7 = (GLenum) PyInt_AsLong(obj6);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj7 == Py_None) 
         {
@@ -11106,7 +11106,7 @@
     arg8 = (GLenum) PyInt_AsLong(obj7);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj8 == Py_None) 
         {
@@ -11607,7 +11607,7 @@
     arg6 = (GLenum) PyInt_AsLong(obj5);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj6 == Py_None) 
         {
@@ -11947,7 +11947,7 @@
     arg8 = (GLenum) PyInt_AsLong(obj7);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj8 == Py_None) 
         {
--- src/interface/GL.GL__init___.0101.inc
+++ src/interface/GL.GL__init___.0101.inc
@@ -6779,7 +6779,7 @@
     arg3 = (GLenum) PyInt_AsLong(obj2);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj3 == Py_None) 
         {
@@ -6926,7 +6926,7 @@
     arg4 = (GLenum) PyInt_AsLong(obj3);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj4 == Py_None) 
         {
@@ -10050,7 +10050,7 @@
     
     if(!PyArg_ParseTuple(args,(char *)"O:glPolygonStipple",&obj0)) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj0 == Py_None) 
         {
@@ -12082,7 +12082,7 @@
     arg7 = (GLenum) PyInt_AsLong(obj6);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj7 == Py_None) 
         {
@@ -12429,7 +12429,7 @@
     arg8 = (GLenum) PyInt_AsLong(obj7);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj8 == Py_None) 
         {
@@ -12930,7 +12930,7 @@
     arg6 = (GLenum) PyInt_AsLong(obj5);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj6 == Py_None) 
         {
@@ -13270,7 +13270,7 @@
     arg8 = (GLenum) PyInt_AsLong(obj7);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj8 == Py_None) 
         {
--- src/interface/GL.SGI.color_table.0120.inc
+++ src/interface/GL.SGI.color_table.0120.inc
@@ -1037,7 +1037,7 @@
     arg5 = (GLenum) PyInt_AsLong(obj4);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj5 == Py_None) 
         {
--- src/interface/GL.SGIS.texture4D.0119.inc
+++ src/interface/GL.SGIS.texture4D.0119.inc
@@ -1014,7 +1014,7 @@
     arg10 = (GLenum) PyInt_AsLong(obj9);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj10 == Py_None) 
         {
@@ -1491,7 +1491,7 @@
     arg12 = (GLenum) PyInt_AsLong(obj11);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj12 == Py_None) 
         {
--- src/interface/GLU.GLU__init___.0100.inc
+++ src/interface/GLU.GLU__init___.0100.inc
@@ -2572,7 +2572,7 @@
     arg5 = (GLenum) PyInt_AsLong(obj4);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj5 == Py_None) 
         {
@@ -2927,7 +2927,7 @@
     arg6 = (GLenum) PyInt_AsLong(obj5);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj6 == Py_None) 
         {
--- src/interface/GLU.GLU__init___.0101.inc
+++ src/interface/GLU.GLU__init___.0101.inc
@@ -2600,7 +2600,7 @@
     arg5 = (GLenum) PyInt_AsLong(obj4);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj5 == Py_None) 
         {
@@ -2955,7 +2955,7 @@
     arg6 = (GLenum) PyInt_AsLong(obj5);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj6 == Py_None) 
         {
--- src/interface/GLU.GLU__init___.0102.inc
+++ src/interface/GLU.GLU__init___.0102.inc
@@ -2626,7 +2626,7 @@
     arg5 = (GLenum) PyInt_AsLong(obj4);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj5 == Py_None) 
         {
@@ -2981,7 +2981,7 @@
     arg6 = (GLenum) PyInt_AsLong(obj5);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj6 == Py_None) 
         {
--- src/interface/GLU.GLU__init___.0103.inc
+++ src/interface/GLU.GLU__init___.0103.inc
@@ -2906,7 +2906,7 @@
     arg5 = (GLenum) PyInt_AsLong(obj4);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj5 == Py_None) 
         {
@@ -3261,7 +3261,7 @@
     arg6 = (GLenum) PyInt_AsLong(obj5);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj6 == Py_None) 
         {
@@ -3659,7 +3659,7 @@
     arg7 = (GLenum) PyInt_AsLong(obj6);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj7 == Py_None) 
         {
@@ -4100,7 +4100,7 @@
     arg5 = (GLenum) PyInt_AsLong(obj4);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj8 == Py_None) 
         {
@@ -4479,7 +4479,7 @@
     arg6 = (GLenum) PyInt_AsLong(obj5);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj9 == Py_None) 
         {
@@ -4901,7 +4901,7 @@
     arg7 = (GLenum) PyInt_AsLong(obj6);
     if (PyErr_Occurred()) return NULL;
     {
-        int len;
+        Py_ssize_t len;
         PyObject* str;
         if (obj10 == Py_None) 
         {
--- 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;
@@ -777,9 +777,9 @@
 
 
 #if PY_VERSION_HEX < 0x02000000
-int PyString_AsStringAndSize(PyObject *obj,	char **s, int *len)
+Py_ssize_t PyString_AsStringAndSize(PyObject *obj,	char **s, Py_ssize_t *len)
 {
-	int l = PyString_Size(obj);
+	Py_ssize_t l = PyString_Size(obj);
 
 	if (s) *s = PyString_AsString(obj);
 	if (len) *len = l;