1
1
2
+ %ModuleHeaderCode
3
+ // From Python 2.5, some functions use Py_ssize_t instead of int
4
+ // thus this typedef is for maintaining backward compatibility
5
+ // for older versions of Python
6
+ #if (PY_VERSION_HEX < 0x02050000)
7
+ typedef int Py_ssize_t;
8
+ #endif
9
+ %End
2
10
3
11
%MappedType QSet<int>
4
12
{
@@ -104,13 +112,13 @@ template<TYPE>
104
112
if (!PyDict_Check(sipPy))
105
113
return 0;
106
114
107
- int i = 0;
115
+ Py_ssize_t i = 0;
108
116
while (PyDict_Next(sipPy, &i, &kobj, &tobj))
109
117
{
110
118
if (!PyDict_Check(tobj))
111
119
return 0;
112
120
113
- int j = 0;
121
+ Py_ssize_t j = 0;
114
122
while (PyDict_Next(tobj, &j, &kobj2, &tobj2))
115
123
{
116
124
if (!sipCanConvertToInstance(tobj2, sipClass_TYPE, SIP_NOT_NONE))
@@ -124,7 +132,7 @@ template<TYPE>
124
132
QMap<int, QMap<int, TYPE> > *qm = new QMap<int, QMap<int, TYPE> >;
125
133
126
134
127
- int i = 0;
135
+ Py_ssize_t i = 0;
128
136
while (PyDict_Next(sipPy, &i, &kobj, &tobj))
129
137
{
130
138
int k = PyInt_AsLong(kobj);
@@ -134,7 +142,7 @@ template<TYPE>
134
142
135
143
QMap<int, TYPE> qm2;
136
144
137
- int j = 0;
145
+ Py_ssize_t j = 0;
138
146
while (PyDict_Next(tobj, &j, &kobj2, &tobj2))
139
147
{
140
148
int k2 = PyInt_AsLong(kobj2);
0 commit comments