Codebase list pygame-sdl2 / 69359bb
New upstream version 7.1.1 Markus Koschany 5 years ago
26 changed file(s) with 34500 addition(s) and 15810 deletion(s). Raw diff Collapse all Expand all
00 Metadata-Version: 1.0
11 Name: pygame_sdl2
2 Version: 2.1.0-for-renpy-7.1.0
2 Version: 2.1.0-for-renpy-7.1.1
33 Summary: UNKNOWN
44 Home-page: https://github.com/renpy/pygame_sdl2
55 Author: Tom Rothamel
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
88 #else
9 #define CYTHON_ABI "0_25_2"
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
102120 #define CYTHON_COMPILING_IN_CPYTHON 1
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
105129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412552
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
423555 #define __PYX_EXTERN_C extern "C"
428560
429561 #define __PYX_HAVE__pygame_sdl2__color
430562 #define __PYX_HAVE_API__pygame_sdl2__color
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
437570 #include <omp.h>
438571 #endif /* _OPENMP */
439572
440 #ifdef PYREX_WITHOUT_ASSERTIONS
573 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
441574 #define CYTHON_WITHOUT_ASSERTIONS
442575 #endif
443576
468601 #define __Pyx_sst_abs(value) abs(value)
469602 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
470603 #define __Pyx_sst_abs(value) labs(value)
471 #elif defined (_MSC_VER) && defined (_M_X64)
472 #define __Pyx_sst_abs(value) _abs64(value)
604 #elif defined (_MSC_VER)
605 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
473606 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
474607 #define __Pyx_sst_abs(value) llabs(value)
475608 #elif defined (__GNUC__)
477610 #else
478611 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
479612 #endif
480 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
481 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
613 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
614 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
482615 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
483616 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
484617 #define __Pyx_PyBytes_FromString PyBytes_FromString
491624 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
492625 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
493626 #endif
494 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
495 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
627 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
628 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
629 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
634 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
635 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
496638 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
497639 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
498640 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
499641 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
500642 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
501 #if PY_MAJOR_VERSION < 3
502 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
503 {
643 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
504644 const Py_UNICODE *u_end = u;
505645 while (*u_end++) ;
506646 return (size_t)(u_end - u - 1);
507647 }
508 #else
509 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
510 #endif
511648 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
512649 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
513650 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
514651 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
515652 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
516 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
653 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
517654 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
518655 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
656 #define __Pyx_PySequence_Tuple(obj)\
657 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
519658 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
520659 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
521660 #if CYTHON_ASSUME_SAFE_MACROS
614753 #define likely(x) (x)
615754 #define unlikely(x) (x)
616755 #endif /* __GNUC__ */
617
618 static PyObject *__pyx_m;
756 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
757
758 static PyObject *__pyx_m = NULL;
619759 static PyObject *__pyx_d;
620760 static PyObject *__pyx_b;
761 static PyObject *__pyx_cython_runtime = NULL;
621762 static PyObject *__pyx_empty_tuple;
622763 static PyObject *__pyx_empty_bytes;
623764 static PyObject *__pyx_empty_unicode;
751892
752893 /* PyObjectGetAttrStr.proto */
753894 #if CYTHON_USE_TYPE_SLOTS
754 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
755 PyTypeObject* tp = Py_TYPE(obj);
756 if (likely(tp->tp_getattro))
757 return tp->tp_getattro(obj, attr_name);
758 #if PY_MAJOR_VERSION < 3
759 if (likely(tp->tp_getattr))
760 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
761 #endif
762 return PyObject_GetAttr(obj, attr_name);
763 }
895 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
764896 #else
765897 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
766898 #endif
790922 /* PyThreadStateGet.proto */
791923 #if CYTHON_FAST_THREAD_STATE
792924 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
793 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
925 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
926 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
794927 #else
795928 #define __Pyx_PyThreadState_declare
796929 #define __Pyx_PyThreadState_assign
930 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
797931 #endif
798932
799933 /* PyErrFetchRestore.proto */
800934 #if CYTHON_FAST_THREAD_STATE
935 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
801936 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
802937 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
803938 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
804939 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
805940 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
806941 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
942 #if CYTHON_COMPILING_IN_CPYTHON
943 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
807944 #else
945 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
946 #endif
947 #else
948 #define __Pyx_PyErr_Clear() PyErr_Clear()
949 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
808950 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
809951 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
952 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
953 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
810954 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
811955 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
812956 #endif
814958 /* RaiseException.proto */
815959 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
816960
961 /* PyCFunctionFastCall.proto */
962 #if CYTHON_FAST_PYCCALL
963 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
964 #else
965 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
966 #endif
967
968 /* PyFunctionFastCall.proto */
969 #if CYTHON_FAST_PYCALL
970 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
971 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
972 #if 1 || PY_VERSION_HEX < 0x030600B1
973 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
974 #else
975 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
976 #endif
977 #endif
978
979 /* PyObjectCallMethO.proto */
980 #if CYTHON_COMPILING_IN_CPYTHON
981 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
982 #endif
983
984 /* PyObjectCallOneArg.proto */
985 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
986
817987 /* FetchCommonType.proto */
818988 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
819989
820990 /* CythonFunction.proto */
821991 #define __Pyx_CyFunction_USED 1
822 #include <structmember.h>
823992 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
824993 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
825994 #define __Pyx_CYFUNCTION_CCLASS 0x04
8741043 /* GetModuleGlobalName.proto */
8751044 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
8761045
877 /* PyCFunctionFastCall.proto */
878 #if CYTHON_FAST_PYCCALL
879 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
880 #else
881 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
882 #endif
883
884 /* PyFunctionFastCall.proto */
885 #if CYTHON_FAST_PYCALL
886 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
887 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
888 #if 1 || PY_VERSION_HEX < 0x030600B1
889 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
890 #else
891 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
892 #endif
893 #endif
894
895 /* PyObjectCallMethO.proto */
896 #if CYTHON_COMPILING_IN_CPYTHON
897 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
898 #endif
899
900 /* PyObjectCallOneArg.proto */
901 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
902
9031046 /* SaveResetException.proto */
9041047 #if CYTHON_FAST_THREAD_STATE
9051048 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
9411084 #else
9421085 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
9431086 #endif
944
945 /* ArgTypeTest.proto */
946 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
947 const char *name, int exact);
948
949 /* RaiseArgTupleInvalid.proto */
950 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
951 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
952
953 /* KeywordStringCheck.proto */
954 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
9551087
9561088 /* GetItemInt.proto */
9571089 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
9711103 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
9721104 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
9731105 int wraparound, int boundscheck);
974 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1106 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
9751107 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
9761108 int is_list, int wraparound, int boundscheck);
1109
1110 /* ObjectGetItem.proto */
1111 #if CYTHON_USE_TYPE_SLOTS
1112 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1113 #else
1114 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1115 #endif
1116
1117 /* RaiseArgTupleInvalid.proto */
1118 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1119 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1120
1121 /* KeywordStringCheck.proto */
1122 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
9771123
9781124 /* SliceObject.proto */
9791125 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
9801126 PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
9811127 PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
9821128 int has_cstart, int has_cstop, int wraparound);
1129
1130 /* DictGetItem.proto */
1131 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1132 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1133 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1134 (likely(PyDict_CheckExact(obj)) ?\
1135 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1136 #else
1137 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1138 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1139 #endif
9831140
9841141 /* PyIntBinop.proto */
9851142 #if !CYTHON_COMPILING_IN_PYPY
9891146 PyObject_RichCompare(op1, op2, Py_EQ)
9901147 #endif
9911148
1149 /* ArgTypeTest.proto */
1150 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1151 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1152 __Pyx__ArgTypeTest(obj, type, name, exact))
1153 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1154
9921155 /* RaiseDoubleKeywords.proto */
9931156 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
9941157
10161179 (inplace ? PyNumber_InPlaceRemainder(op1, op2) : PyNumber_Remainder(op1, op2))
10171180 #endif
10181181
1182 /* pow2.proto */
1183 #define __Pyx_PyNumber_Power2(a, b) PyNumber_Power(a, b, Py_None)
1184
10191185 /* PyFloatBinop.proto */
10201186 #if !CYTHON_COMPILING_IN_PYPY
10211187 static PyObject* __Pyx_PyFloat_TrueDivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace);
10271193 /* None.proto */
10281194 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
10291195
1030 /* pow2.proto */
1031 #define __Pyx_PyNumber_Power2(a, b) PyNumber_Power(a, b, Py_None)
1032
10331196 /* IncludeStringH.proto */
10341197 #include <string.h>
10351198
1199 /* PyObject_GenericGetAttrNoDict.proto */
1200 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1201 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1202 #else
1203 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1204 #endif
1205
1206 /* PyObject_GenericGetAttr.proto */
1207 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1208 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1209 #else
1210 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1211 #endif
1212
10361213 /* SetVTable.proto */
10371214 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
10381215
10391216 /* Import.proto */
10401217 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1218
1219 /* CLineInTraceback.proto */
1220 #ifdef CYTHON_CLINE_IN_TRACEBACK
1221 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1222 #else
1223 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1224 #endif
10411225
10421226 /* CodeObjectCache.proto */
10431227 typedef struct {
10761260 /* CIntFromPy.proto */
10771261 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
10781262
1263 /* FastTypeChecks.proto */
1264 #if CYTHON_COMPILING_IN_CPYTHON
1265 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1266 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1267 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1268 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1269 #else
1270 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1271 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1272 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1273 #endif
1274 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1275
10791276 /* CheckBinaryVersion.proto */
10801277 static int __Pyx_check_binary_version(void);
10811278
11041301 static PyTypeObject *__pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma = 0;
11051302 static PyObject *__pyx_v_11pygame_sdl2_5color_colors = 0;
11061303 #define __Pyx_MODULE_NAME "pygame_sdl2.color"
1304 extern int __pyx_module_is_main_pygame_sdl2__color;
11071305 int __pyx_module_is_main_pygame_sdl2__color = 0;
11081306
11091307 /* Implementation of 'pygame_sdl2.color' */
18292027 static const char __pyx_k_mod___locals_mod[] = "__mod__.<locals>.mod";
18302028 static const char __pyx_k_mediumspringgreen[] = "mediumspringgreen";
18312029 static const char __pyx_k_pygame_sdl2_color[] = "pygame_sdl2.color";
2030 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
18322031 static const char __pyx_k_lightgoldenrodyellow[] = "lightgoldenrodyellow";
18332032 static const char __pyx_k_floordiv___locals_div[] = "__floordiv__.<locals>.div";
18342033 static const char __pyx_k_src_pygame_sdl2_color_pyx[] = "src/pygame_sdl2/color.pyx";
19062105 static PyObject *__pyx_n_u_chocolate2;
19072106 static PyObject *__pyx_n_u_chocolate3;
19082107 static PyObject *__pyx_n_u_chocolate4;
2108 static PyObject *__pyx_n_s_cline_in_traceback;
19092109 static PyObject *__pyx_n_u_coral;
19102110 static PyObject *__pyx_n_u_coral1;
19112111 static PyObject *__pyx_n_u_coral2;
25592759 static int __pyx_pf_11pygame_sdl2_5color_5Color_4__init__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
25602760 static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_6__repr__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */
25612761 static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_8__int__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */
2562 #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
2762 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
25632763 static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_10__hex__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */
25642764 #endif
2565 #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
2765 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
25662766 static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_12__oct__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */
25672767 #endif
25682768 static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_14__float__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self); /* proto */
25762776 static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_30__sub__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */
25772777 static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_7__mod___mod(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_l, PyObject *__pyx_v_r); /* proto */
25782778 static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_32__mod__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */
2579 #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
2779 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
25802780 static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_34__div__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs); /* proto */
25812781 #endif
25822782 static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_12__floordiv___div(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */
35253725 static PyObject *__pyx_tuple__686;
35263726 static PyObject *__pyx_tuple__687;
35273727 static PyObject *__pyx_codeobj__11;
3728 /* Late includes */
35283729
35293730 /* "pygame_sdl2/color.pyx":26
35303731 * include "color_dict.pxi"
35903791 __pyx_t_1 = __pyx_t_4;
35913792 goto __pyx_L4_bool_binop_done;
35923793 }
3593 __pyx_t_5 = PyObject_Length(__pyx_v_color); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 33, __pyx_L1_error)
3794 __pyx_t_5 = PyObject_Length(__pyx_v_color); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 33, __pyx_L1_error)
35943795 __pyx_t_4 = ((__pyx_t_5 == 4) != 0);
35953796 __pyx_t_1 = __pyx_t_4;
35963797 __pyx_L4_bool_binop_done:;
36053806 */
36063807 if ((likely(PyTuple_CheckExact(__pyx_v_color))) || (PyList_CheckExact(__pyx_v_color))) {
36073808 PyObject* sequence = __pyx_v_color;
3608 #if !CYTHON_COMPILING_IN_PYPY
3609 Py_ssize_t size = Py_SIZE(sequence);
3610 #else
3611 Py_ssize_t size = PySequence_Size(sequence);
3612 #endif
3809 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
36133810 if (unlikely(size != 4)) {
36143811 if (size > 4) __Pyx_RaiseTooManyValuesError(4);
36153812 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
37183915 __pyx_t_1 = __pyx_t_3;
37193916 goto __pyx_L11_bool_binop_done;
37203917 }
3721 __pyx_t_5 = PyObject_Length(__pyx_v_color); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 35, __pyx_L1_error)
3918 __pyx_t_5 = PyObject_Length(__pyx_v_color); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 35, __pyx_L1_error)
37223919 __pyx_t_3 = ((__pyx_t_5 == 3) != 0);
37233920 __pyx_t_1 = __pyx_t_3;
37243921 __pyx_L11_bool_binop_done:;
37333930 */
37343931 if ((likely(PyTuple_CheckExact(__pyx_v_color))) || (PyList_CheckExact(__pyx_v_color))) {
37353932 PyObject* sequence = __pyx_v_color;
3736 #if !CYTHON_COMPILING_IN_PYPY
3737 Py_ssize_t size = Py_SIZE(sequence);
3738 #else
3739 Py_ssize_t size = PySequence_Size(sequence);
3740 #endif
3933 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
37413934 if (unlikely(size != 3)) {
37423935 if (size > 3) __Pyx_RaiseTooManyValuesError(3);
37433936 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
38244017 */
38254018 __pyx_t_1 = PyInt_Check(__pyx_v_color);
38264019 __pyx_t_3 = (__pyx_t_1 != 0);
3827 if (__pyx_t_3) {
4020 if (likely(__pyx_t_3)) {
38284021
38294022 /* "pygame_sdl2/color.pyx":39
38304023 * a = 255
39994192 int __pyx_t_1;
40004193 int __pyx_t_2;
40014194 PyObject *__pyx_t_3 = NULL;
4002 PyObject *__pyx_t_4 = NULL;
4003 Uint8 __pyx_t_5;
4195 Uint8 __pyx_t_4;
40044196 __Pyx_RefNannySetupContext("to_sdl_color", 0);
40054197 __Pyx_INCREF(__pyx_v_color);
40064198
40224214 * out.r = color.r
40234215 * out.g = color.g
40244216 */
4025 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error)
4217 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error)
40264218 __Pyx_GOTREF(__pyx_t_3);
4027 __Pyx_INCREF(__pyx_v_color);
4028 __Pyx_GIVEREF(__pyx_v_color);
4029 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_color);
4030 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error)
4031 __Pyx_GOTREF(__pyx_t_4);
4032 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4033 __Pyx_DECREF_SET(__pyx_v_color, __pyx_t_4);
4034 __pyx_t_4 = 0;
4219 __Pyx_DECREF_SET(__pyx_v_color, __pyx_t_3);
4220 __pyx_t_3 = 0;
40354221
40364222 /* "pygame_sdl2/color.pyx":56
40374223 *
40494235 * out.g = color.g
40504236 * out.b = color.b
40514237 */
4052 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error)
4053 __Pyx_GOTREF(__pyx_t_4);
4054 __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_4); if (unlikely((__pyx_t_5 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error)
4055 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4056 __pyx_v_out->r = __pyx_t_5;
4238 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error)
4239 __Pyx_GOTREF(__pyx_t_3);
4240 __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error)
4241 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4242 __pyx_v_out->r = __pyx_t_4;
40574243
40584244 /* "pygame_sdl2/color.pyx":59
40594245 * color = Color(color)
40624248 * out.b = color.b
40634249 * out.a = color.a
40644250 */
4065 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_g); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 59, __pyx_L1_error)
4066 __Pyx_GOTREF(__pyx_t_4);
4067 __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_4); if (unlikely((__pyx_t_5 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error)
4068 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4069 __pyx_v_out->g = __pyx_t_5;
4251 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_g); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error)
4252 __Pyx_GOTREF(__pyx_t_3);
4253 __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error)
4254 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4255 __pyx_v_out->g = __pyx_t_4;
40704256
40714257 /* "pygame_sdl2/color.pyx":60
40724258 * out.r = color.r
40754261 * out.a = color.a
40764262 *
40774263 */
4078 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_b); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 60, __pyx_L1_error)
4079 __Pyx_GOTREF(__pyx_t_4);
4080 __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_4); if (unlikely((__pyx_t_5 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
4081 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4082 __pyx_v_out->b = __pyx_t_5;
4264 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error)
4265 __Pyx_GOTREF(__pyx_t_3);
4266 __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
4267 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4268 __pyx_v_out->b = __pyx_t_4;
40834269
40844270 /* "pygame_sdl2/color.pyx":61
40854271 * out.g = color.g
40884274 *
40894275 * cdef class Color:
40904276 */
4091 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error)
4092 __Pyx_GOTREF(__pyx_t_4);
4093 __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_t_4); if (unlikely((__pyx_t_5 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error)
4094 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4095 __pyx_v_out->a = __pyx_t_5;
4277 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_color, __pyx_n_s_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error)
4278 __Pyx_GOTREF(__pyx_t_3);
4279 __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_t_3); if (unlikely((__pyx_t_4 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 61, __pyx_L1_error)
4280 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4281 __pyx_v_out->a = __pyx_t_4;
40964282
40974283 /* "pygame_sdl2/color.pyx":55
40984284 * return Color(r, g, b, a)
41074293 goto __pyx_L0;
41084294 __pyx_L1_error:;
41094295 __Pyx_XDECREF(__pyx_t_3);
4110 __Pyx_XDECREF(__pyx_t_4);
41114296 __Pyx_AddTraceback("pygame_sdl2.color.to_sdl_color", __pyx_clineno, __pyx_lineno, __pyx_filename);
41124297 __pyx_r = 0;
41134298 __pyx_L0:;
42784463 * c = "".join(map(lambda x: x*2, c))
42794464 *
42804465 */
4281 __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 72, __pyx_L1_error)
4466 __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 72, __pyx_L1_error)
42824467 __pyx_t_3 = ((__pyx_t_2 == 3) != 0);
42834468 if (!__pyx_t_3) {
42844469 } else {
42854470 __pyx_t_1 = __pyx_t_3;
42864471 goto __pyx_L4_bool_binop_done;
42874472 }
4288 __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 72, __pyx_L1_error)
4473 __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 72, __pyx_L1_error)
42894474 __pyx_t_3 = ((__pyx_t_2 == 4) != 0);
42904475 __pyx_t_1 = __pyx_t_3;
42914476 __pyx_L4_bool_binop_done:;
43494534 * r, g, b = struct.unpack('BBB', binascii.unhexlify(c))
43504535 * a = 255
43514536 */
4352 __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 76, __pyx_L6_error)
4537 __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 76, __pyx_L6_error)
43534538 __pyx_t_1 = ((__pyx_t_2 == 6) != 0);
43544539 if (__pyx_t_1) {
43554540
44624647 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
44634648 if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
44644649 PyObject* sequence = __pyx_t_5;
4465 #if !CYTHON_COMPILING_IN_PYPY
4466 Py_ssize_t size = Py_SIZE(sequence);
4467 #else
4468 Py_ssize_t size = PySequence_Size(sequence);
4469 #endif
4650 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
44704651 if (unlikely(size != 3)) {
44714652 if (size > 3) __Pyx_RaiseTooManyValuesError(3);
44724653 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
45004681 __Pyx_GOTREF(__pyx_t_11);
45014682 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
45024683 __pyx_t_14 = Py_TYPE(__pyx_t_11)->tp_iternext;
4503 index = 0; __pyx_t_9 = __pyx_t_14(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L15_unpacking_failed;
4684 index = 0; __pyx_t_9 = __pyx_t_14(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L13_unpacking_failed;
45044685 __Pyx_GOTREF(__pyx_t_9);
4505 index = 1; __pyx_t_12 = __pyx_t_14(__pyx_t_11); if (unlikely(!__pyx_t_12)) goto __pyx_L15_unpacking_failed;
4686 index = 1; __pyx_t_12 = __pyx_t_14(__pyx_t_11); if (unlikely(!__pyx_t_12)) goto __pyx_L13_unpacking_failed;
45064687 __Pyx_GOTREF(__pyx_t_12);
4507 index = 2; __pyx_t_4 = __pyx_t_14(__pyx_t_11); if (unlikely(!__pyx_t_4)) goto __pyx_L15_unpacking_failed;
4688 index = 2; __pyx_t_4 = __pyx_t_14(__pyx_t_11); if (unlikely(!__pyx_t_4)) goto __pyx_L13_unpacking_failed;
45084689 __Pyx_GOTREF(__pyx_t_4);
45094690 if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_11), 3) < 0) __PYX_ERR(0, 77, __pyx_L6_error)
45104691 __pyx_t_14 = NULL;
45114692 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4512 goto __pyx_L16_unpacking_done;
4513 __pyx_L15_unpacking_failed:;
4693 goto __pyx_L14_unpacking_done;
4694 __pyx_L13_unpacking_failed:;
45144695 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
45154696 __pyx_t_14 = NULL;
45164697 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
45174698 __PYX_ERR(0, 77, __pyx_L6_error)
4518 __pyx_L16_unpacking_done:;
4699 __pyx_L14_unpacking_done:;
45194700 }
45204701 __pyx_v_r = __pyx_t_9;
45214702 __pyx_t_9 = 0;
45414722 * r, g, b = struct.unpack('BBB', binascii.unhexlify(c))
45424723 * a = 255
45434724 */
4544 goto __pyx_L14;
4725 goto __pyx_L12;
45454726 }
45464727
45474728 /* "pygame_sdl2/color.pyx":79
45514732 * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c))
45524733 * else:
45534734 */
4554 __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 79, __pyx_L6_error)
4735 __pyx_t_2 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 79, __pyx_L6_error)
45554736 __pyx_t_1 = ((__pyx_t_2 == 8) != 0);
4556 if (__pyx_t_1) {
4737 if (likely(__pyx_t_1)) {
45574738
45584739 /* "pygame_sdl2/color.pyx":80
45594740 * a = 255
46644845 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
46654846 if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
46664847 PyObject* sequence = __pyx_t_5;
4667 #if !CYTHON_COMPILING_IN_PYPY
4668 Py_ssize_t size = Py_SIZE(sequence);
4669 #else
4670 Py_ssize_t size = PySequence_Size(sequence);
4671 #endif
4848 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
46724849 if (unlikely(size != 4)) {
46734850 if (size > 4) __Pyx_RaiseTooManyValuesError(4);
46744851 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
47104887 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
47114888 __pyx_t_14 = Py_TYPE(__pyx_t_9)->tp_iternext;
47124889 for (index=0; index < 4; index++) {
4713 PyObject* item = __pyx_t_14(__pyx_t_9); if (unlikely(!item)) goto __pyx_L17_unpacking_failed;
4890 PyObject* item = __pyx_t_14(__pyx_t_9); if (unlikely(!item)) goto __pyx_L15_unpacking_failed;
47144891 __Pyx_GOTREF(item);
47154892 *(temps[index]) = item;
47164893 }
47174894 if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_9), 4) < 0) __PYX_ERR(0, 80, __pyx_L6_error)
47184895 __pyx_t_14 = NULL;
47194896 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4720 goto __pyx_L18_unpacking_done;
4721 __pyx_L17_unpacking_failed:;
4897 goto __pyx_L16_unpacking_done;
4898 __pyx_L15_unpacking_failed:;
47224899 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
47234900 __pyx_t_14 = NULL;
47244901 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
47254902 __PYX_ERR(0, 80, __pyx_L6_error)
4726 __pyx_L18_unpacking_done:;
4903 __pyx_L16_unpacking_done:;
47274904 }
47284905 __pyx_v_r = __pyx_t_12;
47294906 __pyx_t_12 = 0;
47414918 * r, g, b, a = struct.unpack('BBBB', binascii.unhexlify(c))
47424919 * else:
47434920 */
4744 goto __pyx_L14;
4921 goto __pyx_L12;
47454922 }
47464923
47474924 /* "pygame_sdl2/color.pyx":82
47524929 * raise ValueError(c)
47534930 */
47544931 /*else*/ {
4755 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L6_error)
4932 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_c); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L6_error)
47564933 __Pyx_GOTREF(__pyx_t_5);
4757 __Pyx_INCREF(__pyx_v_c);
4758 __Pyx_GIVEREF(__pyx_v_c);
4759 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_c);
4760 __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 82, __pyx_L6_error)
4761 __Pyx_GOTREF(__pyx_t_11);
4934 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
47624935 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4763 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
4764 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
47654936 __PYX_ERR(0, 82, __pyx_L6_error)
47664937 }
4767 __pyx_L14:;
4938 __pyx_L12:;
47684939
47694940 /* "pygame_sdl2/color.pyx":75
47704941 * c = "".join(map(lambda x: x*2, c))
47774948 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
47784949 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
47794950 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4780 goto __pyx_L13_try_end;
4951 goto __pyx_L11_try_end;
47814952 __pyx_L6_error:;
4782 __Pyx_PyThreadState_assign
47834953 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
47844954 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
47854955 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
47864956 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4957 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
47874958 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4788 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
47894959
47904960 /* "pygame_sdl2/color.pyx":83
47914961 * else:
47974967 __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
47984968 if (__pyx_t_13) {
47994969 __Pyx_AddTraceback("pygame_sdl2.color.Color.from_hex", __pyx_clineno, __pyx_lineno, __pyx_filename);
4800 if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(0, 83, __pyx_L8_except_error)
4970 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_11, &__pyx_t_4) < 0) __PYX_ERR(0, 83, __pyx_L8_except_error)
4971 __Pyx_GOTREF(__pyx_t_5);
48014972 __Pyx_GOTREF(__pyx_t_11);
4802 __Pyx_GOTREF(__pyx_t_5);
48034973 __Pyx_GOTREF(__pyx_t_4);
4804 __Pyx_INCREF(__pyx_t_5);
4805 __pyx_v_e = __pyx_t_5;
4974 __Pyx_INCREF(__pyx_t_11);
4975 __pyx_v_e = __pyx_t_11;
48064976 /*try:*/ {
48074977
48084978 /* "pygame_sdl2/color.pyx":84
48124982 *
48134983 * self.from_rgba(r, g, b, a)
48144984 */
4815 __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 84, __pyx_L24_error)
4985 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_c); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 84, __pyx_L22_error)
48164986 __Pyx_GOTREF(__pyx_t_10);
4817 __Pyx_INCREF(__pyx_v_c);
4818 __Pyx_GIVEREF(__pyx_v_c);
4819 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_c);
4820 __pyx_t_12 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 84, __pyx_L24_error)
4821 __Pyx_GOTREF(__pyx_t_12);
4987 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
48224988 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4823 __Pyx_Raise(__pyx_t_12, 0, 0, 0);
4824 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4825 __PYX_ERR(0, 84, __pyx_L24_error)
4989 __PYX_ERR(0, 84, __pyx_L22_error)
48264990 }
48274991
48284992 /* "pygame_sdl2/color.pyx":83
48334997 *
48344998 */
48354999 /*finally:*/ {
5000 __pyx_L22_error:;
48365001 /*exception exit:*/{
48375002 __Pyx_PyThreadState_declare
4838 __pyx_L24_error:;
5003 __Pyx_PyThreadState_assign
48395004 __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
4840 __Pyx_PyThreadState_assign
48415005 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5006 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
48425007 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4843 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
48445008 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
48455009 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
48465010 __Pyx_XGOTREF(__pyx_t_17);
48545018 __Pyx_DECREF(__pyx_v_e);
48555019 __pyx_v_e = NULL;
48565020 }
4857 __Pyx_PyThreadState_assign
48585021 if (PY_MAJOR_VERSION >= 3) {
48595022 __Pyx_XGIVEREF(__pyx_t_20);
48605023 __Pyx_XGIVEREF(__pyx_t_21);
48815044 * if len(c) == 6:
48825045 * r, g, b = struct.unpack('BBB', binascii.unhexlify(c))
48835046 */
4884 __Pyx_PyThreadState_assign
48855047 __Pyx_XGIVEREF(__pyx_t_6);
48865048 __Pyx_XGIVEREF(__pyx_t_7);
48875049 __Pyx_XGIVEREF(__pyx_t_8);
48885050 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
48895051 goto __pyx_L1_error;
4890 __pyx_L13_try_end:;
5052 __pyx_L11_try_end:;
48915053 }
48925054
48935055 /* "pygame_sdl2/color.pyx":86
50535215 * except KeyError as e:
50545216 * raise ValueError(c)
50555217 */
5056 __pyx_t_1 = PyObject_GetItem(__pyx_v_11pygame_sdl2_5color_colors, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L3_error)
5218 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_11pygame_sdl2_5color_colors, __pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L3_error)
50575219 __Pyx_GOTREF(__pyx_t_1);
50585220 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
50595221 PyObject* sequence = __pyx_t_1;
5060 #if !CYTHON_COMPILING_IN_PYPY
5061 Py_ssize_t size = Py_SIZE(sequence);
5062 #else
5063 Py_ssize_t size = PySequence_Size(sequence);
5064 #endif
5222 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
50655223 if (unlikely(size != 3)) {
50665224 if (size > 3) __Pyx_RaiseTooManyValuesError(3);
50675225 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
50955253 __Pyx_GOTREF(__pyx_t_8);
50965254 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
50975255 __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
5098 index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L11_unpacking_failed;
5256 index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_2)) goto __pyx_L9_unpacking_failed;
50995257 __Pyx_GOTREF(__pyx_t_2);
5100 index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L11_unpacking_failed;
5258 index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L9_unpacking_failed;
51015259 __Pyx_GOTREF(__pyx_t_3);
5102 index = 2; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L11_unpacking_failed;
5260 index = 2; __pyx_t_4 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_4)) goto __pyx_L9_unpacking_failed;
51035261 __Pyx_GOTREF(__pyx_t_4);
51045262 if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(0, 93, __pyx_L3_error)
51055263 __pyx_t_9 = NULL;
51065264 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5107 goto __pyx_L12_unpacking_done;
5108 __pyx_L11_unpacking_failed:;
5265 goto __pyx_L10_unpacking_done;
5266 __pyx_L9_unpacking_failed:;
51095267 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
51105268 __pyx_t_9 = NULL;
51115269 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
51125270 __PYX_ERR(0, 93, __pyx_L3_error)
5113 __pyx_L12_unpacking_done:;
5271 __pyx_L10_unpacking_done:;
51145272 }
51155273 __pyx_v_r = __pyx_t_2;
51165274 __pyx_t_2 = 0;
51305288 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
51315289 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
51325290 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5133 goto __pyx_L10_try_end;
5291 goto __pyx_L8_try_end;
51345292 __pyx_L3_error:;
5135 __Pyx_PyThreadState_assign
51365293 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
51375294 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
51385295 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
51645321 * self.from_rgba(r, g, b, 255)
51655322 *
51665323 */
5167 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L18_error)
5324 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L16_error)
51685325 __Pyx_GOTREF(__pyx_t_2);
5169 __Pyx_INCREF(__pyx_v_c);
5170 __Pyx_GIVEREF(__pyx_v_c);
5171 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_c);
5172 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 95, __pyx_L18_error)
5173 __Pyx_GOTREF(__pyx_t_8);
5326 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
51745327 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5175 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
5176 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5177 __PYX_ERR(0, 95, __pyx_L18_error)
5328 __PYX_ERR(0, 95, __pyx_L16_error)
51785329 }
51795330
51805331 /* "pygame_sdl2/color.pyx":94
51855336 * self.from_rgba(r, g, b, 255)
51865337 */
51875338 /*finally:*/ {
5339 __pyx_L16_error:;
51885340 /*exception exit:*/{
51895341 __Pyx_PyThreadState_declare
5190 __pyx_L18_error:;
5342 __Pyx_PyThreadState_assign
51915343 __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
5192 __Pyx_PyThreadState_assign
5344 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
51935345 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5194 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
51955346 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
51965347 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
51975348 __Pyx_XGOTREF(__pyx_t_13);
52055356 __Pyx_DECREF(__pyx_v_e);
52065357 __pyx_v_e = NULL;
52075358 }
5208 __Pyx_PyThreadState_assign
52095359 if (PY_MAJOR_VERSION >= 3) {
52105360 __Pyx_XGIVEREF(__pyx_t_16);
52115361 __Pyx_XGIVEREF(__pyx_t_17);
52325382 * r, g, b = colors[c]
52335383 * except KeyError as e:
52345384 */
5235 __Pyx_PyThreadState_assign
52365385 __Pyx_XGIVEREF(__pyx_t_5);
52375386 __Pyx_XGIVEREF(__pyx_t_6);
52385387 __Pyx_XGIVEREF(__pyx_t_7);
52395388 __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
52405389 goto __pyx_L1_error;
5241 __pyx_L10_try_end:;
5390 __pyx_L8_try_end:;
52425391 }
52435392
52445393 /* "pygame_sdl2/color.pyx":96
52995448 PyObject *__pyx_r = 0;
53005449 __Pyx_RefNannyDeclarations
53015450 __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
5302 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_11pygame_sdl2_5color_Color, 1, "x", 0))) __PYX_ERR(0, 98, __pyx_L1_error)
53035451 __pyx_r = __pyx_pf_11pygame_sdl2_5color_5Color___richcmp__(((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_v_x), ((PyObject *)__pyx_v_y), ((int)__pyx_v_op));
53045452
53055453 /* function exit code */
5306 goto __pyx_L0;
5307 __pyx_L1_error:;
5308 __pyx_r = NULL;
5309 __pyx_L0:;
53105454 __Pyx_RefNannyFinishContext();
53115455 return __pyx_r;
53125456 }
53775521 * if not isinstance(y, Color):
53785522 * return False
53795523 */
5380 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
5524 __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
53815525 __Pyx_GOTREF(__pyx_t_2);
5382 __Pyx_INCREF(__pyx_v_y);
5383 __Pyx_GIVEREF(__pyx_v_y);
5384 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_y);
5385 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L1_error)
5386 __Pyx_GOTREF(__pyx_t_4);
5387 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5388 __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_4);
5389 __pyx_t_4 = 0;
5526 __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_2);
5527 __pyx_t_2 = 0;
53905528
53915529 /* "pygame_sdl2/color.pyx":102
53925530 * return not (x == y)
54475585 * def __cinit__(self):
54485586 */
54495587 __Pyx_XDECREF(__pyx_r);
5450 __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_x->r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
5451 __Pyx_GOTREF(__pyx_t_2);
5588 __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_x->r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error)
5589 __Pyx_GOTREF(__pyx_t_4);
54525590 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_r); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error)
54535591 __Pyx_GOTREF(__pyx_t_5);
5454 __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
5455 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5592 __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
5593 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
54565594 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
54575595 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 107, __pyx_L1_error)
54585596 if (__pyx_t_1) {
54595597 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
54605598 } else {
54615599 __Pyx_INCREF(__pyx_t_6);
5462 __pyx_t_4 = __pyx_t_6;
5600 __pyx_t_2 = __pyx_t_6;
54635601 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
54645602 goto __pyx_L7_bool_binop_done;
54655603 }
54675605 __Pyx_GOTREF(__pyx_t_6);
54685606 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_g); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error)
54695607 __Pyx_GOTREF(__pyx_t_5);
5470 __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
5608 __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error)
54715609 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
54725610 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5473 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 107, __pyx_L1_error)
5611 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 107, __pyx_L1_error)
54745612 if (__pyx_t_1) {
5475 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5613 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
54765614 } else {
5477 __Pyx_INCREF(__pyx_t_2);
5478 __pyx_t_4 = __pyx_t_2;
5479 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5615 __Pyx_INCREF(__pyx_t_4);
5616 __pyx_t_2 = __pyx_t_4;
5617 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
54805618 goto __pyx_L7_bool_binop_done;
54815619 }
5482 __pyx_t_2 = __Pyx_PyInt_From_uint8_t(__pyx_v_x->b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
5483 __Pyx_GOTREF(__pyx_t_2);
5620 __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_x->b); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error)
5621 __Pyx_GOTREF(__pyx_t_4);
54845622 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_b); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error)
54855623 __Pyx_GOTREF(__pyx_t_5);
5486 __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
5487 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5624 __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
5625 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
54885626 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
54895627 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 107, __pyx_L1_error)
54905628 if (__pyx_t_1) {
54915629 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
54925630 } else {
54935631 __Pyx_INCREF(__pyx_t_6);
5494 __pyx_t_4 = __pyx_t_6;
5632 __pyx_t_2 = __pyx_t_6;
54955633 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
54965634 goto __pyx_L7_bool_binop_done;
54975635 }
54995637 __Pyx_GOTREF(__pyx_t_6);
55005638 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_y, __pyx_n_s_a); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L1_error)
55015639 __Pyx_GOTREF(__pyx_t_5);
5502 __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
5640 __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error)
55035641 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
55045642 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5505 __Pyx_INCREF(__pyx_t_2);
5506 __pyx_t_4 = __pyx_t_2;
5507 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5643 __Pyx_INCREF(__pyx_t_4);
5644 __pyx_t_2 = __pyx_t_4;
5645 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
55085646 __pyx_L7_bool_binop_done:;
5509 __pyx_r = __pyx_t_4;
5510 __pyx_t_4 = 0;
5647 __pyx_r = __pyx_t_2;
5648 __pyx_t_2 = 0;
55115649 goto __pyx_L0;
55125650
55135651 /* "pygame_sdl2/color.pyx":106
56965834 * c = args[0]
56975835 * if isinstance(c, basestring):
56985836 */
5699 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 119, __pyx_L1_error)
5837 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 119, __pyx_L1_error)
57005838 __pyx_t_2 = ((__pyx_t_1 == 1) != 0);
57015839 if (__pyx_t_2) {
57025840
58626000 * self.from_rgba(c[0], c[1], c[2], c[3])
58636001 * elif len(c) == 3:
58646002 */
5865 __pyx_t_1 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 129, __pyx_L1_error)
6003 __pyx_t_1 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 129, __pyx_L1_error)
58666004 __pyx_t_6 = ((__pyx_t_1 == 4) != 0);
58676005 if (__pyx_t_6) {
58686006
59106048 * self.from_rgba(c[0], c[1], c[2], 255)
59116049 * else:
59126050 */
5913 __pyx_t_1 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 131, __pyx_L1_error)
6051 __pyx_t_1 = PyObject_Length(__pyx_v_c); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 131, __pyx_L1_error)
59146052 __pyx_t_6 = ((__pyx_t_1 == 3) != 0);
5915 if (__pyx_t_6) {
6053 if (likely(__pyx_t_6)) {
59166054
59176055 /* "pygame_sdl2/color.pyx":132
59186056 * self.from_rgba(c[0], c[1], c[2], c[3])
59556093 * self.from_hex("%08x" % c)
59566094 */
59576095 /*else*/ {
5958 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error)
6096 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error)
59596097 __Pyx_GOTREF(__pyx_t_3);
5960 __Pyx_INCREF(__pyx_v_c);
5961 __Pyx_GIVEREF(__pyx_v_c);
5962 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_c);
5963 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 134, __pyx_L1_error)
5964 __Pyx_GOTREF(__pyx_t_5);
6098 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
59656099 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5966 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
5967 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
59686100 __PYX_ERR(0, 134, __pyx_L1_error)
59696101 }
59706102 __pyx_L9:;
59876119 * elif len(args) == 3:
59886120 */
59896121 /*else*/ {
5990 __pyx_t_5 = PyUnicode_Format(__pyx_kp_u_08x, __pyx_v_c); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 136, __pyx_L1_error)
6122 __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_08x, __pyx_v_c); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error)
6123 __Pyx_GOTREF(__pyx_t_3);
6124 __pyx_t_5 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_hex(__pyx_v_self, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 136, __pyx_L1_error)
59916125 __Pyx_GOTREF(__pyx_t_5);
5992 __pyx_t_3 = ((struct __pyx_vtabstruct_11pygame_sdl2_5color_Color *)__pyx_v_self->__pyx_vtab)->from_hex(__pyx_v_self, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error)
5993 __Pyx_GOTREF(__pyx_t_3);
6126 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59946127 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5995 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59966128 }
59976129 __pyx_L4:;
59986130
60136145 * r, g, b = args
60146146 * self.from_rgba(r, g, b, 255)
60156147 */
6016 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 138, __pyx_L1_error)
6148 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 138, __pyx_L1_error)
60176149 __pyx_t_6 = ((__pyx_t_1 == 3) != 0);
60186150 if (__pyx_t_6) {
60196151
60266158 */
60276159 if (1) {
60286160 PyObject* sequence = __pyx_v_args;
6029 #if !CYTHON_COMPILING_IN_PYPY
6030 Py_ssize_t size = Py_SIZE(sequence);
6031 #else
6032 Py_ssize_t size = PySequence_Size(sequence);
6033 #endif
6161 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
60346162 if (unlikely(size != 3)) {
60356163 if (size > 3) __Pyx_RaiseTooManyValuesError(3);
60366164 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
60376165 __PYX_ERR(0, 139, __pyx_L1_error)
60386166 }
60396167 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6040 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
6041 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
6168 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
6169 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
60426170 __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2);
6171 __Pyx_INCREF(__pyx_t_5);
60436172 __Pyx_INCREF(__pyx_t_3);
6044 __Pyx_INCREF(__pyx_t_5);
60456173 __Pyx_INCREF(__pyx_t_11);
60466174 #else
6047 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
6175 __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error)
6176 __Pyx_GOTREF(__pyx_t_5);
6177 __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
60486178 __Pyx_GOTREF(__pyx_t_3);
6049 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error)
6050 __Pyx_GOTREF(__pyx_t_5);
60516179 __pyx_t_11 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 139, __pyx_L1_error)
60526180 __Pyx_GOTREF(__pyx_t_11);
60536181 #endif
60546182 }
6055 __pyx_v_r = __pyx_t_3;
6183 __pyx_v_r = __pyx_t_5;
6184 __pyx_t_5 = 0;
6185 __pyx_v_g = __pyx_t_3;
60566186 __pyx_t_3 = 0;
6057 __pyx_v_g = __pyx_t_5;
6058 __pyx_t_5 = 0;
60596187 __pyx_v_b = __pyx_t_11;
60606188 __pyx_t_11 = 0;
60616189
60906218 * r, g, b, a = args
60916219 * self.from_rgba(r, g, b, a)
60926220 */
6093 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 141, __pyx_L1_error)
6221 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 141, __pyx_L1_error)
60946222 __pyx_t_6 = ((__pyx_t_1 == 4) != 0);
60956223 if (__pyx_t_6) {
60966224
61036231 */
61046232 if (1) {
61056233 PyObject* sequence = __pyx_v_args;
6106 #if !CYTHON_COMPILING_IN_PYPY
6107 Py_ssize_t size = Py_SIZE(sequence);
6108 #else
6109 Py_ssize_t size = PySequence_Size(sequence);
6110 #endif
6234 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
61116235 if (unlikely(size != 4)) {
61126236 if (size > 4) __Pyx_RaiseTooManyValuesError(4);
61136237 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
61156239 }
61166240 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
61176241 __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0);
6118 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
6119 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
6242 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
6243 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
61206244 __pyx_t_12 = PyTuple_GET_ITEM(sequence, 3);
61216245 __Pyx_INCREF(__pyx_t_11);
6246 __Pyx_INCREF(__pyx_t_3);
61226247 __Pyx_INCREF(__pyx_t_5);
6123 __Pyx_INCREF(__pyx_t_3);
61246248 __Pyx_INCREF(__pyx_t_12);
61256249 #else
61266250 {
61276251 Py_ssize_t i;
6128 PyObject** temps[4] = {&__pyx_t_11,&__pyx_t_5,&__pyx_t_3,&__pyx_t_12};
6252 PyObject** temps[4] = {&__pyx_t_11,&__pyx_t_3,&__pyx_t_5,&__pyx_t_12};
61296253 for (i=0; i < 4; i++) {
61306254 PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 142, __pyx_L1_error)
61316255 __Pyx_GOTREF(item);
61366260 }
61376261 __pyx_v_r = __pyx_t_11;
61386262 __pyx_t_11 = 0;
6139 __pyx_v_g = __pyx_t_5;
6263 __pyx_v_g = __pyx_t_3;
6264 __pyx_t_3 = 0;
6265 __pyx_v_b = __pyx_t_5;
61406266 __pyx_t_5 = 0;
6141 __pyx_v_b = __pyx_t_3;
6142 __pyx_t_3 = 0;
61436267 __pyx_v_a = __pyx_t_12;
61446268 __pyx_t_12 = 0;
61456269
62576381 __pyx_t_2 = 0;
62586382 __pyx_t_3 = 0;
62596383 __pyx_t_4 = 0;
6260 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
6384 __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
62616385 __Pyx_GOTREF(__pyx_t_4);
6262 __Pyx_GIVEREF(__pyx_t_5);
6263 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6264 __pyx_t_5 = 0;
6265 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error)
6266 __Pyx_GOTREF(__pyx_t_5);
6267 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6268 __pyx_r = __pyx_t_5;
6269 __pyx_t_5 = 0;
6386 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6387 __pyx_r = __pyx_t_4;
6388 __pyx_t_4 = 0;
62706389 goto __pyx_L0;
62716390
62726391 /* "pygame_sdl2/color.pyx":145
65146633 */
65156634
65166635 /* Python wrapper */
6517 #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
6636 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
65186637 static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_11__hex__(PyObject *__pyx_v_self); /*proto*/
65196638 static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_11__hex__(PyObject *__pyx_v_self) {
65206639 PyObject *__pyx_r = 0;
65266645 __Pyx_RefNannyFinishContext();
65276646 return __pyx_r;
65286647 }
6529 #endif /*!(#if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY)*/
6530
6531 #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
6648 #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
6649
6650 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
65326651 static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_10__hex__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) {
65336652 PyObject *__pyx_r = NULL;
65346653 __Pyx_RefNannyDeclarations
65466665 __Pyx_XDECREF(__pyx_r);
65476666 __pyx_t_1 = __Pyx_PyNumber_Int(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
65486667 __Pyx_GOTREF(__pyx_t_1);
6549 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
6668 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_hex, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
65506669 __Pyx_GOTREF(__pyx_t_2);
6551 __Pyx_GIVEREF(__pyx_t_1);
6552 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
6553 __pyx_t_1 = 0;
6554 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_hex, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
6555 __Pyx_GOTREF(__pyx_t_1);
6556 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6557 __pyx_r = __pyx_t_1;
6558 __pyx_t_1 = 0;
6670 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6671 __pyx_r = __pyx_t_2;
6672 __pyx_t_2 = 0;
65596673 goto __pyx_L0;
65606674
65616675 /* "pygame_sdl2/color.pyx":152
65776691 __Pyx_RefNannyFinishContext();
65786692 return __pyx_r;
65796693 }
6580 #endif /*!(#if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY)*/
6694 #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
65816695
65826696 /* "pygame_sdl2/color.pyx":155
65836697 * return hex(int(self))
65886702 */
65896703
65906704 /* Python wrapper */
6591 #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
6705 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
65926706 static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_13__oct__(PyObject *__pyx_v_self); /*proto*/
65936707 static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_13__oct__(PyObject *__pyx_v_self) {
65946708 PyObject *__pyx_r = 0;
66006714 __Pyx_RefNannyFinishContext();
66016715 return __pyx_r;
66026716 }
6603 #endif /*!(#if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY)*/
6604
6605 #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
6717 #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
6718
6719 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
66066720 static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_12__oct__(struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_self) {
66076721 PyObject *__pyx_r = NULL;
66086722 __Pyx_RefNannyDeclarations
66206734 __Pyx_XDECREF(__pyx_r);
66216735 __pyx_t_1 = __Pyx_PyNumber_Int(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
66226736 __Pyx_GOTREF(__pyx_t_1);
6623 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
6737 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_oct, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
66246738 __Pyx_GOTREF(__pyx_t_2);
6625 __Pyx_GIVEREF(__pyx_t_1);
6626 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
6627 __pyx_t_1 = 0;
6628 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_oct, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
6629 __Pyx_GOTREF(__pyx_t_1);
6630 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6631 __pyx_r = __pyx_t_1;
6632 __pyx_t_1 = 0;
6739 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6740 __pyx_r = __pyx_t_2;
6741 __pyx_t_2 = 0;
66336742 goto __pyx_L0;
66346743
66356744 /* "pygame_sdl2/color.pyx":155
66516760 __Pyx_RefNannyFinishContext();
66526761 return __pyx_r;
66536762 }
6654 #endif /*!(#if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY)*/
6763 #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
66556764
66566765 /* "pygame_sdl2/color.pyx":158
66576766 * return oct(int(self))
67576866 * d['rgba'] = (self.r, self.g, self.b, self.a)
67586867 * return (Color, (), d)
67596868 */
6760 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
6869 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
67616870 __Pyx_GOTREF(__pyx_t_1);
67626871 __pyx_v_d = ((PyObject*)__pyx_t_1);
67636872 __pyx_t_1 = 0;
68856994 *
68866995 * def __setitem__(self, key, val):
68876996 */
6888 __pyx_t_1 = PyObject_GetItem(__pyx_v_d, __pyx_n_u_rgba); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
6997 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_d, __pyx_n_u_rgba); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
68896998 __Pyx_GOTREF(__pyx_t_1);
68906999 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
68917000 PyObject* sequence = __pyx_t_1;
6892 #if !CYTHON_COMPILING_IN_PYPY
6893 Py_ssize_t size = Py_SIZE(sequence);
6894 #else
6895 Py_ssize_t size = PySequence_Size(sequence);
6896 #endif
7001 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
68977002 if (unlikely(size != 4)) {
68987003 if (size > 4) __Pyx_RaiseTooManyValuesError(4);
68997004 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
70297134 */
70307135 __pyx_t_1 = PyInt_Check(__pyx_v_val);
70317136 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
7032 if (__pyx_t_2) {
7137 if (unlikely(__pyx_t_2)) {
70337138
70347139 /* "pygame_sdl2/color.pyx":171
70357140 * def __setitem__(self, key, val):
70387143 * if key >= self.length:
70397144 * raise IndexError(key)
70407145 */
7041 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
7146 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
70427147 __Pyx_GOTREF(__pyx_t_3);
7043 __Pyx_INCREF(__pyx_v_val);
7044 __Pyx_GIVEREF(__pyx_v_val);
7045 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val);
7046 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
7047 __Pyx_GOTREF(__pyx_t_4);
7148 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
70487149 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7049 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7050 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
70517150 __PYX_ERR(0, 171, __pyx_L1_error)
70527151
70537152 /* "pygame_sdl2/color.pyx":170
70667165 * raise IndexError(key)
70677166 * if val < 0 or val > 255:
70687167 */
7069 __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
7070 __Pyx_GOTREF(__pyx_t_4);
7071 __pyx_t_3 = PyObject_RichCompare(__pyx_v_key, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error)
7168 __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error)
7169 __Pyx_GOTREF(__pyx_t_3);
7170 __pyx_t_4 = PyObject_RichCompare(__pyx_v_key, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
7171 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7172 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 172, __pyx_L1_error)
70727173 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7073 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 172, __pyx_L1_error)
7074 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7075 if (__pyx_t_2) {
7174 if (unlikely(__pyx_t_2)) {
70767175
70777176 /* "pygame_sdl2/color.pyx":173
70787177 * raise ValueError(val)
70817180 * if val < 0 or val > 255:
70827181 * raise ValueError(val)
70837182 */
7084 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
7085 __Pyx_GOTREF(__pyx_t_3);
7086 __Pyx_INCREF(__pyx_v_key);
7087 __Pyx_GIVEREF(__pyx_v_key);
7088 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key);
7089 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
7183 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
70907184 __Pyx_GOTREF(__pyx_t_4);
7091 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
70927185 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
70937186 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
70947187 __PYX_ERR(0, 173, __pyx_L1_error)
71227215 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
71237216 __pyx_t_2 = __pyx_t_1;
71247217 __pyx_L6_bool_binop_done:;
7125 if (__pyx_t_2) {
7218 if (unlikely(__pyx_t_2)) {
71267219
71277220 /* "pygame_sdl2/color.pyx":175
71287221 * raise IndexError(key)
71317224 *
71327225 * if key == 0: self.r = val
71337226 */
7134 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error)
7227 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error)
71357228 __Pyx_GOTREF(__pyx_t_4);
7136 __Pyx_INCREF(__pyx_v_val);
7137 __Pyx_GIVEREF(__pyx_v_val);
7138 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_val);
7139 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error)
7140 __Pyx_GOTREF(__pyx_t_3);
7229 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
71417230 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7142 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7143 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
71447231 __PYX_ERR(0, 175, __pyx_L1_error)
71457232
71467233 /* "pygame_sdl2/color.pyx":174
71597246 * elif key == 1: self.g = val
71607247 * elif key == 2: self.b = val
71617248 */
7162 __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error)
7163 __Pyx_GOTREF(__pyx_t_3);
7164 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 177, __pyx_L1_error)
7165 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7249 __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L1_error)
7250 __Pyx_GOTREF(__pyx_t_4);
7251 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 177, __pyx_L1_error)
7252 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
71667253 if (__pyx_t_2) {
71677254 __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_5 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L1_error)
71687255 __pyx_v_self->r = __pyx_t_5;
71767263 * elif key == 2: self.b = val
71777264 * elif key == 3: self.a = val
71787265 */
7179 __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error)
7180 __Pyx_GOTREF(__pyx_t_3);
7181 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 178, __pyx_L1_error)
7182 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7266 __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error)
7267 __Pyx_GOTREF(__pyx_t_4);
7268 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 178, __pyx_L1_error)
7269 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
71837270 if (__pyx_t_2) {
71847271 __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_5 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L1_error)
71857272 __pyx_v_self->g = __pyx_t_5;
71937280 * elif key == 3: self.a = val
71947281 * else:
71957282 */
7196 __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error)
7197 __Pyx_GOTREF(__pyx_t_3);
7198 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 179, __pyx_L1_error)
7199 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7283 __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L1_error)
7284 __Pyx_GOTREF(__pyx_t_4);
7285 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 179, __pyx_L1_error)
7286 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
72007287 if (__pyx_t_2) {
72017288 __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_5 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error)
72027289 __pyx_v_self->b = __pyx_t_5;
72107297 * else:
72117298 * raise IndexError(key)
72127299 */
7213 __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error)
7214 __Pyx_GOTREF(__pyx_t_3);
7215 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 180, __pyx_L1_error)
7216 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7217 if (__pyx_t_2) {
7300 __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 180, __pyx_L1_error)
7301 __Pyx_GOTREF(__pyx_t_4);
7302 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 180, __pyx_L1_error)
7303 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7304 if (likely(__pyx_t_2)) {
72187305 __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_val); if (unlikely((__pyx_t_5 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error)
72197306 __pyx_v_self->a = __pyx_t_5;
72207307 goto __pyx_L8;
72287315 * def __getitem__(self, key):
72297316 */
72307317 /*else*/ {
7231 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error)
7232 __Pyx_GOTREF(__pyx_t_3);
7233 __Pyx_INCREF(__pyx_v_key);
7234 __Pyx_GIVEREF(__pyx_v_key);
7235 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key);
7236 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error)
7318 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error)
72377319 __Pyx_GOTREF(__pyx_t_4);
7238 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
72397320 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
72407321 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
72417322 __PYX_ERR(0, 182, __pyx_L1_error)
73147395 __Pyx_XDECREF(__pyx_r);
73157396 __pyx_t_3 = PySequence_Tuple(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error)
73167397 __Pyx_GOTREF(__pyx_t_3);
7317 __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error)
7398 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error)
73187399 __Pyx_GOTREF(__pyx_t_4);
73197400 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
73207401 __pyx_r = __pyx_t_4;
73437424 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
73447425 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 187, __pyx_L1_error)
73457426 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7346 if (__pyx_t_2) {
7427 if (unlikely(__pyx_t_2)) {
73477428
73487429 /* "pygame_sdl2/color.pyx":188
73497430 * return tuple(self)[key]
73527433 * if key == 0: return self.r
73537434 * elif key == 1: return self.g
73547435 */
7355 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
7436 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
73567437 __Pyx_GOTREF(__pyx_t_3);
7357 __Pyx_INCREF(__pyx_v_key);
7358 __Pyx_GIVEREF(__pyx_v_key);
7359 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key);
7360 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
7361 __Pyx_GOTREF(__pyx_t_4);
7438 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
73627439 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7363 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7364 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
73657440 __PYX_ERR(0, 188, __pyx_L1_error)
73667441
73677442 /* "pygame_sdl2/color.pyx":187
73807455 * elif key == 1: return self.g
73817456 * elif key == 2: return self.b
73827457 */
7383 __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error)
7384 __Pyx_GOTREF(__pyx_t_4);
7385 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 189, __pyx_L1_error)
7386 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7458 __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error)
7459 __Pyx_GOTREF(__pyx_t_3);
7460 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 189, __pyx_L1_error)
7461 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
73877462 if (__pyx_t_2) {
73887463 __Pyx_XDECREF(__pyx_r);
7389 __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error)
7390 __Pyx_GOTREF(__pyx_t_4);
7391 __pyx_r = __pyx_t_4;
7392 __pyx_t_4 = 0;
7464 __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error)
7465 __Pyx_GOTREF(__pyx_t_3);
7466 __pyx_r = __pyx_t_3;
7467 __pyx_t_3 = 0;
73937468 goto __pyx_L0;
73947469 }
73957470
74007475 * elif key == 2: return self.b
74017476 * elif key == 3: return self.a
74027477 */
7403 __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error)
7404 __Pyx_GOTREF(__pyx_t_4);
7405 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 190, __pyx_L1_error)
7406 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7478 __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error)
7479 __Pyx_GOTREF(__pyx_t_3);
7480 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 190, __pyx_L1_error)
7481 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
74077482 if (__pyx_t_2) {
74087483 __Pyx_XDECREF(__pyx_r);
7409 __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error)
7410 __Pyx_GOTREF(__pyx_t_4);
7411 __pyx_r = __pyx_t_4;
7412 __pyx_t_4 = 0;
7484 __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->g); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error)
7485 __Pyx_GOTREF(__pyx_t_3);
7486 __pyx_r = __pyx_t_3;
7487 __pyx_t_3 = 0;
74137488 goto __pyx_L0;
74147489 }
74157490
74207495 * elif key == 3: return self.a
74217496 * else:
74227497 */
7423 __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
7424 __Pyx_GOTREF(__pyx_t_4);
7425 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 191, __pyx_L1_error)
7426 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7498 __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error)
7499 __Pyx_GOTREF(__pyx_t_3);
7500 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 191, __pyx_L1_error)
7501 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
74277502 if (__pyx_t_2) {
74287503 __Pyx_XDECREF(__pyx_r);
7429 __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
7430 __Pyx_GOTREF(__pyx_t_4);
7431 __pyx_r = __pyx_t_4;
7432 __pyx_t_4 = 0;
7504 __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error)
7505 __Pyx_GOTREF(__pyx_t_3);
7506 __pyx_r = __pyx_t_3;
7507 __pyx_t_3 = 0;
74337508 goto __pyx_L0;
74347509 }
74357510
74407515 * else:
74417516 * raise IndexError(key)
74427517 */
7443 __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
7444 __Pyx_GOTREF(__pyx_t_4);
7445 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 192, __pyx_L1_error)
7446 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7447 if (__pyx_t_2) {
7518 __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
7519 __Pyx_GOTREF(__pyx_t_3);
7520 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 192, __pyx_L1_error)
7521 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7522 if (likely(__pyx_t_2)) {
74487523 __Pyx_XDECREF(__pyx_r);
7449 __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
7450 __Pyx_GOTREF(__pyx_t_4);
7451 __pyx_r = __pyx_t_4;
7452 __pyx_t_4 = 0;
7524 __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_self->a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
7525 __Pyx_GOTREF(__pyx_t_3);
7526 __pyx_r = __pyx_t_3;
7527 __pyx_t_3 = 0;
74537528 goto __pyx_L0;
74547529 }
74557530
74617536 * def __len__(self):
74627537 */
74637538 /*else*/ {
7464 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error)
7465 __Pyx_GOTREF(__pyx_t_4);
7466 __Pyx_INCREF(__pyx_v_key);
7467 __Pyx_GIVEREF(__pyx_v_key);
7468 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_key);
7469 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error)
7539 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error)
74707540 __Pyx_GOTREF(__pyx_t_3);
7471 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
74727541 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
74737542 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
74747543 __PYX_ERR(0, 194, __pyx_L1_error)
84598528 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
84608529 switch (pos_args) {
84618530 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8531 CYTHON_FALLTHROUGH;
84628532 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8533 CYTHON_FALLTHROUGH;
84638534 case 0: break;
84648535 default: goto __pyx_L5_argtuple_error;
84658536 }
84668537 kw_args = PyDict_Size(__pyx_kwds);
84678538 switch (pos_args) {
84688539 case 0:
8469 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_l)) != 0)) kw_args--;
8540 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_l)) != 0)) kw_args--;
84708541 else goto __pyx_L5_argtuple_error;
8542 CYTHON_FALLTHROUGH;
84718543 case 1:
8472 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
8544 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
84738545 else {
84748546 __Pyx_RaiseArgtupleInvalid("mod", 1, 2, 2, 1); __PYX_ERR(0, 228, __pyx_L3_error)
84758547 }
87828854 */
87838855
87848856 /* Python wrapper */
8785 #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
8857 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
87868858 static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_35__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /*proto*/
87878859 static PyObject *__pyx_pw_11pygame_sdl2_5color_5Color_35__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
87888860 PyObject *__pyx_r = 0;
88028874 __Pyx_RefNannyFinishContext();
88038875 return __pyx_r;
88048876 }
8805 #endif /*!(#if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY)*/
8806
8807 #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
8877 #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
8878
8879 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
88088880 static PyObject *__pyx_pf_11pygame_sdl2_5color_5Color_34__div__(PyObject *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5color_Color *__pyx_v_rhs) {
88098881 PyObject *__pyx_v_r = NULL;
88108882 PyObject *__pyx_v_g = NULL;
90629134 __Pyx_RefNannyFinishContext();
90639135 return __pyx_r;
90649136 }
9065 #endif /*!(#if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY)*/
9137 #endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/
90669138
90679139 /* "pygame_sdl2/color.pyx":249
90689140 * return type(self)(r, g, b, a)
91189190 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
91199191 switch (pos_args) {
91209192 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9193 CYTHON_FALLTHROUGH;
91219194 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9195 CYTHON_FALLTHROUGH;
91229196 case 0: break;
91239197 default: goto __pyx_L5_argtuple_error;
91249198 }
91259199 kw_args = PyDict_Size(__pyx_kwds);
91269200 switch (pos_args) {
91279201 case 0:
9128 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
9202 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
91299203 else goto __pyx_L5_argtuple_error;
9204 CYTHON_FALLTHROUGH;
91309205 case 1:
9131 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
9206 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
91329207 else {
91339208 __Pyx_RaiseArgtupleInvalid("div", 1, 2, 2, 1); __PYX_ERR(0, 251, __pyx_L3_error)
91349209 }
95829657 */
95839658 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
95849659 PyObject* sequence = __pyx_v_val;
9585 #if !CYTHON_COMPILING_IN_PYPY
9586 Py_ssize_t size = Py_SIZE(sequence);
9587 #else
9588 Py_ssize_t size = PySequence_Size(sequence);
9589 #endif
9660 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
95909661 if (unlikely(size != 3)) {
95919662 if (size > 3) __Pyx_RaiseTooManyValuesError(3);
95929663 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
1015110222 * h, s, v = val
1015210223 * a = 0.0
1015310224 */
10154 __pyx_t_1 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 308, __pyx_L1_error)
10225 __pyx_t_1 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 308, __pyx_L1_error)
1015510226 __pyx_t_2 = ((__pyx_t_1 == 3) != 0);
1015610227 if (__pyx_t_2) {
1015710228
1016410235 */
1016510236 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
1016610237 PyObject* sequence = __pyx_v_val;
10167 #if !CYTHON_COMPILING_IN_PYPY
10168 Py_ssize_t size = Py_SIZE(sequence);
10169 #else
10170 Py_ssize_t size = PySequence_Size(sequence);
10171 #endif
10238 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
1017210239 if (unlikely(size != 3)) {
1017310240 if (size > 3) __Pyx_RaiseTooManyValuesError(3);
1017410241 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
1025610323 /*else*/ {
1025710324 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
1025810325 PyObject* sequence = __pyx_v_val;
10259 #if !CYTHON_COMPILING_IN_PYPY
10260 Py_ssize_t size = Py_SIZE(sequence);
10261 #else
10262 Py_ssize_t size = PySequence_Size(sequence);
10263 #endif
10326 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
1026410327 if (unlikely(size != 4)) {
1026510328 if (size > 4) __Pyx_RaiseTooManyValuesError(4);
1026610329 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
1059510658 __pyx_t_13 = (__pyx_v_h < 360.0);
1059610659 }
1059710660 __pyx_t_2 = (__pyx_t_13 != 0);
10598 if (__pyx_t_2) {
10661 if (likely(__pyx_t_2)) {
1059910662
1060010663 /* "pygame_sdl2/color.pyx":338
1060110664 * r, g, b = x, 0, c
1105311116 * h, s, l = val
1105411117 * a = 0.0
1105511118 */
11056 __pyx_t_1 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 379, __pyx_L1_error)
11119 __pyx_t_1 = PyObject_Length(__pyx_v_val); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 379, __pyx_L1_error)
1105711120 __pyx_t_2 = ((__pyx_t_1 == 3) != 0);
1105811121 if (__pyx_t_2) {
1105911122
1106611129 */
1106711130 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
1106811131 PyObject* sequence = __pyx_v_val;
11069 #if !CYTHON_COMPILING_IN_PYPY
11070 Py_ssize_t size = Py_SIZE(sequence);
11071 #else
11072 Py_ssize_t size = PySequence_Size(sequence);
11073 #endif
11132 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
1107411133 if (unlikely(size != 3)) {
1107511134 if (size > 3) __Pyx_RaiseTooManyValuesError(3);
1107611135 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
1115811217 /*else*/ {
1115911218 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
1116011219 PyObject* sequence = __pyx_v_val;
11161 #if !CYTHON_COMPILING_IN_PYPY
11162 Py_ssize_t size = Py_SIZE(sequence);
11163 #else
11164 Py_ssize_t size = PySequence_Size(sequence);
11165 #endif
11220 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
1116611221 if (unlikely(size != 4)) {
1116711222 if (size > 4) __Pyx_RaiseTooManyValuesError(4);
1116811223 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
1148811543 __pyx_t_13 = (__pyx_v_h < 360.0);
1148911544 }
1149011545 __pyx_t_2 = (__pyx_t_13 != 0);
11491 if (__pyx_t_2) {
11546 if (likely(__pyx_t_2)) {
1149211547
1149311548 /* "pygame_sdl2/color.pyx":405
1149411549 * r, g, b = x, 0, c
1178011835 */
1178111836 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
1178211837 PyObject* sequence = __pyx_v_val;
11783 #if !CYTHON_COMPILING_IN_PYPY
11784 Py_ssize_t size = Py_SIZE(sequence);
11785 #else
11786 Py_ssize_t size = PySequence_Size(sequence);
11787 #endif
11838 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
1178811839 if (unlikely(size != 3)) {
1178911840 if (size > 3) __Pyx_RaiseTooManyValuesError(3);
1179011841 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
1207512126 __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_int_255); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error)
1207612127 __Pyx_GOTREF(__pyx_t_2);
1207712128 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12078 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error)
12129 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_round, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error)
1207912130 __Pyx_GOTREF(__pyx_t_3);
12080 __Pyx_GIVEREF(__pyx_t_2);
12081 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
12082 __pyx_t_2 = 0;
12083 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error)
12131 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12132 __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error)
1208412133 __Pyx_GOTREF(__pyx_t_2);
1208512134 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12086 __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error)
12087 __Pyx_GOTREF(__pyx_t_3);
12088 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12089 __pyx_r = __pyx_t_3;
12090 __pyx_t_3 = 0;
12135 __pyx_r = __pyx_t_2;
12136 __pyx_t_2 = 0;
1209112137 goto __pyx_L0;
1209212138
1209312139 /* function exit code */
1216712213 * return c
1216812214 *
1216912215 */
12170 __pyx_t_3 = PySequence_Tuple(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error)
12216 __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_m); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error)
1217112217 __Pyx_GOTREF(__pyx_t_3);
1217212218 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
1217312219 __pyx_t_1 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_4 = NULL;
1228412330 int __pyx_t_1;
1228512331 PyObject *__pyx_t_2 = NULL;
1228612332 int __pyx_t_3;
12287 PyObject *__pyx_t_4 = NULL;
12288 uint8_t __pyx_t_5;
12333 uint8_t __pyx_t_4;
1228912334 __Pyx_RefNannySetupContext("set_length", 0);
1229012335
1229112336 /* "pygame_sdl2/color.pyx":458
1230812353 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1230912354 __pyx_t_1 = __pyx_t_3;
1231012355 __pyx_L4_bool_binop_done:;
12311 if (__pyx_t_1) {
12356 if (unlikely(__pyx_t_1)) {
1231212357
1231312358 /* "pygame_sdl2/color.pyx":459
1231412359 * def set_length(self, n):
1231612361 * raise ValueError(n) # <<<<<<<<<<<<<<
1231712362 * self.length = n
1231812363 */
12319 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 459, __pyx_L1_error)
12364 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 459, __pyx_L1_error)
1232012365 __Pyx_GOTREF(__pyx_t_2);
12321 __Pyx_INCREF(__pyx_v_n);
12322 __Pyx_GIVEREF(__pyx_v_n);
12323 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_n);
12324 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 459, __pyx_L1_error)
12325 __Pyx_GOTREF(__pyx_t_4);
12366 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
1232612367 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12327 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
12328 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1232912368 __PYX_ERR(0, 459, __pyx_L1_error)
1233012369
1233112370 /* "pygame_sdl2/color.pyx":458
1234212381 * raise ValueError(n)
1234312382 * self.length = n # <<<<<<<<<<<<<<
1234412383 */
12345 __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_n); if (unlikely((__pyx_t_5 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error)
12346 __pyx_v_self->length = __pyx_t_5;
12384 __pyx_t_4 = __Pyx_PyInt_As_uint8_t(__pyx_v_n); if (unlikely((__pyx_t_4 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error)
12385 __pyx_v_self->length = __pyx_t_4;
1234712386
1234812387 /* "pygame_sdl2/color.pyx":457
1234912388 * return c
1235812397 goto __pyx_L0;
1235912398 __pyx_L1_error:;
1236012399 __Pyx_XDECREF(__pyx_t_2);
12361 __Pyx_XDECREF(__pyx_t_4);
1236212400 __Pyx_AddTraceback("pygame_sdl2.color.Color.set_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
1236312401 __pyx_r = NULL;
1236412402 __pyx_L0:;
1266812706
1266912707 static void __pyx_tp_dealloc_11pygame_sdl2_5color_Color(PyObject *o) {
1267012708 struct __pyx_obj_11pygame_sdl2_5color_Color *p = (struct __pyx_obj_11pygame_sdl2_5color_Color *)o;
12671 #if PY_VERSION_HEX >= 0x030400a1
12672 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
12709 #if CYTHON_USE_TP_FINALIZE
12710 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
1267312711 if (PyObject_CallFinalizerFromDealloc(o)) return;
1267412712 }
1267512713 #endif
1283212870 __pyx_pw_11pygame_sdl2_5color_5Color_29__add__, /*nb_add*/
1283312871 __pyx_pw_11pygame_sdl2_5color_5Color_31__sub__, /*nb_subtract*/
1283412872 __pyx_pw_11pygame_sdl2_5color_5Color_27__mul__, /*nb_multiply*/
12835 #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
12873 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
1283612874 __pyx_pw_11pygame_sdl2_5color_5Color_35__div__, /*nb_divide*/
1283712875 #endif
1283812876 __pyx_pw_11pygame_sdl2_5color_5Color_33__mod__, /*nb_remainder*/
1284812886 0, /*nb_and*/
1284912887 0, /*nb_xor*/
1285012888 0, /*nb_or*/
12851 #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
12889 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
1285212890 0, /*nb_coerce*/
1285312891 #endif
1285412892 __pyx_pw_11pygame_sdl2_5color_5Color_9__int__, /*nb_int*/
1285812896 0, /*reserved*/
1285912897 #endif
1286012898 __pyx_pw_11pygame_sdl2_5color_5Color_15__float__, /*nb_float*/
12861 #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
12899 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
1286212900 __pyx_pw_11pygame_sdl2_5color_5Color_13__oct__, /*nb_oct*/
1286312901 #endif
12864 #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
12902 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
1286512903 __pyx_pw_11pygame_sdl2_5color_5Color_11__hex__, /*nb_hex*/
1286612904 #endif
1286712905 0, /*nb_inplace_add*/
1286812906 0, /*nb_inplace_subtract*/
1286912907 0, /*nb_inplace_multiply*/
12870 #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
12908 #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
1287112909 0, /*nb_inplace_divide*/
1287212910 #endif
1287312911 0, /*nb_inplace_remainder*/
1307613114 };
1307713115
1307813116 #if PY_MAJOR_VERSION >= 3
13117 #if CYTHON_PEP489_MULTI_PHASE_INIT
13118 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
13119 static int __pyx_pymod_exec_color(PyObject* module); /*proto*/
13120 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
13121 {Py_mod_create, (void*)__pyx_pymod_create},
13122 {Py_mod_exec, (void*)__pyx_pymod_exec_color},
13123 {0, NULL}
13124 };
13125 #endif
13126
1307913127 static struct PyModuleDef __pyx_moduledef = {
13080 #if PY_VERSION_HEX < 0x03020000
13081 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
13082 #else
1308313128 PyModuleDef_HEAD_INIT,
13084 #endif
1308513129 "color",
1308613130 0, /* m_doc */
13131 #if CYTHON_PEP489_MULTI_PHASE_INIT
13132 0, /* m_size */
13133 #else
1308713134 -1, /* m_size */
13135 #endif
1308813136 __pyx_methods /* m_methods */,
13137 #if CYTHON_PEP489_MULTI_PHASE_INIT
13138 __pyx_moduledef_slots, /* m_slots */
13139 #else
1308913140 NULL, /* m_reload */
13141 #endif
1309013142 NULL, /* m_traverse */
1309113143 NULL, /* m_clear */
1309213144 NULL /* m_free */
1316613218 {&__pyx_n_u_chocolate2, __pyx_k_chocolate2, sizeof(__pyx_k_chocolate2), 0, 1, 0, 1},
1316713219 {&__pyx_n_u_chocolate3, __pyx_k_chocolate3, sizeof(__pyx_k_chocolate3), 0, 1, 0, 1},
1316813220 {&__pyx_n_u_chocolate4, __pyx_k_chocolate4, sizeof(__pyx_k_chocolate4), 0, 1, 0, 1},
13221 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
1316913222 {&__pyx_n_u_coral, __pyx_k_coral, sizeof(__pyx_k_coral), 0, 1, 0, 1},
1317013223 {&__pyx_n_u_coral1, __pyx_k_coral1, sizeof(__pyx_k_coral1), 0, 1, 0, 1},
1317113224 {&__pyx_n_u_coral2, __pyx_k_coral2, sizeof(__pyx_k_coral2), 0, 1, 0, 1},
1389813951 __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_l, __pyx_n_s_r); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 228, __pyx_L1_error)
1389913952 __Pyx_GOTREF(__pyx_tuple__8);
1390013953 __Pyx_GIVEREF(__pyx_tuple__8);
13901 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_color_pyx, __pyx_n_s_mod, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 228, __pyx_L1_error)
13954 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_color_pyx, __pyx_n_s_mod, 228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 228, __pyx_L1_error)
1390213955
1390313956 /* "pygame_sdl2/color.pyx":251
1390413957 * def __floordiv__(self not None, Color rhs not None):
1391013963 __pyx_tuple__10 = PyTuple_Pack(2, __pyx_n_s_a, __pyx_n_s_b); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 251, __pyx_L1_error)
1391113964 __Pyx_GOTREF(__pyx_tuple__10);
1391213965 __Pyx_GIVEREF(__pyx_tuple__10);
13913 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_color_pyx, __pyx_n_s_div, 251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 251, __pyx_L1_error)
13966 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_color_pyx, __pyx_n_s_div, 251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 251, __pyx_L1_error)
1391413967
1391513968 /* "include/color_dict.pxi":5
1391613969 *
2159721650 return -1;
2159821651 }
2159921652
21653 static int __Pyx_modinit_global_init_code(void); /*proto*/
21654 static int __Pyx_modinit_variable_export_code(void); /*proto*/
21655 static int __Pyx_modinit_function_export_code(void); /*proto*/
21656 static int __Pyx_modinit_type_init_code(void); /*proto*/
21657 static int __Pyx_modinit_type_import_code(void); /*proto*/
21658 static int __Pyx_modinit_variable_import_code(void); /*proto*/
21659 static int __Pyx_modinit_function_import_code(void); /*proto*/
21660
21661 static int __Pyx_modinit_global_init_code(void) {
21662 __Pyx_RefNannyDeclarations
21663 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
21664 /*--- Global init code ---*/
21665 __pyx_v_11pygame_sdl2_5color_colors = Py_None; Py_INCREF(Py_None);
21666 __Pyx_RefNannyFinishContext();
21667 return 0;
21668 }
21669
21670 static int __Pyx_modinit_variable_export_code(void) {
21671 __Pyx_RefNannyDeclarations
21672 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
21673 /*--- Variable export code ---*/
21674 __Pyx_RefNannyFinishContext();
21675 return 0;
21676 }
21677
21678 static int __Pyx_modinit_function_export_code(void) {
21679 __Pyx_RefNannyDeclarations
21680 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
21681 /*--- Function export code ---*/
21682 if (__Pyx_ExportFunction("map_color", (void (*)(void))__pyx_f_11pygame_sdl2_5color_map_color, "Uint32 (SDL_Surface *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21683 if (__Pyx_ExportFunction("get_color", (void (*)(void))__pyx_f_11pygame_sdl2_5color_get_color, "PyObject *(Uint32, SDL_Surface *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21684 if (__Pyx_ExportFunction("to_sdl_color", (void (*)(void))__pyx_f_11pygame_sdl2_5color_to_sdl_color, "PyObject *(PyObject *, SDL_Color *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21685 __Pyx_RefNannyFinishContext();
21686 return 0;
21687 __pyx_L1_error:;
21688 __Pyx_RefNannyFinishContext();
21689 return -1;
21690 }
21691
21692 static int __Pyx_modinit_type_init_code(void) {
21693 __Pyx_RefNannyDeclarations
21694 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
21695 /*--- Type init code ---*/
21696 __pyx_vtabptr_11pygame_sdl2_5color_Color = &__pyx_vtable_11pygame_sdl2_5color_Color;
21697 __pyx_vtable_11pygame_sdl2_5color_Color.from_rgba = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8))__pyx_f_11pygame_sdl2_5color_5Color_from_rgba;
21698 __pyx_vtable_11pygame_sdl2_5color_Color.from_name = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *))__pyx_f_11pygame_sdl2_5color_5Color_from_name;
21699 __pyx_vtable_11pygame_sdl2_5color_Color.from_hex = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *))__pyx_f_11pygame_sdl2_5color_5Color_from_hex;
21700 if (PyType_Ready(&__pyx_type_11pygame_sdl2_5color_Color) < 0) __PYX_ERR(0, 63, __pyx_L1_error)
21701 __pyx_type_11pygame_sdl2_5color_Color.tp_print = 0;
21702 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11pygame_sdl2_5color_Color.tp_dictoffset && __pyx_type_11pygame_sdl2_5color_Color.tp_getattro == PyObject_GenericGetAttr)) {
21703 __pyx_type_11pygame_sdl2_5color_Color.tp_getattro = __Pyx_PyObject_GenericGetAttr;
21704 }
21705 if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_5color_Color.tp_dict, __pyx_vtabptr_11pygame_sdl2_5color_Color) < 0) __PYX_ERR(0, 63, __pyx_L1_error)
21706 if (PyObject_SetAttrString(__pyx_m, "Color", (PyObject *)&__pyx_type_11pygame_sdl2_5color_Color) < 0) __PYX_ERR(0, 63, __pyx_L1_error)
21707 if (__pyx_type_11pygame_sdl2_5color_Color.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_5color_Color.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_5color_Color, __weakref__);
21708 __pyx_ptype_11pygame_sdl2_5color_Color = &__pyx_type_11pygame_sdl2_5color_Color;
21709 if (PyType_Ready(&__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma) < 0) __PYX_ERR(0, 452, __pyx_L1_error)
21710 __pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma.tp_print = 0;
21711 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma.tp_dictoffset && __pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma.tp_getattro == PyObject_GenericGetAttr)) {
21712 __pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
21713 }
21714 __pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma = &__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma;
21715 __Pyx_RefNannyFinishContext();
21716 return 0;
21717 __pyx_L1_error:;
21718 __Pyx_RefNannyFinishContext();
21719 return -1;
21720 }
21721
21722 static int __Pyx_modinit_type_import_code(void) {
21723 __Pyx_RefNannyDeclarations
21724 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
21725 /*--- Type import code ---*/
21726 __Pyx_RefNannyFinishContext();
21727 return 0;
21728 }
21729
21730 static int __Pyx_modinit_variable_import_code(void) {
21731 __Pyx_RefNannyDeclarations
21732 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
21733 /*--- Variable import code ---*/
21734 __Pyx_RefNannyFinishContext();
21735 return 0;
21736 }
21737
21738 static int __Pyx_modinit_function_import_code(void) {
21739 __Pyx_RefNannyDeclarations
21740 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
21741 /*--- Function import code ---*/
21742 __Pyx_RefNannyFinishContext();
21743 return 0;
21744 }
21745
21746
2160021747 #if PY_MAJOR_VERSION < 3
21601 PyMODINIT_FUNC initcolor(void); /*proto*/
21602 PyMODINIT_FUNC initcolor(void)
21748 #ifdef CYTHON_NO_PYINIT_EXPORT
21749 #define __Pyx_PyMODINIT_FUNC void
2160321750 #else
21604 PyMODINIT_FUNC PyInit_color(void); /*proto*/
21605 PyMODINIT_FUNC PyInit_color(void)
21751 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
21752 #endif
21753 #else
21754 #ifdef CYTHON_NO_PYINIT_EXPORT
21755 #define __Pyx_PyMODINIT_FUNC PyObject *
21756 #else
21757 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
21758 #endif
21759 #endif
21760 #ifndef CYTHON_SMALL_CODE
21761 #if defined(__clang__)
21762 #define CYTHON_SMALL_CODE
21763 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
21764 #define CYTHON_SMALL_CODE __attribute__((cold))
21765 #else
21766 #define CYTHON_SMALL_CODE
21767 #endif
21768 #endif
21769
21770
21771 #if PY_MAJOR_VERSION < 3
21772 __Pyx_PyMODINIT_FUNC initcolor(void) CYTHON_SMALL_CODE; /*proto*/
21773 __Pyx_PyMODINIT_FUNC initcolor(void)
21774 #else
21775 __Pyx_PyMODINIT_FUNC PyInit_color(void) CYTHON_SMALL_CODE; /*proto*/
21776 __Pyx_PyMODINIT_FUNC PyInit_color(void)
21777 #if CYTHON_PEP489_MULTI_PHASE_INIT
21778 {
21779 return PyModuleDef_Init(&__pyx_moduledef);
21780 }
21781 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
21782 PyObject *value = PyObject_GetAttrString(spec, from_name);
21783 int result = 0;
21784 if (likely(value)) {
21785 result = PyDict_SetItemString(moddict, to_name, value);
21786 Py_DECREF(value);
21787 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
21788 PyErr_Clear();
21789 } else {
21790 result = -1;
21791 }
21792 return result;
21793 }
21794 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
21795 PyObject *module = NULL, *moddict, *modname;
21796 if (__pyx_m)
21797 return __Pyx_NewRef(__pyx_m);
21798 modname = PyObject_GetAttrString(spec, "name");
21799 if (unlikely(!modname)) goto bad;
21800 module = PyModule_NewObject(modname);
21801 Py_DECREF(modname);
21802 if (unlikely(!module)) goto bad;
21803 moddict = PyModule_GetDict(module);
21804 if (unlikely(!moddict)) goto bad;
21805 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
21806 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
21807 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
21808 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
21809 return module;
21810 bad:
21811 Py_XDECREF(module);
21812 return NULL;
21813 }
21814
21815
21816 static int __pyx_pymod_exec_color(PyObject *__pyx_pyinit_module)
21817 #endif
2160621818 #endif
2160721819 {
2160821820 PyObject *__pyx_t_1 = NULL;
2160921821 __Pyx_RefNannyDeclarations
21822 #if CYTHON_PEP489_MULTI_PHASE_INIT
21823 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
21824 #elif PY_MAJOR_VERSION >= 3
21825 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
21826 #endif
2161021827 #if CYTHON_REFNANNY
21611 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
21612 if (!__Pyx_RefNanny) {
21613 PyErr_Clear();
21614 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
21615 if (!__Pyx_RefNanny)
21616 Py_FatalError("failed to import 'refnanny' module");
21617 }
21618 #endif
21619 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_color(void)", 0);
21828 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
21829 if (!__Pyx_RefNanny) {
21830 PyErr_Clear();
21831 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
21832 if (!__Pyx_RefNanny)
21833 Py_FatalError("failed to import 'refnanny' module");
21834 }
21835 #endif
21836 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_color(void)", 0);
2162021837 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2162121838 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
2162221839 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
2163321850 #ifdef __Pyx_Generator_USED
2163421851 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2163521852 #endif
21853 #ifdef __Pyx_AsyncGen_USED
21854 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21855 #endif
2163621856 #ifdef __Pyx_StopAsyncIteration_USED
2163721857 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2163821858 #endif
2164421864 #endif
2164521865 #endif
2164621866 /*--- Module creation code ---*/
21867 #if CYTHON_PEP489_MULTI_PHASE_INIT
21868 __pyx_m = __pyx_pyinit_module;
21869 Py_INCREF(__pyx_m);
21870 #else
2164721871 #if PY_MAJOR_VERSION < 3
2164821872 __pyx_m = Py_InitModule4("color", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
2164921873 #else
2165021874 __pyx_m = PyModule_Create(&__pyx_moduledef);
2165121875 #endif
2165221876 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
21877 #endif
2165321878 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
2165421879 Py_INCREF(__pyx_d);
2165521880 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
21881 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
2165621882 #if CYTHON_COMPILING_IN_PYPY
2165721883 Py_INCREF(__pyx_b);
2165821884 #endif
2167721903 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2167821904 /*--- Constants init code ---*/
2167921905 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21680 /*--- Global init code ---*/
21681 __pyx_v_11pygame_sdl2_5color_colors = Py_None; Py_INCREF(Py_None);
21682 /*--- Variable export code ---*/
21683 /*--- Function export code ---*/
21684 if (__Pyx_ExportFunction("map_color", (void (*)(void))__pyx_f_11pygame_sdl2_5color_map_color, "Uint32 (SDL_Surface *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21685 if (__Pyx_ExportFunction("get_color", (void (*)(void))__pyx_f_11pygame_sdl2_5color_get_color, "PyObject *(Uint32, SDL_Surface *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21686 if (__Pyx_ExportFunction("to_sdl_color", (void (*)(void))__pyx_f_11pygame_sdl2_5color_to_sdl_color, "PyObject *(PyObject *, SDL_Color *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21687 /*--- Type init code ---*/
21688 __pyx_vtabptr_11pygame_sdl2_5color_Color = &__pyx_vtable_11pygame_sdl2_5color_Color;
21689 __pyx_vtable_11pygame_sdl2_5color_Color.from_rgba = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_5color_Color *, Uint8, Uint8, Uint8, Uint8))__pyx_f_11pygame_sdl2_5color_5Color_from_rgba;
21690 __pyx_vtable_11pygame_sdl2_5color_Color.from_name = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *))__pyx_f_11pygame_sdl2_5color_5Color_from_name;
21691 __pyx_vtable_11pygame_sdl2_5color_Color.from_hex = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_5color_Color *, PyObject *))__pyx_f_11pygame_sdl2_5color_5Color_from_hex;
21692 if (PyType_Ready(&__pyx_type_11pygame_sdl2_5color_Color) < 0) __PYX_ERR(0, 63, __pyx_L1_error)
21693 __pyx_type_11pygame_sdl2_5color_Color.tp_print = 0;
21694 if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_5color_Color.tp_dict, __pyx_vtabptr_11pygame_sdl2_5color_Color) < 0) __PYX_ERR(0, 63, __pyx_L1_error)
21695 if (PyObject_SetAttrString(__pyx_m, "Color", (PyObject *)&__pyx_type_11pygame_sdl2_5color_Color) < 0) __PYX_ERR(0, 63, __pyx_L1_error)
21696 if (__pyx_type_11pygame_sdl2_5color_Color.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_5color_Color.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_5color_Color, __weakref__);
21697 __pyx_ptype_11pygame_sdl2_5color_Color = &__pyx_type_11pygame_sdl2_5color_Color;
21698 if (PyType_Ready(&__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma) < 0) __PYX_ERR(0, 452, __pyx_L1_error)
21699 __pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma.tp_print = 0;
21700 __pyx_ptype_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma = &__pyx_type_11pygame_sdl2_5color___pyx_scope_struct__correct_gamma;
21701 /*--- Type import code ---*/
21702 /*--- Variable import code ---*/
21703 /*--- Function import code ---*/
21906 /*--- Global type/function init code ---*/
21907 (void)__Pyx_modinit_global_init_code();
21908 (void)__Pyx_modinit_variable_export_code();
21909 if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error;
21910 if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
21911 (void)__Pyx_modinit_type_import_code();
21912 (void)__Pyx_modinit_variable_import_code();
21913 (void)__Pyx_modinit_function_import_code();
2170421914 /*--- Execution code ---*/
2170521915 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
2170621916 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2173721947 * 'antiquewhite' : (250, 235, 215),
2173821948 * 'antiquewhite1' : (255, 239, 219),
2173921949 */
21740 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
21950 __pyx_t_1 = __Pyx_PyDict_NewPresized(676); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 5, __pyx_L1_error)
2174121951 __Pyx_GOTREF(__pyx_t_1);
2174221952 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_aliceblue, __pyx_tuple__12) < 0) __PYX_ERR(2, 5, __pyx_L1_error)
2174321953
2782428034 * # Copyright 2014 Patrick Dawson <pat@dw.is>
2782528035 * #
2782628036 */
27827 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
28037 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
2782828038 __Pyx_GOTREF(__pyx_t_1);
2782928039 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2783028040 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2783628046 __Pyx_XDECREF(__pyx_t_1);
2783728047 if (__pyx_m) {
2783828048 if (__pyx_d) {
27839 __Pyx_AddTraceback("init pygame_sdl2.color", __pyx_clineno, __pyx_lineno, __pyx_filename);
28049 __Pyx_AddTraceback("init pygame_sdl2.color", 0, __pyx_lineno, __pyx_filename);
2784028050 }
2784128051 Py_DECREF(__pyx_m); __pyx_m = 0;
2784228052 } else if (!PyErr_Occurred()) {
2784428054 }
2784528055 __pyx_L0:;
2784628056 __Pyx_RefNannyFinishContext();
27847 #if PY_MAJOR_VERSION < 3
28057 #if CYTHON_PEP489_MULTI_PHASE_INIT
28058 return (__pyx_m != NULL) ? 0 : -1;
28059 #elif PY_MAJOR_VERSION >= 3
28060 return __pyx_m;
28061 #else
2784828062 return;
27849 #else
27850 return __pyx_m;
2785128063 #endif
2785228064 }
2785328065
2786928081 }
2787028082 #endif
2787128083
28084 /* PyObjectGetAttrStr */
28085 #if CYTHON_USE_TYPE_SLOTS
28086 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
28087 PyTypeObject* tp = Py_TYPE(obj);
28088 if (likely(tp->tp_getattro))
28089 return tp->tp_getattro(obj, attr_name);
28090 #if PY_MAJOR_VERSION < 3
28091 if (likely(tp->tp_getattr))
28092 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
28093 #endif
28094 return PyObject_GetAttr(obj, attr_name);
28095 }
28096 #endif
28097
2787228098 /* GetBuiltinName */
2787328099 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
2787428100 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
2789928125 /* IterFinish */
2790028126 static CYTHON_INLINE int __Pyx_IterFinish(void) {
2790128127 #if CYTHON_FAST_THREAD_STATE
27902 PyThreadState *tstate = PyThreadState_GET();
28128 PyThreadState *tstate = __Pyx_PyThreadState_Current;
2790328129 PyObject* exc_type = tstate->curexc_type;
2790428130 if (unlikely(exc_type)) {
27905 if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
28131 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
2790628132 PyObject *exc_value, *exc_tb;
2790728133 exc_value = tstate->curexc_value;
2790828134 exc_tb = tstate->curexc_traceback;
2810328329 "raise: exception class must be a subclass of BaseException");
2810428330 goto bad;
2810528331 }
28106 #if PY_VERSION_HEX >= 0x03030000
2810728332 if (cause) {
28108 #else
28109 if (cause && cause != Py_None) {
28110 #endif
2811128333 PyObject *fixed_cause;
2811228334 if (cause == Py_None) {
2811328335 fixed_cause = NULL;
2813528357 PyErr_Restore(tmp_type, tmp_value, tb);
2813628358 Py_XDECREF(tmp_tb);
2813728359 #else
28138 PyThreadState *tstate = PyThreadState_GET();
28360 PyThreadState *tstate = __Pyx_PyThreadState_Current;
2813928361 PyObject* tmp_tb = tstate->curexc_traceback;
2814028362 if (tb != tmp_tb) {
2814128363 Py_INCREF(tb);
2815028372 }
2815128373 #endif
2815228374
28375 /* PyCFunctionFastCall */
28376 #if CYTHON_FAST_PYCCALL
28377 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
28378 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
28379 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
28380 PyObject *self = PyCFunction_GET_SELF(func);
28381 int flags = PyCFunction_GET_FLAGS(func);
28382 assert(PyCFunction_Check(func));
28383 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
28384 assert(nargs >= 0);
28385 assert(nargs == 0 || args != NULL);
28386 /* _PyCFunction_FastCallDict() must not be called with an exception set,
28387 because it may clear it (directly or indirectly) and so the
28388 caller loses its exception */
28389 assert(!PyErr_Occurred());
28390 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
28391 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
28392 } else {
28393 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
28394 }
28395 }
28396 #endif
28397
28398 /* PyFunctionFastCall */
28399 #if CYTHON_FAST_PYCALL
28400 #include "frameobject.h"
28401 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
28402 PyObject *globals) {
28403 PyFrameObject *f;
28404 PyThreadState *tstate = __Pyx_PyThreadState_Current;
28405 PyObject **fastlocals;
28406 Py_ssize_t i;
28407 PyObject *result;
28408 assert(globals != NULL);
28409 /* XXX Perhaps we should create a specialized
28410 PyFrame_New() that doesn't take locals, but does
28411 take builtins without sanity checking them.
28412 */
28413 assert(tstate != NULL);
28414 f = PyFrame_New(tstate, co, globals, NULL);
28415 if (f == NULL) {
28416 return NULL;
28417 }
28418 fastlocals = f->f_localsplus;
28419 for (i = 0; i < na; i++) {
28420 Py_INCREF(*args);
28421 fastlocals[i] = *args++;
28422 }
28423 result = PyEval_EvalFrameEx(f,0);
28424 ++tstate->recursion_depth;
28425 Py_DECREF(f);
28426 --tstate->recursion_depth;
28427 return result;
28428 }
28429 #if 1 || PY_VERSION_HEX < 0x030600B1
28430 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
28431 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
28432 PyObject *globals = PyFunction_GET_GLOBALS(func);
28433 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
28434 PyObject *closure;
28435 #if PY_MAJOR_VERSION >= 3
28436 PyObject *kwdefs;
28437 #endif
28438 PyObject *kwtuple, **k;
28439 PyObject **d;
28440 Py_ssize_t nd;
28441 Py_ssize_t nk;
28442 PyObject *result;
28443 assert(kwargs == NULL || PyDict_Check(kwargs));
28444 nk = kwargs ? PyDict_Size(kwargs) : 0;
28445 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
28446 return NULL;
28447 }
28448 if (
28449 #if PY_MAJOR_VERSION >= 3
28450 co->co_kwonlyargcount == 0 &&
28451 #endif
28452 likely(kwargs == NULL || nk == 0) &&
28453 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
28454 if (argdefs == NULL && co->co_argcount == nargs) {
28455 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
28456 goto done;
28457 }
28458 else if (nargs == 0 && argdefs != NULL
28459 && co->co_argcount == Py_SIZE(argdefs)) {
28460 /* function called with no arguments, but all parameters have
28461 a default value: use default values as arguments .*/
28462 args = &PyTuple_GET_ITEM(argdefs, 0);
28463 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
28464 goto done;
28465 }
28466 }
28467 if (kwargs != NULL) {
28468 Py_ssize_t pos, i;
28469 kwtuple = PyTuple_New(2 * nk);
28470 if (kwtuple == NULL) {
28471 result = NULL;
28472 goto done;
28473 }
28474 k = &PyTuple_GET_ITEM(kwtuple, 0);
28475 pos = i = 0;
28476 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
28477 Py_INCREF(k[i]);
28478 Py_INCREF(k[i+1]);
28479 i += 2;
28480 }
28481 nk = i / 2;
28482 }
28483 else {
28484 kwtuple = NULL;
28485 k = NULL;
28486 }
28487 closure = PyFunction_GET_CLOSURE(func);
28488 #if PY_MAJOR_VERSION >= 3
28489 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
28490 #endif
28491 if (argdefs != NULL) {
28492 d = &PyTuple_GET_ITEM(argdefs, 0);
28493 nd = Py_SIZE(argdefs);
28494 }
28495 else {
28496 d = NULL;
28497 nd = 0;
28498 }
28499 #if PY_MAJOR_VERSION >= 3
28500 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
28501 args, nargs,
28502 k, (int)nk,
28503 d, (int)nd, kwdefs, closure);
28504 #else
28505 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
28506 args, nargs,
28507 k, (int)nk,
28508 d, (int)nd, closure);
28509 #endif
28510 Py_XDECREF(kwtuple);
28511 done:
28512 Py_LeaveRecursiveCall();
28513 return result;
28514 }
28515 #endif
28516 #endif
28517
28518 /* PyObjectCallMethO */
28519 #if CYTHON_COMPILING_IN_CPYTHON
28520 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
28521 PyObject *self, *result;
28522 PyCFunction cfunc;
28523 cfunc = PyCFunction_GET_FUNCTION(func);
28524 self = PyCFunction_GET_SELF(func);
28525 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
28526 return NULL;
28527 result = cfunc(self, arg);
28528 Py_LeaveRecursiveCall();
28529 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
28530 PyErr_SetString(
28531 PyExc_SystemError,
28532 "NULL result without error in PyObject_Call");
28533 }
28534 return result;
28535 }
28536 #endif
28537
28538 /* PyObjectCallOneArg */
28539 #if CYTHON_COMPILING_IN_CPYTHON
28540 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
28541 PyObject *result;
28542 PyObject *args = PyTuple_New(1);
28543 if (unlikely(!args)) return NULL;
28544 Py_INCREF(arg);
28545 PyTuple_SET_ITEM(args, 0, arg);
28546 result = __Pyx_PyObject_Call(func, args, NULL);
28547 Py_DECREF(args);
28548 return result;
28549 }
28550 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
28551 #if CYTHON_FAST_PYCALL
28552 if (PyFunction_Check(func)) {
28553 return __Pyx_PyFunction_FastCall(func, &arg, 1);
28554 }
28555 #endif
28556 if (likely(PyCFunction_Check(func))) {
28557 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
28558 return __Pyx_PyObject_CallMethO(func, arg);
28559 #if CYTHON_FAST_PYCCALL
28560 } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
28561 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
28562 #endif
28563 }
28564 }
28565 return __Pyx__PyObject_CallOneArg(func, arg);
28566 }
28567 #else
28568 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
28569 PyObject *result;
28570 PyObject *args = PyTuple_Pack(1, arg);
28571 if (unlikely(!args)) return NULL;
28572 result = __Pyx_PyObject_Call(func, args, NULL);
28573 Py_DECREF(args);
28574 return result;
28575 }
28576 #endif
28577
2815328578 /* FetchCommonType */
28154 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
28579 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
2815528580 PyObject* fake_module;
2815628581 PyTypeObject* cached_type = NULL;
2815728582 fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
2819028615 }
2819128616
2819228617 /* CythonFunction */
28193 static PyObject *
28618 #include <structmember.h>
28619 static PyObject *
2819428620 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
2819528621 {
2819628622 if (unlikely(op->func_doc == NULL)) {
2847228898 {0, 0, 0, 0, 0}
2847328899 };
2847428900 static PyMemberDef __pyx_CyFunction_members[] = {
28475 {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
28901 {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
2847628902 {0, 0, 0, 0, 0}
2847728903 };
2847828904 static PyObject *
2855028976 }
2855128977 return 0;
2855228978 }
28553 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
28979 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
2855428980 {
28555 PyObject_GC_UnTrack(m);
2855628981 if (__Pyx_CyFunction_weakreflist(m) != NULL)
2855728982 PyObject_ClearWeakRefs((PyObject *) m);
2855828983 __Pyx_CyFunction_clear(m);
2855928984 PyObject_GC_Del(m);
28985 }
28986 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
28987 {
28988 PyObject_GC_UnTrack(m);
28989 __Pyx__CyFunction_dealloc(m);
2856028990 }
2856128991 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
2856228992 {
2863229062 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
2863329063 size = PyTuple_GET_SIZE(arg);
2863429064 if (likely(size == 1)) {
28635 PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
28636 if (unlikely(!arg0)) return NULL;
29065 PyObject *result, *arg0;
29066 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29067 arg0 = PyTuple_GET_ITEM(arg, 0);
29068 #else
29069 arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
29070 #endif
2863729071 result = (*meth)(self, arg0);
29072 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
2863829073 Py_DECREF(arg0);
29074 #endif
2863929075 return result;
2864029076 }
2864129077 PyErr_Format(PyExc_TypeError,
2874229178 };
2874329179 static int __pyx_CyFunction_init(void) {
2874429180 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
28745 if (__pyx_CyFunctionType == NULL) {
29181 if (unlikely(__pyx_CyFunctionType == NULL)) {
2874629182 return -1;
2874729183 }
2874829184 return 0;
2875029186 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
2875129187 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
2875229188 m->defaults = PyObject_Malloc(size);
28753 if (!m->defaults)
29189 if (unlikely(!m->defaults))
2875429190 return PyErr_NoMemory();
2875529191 memset(m->defaults, 0, size);
2875629192 m->defaults_pyobjects = pyobjects;
2877329209 }
2877429210
2877529211 /* GetModuleGlobalName */
28776 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
29212 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
2877729213 PyObject *result;
2877829214 #if !CYTHON_AVOID_BORROWED_REFS
29215 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
29216 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
29217 if (likely(result)) {
29218 Py_INCREF(result);
29219 } else if (unlikely(PyErr_Occurred())) {
29220 result = NULL;
29221 } else {
29222 #else
2877929223 result = PyDict_GetItem(__pyx_d, name);
2878029224 if (likely(result)) {
2878129225 Py_INCREF(result);
2878229226 } else {
29227 #endif
2878329228 #else
2878429229 result = PyObject_GetItem(__pyx_d, name);
2878529230 if (!result) {
2879029235 return result;
2879129236 }
2879229237
28793 /* PyCFunctionFastCall */
28794 #if CYTHON_FAST_PYCCALL
28795 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
28796 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
28797 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
28798 PyObject *self = PyCFunction_GET_SELF(func);
28799 assert(PyCFunction_Check(func));
28800 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
28801 assert(nargs >= 0);
28802 assert(nargs == 0 || args != NULL);
28803 /* _PyCFunction_FastCallDict() must not be called with an exception set,
28804 because it may clear it (directly or indirectly) and so the
28805 caller loses its exception */
28806 assert(!PyErr_Occurred());
28807 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
28808 }
28809 #endif // CYTHON_FAST_PYCCALL
28810
28811 /* PyFunctionFastCall */
28812 #if CYTHON_FAST_PYCALL
28813 #include "frameobject.h"
28814 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
28815 PyObject *globals) {
28816 PyFrameObject *f;
28817 PyThreadState *tstate = PyThreadState_GET();
28818 PyObject **fastlocals;
28819 Py_ssize_t i;
28820 PyObject *result;
28821 assert(globals != NULL);
28822 /* XXX Perhaps we should create a specialized
28823 PyFrame_New() that doesn't take locals, but does
28824 take builtins without sanity checking them.
28825 */
28826 assert(tstate != NULL);
28827 f = PyFrame_New(tstate, co, globals, NULL);
28828 if (f == NULL) {
28829 return NULL;
28830 }
28831 fastlocals = f->f_localsplus;
28832 for (i = 0; i < na; i++) {
28833 Py_INCREF(*args);
28834 fastlocals[i] = *args++;
28835 }
28836 result = PyEval_EvalFrameEx(f,0);
28837 ++tstate->recursion_depth;
28838 Py_DECREF(f);
28839 --tstate->recursion_depth;
28840 return result;
28841 }
28842 #if 1 || PY_VERSION_HEX < 0x030600B1
28843 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
28844 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
28845 PyObject *globals = PyFunction_GET_GLOBALS(func);
28846 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
28847 PyObject *closure;
28848 #if PY_MAJOR_VERSION >= 3
28849 PyObject *kwdefs;
28850 #endif
28851 PyObject *kwtuple, **k;
28852 PyObject **d;
28853 Py_ssize_t nd;
28854 Py_ssize_t nk;
28855 PyObject *result;
28856 assert(kwargs == NULL || PyDict_Check(kwargs));
28857 nk = kwargs ? PyDict_Size(kwargs) : 0;
28858 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
28859 return NULL;
28860 }
28861 if (
28862 #if PY_MAJOR_VERSION >= 3
28863 co->co_kwonlyargcount == 0 &&
28864 #endif
28865 likely(kwargs == NULL || nk == 0) &&
28866 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
28867 if (argdefs == NULL && co->co_argcount == nargs) {
28868 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
28869 goto done;
28870 }
28871 else if (nargs == 0 && argdefs != NULL
28872 && co->co_argcount == Py_SIZE(argdefs)) {
28873 /* function called with no arguments, but all parameters have
28874 a default value: use default values as arguments .*/
28875 args = &PyTuple_GET_ITEM(argdefs, 0);
28876 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
28877 goto done;
28878 }
28879 }
28880 if (kwargs != NULL) {
28881 Py_ssize_t pos, i;
28882 kwtuple = PyTuple_New(2 * nk);
28883 if (kwtuple == NULL) {
28884 result = NULL;
28885 goto done;
28886 }
28887 k = &PyTuple_GET_ITEM(kwtuple, 0);
28888 pos = i = 0;
28889 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
28890 Py_INCREF(k[i]);
28891 Py_INCREF(k[i+1]);
28892 i += 2;
28893 }
28894 nk = i / 2;
28895 }
28896 else {
28897 kwtuple = NULL;
28898 k = NULL;
28899 }
28900 closure = PyFunction_GET_CLOSURE(func);
28901 #if PY_MAJOR_VERSION >= 3
28902 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
28903 #endif
28904 if (argdefs != NULL) {
28905 d = &PyTuple_GET_ITEM(argdefs, 0);
28906 nd = Py_SIZE(argdefs);
28907 }
28908 else {
28909 d = NULL;
28910 nd = 0;
28911 }
28912 #if PY_MAJOR_VERSION >= 3
28913 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
28914 args, nargs,
28915 k, (int)nk,
28916 d, (int)nd, kwdefs, closure);
28917 #else
28918 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
28919 args, nargs,
28920 k, (int)nk,
28921 d, (int)nd, closure);
28922 #endif
28923 Py_XDECREF(kwtuple);
28924 done:
28925 Py_LeaveRecursiveCall();
28926 return result;
28927 }
28928 #endif // CPython < 3.6
28929 #endif // CYTHON_FAST_PYCALL
28930
28931 /* PyObjectCallMethO */
28932 #if CYTHON_COMPILING_IN_CPYTHON
28933 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
28934 PyObject *self, *result;
28935 PyCFunction cfunc;
28936 cfunc = PyCFunction_GET_FUNCTION(func);
28937 self = PyCFunction_GET_SELF(func);
28938 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
28939 return NULL;
28940 result = cfunc(self, arg);
28941 Py_LeaveRecursiveCall();
28942 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
28943 PyErr_SetString(
28944 PyExc_SystemError,
28945 "NULL result without error in PyObject_Call");
28946 }
28947 return result;
28948 }
28949 #endif
28950
28951 /* PyObjectCallOneArg */
28952 #if CYTHON_COMPILING_IN_CPYTHON
28953 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
28954 PyObject *result;
28955 PyObject *args = PyTuple_New(1);
28956 if (unlikely(!args)) return NULL;
28957 Py_INCREF(arg);
28958 PyTuple_SET_ITEM(args, 0, arg);
28959 result = __Pyx_PyObject_Call(func, args, NULL);
28960 Py_DECREF(args);
28961 return result;
28962 }
28963 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
28964 #if CYTHON_FAST_PYCALL
28965 if (PyFunction_Check(func)) {
28966 return __Pyx_PyFunction_FastCall(func, &arg, 1);
28967 }
28968 #endif
28969 #ifdef __Pyx_CyFunction_USED
28970 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
28971 #else
28972 if (likely(PyCFunction_Check(func))) {
28973 #endif
28974 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
28975 return __Pyx_PyObject_CallMethO(func, arg);
28976 #if CYTHON_FAST_PYCCALL
28977 } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
28978 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
28979 #endif
28980 }
28981 }
28982 return __Pyx__PyObject_CallOneArg(func, arg);
28983 }
28984 #else
28985 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
28986 PyObject *result;
28987 PyObject *args = PyTuple_Pack(1, arg);
28988 if (unlikely(!args)) return NULL;
28989 result = __Pyx_PyObject_Call(func, args, NULL);
28990 Py_DECREF(args);
28991 return result;
28992 }
28993 #endif
28994
2899529238 /* SaveResetException */
28996 #if CYTHON_FAST_THREAD_STATE
29239 #if CYTHON_FAST_THREAD_STATE
2899729240 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
29241 #if PY_VERSION_HEX >= 0x030700A3
29242 *type = tstate->exc_state.exc_type;
29243 *value = tstate->exc_state.exc_value;
29244 *tb = tstate->exc_state.exc_traceback;
29245 #else
2899829246 *type = tstate->exc_type;
2899929247 *value = tstate->exc_value;
2900029248 *tb = tstate->exc_traceback;
29249 #endif
2900129250 Py_XINCREF(*type);
2900229251 Py_XINCREF(*value);
2900329252 Py_XINCREF(*tb);
2900429253 }
2900529254 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
2900629255 PyObject *tmp_type, *tmp_value, *tmp_tb;
29256 #if PY_VERSION_HEX >= 0x030700A3
29257 tmp_type = tstate->exc_state.exc_type;
29258 tmp_value = tstate->exc_state.exc_value;
29259 tmp_tb = tstate->exc_state.exc_traceback;
29260 tstate->exc_state.exc_type = type;
29261 tstate->exc_state.exc_value = value;
29262 tstate->exc_state.exc_traceback = tb;
29263 #else
2900729264 tmp_type = tstate->exc_type;
2900829265 tmp_value = tstate->exc_value;
2900929266 tmp_tb = tstate->exc_traceback;
2901029267 tstate->exc_type = type;
2901129268 tstate->exc_value = value;
2901229269 tstate->exc_traceback = tb;
29270 #endif
2901329271 Py_XDECREF(tmp_type);
2901429272 Py_XDECREF(tmp_value);
2901529273 Py_XDECREF(tmp_tb);
2901729275 #endif
2901829276
2901929277 /* PyErrExceptionMatches */
29020 #if CYTHON_FAST_THREAD_STATE
29278 #if CYTHON_FAST_THREAD_STATE
29279 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
29280 Py_ssize_t i, n;
29281 n = PyTuple_GET_SIZE(tuple);
29282 #if PY_MAJOR_VERSION >= 3
29283 for (i=0; i<n; i++) {
29284 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
29285 }
29286 #endif
29287 for (i=0; i<n; i++) {
29288 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
29289 }
29290 return 0;
29291 }
2902129292 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
2902229293 PyObject *exc_type = tstate->curexc_type;
2902329294 if (exc_type == err) return 1;
2902429295 if (unlikely(!exc_type)) return 0;
29025 return PyErr_GivenExceptionMatches(exc_type, err);
29296 if (unlikely(PyTuple_Check(err)))
29297 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
29298 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
2902629299 }
2902729300 #endif
2902829301
2902929302 /* GetException */
29030 #if CYTHON_FAST_THREAD_STATE
29303 #if CYTHON_FAST_THREAD_STATE
2903129304 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
2903229305 #else
2903329306 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
2906429337 *value = local_value;
2906529338 *tb = local_tb;
2906629339 #if CYTHON_FAST_THREAD_STATE
29340 #if PY_VERSION_HEX >= 0x030700A3
29341 tmp_type = tstate->exc_state.exc_type;
29342 tmp_value = tstate->exc_state.exc_value;
29343 tmp_tb = tstate->exc_state.exc_traceback;
29344 tstate->exc_state.exc_type = local_type;
29345 tstate->exc_state.exc_value = local_value;
29346 tstate->exc_state.exc_traceback = local_tb;
29347 #else
2906729348 tmp_type = tstate->exc_type;
2906829349 tmp_value = tstate->exc_value;
2906929350 tmp_tb = tstate->exc_traceback;
2907029351 tstate->exc_type = local_type;
2907129352 tstate->exc_value = local_value;
2907229353 tstate->exc_traceback = local_tb;
29354 #endif
2907329355 Py_XDECREF(tmp_type);
2907429356 Py_XDECREF(tmp_value);
2907529357 Py_XDECREF(tmp_tb);
2908829370 }
2908929371
2909029372 /* SwapException */
29091 #if CYTHON_FAST_THREAD_STATE
29373 #if CYTHON_FAST_THREAD_STATE
2909229374 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
2909329375 PyObject *tmp_type, *tmp_value, *tmp_tb;
29376 #if PY_VERSION_HEX >= 0x030700A3
29377 tmp_type = tstate->exc_state.exc_type;
29378 tmp_value = tstate->exc_state.exc_value;
29379 tmp_tb = tstate->exc_state.exc_traceback;
29380 tstate->exc_state.exc_type = *type;
29381 tstate->exc_state.exc_value = *value;
29382 tstate->exc_state.exc_traceback = *tb;
29383 #else
2909429384 tmp_type = tstate->exc_type;
2909529385 tmp_value = tstate->exc_value;
2909629386 tmp_tb = tstate->exc_traceback;
2909729387 tstate->exc_type = *type;
2909829388 tstate->exc_value = *value;
2909929389 tstate->exc_traceback = *tb;
29390 #endif
2910029391 *type = tmp_type;
2910129392 *value = tmp_value;
2910229393 *tb = tmp_tb;
2911329404 #endif
2911429405
2911529406 /* PyObjectCallNoArg */
29116 #if CYTHON_COMPILING_IN_CPYTHON
29407 #if CYTHON_COMPILING_IN_CPYTHON
2911729408 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
2911829409 #if CYTHON_FAST_PYCALL
2911929410 if (PyFunction_Check(func)) {
2912129412 }
2912229413 #endif
2912329414 #ifdef __Pyx_CyFunction_USED
29124 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
29415 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
2912529416 #else
2912629417 if (likely(PyCFunction_Check(func))) {
2912729418 #endif
2913329424 }
2913429425 #endif
2913529426
29136 /* ArgTypeTest */
29137 static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
29138 PyErr_Format(PyExc_TypeError,
29139 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
29140 name, type->tp_name, Py_TYPE(obj)->tp_name);
29141 }
29142 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
29143 const char *name, int exact)
29144 {
29145 if (unlikely(!type)) {
29146 PyErr_SetString(PyExc_SystemError, "Missing type object");
29147 return 0;
29148 }
29149 if (none_allowed && obj == Py_None) return 1;
29150 else if (exact) {
29151 if (likely(Py_TYPE(obj) == type)) return 1;
29152 #if PY_MAJOR_VERSION == 2
29153 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
29154 #endif
29155 }
29156 else {
29157 if (likely(PyObject_TypeCheck(obj, type))) return 1;
29158 }
29159 __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
29160 return 0;
29161 }
29162
29163 /* RaiseArgTupleInvalid */
29164 static void __Pyx_RaiseArgtupleInvalid(
29165 const char* func_name,
29166 int exact,
29167 Py_ssize_t num_min,
29168 Py_ssize_t num_max,
29169 Py_ssize_t num_found)
29170 {
29171 Py_ssize_t num_expected;
29172 const char *more_or_less;
29173 if (num_found < num_min) {
29174 num_expected = num_min;
29175 more_or_less = "at least";
29176 } else {
29177 num_expected = num_max;
29178 more_or_less = "at most";
29179 }
29180 if (exact) {
29181 more_or_less = "exactly";
29182 }
29183 PyErr_Format(PyExc_TypeError,
29184 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
29185 func_name, more_or_less, num_expected,
29186 (num_expected == 1) ? "" : "s", num_found);
29187 }
29188
29189 /* KeywordStringCheck */
29190 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
29191 PyObject *kwdict,
29192 const char* function_name,
29193 int kw_allowed)
29194 {
29195 PyObject* key = 0;
29196 Py_ssize_t pos = 0;
29197 #if CYTHON_COMPILING_IN_PYPY
29198 if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
29199 goto invalid_keyword;
29200 return 1;
29201 #else
29202 while (PyDict_Next(kwdict, &pos, &key, 0)) {
29203 #if PY_MAJOR_VERSION < 3
29204 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
29205 #endif
29206 if (unlikely(!PyUnicode_Check(key)))
29207 goto invalid_keyword_type;
29208 }
29209 if ((!kw_allowed) && unlikely(key))
29210 goto invalid_keyword;
29211 return 1;
29212 invalid_keyword_type:
29213 PyErr_Format(PyExc_TypeError,
29214 "%.200s() keywords must be strings", function_name);
29215 return 0;
29216 #endif
29217 invalid_keyword:
29218 PyErr_Format(PyExc_TypeError,
29219 #if PY_MAJOR_VERSION < 3
29220 "%.200s() got an unexpected keyword argument '%.200s'",
29221 function_name, PyString_AsString(key));
29222 #else
29223 "%s() got an unexpected keyword argument '%U'",
29224 function_name, key);
29225 #endif
29226 return 0;
29227 }
29228
2922929427 /* GetItemInt */
29230 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
29428 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
2923129429 PyObject *r;
2923229430 if (!j) return NULL;
2923329431 r = PyObject_GetItem(o, j);
2923829436 CYTHON_NCP_UNUSED int wraparound,
2923929437 CYTHON_NCP_UNUSED int boundscheck) {
2924029438 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29241 if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
29242 if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
29243 PyObject *r = PyList_GET_ITEM(o, i);
29439 Py_ssize_t wrapped_i = i;
29440 if (wraparound & unlikely(i < 0)) {
29441 wrapped_i += PyList_GET_SIZE(o);
29442 }
29443 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
29444 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
2924429445 Py_INCREF(r);
2924529446 return r;
2924629447 }
2925329454 CYTHON_NCP_UNUSED int wraparound,
2925429455 CYTHON_NCP_UNUSED int boundscheck) {
2925529456 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29256 if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
29257 if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
29258 PyObject *r = PyTuple_GET_ITEM(o, i);
29457 Py_ssize_t wrapped_i = i;
29458 if (wraparound & unlikely(i < 0)) {
29459 wrapped_i += PyTuple_GET_SIZE(o);
29460 }
29461 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
29462 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
2925929463 Py_INCREF(r);
2926029464 return r;
2926129465 }
2930729511 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
2930829512 }
2930929513
29514 /* ObjectGetItem */
29515 #if CYTHON_USE_TYPE_SLOTS
29516 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
29517 PyObject *runerr;
29518 Py_ssize_t key_value;
29519 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
29520 if (unlikely(!(m && m->sq_item))) {
29521 PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
29522 return NULL;
29523 }
29524 key_value = __Pyx_PyIndex_AsSsize_t(index);
29525 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
29526 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
29527 }
29528 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
29529 PyErr_Clear();
29530 PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
29531 }
29532 return NULL;
29533 }
29534 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
29535 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
29536 if (likely(m && m->mp_subscript)) {
29537 return m->mp_subscript(obj, key);
29538 }
29539 return __Pyx_PyObject_GetIndex(obj, key);
29540 }
29541 #endif
29542
29543 /* RaiseArgTupleInvalid */
29544 static void __Pyx_RaiseArgtupleInvalid(
29545 const char* func_name,
29546 int exact,
29547 Py_ssize_t num_min,
29548 Py_ssize_t num_max,
29549 Py_ssize_t num_found)
29550 {
29551 Py_ssize_t num_expected;
29552 const char *more_or_less;
29553 if (num_found < num_min) {
29554 num_expected = num_min;
29555 more_or_less = "at least";
29556 } else {
29557 num_expected = num_max;
29558 more_or_less = "at most";
29559 }
29560 if (exact) {
29561 more_or_less = "exactly";
29562 }
29563 PyErr_Format(PyExc_TypeError,
29564 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
29565 func_name, more_or_less, num_expected,
29566 (num_expected == 1) ? "" : "s", num_found);
29567 }
29568
29569 /* KeywordStringCheck */
29570 static int __Pyx_CheckKeywordStrings(
29571 PyObject *kwdict,
29572 const char* function_name,
29573 int kw_allowed)
29574 {
29575 PyObject* key = 0;
29576 Py_ssize_t pos = 0;
29577 #if CYTHON_COMPILING_IN_PYPY
29578 if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
29579 goto invalid_keyword;
29580 return 1;
29581 #else
29582 while (PyDict_Next(kwdict, &pos, &key, 0)) {
29583 #if PY_MAJOR_VERSION < 3
29584 if (unlikely(!PyString_Check(key)))
29585 #endif
29586 if (unlikely(!PyUnicode_Check(key)))
29587 goto invalid_keyword_type;
29588 }
29589 if ((!kw_allowed) && unlikely(key))
29590 goto invalid_keyword;
29591 return 1;
29592 invalid_keyword_type:
29593 PyErr_Format(PyExc_TypeError,
29594 "%.200s() keywords must be strings", function_name);
29595 return 0;
29596 #endif
29597 invalid_keyword:
29598 PyErr_Format(PyExc_TypeError,
29599 #if PY_MAJOR_VERSION < 3
29600 "%.200s() got an unexpected keyword argument '%.200s'",
29601 function_name, PyString_AsString(key));
29602 #else
29603 "%s() got an unexpected keyword argument '%U'",
29604 function_name, key);
29605 #endif
29606 return 0;
29607 }
29608
2931029609 /* SliceObject */
29311 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
29610 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
2931229611 Py_ssize_t cstart, Py_ssize_t cstop,
2931329612 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
2931429613 int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
2940429703 return NULL;
2940529704 }
2940629705
29706 /* DictGetItem */
29707 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
29708 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
29709 PyObject *value;
29710 value = PyDict_GetItemWithError(d, key);
29711 if (unlikely(!value)) {
29712 if (!PyErr_Occurred()) {
29713 PyObject* args = PyTuple_Pack(1, key);
29714 if (likely(args))
29715 PyErr_SetObject(PyExc_KeyError, args);
29716 Py_XDECREF(args);
29717 }
29718 return NULL;
29719 }
29720 Py_INCREF(value);
29721 return value;
29722 }
29723 #endif
29724
2940729725 /* PyIntBinop */
29408 #if !CYTHON_COMPILING_IN_PYPY
29726 #if !CYTHON_COMPILING_IN_PYPY
2940929727 static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
2941029728 if (op1 == op2) {
2941129729 Py_RETURN_TRUE;
2943729755 a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
2943829756 break;
2943929757 }
29758 CYTHON_FALLTHROUGH;
2944029759 case 2:
2944129760 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
2944229761 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
2944329762 break;
2944429763 }
29764 CYTHON_FALLTHROUGH;
2944529765 case -3:
2944629766 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
2944729767 a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
2944829768 break;
2944929769 }
29770 CYTHON_FALLTHROUGH;
2945029771 case 3:
2945129772 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
2945229773 a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
2945329774 break;
2945429775 }
29776 CYTHON_FALLTHROUGH;
2945529777 case -4:
2945629778 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
2945729779 a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
2945829780 break;
2945929781 }
29782 CYTHON_FALLTHROUGH;
2946029783 case 4:
2946129784 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
2946229785 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
2946329786 break;
2946429787 }
29788 CYTHON_FALLTHROUGH;
2946529789 #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
2946629790 default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
2946729791 #else
2948929813 }
2949029814 #endif
2949129815
29816 /* ArgTypeTest */
29817 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
29818 {
29819 if (unlikely(!type)) {
29820 PyErr_SetString(PyExc_SystemError, "Missing type object");
29821 return 0;
29822 }
29823 else if (exact) {
29824 #if PY_MAJOR_VERSION == 2
29825 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
29826 #endif
29827 }
29828 else {
29829 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
29830 }
29831 PyErr_Format(PyExc_TypeError,
29832 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
29833 name, type->tp_name, Py_TYPE(obj)->tp_name);
29834 return 0;
29835 }
29836
2949229837 /* RaiseDoubleKeywords */
29493 static void __Pyx_RaiseDoubleKeywordsError(
29838 static void __Pyx_RaiseDoubleKeywordsError(
2949429839 const char* func_name,
2949529840 PyObject* kw_name)
2949629841 {
2950429849 }
2950529850
2950629851 /* ParseKeywords */
29507 static int __Pyx_ParseOptionalKeywords(
29852 static int __Pyx_ParseOptionalKeywords(
2950829853 PyObject *kwds,
2950929854 PyObject **argnames[],
2951029855 PyObject *kwds2,
2960629951 }
2960729952
2960829953 /* PyIntBinop */
29609 #if !CYTHON_COMPILING_IN_PYPY
29954 #if !CYTHON_COMPILING_IN_PYPY
2961029955 static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
2961129956 #if PY_MAJOR_VERSION < 3
2961229957 if (likely(PyInt_CheckExact(op2))) {
2964429989 goto long_long;
2964529990 #endif
2964629991 }
29992 CYTHON_FALLTHROUGH;
2964729993 case 2:
2964829994 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
2964929995 b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
2965430000 goto long_long;
2965530001 #endif
2965630002 }
30003 CYTHON_FALLTHROUGH;
2965730004 case -3:
2965830005 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
2965930006 b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
2966430011 goto long_long;
2966530012 #endif
2966630013 }
30014 CYTHON_FALLTHROUGH;
2966730015 case 3:
2966830016 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
2966930017 b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
2967430022 goto long_long;
2967530023 #endif
2967630024 }
30025 CYTHON_FALLTHROUGH;
2967730026 case -4:
2967830027 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
2967930028 b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
2968430033 goto long_long;
2968530034 #endif
2968630035 }
30036 CYTHON_FALLTHROUGH;
2968730037 case 4:
2968830038 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
2968930039 b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
2969430044 goto long_long;
2969530045 #endif
2969630046 }
30047 CYTHON_FALLTHROUGH;
2969730048 default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
2969830049 }
2969930050 }
2972230073 #endif
2972330074
2972430075 /* None */
29725 static CYTHON_INLINE double __Pyx_mod_double(double a, double b) {
30076 static CYTHON_INLINE double __Pyx_mod_double(double a, double b) {
2972630077 double r = fmod(a, b);
2972730078 r += ((r != 0) & ((r < 0) ^ (b < 0))) * b;
2972830079 return r;
2972930080 }
2973030081
2973130082 /* PyFloatBinop */
29732 #if !CYTHON_COMPILING_IN_PYPY
30083 #if !CYTHON_COMPILING_IN_PYPY
2973330084 static PyObject* __Pyx_PyFloat_RemainderObjC(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) {
2973430085 const double b = floatval;
2973530086 double a, result;
2975330104 case 2:
2975430105 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
2975530106 a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
29756 if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
30107 if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
2975730108 if (size == -2)
2975830109 a = -a;
2975930110 break;
2976030111 }
2976130112 }
30113 CYTHON_FALLTHROUGH;
2976230114 case -3:
2976330115 case 3:
2976430116 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
2976530117 a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
29766 if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
30118 if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
2976730119 if (size == -3)
2976830120 a = -a;
2976930121 break;
2977030122 }
2977130123 }
30124 CYTHON_FALLTHROUGH;
2977230125 case -4:
2977330126 case 4:
2977430127 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
2977530128 a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
29776 if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
30129 if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
2977730130 if (size == -4)
2977830131 a = -a;
2977930132 break;
2978030133 }
2978130134 }
30135 CYTHON_FALLTHROUGH;
2978230136 default:
2978330137 #else
2978430138 {
2980130155 #endif
2980230156
2980330157 /* PyFloatBinop */
29804 #if !CYTHON_COMPILING_IN_PYPY
30158 #if !CYTHON_COMPILING_IN_PYPY
2980530159 static PyObject* __Pyx_PyFloat_TrueDivideObjC(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) {
2980630160 const double b = floatval;
2980730161 double a, result;
2982530179 case 2:
2982630180 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
2982730181 a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
29828 if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
30182 if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
2982930183 if (size == -2)
2983030184 a = -a;
2983130185 break;
2983230186 }
2983330187 }
30188 CYTHON_FALLTHROUGH;
2983430189 case -3:
2983530190 case 3:
2983630191 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
2983730192 a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
29838 if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
30193 if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
2983930194 if (size == -3)
2984030195 a = -a;
2984130196 break;
2984230197 }
2984330198 }
30199 CYTHON_FALLTHROUGH;
2984430200 case -4:
2984530201 case 4:
2984630202 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
2984730203 a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
29848 if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
30204 if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
2984930205 if (size == -4)
2985030206 a = -a;
2985130207 break;
2985230208 }
2985330209 }
30210 CYTHON_FALLTHROUGH;
2985430211 default:
2985530212 #else
2985630213 {
2986930226 #endif
2987030227
2987130228 /* None */
29872 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
30229 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
2987330230 PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
2987430231 }
2987530232
30233 /* PyObject_GenericGetAttrNoDict */
30234 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
30235 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
30236 PyErr_Format(PyExc_AttributeError,
30237 #if PY_MAJOR_VERSION >= 3
30238 "'%.50s' object has no attribute '%U'",
30239 tp->tp_name, attr_name);
30240 #else
30241 "'%.50s' object has no attribute '%.400s'",
30242 tp->tp_name, PyString_AS_STRING(attr_name));
30243 #endif
30244 return NULL;
30245 }
30246 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
30247 PyObject *descr;
30248 PyTypeObject *tp = Py_TYPE(obj);
30249 if (unlikely(!PyString_Check(attr_name))) {
30250 return PyObject_GenericGetAttr(obj, attr_name);
30251 }
30252 assert(!tp->tp_dictoffset);
30253 descr = _PyType_Lookup(tp, attr_name);
30254 if (unlikely(!descr)) {
30255 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
30256 }
30257 Py_INCREF(descr);
30258 #if PY_MAJOR_VERSION < 3
30259 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
30260 #endif
30261 {
30262 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
30263 if (unlikely(f)) {
30264 PyObject *res = f(descr, obj, (PyObject *)tp);
30265 Py_DECREF(descr);
30266 return res;
30267 }
30268 }
30269 return descr;
30270 }
30271 #endif
30272
30273 /* PyObject_GenericGetAttr */
30274 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
30275 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
30276 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
30277 return PyObject_GenericGetAttr(obj, attr_name);
30278 }
30279 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
30280 }
30281 #endif
30282
2987630283 /* SetVTable */
29877 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
30284 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
2987830285 #if PY_VERSION_HEX >= 0x02070000
2987930286 PyObject *ob = PyCapsule_New(vtable, 0, 0);
2988030287 #else
2989230299 }
2989330300
2989430301 /* Import */
29895 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
30302 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
2989630303 PyObject *empty_list = 0;
2989730304 PyObject *module = 0;
2989830305 PyObject *global_dict = 0;
2989930306 PyObject *empty_dict = 0;
2990030307 PyObject *list;
29901 #if PY_VERSION_HEX < 0x03030000
30308 #if PY_MAJOR_VERSION < 3
2990230309 PyObject *py_import;
2990330310 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
2990430311 if (!py_import)
2992230329 #if PY_MAJOR_VERSION >= 3
2992330330 if (level == -1) {
2992430331 if (strchr(__Pyx_MODULE_NAME, '.')) {
29925 #if PY_VERSION_HEX < 0x03030000
29926 PyObject *py_level = PyInt_FromLong(1);
29927 if (!py_level)
29928 goto bad;
29929 module = PyObject_CallFunctionObjArgs(py_import,
29930 name, global_dict, empty_dict, list, py_level, NULL);
29931 Py_DECREF(py_level);
29932 #else
2993330332 module = PyImport_ImportModuleLevelObject(
2993430333 name, global_dict, empty_dict, list, 1);
29935 #endif
2993630334 if (!module) {
2993730335 if (!PyErr_ExceptionMatches(PyExc_ImportError))
2993830336 goto bad;
2994330341 }
2994430342 #endif
2994530343 if (!module) {
29946 #if PY_VERSION_HEX < 0x03030000
30344 #if PY_MAJOR_VERSION < 3
2994730345 PyObject *py_level = PyInt_FromLong(level);
2994830346 if (!py_level)
2994930347 goto bad;
2995730355 }
2995830356 }
2995930357 bad:
29960 #if PY_VERSION_HEX < 0x03030000
30358 #if PY_MAJOR_VERSION < 3
2996130359 Py_XDECREF(py_import);
2996230360 #endif
2996330361 Py_XDECREF(empty_list);
2996530363 return module;
2996630364 }
2996730365
30366 /* CLineInTraceback */
30367 #ifndef CYTHON_CLINE_IN_TRACEBACK
30368 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
30369 PyObject *use_cline;
30370 PyObject *ptype, *pvalue, *ptraceback;
30371 #if CYTHON_COMPILING_IN_CPYTHON
30372 PyObject **cython_runtime_dict;
30373 #endif
30374 if (unlikely(!__pyx_cython_runtime)) {
30375 return c_line;
30376 }
30377 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
30378 #if CYTHON_COMPILING_IN_CPYTHON
30379 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
30380 if (likely(cython_runtime_dict)) {
30381 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
30382 } else
30383 #endif
30384 {
30385 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
30386 if (use_cline_obj) {
30387 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
30388 Py_DECREF(use_cline_obj);
30389 } else {
30390 PyErr_Clear();
30391 use_cline = NULL;
30392 }
30393 }
30394 if (!use_cline) {
30395 c_line = 0;
30396 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
30397 }
30398 else if (PyObject_Not(use_cline) != 0) {
30399 c_line = 0;
30400 }
30401 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
30402 return c_line;
30403 }
30404 #endif
30405
2996830406 /* CodeObjectCache */
29969 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
30407 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
2997030408 int start = 0, mid = 0, end = count - 1;
2997130409 if (end >= 0 && code_line > entries[end].code_line) {
2997230410 return count;
3004630484 }
3004730485
3004830486 /* AddTraceback */
30049 #include "compile.h"
30487 #include "compile.h"
3005030488 #include "frameobject.h"
3005130489 #include "traceback.h"
3005230490 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
3010530543 int py_line, const char *filename) {
3010630544 PyCodeObject *py_code = 0;
3010730545 PyFrameObject *py_frame = 0;
30108 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
30546 PyThreadState *tstate = __Pyx_PyThreadState_Current;
30547 if (c_line) {
30548 c_line = __Pyx_CLineForTraceback(tstate, c_line);
30549 }
30550 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
3010930551 if (!py_code) {
3011030552 py_code = __Pyx_CreateCodeObjectForTraceback(
3011130553 funcname, c_line, py_line, filename);
3011230554 if (!py_code) goto bad;
30113 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
30555 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
3011430556 }
3011530557 py_frame = PyFrame_New(
30116 PyThreadState_GET(), /*PyThreadState *tstate,*/
30117 py_code, /*PyCodeObject *code,*/
30118 __pyx_d, /*PyObject *globals,*/
30119 0 /*PyObject *locals*/
30558 tstate, /*PyThreadState *tstate,*/
30559 py_code, /*PyCodeObject *code,*/
30560 __pyx_d, /*PyObject *globals,*/
30561 0 /*PyObject *locals*/
3012030562 );
3012130563 if (!py_frame) goto bad;
3012230564 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
3012730569 }
3012830570
3012930571 /* CIntFromPyVerify */
30130 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
30572 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
3013130573 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
3013230574 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
3013330575 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
3014930591 }
3015030592
3015130593 /* CIntToPy */
30152 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
30594 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
3015330595 const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0;
3015430596 const int is_unsigned = neg_one > const_zero;
3015530597 if (is_unsigned) {
3018030622 }
3018130623
3018230624 /* CIntToPy */
30183 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
30625 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
3018430626 const long neg_one = (long) -1, const_zero = (long) 0;
3018530627 const int is_unsigned = neg_one > const_zero;
3018630628 if (is_unsigned) {
3021130653 }
3021230654
3021330655 /* CIntFromPy */
30214 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
30656 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
3021530657 const int neg_one = (int) -1, const_zero = (int) 0;
3021630658 const int is_unsigned = neg_one > const_zero;
3021730659 #if PY_MAJOR_VERSION < 3
3040030842 }
3040130843
3040230844 /* CIntFromPy */
30403 static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) {
30845 static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) {
3040430846 const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0;
3040530847 const int is_unsigned = neg_one > const_zero;
3040630848 #if PY_MAJOR_VERSION < 3
3058931031 }
3059031032
3059131033 /* CIntFromPy */
30592 static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
31034 static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
3059331035 const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
3059431036 const int is_unsigned = neg_one > const_zero;
3059531037 #if PY_MAJOR_VERSION < 3
3077831220 }
3077931221
3078031222 /* CIntFromPy */
30781 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
31223 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
3078231224 const long neg_one = (long) -1, const_zero = (long) 0;
3078331225 const int is_unsigned = neg_one > const_zero;
3078431226 #if PY_MAJOR_VERSION < 3
3096631408 return (long) -1;
3096731409 }
3096831410
31411 /* FastTypeChecks */
31412 #if CYTHON_COMPILING_IN_CPYTHON
31413 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
31414 while (a) {
31415 a = a->tp_base;
31416 if (a == b)
31417 return 1;
31418 }
31419 return b == &PyBaseObject_Type;
31420 }
31421 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
31422 PyObject *mro;
31423 if (a == b) return 1;
31424 mro = a->tp_mro;
31425 if (likely(mro)) {
31426 Py_ssize_t i, n;
31427 n = PyTuple_GET_SIZE(mro);
31428 for (i = 0; i < n; i++) {
31429 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
31430 return 1;
31431 }
31432 return 0;
31433 }
31434 return __Pyx_InBases(a, b);
31435 }
31436 #if PY_MAJOR_VERSION == 2
31437 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
31438 PyObject *exception, *value, *tb;
31439 int res;
31440 __Pyx_PyThreadState_declare
31441 __Pyx_PyThreadState_assign
31442 __Pyx_ErrFetch(&exception, &value, &tb);
31443 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
31444 if (unlikely(res == -1)) {
31445 PyErr_WriteUnraisable(err);
31446 res = 0;
31447 }
31448 if (!res) {
31449 res = PyObject_IsSubclass(err, exc_type2);
31450 if (unlikely(res == -1)) {
31451 PyErr_WriteUnraisable(err);
31452 res = 0;
31453 }
31454 }
31455 __Pyx_ErrRestore(exception, value, tb);
31456 return res;
31457 }
31458 #else
31459 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
31460 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
31461 if (!res) {
31462 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
31463 }
31464 return res;
31465 }
31466 #endif
31467 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
31468 Py_ssize_t i, n;
31469 assert(PyExceptionClass_Check(exc_type));
31470 n = PyTuple_GET_SIZE(tuple);
31471 #if PY_MAJOR_VERSION >= 3
31472 for (i=0; i<n; i++) {
31473 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
31474 }
31475 #endif
31476 for (i=0; i<n; i++) {
31477 PyObject *t = PyTuple_GET_ITEM(tuple, i);
31478 #if PY_MAJOR_VERSION < 3
31479 if (likely(exc_type == t)) return 1;
31480 #endif
31481 if (likely(PyExceptionClass_Check(t))) {
31482 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
31483 } else {
31484 }
31485 }
31486 return 0;
31487 }
31488 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
31489 if (likely(err == exc_type)) return 1;
31490 if (likely(PyExceptionClass_Check(err))) {
31491 if (likely(PyExceptionClass_Check(exc_type))) {
31492 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
31493 } else if (likely(PyTuple_Check(exc_type))) {
31494 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
31495 } else {
31496 }
31497 }
31498 return PyErr_GivenExceptionMatches(err, exc_type);
31499 }
31500 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
31501 assert(PyExceptionClass_Check(exc_type1));
31502 assert(PyExceptionClass_Check(exc_type2));
31503 if (likely(err == exc_type1 || err == exc_type2)) return 1;
31504 if (likely(PyExceptionClass_Check(err))) {
31505 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
31506 }
31507 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
31508 }
31509 #endif
31510
3096931511 /* CheckBinaryVersion */
30970 static int __Pyx_check_binary_version(void) {
31512 static int __Pyx_check_binary_version(void) {
3097131513 char ctversion[4], rtversion[4];
3097231514 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
3097331515 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
3098331525 }
3098431526
3098531527 /* FunctionExport */
30986 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
31528 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
3098731529 PyObject *d = 0;
3098831530 PyObject *cobj = 0;
3098931531 union {
3102031562 }
3102131563
3102231564 /* InitStrings */
31023 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
31565 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
3102431566 while (t->p) {
3102531567 #if PY_MAJOR_VERSION < 3
3102631568 if (t->is_unicode) {
3104531587 #endif
3104631588 if (!*t->p)
3104731589 return -1;
31590 if (PyObject_Hash(*t->p) == -1)
31591 return -1;
3104831592 ++t;
3104931593 }
3105031594 return 0;
3105331597 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
3105431598 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
3105531599 }
31056 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
31600 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
3105731601 Py_ssize_t ignore;
3105831602 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
3105931603 }
31060 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
31061 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
31604 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
31605 #if !CYTHON_PEP393_ENABLED
31606 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
31607 char* defenc_c;
31608 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
31609 if (!defenc) return NULL;
31610 defenc_c = PyBytes_AS_STRING(defenc);
31611 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
31612 {
31613 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
31614 char* c;
31615 for (c = defenc_c; c < end; c++) {
31616 if ((unsigned char) (*c) >= 128) {
31617 PyUnicode_AsASCIIString(o);
31618 return NULL;
31619 }
31620 }
31621 }
31622 #endif
31623 *length = PyBytes_GET_SIZE(defenc);
31624 return defenc_c;
31625 }
31626 #else
31627 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
31628 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
31629 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
31630 if (likely(PyUnicode_IS_ASCII(o))) {
31631 *length = PyUnicode_GET_LENGTH(o);
31632 return PyUnicode_AsUTF8(o);
31633 } else {
31634 PyUnicode_AsASCIIString(o);
31635 return NULL;
31636 }
31637 #else
31638 return PyUnicode_AsUTF8AndSize(o, length);
31639 #endif
31640 }
31641 #endif
31642 #endif
31643 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
31644 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
3106231645 if (
3106331646 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
3106431647 __Pyx_sys_getdefaultencoding_not_ascii &&
3106531648 #endif
3106631649 PyUnicode_Check(o)) {
31067 #if PY_VERSION_HEX < 0x03030000
31068 char* defenc_c;
31069 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
31070 if (!defenc) return NULL;
31071 defenc_c = PyBytes_AS_STRING(defenc);
31072 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
31073 {
31074 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
31075 char* c;
31076 for (c = defenc_c; c < end; c++) {
31077 if ((unsigned char) (*c) >= 128) {
31078 PyUnicode_AsASCIIString(o);
31079 return NULL;
31080 }
31081 }
31082 }
31083 #endif
31084 *length = PyBytes_GET_SIZE(defenc);
31085 return defenc_c;
31086 #else
31087 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
31088 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
31089 if (PyUnicode_IS_ASCII(o)) {
31090 *length = PyUnicode_GET_LENGTH(o);
31091 return PyUnicode_AsUTF8(o);
31092 } else {
31093 PyUnicode_AsASCIIString(o);
31094 return NULL;
31095 }
31096 #else
31097 return PyUnicode_AsUTF8AndSize(o, length);
31098 #endif
31099 #endif
31650 return __Pyx_PyUnicode_AsStringAndSize(o, length);
3110031651 } else
3110131652 #endif
3110231653 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
3112031671 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
3112131672 else return PyObject_IsTrue(x);
3112231673 }
31674 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
31675 #if PY_MAJOR_VERSION >= 3
31676 if (PyLong_Check(result)) {
31677 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
31678 "__int__ returned non-int (type %.200s). "
31679 "The ability to return an instance of a strict subclass of int "
31680 "is deprecated, and may be removed in a future version of Python.",
31681 Py_TYPE(result)->tp_name)) {
31682 Py_DECREF(result);
31683 return NULL;
31684 }
31685 return result;
31686 }
31687 #endif
31688 PyErr_Format(PyExc_TypeError,
31689 "__%.4s__ returned non-%.4s (type %.200s)",
31690 type_name, type_name, Py_TYPE(result)->tp_name);
31691 Py_DECREF(result);
31692 return NULL;
31693 }
3112331694 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
3112431695 #if CYTHON_USE_TYPE_SLOTS
3112531696 PyNumberMethods *m;
3112731698 const char *name = NULL;
3112831699 PyObject *res = NULL;
3112931700 #if PY_MAJOR_VERSION < 3
31130 if (PyInt_Check(x) || PyLong_Check(x))
31701 if (likely(PyInt_Check(x) || PyLong_Check(x)))
3113131702 #else
31132 if (PyLong_Check(x))
31703 if (likely(PyLong_Check(x)))
3113331704 #endif
3113431705 return __Pyx_NewRef(x);
3113531706 #if CYTHON_USE_TYPE_SLOTS
3113731708 #if PY_MAJOR_VERSION < 3
3113831709 if (m && m->nb_int) {
3113931710 name = "int";
31140 res = PyNumber_Int(x);
31711 res = m->nb_int(x);
3114131712 }
3114231713 else if (m && m->nb_long) {
3114331714 name = "long";
31144 res = PyNumber_Long(x);
31715 res = m->nb_long(x);
3114531716 }
3114631717 #else
31147 if (m && m->nb_int) {
31718 if (likely(m && m->nb_int)) {
3114831719 name = "int";
31149 res = PyNumber_Long(x);
31720 res = m->nb_int(x);
3115031721 }
3115131722 #endif
3115231723 #else
31153 res = PyNumber_Int(x);
31724 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
31725 res = PyNumber_Int(x);
31726 }
3115431727 #endif
31155 if (res) {
31728 if (likely(res)) {
3115631729 #if PY_MAJOR_VERSION < 3
31157 if (!PyInt_Check(res) && !PyLong_Check(res)) {
31730 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
3115831731 #else
31159 if (!PyLong_Check(res)) {
31732 if (unlikely(!PyLong_CheckExact(res))) {
3116031733 #endif
31161 PyErr_Format(PyExc_TypeError,
31162 "__%.4s__ returned non-%.4s (type %.200s)",
31163 name, name, Py_TYPE(res)->tp_name);
31164 Py_DECREF(res);
31165 return NULL;
31734 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
3116631735 }
3116731736 }
3116831737 else if (!PyErr_Occurred()) {
3123331802 Py_DECREF(x);
3123431803 return ival;
3123531804 }
31805 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
31806 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
31807 }
3123631808 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
3123731809 return PyInt_FromSize_t(ival);
3123831810 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
8 #else
9 #define CYTHON_ABI "0_25_2"
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
8 #else
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
102120 #define CYTHON_COMPILING_IN_CPYTHON 1
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
105129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
409549 { \
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420552
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
428560
429561 #define __PYX_HAVE__pygame_sdl2__controller
430562 #define __PYX_HAVE_API__pygame_sdl2__controller
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
437570 #include <omp.h>
438571 #endif /* _OPENMP */
439572
440 #ifdef PYREX_WITHOUT_ASSERTIONS
573 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
441574 #define CYTHON_WITHOUT_ASSERTIONS
442575 #endif
443576
468601 #define __Pyx_sst_abs(value) abs(value)
469602 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
470603 #define __Pyx_sst_abs(value) labs(value)
471 #elif defined (_MSC_VER) && defined (_M_X64)
472 #define __Pyx_sst_abs(value) _abs64(value)
604 #elif defined (_MSC_VER)
605 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
473606 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
474607 #define __Pyx_sst_abs(value) llabs(value)
475608 #elif defined (__GNUC__)
477610 #else
478611 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
479612 #endif
480 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
481 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
613 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
614 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
482615 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
483616 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
484617 #define __Pyx_PyBytes_FromString PyBytes_FromString
491624 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
492625 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
493626 #endif
494 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
495 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
627 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
628 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
629 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
634 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
635 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
496638 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
497639 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
498640 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
499641 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
500642 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
501 #if PY_MAJOR_VERSION < 3
502 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
503 {
643 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
504644 const Py_UNICODE *u_end = u;
505645 while (*u_end++) ;
506646 return (size_t)(u_end - u - 1);
507647 }
508 #else
509 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
510 #endif
511648 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
512649 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
513650 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
514651 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
515652 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
516 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
653 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
517654 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
518655 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
656 #define __Pyx_PySequence_Tuple(obj)\
657 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
519658 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
520659 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
521660 #if CYTHON_ASSUME_SAFE_MACROS
614753 #define likely(x) (x)
615754 #define unlikely(x) (x)
616755 #endif /* __GNUC__ */
617
618 static PyObject *__pyx_m;
756 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
757
758 static PyObject *__pyx_m = NULL;
619759 static PyObject *__pyx_d;
620760 static PyObject *__pyx_b;
761 static PyObject *__pyx_cython_runtime = NULL;
621762 static PyObject *__pyx_empty_tuple;
622763 static PyObject *__pyx_empty_bytes;
623764 static PyObject *__pyx_empty_unicode;
628769
629770
630771 static const char *__pyx_f[] = {
772 "stringsource",
631773 "src/pygame_sdl2/controller.pyx",
632774 };
633775
727869
728870 /* PyObjectGetAttrStr.proto */
729871 #if CYTHON_USE_TYPE_SLOTS
730 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
731 PyTypeObject* tp = Py_TYPE(obj);
732 if (likely(tp->tp_getattro))
733 return tp->tp_getattro(obj, attr_name);
734 #if PY_MAJOR_VERSION < 3
735 if (likely(tp->tp_getattr))
736 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
737 #endif
738 return PyObject_GetAttr(obj, attr_name);
739 }
872 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
740873 #else
741874 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
742875 #endif
790923 /* PyThreadStateGet.proto */
791924 #if CYTHON_FAST_THREAD_STATE
792925 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
793 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
926 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
927 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
794928 #else
795929 #define __Pyx_PyThreadState_declare
796930 #define __Pyx_PyThreadState_assign
931 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
797932 #endif
798933
799934 /* PyErrFetchRestore.proto */
800935 #if CYTHON_FAST_THREAD_STATE
936 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
801937 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
802938 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
803939 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
804940 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
805941 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
806942 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
807 #else
943 #if CYTHON_COMPILING_IN_CPYTHON
944 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
945 #else
946 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
947 #endif
948 #else
949 #define __Pyx_PyErr_Clear() PyErr_Clear()
950 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
808951 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
809952 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
953 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
954 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
810955 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
811956 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
812957 #endif
819964 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
820965
821966 /* KeywordStringCheck.proto */
822 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
967 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
823968
824969 /* RaiseDoubleKeywords.proto */
825970 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
829974 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
830975 const char* function_name);
831976
977 /* PyObject_GenericGetAttrNoDict.proto */
978 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
979 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
980 #else
981 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
982 #endif
983
984 /* PyObject_GenericGetAttr.proto */
985 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
986 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
987 #else
988 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
989 #endif
990
991 /* SetupReduce.proto */
992 static int __Pyx_setup_reduce(PyObject* type_obj);
993
832994 /* Import.proto */
833995 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
834996
835997 /* ImportFrom.proto */
836998 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
999
1000 /* CLineInTraceback.proto */
1001 #ifdef CYTHON_CLINE_IN_TRACEBACK
1002 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1003 #else
1004 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1005 #endif
8371006
8381007 /* CodeObjectCache.proto */
8391008 typedef struct {
8871056 /* CIntFromPy.proto */
8881057 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
8891058
1059 /* FastTypeChecks.proto */
1060 #if CYTHON_COMPILING_IN_CPYTHON
1061 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1062 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1063 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1064 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1065 #else
1066 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1067 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1068 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1069 #endif
1070 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1071
8901072 /* CheckBinaryVersion.proto */
8911073 static int __Pyx_check_binary_version(void);
8921074
9251107 /* Module declarations from 'pygame_sdl2.controller' */
9261108 static PyTypeObject *__pyx_ptype_11pygame_sdl2_10controller_Controller = 0;
9271109 #define __Pyx_MODULE_NAME "pygame_sdl2.controller"
1110 extern int __pyx_module_is_main_pygame_sdl2__controller;
9281111 int __pyx_module_is_main_pygame_sdl2__controller = 0;
9291112
9301113 /* Implementation of 'pygame_sdl2.controller' */
1114 static PyObject *__pyx_builtin_TypeError;
9311115 static const char __pyx_k_rv[] = "rv";
9321116 static const char __pyx_k_axis[] = "axis";
9331117 static const char __pyx_k_init[] = "init";
9341118 static const char __pyx_k_main[] = "__main__";
935 static const char __pyx_k_name[] = "name";
1119 static const char __pyx_k_name[] = "__name__";
9361120 static const char __pyx_k_quit[] = "quit";
9371121 static const char __pyx_k_test[] = "__test__";
9381122 static const char __pyx_k_error[] = "error";
9401124 static const char __pyx_k_rwops[] = "rwops";
9411125 static const char __pyx_k_button[] = "button";
9421126 static const char __pyx_k_import[] = "__import__";
1127 static const char __pyx_k_name_2[] = "name";
1128 static const char __pyx_k_reduce[] = "__reduce__";
9431129 static const char __pyx_k_display[] = "display";
9441130 static const char __pyx_k_mapping[] = "mapping";
9451131 static const char __pyx_k_get_init[] = "get_init";
1132 static const char __pyx_k_getstate[] = "__getstate__";
1133 static const char __pyx_k_setstate[] = "__setstate__";
1134 static const char __pyx_k_TypeError[] = "TypeError";
9461135 static const char __pyx_k_get_count[] = "get_count";
1136 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
9471137 static const char __pyx_k_add_mapping[] = "add_mapping";
9481138 static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2";
9491139 static const char __pyx_k_add_mappings[] = "add_mappings";
9501140 static const char __pyx_k_mapping_file[] = "mapping_file";
1141 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
9511142 static const char __pyx_k_register_init[] = "register_init";
9521143 static const char __pyx_k_register_quit[] = "register_quit";
9531144 static const char __pyx_k_sdl_main_init[] = "sdl_main_init";
1145 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
9541146 static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error";
1147 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
9551148 static const char __pyx_k_get_string_for_axis[] = "get_string_for_axis";
9561149 static const char __pyx_k_get_axis_from_string[] = "get_axis_from_string";
9571150 static const char __pyx_k_get_string_for_button[] = "get_string_for_button";
9591152 static const char __pyx_k_pygame_sdl2_controller[] = "pygame_sdl2.controller";
9601153 static const char __pyx_k_controller_not_initialized[] = "controller not initialized.";
9611154 static const char __pyx_k_src_pygame_sdl2_controller_pyx[] = "src/pygame_sdl2/controller.pyx";
1155 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
1156 static PyObject *__pyx_n_s_TypeError;
9621157 static PyObject *__pyx_n_s_add_mapping;
9631158 static PyObject *__pyx_n_s_add_mappings;
9641159 static PyObject *__pyx_n_s_axis;
9651160 static PyObject *__pyx_n_s_button;
1161 static PyObject *__pyx_n_s_cline_in_traceback;
9661162 static PyObject *__pyx_kp_u_controller_not_initialized;
9671163 static PyObject *__pyx_n_s_display;
9681164 static PyObject *__pyx_n_s_error;
9721168 static PyObject *__pyx_n_s_get_init;
9731169 static PyObject *__pyx_n_s_get_string_for_axis;
9741170 static PyObject *__pyx_n_s_get_string_for_button;
1171 static PyObject *__pyx_n_s_getstate;
9751172 static PyObject *__pyx_n_s_import;
9761173 static PyObject *__pyx_n_s_index;
9771174 static PyObject *__pyx_n_s_init;
9791176 static PyObject *__pyx_n_s_mapping;
9801177 static PyObject *__pyx_n_s_mapping_file;
9811178 static PyObject *__pyx_n_s_name;
1179 static PyObject *__pyx_n_s_name_2;
1180 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
9821181 static PyObject *__pyx_n_s_pygame_sdl2;
9831182 static PyObject *__pyx_n_s_pygame_sdl2_controller;
9841183 static PyObject *__pyx_n_s_pygame_sdl2_error;
9851184 static PyObject *__pyx_n_s_quit;
1185 static PyObject *__pyx_n_s_reduce;
1186 static PyObject *__pyx_n_s_reduce_cython;
1187 static PyObject *__pyx_n_s_reduce_ex;
9861188 static PyObject *__pyx_n_s_register_init;
9871189 static PyObject *__pyx_n_s_register_quit;
9881190 static PyObject *__pyx_n_s_rv;
9891191 static PyObject *__pyx_n_s_rwops;
9901192 static PyObject *__pyx_n_s_sdl_main_init;
1193 static PyObject *__pyx_n_s_setstate;
1194 static PyObject *__pyx_n_s_setstate_cython;
9911195 static PyObject *__pyx_kp_s_src_pygame_sdl2_controller_pyx;
9921196 static PyObject *__pyx_n_s_test;
9931197 static PyObject *__pyx_pf_11pygame_sdl2_10controller_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
10101214 static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_14get_name(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */
10111215 static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_16is_controller(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */
10121216 static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_18get_guid_string(struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */
1217 static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self); /* proto */
1218 static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
10131219 static PyObject *__pyx_tp_new_11pygame_sdl2_10controller_Controller(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
10141220 static PyObject *__pyx_tuple_;
10151221 static PyObject *__pyx_tuple__2;
1016 static PyObject *__pyx_tuple__7;
1222 static PyObject *__pyx_tuple__3;
1223 static PyObject *__pyx_tuple__4;
10171224 static PyObject *__pyx_tuple__9;
10181225 static PyObject *__pyx_tuple__11;
10191226 static PyObject *__pyx_tuple__13;
10201227 static PyObject *__pyx_tuple__15;
10211228 static PyObject *__pyx_tuple__17;
1022 static PyObject *__pyx_codeobj__3;
1023 static PyObject *__pyx_codeobj__4;
1229 static PyObject *__pyx_tuple__19;
10241230 static PyObject *__pyx_codeobj__5;
10251231 static PyObject *__pyx_codeobj__6;
1232 static PyObject *__pyx_codeobj__7;
10261233 static PyObject *__pyx_codeobj__8;
10271234 static PyObject *__pyx_codeobj__10;
10281235 static PyObject *__pyx_codeobj__12;
10291236 static PyObject *__pyx_codeobj__14;
10301237 static PyObject *__pyx_codeobj__16;
10311238 static PyObject *__pyx_codeobj__18;
1239 static PyObject *__pyx_codeobj__20;
1240 /* Late includes */
10321241
10331242 /* "pygame_sdl2/controller.pyx":26
10341243 *
10691278 *
10701279 * if SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER):
10711280 */
1072 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
1281 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 31, __pyx_L1_error)
10731282 __Pyx_GOTREF(__pyx_t_2);
1074 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)
1283 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 31, __pyx_L1_error)
10751284 __Pyx_GOTREF(__pyx_t_3);
10761285 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1077 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
1286 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 31, __pyx_L1_error)
10781287 __Pyx_GOTREF(__pyx_t_2);
10791288 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10801289 __pyx_t_3 = NULL;
10881297 }
10891298 }
10901299 if (__pyx_t_3) {
1091 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
1300 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 31, __pyx_L1_error)
10921301 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10931302 } else {
1094 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
1303 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 31, __pyx_L1_error)
10951304 }
10961305 __Pyx_GOTREF(__pyx_t_1);
10971306 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11051314 *
11061315 */
11071316 __pyx_t_4 = (SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER) != 0);
1108 if (__pyx_t_4) {
1317 if (unlikely(__pyx_t_4)) {
11091318
11101319 /* "pygame_sdl2/controller.pyx":34
11111320 *
11141323 *
11151324 * @pygame_sdl2.register_quit
11161325 */
1117 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
1326 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 34, __pyx_L1_error)
11181327 __Pyx_GOTREF(__pyx_t_2);
11191328 __pyx_t_3 = NULL;
11201329 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11271336 }
11281337 }
11291338 if (__pyx_t_3) {
1130 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
1339 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 34, __pyx_L1_error)
11311340 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11321341 } else {
1133 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
1342 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 34, __pyx_L1_error)
11341343 }
11351344 __Pyx_GOTREF(__pyx_t_1);
11361345 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11371346 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
11381347 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1139 __PYX_ERR(0, 34, __pyx_L1_error)
1348 __PYX_ERR(1, 34, __pyx_L1_error)
11401349
11411350 /* "pygame_sdl2/controller.pyx":33
11421351 * pygame_sdl2.display.sdl_main_init()
12591468 * def get_count():
12601469 */
12611470 __Pyx_XDECREF(__pyx_r);
1262 __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
1471 __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 49, __pyx_L1_error)
12631472 __Pyx_GOTREF(__pyx_t_1);
12641473 __pyx_r = __pyx_t_1;
12651474 __pyx_t_1 = 0;
13211530 *
13221531 */
13231532 __Pyx_XDECREF(__pyx_r);
1324 __pyx_t_1 = __Pyx_PyInt_From_int(SDL_NumJoysticks()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
1533 __pyx_t_1 = __Pyx_PyInt_From_int(SDL_NumJoysticks()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 63, __pyx_L1_error)
13251534 __Pyx_GOTREF(__pyx_t_1);
13261535 __pyx_r = __pyx_t_1;
13271536 __pyx_t_1 = 0;
13861595 * raise error()
13871596 *
13881597 */
1389 __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_mapping); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error)
1598 __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_mapping); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(1, 71, __pyx_L1_error)
13901599 __pyx_t_2 = ((SDL_GameControllerAddMapping(__pyx_t_1) == -1L) != 0);
1391 if (__pyx_t_2) {
1600 if (unlikely(__pyx_t_2)) {
13921601
13931602 /* "pygame_sdl2/controller.pyx":72
13941603 *
13971606 *
13981607 * def add_mappings(mapping_file):
13991608 */
1400 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
1609 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 72, __pyx_L1_error)
14011610 __Pyx_GOTREF(__pyx_t_4);
14021611 __pyx_t_5 = NULL;
14031612 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
14101619 }
14111620 }
14121621 if (__pyx_t_5) {
1413 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
1622 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 72, __pyx_L1_error)
14141623 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14151624 } else {
1416 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
1625 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 72, __pyx_L1_error)
14171626 }
14181627 __Pyx_GOTREF(__pyx_t_3);
14191628 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14201629 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
14211630 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1422 __PYX_ERR(0, 72, __pyx_L1_error)
1631 __PYX_ERR(1, 72, __pyx_L1_error)
14231632
14241633 /* "pygame_sdl2/controller.pyx":71
14251634 * """
14941703 *
14951704 * if SDL_GameControllerAddMappingsFromRW(rwops, 1) == -1:
14961705 */
1497 __pyx_t_1 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_mapping_file, NULL); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(0, 86, __pyx_L1_error)
1706 __pyx_t_1 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_mapping_file, NULL); if (unlikely(__pyx_t_1 == ((SDL_RWops *)NULL))) __PYX_ERR(1, 86, __pyx_L1_error)
14981707 __pyx_v_rwops = __pyx_t_1;
14991708
15001709 /* "pygame_sdl2/controller.pyx":88
15051714 *
15061715 */
15071716 __pyx_t_2 = ((SDL_GameControllerAddMappingsFromRW(__pyx_v_rwops, 1) == -1L) != 0);
1508 if (__pyx_t_2) {
1717 if (unlikely(__pyx_t_2)) {
15091718
15101719 /* "pygame_sdl2/controller.pyx":89
15111720 *
15141723 *
15151724 * def get_axis_from_string(name):
15161725 */
1517 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error)
1726 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 89, __pyx_L1_error)
15181727 __Pyx_GOTREF(__pyx_t_4);
15191728 __pyx_t_5 = NULL;
15201729 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
15271736 }
15281737 }
15291738 if (__pyx_t_5) {
1530 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
1739 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 89, __pyx_L1_error)
15311740 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15321741 } else {
1533 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
1742 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 89, __pyx_L1_error)
15341743 }
15351744 __Pyx_GOTREF(__pyx_t_3);
15361745 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15371746 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
15381747 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1539 __PYX_ERR(0, 89, __pyx_L1_error)
1748 __PYX_ERR(1, 89, __pyx_L1_error)
15401749
15411750 /* "pygame_sdl2/controller.pyx":88
15421751 * cdef SDL_RWops *rwops = to_rwops(mapping_file)
16081817 * def get_button_from_string(name):
16091818 */
16101819 __Pyx_XDECREF(__pyx_r);
1611 __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L1_error)
1612 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerGetAxisFromString(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
1820 __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(1, 97, __pyx_L1_error)
1821 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerGetAxisFromString(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 97, __pyx_L1_error)
16131822 __Pyx_GOTREF(__pyx_t_2);
16141823 __pyx_r = __pyx_t_2;
16151824 __pyx_t_2 = 0;
16721881 * def get_string_for_axis(axis):
16731882 */
16741883 __Pyx_XDECREF(__pyx_r);
1675 __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error)
1676 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerGetButtonFromString(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
1884 __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(1, 105, __pyx_L1_error)
1885 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerGetButtonFromString(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 105, __pyx_L1_error)
16771886 __Pyx_GOTREF(__pyx_t_2);
16781887 __pyx_r = __pyx_t_2;
16791888 __pyx_t_2 = 0;
17371946 *
17381947 * if rv != NULL:
17391948 */
1740 __pyx_t_1 = ((SDL_GameControllerAxis)__Pyx_PyInt_As_SDL_GameControllerAxis(__pyx_v_axis)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L1_error)
1949 __pyx_t_1 = ((SDL_GameControllerAxis)__Pyx_PyInt_As_SDL_GameControllerAxis(__pyx_v_axis)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 113, __pyx_L1_error)
17411950 __pyx_v_rv = SDL_GameControllerGetStringForAxis(__pyx_t_1);
17421951
17431952 /* "pygame_sdl2/controller.pyx":115
17581967 * return None
17591968 */
17601969 __Pyx_XDECREF(__pyx_r);
1761 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error)
1970 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 116, __pyx_L1_error)
17621971 __Pyx_GOTREF(__pyx_t_3);
17631972 __pyx_r = __pyx_t_3;
17641973 __pyx_t_3 = 0;
17821991 */
17831992 /*else*/ {
17841993 __Pyx_XDECREF(__pyx_r);
1785 __Pyx_INCREF(Py_None);
1786 __pyx_r = Py_None;
1994 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17871995 goto __pyx_L0;
17881996 }
17891997
18452053 *
18462054 * if rv != NULL:
18472055 */
1848 __pyx_t_1 = ((SDL_GameControllerButton)__Pyx_PyInt_As_SDL_GameControllerButton(__pyx_v_button)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L1_error)
2056 __pyx_t_1 = ((SDL_GameControllerButton)__Pyx_PyInt_As_SDL_GameControllerButton(__pyx_v_button)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 126, __pyx_L1_error)
18492057 __pyx_v_rv = SDL_GameControllerGetStringForButton(__pyx_t_1);
18502058
18512059 /* "pygame_sdl2/controller.pyx":128
18662074 * return None
18672075 */
18682076 __Pyx_XDECREF(__pyx_r);
1869 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error)
2077 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 129, __pyx_L1_error)
18702078 __Pyx_GOTREF(__pyx_t_3);
18712079 __pyx_r = __pyx_t_3;
18722080 __pyx_t_3 = 0;
18902098 */
18912099 /*else*/ {
18922100 __Pyx_XDECREF(__pyx_r);
1893 __Pyx_INCREF(Py_None);
1894 __pyx_r = Py_None;
2101 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18952102 goto __pyx_L0;
18962103 }
18972104
19932200 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19942201 switch (pos_args) {
19952202 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2203 CYTHON_FALLTHROUGH;
19962204 case 0: break;
19972205 default: goto __pyx_L5_argtuple_error;
19982206 }
19992207 kw_args = PyDict_Size(__pyx_kwds);
20002208 switch (pos_args) {
20012209 case 0:
2002 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
2210 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
20032211 else goto __pyx_L5_argtuple_error;
20042212 }
20052213 if (unlikely(kw_args > 0)) {
2006 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 144, __pyx_L3_error)
2214 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 144, __pyx_L3_error)
20072215 }
20082216 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
20092217 goto __pyx_L5_argtuple_error;
20142222 }
20152223 goto __pyx_L4_argument_unpacking_done;
20162224 __pyx_L5_argtuple_error:;
2017 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 144, __pyx_L3_error)
2225 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 144, __pyx_L3_error)
20182226 __pyx_L3_error:;
20192227 __Pyx_AddTraceback("pygame_sdl2.controller.Controller.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20202228 __Pyx_RefNannyFinishContext();
20402248 *
20412249 * def init(self):
20422250 */
2043 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L1_error)
2251 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_index); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 150, __pyx_L1_error)
20442252 __pyx_v_self->index = __pyx_t_1;
20452253
20462254 /* "pygame_sdl2/controller.pyx":144
21202328 *
21212329 */
21222330 __pyx_t_1 = ((__pyx_v_self->controller == NULL) != 0);
2123 if (__pyx_t_1) {
2331 if (unlikely(__pyx_t_1)) {
21242332
21252333 /* "pygame_sdl2/controller.pyx":160
21262334 * self.controller = SDL_GameControllerOpen(self.index)
21292337 *
21302338 * def quit(self): # @ReservedAssignment
21312339 */
2132 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
2340 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 160, __pyx_L1_error)
21332341 __Pyx_GOTREF(__pyx_t_3);
21342342 __pyx_t_4 = NULL;
21352343 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
21422350 }
21432351 }
21442352 if (__pyx_t_4) {
2145 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
2353 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 160, __pyx_L1_error)
21462354 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21472355 } else {
2148 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
2356 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 160, __pyx_L1_error)
21492357 }
21502358 __Pyx_GOTREF(__pyx_t_2);
21512359 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21522360 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
21532361 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2154 __PYX_ERR(0, 160, __pyx_L1_error)
2362 __PYX_ERR(1, 160, __pyx_L1_error)
21552363
21562364 /* "pygame_sdl2/controller.pyx":159
21572365 * if self.controller == NULL:
24112619 *
24122620 */
24132621 __pyx_t_1 = ((__pyx_v_self->controller == NULL) != 0);
2414 if (__pyx_t_1) {
2622 if (unlikely(__pyx_t_1)) {
24152623
24162624 /* "pygame_sdl2/controller.pyx":191
24172625 *
24202628 *
24212629 * return SDL_GameControllerGetAxis(self.controller, axis)
24222630 */
2423 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
2631 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 191, __pyx_L1_error)
24242632 __Pyx_GOTREF(__pyx_t_2);
2425 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error)
2633 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 191, __pyx_L1_error)
24262634 __Pyx_GOTREF(__pyx_t_3);
24272635 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24282636 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
24292637 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2430 __PYX_ERR(0, 191, __pyx_L1_error)
2638 __PYX_ERR(1, 191, __pyx_L1_error)
24312639
24322640 /* "pygame_sdl2/controller.pyx":190
24332641 * """
24462654 *
24472655 */
24482656 __Pyx_XDECREF(__pyx_r);
2449 __pyx_t_4 = ((SDL_GameControllerAxis)__Pyx_PyInt_As_SDL_GameControllerAxis(__pyx_v_axis)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L1_error)
2450 __pyx_t_3 = __Pyx_PyInt_From_int16_t(SDL_GameControllerGetAxis(__pyx_v_self->controller, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
2657 __pyx_t_4 = ((SDL_GameControllerAxis)__Pyx_PyInt_As_SDL_GameControllerAxis(__pyx_v_axis)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 193, __pyx_L1_error)
2658 __pyx_t_3 = __Pyx_PyInt_From_int16_t(SDL_GameControllerGetAxis(__pyx_v_self->controller, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 193, __pyx_L1_error)
24512659 __Pyx_GOTREF(__pyx_t_3);
24522660 __pyx_r = __pyx_t_3;
24532661 __pyx_t_3 = 0;
25122720 *
25132721 */
25142722 __pyx_t_1 = ((__pyx_v_self->controller == NULL) != 0);
2515 if (__pyx_t_1) {
2723 if (unlikely(__pyx_t_1)) {
25162724
25172725 /* "pygame_sdl2/controller.pyx":205
25182726 *
25212729 *
25222730 * return SDL_GameControllerGetButton(self.controller, button)
25232731 */
2524 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error)
2732 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 205, __pyx_L1_error)
25252733 __Pyx_GOTREF(__pyx_t_2);
2526 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error)
2734 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 205, __pyx_L1_error)
25272735 __Pyx_GOTREF(__pyx_t_3);
25282736 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25292737 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
25302738 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2531 __PYX_ERR(0, 205, __pyx_L1_error)
2739 __PYX_ERR(1, 205, __pyx_L1_error)
25322740
25332741 /* "pygame_sdl2/controller.pyx":204
25342742 * """
25472755 * def get_name(self):
25482756 */
25492757 __Pyx_XDECREF(__pyx_r);
2550 __pyx_t_4 = ((SDL_GameControllerButton)__Pyx_PyInt_As_SDL_GameControllerButton(__pyx_v_button)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 207, __pyx_L1_error)
2551 __pyx_t_3 = __Pyx_PyInt_From_uint8_t(SDL_GameControllerGetButton(__pyx_v_self->controller, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
2758 __pyx_t_4 = ((SDL_GameControllerButton)__Pyx_PyInt_As_SDL_GameControllerButton(__pyx_v_button)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 207, __pyx_L1_error)
2759 __pyx_t_3 = __Pyx_PyInt_From_uint8_t(SDL_GameControllerGetButton(__pyx_v_self->controller, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 207, __pyx_L1_error)
25522760 __Pyx_GOTREF(__pyx_t_3);
25532761 __pyx_r = __pyx_t_3;
25542762 __pyx_t_3 = 0;
26312839 * return rv
26322840 */
26332841 __Pyx_XDECREF(__pyx_r);
2634 __Pyx_INCREF(Py_None);
2635 __pyx_r = Py_None;
2842 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26362843 goto __pyx_L0;
26372844
26382845 /* "pygame_sdl2/controller.pyx":217
26522859 * def is_controller(self):
26532860 */
26542861 __Pyx_XDECREF(__pyx_r);
2655 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error)
2862 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 220, __pyx_L1_error)
26562863 __Pyx_GOTREF(__pyx_t_2);
26572864 __pyx_r = __pyx_t_2;
26582865 __pyx_t_2 = 0;
27132920 * def get_guid_string(self):
27142921 */
27152922 __Pyx_XDECREF(__pyx_r);
2716 __pyx_t_1 = __Pyx_PyInt_From_SDL_bool(SDL_IsGameController(__pyx_v_self->index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
2923 __pyx_t_1 = __Pyx_PyInt_From_SDL_bool(SDL_IsGameController(__pyx_v_self->index)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
27172924 __Pyx_GOTREF(__pyx_t_1);
27182925 __pyx_r = __pyx_t_1;
27192926 __pyx_t_1 = 0;
27933000 *
27943001 */
27953002 __Pyx_XDECREF(__pyx_r);
2796 __pyx_t_1 = __Pyx_PyObject_FromString(__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
3003 __pyx_t_1 = __Pyx_PyObject_FromString(__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
27973004 __Pyx_GOTREF(__pyx_t_1);
27983005 __pyx_r = __pyx_t_1;
27993006 __pyx_t_1 = 0;
28133020 __Pyx_AddTraceback("pygame_sdl2.controller.Controller.get_guid_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
28143021 __pyx_r = NULL;
28153022 __pyx_L0:;
3023 __Pyx_XGIVEREF(__pyx_r);
3024 __Pyx_RefNannyFinishContext();
3025 return __pyx_r;
3026 }
3027
3028 /* "(tree fragment)":1
3029 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3030 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3031 * def __setstate_cython__(self, __pyx_state):
3032 */
3033
3034 /* Python wrapper */
3035 static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3036 static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3037 PyObject *__pyx_r = 0;
3038 __Pyx_RefNannyDeclarations
3039 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3040 __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_20__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self));
3041
3042 /* function exit code */
3043 __Pyx_RefNannyFinishContext();
3044 return __pyx_r;
3045 }
3046
3047 static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self) {
3048 PyObject *__pyx_r = NULL;
3049 __Pyx_RefNannyDeclarations
3050 PyObject *__pyx_t_1 = NULL;
3051 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3052
3053 /* "(tree fragment)":2
3054 * def __reduce_cython__(self):
3055 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3056 * def __setstate_cython__(self, __pyx_state):
3057 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3058 */
3059 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
3060 __Pyx_GOTREF(__pyx_t_1);
3061 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3062 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3063 __PYX_ERR(0, 2, __pyx_L1_error)
3064
3065 /* "(tree fragment)":1
3066 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3067 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3068 * def __setstate_cython__(self, __pyx_state):
3069 */
3070
3071 /* function exit code */
3072 __pyx_L1_error:;
3073 __Pyx_XDECREF(__pyx_t_1);
3074 __Pyx_AddTraceback("pygame_sdl2.controller.Controller.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3075 __pyx_r = NULL;
3076 __Pyx_XGIVEREF(__pyx_r);
3077 __Pyx_RefNannyFinishContext();
3078 return __pyx_r;
3079 }
3080
3081 /* "(tree fragment)":3
3082 * def __reduce_cython__(self):
3083 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3084 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3085 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3086 */
3087
3088 /* Python wrapper */
3089 static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
3090 static PyObject *__pyx_pw_11pygame_sdl2_10controller_10Controller_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3091 PyObject *__pyx_r = 0;
3092 __Pyx_RefNannyDeclarations
3093 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3094 __pyx_r = __pyx_pf_11pygame_sdl2_10controller_10Controller_22__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_10controller_Controller *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3095
3096 /* function exit code */
3097 __Pyx_RefNannyFinishContext();
3098 return __pyx_r;
3099 }
3100
3101 static PyObject *__pyx_pf_11pygame_sdl2_10controller_10Controller_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_10controller_Controller *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3102 PyObject *__pyx_r = NULL;
3103 __Pyx_RefNannyDeclarations
3104 PyObject *__pyx_t_1 = NULL;
3105 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3106
3107 /* "(tree fragment)":4
3108 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3109 * def __setstate_cython__(self, __pyx_state):
3110 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3111 */
3112 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
3113 __Pyx_GOTREF(__pyx_t_1);
3114 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3115 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3116 __PYX_ERR(0, 4, __pyx_L1_error)
3117
3118 /* "(tree fragment)":3
3119 * def __reduce_cython__(self):
3120 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3121 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3122 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3123 */
3124
3125 /* function exit code */
3126 __pyx_L1_error:;
3127 __Pyx_XDECREF(__pyx_t_1);
3128 __Pyx_AddTraceback("pygame_sdl2.controller.Controller.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3129 __pyx_r = NULL;
28163130 __Pyx_XGIVEREF(__pyx_r);
28173131 __Pyx_RefNannyFinishContext();
28183132 return __pyx_r;
28353149
28363150 static void __pyx_tp_dealloc_11pygame_sdl2_10controller_Controller(PyObject *o) {
28373151 struct __pyx_obj_11pygame_sdl2_10controller_Controller *p = (struct __pyx_obj_11pygame_sdl2_10controller_Controller *)o;
2838 #if PY_VERSION_HEX >= 0x030400a1
2839 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
3152 #if CYTHON_USE_TP_FINALIZE
3153 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
28403154 if (PyObject_CallFinalizerFromDealloc(o)) return;
28413155 }
28423156 #endif
28533167 {"get_name", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_10Controller_15get_name, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_10Controller_14get_name},
28543168 {"is_controller", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_10Controller_17is_controller, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_10Controller_16is_controller},
28553169 {"get_guid_string", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_10Controller_19get_guid_string, METH_NOARGS, __pyx_doc_11pygame_sdl2_10controller_10Controller_18get_guid_string},
3170 {"__reduce_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_10Controller_21__reduce_cython__, METH_NOARGS, 0},
3171 {"__setstate_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_10controller_10Controller_23__setstate_cython__, METH_O, 0},
28563172 {0, 0, 0, 0}
28573173 };
28583174
29193235 };
29203236
29213237 #if PY_MAJOR_VERSION >= 3
3238 #if CYTHON_PEP489_MULTI_PHASE_INIT
3239 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
3240 static int __pyx_pymod_exec_controller(PyObject* module); /*proto*/
3241 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
3242 {Py_mod_create, (void*)__pyx_pymod_create},
3243 {Py_mod_exec, (void*)__pyx_pymod_exec_controller},
3244 {0, NULL}
3245 };
3246 #endif
3247
29223248 static struct PyModuleDef __pyx_moduledef = {
2923 #if PY_VERSION_HEX < 0x03020000
2924 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
2925 #else
29263249 PyModuleDef_HEAD_INIT,
2927 #endif
29283250 "controller",
29293251 0, /* m_doc */
3252 #if CYTHON_PEP489_MULTI_PHASE_INIT
3253 0, /* m_size */
3254 #else
29303255 -1, /* m_size */
3256 #endif
29313257 __pyx_methods /* m_methods */,
3258 #if CYTHON_PEP489_MULTI_PHASE_INIT
3259 __pyx_moduledef_slots, /* m_slots */
3260 #else
29323261 NULL, /* m_reload */
3262 #endif
29333263 NULL, /* m_traverse */
29343264 NULL, /* m_clear */
29353265 NULL /* m_free */
29373267 #endif
29383268
29393269 static __Pyx_StringTabEntry __pyx_string_tab[] = {
3270 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
29403271 {&__pyx_n_s_add_mapping, __pyx_k_add_mapping, sizeof(__pyx_k_add_mapping), 0, 0, 1, 1},
29413272 {&__pyx_n_s_add_mappings, __pyx_k_add_mappings, sizeof(__pyx_k_add_mappings), 0, 0, 1, 1},
29423273 {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1},
29433274 {&__pyx_n_s_button, __pyx_k_button, sizeof(__pyx_k_button), 0, 0, 1, 1},
3275 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
29443276 {&__pyx_kp_u_controller_not_initialized, __pyx_k_controller_not_initialized, sizeof(__pyx_k_controller_not_initialized), 0, 1, 0, 0},
29453277 {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1},
29463278 {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
29503282 {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1},
29513283 {&__pyx_n_s_get_string_for_axis, __pyx_k_get_string_for_axis, sizeof(__pyx_k_get_string_for_axis), 0, 0, 1, 1},
29523284 {&__pyx_n_s_get_string_for_button, __pyx_k_get_string_for_button, sizeof(__pyx_k_get_string_for_button), 0, 0, 1, 1},
3285 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
29533286 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
29543287 {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
29553288 {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
29573290 {&__pyx_n_s_mapping, __pyx_k_mapping, sizeof(__pyx_k_mapping), 0, 0, 1, 1},
29583291 {&__pyx_n_s_mapping_file, __pyx_k_mapping_file, sizeof(__pyx_k_mapping_file), 0, 0, 1, 1},
29593292 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
3293 {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
3294 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
29603295 {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1},
29613296 {&__pyx_n_s_pygame_sdl2_controller, __pyx_k_pygame_sdl2_controller, sizeof(__pyx_k_pygame_sdl2_controller), 0, 0, 1, 1},
29623297 {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1},
29633298 {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1},
3299 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
3300 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
3301 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
29643302 {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1},
29653303 {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1},
29663304 {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1},
29673305 {&__pyx_n_s_rwops, __pyx_k_rwops, sizeof(__pyx_k_rwops), 0, 0, 1, 1},
29683306 {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1},
3307 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
3308 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
29693309 {&__pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_k_src_pygame_sdl2_controller_pyx, sizeof(__pyx_k_src_pygame_sdl2_controller_pyx), 0, 0, 1, 0},
29703310 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
29713311 {0, 0, 0, 0, 0, 0, 0}
29723312 };
29733313 static int __Pyx_InitCachedBuiltins(void) {
3314 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error)
29743315 return 0;
3316 __pyx_L1_error:;
3317 return -1;
29753318 }
29763319
29773320 static int __Pyx_InitCachedConstants(void) {
29853328 *
29863329 * return SDL_GameControllerGetAxis(self.controller, axis)
29873330 */
2988 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_controller_not_initialized); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 191, __pyx_L1_error)
3331 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_controller_not_initialized); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 191, __pyx_L1_error)
29893332 __Pyx_GOTREF(__pyx_tuple_);
29903333 __Pyx_GIVEREF(__pyx_tuple_);
29913334
29963339 *
29973340 * return SDL_GameControllerGetButton(self.controller, button)
29983341 */
2999 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_controller_not_initialized); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 205, __pyx_L1_error)
3342 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_controller_not_initialized); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 205, __pyx_L1_error)
30003343 __Pyx_GOTREF(__pyx_tuple__2);
30013344 __Pyx_GIVEREF(__pyx_tuple__2);
3345
3346 /* "(tree fragment)":2
3347 * def __reduce_cython__(self):
3348 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3349 * def __setstate_cython__(self, __pyx_state):
3350 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3351 */
3352 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 2, __pyx_L1_error)
3353 __Pyx_GOTREF(__pyx_tuple__3);
3354 __Pyx_GIVEREF(__pyx_tuple__3);
3355
3356 /* "(tree fragment)":4
3357 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3358 * def __setstate_cython__(self, __pyx_state):
3359 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3360 */
3361 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 4, __pyx_L1_error)
3362 __Pyx_GOTREF(__pyx_tuple__4);
3363 __Pyx_GIVEREF(__pyx_tuple__4);
30023364
30033365 /* "pygame_sdl2/controller.pyx":26
30043366 *
30073369 * """
30083370 * Initializes game controller support.
30093371 */
3010 __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_init, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 26, __pyx_L1_error)
3372 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_init, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(1, 26, __pyx_L1_error)
30113373
30123374 /* "pygame_sdl2/controller.pyx":37
30133375 *
30163378 * """
30173379 * Shuts down game controller support.
30183380 */
3019 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_quit, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 37, __pyx_L1_error)
3381 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_quit, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(1, 37, __pyx_L1_error)
30203382
30213383 /* "pygame_sdl2/controller.pyx":44
30223384 * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER)
30253387 * """
30263388 * Returns true if game controller support has been initialized.
30273389 */
3028 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_init, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 44, __pyx_L1_error)
3390 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_init, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(1, 44, __pyx_L1_error)
30293391
30303392 /* "pygame_sdl2/controller.pyx":51
30313393 * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0
30343396 * """
30353397 * Returns the number of joysticks and game controllers connected to the
30363398 */
3037 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_count, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 51, __pyx_L1_error)
3399 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_count, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(1, 51, __pyx_L1_error)
30383400
30393401 /* "pygame_sdl2/controller.pyx":66
30403402 *
30433405 * """
30443406 * Adds a game controller mapping from the string in `mapping`.
30453407 */
3046 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_mapping); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 66, __pyx_L1_error)
3047 __Pyx_GOTREF(__pyx_tuple__7);
3048 __Pyx_GIVEREF(__pyx_tuple__7);
3049 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_add_mapping, 66, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 66, __pyx_L1_error)
3408 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_mapping); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 66, __pyx_L1_error)
3409 __Pyx_GOTREF(__pyx_tuple__9);
3410 __Pyx_GIVEREF(__pyx_tuple__9);
3411 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_add_mapping, 66, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(1, 66, __pyx_L1_error)
30503412
30513413 /* "pygame_sdl2/controller.pyx":74
30523414 * raise error()
30553417 * """
30563418 * Adds game controller mappings from `mapping_file`, which can be a string
30573419 */
3058 __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_mapping_file, __pyx_n_s_rwops); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 74, __pyx_L1_error)
3059 __Pyx_GOTREF(__pyx_tuple__9);
3060 __Pyx_GIVEREF(__pyx_tuple__9);
3061 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_add_mappings, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 74, __pyx_L1_error)
3420 __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_mapping_file, __pyx_n_s_rwops); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 74, __pyx_L1_error)
3421 __Pyx_GOTREF(__pyx_tuple__11);
3422 __Pyx_GIVEREF(__pyx_tuple__11);
3423 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_add_mappings, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 74, __pyx_L1_error)
30623424
30633425 /* "pygame_sdl2/controller.pyx":91
30643426 * raise error()
30673429 * """
30683430 * Returns the axis number of the controller axis with `name`, or
30693431 */
3070 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_name); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 91, __pyx_L1_error)
3071 __Pyx_GOTREF(__pyx_tuple__11);
3072 __Pyx_GIVEREF(__pyx_tuple__11);
3073 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_axis_from_string, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 91, __pyx_L1_error)
3432 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_name_2); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 91, __pyx_L1_error)
3433 __Pyx_GOTREF(__pyx_tuple__13);
3434 __Pyx_GIVEREF(__pyx_tuple__13);
3435 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_axis_from_string, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 91, __pyx_L1_error)
30743436
30753437 /* "pygame_sdl2/controller.pyx":99
30763438 * return SDL_GameControllerGetAxisFromString(name)
30793441 * """
30803442 * Returns the button number of the controller button with `name`, or
30813443 */
3082 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_name); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 99, __pyx_L1_error)
3083 __Pyx_GOTREF(__pyx_tuple__13);
3084 __Pyx_GIVEREF(__pyx_tuple__13);
3085 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_button_from_string, 99, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 99, __pyx_L1_error)
3444 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_name_2); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 99, __pyx_L1_error)
3445 __Pyx_GOTREF(__pyx_tuple__15);
3446 __Pyx_GIVEREF(__pyx_tuple__15);
3447 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_button_from_string, 99, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 99, __pyx_L1_error)
30863448
30873449 /* "pygame_sdl2/controller.pyx":107
30883450 * return SDL_GameControllerGetButtonFromString(name)
30913453 * """
30923454 * Returns a string describing the controller axis `axis`, which must be
30933455 */
3094 __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_axis, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 107, __pyx_L1_error)
3095 __Pyx_GOTREF(__pyx_tuple__15);
3096 __Pyx_GIVEREF(__pyx_tuple__15);
3097 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_string_for_axis, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 107, __pyx_L1_error)
3456 __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_axis, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 107, __pyx_L1_error)
3457 __Pyx_GOTREF(__pyx_tuple__17);
3458 __Pyx_GIVEREF(__pyx_tuple__17);
3459 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_string_for_axis, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(1, 107, __pyx_L1_error)
30983460
30993461 /* "pygame_sdl2/controller.pyx":120
31003462 * return None
31033465 * """
31043466 * Returns a string describing the controller button `button`, which must be
31053467 */
3106 __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_button, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 120, __pyx_L1_error)
3107 __Pyx_GOTREF(__pyx_tuple__17);
3108 __Pyx_GIVEREF(__pyx_tuple__17);
3109 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_string_for_button, 120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 120, __pyx_L1_error)
3468 __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_button, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 120, __pyx_L1_error)
3469 __Pyx_GOTREF(__pyx_tuple__19);
3470 __Pyx_GIVEREF(__pyx_tuple__19);
3471 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_controller_pyx, __pyx_n_s_get_string_for_button, 120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(1, 120, __pyx_L1_error)
31103472 __Pyx_RefNannyFinishContext();
31113473 return 0;
31123474 __pyx_L1_error:;
31153477 }
31163478
31173479 static int __Pyx_InitGlobals(void) {
3118 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
3480 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
31193481 return 0;
31203482 __pyx_L1_error:;
31213483 return -1;
31223484 }
31233485
3486 static int __Pyx_modinit_global_init_code(void); /*proto*/
3487 static int __Pyx_modinit_variable_export_code(void); /*proto*/
3488 static int __Pyx_modinit_function_export_code(void); /*proto*/
3489 static int __Pyx_modinit_type_init_code(void); /*proto*/
3490 static int __Pyx_modinit_type_import_code(void); /*proto*/
3491 static int __Pyx_modinit_variable_import_code(void); /*proto*/
3492 static int __Pyx_modinit_function_import_code(void); /*proto*/
3493
3494 static int __Pyx_modinit_global_init_code(void) {
3495 __Pyx_RefNannyDeclarations
3496 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
3497 /*--- Global init code ---*/
3498 __Pyx_RefNannyFinishContext();
3499 return 0;
3500 }
3501
3502 static int __Pyx_modinit_variable_export_code(void) {
3503 __Pyx_RefNannyDeclarations
3504 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
3505 /*--- Variable export code ---*/
3506 __Pyx_RefNannyFinishContext();
3507 return 0;
3508 }
3509
3510 static int __Pyx_modinit_function_export_code(void) {
3511 __Pyx_RefNannyDeclarations
3512 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
3513 /*--- Function export code ---*/
3514 __Pyx_RefNannyFinishContext();
3515 return 0;
3516 }
3517
3518 static int __Pyx_modinit_type_init_code(void) {
3519 __Pyx_RefNannyDeclarations
3520 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
3521 /*--- Type init code ---*/
3522 if (PyType_Ready(&__pyx_type_11pygame_sdl2_10controller_Controller) < 0) __PYX_ERR(1, 134, __pyx_L1_error)
3523 __pyx_type_11pygame_sdl2_10controller_Controller.tp_print = 0;
3524 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11pygame_sdl2_10controller_Controller.tp_dictoffset && __pyx_type_11pygame_sdl2_10controller_Controller.tp_getattro == PyObject_GenericGetAttr)) {
3525 __pyx_type_11pygame_sdl2_10controller_Controller.tp_getattro = __Pyx_PyObject_GenericGetAttr;
3526 }
3527 #if CYTHON_COMPILING_IN_CPYTHON
3528 {
3529 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_11pygame_sdl2_10controller_Controller, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 134, __pyx_L1_error)
3530 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
3531 __pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
3532 __pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__.doc = __pyx_doc_11pygame_sdl2_10controller_10Controller_2__init__;
3533 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__;
3534 }
3535 }
3536 #endif
3537 if (PyObject_SetAttrString(__pyx_m, "Controller", (PyObject *)&__pyx_type_11pygame_sdl2_10controller_Controller) < 0) __PYX_ERR(1, 134, __pyx_L1_error)
3538 if (__pyx_type_11pygame_sdl2_10controller_Controller.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_10controller_Controller.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_10controller_Controller, __weakref__);
3539 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11pygame_sdl2_10controller_Controller) < 0) __PYX_ERR(1, 134, __pyx_L1_error)
3540 __pyx_ptype_11pygame_sdl2_10controller_Controller = &__pyx_type_11pygame_sdl2_10controller_Controller;
3541 __Pyx_RefNannyFinishContext();
3542 return 0;
3543 __pyx_L1_error:;
3544 __Pyx_RefNannyFinishContext();
3545 return -1;
3546 }
3547
3548 static int __Pyx_modinit_type_import_code(void) {
3549 __Pyx_RefNannyDeclarations
3550 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
3551 /*--- Type import code ---*/
3552 __Pyx_RefNannyFinishContext();
3553 return 0;
3554 }
3555
3556 static int __Pyx_modinit_variable_import_code(void) {
3557 __Pyx_RefNannyDeclarations
3558 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
3559 /*--- Variable import code ---*/
3560 __Pyx_RefNannyFinishContext();
3561 return 0;
3562 }
3563
3564 static int __Pyx_modinit_function_import_code(void) {
3565 __Pyx_RefNannyDeclarations
3566 PyObject *__pyx_t_1 = NULL;
3567 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
3568 /*--- Function import code ---*/
3569 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error)
3570 if (__Pyx_ImportFunction(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3571 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3572 __Pyx_RefNannyFinishContext();
3573 return 0;
3574 __pyx_L1_error:;
3575 __Pyx_XDECREF(__pyx_t_1);
3576 __Pyx_RefNannyFinishContext();
3577 return -1;
3578 }
3579
3580
31243581 #if PY_MAJOR_VERSION < 3
3125 PyMODINIT_FUNC initcontroller(void); /*proto*/
3126 PyMODINIT_FUNC initcontroller(void)
3127 #else
3128 PyMODINIT_FUNC PyInit_controller(void); /*proto*/
3129 PyMODINIT_FUNC PyInit_controller(void)
3582 #ifdef CYTHON_NO_PYINIT_EXPORT
3583 #define __Pyx_PyMODINIT_FUNC void
3584 #else
3585 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
3586 #endif
3587 #else
3588 #ifdef CYTHON_NO_PYINIT_EXPORT
3589 #define __Pyx_PyMODINIT_FUNC PyObject *
3590 #else
3591 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
3592 #endif
3593 #endif
3594 #ifndef CYTHON_SMALL_CODE
3595 #if defined(__clang__)
3596 #define CYTHON_SMALL_CODE
3597 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
3598 #define CYTHON_SMALL_CODE __attribute__((cold))
3599 #else
3600 #define CYTHON_SMALL_CODE
3601 #endif
3602 #endif
3603
3604
3605 #if PY_MAJOR_VERSION < 3
3606 __Pyx_PyMODINIT_FUNC initcontroller(void) CYTHON_SMALL_CODE; /*proto*/
3607 __Pyx_PyMODINIT_FUNC initcontroller(void)
3608 #else
3609 __Pyx_PyMODINIT_FUNC PyInit_controller(void) CYTHON_SMALL_CODE; /*proto*/
3610 __Pyx_PyMODINIT_FUNC PyInit_controller(void)
3611 #if CYTHON_PEP489_MULTI_PHASE_INIT
3612 {
3613 return PyModuleDef_Init(&__pyx_moduledef);
3614 }
3615 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
3616 PyObject *value = PyObject_GetAttrString(spec, from_name);
3617 int result = 0;
3618 if (likely(value)) {
3619 result = PyDict_SetItemString(moddict, to_name, value);
3620 Py_DECREF(value);
3621 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
3622 PyErr_Clear();
3623 } else {
3624 result = -1;
3625 }
3626 return result;
3627 }
3628 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
3629 PyObject *module = NULL, *moddict, *modname;
3630 if (__pyx_m)
3631 return __Pyx_NewRef(__pyx_m);
3632 modname = PyObject_GetAttrString(spec, "name");
3633 if (unlikely(!modname)) goto bad;
3634 module = PyModule_NewObject(modname);
3635 Py_DECREF(modname);
3636 if (unlikely(!module)) goto bad;
3637 moddict = PyModule_GetDict(module);
3638 if (unlikely(!moddict)) goto bad;
3639 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
3640 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
3641 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
3642 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
3643 return module;
3644 bad:
3645 Py_XDECREF(module);
3646 return NULL;
3647 }
3648
3649
3650 static int __pyx_pymod_exec_controller(PyObject *__pyx_pyinit_module)
3651 #endif
31303652 #endif
31313653 {
31323654 PyObject *__pyx_t_1 = NULL;
31333655 PyObject *__pyx_t_2 = NULL;
31343656 PyObject *__pyx_t_3 = NULL;
3135 PyObject *__pyx_t_4 = NULL;
3136 PyObject *__pyx_t_5 = NULL;
3137 PyObject *__pyx_t_6 = NULL;
31383657 __Pyx_RefNannyDeclarations
3658 #if CYTHON_PEP489_MULTI_PHASE_INIT
3659 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
3660 #elif PY_MAJOR_VERSION >= 3
3661 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
3662 #endif
31393663 #if CYTHON_REFNANNY
3140 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
3141 if (!__Pyx_RefNanny) {
3142 PyErr_Clear();
3143 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
3144 if (!__Pyx_RefNanny)
3145 Py_FatalError("failed to import 'refnanny' module");
3146 }
3147 #endif
3148 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_controller(void)", 0);
3149 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3150 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
3151 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
3152 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
3664 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
3665 if (!__Pyx_RefNanny) {
3666 PyErr_Clear();
3667 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
3668 if (!__Pyx_RefNanny)
3669 Py_FatalError("failed to import 'refnanny' module");
3670 }
3671 #endif
3672 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_controller(void)", 0);
3673 if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3674 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error)
3675 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error)
3676 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error)
31533677 #ifdef __Pyx_CyFunction_USED
3154 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3678 if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
31553679 #endif
31563680 #ifdef __Pyx_FusedFunction_USED
3157 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3681 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
31583682 #endif
31593683 #ifdef __Pyx_Coroutine_USED
3160 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3684 if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
31613685 #endif
31623686 #ifdef __Pyx_Generator_USED
3163 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3687 if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3688 #endif
3689 #ifdef __Pyx_AsyncGen_USED
3690 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
31643691 #endif
31653692 #ifdef __Pyx_StopAsyncIteration_USED
3166 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3693 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
31673694 #endif
31683695 /*--- Library function declarations ---*/
31693696 /*--- Threads initialization code ---*/
31733700 #endif
31743701 #endif
31753702 /*--- Module creation code ---*/
3703 #if CYTHON_PEP489_MULTI_PHASE_INIT
3704 __pyx_m = __pyx_pyinit_module;
3705 Py_INCREF(__pyx_m);
3706 #else
31763707 #if PY_MAJOR_VERSION < 3
31773708 __pyx_m = Py_InitModule4("controller", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
31783709 #else
31793710 __pyx_m = PyModule_Create(&__pyx_moduledef);
31803711 #endif
3181 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
3182 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
3712 if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
3713 #endif
3714 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error)
31833715 Py_INCREF(__pyx_d);
3184 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
3716 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error)
3717 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error)
31853718 #if CYTHON_COMPILING_IN_PYPY
31863719 Py_INCREF(__pyx_b);
31873720 #endif
3188 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
3721 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
31893722 /*--- Initialize various global constants etc. ---*/
3190 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3723 if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
31913724 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
3192 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3725 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
31933726 #endif
31943727 if (__pyx_module_is_main_pygame_sdl2__controller) {
3195 if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3728 if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
31963729 }
31973730 #if PY_MAJOR_VERSION >= 3
31983731 {
3199 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
3732 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error)
32003733 if (!PyDict_GetItemString(modules, "pygame_sdl2.controller")) {
3201 if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.controller", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
3734 if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.controller", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
32023735 }
32033736 }
32043737 #endif
32053738 /*--- Builtin init code ---*/
3206 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3739 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
32073740 /*--- Constants init code ---*/
3208 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3209 /*--- Global init code ---*/
3210 /*--- Variable export code ---*/
3211 /*--- Function export code ---*/
3212 /*--- Type init code ---*/
3213 if (PyType_Ready(&__pyx_type_11pygame_sdl2_10controller_Controller) < 0) __PYX_ERR(0, 134, __pyx_L1_error)
3214 __pyx_type_11pygame_sdl2_10controller_Controller.tp_print = 0;
3215 #if CYTHON_COMPILING_IN_CPYTHON
3216 {
3217 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_11pygame_sdl2_10controller_Controller, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 134, __pyx_L1_error)
3218 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
3219 __pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
3220 __pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__.doc = __pyx_doc_11pygame_sdl2_10controller_10Controller_2__init__;
3221 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_11pygame_sdl2_10controller_10Controller_2__init__;
3222 }
3223 }
3224 #endif
3225 if (PyObject_SetAttrString(__pyx_m, "Controller", (PyObject *)&__pyx_type_11pygame_sdl2_10controller_Controller) < 0) __PYX_ERR(0, 134, __pyx_L1_error)
3226 if (__pyx_type_11pygame_sdl2_10controller_Controller.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_10controller_Controller.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_10controller_Controller, __weakref__);
3227 __pyx_ptype_11pygame_sdl2_10controller_Controller = &__pyx_type_11pygame_sdl2_10controller_Controller;
3228 /*--- Type import code ---*/
3229 /*--- Variable import code ---*/
3230 /*--- Function import code ---*/
3231 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
3232 if (__Pyx_ImportFunction(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3233 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3741 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3742 /*--- Global type/function init code ---*/
3743 (void)__Pyx_modinit_global_init_code();
3744 (void)__Pyx_modinit_variable_export_code();
3745 (void)__Pyx_modinit_function_export_code();
3746 if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
3747 (void)__Pyx_modinit_type_import_code();
3748 (void)__Pyx_modinit_variable_import_code();
3749 if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error;
32343750 /*--- Execution code ---*/
32353751 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
3236 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3752 if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
32373753 #endif
32383754
32393755 /* "pygame_sdl2/controller.pyx":20
32433759 * import pygame_sdl2
32443760 *
32453761 */
3246 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
3247 __Pyx_GOTREF(__pyx_t_2);
3762 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 20, __pyx_L1_error)
3763 __Pyx_GOTREF(__pyx_t_1);
32483764 __Pyx_INCREF(__pyx_n_s_error);
32493765 __Pyx_GIVEREF(__pyx_n_s_error);
3250 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error);
3251 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error)
3252 __Pyx_GOTREF(__pyx_t_3);
3766 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_error);
3767 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 20, __pyx_L1_error)
3768 __Pyx_GOTREF(__pyx_t_2);
3769 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3770 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 20, __pyx_L1_error)
3771 __Pyx_GOTREF(__pyx_t_1);
3772 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_1) < 0) __PYX_ERR(1, 20, __pyx_L1_error)
3773 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32533774 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3254 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
3255 __Pyx_GOTREF(__pyx_t_2);
3256 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
3257 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3258 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
32593775
32603776 /* "pygame_sdl2/controller.pyx":21
32613777 * from sdl2 cimport *
32643780 *
32653781 * from pygame_sdl2.rwobject cimport to_rwops
32663782 */
3267 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error)
3268 __Pyx_GOTREF(__pyx_t_3);
3269 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_3) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
3270 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3783 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 21, __pyx_L1_error)
3784 __Pyx_GOTREF(__pyx_t_2);
3785 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) __PYX_ERR(1, 21, __pyx_L1_error)
3786 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
32713787
32723788 /* "pygame_sdl2/controller.pyx":25
32733789 * from pygame_sdl2.rwobject cimport to_rwops
32763792 * def init():
32773793 * """
32783794 */
3279 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
3795 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error)
32803796 __Pyx_GOTREF(__pyx_t_2);
3281 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_register_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error)
3282 __Pyx_GOTREF(__pyx_t_4);
3797 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_register_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error)
3798 __Pyx_GOTREF(__pyx_t_1);
32833799 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
32843800
32853801 /* "pygame_sdl2/controller.pyx":26
32893805 * """
32903806 * Initializes game controller support.
32913807 */
3292 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_1init, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
3808 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_1init, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 26, __pyx_L1_error)
32933809 __Pyx_GOTREF(__pyx_t_2);
3294 __pyx_t_5 = NULL;
3295 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
3296 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3297 if (likely(__pyx_t_5)) {
3298 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3299 __Pyx_INCREF(__pyx_t_5);
3300 __Pyx_INCREF(function);
3301 __Pyx_DECREF_SET(__pyx_t_4, function);
3302 }
3303 }
3304 if (!__pyx_t_5) {
3305 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
3306 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3307 __Pyx_GOTREF(__pyx_t_3);
3308 } else {
3309 #if CYTHON_FAST_PYCALL
3310 if (PyFunction_Check(__pyx_t_4)) {
3311 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_2};
3312 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
3313 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3314 __Pyx_GOTREF(__pyx_t_3);
3315 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3316 } else
3317 #endif
3318 #if CYTHON_FAST_PYCCALL
3319 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
3320 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_2};
3321 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
3322 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3323 __Pyx_GOTREF(__pyx_t_3);
3324 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3325 } else
3326 #endif
3327 {
3328 __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 25, __pyx_L1_error)
3329 __Pyx_GOTREF(__pyx_t_6);
3330 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
3331 __Pyx_GIVEREF(__pyx_t_2);
3332 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_2);
3333 __pyx_t_2 = 0;
3334 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
3335 __Pyx_GOTREF(__pyx_t_3);
3336 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3337 }
3338 }
3339 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3340 if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
3810
3811 /* "pygame_sdl2/controller.pyx":25
3812 * from pygame_sdl2.rwobject cimport to_rwops
3813 *
3814 * @pygame_sdl2.register_init # <<<<<<<<<<<<<<
3815 * def init():
3816 * """
3817 */
3818 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error)
3819 __Pyx_GOTREF(__pyx_t_3);
3820 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3821 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3822 if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(1, 26, __pyx_L1_error)
33413823 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
33423824
33433825 /* "pygame_sdl2/controller.pyx":36
33473829 * def quit(): # @ReservedAssignment
33483830 * """
33493831 */
3350 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 36, __pyx_L1_error)
3351 __Pyx_GOTREF(__pyx_t_4);
3352 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 36, __pyx_L1_error)
3353 __Pyx_GOTREF(__pyx_t_6);
3354 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3832 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 36, __pyx_L1_error)
3833 __Pyx_GOTREF(__pyx_t_3);
3834 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 36, __pyx_L1_error)
3835 __Pyx_GOTREF(__pyx_t_2);
3836 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
33553837
33563838 /* "pygame_sdl2/controller.pyx":37
33573839 *
33603842 * """
33613843 * Shuts down game controller support.
33623844 */
3363 __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_3quit, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L1_error)
3364 __Pyx_GOTREF(__pyx_t_4);
3365 __pyx_t_2 = NULL;
3366 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
3367 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
3368 if (likely(__pyx_t_2)) {
3369 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
3370 __Pyx_INCREF(__pyx_t_2);
3371 __Pyx_INCREF(function);
3372 __Pyx_DECREF_SET(__pyx_t_6, function);
3373 }
3374 }
3375 if (!__pyx_t_2) {
3376 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error)
3377 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3378 __Pyx_GOTREF(__pyx_t_3);
3379 } else {
3380 #if CYTHON_FAST_PYCALL
3381 if (PyFunction_Check(__pyx_t_6)) {
3382 PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
3383 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error)
3384 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3385 __Pyx_GOTREF(__pyx_t_3);
3386 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3387 } else
3388 #endif
3389 #if CYTHON_FAST_PYCCALL
3390 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
3391 PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
3392 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error)
3393 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3394 __Pyx_GOTREF(__pyx_t_3);
3395 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3396 } else
3397 #endif
3398 {
3399 __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
3400 __Pyx_GOTREF(__pyx_t_5);
3401 __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
3402 __Pyx_GIVEREF(__pyx_t_4);
3403 PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
3404 __pyx_t_4 = 0;
3405 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error)
3406 __Pyx_GOTREF(__pyx_t_3);
3407 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3408 }
3409 }
3410 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3411 if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_3) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
3845 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_3quit, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 37, __pyx_L1_error)
3846 __Pyx_GOTREF(__pyx_t_3);
3847
3848 /* "pygame_sdl2/controller.pyx":36
3849 * raise error()
3850 *
3851 * @pygame_sdl2.register_quit # <<<<<<<<<<<<<<
3852 * def quit(): # @ReservedAssignment
3853 * """
3854 */
3855 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 36, __pyx_L1_error)
3856 __Pyx_GOTREF(__pyx_t_1);
3857 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34123858 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3859 if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_1) < 0) __PYX_ERR(1, 37, __pyx_L1_error)
3860 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34133861
34143862 /* "pygame_sdl2/controller.pyx":44
34153863 * SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER)
34183866 * """
34193867 * Returns true if game controller support has been initialized.
34203868 */
3421 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_5get_init, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)
3422 __Pyx_GOTREF(__pyx_t_3);
3423 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
3424 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3869 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_5get_init, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L1_error)
3870 __Pyx_GOTREF(__pyx_t_1);
3871 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_1) < 0) __PYX_ERR(1, 44, __pyx_L1_error)
3872 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34253873
34263874 /* "pygame_sdl2/controller.pyx":51
34273875 * return SDL_WasInit(SDL_INIT_GAMECONTROLLER) != 0
34303878 * """
34313879 * Returns the number of joysticks and game controllers connected to the
34323880 */
3433 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_7get_count, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error)
3434 __Pyx_GOTREF(__pyx_t_3);
3435 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_count, __pyx_t_3) < 0) __PYX_ERR(0, 51, __pyx_L1_error)
3436 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3881 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_7get_count, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 51, __pyx_L1_error)
3882 __Pyx_GOTREF(__pyx_t_1);
3883 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_count, __pyx_t_1) < 0) __PYX_ERR(1, 51, __pyx_L1_error)
3884 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34373885
34383886 /* "pygame_sdl2/controller.pyx":66
34393887 *
34423890 * """
34433891 * Adds a game controller mapping from the string in `mapping`.
34443892 */
3445 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_9add_mapping, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 66, __pyx_L1_error)
3446 __Pyx_GOTREF(__pyx_t_3);
3447 if (PyDict_SetItem(__pyx_d, __pyx_n_s_add_mapping, __pyx_t_3) < 0) __PYX_ERR(0, 66, __pyx_L1_error)
3448 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3893 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_9add_mapping, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 66, __pyx_L1_error)
3894 __Pyx_GOTREF(__pyx_t_1);
3895 if (PyDict_SetItem(__pyx_d, __pyx_n_s_add_mapping, __pyx_t_1) < 0) __PYX_ERR(1, 66, __pyx_L1_error)
3896 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34493897
34503898 /* "pygame_sdl2/controller.pyx":74
34513899 * raise error()
34543902 * """
34553903 * Adds game controller mappings from `mapping_file`, which can be a string
34563904 */
3457 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_11add_mappings, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error)
3458 __Pyx_GOTREF(__pyx_t_3);
3459 if (PyDict_SetItem(__pyx_d, __pyx_n_s_add_mappings, __pyx_t_3) < 0) __PYX_ERR(0, 74, __pyx_L1_error)
3460 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3905 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_11add_mappings, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 74, __pyx_L1_error)
3906 __Pyx_GOTREF(__pyx_t_1);
3907 if (PyDict_SetItem(__pyx_d, __pyx_n_s_add_mappings, __pyx_t_1) < 0) __PYX_ERR(1, 74, __pyx_L1_error)
3908 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34613909
34623910 /* "pygame_sdl2/controller.pyx":91
34633911 * raise error()
34663914 * """
34673915 * Returns the axis number of the controller axis with `name`, or
34683916 */
3469 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_13get_axis_from_string, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error)
3470 __Pyx_GOTREF(__pyx_t_3);
3471 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_axis_from_string, __pyx_t_3) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
3472 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3917 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_13get_axis_from_string, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 91, __pyx_L1_error)
3918 __Pyx_GOTREF(__pyx_t_1);
3919 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_axis_from_string, __pyx_t_1) < 0) __PYX_ERR(1, 91, __pyx_L1_error)
3920 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34733921
34743922 /* "pygame_sdl2/controller.pyx":99
34753923 * return SDL_GameControllerGetAxisFromString(name)
34783926 * """
34793927 * Returns the button number of the controller button with `name`, or
34803928 */
3481 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_15get_button_from_string, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error)
3482 __Pyx_GOTREF(__pyx_t_3);
3483 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_button_from_string, __pyx_t_3) < 0) __PYX_ERR(0, 99, __pyx_L1_error)
3484 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3929 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_15get_button_from_string, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 99, __pyx_L1_error)
3930 __Pyx_GOTREF(__pyx_t_1);
3931 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_button_from_string, __pyx_t_1) < 0) __PYX_ERR(1, 99, __pyx_L1_error)
3932 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34853933
34863934 /* "pygame_sdl2/controller.pyx":107
34873935 * return SDL_GameControllerGetButtonFromString(name)
34903938 * """
34913939 * Returns a string describing the controller axis `axis`, which must be
34923940 */
3493 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_17get_string_for_axis, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error)
3494 __Pyx_GOTREF(__pyx_t_3);
3495 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_string_for_axis, __pyx_t_3) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
3496 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3941 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_17get_string_for_axis, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 107, __pyx_L1_error)
3942 __Pyx_GOTREF(__pyx_t_1);
3943 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_string_for_axis, __pyx_t_1) < 0) __PYX_ERR(1, 107, __pyx_L1_error)
3944 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34973945
34983946 /* "pygame_sdl2/controller.pyx":120
34993947 * return None
35023950 * """
35033951 * Returns a string describing the controller button `button`, which must be
35043952 */
3505 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_19get_string_for_button, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error)
3506 __Pyx_GOTREF(__pyx_t_3);
3507 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_string_for_button, __pyx_t_3) < 0) __PYX_ERR(0, 120, __pyx_L1_error)
3508 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3953 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_10controller_19get_string_for_button, NULL, __pyx_n_s_pygame_sdl2_controller); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 120, __pyx_L1_error)
3954 __Pyx_GOTREF(__pyx_t_1);
3955 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_string_for_button, __pyx_t_1) < 0) __PYX_ERR(1, 120, __pyx_L1_error)
3956 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35093957
35103958 /* "pygame_sdl2/controller.pyx":1
35113959 * # Copyright 2015 Tom Rothamel <tom@rothamel.us> # <<<<<<<<<<<<<<
35123960 * #
35133961 * # This software is provided 'as-is', without any express or implied
35143962 */
3515 __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error)
3516 __Pyx_GOTREF(__pyx_t_3);
3517 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3518 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3963 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
3964 __Pyx_GOTREF(__pyx_t_1);
3965 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3966 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35193967
35203968 /*--- Wrapped vars code ---*/
35213969
35243972 __Pyx_XDECREF(__pyx_t_1);
35253973 __Pyx_XDECREF(__pyx_t_2);
35263974 __Pyx_XDECREF(__pyx_t_3);
3527 __Pyx_XDECREF(__pyx_t_4);
3528 __Pyx_XDECREF(__pyx_t_5);
3529 __Pyx_XDECREF(__pyx_t_6);
35303975 if (__pyx_m) {
35313976 if (__pyx_d) {
3532 __Pyx_AddTraceback("init pygame_sdl2.controller", __pyx_clineno, __pyx_lineno, __pyx_filename);
3977 __Pyx_AddTraceback("init pygame_sdl2.controller", 0, __pyx_lineno, __pyx_filename);
35333978 }
35343979 Py_DECREF(__pyx_m); __pyx_m = 0;
35353980 } else if (!PyErr_Occurred()) {
35373982 }
35383983 __pyx_L0:;
35393984 __Pyx_RefNannyFinishContext();
3540 #if PY_MAJOR_VERSION < 3
3985 #if CYTHON_PEP489_MULTI_PHASE_INIT
3986 return (__pyx_m != NULL) ? 0 : -1;
3987 #elif PY_MAJOR_VERSION >= 3
3988 return __pyx_m;
3989 #else
35413990 return;
3542 #else
3543 return __pyx_m;
35443991 #endif
35453992 }
35463993
35624009 }
35634010 #endif
35644011
4012 /* PyObjectGetAttrStr */
4013 #if CYTHON_USE_TYPE_SLOTS
4014 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
4015 PyTypeObject* tp = Py_TYPE(obj);
4016 if (likely(tp->tp_getattro))
4017 return tp->tp_getattro(obj, attr_name);
4018 #if PY_MAJOR_VERSION < 3
4019 if (likely(tp->tp_getattr))
4020 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
4021 #endif
4022 return PyObject_GetAttr(obj, attr_name);
4023 }
4024 #endif
4025
35654026 /* GetBuiltinName */
35664027 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
35674028 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
35804041 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
35814042 PyObject *result;
35824043 #if !CYTHON_AVOID_BORROWED_REFS
4044 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
4045 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
4046 if (likely(result)) {
4047 Py_INCREF(result);
4048 } else if (unlikely(PyErr_Occurred())) {
4049 result = NULL;
4050 } else {
4051 #else
35834052 result = PyDict_GetItem(__pyx_d, name);
35844053 if (likely(result)) {
35854054 Py_INCREF(result);
35864055 } else {
4056 #endif
35874057 #else
35884058 result = PyObject_GetItem(__pyx_d, name);
35894059 if (!result) {
35954065 }
35964066
35974067 /* PyCFunctionFastCall */
3598 #if CYTHON_FAST_PYCCALL
4068 #if CYTHON_FAST_PYCCALL
35994069 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
36004070 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
36014071 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
36024072 PyObject *self = PyCFunction_GET_SELF(func);
4073 int flags = PyCFunction_GET_FLAGS(func);
36034074 assert(PyCFunction_Check(func));
3604 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
4075 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
36054076 assert(nargs >= 0);
36064077 assert(nargs == 0 || args != NULL);
36074078 /* _PyCFunction_FastCallDict() must not be called with an exception set,
36084079 because it may clear it (directly or indirectly) and so the
36094080 caller loses its exception */
36104081 assert(!PyErr_Occurred());
3611 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
3612 }
3613 #endif // CYTHON_FAST_PYCCALL
4082 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
4083 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
4084 } else {
4085 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
4086 }
4087 }
4088 #endif
36144089
36154090 /* PyFunctionFastCall */
3616 #if CYTHON_FAST_PYCALL
4091 #if CYTHON_FAST_PYCALL
36174092 #include "frameobject.h"
36184093 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
36194094 PyObject *globals) {
36204095 PyFrameObject *f;
3621 PyThreadState *tstate = PyThreadState_GET();
4096 PyThreadState *tstate = __Pyx_PyThreadState_Current;
36224097 PyObject **fastlocals;
36234098 Py_ssize_t i;
36244099 PyObject *result;
37294204 Py_LeaveRecursiveCall();
37304205 return result;
37314206 }
3732 #endif // CPython < 3.6
3733 #endif // CYTHON_FAST_PYCALL
4207 #endif
4208 #endif
37344209
37354210 /* PyObjectCall */
3736 #if CYTHON_COMPILING_IN_CPYTHON
4211 #if CYTHON_COMPILING_IN_CPYTHON
37374212 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
37384213 PyObject *result;
37394214 ternaryfunc call = func->ob_type->tp_call;
37534228 #endif
37544229
37554230 /* PyObjectCallMethO */
3756 #if CYTHON_COMPILING_IN_CPYTHON
4231 #if CYTHON_COMPILING_IN_CPYTHON
37574232 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
37584233 PyObject *self, *result;
37594234 PyCFunction cfunc;
37734248 #endif
37744249
37754250 /* PyObjectCallOneArg */
3776 #if CYTHON_COMPILING_IN_CPYTHON
4251 #if CYTHON_COMPILING_IN_CPYTHON
37774252 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
37784253 PyObject *result;
37794254 PyObject *args = PyTuple_New(1);
37904265 return __Pyx_PyFunction_FastCall(func, &arg, 1);
37914266 }
37924267 #endif
3793 #ifdef __Pyx_CyFunction_USED
3794 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
3795 #else
37964268 if (likely(PyCFunction_Check(func))) {
3797 #endif
37984269 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
37994270 return __Pyx_PyObject_CallMethO(func, arg);
38004271 #if CYTHON_FAST_PYCCALL
38254296 }
38264297 #endif
38274298 #ifdef __Pyx_CyFunction_USED
3828 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
4299 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
38294300 #else
38304301 if (likely(PyCFunction_Check(func))) {
38314302 #endif
39774448 "raise: exception class must be a subclass of BaseException");
39784449 goto bad;
39794450 }
3980 #if PY_VERSION_HEX >= 0x03030000
39814451 if (cause) {
3982 #else
3983 if (cause && cause != Py_None) {
3984 #endif
39854452 PyObject *fixed_cause;
39864453 if (cause == Py_None) {
39874454 fixed_cause = NULL;
40094476 PyErr_Restore(tmp_type, tmp_value, tb);
40104477 Py_XDECREF(tmp_tb);
40114478 #else
4012 PyThreadState *tstate = PyThreadState_GET();
4479 PyThreadState *tstate = __Pyx_PyThreadState_Current;
40134480 PyObject* tmp_tb = tstate->curexc_traceback;
40144481 if (tb != tmp_tb) {
40154482 Py_INCREF(tb);
40254492 #endif
40264493
40274494 /* RaiseArgTupleInvalid */
4028 static void __Pyx_RaiseArgtupleInvalid(
4495 static void __Pyx_RaiseArgtupleInvalid(
40294496 const char* func_name,
40304497 int exact,
40314498 Py_ssize_t num_min,
40514518 }
40524519
40534520 /* KeywordStringCheck */
4054 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
4521 static int __Pyx_CheckKeywordStrings(
40554522 PyObject *kwdict,
40564523 const char* function_name,
40574524 int kw_allowed)
40654532 #else
40664533 while (PyDict_Next(kwdict, &pos, &key, 0)) {
40674534 #if PY_MAJOR_VERSION < 3
4068 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
4535 if (unlikely(!PyString_Check(key)))
40694536 #endif
40704537 if (unlikely(!PyUnicode_Check(key)))
40714538 goto invalid_keyword_type;
40914558 }
40924559
40934560 /* RaiseDoubleKeywords */
4094 static void __Pyx_RaiseDoubleKeywordsError(
4561 static void __Pyx_RaiseDoubleKeywordsError(
40954562 const char* func_name,
40964563 PyObject* kw_name)
40974564 {
41054572 }
41064573
41074574 /* ParseKeywords */
4108 static int __Pyx_ParseOptionalKeywords(
4575 static int __Pyx_ParseOptionalKeywords(
41094576 PyObject *kwds,
41104577 PyObject **argnames[],
41114578 PyObject *kwds2,
42064673 return -1;
42074674 }
42084675
4676 /* PyObject_GenericGetAttrNoDict */
4677 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
4678 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
4679 PyErr_Format(PyExc_AttributeError,
4680 #if PY_MAJOR_VERSION >= 3
4681 "'%.50s' object has no attribute '%U'",
4682 tp->tp_name, attr_name);
4683 #else
4684 "'%.50s' object has no attribute '%.400s'",
4685 tp->tp_name, PyString_AS_STRING(attr_name));
4686 #endif
4687 return NULL;
4688 }
4689 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
4690 PyObject *descr;
4691 PyTypeObject *tp = Py_TYPE(obj);
4692 if (unlikely(!PyString_Check(attr_name))) {
4693 return PyObject_GenericGetAttr(obj, attr_name);
4694 }
4695 assert(!tp->tp_dictoffset);
4696 descr = _PyType_Lookup(tp, attr_name);
4697 if (unlikely(!descr)) {
4698 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
4699 }
4700 Py_INCREF(descr);
4701 #if PY_MAJOR_VERSION < 3
4702 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
4703 #endif
4704 {
4705 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
4706 if (unlikely(f)) {
4707 PyObject *res = f(descr, obj, (PyObject *)tp);
4708 Py_DECREF(descr);
4709 return res;
4710 }
4711 }
4712 return descr;
4713 }
4714 #endif
4715
4716 /* PyObject_GenericGetAttr */
4717 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
4718 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
4719 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
4720 return PyObject_GenericGetAttr(obj, attr_name);
4721 }
4722 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
4723 }
4724 #endif
4725
4726 /* SetupReduce */
4727 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
4728 int ret;
4729 PyObject *name_attr;
4730 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
4731 if (likely(name_attr)) {
4732 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
4733 } else {
4734 ret = -1;
4735 }
4736 if (unlikely(ret < 0)) {
4737 PyErr_Clear();
4738 ret = 0;
4739 }
4740 Py_XDECREF(name_attr);
4741 return ret;
4742 }
4743 static int __Pyx_setup_reduce(PyObject* type_obj) {
4744 int ret = 0;
4745 PyObject *object_reduce = NULL;
4746 PyObject *object_reduce_ex = NULL;
4747 PyObject *reduce = NULL;
4748 PyObject *reduce_ex = NULL;
4749 PyObject *reduce_cython = NULL;
4750 PyObject *setstate = NULL;
4751 PyObject *setstate_cython = NULL;
4752 #if CYTHON_USE_PYTYPE_LOOKUP
4753 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
4754 #else
4755 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
4756 #endif
4757 #if CYTHON_USE_PYTYPE_LOOKUP
4758 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
4759 #else
4760 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
4761 #endif
4762 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
4763 if (reduce_ex == object_reduce_ex) {
4764 #if CYTHON_USE_PYTYPE_LOOKUP
4765 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
4766 #else
4767 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
4768 #endif
4769 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
4770 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
4771 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
4772 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
4773 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
4774 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
4775 if (!setstate) PyErr_Clear();
4776 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
4777 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
4778 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
4779 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
4780 }
4781 PyType_Modified((PyTypeObject*)type_obj);
4782 }
4783 }
4784 goto GOOD;
4785 BAD:
4786 if (!PyErr_Occurred())
4787 PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
4788 ret = -1;
4789 GOOD:
4790 #if !CYTHON_USE_PYTYPE_LOOKUP
4791 Py_XDECREF(object_reduce);
4792 Py_XDECREF(object_reduce_ex);
4793 #endif
4794 Py_XDECREF(reduce);
4795 Py_XDECREF(reduce_ex);
4796 Py_XDECREF(reduce_cython);
4797 Py_XDECREF(setstate);
4798 Py_XDECREF(setstate_cython);
4799 return ret;
4800 }
4801
42094802 /* Import */
4210 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
4803 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
42114804 PyObject *empty_list = 0;
42124805 PyObject *module = 0;
42134806 PyObject *global_dict = 0;
42144807 PyObject *empty_dict = 0;
42154808 PyObject *list;
4216 #if PY_VERSION_HEX < 0x03030000
4809 #if PY_MAJOR_VERSION < 3
42174810 PyObject *py_import;
42184811 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
42194812 if (!py_import)
42374830 #if PY_MAJOR_VERSION >= 3
42384831 if (level == -1) {
42394832 if (strchr(__Pyx_MODULE_NAME, '.')) {
4240 #if PY_VERSION_HEX < 0x03030000
4241 PyObject *py_level = PyInt_FromLong(1);
4242 if (!py_level)
4243 goto bad;
4244 module = PyObject_CallFunctionObjArgs(py_import,
4245 name, global_dict, empty_dict, list, py_level, NULL);
4246 Py_DECREF(py_level);
4247 #else
42484833 module = PyImport_ImportModuleLevelObject(
42494834 name, global_dict, empty_dict, list, 1);
4250 #endif
42514835 if (!module) {
42524836 if (!PyErr_ExceptionMatches(PyExc_ImportError))
42534837 goto bad;
42584842 }
42594843 #endif
42604844 if (!module) {
4261 #if PY_VERSION_HEX < 0x03030000
4845 #if PY_MAJOR_VERSION < 3
42624846 PyObject *py_level = PyInt_FromLong(level);
42634847 if (!py_level)
42644848 goto bad;
42724856 }
42734857 }
42744858 bad:
4275 #if PY_VERSION_HEX < 0x03030000
4859 #if PY_MAJOR_VERSION < 3
42764860 Py_XDECREF(py_import);
42774861 #endif
42784862 Py_XDECREF(empty_list);
42814865 }
42824866
42834867 /* ImportFrom */
4284 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
4868 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
42854869 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
42864870 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
42874871 PyErr_Format(PyExc_ImportError,
42944878 return value;
42954879 }
42964880
4881 /* CLineInTraceback */
4882 #ifndef CYTHON_CLINE_IN_TRACEBACK
4883 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
4884 PyObject *use_cline;
4885 PyObject *ptype, *pvalue, *ptraceback;
4886 #if CYTHON_COMPILING_IN_CPYTHON
4887 PyObject **cython_runtime_dict;
4888 #endif
4889 if (unlikely(!__pyx_cython_runtime)) {
4890 return c_line;
4891 }
4892 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
4893 #if CYTHON_COMPILING_IN_CPYTHON
4894 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
4895 if (likely(cython_runtime_dict)) {
4896 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
4897 } else
4898 #endif
4899 {
4900 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
4901 if (use_cline_obj) {
4902 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
4903 Py_DECREF(use_cline_obj);
4904 } else {
4905 PyErr_Clear();
4906 use_cline = NULL;
4907 }
4908 }
4909 if (!use_cline) {
4910 c_line = 0;
4911 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
4912 }
4913 else if (PyObject_Not(use_cline) != 0) {
4914 c_line = 0;
4915 }
4916 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
4917 return c_line;
4918 }
4919 #endif
4920
42974921 /* CodeObjectCache */
4298 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
4922 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
42994923 int start = 0, mid = 0, end = count - 1;
43004924 if (end >= 0 && code_line > entries[end].code_line) {
43014925 return count;
43754999 }
43765000
43775001 /* AddTraceback */
4378 #include "compile.h"
5002 #include "compile.h"
43795003 #include "frameobject.h"
43805004 #include "traceback.h"
43815005 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
44345058 int py_line, const char *filename) {
44355059 PyCodeObject *py_code = 0;
44365060 PyFrameObject *py_frame = 0;
4437 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
5061 PyThreadState *tstate = __Pyx_PyThreadState_Current;
5062 if (c_line) {
5063 c_line = __Pyx_CLineForTraceback(tstate, c_line);
5064 }
5065 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
44385066 if (!py_code) {
44395067 py_code = __Pyx_CreateCodeObjectForTraceback(
44405068 funcname, c_line, py_line, filename);
44415069 if (!py_code) goto bad;
4442 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
5070 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
44435071 }
44445072 py_frame = PyFrame_New(
4445 PyThreadState_GET(), /*PyThreadState *tstate,*/
4446 py_code, /*PyCodeObject *code,*/
4447 __pyx_d, /*PyObject *globals,*/
4448 0 /*PyObject *locals*/
5073 tstate, /*PyThreadState *tstate,*/
5074 py_code, /*PyCodeObject *code,*/
5075 __pyx_d, /*PyObject *globals,*/
5076 0 /*PyObject *locals*/
44495077 );
44505078 if (!py_frame) goto bad;
44515079 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
44565084 }
44575085
44585086 /* CIntToPy */
4459 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
5087 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
44605088 const int neg_one = (int) -1, const_zero = (int) 0;
44615089 const int is_unsigned = neg_one > const_zero;
44625090 if (is_unsigned) {
44875115 }
44885116
44895117 /* CIntToPy */
4490 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerAxis value) {
5118 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerAxis value) {
44915119 const SDL_GameControllerAxis neg_one = (SDL_GameControllerAxis) -1, const_zero = (SDL_GameControllerAxis) 0;
44925120 const int is_unsigned = neg_one > const_zero;
44935121 if (is_unsigned) {
45185146 }
45195147
45205148 /* CIntToPy */
4521 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerButton value) {
5149 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerButton value) {
45225150 const SDL_GameControllerButton neg_one = (SDL_GameControllerButton) -1, const_zero = (SDL_GameControllerButton) 0;
45235151 const int is_unsigned = neg_one > const_zero;
45245152 if (is_unsigned) {
45495177 }
45505178
45515179 /* CIntFromPyVerify */
4552 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
5180 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
45535181 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
45545182 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
45555183 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
45715199 }
45725200
45735201 /* CIntToPy */
4574 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) {
5202 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) {
45755203 const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0;
45765204 const int is_unsigned = neg_one > const_zero;
45775205 if (is_unsigned) {
46025230 }
46035231
46045232 /* CIntToPy */
4605 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
5233 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
46065234 const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0;
46075235 const int is_unsigned = neg_one > const_zero;
46085236 if (is_unsigned) {
46335261 }
46345262
46355263 /* CIntToPy */
4636 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value) {
5264 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value) {
46375265 const SDL_bool neg_one = (SDL_bool) -1, const_zero = (SDL_bool) 0;
46385266 const int is_unsigned = neg_one > const_zero;
46395267 if (is_unsigned) {
46645292 }
46655293
46665294 /* CIntFromPy */
4667 static CYTHON_INLINE SDL_GameControllerAxis __Pyx_PyInt_As_SDL_GameControllerAxis(PyObject *x) {
5295 static CYTHON_INLINE SDL_GameControllerAxis __Pyx_PyInt_As_SDL_GameControllerAxis(PyObject *x) {
46685296 const SDL_GameControllerAxis neg_one = (SDL_GameControllerAxis) -1, const_zero = (SDL_GameControllerAxis) 0;
46695297 const int is_unsigned = neg_one > const_zero;
46705298 #if PY_MAJOR_VERSION < 3
48535481 }
48545482
48555483 /* CIntFromPy */
4856 static CYTHON_INLINE SDL_GameControllerButton __Pyx_PyInt_As_SDL_GameControllerButton(PyObject *x) {
5484 static CYTHON_INLINE SDL_GameControllerButton __Pyx_PyInt_As_SDL_GameControllerButton(PyObject *x) {
48575485 const SDL_GameControllerButton neg_one = (SDL_GameControllerButton) -1, const_zero = (SDL_GameControllerButton) 0;
48585486 const int is_unsigned = neg_one > const_zero;
48595487 #if PY_MAJOR_VERSION < 3
50425670 }
50435671
50445672 /* CIntFromPy */
5045 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
5673 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
50465674 const int neg_one = (int) -1, const_zero = (int) 0;
50475675 const int is_unsigned = neg_one > const_zero;
50485676 #if PY_MAJOR_VERSION < 3
52315859 }
52325860
52335861 /* CIntToPy */
5234 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
5862 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
52355863 const long neg_one = (long) -1, const_zero = (long) 0;
52365864 const int is_unsigned = neg_one > const_zero;
52375865 if (is_unsigned) {
52625890 }
52635891
52645892 /* CIntFromPy */
5265 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
5893 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
52665894 const long neg_one = (long) -1, const_zero = (long) 0;
52675895 const int is_unsigned = neg_one > const_zero;
52685896 #if PY_MAJOR_VERSION < 3
54506078 return (long) -1;
54516079 }
54526080
6081 /* FastTypeChecks */
6082 #if CYTHON_COMPILING_IN_CPYTHON
6083 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
6084 while (a) {
6085 a = a->tp_base;
6086 if (a == b)
6087 return 1;
6088 }
6089 return b == &PyBaseObject_Type;
6090 }
6091 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
6092 PyObject *mro;
6093 if (a == b) return 1;
6094 mro = a->tp_mro;
6095 if (likely(mro)) {
6096 Py_ssize_t i, n;
6097 n = PyTuple_GET_SIZE(mro);
6098 for (i = 0; i < n; i++) {
6099 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
6100 return 1;
6101 }
6102 return 0;
6103 }
6104 return __Pyx_InBases(a, b);
6105 }
6106 #if PY_MAJOR_VERSION == 2
6107 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
6108 PyObject *exception, *value, *tb;
6109 int res;
6110 __Pyx_PyThreadState_declare
6111 __Pyx_PyThreadState_assign
6112 __Pyx_ErrFetch(&exception, &value, &tb);
6113 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
6114 if (unlikely(res == -1)) {
6115 PyErr_WriteUnraisable(err);
6116 res = 0;
6117 }
6118 if (!res) {
6119 res = PyObject_IsSubclass(err, exc_type2);
6120 if (unlikely(res == -1)) {
6121 PyErr_WriteUnraisable(err);
6122 res = 0;
6123 }
6124 }
6125 __Pyx_ErrRestore(exception, value, tb);
6126 return res;
6127 }
6128 #else
6129 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
6130 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
6131 if (!res) {
6132 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
6133 }
6134 return res;
6135 }
6136 #endif
6137 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
6138 Py_ssize_t i, n;
6139 assert(PyExceptionClass_Check(exc_type));
6140 n = PyTuple_GET_SIZE(tuple);
6141 #if PY_MAJOR_VERSION >= 3
6142 for (i=0; i<n; i++) {
6143 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
6144 }
6145 #endif
6146 for (i=0; i<n; i++) {
6147 PyObject *t = PyTuple_GET_ITEM(tuple, i);
6148 #if PY_MAJOR_VERSION < 3
6149 if (likely(exc_type == t)) return 1;
6150 #endif
6151 if (likely(PyExceptionClass_Check(t))) {
6152 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
6153 } else {
6154 }
6155 }
6156 return 0;
6157 }
6158 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
6159 if (likely(err == exc_type)) return 1;
6160 if (likely(PyExceptionClass_Check(err))) {
6161 if (likely(PyExceptionClass_Check(exc_type))) {
6162 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
6163 } else if (likely(PyTuple_Check(exc_type))) {
6164 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
6165 } else {
6166 }
6167 }
6168 return PyErr_GivenExceptionMatches(err, exc_type);
6169 }
6170 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
6171 assert(PyExceptionClass_Check(exc_type1));
6172 assert(PyExceptionClass_Check(exc_type2));
6173 if (likely(err == exc_type1 || err == exc_type2)) return 1;
6174 if (likely(PyExceptionClass_Check(err))) {
6175 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
6176 }
6177 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
6178 }
6179 #endif
6180
54536181 /* CheckBinaryVersion */
5454 static int __Pyx_check_binary_version(void) {
6182 static int __Pyx_check_binary_version(void) {
54556183 char ctversion[4], rtversion[4];
54566184 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
54576185 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
54676195 }
54686196
54696197 /* ModuleImport */
5470 #ifndef __PYX_HAVE_RT_ImportModule
6198 #ifndef __PYX_HAVE_RT_ImportModule
54716199 #define __PYX_HAVE_RT_ImportModule
54726200 static PyObject *__Pyx_ImportModule(const char *name) {
54736201 PyObject *py_name = 0;
54856213 #endif
54866214
54876215 /* FunctionImport */
5488 #ifndef __PYX_HAVE_RT_ImportFunction
6216 #ifndef __PYX_HAVE_RT_ImportFunction
54896217 #define __PYX_HAVE_RT_ImportFunction
54906218 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
54916219 PyObject *d = 0;
55396267 #endif
55406268
55416269 /* InitStrings */
5542 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
6270 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
55436271 while (t->p) {
55446272 #if PY_MAJOR_VERSION < 3
55456273 if (t->is_unicode) {
55646292 #endif
55656293 if (!*t->p)
55666294 return -1;
6295 if (PyObject_Hash(*t->p) == -1)
6296 return -1;
55676297 ++t;
55686298 }
55696299 return 0;
55726302 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
55736303 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
55746304 }
5575 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
6305 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
55766306 Py_ssize_t ignore;
55776307 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
55786308 }
5579 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5580 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
6309 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
6310 #if !CYTHON_PEP393_ENABLED
6311 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6312 char* defenc_c;
6313 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
6314 if (!defenc) return NULL;
6315 defenc_c = PyBytes_AS_STRING(defenc);
6316 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6317 {
6318 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
6319 char* c;
6320 for (c = defenc_c; c < end; c++) {
6321 if ((unsigned char) (*c) >= 128) {
6322 PyUnicode_AsASCIIString(o);
6323 return NULL;
6324 }
6325 }
6326 }
6327 #endif
6328 *length = PyBytes_GET_SIZE(defenc);
6329 return defenc_c;
6330 }
6331 #else
6332 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6333 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
6334 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6335 if (likely(PyUnicode_IS_ASCII(o))) {
6336 *length = PyUnicode_GET_LENGTH(o);
6337 return PyUnicode_AsUTF8(o);
6338 } else {
6339 PyUnicode_AsASCIIString(o);
6340 return NULL;
6341 }
6342 #else
6343 return PyUnicode_AsUTF8AndSize(o, length);
6344 #endif
6345 }
6346 #endif
6347 #endif
6348 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6349 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
55816350 if (
55826351 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
55836352 __Pyx_sys_getdefaultencoding_not_ascii &&
55846353 #endif
55856354 PyUnicode_Check(o)) {
5586 #if PY_VERSION_HEX < 0x03030000
5587 char* defenc_c;
5588 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
5589 if (!defenc) return NULL;
5590 defenc_c = PyBytes_AS_STRING(defenc);
5591 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5592 {
5593 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
5594 char* c;
5595 for (c = defenc_c; c < end; c++) {
5596 if ((unsigned char) (*c) >= 128) {
5597 PyUnicode_AsASCIIString(o);
5598 return NULL;
5599 }
5600 }
5601 }
5602 #endif
5603 *length = PyBytes_GET_SIZE(defenc);
5604 return defenc_c;
5605 #else
5606 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
5607 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5608 if (PyUnicode_IS_ASCII(o)) {
5609 *length = PyUnicode_GET_LENGTH(o);
5610 return PyUnicode_AsUTF8(o);
5611 } else {
5612 PyUnicode_AsASCIIString(o);
5613 return NULL;
5614 }
5615 #else
5616 return PyUnicode_AsUTF8AndSize(o, length);
5617 #endif
5618 #endif
6355 return __Pyx_PyUnicode_AsStringAndSize(o, length);
56196356 } else
56206357 #endif
56216358 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
56396376 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
56406377 else return PyObject_IsTrue(x);
56416378 }
6379 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
6380 #if PY_MAJOR_VERSION >= 3
6381 if (PyLong_Check(result)) {
6382 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
6383 "__int__ returned non-int (type %.200s). "
6384 "The ability to return an instance of a strict subclass of int "
6385 "is deprecated, and may be removed in a future version of Python.",
6386 Py_TYPE(result)->tp_name)) {
6387 Py_DECREF(result);
6388 return NULL;
6389 }
6390 return result;
6391 }
6392 #endif
6393 PyErr_Format(PyExc_TypeError,
6394 "__%.4s__ returned non-%.4s (type %.200s)",
6395 type_name, type_name, Py_TYPE(result)->tp_name);
6396 Py_DECREF(result);
6397 return NULL;
6398 }
56426399 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
56436400 #if CYTHON_USE_TYPE_SLOTS
56446401 PyNumberMethods *m;
56466403 const char *name = NULL;
56476404 PyObject *res = NULL;
56486405 #if PY_MAJOR_VERSION < 3
5649 if (PyInt_Check(x) || PyLong_Check(x))
5650 #else
5651 if (PyLong_Check(x))
6406 if (likely(PyInt_Check(x) || PyLong_Check(x)))
6407 #else
6408 if (likely(PyLong_Check(x)))
56526409 #endif
56536410 return __Pyx_NewRef(x);
56546411 #if CYTHON_USE_TYPE_SLOTS
56566413 #if PY_MAJOR_VERSION < 3
56576414 if (m && m->nb_int) {
56586415 name = "int";
5659 res = PyNumber_Int(x);
6416 res = m->nb_int(x);
56606417 }
56616418 else if (m && m->nb_long) {
56626419 name = "long";
5663 res = PyNumber_Long(x);
6420 res = m->nb_long(x);
56646421 }
56656422 #else
5666 if (m && m->nb_int) {
6423 if (likely(m && m->nb_int)) {
56676424 name = "int";
5668 res = PyNumber_Long(x);
6425 res = m->nb_int(x);
56696426 }
56706427 #endif
56716428 #else
5672 res = PyNumber_Int(x);
5673 #endif
5674 if (res) {
6429 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
6430 res = PyNumber_Int(x);
6431 }
6432 #endif
6433 if (likely(res)) {
56756434 #if PY_MAJOR_VERSION < 3
5676 if (!PyInt_Check(res) && !PyLong_Check(res)) {
5677 #else
5678 if (!PyLong_Check(res)) {
5679 #endif
5680 PyErr_Format(PyExc_TypeError,
5681 "__%.4s__ returned non-%.4s (type %.200s)",
5682 name, name, Py_TYPE(res)->tp_name);
5683 Py_DECREF(res);
5684 return NULL;
6435 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
6436 #else
6437 if (unlikely(!PyLong_CheckExact(res))) {
6438 #endif
6439 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
56856440 }
56866441 }
56876442 else if (!PyErr_Occurred()) {
57526507 Py_DECREF(x);
57536508 return ival;
57546509 }
6510 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
6511 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
6512 }
57556513 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
57566514 return PyInt_FromSize_t(ival);
57576515 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
88 #else
9 #define CYTHON_ABI "0_25_2"
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
102120 #define CYTHON_COMPILING_IN_CPYTHON 1
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
105129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412552
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
423555 #define __PYX_EXTERN_C extern "C"
428560
429561 #define __PYX_HAVE__pygame_sdl2__display
430562 #define __PYX_HAVE_API__pygame_sdl2__display
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
438571 #include <omp.h>
439572 #endif /* _OPENMP */
440573
441 #ifdef PYREX_WITHOUT_ASSERTIONS
574 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
442575 #define CYTHON_WITHOUT_ASSERTIONS
443576 #endif
444577
469602 #define __Pyx_sst_abs(value) abs(value)
470603 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
471604 #define __Pyx_sst_abs(value) labs(value)
472 #elif defined (_MSC_VER) && defined (_M_X64)
473 #define __Pyx_sst_abs(value) _abs64(value)
605 #elif defined (_MSC_VER)
606 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
474607 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
475608 #define __Pyx_sst_abs(value) llabs(value)
476609 #elif defined (__GNUC__)
478611 #else
479612 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
480613 #endif
481 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
482 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
614 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
615 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
483616 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
484617 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
485618 #define __Pyx_PyBytes_FromString PyBytes_FromString
492625 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
493626 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
494627 #endif
495 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
496 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
628 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
629 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
634 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
635 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
638 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
497639 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
498640 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
499641 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
500642 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
501643 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
502 #if PY_MAJOR_VERSION < 3
503 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
504 {
644 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
505645 const Py_UNICODE *u_end = u;
506646 while (*u_end++) ;
507647 return (size_t)(u_end - u - 1);
508648 }
509 #else
510 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
511 #endif
512649 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
513650 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
514651 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
515652 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
516653 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
517 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
654 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
518655 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
519656 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
657 #define __Pyx_PySequence_Tuple(obj)\
658 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
520659 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
521660 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
522661 #if CYTHON_ASSUME_SAFE_MACROS
615754 #define likely(x) (x)
616755 #define unlikely(x) (x)
617756 #endif /* __GNUC__ */
618
619 static PyObject *__pyx_m;
757 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
758
759 static PyObject *__pyx_m = NULL;
620760 static PyObject *__pyx_d;
621761 static PyObject *__pyx_b;
762 static PyObject *__pyx_cython_runtime = NULL;
622763 static PyObject *__pyx_empty_tuple;
623764 static PyObject *__pyx_empty_bytes;
624765 static PyObject *__pyx_empty_unicode;
630771
631772 static const char *__pyx_f[] = {
632773 "src/pygame_sdl2/display.pyx",
774 "stringsource",
633775 "src/pygame_sdl2/display.pxd",
634776 "src/pygame_sdl2/surface.pxd",
635777 "src/pygame_sdl2/rect.pxd",
636778 };
779 /* NoFastGil.proto */
780 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
781 #define __Pyx_PyGILState_Release PyGILState_Release
782 #define __Pyx_FastGIL_Remember()
783 #define __Pyx_FastGIL_Forget()
784 #define __Pyx_FastGilFuncInit()
785
786 /* ForceInitThreads.proto */
787 #ifndef __PYX_FORCE_INIT_THREADS
788 #define __PYX_FORCE_INIT_THREADS 0
789 #endif
790
637791
638792 /*--- Type declarations ---*/
639793 struct __pyx_obj_11pygame_sdl2_7surface_Surface;
790944
791945 /* PyObjectGetAttrStr.proto */
792946 #if CYTHON_USE_TYPE_SLOTS
793 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
794 PyTypeObject* tp = Py_TYPE(obj);
795 if (likely(tp->tp_getattro))
796 return tp->tp_getattro(obj, attr_name);
797 #if PY_MAJOR_VERSION < 3
798 if (likely(tp->tp_getattr))
799 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
800 #endif
801 return PyObject_GetAttr(obj, attr_name);
802 }
947 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
803948 #else
804949 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
805950 #endif
820965 const char* function_name);
821966
822967 /* unicode_tailmatch.proto */
823 static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr,
824 Py_ssize_t start, Py_ssize_t end, int direction);
825
826 /* PyObjectCall.proto */
827 #if CYTHON_COMPILING_IN_CPYTHON
828 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
829 #else
830 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
831 #endif
832
833 /* GetModuleGlobalName.proto */
834 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
835
836 /* PySequenceContains.proto */
837 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
838 int result = PySequence_Contains(seq, item);
839 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
840 }
968 static int __Pyx_PyUnicode_Tailmatch(
969 PyObject* s, PyObject* substr, Py_ssize_t start, Py_ssize_t end, int direction);
841970
842971 /* PyCFunctionFastCall.proto */
843972 #if CYTHON_FAST_PYCCALL
857986 #endif
858987 #endif
859988
989 /* PyObjectCall.proto */
990 #if CYTHON_COMPILING_IN_CPYTHON
991 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
992 #else
993 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
994 #endif
995
860996 /* PyObjectCallMethO.proto */
861997 #if CYTHON_COMPILING_IN_CPYTHON
862998 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
8651001 /* PyObjectCallOneArg.proto */
8661002 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
8671003
868 /* PyObjectCallNoArg.proto */
869 #if CYTHON_COMPILING_IN_CPYTHON
870 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
871 #else
872 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
873 #endif
874
875 /* PyThreadStateGet.proto */
876 #if CYTHON_FAST_THREAD_STATE
877 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
878 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
879 #else
880 #define __Pyx_PyThreadState_declare
881 #define __Pyx_PyThreadState_assign
882 #endif
883
884 /* PyErrFetchRestore.proto */
885 #if CYTHON_FAST_THREAD_STATE
886 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
887 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
888 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
889 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
890 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
891 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
892 #else
893 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
894 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
895 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
896 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
897 #endif
898
899 /* RaiseException.proto */
900 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
901
902 /* Import.proto */
903 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
904
905 /* SaveResetException.proto */
906 #if CYTHON_FAST_THREAD_STATE
907 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
908 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
909 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
910 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
911 #else
912 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
913 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
914 #endif
915
916 /* PyErrExceptionMatches.proto */
917 #if CYTHON_FAST_THREAD_STATE
918 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
919 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
920 #else
921 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
922 #endif
1004 /* GetModuleGlobalName.proto */
1005 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
1006
1007 /* PySequenceContains.proto */
1008 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
1009 int result = PySequence_Contains(seq, item);
1010 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1011 }
9231012
9241013 /* GetItemInt.proto */
9251014 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
9391028 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
9401029 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
9411030 int wraparound, int boundscheck);
942 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1031 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
9431032 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
9441033 int is_list, int wraparound, int boundscheck);
1034
1035 /* ObjectGetItem.proto */
1036 #if CYTHON_USE_TYPE_SLOTS
1037 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1038 #else
1039 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1040 #endif
1041
1042 /* PyObjectCallNoArg.proto */
1043 #if CYTHON_COMPILING_IN_CPYTHON
1044 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1045 #else
1046 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1047 #endif
1048
1049 /* PyThreadStateGet.proto */
1050 #if CYTHON_FAST_THREAD_STATE
1051 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1052 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1053 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1054 #else
1055 #define __Pyx_PyThreadState_declare
1056 #define __Pyx_PyThreadState_assign
1057 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1058 #endif
1059
1060 /* PyErrFetchRestore.proto */
1061 #if CYTHON_FAST_THREAD_STATE
1062 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1063 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1064 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1065 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1066 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1067 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1068 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1069 #if CYTHON_COMPILING_IN_CPYTHON
1070 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1071 #else
1072 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1073 #endif
1074 #else
1075 #define __Pyx_PyErr_Clear() PyErr_Clear()
1076 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1077 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1078 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1079 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1080 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1081 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1082 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1083 #endif
1084
1085 /* RaiseException.proto */
1086 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1087
1088 /* Import.proto */
1089 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1090
1091 /* SaveResetException.proto */
1092 #if CYTHON_FAST_THREAD_STATE
1093 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1094 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1095 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1096 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1097 #else
1098 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1099 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1100 #endif
1101
1102 /* PyErrExceptionMatches.proto */
1103 #if CYTHON_FAST_THREAD_STATE
1104 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1105 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1106 #else
1107 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1108 #endif
9451109
9461110 /* GetException.proto */
9471111 #if CYTHON_FAST_THREAD_STATE
9721136 #endif
9731137
9741138 /* ArgTypeTest.proto */
975 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
976 const char *name, int exact);
1139 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1140 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1141 __Pyx__ArgTypeTest(obj, type, name, exact))
1142 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
9771143
9781144 /* ExtTypeTest.proto */
9791145 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
9801146
9811147 /* PyObjectSetAttrStr.proto */
9821148 #if CYTHON_USE_TYPE_SLOTS
983 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
984 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
985 PyTypeObject* tp = Py_TYPE(obj);
986 if (likely(tp->tp_setattro))
987 return tp->tp_setattro(obj, attr_name, value);
988 #if PY_MAJOR_VERSION < 3
989 if (likely(tp->tp_setattr))
990 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
991 #endif
992 return PyObject_SetAttr(obj, attr_name, value);
993 }
1149 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1150 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
9941151 #else
9951152 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
9961153 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
10131170 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
10141171 #endif
10151172
1173 /* PyObject_GenericGetAttrNoDict.proto */
1174 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1175 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1176 #else
1177 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1178 #endif
1179
1180 /* PyObject_GenericGetAttr.proto */
1181 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1182 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1183 #else
1184 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1185 #endif
1186
1187 /* SetupReduce.proto */
1188 static int __Pyx_setup_reduce(PyObject* type_obj);
1189
10161190 /* GetVTable.proto */
10171191 static void* __Pyx_GetVtable(PyObject *dict);
10181192
10271201
10281202 /* CythonFunction.proto */
10291203 #define __Pyx_CyFunction_USED 1
1030 #include <structmember.h>
10311204 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
10321205 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
10331206 #define __Pyx_CYFUNCTION_CCLASS 0x04
10791252 PyObject *dict);
10801253 static int __pyx_CyFunction_init(void);
10811254
1255 /* SetNameInClass.proto */
1256 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
1257 #define __Pyx_SetNameInClass(ns, name, value)\
1258 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
1259 #elif CYTHON_COMPILING_IN_CPYTHON
1260 #define __Pyx_SetNameInClass(ns, name, value)\
1261 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
1262 #else
1263 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
1264 #endif
1265
10821266 /* Py3ClassCreate.proto */
10831267 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
10841268 PyObject *mkw, PyObject *modname, PyObject *doc);
10851269 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
10861270 PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
1271
1272 /* CLineInTraceback.proto */
1273 #ifdef CYTHON_CLINE_IN_TRACEBACK
1274 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1275 #else
1276 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1277 #endif
10871278
10881279 /* CodeObjectCache.proto */
10891280 typedef struct {
11161307 /* CIntToPy.proto */
11171308 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);
11181309
1119 /* ForceInitThreads.proto */
1120 #ifndef __PYX_FORCE_INIT_THREADS
1121 #define __PYX_FORCE_INIT_THREADS 0
1122 #endif
1123
11241310 /* CIntToPy.proto */
11251311 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value);
11261312
11381324
11391325 /* CIntFromPy.proto */
11401326 static CYTHON_INLINE SDL_GLattr __Pyx_PyInt_As_SDL_GLattr(PyObject *);
1327
1328 /* FastTypeChecks.proto */
1329 #if CYTHON_COMPILING_IN_CPYTHON
1330 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1331 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1332 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1333 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1334 #else
1335 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1336 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1337 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1338 #endif
1339 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
11411340
11421341 /* CheckBinaryVersion.proto */
11431342 static int __Pyx_check_binary_version(void);
11941393 static struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_11pygame_sdl2_7display_main_window = 0;
11951394 static SDL_Window *__pyx_f_11pygame_sdl2_7display_PyWindow_AsWindow(PyObject *); /*proto*/
11961395 #define __Pyx_MODULE_NAME "pygame_sdl2.display"
1396 extern int __pyx_module_is_main_pygame_sdl2__display;
11971397 int __pyx_module_is_main_pygame_sdl2__display = 0;
11981398
11991399 /* Implementation of 'pygame_sdl2.display' */
12011401 static PyObject *__pyx_builtin_ImportError;
12021402 static PyObject *__pyx_builtin_MemoryError;
12031403 static PyObject *__pyx_builtin_range;
1404 static PyObject *__pyx_builtin_TypeError;
12041405 static const char __pyx_k_0[] = "0";
12051406 static const char __pyx_k_i[] = "i";
12061407 static const char __pyx_k_t[] = "t";
12231424 static const char __pyx_k_init[] = "init";
12241425 static const char __pyx_k_main[] = "__main__";
12251426 static const char __pyx_k_mode[] = "mode";
1427 static const char __pyx_k_name[] = "__name__";
12261428 static const char __pyx_k_path[] = "path";
12271429 static const char __pyx_k_quit[] = "quit";
12281430 static const char __pyx_k_rect[] = "rect";
12511453 static const char __pyx_k_module[] = "__module__";
12521454 static const char __pyx_k_object[] = "object";
12531455 static const char __pyx_k_opengl[] = "opengl";
1456 static const char __pyx_k_reduce[] = "__reduce__";
12541457 static const char __pyx_k_resize[] = "resize";
12551458 static const char __pyx_k_shifts[] = "shifts";
12561459 static const char __pyx_k_update[] = "update";
12701473 static const char __pyx_k_get_hint[] = "_get_hint";
12711474 static const char __pyx_k_get_init[] = "get_init";
12721475 static const char __pyx_k_get_size[] = "get_size";
1476 static const char __pyx_k_getstate[] = "__getstate__";
12731477 static const char __pyx_k_pyx_capi[] = "__pyx_capi__";
12741478 static const char __pyx_k_qualname[] = "__qualname__";
12751479 static const char __pyx_k_set_icon[] = "set_icon";
12761480 static const char __pyx_k_set_mode[] = "set_mode";
1481 static const char __pyx_k_setstate[] = "__setstate__";
12771482 static const char __pyx_k_warnings[] = "warnings";
1483 static const char __pyx_k_TypeError[] = "TypeError";
12781484 static const char __pyx_k_blit_hw_A[] = "blit_hw_A";
12791485 static const char __pyx_k_blit_sw_A[] = "blit_sw_A";
12801486 static const char __pyx_k_current_h[] = "current_h";
12841490 static const char __pyx_k_main_done[] = "main_done";
12851491 static const char __pyx_k_metaclass[] = "__metaclass__";
12861492 static const char __pyx_k_num_modes[] = "num_modes";
1493 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
12871494 static const char __pyx_k_set_gamma[] = "set_gamma";
12881495 static const char __pyx_k_video_mem[] = "video_mem";
12891496 static const char __pyx_k_PYGAME_IOS[] = "PYGAME_IOS";
13151522 static const char __pyx_k_refresh_rate[] = "refresh_rate";
13161523 static const char __pyx_k_default_title[] = "default_title";
13171524 static const char __pyx_k_pygame_window[] = "pygame window";
1525 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
13181526 static const char __pyx_k_register_init[] = "register_init";
13191527 static const char __pyx_k_register_quit[] = "register_quit";
13201528 static const char __pyx_k_sdl_main_init[] = "sdl_main_init";
13221530 static const char __pyx_k_set_gamma_ramp[] = "set_gamma_ramp";
13231531 static const char __pyx_k_GL_SWAP_CONTROL[] = "GL_SWAP_CONTROL";
13241532 static const char __pyx_k_gl_load_library[] = "gl_load_library";
1533 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
13251534 static const char __pyx_k_get_window_flags[] = "get_window_flags";
13261535 static const char __pyx_k_gl_get_attribute[] = "gl_get_attribute";
13271536 static const char __pyx_k_gl_set_attribute[] = "gl_set_attribute";
13291538 static const char __pyx_k_gl_unload_library[] = "gl_unload_library";
13301539 static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error";
13311540 static const char __pyx_k_toggle_fullscreen[] = "toggle_fullscreen";
1541 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
13321542 static const char __pyx_k_get_display_bounds[] = "get_display_bounds";
13331543 static const char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals";
13341544 static const char __pyx_k_shown_first_window[] = "_shown_first_window";
13421552 static const char __pyx_k_src_pygame_sdl2_display_pyx[] = "src/pygame_sdl2/display.pyx";
13431553 static const char __pyx_k_Couldn_t_allocate_rectangles[] = "Couldn't allocate rectangles.";
13441554 static const char __pyx_k_SDL_VIDEO_MAC_FULLSCREEN_SPACES[] = "SDL_VIDEO_MAC_FULLSCREEN_SPACES";
1555 static const char __pyx_k_self_gl_context_self_window_self[] = "self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling";
13451556 static PyObject *__pyx_kp_u_0;
13461557 static PyObject *__pyx_kp_u_Couldn_t_allocate_rectangles;
13471558 static PyObject *__pyx_n_s_GL_SWAP_CONTROL;
13561567 static PyObject *__pyx_n_u_PYGAME_SDL2_AVOID_GL;
13571568 static PyObject *__pyx_n_u_SDL_VIDEO_MAC_FULLSCREEN_SPACES;
13581569 static PyObject *__pyx_n_s_SRCALPHA;
1570 static PyObject *__pyx_n_s_TypeError;
13591571 static PyObject *__pyx_n_s_androidembed;
13601572 static PyObject *__pyx_n_s_before_first_window;
13611573 static PyObject *__pyx_n_s_bitsize;
13671579 static PyObject *__pyx_n_s_blit_sw_CC;
13681580 static PyObject *__pyx_n_s_blue;
13691581 static PyObject *__pyx_n_s_bytesize;
1582 static PyObject *__pyx_n_s_cline_in_traceback;
13701583 static PyObject *__pyx_n_s_close_window;
13711584 static PyObject *__pyx_n_s_copy;
13721585 static PyObject *__pyx_n_s_create_surface;
14051618 static PyObject *__pyx_n_s_get_window;
14061619 static PyObject *__pyx_n_s_get_window_flags;
14071620 static PyObject *__pyx_n_s_get_wm_info;
1621 static PyObject *__pyx_n_s_getstate;
14081622 static PyObject *__pyx_n_s_gl_get_attribute;
14091623 static PyObject *__pyx_n_s_gl_load_library;
14101624 static PyObject *__pyx_n_s_gl_reset_attributes;
14321646 static PyObject *__pyx_n_s_mode;
14331647 static PyObject *__pyx_n_s_mode_ok;
14341648 static PyObject *__pyx_n_s_module;
1649 static PyObject *__pyx_n_s_name;
14351650 static PyObject *__pyx_n_s_num_modes;
14361651 static PyObject *__pyx_n_s_object;
14371652 static PyObject *__pyx_n_s_opengl;
14541669 static PyObject *__pyx_n_s_rect;
14551670 static PyObject *__pyx_n_s_rectangles;
14561671 static PyObject *__pyx_n_s_red;
1672 static PyObject *__pyx_n_s_reduce;
1673 static PyObject *__pyx_n_s_reduce_cython;
1674 static PyObject *__pyx_n_s_reduce_ex;
14571675 static PyObject *__pyx_n_s_refresh_rate;
14581676 static PyObject *__pyx_n_s_register_init;
14591677 static PyObject *__pyx_n_s_register_quit;
14631681 static PyObject *__pyx_n_s_rv;
14641682 static PyObject *__pyx_n_s_sdl_main_init;
14651683 static PyObject *__pyx_n_s_self;
1684 static PyObject *__pyx_kp_s_self_gl_context_self_window_self;
14661685 static PyObject *__pyx_n_s_set_caption;
14671686 static PyObject *__pyx_n_s_set_gamma;
14681687 static PyObject *__pyx_n_s_set_gamma_ramp;
14691688 static PyObject *__pyx_n_s_set_icon;
14701689 static PyObject *__pyx_n_s_set_mode;
1690 static PyObject *__pyx_n_s_setstate;
1691 static PyObject *__pyx_n_s_setstate_cython;
14711692 static PyObject *__pyx_n_s_shifts;
14721693 static PyObject *__pyx_n_s_shown_first_window;
14731694 static PyObject *__pyx_n_s_size;
15111732 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_7surface___get__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
15121733 static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_2__set__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
15131734 static int __pyx_pf_11pygame_sdl2_7display_6Window_7surface_4__del__(struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
1735 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_36__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self); /* proto */
1736 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_38__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
15141737 static PyObject *__pyx_pf_11pygame_sdl2_7display_14set_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_resolution, PyObject *__pyx_v_flags, PyObject *__pyx_v_depth, PyObject *__pyx_v_pos); /* proto */
15151738 static PyObject *__pyx_pf_11pygame_sdl2_7display_16get_surface(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
15161739 static PyObject *__pyx_pf_11pygame_sdl2_7display_18get_window(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
15461769 static PyObject *__pyx_int_32;
15471770 static PyObject *__pyx_int_268435456;
15481771 static PyObject *__pyx_k__5;
1549 static PyObject *__pyx_k__12;
1772 static PyObject *__pyx_k__14;
15501773 static PyObject *__pyx_tuple_;
15511774 static PyObject *__pyx_tuple__2;
15521775 static PyObject *__pyx_tuple__3;
15571780 static PyObject *__pyx_tuple__9;
15581781 static PyObject *__pyx_tuple__10;
15591782 static PyObject *__pyx_tuple__11;
1783 static PyObject *__pyx_tuple__12;
15601784 static PyObject *__pyx_tuple__13;
15611785 static PyObject *__pyx_tuple__15;
1562 static PyObject *__pyx_tuple__21;
1786 static PyObject *__pyx_tuple__17;
15631787 static PyObject *__pyx_tuple__23;
1564 static PyObject *__pyx_tuple__28;
1788 static PyObject *__pyx_tuple__25;
15651789 static PyObject *__pyx_tuple__30;
15661790 static PyObject *__pyx_tuple__32;
15671791 static PyObject *__pyx_tuple__34;
1792 static PyObject *__pyx_tuple__35;
15681793 static PyObject *__pyx_tuple__37;
1569 static PyObject *__pyx_tuple__39;
1570 static PyObject *__pyx_tuple__41;
1794 static PyObject *__pyx_tuple__40;
1795 static PyObject *__pyx_tuple__42;
15711796 static PyObject *__pyx_tuple__44;
1572 static PyObject *__pyx_tuple__46;
1573 static PyObject *__pyx_tuple__48;
1574 static PyObject *__pyx_tuple__54;
1575 static PyObject *__pyx_tuple__56;
1576 static PyObject *__pyx_tuple__58;
1577 static PyObject *__pyx_tuple__60;
1578 static PyObject *__pyx_tuple__64;
1579 static PyObject *__pyx_tuple__66;
1580 static PyObject *__pyx_codeobj__14;
1797 static PyObject *__pyx_tuple__47;
1798 static PyObject *__pyx_tuple__49;
1799 static PyObject *__pyx_tuple__51;
1800 static PyObject *__pyx_tuple__57;
1801 static PyObject *__pyx_tuple__59;
1802 static PyObject *__pyx_tuple__61;
1803 static PyObject *__pyx_tuple__63;
1804 static PyObject *__pyx_tuple__67;
1805 static PyObject *__pyx_tuple__69;
15811806 static PyObject *__pyx_codeobj__16;
1582 static PyObject *__pyx_codeobj__17;
15831807 static PyObject *__pyx_codeobj__18;
15841808 static PyObject *__pyx_codeobj__19;
15851809 static PyObject *__pyx_codeobj__20;
1810 static PyObject *__pyx_codeobj__21;
15861811 static PyObject *__pyx_codeobj__22;
15871812 static PyObject *__pyx_codeobj__24;
1588 static PyObject *__pyx_codeobj__25;
15891813 static PyObject *__pyx_codeobj__26;
15901814 static PyObject *__pyx_codeobj__27;
1815 static PyObject *__pyx_codeobj__28;
15911816 static PyObject *__pyx_codeobj__29;
15921817 static PyObject *__pyx_codeobj__31;
15931818 static PyObject *__pyx_codeobj__33;
1594 static PyObject *__pyx_codeobj__35;
15951819 static PyObject *__pyx_codeobj__36;
15961820 static PyObject *__pyx_codeobj__38;
1597 static PyObject *__pyx_codeobj__40;
1598 static PyObject *__pyx_codeobj__42;
1821 static PyObject *__pyx_codeobj__39;
1822 static PyObject *__pyx_codeobj__41;
15991823 static PyObject *__pyx_codeobj__43;
16001824 static PyObject *__pyx_codeobj__45;
1601 static PyObject *__pyx_codeobj__47;
1602 static PyObject *__pyx_codeobj__49;
1825 static PyObject *__pyx_codeobj__46;
1826 static PyObject *__pyx_codeobj__48;
16031827 static PyObject *__pyx_codeobj__50;
1604 static PyObject *__pyx_codeobj__51;
16051828 static PyObject *__pyx_codeobj__52;
16061829 static PyObject *__pyx_codeobj__53;
1830 static PyObject *__pyx_codeobj__54;
16071831 static PyObject *__pyx_codeobj__55;
1608 static PyObject *__pyx_codeobj__57;
1609 static PyObject *__pyx_codeobj__59;
1610 static PyObject *__pyx_codeobj__61;
1832 static PyObject *__pyx_codeobj__56;
1833 static PyObject *__pyx_codeobj__58;
1834 static PyObject *__pyx_codeobj__60;
16111835 static PyObject *__pyx_codeobj__62;
1612 static PyObject *__pyx_codeobj__63;
1836 static PyObject *__pyx_codeobj__64;
16131837 static PyObject *__pyx_codeobj__65;
1614 static PyObject *__pyx_codeobj__67;
1838 static PyObject *__pyx_codeobj__66;
16151839 static PyObject *__pyx_codeobj__68;
1840 static PyObject *__pyx_codeobj__70;
1841 static PyObject *__pyx_codeobj__71;
1842 /* Late includes */
16161843
16171844 /* "pygame_sdl2/display.pyx":40
16181845 * _pygame_hints = { }
16391866 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16401867 switch (pos_args) {
16411868 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1869 CYTHON_FALLTHROUGH;
16421870 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1871 CYTHON_FALLTHROUGH;
16431872 case 0: break;
16441873 default: goto __pyx_L5_argtuple_error;
16451874 }
16461875 kw_args = PyDict_Size(__pyx_kwds);
16471876 switch (pos_args) {
16481877 case 0:
1649 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hint)) != 0)) kw_args--;
1878 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hint)) != 0)) kw_args--;
16501879 else goto __pyx_L5_argtuple_error;
1880 CYTHON_FALLTHROUGH;
16511881 case 1:
1652 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
1882 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
16531883 else {
16541884 __Pyx_RaiseArgtupleInvalid("hint", 1, 2, 2, 1); __PYX_ERR(0, 40, __pyx_L3_error)
16551885 }
16851915 PyObject *__pyx_r = NULL;
16861916 __Pyx_RefNannyDeclarations
16871917 PyObject *__pyx_t_1 = NULL;
1688 PyObject *__pyx_t_2 = NULL;
1689 int __pyx_t_3;
1918 int __pyx_t_2;
1919 PyObject *__pyx_t_3 = NULL;
16901920 PyObject *__pyx_t_4 = NULL;
1691 PyObject *__pyx_t_5 = NULL;
1692 int __pyx_t_6;
1921 int __pyx_t_5;
1922 char const *__pyx_t_6;
16931923 char const *__pyx_t_7;
1694 char const *__pyx_t_8;
16951924 __Pyx_RefNannySetupContext("hint", 0);
16961925 __Pyx_INCREF(__pyx_v_hint);
16971926 __Pyx_INCREF(__pyx_v_value);
17031932 * _pygame_hints[str(hint)] = str(value)
17041933 * return
17051934 */
1706 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
1935 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_hint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
17071936 __Pyx_GOTREF(__pyx_t_1);
1708 __Pyx_INCREF(__pyx_v_hint);
1709 __Pyx_GIVEREF(__pyx_v_hint);
1710 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_hint);
1711 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
1712 __Pyx_GOTREF(__pyx_t_2);
1937 __pyx_t_2 = __Pyx_PyUnicode_Tailmatch(__pyx_t_1, __pyx_n_u_PYGAME_SDL2, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 42, __pyx_L1_error)
17131938 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1714 __pyx_t_3 = __Pyx_PyUnicode_Tailmatch(__pyx_t_2, __pyx_n_u_PYGAME_SDL2, 0, PY_SSIZE_T_MAX, -1); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 42, __pyx_L1_error)
1715 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1716 if ((__pyx_t_3 != 0)) {
1939 if ((__pyx_t_2 != 0)) {
17171940
17181941 /* "pygame_sdl2/display.pyx":43
17191942 *
17221945 * return
17231946 *
17241947 */
1725 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
1726 __Pyx_GOTREF(__pyx_t_2);
1727 __Pyx_INCREF(__pyx_v_value);
1728 __Pyx_GIVEREF(__pyx_v_value);
1729 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_value);
1730 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
1948 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
17311949 __Pyx_GOTREF(__pyx_t_1);
1732 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1733 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_hints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
1734 __Pyx_GOTREF(__pyx_t_2);
1735 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 43, __pyx_L1_error)
1950 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_hints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
1951 __Pyx_GOTREF(__pyx_t_3);
1952 __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_hint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 43, __pyx_L1_error)
17361953 __Pyx_GOTREF(__pyx_t_4);
1737 __Pyx_INCREF(__pyx_v_hint);
1738 __Pyx_GIVEREF(__pyx_v_hint);
1739 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_hint);
1740 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 43, __pyx_L1_error)
1741 __Pyx_GOTREF(__pyx_t_5);
1954 if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_t_4, __pyx_t_1) < 0)) __PYX_ERR(0, 43, __pyx_L1_error)
1955 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17421956 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1743 if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 43, __pyx_L1_error)
1744 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1745 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17461957 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17471958
17481959 /* "pygame_sdl2/display.pyx":44
17721983 * hint = hint.encode("utf-8")
17731984 *
17741985 */
1775 __pyx_t_3 = PyBytes_Check(__pyx_v_hint);
1776 __pyx_t_6 = ((!(__pyx_t_3 != 0)) != 0);
1777 if (__pyx_t_6) {
1986 __pyx_t_2 = PyBytes_Check(__pyx_v_hint);
1987 __pyx_t_5 = ((!(__pyx_t_2 != 0)) != 0);
1988 if (__pyx_t_5) {
17781989
17791990 /* "pygame_sdl2/display.pyx":48
17801991 *
17851996 */
17861997 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_hint, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
17871998 __Pyx_GOTREF(__pyx_t_1);
1788 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 48, __pyx_L1_error)
1789 __Pyx_GOTREF(__pyx_t_5);
1999 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 48, __pyx_L1_error)
2000 __Pyx_GOTREF(__pyx_t_4);
17902001 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1791 __Pyx_DECREF_SET(__pyx_v_hint, __pyx_t_5);
1792 __pyx_t_5 = 0;
2002 __Pyx_DECREF_SET(__pyx_v_hint, __pyx_t_4);
2003 __pyx_t_4 = 0;
17932004
17942005 /* "pygame_sdl2/display.pyx":47
17952006 *
18072018 * value = value.encode("utf-8")
18082019 *
18092020 */
1810 __pyx_t_6 = PyBytes_Check(__pyx_v_value);
1811 __pyx_t_3 = ((!(__pyx_t_6 != 0)) != 0);
1812 if (__pyx_t_3) {
2021 __pyx_t_5 = PyBytes_Check(__pyx_v_value);
2022 __pyx_t_2 = ((!(__pyx_t_5 != 0)) != 0);
2023 if (__pyx_t_2) {
18132024
18142025 /* "pygame_sdl2/display.pyx":51
18152026 *
18182029 *
18192030 * SDL_SetHint(hint, value)
18202031 */
1821 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error)
1822 __Pyx_GOTREF(__pyx_t_5);
1823 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
2032 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error)
2033 __Pyx_GOTREF(__pyx_t_4);
2034 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
18242035 __Pyx_GOTREF(__pyx_t_1);
1825 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2036 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18262037 __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1);
18272038 __pyx_t_1 = 0;
18282039
18422053 *
18432054 * def _get_hint(hint, default):
18442055 */
1845 __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_hint); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L1_error)
1846 __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_value); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L1_error)
1847 SDL_SetHint(__pyx_t_7, __pyx_t_8);
2056 __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_hint); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L1_error)
2057 __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_value); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L1_error)
2058 (void)(SDL_SetHint(__pyx_t_6, __pyx_t_7));
18482059
18492060 /* "pygame_sdl2/display.pyx":40
18502061 * _pygame_hints = { }
18592070 goto __pyx_L0;
18602071 __pyx_L1_error:;
18612072 __Pyx_XDECREF(__pyx_t_1);
1862 __Pyx_XDECREF(__pyx_t_2);
2073 __Pyx_XDECREF(__pyx_t_3);
18632074 __Pyx_XDECREF(__pyx_t_4);
1864 __Pyx_XDECREF(__pyx_t_5);
18652075 __Pyx_AddTraceback("pygame_sdl2.display.hint", __pyx_clineno, __pyx_lineno, __pyx_filename);
18662076 __pyx_r = NULL;
18672077 __pyx_L0:;
18972107 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18982108 switch (pos_args) {
18992109 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2110 CYTHON_FALLTHROUGH;
19002111 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2112 CYTHON_FALLTHROUGH;
19012113 case 0: break;
19022114 default: goto __pyx_L5_argtuple_error;
19032115 }
19042116 kw_args = PyDict_Size(__pyx_kwds);
19052117 switch (pos_args) {
19062118 case 0:
1907 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hint)) != 0)) kw_args--;
2119 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hint)) != 0)) kw_args--;
19082120 else goto __pyx_L5_argtuple_error;
2121 CYTHON_FALLTHROUGH;
19092122 case 1:
1910 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default)) != 0)) kw_args--;
2123 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default)) != 0)) kw_args--;
19112124 else {
19122125 __Pyx_RaiseArgtupleInvalid("_get_hint", 1, 2, 2, 1); __PYX_ERR(0, 55, __pyx_L3_error)
19132126 }
19432156 PyObject *__pyx_r = NULL;
19442157 __Pyx_RefNannyDeclarations
19452158 PyObject *__pyx_t_1 = NULL;
1946 PyObject *__pyx_t_2 = NULL;
2159 int __pyx_t_2;
19472160 int __pyx_t_3;
1948 int __pyx_t_4;
2161 PyObject *__pyx_t_4 = NULL;
19492162 __Pyx_RefNannySetupContext("_get_hint", 0);
19502163 __Pyx_INCREF(__pyx_v_hint);
19512164
19562169 *
19572170 * if hint in _pygame_hints:
19582171 */
1959 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
2172 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_hint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
19602173 __Pyx_GOTREF(__pyx_t_1);
1961 __Pyx_INCREF(__pyx_v_hint);
1962 __Pyx_GIVEREF(__pyx_v_hint);
1963 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_hint);
1964 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
1965 __Pyx_GOTREF(__pyx_t_2);
1966 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1967 __Pyx_DECREF_SET(__pyx_v_hint, __pyx_t_2);
1968 __pyx_t_2 = 0;
2174 __Pyx_DECREF_SET(__pyx_v_hint, __pyx_t_1);
2175 __pyx_t_1 = 0;
19692176
19702177 /* "pygame_sdl2/display.pyx":58
19712178 * hint = str(hint)
19742181 * return _pygame_hints[hint]
19752182 *
19762183 */
1977 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_hints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
1978 __Pyx_GOTREF(__pyx_t_2);
1979 __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_hint, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 58, __pyx_L1_error)
1980 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1981 __pyx_t_4 = (__pyx_t_3 != 0);
1982 if (__pyx_t_4) {
2184 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_hints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
2185 __Pyx_GOTREF(__pyx_t_1);
2186 __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_hint, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 58, __pyx_L1_error)
2187 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2188 __pyx_t_3 = (__pyx_t_2 != 0);
2189 if (__pyx_t_3) {
19832190
19842191 /* "pygame_sdl2/display.pyx":59
19852192 *
19892196 * if hint in os.environ:
19902197 */
19912198 __Pyx_XDECREF(__pyx_r);
1992 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_hints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
1993 __Pyx_GOTREF(__pyx_t_2);
1994 __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_v_hint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error)
2199 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_hints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error)
19952200 __Pyx_GOTREF(__pyx_t_1);
1996 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2201 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_hint); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 59, __pyx_L1_error)
2202 __Pyx_GOTREF(__pyx_t_4);
2203 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2204 __pyx_r = __pyx_t_4;
2205 __pyx_t_4 = 0;
2206 goto __pyx_L0;
2207
2208 /* "pygame_sdl2/display.pyx":58
2209 * hint = str(hint)
2210 *
2211 * if hint in _pygame_hints: # <<<<<<<<<<<<<<
2212 * return _pygame_hints[hint]
2213 *
2214 */
2215 }
2216
2217 /* "pygame_sdl2/display.pyx":61
2218 * return _pygame_hints[hint]
2219 *
2220 * if hint in os.environ: # <<<<<<<<<<<<<<
2221 * return os.environ[hint]
2222 *
2223 */
2224 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 61, __pyx_L1_error)
2225 __Pyx_GOTREF(__pyx_t_4);
2226 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_environ); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
2227 __Pyx_GOTREF(__pyx_t_1);
2228 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2229 __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_hint, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 61, __pyx_L1_error)
2230 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2231 __pyx_t_2 = (__pyx_t_3 != 0);
2232 if (__pyx_t_2) {
2233
2234 /* "pygame_sdl2/display.pyx":62
2235 *
2236 * if hint in os.environ:
2237 * return os.environ[hint] # <<<<<<<<<<<<<<
2238 *
2239 * return default
2240 */
2241 __Pyx_XDECREF(__pyx_r);
2242 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
2243 __Pyx_GOTREF(__pyx_t_1);
2244 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_environ); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error)
2245 __Pyx_GOTREF(__pyx_t_4);
2246 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2247 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_hint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
2248 __Pyx_GOTREF(__pyx_t_1);
2249 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19972250 __pyx_r = __pyx_t_1;
19982251 __pyx_t_1 = 0;
1999 goto __pyx_L0;
2000
2001 /* "pygame_sdl2/display.pyx":58
2002 * hint = str(hint)
2003 *
2004 * if hint in _pygame_hints: # <<<<<<<<<<<<<<
2005 * return _pygame_hints[hint]
2006 *
2007 */
2008 }
2009
2010 /* "pygame_sdl2/display.pyx":61
2011 * return _pygame_hints[hint]
2012 *
2013 * if hint in os.environ: # <<<<<<<<<<<<<<
2014 * return os.environ[hint]
2015 *
2016 */
2017 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
2018 __Pyx_GOTREF(__pyx_t_1);
2019 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_environ); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error)
2020 __Pyx_GOTREF(__pyx_t_2);
2021 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2022 __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_hint, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 61, __pyx_L1_error)
2023 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2024 __pyx_t_3 = (__pyx_t_4 != 0);
2025 if (__pyx_t_3) {
2026
2027 /* "pygame_sdl2/display.pyx":62
2028 *
2029 * if hint in os.environ:
2030 * return os.environ[hint] # <<<<<<<<<<<<<<
2031 *
2032 * return default
2033 */
2034 __Pyx_XDECREF(__pyx_r);
2035 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
2036 __Pyx_GOTREF(__pyx_t_2);
2037 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_environ); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
2038 __Pyx_GOTREF(__pyx_t_1);
2039 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2040 __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_hint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
2041 __Pyx_GOTREF(__pyx_t_2);
2042 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2043 __pyx_r = __pyx_t_2;
2044 __pyx_t_2 = 0;
20452252 goto __pyx_L0;
20462253
20472254 /* "pygame_sdl2/display.pyx":61
20762283 /* function exit code */
20772284 __pyx_L1_error:;
20782285 __Pyx_XDECREF(__pyx_t_1);
2079 __Pyx_XDECREF(__pyx_t_2);
2286 __Pyx_XDECREF(__pyx_t_4);
20802287 __Pyx_AddTraceback("pygame_sdl2.display._get_hint", __pyx_clineno, __pyx_lineno, __pyx_filename);
20812288 __pyx_r = NULL;
20822289 __pyx_L0:;
21672374 *
21682375 */
21692376 __pyx_t_2 = (SDL_Init(0) != 0);
2170 if (__pyx_t_2) {
2377 if (unlikely(__pyx_t_2)) {
21712378
21722379 /* "pygame_sdl2/display.pyx":78
21732380 *
23562563 *
23572564 */
23582565 __pyx_t_2 = (SDL_InitSubSystem(SDL_INIT_VIDEO) != 0);
2359 if (__pyx_t_2) {
2566 if (unlikely(__pyx_t_2)) {
23602567
23612568 /* "pygame_sdl2/display.pyx":96
23622569 *
27953002 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27963003 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27973004 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2798 goto __pyx_L11_try_end;
3005 goto __pyx_L9_try_end;
27993006 __pyx_L4_error:;
2800 __Pyx_PyThreadState_assign
28013007 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
28023008 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
28033009 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
28243030 * import androidembed
28253031 * androidembed.close_window()
28263032 */
2827 __Pyx_PyThreadState_assign
28283033 __Pyx_XGIVEREF(__pyx_t_3);
28293034 __Pyx_XGIVEREF(__pyx_t_4);
28303035 __Pyx_XGIVEREF(__pyx_t_5);
28313036 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
28323037 goto __pyx_L1_error;
28333038 __pyx_L5_exception_handled:;
2834 __Pyx_PyThreadState_assign
28353039 __Pyx_XGIVEREF(__pyx_t_3);
28363040 __Pyx_XGIVEREF(__pyx_t_4);
28373041 __Pyx_XGIVEREF(__pyx_t_5);
28383042 __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
2839 __pyx_L11_try_end:;
3043 __pyx_L9_try_end:;
28403044 }
28413045
28423046 /* "pygame_sdl2/display.pyx":127
28943098 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
28953099 switch (pos_args) {
28963100 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3101 CYTHON_FALLTHROUGH;
28973102 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3103 CYTHON_FALLTHROUGH;
28983104 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3105 CYTHON_FALLTHROUGH;
28993106 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3107 CYTHON_FALLTHROUGH;
29003108 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3109 CYTHON_FALLTHROUGH;
29013110 case 0: break;
29023111 default: goto __pyx_L5_argtuple_error;
29033112 }
29043113 kw_args = PyDict_Size(__pyx_kwds);
29053114 switch (pos_args) {
29063115 case 0:
2907 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_title)) != 0)) kw_args--;
3116 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_title)) != 0)) kw_args--;
29083117 else goto __pyx_L5_argtuple_error;
3118 CYTHON_FALLTHROUGH;
29093119 case 1:
29103120 if (kw_args > 0) {
2911 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_resolution);
3121 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_resolution);
29123122 if (value) { values[1] = value; kw_args--; }
29133123 }
3124 CYTHON_FALLTHROUGH;
29143125 case 2:
29153126 if (kw_args > 0) {
2916 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags);
3127 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags);
29173128 if (value) { values[2] = value; kw_args--; }
29183129 }
3130 CYTHON_FALLTHROUGH;
29193131 case 3:
29203132 if (kw_args > 0) {
2921 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_depth);
3133 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_depth);
29223134 if (value) { values[3] = value; kw_args--; }
29233135 }
3136 CYTHON_FALLTHROUGH;
29243137 case 4:
29253138 if (kw_args > 0) {
2926 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos);
3139 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pos);
29273140 if (value) { values[4] = value; kw_args--; }
29283141 }
29293142 }
29333146 } else {
29343147 switch (PyTuple_GET_SIZE(__pyx_args)) {
29353148 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3149 CYTHON_FALLTHROUGH;
29363150 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3151 CYTHON_FALLTHROUGH;
29373152 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3153 CYTHON_FALLTHROUGH;
29383154 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3155 CYTHON_FALLTHROUGH;
29393156 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
29403157 break;
29413158 default: goto __pyx_L5_argtuple_error;
31753392 *
31763393 */
31773394 __pyx_t_2 = ((!(__pyx_v_self->window != 0)) != 0);
3178 if (__pyx_t_2) {
3395 if (unlikely(__pyx_t_2)) {
31793396
31803397 /* "pygame_sdl2/display.pyx":168
31813398 *
32663483 *
32673484 */
32683485 __pyx_t_2 = ((__pyx_v_self->gl_context == NULL) != 0);
3269 if (__pyx_t_2) {
3486 if (unlikely(__pyx_t_2)) {
32703487
32713488 /* "pygame_sdl2/display.pyx":180
32723489 *
33503567 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
33513568 __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 187, __pyx_L6_error)
33523569 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3353 SDL_GL_SetSwapInterval(__pyx_t_11);
3570 (void)(SDL_GL_SetSwapInterval(__pyx_t_11));
33543571
33553572 /* "pygame_sdl2/display.pyx":186
33563573 * # to deal with the case where the negative interval isn't
34193636 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
34203637 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
34213638 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
3422 goto __pyx_L13_try_end;
3639 goto __pyx_L11_try_end;
34233640 __pyx_L6_error:;
3424 __Pyx_PyThreadState_assign
34253641 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
34263642 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
34273643 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
34923708 *
34933709 * if flags & SDL_WINDOW_OPENGL:
34943710 */
3495 __Pyx_PyThreadState_assign
34963711 __Pyx_XGIVEREF(__pyx_t_12);
34973712 __Pyx_XGIVEREF(__pyx_t_13);
34983713 __Pyx_XGIVEREF(__pyx_t_14);
34993714 __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
35003715 goto __pyx_L1_error;
3501 __pyx_L13_try_end:;
3716 __pyx_L11_try_end:;
35023717 }
35033718
35043719 /* "pygame_sdl2/display.pyx":146
39424157 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
39434158 switch (pos_args) {
39444159 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4160 CYTHON_FALLTHROUGH;
39454161 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4162 CYTHON_FALLTHROUGH;
39464163 case 0: break;
39474164 default: goto __pyx_L5_argtuple_error;
39484165 }
39494166 kw_args = PyDict_Size(__pyx_kwds);
39504167 switch (pos_args) {
39514168 case 0:
3952 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
4169 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
39534170 else goto __pyx_L5_argtuple_error;
4171 CYTHON_FALLTHROUGH;
39544172 case 1:
39554173 if (kw_args > 0) {
3956 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_opengl);
4174 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_opengl);
39574175 if (value) { values[1] = value; kw_args--; }
39584176 }
39594177 }
39634181 } else {
39644182 switch (PyTuple_GET_SIZE(__pyx_args)) {
39654183 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4184 CYTHON_FALLTHROUGH;
39664185 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
39674186 break;
39684187 default: goto __pyx_L5_argtuple_error;
40904309 */
40914310 if ((likely(PyTuple_CheckExact(__pyx_v_size))) || (PyList_CheckExact(__pyx_v_size))) {
40924311 PyObject* sequence = __pyx_v_size;
4093 #if !CYTHON_COMPILING_IN_PYPY
4094 Py_ssize_t size = Py_SIZE(sequence);
4095 #else
4096 Py_ssize_t size = PySequence_Size(sequence);
4097 #endif
4312 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
40984313 if (unlikely(size != 2)) {
40994314 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
41004315 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
42334448 *
42344449 */
42354450 __pyx_t_1 = ((__pyx_v_self->gl_context == NULL) != 0);
4236 if (__pyx_t_1) {
4451 if (unlikely(__pyx_t_1)) {
42374452
42384453 /* "pygame_sdl2/display.pyx":280
42394454 *
44994714 *
45004715 * def flip(self):
45014716 */
4502 SDL_UpperBlit(__pyx_v_self->surface->surface, NULL, __pyx_v_self->window_surface, NULL);
4717 (void)(SDL_UpperBlit(__pyx_v_self->surface->surface, NULL, __pyx_v_self->window_surface, NULL));
45034718
45044719 /* "pygame_sdl2/display.pyx":294
45054720 * return rv
45674782 #ifdef WITH_THREAD
45684783 PyThreadState *_save;
45694784 Py_UNBLOCK_THREADS
4785 __Pyx_FastGIL_Remember();
45704786 #endif
45714787 /*try:*/ {
45724788
45904806 /*finally:*/ {
45914807 /*normal exit:*/{
45924808 #ifdef WITH_THREAD
4809 __Pyx_FastGIL_Forget();
45934810 Py_BLOCK_THREADS
45944811 #endif
45954812 goto __pyx_L6;
46684885 #ifdef WITH_THREAD
46694886 PyThreadState *_save;
46704887 Py_UNBLOCK_THREADS
4888 __Pyx_FastGIL_Remember();
46714889 #endif
46724890 /*try:*/ {
46734891
46784896 *
46794897 * def get_surface(self):
46804898 */
4681 SDL_UpdateWindowSurface(__pyx_v_self->window);
4899 (void)(SDL_UpdateWindowSurface(__pyx_v_self->window));
46824900 }
46834901
46844902 /* "pygame_sdl2/display.pyx":306
46914909 /*finally:*/ {
46924910 /*normal exit:*/{
46934911 #ifdef WITH_THREAD
4912 __Pyx_FastGIL_Forget();
46944913 Py_BLOCK_THREADS
46954914 #endif
46964915 goto __pyx_L10;
48015020 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
48025021 switch (pos_args) {
48035022 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5023 CYTHON_FALLTHROUGH;
48045024 case 0: break;
48055025 default: goto __pyx_L5_argtuple_error;
48065026 }
48085028 switch (pos_args) {
48095029 case 0:
48105030 if (kw_args > 0) {
4811 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rectangles);
5031 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rectangles);
48125032 if (value) { values[0] = value; kw_args--; }
48135033 }
48145034 }
48185038 } else {
48195039 switch (PyTuple_GET_SIZE(__pyx_args)) {
48205040 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5041 CYTHON_FALLTHROUGH;
48215042 case 0: break;
48225043 default: goto __pyx_L5_argtuple_error;
48235044 }
50235244 * if rects == NULL:
50245245 * raise MemoryError("Couldn't allocate rectangles.")
50255246 */
5026 __pyx_t_6 = PyObject_Length(__pyx_v_rectangles); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 327, __pyx_L1_error)
5247 __pyx_t_6 = PyObject_Length(__pyx_v_rectangles); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 327, __pyx_L1_error)
50275248 __pyx_v_rects = ((SDL_Rect *)calloc(__pyx_t_6, (sizeof(SDL_Rect))));
50285249
50295250 /* "pygame_sdl2/display.pyx":328
50345255 *
50355256 */
50365257 __pyx_t_1 = ((__pyx_v_rects == NULL) != 0);
5037 if (__pyx_t_1) {
5258 if (unlikely(__pyx_t_1)) {
50385259
50395260 /* "pygame_sdl2/display.pyx":329
50405261 * rects = <SDL_Rect *> calloc(len(rectangles), sizeof(SDL_Rect))
51065327 if (unlikely(!__pyx_t_4)) {
51075328 PyObject* exc_type = PyErr_Occurred();
51085329 if (exc_type) {
5109 if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5330 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
51105331 else __PYX_ERR(0, 333, __pyx_L8_error)
51115332 }
51125333 break;
51525373 * count += 1
51535374 *
51545375 */
5155 __pyx_t_8 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_i, (&(__pyx_v_rects[__pyx_v_count])), NULL); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 337, __pyx_L8_error)
5376 __pyx_t_8 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_i, (&(__pyx_v_rects[__pyx_v_count])), NULL); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 337, __pyx_L8_error)
51565377
51575378 /* "pygame_sdl2/display.pyx":338
51585379 *
51815402 *
51825403 * finally:
51835404 */
5184 SDL_UpdateWindowSurfaceRects(__pyx_v_self->window, __pyx_v_rects, __pyx_v_count);
5405 (void)(SDL_UpdateWindowSurfaceRects(__pyx_v_self->window, __pyx_v_rects, __pyx_v_count));
51855406 }
51865407
51875408 /* "pygame_sdl2/display.pyx":343
51965417 free(__pyx_v_rects);
51975418 goto __pyx_L9;
51985419 }
5420 __pyx_L8_error:;
51995421 /*exception exit:*/{
52005422 __Pyx_PyThreadState_declare
5201 __pyx_L8_error:;
5423 __Pyx_PyThreadState_assign
52025424 __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
5203 __Pyx_PyThreadState_assign
52045425 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
52055426 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
52065427 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
52165437 {
52175438 free(__pyx_v_rects);
52185439 }
5219 __Pyx_PyThreadState_assign
52205440 if (PY_MAJOR_VERSION >= 3) {
52215441 __Pyx_XGIVEREF(__pyx_t_14);
52225442 __Pyx_XGIVEREF(__pyx_t_15);
52945514 * def get_active(self):
52955515 */
52965516 __Pyx_XDECREF(__pyx_r);
5297 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
5517 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
52985518 __Pyx_GOTREF(__pyx_t_1);
52995519 __pyx_r = __pyx_t_1;
53005520 __pyx_t_1 = 0;
55165736 * else:
55175737 */
55185738 __pyx_t_1 = (SDL_SetWindowFullscreen(__pyx_v_self->window, 0) != 0);
5519 if (__pyx_t_1) {
5739 if (unlikely(__pyx_t_1)) {
55205740
55215741 /* "pygame_sdl2/display.pyx":361
55225742 * if SDL_GetWindowFlags(self.window) & (SDL_WINDOW_FULLSCREEN_DESKTOP):
55775797 */
55785798 /*else*/ {
55795799 __pyx_t_1 = (SDL_SetWindowFullscreen(__pyx_v_self->window, SDL_WINDOW_FULLSCREEN_DESKTOP) != 0);
5580 if (__pyx_t_1) {
5800 if (unlikely(__pyx_t_1)) {
55815801
55825802 /* "pygame_sdl2/display.pyx":364
55835803 * else:
56815901 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
56825902 switch (pos_args) {
56835903 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5904 CYTHON_FALLTHROUGH;
56845905 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5906 CYTHON_FALLTHROUGH;
56855907 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5908 CYTHON_FALLTHROUGH;
56865909 case 0: break;
56875910 default: goto __pyx_L5_argtuple_error;
56885911 }
56895912 kw_args = PyDict_Size(__pyx_kwds);
56905913 switch (pos_args) {
56915914 case 0:
5692 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_red)) != 0)) kw_args--;
5915 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_red)) != 0)) kw_args--;
56935916 else goto __pyx_L5_argtuple_error;
5917 CYTHON_FALLTHROUGH;
56945918 case 1:
56955919 if (kw_args > 0) {
5696 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_green);
5920 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_green);
56975921 if (value) { values[1] = value; kw_args--; }
56985922 }
5923 CYTHON_FALLTHROUGH;
56995924 case 2:
57005925 if (kw_args > 0) {
5701 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blue);
5926 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blue);
57025927 if (value) { values[2] = value; kw_args--; }
57035928 }
57045929 }
57085933 } else {
57095934 switch (PyTuple_GET_SIZE(__pyx_args)) {
57105935 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5936 CYTHON_FALLTHROUGH;
57115937 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5938 CYTHON_FALLTHROUGH;
57125939 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
57135940 break;
57145941 default: goto __pyx_L5_argtuple_error;
59246151 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
59256152 switch (pos_args) {
59266153 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6154 CYTHON_FALLTHROUGH;
59276155 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6156 CYTHON_FALLTHROUGH;
59286157 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6158 CYTHON_FALLTHROUGH;
59296159 case 0: break;
59306160 default: goto __pyx_L5_argtuple_error;
59316161 }
59326162 kw_args = PyDict_Size(__pyx_kwds);
59336163 switch (pos_args) {
59346164 case 0:
5935 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_red)) != 0)) kw_args--;
6165 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_red)) != 0)) kw_args--;
59366166 else goto __pyx_L5_argtuple_error;
6167 CYTHON_FALLTHROUGH;
59376168 case 1:
5938 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_green)) != 0)) kw_args--;
6169 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_green)) != 0)) kw_args--;
59396170 else {
59406171 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 387, __pyx_L3_error)
59416172 }
6173 CYTHON_FALLTHROUGH;
59426174 case 2:
5943 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blue)) != 0)) kw_args--;
6175 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blue)) != 0)) kw_args--;
59446176 else {
59456177 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 387, __pyx_L3_error)
59466178 }
63946626 __Pyx_RefNannyDeclarations
63956627 PyObject *__pyx_t_1 = NULL;
63966628 __Pyx_RefNannySetupContext("__set__", 0);
6397 if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(1, 29, __pyx_L1_error)
6629 if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(2, 29, __pyx_L1_error)
63986630 __pyx_t_1 = __pyx_v_value;
63996631 __Pyx_INCREF(__pyx_t_1);
64006632 __Pyx_GIVEREF(__pyx_t_1);
64406672
64416673 /* function exit code */
64426674 __pyx_r = 0;
6675 __Pyx_RefNannyFinishContext();
6676 return __pyx_r;
6677 }
6678
6679 /* "(tree fragment)":1
6680 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6681 * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling")
6682 * def __setstate_cython__(self, __pyx_state):
6683 */
6684
6685 /* Python wrapper */
6686 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_37__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
6687 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_37__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6688 PyObject *__pyx_r = 0;
6689 __Pyx_RefNannyDeclarations
6690 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6691 __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_36__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self));
6692
6693 /* function exit code */
6694 __Pyx_RefNannyFinishContext();
6695 return __pyx_r;
6696 }
6697
6698 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_36__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self) {
6699 PyObject *__pyx_r = NULL;
6700 __Pyx_RefNannyDeclarations
6701 PyObject *__pyx_t_1 = NULL;
6702 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6703
6704 /* "(tree fragment)":2
6705 * def __reduce_cython__(self):
6706 * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
6707 * def __setstate_cython__(self, __pyx_state):
6708 * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling")
6709 */
6710 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
6711 __Pyx_GOTREF(__pyx_t_1);
6712 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6713 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6714 __PYX_ERR(1, 2, __pyx_L1_error)
6715
6716 /* "(tree fragment)":1
6717 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6718 * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling")
6719 * def __setstate_cython__(self, __pyx_state):
6720 */
6721
6722 /* function exit code */
6723 __pyx_L1_error:;
6724 __Pyx_XDECREF(__pyx_t_1);
6725 __Pyx_AddTraceback("pygame_sdl2.display.Window.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6726 __pyx_r = NULL;
6727 __Pyx_XGIVEREF(__pyx_r);
6728 __Pyx_RefNannyFinishContext();
6729 return __pyx_r;
6730 }
6731
6732 /* "(tree fragment)":3
6733 * def __reduce_cython__(self):
6734 * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling")
6735 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6736 * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling")
6737 */
6738
6739 /* Python wrapper */
6740 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_39__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
6741 static PyObject *__pyx_pw_11pygame_sdl2_7display_6Window_39__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6742 PyObject *__pyx_r = 0;
6743 __Pyx_RefNannyDeclarations
6744 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6745 __pyx_r = __pyx_pf_11pygame_sdl2_7display_6Window_38__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_7display_Window *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6746
6747 /* function exit code */
6748 __Pyx_RefNannyFinishContext();
6749 return __pyx_r;
6750 }
6751
6752 static PyObject *__pyx_pf_11pygame_sdl2_7display_6Window_38__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7display_Window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6753 PyObject *__pyx_r = NULL;
6754 __Pyx_RefNannyDeclarations
6755 PyObject *__pyx_t_1 = NULL;
6756 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
6757
6758 /* "(tree fragment)":4
6759 * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling")
6760 * def __setstate_cython__(self, __pyx_state):
6761 * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
6762 */
6763 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
6764 __Pyx_GOTREF(__pyx_t_1);
6765 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6766 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6767 __PYX_ERR(1, 4, __pyx_L1_error)
6768
6769 /* "(tree fragment)":3
6770 * def __reduce_cython__(self):
6771 * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling")
6772 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6773 * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling")
6774 */
6775
6776 /* function exit code */
6777 __pyx_L1_error:;
6778 __Pyx_XDECREF(__pyx_t_1);
6779 __Pyx_AddTraceback("pygame_sdl2.display.Window.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6780 __pyx_r = NULL;
6781 __Pyx_XGIVEREF(__pyx_r);
64436782 __Pyx_RefNannyFinishContext();
64446783 return __pyx_r;
64456784 }
64666805 {
64676806 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_resolution,&__pyx_n_s_flags,&__pyx_n_s_depth,&__pyx_n_s_pos,0};
64686807 PyObject* values[4] = {0,0,0,0};
6469 values[0] = ((PyObject *)__pyx_tuple__11);
6808 values[0] = ((PyObject *)__pyx_tuple__13);
64706809 values[1] = ((PyObject *)__pyx_int_0);
64716810 values[2] = ((PyObject *)__pyx_int_0);
6472 values[3] = __pyx_k__12;
6811 values[3] = __pyx_k__14;
64736812 if (unlikely(__pyx_kwds)) {
64746813 Py_ssize_t kw_args;
64756814 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
64766815 switch (pos_args) {
64776816 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6817 CYTHON_FALLTHROUGH;
64786818 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6819 CYTHON_FALLTHROUGH;
64796820 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6821 CYTHON_FALLTHROUGH;
64806822 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6823 CYTHON_FALLTHROUGH;
64816824 case 0: break;
64826825 default: goto __pyx_L5_argtuple_error;
64836826 }
64856828 switch (pos_args) {
64866829 case 0:
64876830 if (kw_args > 0) {
6488 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_resolution);
6831 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_resolution);
64896832 if (value) { values[0] = value; kw_args--; }
64906833 }
6834 CYTHON_FALLTHROUGH;
64916835 case 1:
64926836 if (kw_args > 0) {
6493 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags);
6837 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags);
64946838 if (value) { values[1] = value; kw_args--; }
64956839 }
6840 CYTHON_FALLTHROUGH;
64966841 case 2:
64976842 if (kw_args > 0) {
6498 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_depth);
6843 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_depth);
64996844 if (value) { values[2] = value; kw_args--; }
65006845 }
6846 CYTHON_FALLTHROUGH;
65016847 case 3:
65026848 if (kw_args > 0) {
6503 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos);
6849 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pos);
65046850 if (value) { values[3] = value; kw_args--; }
65056851 }
65066852 }
65106856 } else {
65116857 switch (PyTuple_GET_SIZE(__pyx_args)) {
65126858 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6859 CYTHON_FALLTHROUGH;
65136860 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6861 CYTHON_FALLTHROUGH;
65146862 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6863 CYTHON_FALLTHROUGH;
65156864 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6865 CYTHON_FALLTHROUGH;
65166866 case 0: break;
65176867 default: goto __pyx_L5_argtuple_error;
65186868 }
67287078 __Pyx_GIVEREF(__pyx_v_depth);
67297079 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_depth);
67307080 __pyx_t_4 = 0;
6731 __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 440, __pyx_L1_error)
7081 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 440, __pyx_L1_error)
67327082 __Pyx_GOTREF(__pyx_t_4);
67337083 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_pos, __pyx_v_pos) < 0) __PYX_ERR(0, 440, __pyx_L1_error)
67347084 __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7display_Window), __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 440, __pyx_L1_error)
69087258 * return main_window.get_surface()
69097259 */
69107260 __Pyx_XDECREF(__pyx_r);
6911 __Pyx_INCREF(Py_None);
6912 __pyx_r = Py_None;
7261 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
69137262 goto __pyx_L0;
69147263
69157264 /* "pygame_sdl2/display.pyx":448
71567505 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
71577506 switch (pos_args) {
71587507 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7508 CYTHON_FALLTHROUGH;
71597509 case 0: break;
71607510 default: goto __pyx_L5_argtuple_error;
71617511 }
71637513 switch (pos_args) {
71647514 case 0:
71657515 if (kw_args > 0) {
7166 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rectangles);
7516 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rectangles);
71677517 if (value) { values[0] = value; kw_args--; }
71687518 }
71697519 }
71737523 } else {
71747524 switch (PyTuple_GET_SIZE(__pyx_args)) {
71757525 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7526 CYTHON_FALLTHROUGH;
71767527 case 0: break;
71777528 default: goto __pyx_L5_argtuple_error;
71787529 }
73507701 *
73517702 */
73527703 __pyx_t_1 = ((__pyx_v_driver == NULL) != 0);
7353 if (__pyx_t_1) {
7704 if (unlikely(__pyx_t_1)) {
73547705
73557706 /* "pygame_sdl2/display.pyx":473
73567707 *
74717822 *
74727823 */
74737824 __pyx_t_1 = (SDL_GetCurrentDisplayMode(0, (&__pyx_v_dm)) != 0);
7474 if (__pyx_t_1) {
7825 if (unlikely(__pyx_t_1)) {
74757826
74767827 /* "pygame_sdl2/display.pyx":484
74777828 *
75307881 *
75317882 */
75327883 __pyx_t_1 = ((__pyx_v_format == NULL) != 0);
7533 if (__pyx_t_1) {
7884 if (unlikely(__pyx_t_1)) {
75347885
75357886 /* "pygame_sdl2/display.pyx":488
75367887 * format = SDL_AllocFormat(dm.format)
78608211 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
78618212 if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
78628213 PyObject* sequence = __pyx_t_6;
7863 #if !CYTHON_COMPILING_IN_PYPY
7864 Py_ssize_t size = Py_SIZE(sequence);
7865 #else
7866 Py_ssize_t size = PySequence_Size(sequence);
7867 #endif
8214 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
78688215 if (unlikely(size != 2)) {
78698216 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
78708217 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
82758622 *
82768623 */
82778624 __Pyx_XDECREF(__pyx_r);
8278 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error)
8625 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error)
82798626 __Pyx_GOTREF(__pyx_t_2);
82808627 __pyx_r = __pyx_t_2;
82818628 __pyx_t_2 = 0;
83528699 *
83538700 */
83548701 __pyx_t_1 = ((__pyx_v_rv < 0) != 0);
8355 if (__pyx_t_1) {
8702 if (unlikely(__pyx_t_1)) {
83568703
83578704 /* "pygame_sdl2/display.pyx":557
83588705 *
84598806 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
84608807 switch (pos_args) {
84618808 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8809 CYTHON_FALLTHROUGH;
84628810 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8811 CYTHON_FALLTHROUGH;
84638812 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8813 CYTHON_FALLTHROUGH;
84648814 case 0: break;
84658815 default: goto __pyx_L5_argtuple_error;
84668816 }
84688818 switch (pos_args) {
84698819 case 0:
84708820 if (kw_args > 0) {
8471 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_depth);
8821 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_depth);
84728822 if (value) { values[0] = value; kw_args--; }
84738823 }
8824 CYTHON_FALLTHROUGH;
84748825 case 1:
84758826 if (kw_args > 0) {
8476 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags);
8827 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags);
84778828 if (value) { values[1] = value; kw_args--; }
84788829 }
8830 CYTHON_FALLTHROUGH;
84798831 case 2:
84808832 if (kw_args > 0) {
8481 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_display);
8833 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_display);
84828834 if (value) { values[2] = value; kw_args--; }
84838835 }
84848836 }
84888840 } else {
84898841 switch (PyTuple_GET_SIZE(__pyx_args)) {
84908842 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8843 CYTHON_FALLTHROUGH;
84918844 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8845 CYTHON_FALLTHROUGH;
84928846 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8847 CYTHON_FALLTHROUGH;
84938848 case 0: break;
84948849 default: goto __pyx_L5_argtuple_error;
84958850 }
85618916 *
85628917 */
85638918 __pyx_t_3 = ((__pyx_v_num_modes < 0) != 0);
8564 if (__pyx_t_3) {
8919 if (unlikely(__pyx_t_3)) {
85658920
85668921 /* "pygame_sdl2/display.pyx":576
85678922 * num_modes = SDL_GetNumDisplayModes(display)
86649019 *
86659020 * return rv
86669021 */
8667 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_v_t); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 582, __pyx_L1_error)
9022 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_v_t); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 582, __pyx_L1_error)
86689023
86699024 /* "pygame_sdl2/display.pyx":581
86709025 * if SDL_GetDisplayMode(display, i, &mode) == 0:
87499104 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
87509105 switch (pos_args) {
87519106 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9107 CYTHON_FALLTHROUGH;
87529108 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9109 CYTHON_FALLTHROUGH;
87539110 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9111 CYTHON_FALLTHROUGH;
87549112 case 0: break;
87559113 default: goto __pyx_L5_argtuple_error;
87569114 }
87579115 kw_args = PyDict_Size(__pyx_kwds);
87589116 switch (pos_args) {
87599117 case 0:
8760 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
9118 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
87619119 else goto __pyx_L5_argtuple_error;
9120 CYTHON_FALLTHROUGH;
87629121 case 1:
87639122 if (kw_args > 0) {
8764 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags);
9123 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags);
87659124 if (value) { values[1] = value; kw_args--; }
87669125 }
9126 CYTHON_FALLTHROUGH;
87679127 case 2:
87689128 if (kw_args > 0) {
8769 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_depth);
9129 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_depth);
87709130 if (value) { values[2] = value; kw_args--; }
87719131 }
87729132 }
87769136 } else {
87779137 switch (PyTuple_GET_SIZE(__pyx_args)) {
87789138 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9139 CYTHON_FALLTHROUGH;
87799140 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9141 CYTHON_FALLTHROUGH;
87809142 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
87819143 break;
87829144 default: goto __pyx_L5_argtuple_error;
88199181 * def gl_reset_attributes():
88209182 */
88219183 __Pyx_XDECREF(__pyx_r);
8822 __pyx_t_1 = PySequence_Tuple(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error)
9184 __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error)
88239185 __Pyx_GOTREF(__pyx_t_1);
88249186 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_list_modes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error)
88259187 __Pyx_GOTREF(__pyx_t_3);
89489310 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
89499311 switch (pos_args) {
89509312 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9313 CYTHON_FALLTHROUGH;
89519314 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9315 CYTHON_FALLTHROUGH;
89529316 case 0: break;
89539317 default: goto __pyx_L5_argtuple_error;
89549318 }
89559319 kw_args = PyDict_Size(__pyx_kwds);
89569320 switch (pos_args) {
89579321 case 0:
8958 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
9322 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
89599323 else goto __pyx_L5_argtuple_error;
9324 CYTHON_FALLTHROUGH;
89609325 case 1:
8961 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
9326 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
89629327 else {
89639328 __Pyx_RaiseArgtupleInvalid("gl_set_attribute", 1, 2, 2, 1); __PYX_ERR(0, 597, __pyx_L3_error)
89649329 }
90719436 __Pyx_GOTREF(__pyx_t_2);
90729437 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L1_error)
90739438 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9074 SDL_GL_SetSwapInterval(__pyx_t_4);
9439 (void)(SDL_GL_SetSwapInterval(__pyx_t_4));
90759440
90769441 /* "pygame_sdl2/display.pyx":608
90779442 * # to deal with the case where the negative interval isn't
91219486 __pyx_t_5 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 614, __pyx_L1_error)
91229487 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 614, __pyx_L1_error)
91239488 __pyx_t_3 = (SDL_GL_SetAttribute(__pyx_t_5, __pyx_t_4) != 0);
9124 if (__pyx_t_3) {
9489 if (unlikely(__pyx_t_3)) {
91259490
91269491 /* "pygame_sdl2/display.pyx":615
91279492 *
92669631 */
92679632 __pyx_t_4 = ((SDL_GLattr)__Pyx_PyInt_As_SDL_GLattr(__pyx_v_flag)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 623, __pyx_L1_error)
92689633 __pyx_t_3 = (SDL_GL_GetAttribute(__pyx_t_4, (&__pyx_v_rv)) != 0);
9269 if (__pyx_t_3) {
9634 if (unlikely(__pyx_t_3)) {
92709635
92719636 /* "pygame_sdl2/display.pyx":624
92729637 *
93959760 * else:
93969761 */
93979762 __pyx_t_2 = (SDL_GL_LoadLibrary(NULL) != 0);
9398 if (__pyx_t_2) {
9763 if (unlikely(__pyx_t_2)) {
93999764
94009765 /* "pygame_sdl2/display.pyx":631
94019766 * if path is None:
94579822 /*else*/ {
94589823 __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_path); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 633, __pyx_L1_error)
94599824 __pyx_t_2 = (SDL_GL_LoadLibrary(__pyx_t_6) != 0);
9460 if (__pyx_t_2) {
9825 if (unlikely(__pyx_t_2)) {
94619826
94629827 /* "pygame_sdl2/display.pyx":634
94639828 * else:
994810313 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
994910314 switch (pos_args) {
995010315 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10316 CYTHON_FALLTHROUGH;
995110317 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10318 CYTHON_FALLTHROUGH;
995210319 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10320 CYTHON_FALLTHROUGH;
995310321 case 0: break;
995410322 default: goto __pyx_L5_argtuple_error;
995510323 }
995610324 kw_args = PyDict_Size(__pyx_kwds);
995710325 switch (pos_args) {
995810326 case 0:
9959 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_red)) != 0)) kw_args--;
10327 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_red)) != 0)) kw_args--;
996010328 else goto __pyx_L5_argtuple_error;
10329 CYTHON_FALLTHROUGH;
996110330 case 1:
996210331 if (kw_args > 0) {
9963 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_green);
10332 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_green);
996410333 if (value) { values[1] = value; kw_args--; }
996510334 }
10335 CYTHON_FALLTHROUGH;
996610336 case 2:
996710337 if (kw_args > 0) {
9968 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blue);
10338 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blue);
996910339 if (value) { values[2] = value; kw_args--; }
997010340 }
997110341 }
997510345 } else {
997610346 switch (PyTuple_GET_SIZE(__pyx_args)) {
997710347 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10348 CYTHON_FALLTHROUGH;
997810349 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10350 CYTHON_FALLTHROUGH;
997910351 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
998010352 break;
998110353 default: goto __pyx_L5_argtuple_error;
1015210524 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1015310525 switch (pos_args) {
1015410526 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10527 CYTHON_FALLTHROUGH;
1015510528 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10529 CYTHON_FALLTHROUGH;
1015610530 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10531 CYTHON_FALLTHROUGH;
1015710532 case 0: break;
1015810533 default: goto __pyx_L5_argtuple_error;
1015910534 }
1016010535 kw_args = PyDict_Size(__pyx_kwds);
1016110536 switch (pos_args) {
1016210537 case 0:
10163 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_red)) != 0)) kw_args--;
10538 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_red)) != 0)) kw_args--;
1016410539 else goto __pyx_L5_argtuple_error;
10540 CYTHON_FALLTHROUGH;
1016510541 case 1:
10166 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_green)) != 0)) kw_args--;
10542 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_green)) != 0)) kw_args--;
1016710543 else {
1016810544 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 1); __PYX_ERR(0, 661, __pyx_L3_error)
1016910545 }
10546 CYTHON_FALLTHROUGH;
1017010547 case 2:
10171 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blue)) != 0)) kw_args--;
10548 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blue)) != 0)) kw_args--;
1017210549 else {
1017310550 __Pyx_RaiseArgtupleInvalid("set_gamma_ramp", 1, 3, 3, 2); __PYX_ERR(0, 661, __pyx_L3_error)
1017410551 }
1052210899 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1052310900 switch (pos_args) {
1052410901 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10902 CYTHON_FALLTHROUGH;
1052510903 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10904 CYTHON_FALLTHROUGH;
1052610905 case 0: break;
1052710906 default: goto __pyx_L5_argtuple_error;
1052810907 }
1052910908 kw_args = PyDict_Size(__pyx_kwds);
1053010909 switch (pos_args) {
1053110910 case 0:
10532 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_title)) != 0)) kw_args--;
10911 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_title)) != 0)) kw_args--;
1053310912 else goto __pyx_L5_argtuple_error;
10913 CYTHON_FALLTHROUGH;
1053410914 case 1:
1053510915 if (kw_args > 0) {
10536 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_icontitle);
10916 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_icontitle);
1053710917 if (value) { values[1] = value; kw_args--; }
1053810918 }
1053910919 }
1054310923 } else {
1054410924 switch (PyTuple_GET_SIZE(__pyx_args)) {
1054510925 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10926 CYTHON_FALLTHROUGH;
1054610927 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1054710928 break;
1054810929 default: goto __pyx_L5_argtuple_error;
1084011221 * def get_num_video_displays():
1084111222 */
1084211223 __Pyx_XDECREF(__pyx_r);
10843 __Pyx_INCREF(Py_None);
10844 __pyx_r = Py_None;
11224 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1084511225 goto __pyx_L0;
1084611226
1084711227 /* "pygame_sdl2/display.pyx":685
1091411294 *
1091511295 */
1091611296 __pyx_t_1 = ((__pyx_v_rv < 0) != 0);
10917 if (__pyx_t_1) {
11297 if (unlikely(__pyx_t_1)) {
1091811298
1091911299 /* "pygame_sdl2/display.pyx":693
1092011300 * rv = SDL_GetNumVideoDisplays()
1126911649
1127011650 static void __pyx_tp_dealloc_11pygame_sdl2_7display_Window(PyObject *o) {
1127111651 struct __pyx_obj_11pygame_sdl2_7display_Window *p = (struct __pyx_obj_11pygame_sdl2_7display_Window *)o;
11272 #if PY_VERSION_HEX >= 0x030400a1
11273 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
11652 #if CYTHON_USE_TP_FINALIZE
11653 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
1127411654 if (PyObject_CallFinalizerFromDealloc(o)) return;
1127511655 }
1127611656 #endif
1128411664 int e;
1128511665 struct __pyx_obj_11pygame_sdl2_7display_Window *p = (struct __pyx_obj_11pygame_sdl2_7display_Window *)o;
1128611666 if (p->surface) {
11287 e = (*v)(((PyObject*)p->surface), a); if (e) return e;
11667 e = (*v)(((PyObject *)p->surface), a); if (e) return e;
1128811668 }
1128911669 return 0;
1129011670 }
1132911709 {"set_icon", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_31set_icon, METH_O, 0},
1133011710 {"set_caption", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_33set_caption, METH_O, 0},
1133111711 {"get_drawable_size", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_35get_drawable_size, METH_NOARGS, 0},
11712 {"__reduce_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_37__reduce_cython__, METH_NOARGS, 0},
11713 {"__setstate_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_7display_6Window_39__setstate_cython__, METH_O, 0},
1133211714 {0, 0, 0, 0}
1133311715 };
1133411716
1140011782 };
1140111783
1140211784 #if PY_MAJOR_VERSION >= 3
11785 #if CYTHON_PEP489_MULTI_PHASE_INIT
11786 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
11787 static int __pyx_pymod_exec_display(PyObject* module); /*proto*/
11788 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
11789 {Py_mod_create, (void*)__pyx_pymod_create},
11790 {Py_mod_exec, (void*)__pyx_pymod_exec_display},
11791 {0, NULL}
11792 };
11793 #endif
11794
1140311795 static struct PyModuleDef __pyx_moduledef = {
11404 #if PY_VERSION_HEX < 0x03020000
11405 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
11406 #else
1140711796 PyModuleDef_HEAD_INIT,
11408 #endif
1140911797 "display",
1141011798 0, /* m_doc */
11799 #if CYTHON_PEP489_MULTI_PHASE_INIT
11800 0, /* m_size */
11801 #else
1141111802 -1, /* m_size */
11803 #endif
1141211804 __pyx_methods /* m_methods */,
11805 #if CYTHON_PEP489_MULTI_PHASE_INIT
11806 __pyx_moduledef_slots, /* m_slots */
11807 #else
1141311808 NULL, /* m_reload */
11809 #endif
1141411810 NULL, /* m_traverse */
1141511811 NULL, /* m_clear */
1141611812 NULL /* m_free */
1143211828 {&__pyx_n_u_PYGAME_SDL2_AVOID_GL, __pyx_k_PYGAME_SDL2_AVOID_GL, sizeof(__pyx_k_PYGAME_SDL2_AVOID_GL), 0, 1, 0, 1},
1143311829 {&__pyx_n_u_SDL_VIDEO_MAC_FULLSCREEN_SPACES, __pyx_k_SDL_VIDEO_MAC_FULLSCREEN_SPACES, sizeof(__pyx_k_SDL_VIDEO_MAC_FULLSCREEN_SPACES), 0, 1, 0, 1},
1143411830 {&__pyx_n_s_SRCALPHA, __pyx_k_SRCALPHA, sizeof(__pyx_k_SRCALPHA), 0, 0, 1, 1},
11831 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
1143511832 {&__pyx_n_s_androidembed, __pyx_k_androidembed, sizeof(__pyx_k_androidembed), 0, 0, 1, 1},
1143611833 {&__pyx_n_s_before_first_window, __pyx_k_before_first_window, sizeof(__pyx_k_before_first_window), 0, 0, 1, 1},
1143711834 {&__pyx_n_s_bitsize, __pyx_k_bitsize, sizeof(__pyx_k_bitsize), 0, 0, 1, 1},
1144311840 {&__pyx_n_s_blit_sw_CC, __pyx_k_blit_sw_CC, sizeof(__pyx_k_blit_sw_CC), 0, 0, 1, 1},
1144411841 {&__pyx_n_s_blue, __pyx_k_blue, sizeof(__pyx_k_blue), 0, 0, 1, 1},
1144511842 {&__pyx_n_s_bytesize, __pyx_k_bytesize, sizeof(__pyx_k_bytesize), 0, 0, 1, 1},
11843 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
1144611844 {&__pyx_n_s_close_window, __pyx_k_close_window, sizeof(__pyx_k_close_window), 0, 0, 1, 1},
1144711845 {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
1144811846 {&__pyx_n_s_create_surface, __pyx_k_create_surface, sizeof(__pyx_k_create_surface), 0, 0, 1, 1},
1148111879 {&__pyx_n_s_get_window, __pyx_k_get_window, sizeof(__pyx_k_get_window), 0, 0, 1, 1},
1148211880 {&__pyx_n_s_get_window_flags, __pyx_k_get_window_flags, sizeof(__pyx_k_get_window_flags), 0, 0, 1, 1},
1148311881 {&__pyx_n_s_get_wm_info, __pyx_k_get_wm_info, sizeof(__pyx_k_get_wm_info), 0, 0, 1, 1},
11882 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
1148411883 {&__pyx_n_s_gl_get_attribute, __pyx_k_gl_get_attribute, sizeof(__pyx_k_gl_get_attribute), 0, 0, 1, 1},
1148511884 {&__pyx_n_s_gl_load_library, __pyx_k_gl_load_library, sizeof(__pyx_k_gl_load_library), 0, 0, 1, 1},
1148611885 {&__pyx_n_s_gl_reset_attributes, __pyx_k_gl_reset_attributes, sizeof(__pyx_k_gl_reset_attributes), 0, 0, 1, 1},
1150811907 {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
1150911908 {&__pyx_n_s_mode_ok, __pyx_k_mode_ok, sizeof(__pyx_k_mode_ok), 0, 0, 1, 1},
1151011909 {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
11910 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
1151111911 {&__pyx_n_s_num_modes, __pyx_k_num_modes, sizeof(__pyx_k_num_modes), 0, 0, 1, 1},
1151211912 {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
1151311913 {&__pyx_n_s_opengl, __pyx_k_opengl, sizeof(__pyx_k_opengl), 0, 0, 1, 1},
1153011930 {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1},
1153111931 {&__pyx_n_s_rectangles, __pyx_k_rectangles, sizeof(__pyx_k_rectangles), 0, 0, 1, 1},
1153211932 {&__pyx_n_s_red, __pyx_k_red, sizeof(__pyx_k_red), 0, 0, 1, 1},
11933 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
11934 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
11935 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
1153311936 {&__pyx_n_s_refresh_rate, __pyx_k_refresh_rate, sizeof(__pyx_k_refresh_rate), 0, 0, 1, 1},
1153411937 {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1},
1153511938 {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1},
1153911942 {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1},
1154011943 {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1},
1154111944 {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
11945 {&__pyx_kp_s_self_gl_context_self_window_self, __pyx_k_self_gl_context_self_window_self, sizeof(__pyx_k_self_gl_context_self_window_self), 0, 0, 1, 0},
1154211946 {&__pyx_n_s_set_caption, __pyx_k_set_caption, sizeof(__pyx_k_set_caption), 0, 0, 1, 1},
1154311947 {&__pyx_n_s_set_gamma, __pyx_k_set_gamma, sizeof(__pyx_k_set_gamma), 0, 0, 1, 1},
1154411948 {&__pyx_n_s_set_gamma_ramp, __pyx_k_set_gamma_ramp, sizeof(__pyx_k_set_gamma_ramp), 0, 0, 1, 1},
1154511949 {&__pyx_n_s_set_icon, __pyx_k_set_icon, sizeof(__pyx_k_set_icon), 0, 0, 1, 1},
1154611950 {&__pyx_n_s_set_mode, __pyx_k_set_mode, sizeof(__pyx_k_set_mode), 0, 0, 1, 1},
11951 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
11952 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
1154711953 {&__pyx_n_s_shifts, __pyx_k_shifts, sizeof(__pyx_k_shifts), 0, 0, 1, 1},
1154811954 {&__pyx_n_s_shown_first_window, __pyx_k_shown_first_window, sizeof(__pyx_k_shown_first_window), 0, 0, 1, 1},
1154911955 {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
1156611972 __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 140, __pyx_L1_error)
1156711973 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 329, __pyx_L1_error)
1156811974 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 393, __pyx_L1_error)
11975 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
1156911976 return 0;
1157011977 __pyx_L1_error:;
1157111978 return -1;
1167412081 __Pyx_GOTREF(__pyx_tuple__10);
1167512082 __Pyx_GIVEREF(__pyx_tuple__10);
1167612083
12084 /* "(tree fragment)":2
12085 * def __reduce_cython__(self):
12086 * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
12087 * def __setstate_cython__(self, __pyx_state):
12088 * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling")
12089 */
12090 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_self_gl_context_self_window_self); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 2, __pyx_L1_error)
12091 __Pyx_GOTREF(__pyx_tuple__11);
12092 __Pyx_GIVEREF(__pyx_tuple__11);
12093
12094 /* "(tree fragment)":4
12095 * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling")
12096 * def __setstate_cython__(self, __pyx_state):
12097 * raise TypeError("self.gl_context,self.window,self.window_surface cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
12098 */
12099 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_self_gl_context_self_window_self); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 4, __pyx_L1_error)
12100 __Pyx_GOTREF(__pyx_tuple__12);
12101 __Pyx_GIVEREF(__pyx_tuple__12);
12102
1167712103 /* "pygame_sdl2/display.pyx":428
1167812104 * default_swap_control = 1
1167912105 *
1168112107 * global main_window
1168212108 *
1168312109 */
11684 __pyx_tuple__11 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 428, __pyx_L1_error)
11685 __Pyx_GOTREF(__pyx_tuple__11);
11686 __Pyx_GIVEREF(__pyx_tuple__11);
12110 __pyx_tuple__13 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 428, __pyx_L1_error)
12111 __Pyx_GOTREF(__pyx_tuple__13);
12112 __Pyx_GIVEREF(__pyx_tuple__13);
1168712113
1168812114 /* "pygame_sdl2/display.pyx":40
1168912115 * _pygame_hints = { }
1169212118 *
1169312119 * if str(hint).startswith("PYGAME_SDL2"):
1169412120 */
11695 __pyx_tuple__13 = PyTuple_Pack(2, __pyx_n_s_hint, __pyx_n_s_value); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 40, __pyx_L1_error)
11696 __Pyx_GOTREF(__pyx_tuple__13);
11697 __Pyx_GIVEREF(__pyx_tuple__13);
11698 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_hint, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 40, __pyx_L1_error)
12121 __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_hint, __pyx_n_s_value); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 40, __pyx_L1_error)
12122 __Pyx_GOTREF(__pyx_tuple__15);
12123 __Pyx_GIVEREF(__pyx_tuple__15);
12124 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_hint, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 40, __pyx_L1_error)
1169912125
1170012126 /* "pygame_sdl2/display.pyx":55
1170112127 * SDL_SetHint(hint, value)
1170412130 * hint = str(hint)
1170512131 *
1170612132 */
11707 __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_hint, __pyx_n_s_default); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 55, __pyx_L1_error)
11708 __Pyx_GOTREF(__pyx_tuple__15);
11709 __Pyx_GIVEREF(__pyx_tuple__15);
11710 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_hint, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 55, __pyx_L1_error)
12133 __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_hint, __pyx_n_s_default); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 55, __pyx_L1_error)
12134 __Pyx_GOTREF(__pyx_tuple__17);
12135 __Pyx_GIVEREF(__pyx_tuple__17);
12136 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_hint, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 55, __pyx_L1_error)
1171112137
1171212138 /* "pygame_sdl2/display.pyx":69
1171312139 * main_done = False
1171612142 * global main_done
1171712143 *
1171812144 */
11719 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_sdl_main_init, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 69, __pyx_L1_error)
12145 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_sdl_main_init, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 69, __pyx_L1_error)
1172012146
1172112147 /* "pygame_sdl2/display.pyx":86
1172212148 *
1172512151 *
1172612152 * if init_done:
1172712153 */
11728 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_init, 86, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 86, __pyx_L1_error)
12154 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_init, 86, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 86, __pyx_L1_error)
1172912155
1173012156 /* "pygame_sdl2/display.pyx":106
1173112157 *
1173412160 *
1173512161 * global init_done
1173612162 */
11737 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_quit, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 106, __pyx_L1_error)
12163 __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_quit, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 106, __pyx_L1_error)
1173812164
1173912165 /* "pygame_sdl2/display.pyx":117
1174012166 * init_done = False
1174312169 * return init_done
1174412170 *
1174512171 */
11746 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_init, 117, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 117, __pyx_L1_error)
12172 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_init, 117, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 117, __pyx_L1_error)
1174712173
1174812174 /* "pygame_sdl2/display.pyx":127
1174912175 * _shown_first_window = False
1175212178 * global _shown_first_window
1175312179 *
1175412180 */
11755 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_androidembed); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 127, __pyx_L1_error)
11756 __Pyx_GOTREF(__pyx_tuple__21);
11757 __Pyx_GIVEREF(__pyx_tuple__21);
11758 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_before_first_window, 127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 127, __pyx_L1_error)
12181 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_androidembed); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 127, __pyx_L1_error)
12182 __Pyx_GOTREF(__pyx_tuple__23);
12183 __Pyx_GIVEREF(__pyx_tuple__23);
12184 __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_before_first_window, 127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 127, __pyx_L1_error)
1175912185
1176012186 /* "pygame_sdl2/display.pyx":428
1176112187 * default_swap_control = 1
1176412190 * global main_window
1176512191 *
1176612192 */
11767 __pyx_tuple__23 = PyTuple_Pack(4, __pyx_n_s_resolution, __pyx_n_s_flags, __pyx_n_s_depth, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 428, __pyx_L1_error)
11768 __Pyx_GOTREF(__pyx_tuple__23);
11769 __Pyx_GIVEREF(__pyx_tuple__23);
11770 __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_mode, 428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 428, __pyx_L1_error)
12193 __pyx_tuple__25 = PyTuple_Pack(4, __pyx_n_s_resolution, __pyx_n_s_flags, __pyx_n_s_depth, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 428, __pyx_L1_error)
12194 __Pyx_GOTREF(__pyx_tuple__25);
12195 __Pyx_GIVEREF(__pyx_tuple__25);
12196 __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_mode, 428, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 428, __pyx_L1_error)
1177112197
1177212198 /* "pygame_sdl2/display.pyx":447
1177312199 * return main_window.surface
1177612202 * if main_window is None:
1177712203 * return None
1177812204 */
11779 __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_surface, 447, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 447, __pyx_L1_error)
12205 __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_surface, 447, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 447, __pyx_L1_error)
1178012206
1178112207 /* "pygame_sdl2/display.pyx":453
1178212208 * return main_window.get_surface()
1178512211 * """
1178612212 * Returns the Window created by set_mode, or None if no such window
1178712213 */
11788 __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_window, 453, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 453, __pyx_L1_error)
12214 __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_window, 453, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 453, __pyx_L1_error)
1178912215
1179012216 /* "pygame_sdl2/display.pyx":461
1179112217 * return main_window
1179412220 * if main_window:
1179512221 * main_window.flip()
1179612222 */
11797 __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_flip, 461, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 461, __pyx_L1_error)
12223 __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_flip, 461, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 461, __pyx_L1_error)
1179812224
1179912225 /* "pygame_sdl2/display.pyx":465
1180012226 * main_window.flip()
1180312229 * if main_window:
1180412230 * main_window.update(rectangles)
1180512231 */
11806 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_rectangles); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 465, __pyx_L1_error)
11807 __Pyx_GOTREF(__pyx_tuple__28);
11808 __Pyx_GIVEREF(__pyx_tuple__28);
11809 __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_update, 465, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 465, __pyx_L1_error)
12232 __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_rectangles); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 465, __pyx_L1_error)
12233 __Pyx_GOTREF(__pyx_tuple__30);
12234 __Pyx_GIVEREF(__pyx_tuple__30);
12235 __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_update, 465, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 465, __pyx_L1_error)
1181012236
1181112237 /* "pygame_sdl2/display.pyx":469
1181212238 * main_window.update(rectangles)
1181512241 * cdef const char *driver = SDL_GetCurrentVideoDriver()
1181612242 *
1181712243 */
11818 __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_driver); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 469, __pyx_L1_error)
11819 __Pyx_GOTREF(__pyx_tuple__30);
11820 __Pyx_GIVEREF(__pyx_tuple__30);
11821 __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_driver, 469, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 469, __pyx_L1_error)
12244 __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_driver); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 469, __pyx_L1_error)
12245 __Pyx_GOTREF(__pyx_tuple__32);
12246 __Pyx_GIVEREF(__pyx_tuple__32);
12247 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_driver, 469, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 469, __pyx_L1_error)
12248
12249 /* "pygame_sdl2/display.pyx":477
12250 * return driver
12251 *
12252 * class Info(object): # <<<<<<<<<<<<<<
12253 *
12254 * def __init__(self):
12255 */
12256 __pyx_tuple__34 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 477, __pyx_L1_error)
12257 __Pyx_GOTREF(__pyx_tuple__34);
12258 __Pyx_GIVEREF(__pyx_tuple__34);
1182212259
1182312260 /* "pygame_sdl2/display.pyx":479
1182412261 * class Info(object):
1182712264 * cdef SDL_DisplayMode dm
1182812265 * cdef SDL_PixelFormat *format
1182912266 */
11830 __pyx_tuple__32 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_dm, __pyx_n_s_format); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 479, __pyx_L1_error)
11831 __Pyx_GOTREF(__pyx_tuple__32);
11832 __Pyx_GIVEREF(__pyx_tuple__32);
11833 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_init_2, 479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 479, __pyx_L1_error)
12267 __pyx_tuple__35 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_dm, __pyx_n_s_format); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 479, __pyx_L1_error)
12268 __Pyx_GOTREF(__pyx_tuple__35);
12269 __Pyx_GIVEREF(__pyx_tuple__35);
12270 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_init_2, 479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 479, __pyx_L1_error)
1183412271
1183512272 /* "pygame_sdl2/display.pyx":538
1183612273 * self.blit_sw_A = False
1183912276 * return "<Info({!r})>".format(self.__dict__)
1184012277 *
1184112278 */
11842 __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 538, __pyx_L1_error)
11843 __Pyx_GOTREF(__pyx_tuple__34);
11844 __Pyx_GIVEREF(__pyx_tuple__34);
11845 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_repr, 538, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 538, __pyx_L1_error)
12279 __pyx_tuple__37 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 538, __pyx_L1_error)
12280 __Pyx_GOTREF(__pyx_tuple__37);
12281 __Pyx_GIVEREF(__pyx_tuple__37);
12282 __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_repr, 538, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 538, __pyx_L1_error)
1184612283
1184712284 /* "pygame_sdl2/display.pyx":542
1184812285 *
1185112288 * if main_window:
1185212289 * return main_window.get_wm_info()
1185312290 */
11854 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_wm_info, 542, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 542, __pyx_L1_error)
12291 __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_wm_info, 542, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 542, __pyx_L1_error)
1185512292
1185612293 /* "pygame_sdl2/display.pyx":549
1185712294 *
1186012297 * """
1186112298 * Returns the number of video displays connected to the system.
1186212299 */
11863 __pyx_tuple__37 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 549, __pyx_L1_error)
11864 __Pyx_GOTREF(__pyx_tuple__37);
11865 __Pyx_GIVEREF(__pyx_tuple__37);
11866 __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 549, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 549, __pyx_L1_error)
12300 __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 549, __pyx_L1_error)
12301 __Pyx_GOTREF(__pyx_tuple__40);
12302 __Pyx_GIVEREF(__pyx_tuple__40);
12303 __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 549, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 549, __pyx_L1_error)
1186712304
1186812305 /* "pygame_sdl2/display.pyx":562
1186912306 *
1187212309 * """
1187312310 * Returns a list of possible display modes for the display `display`.
1187412311 */
11875 __pyx_tuple__39 = PyTuple_Pack(8, __pyx_n_s_depth, __pyx_n_s_flags, __pyx_n_s_display, __pyx_n_s_num_modes, __pyx_n_s_i, __pyx_n_s_mode, __pyx_n_s_rv, __pyx_n_s_t); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 562, __pyx_L1_error)
11876 __Pyx_GOTREF(__pyx_tuple__39);
11877 __Pyx_GIVEREF(__pyx_tuple__39);
11878 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_list_modes, 562, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 562, __pyx_L1_error)
12312 __pyx_tuple__42 = PyTuple_Pack(8, __pyx_n_s_depth, __pyx_n_s_flags, __pyx_n_s_display, __pyx_n_s_num_modes, __pyx_n_s_i, __pyx_n_s_mode, __pyx_n_s_rv, __pyx_n_s_t); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 562, __pyx_L1_error)
12313 __Pyx_GOTREF(__pyx_tuple__42);
12314 __Pyx_GIVEREF(__pyx_tuple__42);
12315 __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_list_modes, 562, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 562, __pyx_L1_error)
1187912316
1188012317 /* "pygame_sdl2/display.pyx":587
1188112318 *
1188412321 * """
1188512322 * Returns true if size is in the result of list_modes().
1188612323 */
11887 __pyx_tuple__41 = PyTuple_Pack(3, __pyx_n_s_size, __pyx_n_s_flags, __pyx_n_s_depth); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 587, __pyx_L1_error)
11888 __Pyx_GOTREF(__pyx_tuple__41);
11889 __Pyx_GIVEREF(__pyx_tuple__41);
11890 __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_mode_ok, 587, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 587, __pyx_L1_error)
12324 __pyx_tuple__44 = PyTuple_Pack(3, __pyx_n_s_size, __pyx_n_s_flags, __pyx_n_s_depth); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 587, __pyx_L1_error)
12325 __Pyx_GOTREF(__pyx_tuple__44);
12326 __Pyx_GIVEREF(__pyx_tuple__44);
12327 __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_mode_ok, 587, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 587, __pyx_L1_error)
1189112328
1189212329 /* "pygame_sdl2/display.pyx":594
1189312330 * return tuple(size) in list_modes()
1189612333 * SDL_GL_ResetAttributes()
1189712334 *
1189812335 */
11899 __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_reset_attributes, 594, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 594, __pyx_L1_error)
12336 __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_reset_attributes, 594, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 594, __pyx_L1_error)
1190012337
1190112338 /* "pygame_sdl2/display.pyx":597
1190212339 * SDL_GL_ResetAttributes()
1190512342 *
1190612343 * if flag == GL_SWAP_CONTROL:
1190712344 */
11908 __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_value); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 597, __pyx_L1_error)
11909 __Pyx_GOTREF(__pyx_tuple__44);
11910 __Pyx_GIVEREF(__pyx_tuple__44);
11911 __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_set_attribute, 597, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 597, __pyx_L1_error)
12345 __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_value); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 597, __pyx_L1_error)
12346 __Pyx_GOTREF(__pyx_tuple__47);
12347 __Pyx_GIVEREF(__pyx_tuple__47);
12348 __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_set_attribute, 597, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 597, __pyx_L1_error)
1191212349
1191312350 /* "pygame_sdl2/display.pyx":617
1191412351 * raise error()
1191712354 * cdef int rv
1191812355 *
1191912356 */
11920 __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 617, __pyx_L1_error)
11921 __Pyx_GOTREF(__pyx_tuple__46);
11922 __Pyx_GIVEREF(__pyx_tuple__46);
11923 __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_get_attribute, 617, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 617, __pyx_L1_error)
12357 __pyx_tuple__49 = PyTuple_Pack(2, __pyx_n_s_flag, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 617, __pyx_L1_error)
12358 __Pyx_GOTREF(__pyx_tuple__49);
12359 __Pyx_GIVEREF(__pyx_tuple__49);
12360 __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_get_attribute, 617, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 617, __pyx_L1_error)
1192412361
1192512362 /* "pygame_sdl2/display.pyx":628
1192612363 * return rv
1192912366 * if path is None:
1193012367 * if SDL_GL_LoadLibrary(NULL):
1193112368 */
11932 __pyx_tuple__48 = PyTuple_Pack(1, __pyx_n_s_path); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 628, __pyx_L1_error)
11933 __Pyx_GOTREF(__pyx_tuple__48);
11934 __Pyx_GIVEREF(__pyx_tuple__48);
11935 __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_load_library, 628, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 628, __pyx_L1_error)
12369 __pyx_tuple__51 = PyTuple_Pack(1, __pyx_n_s_path); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 628, __pyx_L1_error)
12370 __Pyx_GOTREF(__pyx_tuple__51);
12371 __Pyx_GIVEREF(__pyx_tuple__51);
12372 __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_load_library, 628, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 628, __pyx_L1_error)
1193612373
1193712374 /* "pygame_sdl2/display.pyx":636
1193812375 * raise error()
1194112378 * SDL_GL_UnloadLibrary()
1194212379 *
1194312380 */
11944 __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_unload_library, 636, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 636, __pyx_L1_error)
12381 __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_gl_unload_library, 636, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 636, __pyx_L1_error)
1194512382
1194612383 /* "pygame_sdl2/display.pyx":639
1194712384 * SDL_GL_UnloadLibrary()
1195012387 * if main_window:
1195112388 * return main_window.get_active()
1195212389 */
11953 __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_active, 639, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 639, __pyx_L1_error)
12390 __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_active, 639, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 639, __pyx_L1_error)
1195412391
1195512392 /* "pygame_sdl2/display.pyx":644
1195612393 * return False
1195912396 * if main_window:
1196012397 * return main_window.iconify()
1196112398 */
11962 __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_iconify, 644, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 644, __pyx_L1_error)
12399 __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_iconify, 644, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 644, __pyx_L1_error)
1196312400
1196412401 /* "pygame_sdl2/display.pyx":650
1196512402 * return False
1196812405 * if main_window:
1196912406 * return main_window.toggle_fullscreen()
1197012407 */
11971 __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_toggle_fullscreen, 650, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 650, __pyx_L1_error)
12408 __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_toggle_fullscreen, 650, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 650, __pyx_L1_error)
1197212409
1197312410 /* "pygame_sdl2/display.pyx":656
1197412411 * return True
1197712414 * if main_window:
1197812415 * return main_window.set_gamma(red, green, blue)
1197912416 */
11980 __pyx_tuple__54 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 656, __pyx_L1_error)
11981 __Pyx_GOTREF(__pyx_tuple__54);
11982 __Pyx_GIVEREF(__pyx_tuple__54);
11983 __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma, 656, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 656, __pyx_L1_error)
12417 __pyx_tuple__57 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 656, __pyx_L1_error)
12418 __Pyx_GOTREF(__pyx_tuple__57);
12419 __Pyx_GIVEREF(__pyx_tuple__57);
12420 __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma, 656, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 656, __pyx_L1_error)
1198412421
1198512422 /* "pygame_sdl2/display.pyx":661
1198612423 * return False
1198912426 * if main_window:
1199012427 * return main_window.set_gamma_ramp(red, green, blue)
1199112428 */
11992 __pyx_tuple__56 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 661, __pyx_L1_error)
11993 __Pyx_GOTREF(__pyx_tuple__56);
11994 __Pyx_GIVEREF(__pyx_tuple__56);
11995 __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma_ramp, 661, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 661, __pyx_L1_error)
12429 __pyx_tuple__59 = PyTuple_Pack(3, __pyx_n_s_red, __pyx_n_s_green, __pyx_n_s_blue); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 661, __pyx_L1_error)
12430 __Pyx_GOTREF(__pyx_tuple__59);
12431 __Pyx_GIVEREF(__pyx_tuple__59);
12432 __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_gamma_ramp, 661, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 661, __pyx_L1_error)
1199612433
1199712434 /* "pygame_sdl2/display.pyx":666
1199812435 * return False
1200112438 * global default_icon
1200212439 *
1200312440 */
12004 __pyx_tuple__58 = PyTuple_Pack(1, __pyx_n_s_surface); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 666, __pyx_L1_error)
12005 __Pyx_GOTREF(__pyx_tuple__58);
12006 __Pyx_GIVEREF(__pyx_tuple__58);
12007 __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_icon, 666, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 666, __pyx_L1_error)
12441 __pyx_tuple__61 = PyTuple_Pack(1, __pyx_n_s_surface); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 666, __pyx_L1_error)
12442 __Pyx_GOTREF(__pyx_tuple__61);
12443 __Pyx_GIVEREF(__pyx_tuple__61);
12444 __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_icon, 666, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 666, __pyx_L1_error)
1200812445
1200912446 /* "pygame_sdl2/display.pyx":674
1201012447 * main_window.set_icon(default_icon)
1201312450 * global default_title
1201412451 *
1201512452 */
12016 __pyx_tuple__60 = PyTuple_Pack(2, __pyx_n_s_title, __pyx_n_s_icontitle); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 674, __pyx_L1_error)
12017 __Pyx_GOTREF(__pyx_tuple__60);
12018 __Pyx_GIVEREF(__pyx_tuple__60);
12019 __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_caption, 674, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 674, __pyx_L1_error)
12453 __pyx_tuple__63 = PyTuple_Pack(2, __pyx_n_s_title, __pyx_n_s_icontitle); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 674, __pyx_L1_error)
12454 __Pyx_GOTREF(__pyx_tuple__63);
12455 __Pyx_GIVEREF(__pyx_tuple__63);
12456 __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_set_caption, 674, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 674, __pyx_L1_error)
1202012457
1202112458 /* "pygame_sdl2/display.pyx":682
1202212459 * main_window.set_caption(default_title)
1202512462 * return default_title
1202612463 *
1202712464 */
12028 __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_caption, 682, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 682, __pyx_L1_error)
12465 __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_caption, 682, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 682, __pyx_L1_error)
1202912466
1203012467 /* "pygame_sdl2/display.pyx":685
1203112468 * return default_title
1203412471 * if main_window:
1203512472 * return main_window.get_drawable_size()
1203612473 */
12037 __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_drawable_size, 685, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 685, __pyx_L1_error)
12474 __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_drawable_size, 685, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 685, __pyx_L1_error)
1203812475
1203912476 /* "pygame_sdl2/display.pyx":690
1204012477 * return None
1204312480 * rv = SDL_GetNumVideoDisplays()
1204412481 * if rv < 0:
1204512482 */
12046 __pyx_tuple__64 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 690, __pyx_L1_error)
12047 __Pyx_GOTREF(__pyx_tuple__64);
12048 __Pyx_GIVEREF(__pyx_tuple__64);
12049 __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 690, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 690, __pyx_L1_error)
12483 __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 690, __pyx_L1_error)
12484 __Pyx_GOTREF(__pyx_tuple__67);
12485 __Pyx_GIVEREF(__pyx_tuple__67);
12486 __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_num_video_displays, 690, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 690, __pyx_L1_error)
1205012487
1205112488 /* "pygame_sdl2/display.pyx":697
1205212489 * return rv
1205512492 * cdef SDL_Rect rect
1205612493 * rv = SDL_GetDisplayBounds(index, &rect)
1205712494 */
12058 __pyx_tuple__66 = PyTuple_Pack(3, __pyx_n_s_index, __pyx_n_s_rect, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 697, __pyx_L1_error)
12059 __Pyx_GOTREF(__pyx_tuple__66);
12060 __Pyx_GIVEREF(__pyx_tuple__66);
12061 __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_display_bounds, 697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 697, __pyx_L1_error)
12495 __pyx_tuple__69 = PyTuple_Pack(3, __pyx_n_s_index, __pyx_n_s_rect, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 697, __pyx_L1_error)
12496 __Pyx_GOTREF(__pyx_tuple__69);
12497 __Pyx_GIVEREF(__pyx_tuple__69);
12498 __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_display_bounds, 697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 697, __pyx_L1_error)
1206212499
1206312500 /* "pygame_sdl2/display.pyx":703
1206412501 * return (rect.x, rect.y, rect.w, rect.h)
1206712504 * return SDL_GetPlatform()
1206812505 *
1206912506 */
12070 __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_platform, 703, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 703, __pyx_L1_error)
12507 __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_display_pyx, __pyx_n_s_get_platform, 703, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 703, __pyx_L1_error)
1207112508 __Pyx_RefNannyFinishContext();
1207212509 return 0;
1207312510 __pyx_L1_error:;
1208612523 return -1;
1208712524 }
1208812525
12526 static int __Pyx_modinit_global_init_code(void); /*proto*/
12527 static int __Pyx_modinit_variable_export_code(void); /*proto*/
12528 static int __Pyx_modinit_function_export_code(void); /*proto*/
12529 static int __Pyx_modinit_type_init_code(void); /*proto*/
12530 static int __Pyx_modinit_type_import_code(void); /*proto*/
12531 static int __Pyx_modinit_variable_import_code(void); /*proto*/
12532 static int __Pyx_modinit_function_import_code(void); /*proto*/
12533
12534 static int __Pyx_modinit_global_init_code(void) {
12535 __Pyx_RefNannyDeclarations
12536 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
12537 /*--- Global init code ---*/
12538 __pyx_v_11pygame_sdl2_7display_main_window = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None); Py_INCREF(Py_None);
12539 __Pyx_RefNannyFinishContext();
12540 return 0;
12541 }
12542
12543 static int __Pyx_modinit_variable_export_code(void) {
12544 __Pyx_RefNannyDeclarations
12545 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
12546 /*--- Variable export code ---*/
12547 if (__Pyx_ExportVoidPtr(__pyx_n_s_main_window, (void *)&__pyx_v_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12548 __Pyx_RefNannyFinishContext();
12549 return 0;
12550 __pyx_L1_error:;
12551 __Pyx_RefNannyFinishContext();
12552 return -1;
12553 }
12554
12555 static int __Pyx_modinit_function_export_code(void) {
12556 __Pyx_RefNannyDeclarations
12557 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
12558 /*--- Function export code ---*/
12559 if (__Pyx_ExportFunction("PyWindow_AsWindow", (void (*)(void))__pyx_f_11pygame_sdl2_7display_PyWindow_AsWindow, "SDL_Window *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12560 __Pyx_RefNannyFinishContext();
12561 return 0;
12562 __pyx_L1_error:;
12563 __Pyx_RefNannyFinishContext();
12564 return -1;
12565 }
12566
12567 static int __Pyx_modinit_type_init_code(void) {
12568 __Pyx_RefNannyDeclarations
12569 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
12570 /*--- Type init code ---*/
12571 if (PyType_Ready(&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
12572 __pyx_type_11pygame_sdl2_7display_Window.tp_print = 0;
12573 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11pygame_sdl2_7display_Window.tp_dictoffset && __pyx_type_11pygame_sdl2_7display_Window.tp_getattro == PyObject_GenericGetAttr)) {
12574 __pyx_type_11pygame_sdl2_7display_Window.tp_getattro = __Pyx_PyObject_GenericGetAttr;
12575 }
12576 if (PyObject_SetAttrString(__pyx_m, "Window", (PyObject *)&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
12577 if (__pyx_type_11pygame_sdl2_7display_Window.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_7display_Window.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_7display_Window, __weakref__);
12578 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
12579 __pyx_ptype_11pygame_sdl2_7display_Window = &__pyx_type_11pygame_sdl2_7display_Window;
12580 __Pyx_RefNannyFinishContext();
12581 return 0;
12582 __pyx_L1_error:;
12583 __Pyx_RefNannyFinishContext();
12584 return -1;
12585 }
12586
12587 static int __Pyx_modinit_type_import_code(void) {
12588 __Pyx_RefNannyDeclarations
12589 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
12590 /*--- Type import code ---*/
12591 __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(3, 23, __pyx_L1_error)
12592 __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(3, 23, __pyx_L1_error)
12593 __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType("pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_4rect_Rect)) __PYX_ERR(4, 21, __pyx_L1_error)
12594 __Pyx_RefNannyFinishContext();
12595 return 0;
12596 __pyx_L1_error:;
12597 __Pyx_RefNannyFinishContext();
12598 return -1;
12599 }
12600
12601 static int __Pyx_modinit_variable_import_code(void) {
12602 __Pyx_RefNannyDeclarations
12603 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
12604 /*--- Variable import code ---*/
12605 __Pyx_RefNannyFinishContext();
12606 return 0;
12607 }
12608
12609 static int __Pyx_modinit_function_import_code(void) {
12610 __Pyx_RefNannyDeclarations
12611 PyObject *__pyx_t_1 = NULL;
12612 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
12613 /*--- Function import code ---*/
12614 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
12615 if (__Pyx_ImportFunction(__pyx_t_1, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12616 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12617 __Pyx_RefNannyFinishContext();
12618 return 0;
12619 __pyx_L1_error:;
12620 __Pyx_XDECREF(__pyx_t_1);
12621 __Pyx_RefNannyFinishContext();
12622 return -1;
12623 }
12624
12625
1208912626 #if PY_MAJOR_VERSION < 3
12090 PyMODINIT_FUNC initdisplay(void); /*proto*/
12091 PyMODINIT_FUNC initdisplay(void)
12627 #ifdef CYTHON_NO_PYINIT_EXPORT
12628 #define __Pyx_PyMODINIT_FUNC void
1209212629 #else
12093 PyMODINIT_FUNC PyInit_display(void); /*proto*/
12094 PyMODINIT_FUNC PyInit_display(void)
12630 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
12631 #endif
12632 #else
12633 #ifdef CYTHON_NO_PYINIT_EXPORT
12634 #define __Pyx_PyMODINIT_FUNC PyObject *
12635 #else
12636 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
12637 #endif
12638 #endif
12639 #ifndef CYTHON_SMALL_CODE
12640 #if defined(__clang__)
12641 #define CYTHON_SMALL_CODE
12642 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
12643 #define CYTHON_SMALL_CODE __attribute__((cold))
12644 #else
12645 #define CYTHON_SMALL_CODE
12646 #endif
12647 #endif
12648
12649
12650 #if PY_MAJOR_VERSION < 3
12651 __Pyx_PyMODINIT_FUNC initdisplay(void) CYTHON_SMALL_CODE; /*proto*/
12652 __Pyx_PyMODINIT_FUNC initdisplay(void)
12653 #else
12654 __Pyx_PyMODINIT_FUNC PyInit_display(void) CYTHON_SMALL_CODE; /*proto*/
12655 __Pyx_PyMODINIT_FUNC PyInit_display(void)
12656 #if CYTHON_PEP489_MULTI_PHASE_INIT
12657 {
12658 return PyModuleDef_Init(&__pyx_moduledef);
12659 }
12660 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
12661 PyObject *value = PyObject_GetAttrString(spec, from_name);
12662 int result = 0;
12663 if (likely(value)) {
12664 result = PyDict_SetItemString(moddict, to_name, value);
12665 Py_DECREF(value);
12666 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
12667 PyErr_Clear();
12668 } else {
12669 result = -1;
12670 }
12671 return result;
12672 }
12673 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
12674 PyObject *module = NULL, *moddict, *modname;
12675 if (__pyx_m)
12676 return __Pyx_NewRef(__pyx_m);
12677 modname = PyObject_GetAttrString(spec, "name");
12678 if (unlikely(!modname)) goto bad;
12679 module = PyModule_NewObject(modname);
12680 Py_DECREF(modname);
12681 if (unlikely(!module)) goto bad;
12682 moddict = PyModule_GetDict(module);
12683 if (unlikely(!moddict)) goto bad;
12684 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
12685 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
12686 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
12687 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
12688 return module;
12689 bad:
12690 Py_XDECREF(module);
12691 return NULL;
12692 }
12693
12694
12695 static int __pyx_pymod_exec_display(PyObject *__pyx_pyinit_module)
12696 #endif
1209512697 #endif
1209612698 {
1209712699 PyObject *__pyx_t_1 = NULL;
1209812700 PyObject *__pyx_t_2 = NULL;
12099 PyObject *__pyx_t_3 = NULL;
12100 int __pyx_t_4;
12101 PyObject *__pyx_t_5 = NULL;
12102 PyObject *__pyx_t_6 = NULL;
12103 PyObject *__pyx_t_7 = NULL;
12701 int __pyx_t_3;
12702 PyObject *__pyx_t_4 = NULL;
1210412703 __Pyx_RefNannyDeclarations
12704 #if CYTHON_PEP489_MULTI_PHASE_INIT
12705 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
12706 #elif PY_MAJOR_VERSION >= 3
12707 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
12708 #endif
1210512709 #if CYTHON_REFNANNY
12106 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
12107 if (!__Pyx_RefNanny) {
12108 PyErr_Clear();
12109 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
12110 if (!__Pyx_RefNanny)
12111 Py_FatalError("failed to import 'refnanny' module");
12112 }
12113 #endif
12114 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_display(void)", 0);
12710 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
12711 if (!__Pyx_RefNanny) {
12712 PyErr_Clear();
12713 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
12714 if (!__Pyx_RefNanny)
12715 Py_FatalError("failed to import 'refnanny' module");
12716 }
12717 #endif
12718 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_display(void)", 0);
1211512719 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1211612720 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
1211712721 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
1212812732 #ifdef __Pyx_Generator_USED
1212912733 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1213012734 #endif
12735 #ifdef __Pyx_AsyncGen_USED
12736 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12737 #endif
1213112738 #ifdef __Pyx_StopAsyncIteration_USED
1213212739 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1213312740 #endif
1213912746 #endif
1214012747 #endif
1214112748 /*--- Module creation code ---*/
12749 #if CYTHON_PEP489_MULTI_PHASE_INIT
12750 __pyx_m = __pyx_pyinit_module;
12751 Py_INCREF(__pyx_m);
12752 #else
1214212753 #if PY_MAJOR_VERSION < 3
1214312754 __pyx_m = Py_InitModule4("display", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
1214412755 #else
1214512756 __pyx_m = PyModule_Create(&__pyx_moduledef);
1214612757 #endif
1214712758 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
12759 #endif
1214812760 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
1214912761 Py_INCREF(__pyx_d);
1215012762 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
12763 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
1215112764 #if CYTHON_COMPILING_IN_PYPY
1215212765 Py_INCREF(__pyx_b);
1215312766 #endif
1217212785 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1217312786 /*--- Constants init code ---*/
1217412787 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12175 /*--- Global init code ---*/
12176 __pyx_v_11pygame_sdl2_7display_main_window = ((struct __pyx_obj_11pygame_sdl2_7display_Window *)Py_None); Py_INCREF(Py_None);
12177 /*--- Variable export code ---*/
12178 if (__Pyx_ExportVoidPtr(__pyx_n_s_main_window, (void *)&__pyx_v_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12179 /*--- Function export code ---*/
12180 if (__Pyx_ExportFunction("PyWindow_AsWindow", (void (*)(void))__pyx_f_11pygame_sdl2_7display_PyWindow_AsWindow, "SDL_Window *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12181 /*--- Type init code ---*/
12182 if (PyType_Ready(&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
12183 __pyx_type_11pygame_sdl2_7display_Window.tp_print = 0;
12184 if (PyObject_SetAttrString(__pyx_m, "Window", (PyObject *)&__pyx_type_11pygame_sdl2_7display_Window) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
12185 if (__pyx_type_11pygame_sdl2_7display_Window.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_7display_Window.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_7display_Window, __weakref__);
12186 __pyx_ptype_11pygame_sdl2_7display_Window = &__pyx_type_11pygame_sdl2_7display_Window;
12187 /*--- Type import code ---*/
12188 __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error)
12189 __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error)
12190 __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType("pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_4rect_Rect)) __PYX_ERR(3, 21, __pyx_L1_error)
12191 /*--- Variable import code ---*/
12192 /*--- Function import code ---*/
12193 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
12194 if (__Pyx_ImportFunction(__pyx_t_1, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12195 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12788 /*--- Global type/function init code ---*/
12789 (void)__Pyx_modinit_global_init_code();
12790 if (unlikely(__Pyx_modinit_variable_export_code() != 0)) goto __pyx_L1_error;
12791 if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error;
12792 if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
12793 if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
12794 (void)__Pyx_modinit_variable_import_code();
12795 if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error;
1219612796 /*--- Execution code ---*/
1219712797 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
1219812798 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1220512805 * from pygame_sdl2.error import error
1220612806 * import pygame_sdl2
1220712807 */
12208 __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
12209 __Pyx_GOTREF(__pyx_t_2);
12808 __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
12809 __Pyx_GOTREF(__pyx_t_1);
1221012810 __Pyx_INCREF(__pyx_n_s_SRCALPHA);
1221112811 __Pyx_GIVEREF(__pyx_n_s_SRCALPHA);
12212 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_SRCALPHA);
12812 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_SRCALPHA);
1221312813 __Pyx_INCREF(__pyx_n_s_GL_SWAP_CONTROL);
1221412814 __Pyx_GIVEREF(__pyx_n_s_GL_SWAP_CONTROL);
12215 PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_GL_SWAP_CONTROL);
12216 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_locals, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
12217 __Pyx_GOTREF(__pyx_t_3);
12815 PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_GL_SWAP_CONTROL);
12816 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_locals, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
12817 __Pyx_GOTREF(__pyx_t_2);
12818 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12819 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
12820 __Pyx_GOTREF(__pyx_t_1);
12821 if (PyDict_SetItem(__pyx_d, __pyx_n_s_SRCALPHA, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
12822 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12823 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
12824 __Pyx_GOTREF(__pyx_t_1);
12825 if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_SWAP_CONTROL, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
12826 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1221812827 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12219 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
12220 __Pyx_GOTREF(__pyx_t_2);
12221 if (PyDict_SetItem(__pyx_d, __pyx_n_s_SRCALPHA, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
12222 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12223 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_GL_SWAP_CONTROL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
12224 __Pyx_GOTREF(__pyx_t_2);
12225 if (PyDict_SetItem(__pyx_d, __pyx_n_s_GL_SWAP_CONTROL, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
12226 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12227 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1222812828
1222912829 /* "pygame_sdl2/display.pyx":26
1223012830 * from libc.stdlib cimport calloc, free
1223312833 * import pygame_sdl2
1223412834 *
1223512835 */
12236 __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
12237 __Pyx_GOTREF(__pyx_t_3);
12836 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
12837 __Pyx_GOTREF(__pyx_t_2);
1223812838 __Pyx_INCREF(__pyx_n_s_error);
1223912839 __Pyx_GIVEREF(__pyx_n_s_error);
12240 PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_error);
12241 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
12840 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error);
12841 __pyx_t_1 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
12842 __Pyx_GOTREF(__pyx_t_1);
12843 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12844 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
1224212845 __Pyx_GOTREF(__pyx_t_2);
12243 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12244 __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
12245 __Pyx_GOTREF(__pyx_t_3);
12246 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
12247 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12846 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
1224812847 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12848 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1224912849
1225012850 /* "pygame_sdl2/display.pyx":27
1225112851 * from pygame_sdl2.locals import SRCALPHA, GL_SWAP_CONTROL
1225412854 *
1225512855 * import warnings
1225612856 */
12257 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
12258 __Pyx_GOTREF(__pyx_t_2);
12259 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
12260 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12857 __pyx_t_1 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
12858 __Pyx_GOTREF(__pyx_t_1);
12859 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_1) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
12860 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1226112861
1226212862 /* "pygame_sdl2/display.pyx":29
1226312863 * import pygame_sdl2
1226612866 * import os
1226712867 *
1226812868 */
12269 __pyx_t_2 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
12270 __Pyx_GOTREF(__pyx_t_2);
12271 if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
12272 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12869 __pyx_t_1 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
12870 __Pyx_GOTREF(__pyx_t_1);
12871 if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
12872 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1227312873
1227412874 /* "pygame_sdl2/display.pyx":30
1227512875 *
1227812878 *
1227912879 * # True if we are on ios.
1228012880 */
12281 __pyx_t_2 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
12282 __Pyx_GOTREF(__pyx_t_2);
12283 if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
12284 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12881 __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
12882 __Pyx_GOTREF(__pyx_t_1);
12883 if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
12884 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1228512885
1228612886 /* "pygame_sdl2/display.pyx":33
1228712887 *
1229012890 *
1229112891 * # This inits SDL proper, and should be called by the other init methods.
1229212892 */
12293 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
12893 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
12894 __Pyx_GOTREF(__pyx_t_1);
12895 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_environ); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
1229412896 __Pyx_GOTREF(__pyx_t_2);
12295 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_environ); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)
12296 __Pyx_GOTREF(__pyx_t_3);
12897 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12898 __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_PYGAME_IOS, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 33, __pyx_L1_error)
1229712899 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12298 __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_n_u_PYGAME_IOS, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 33, __pyx_L1_error)
12299 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12300 __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)
12301 __Pyx_GOTREF(__pyx_t_3);
12302 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ios, __pyx_t_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
12303 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12900 __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
12901 __Pyx_GOTREF(__pyx_t_2);
12902 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ios, __pyx_t_2) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
12903 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1230412904
1230512905 /* "pygame_sdl2/display.pyx":38
1230612906 *
1230912909 *
1231012910 * def hint(hint, value):
1231112911 */
12312 __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error)
12313 __Pyx_GOTREF(__pyx_t_3);
12314 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_hints, __pyx_t_3) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
12315 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12912 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error)
12913 __Pyx_GOTREF(__pyx_t_2);
12914 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_hints, __pyx_t_2) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
12915 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1231612916
1231712917 /* "pygame_sdl2/display.pyx":40
1231812918 * _pygame_hints = { }
1232112921 *
1232212922 * if str(hint).startswith("PYGAME_SDL2"):
1232312923 */
12324 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_1hint, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error)
12325 __Pyx_GOTREF(__pyx_t_3);
12326 if (PyDict_SetItem(__pyx_d, __pyx_n_s_hint, __pyx_t_3) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
12327 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12924 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_1hint, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
12925 __Pyx_GOTREF(__pyx_t_2);
12926 if (PyDict_SetItem(__pyx_d, __pyx_n_s_hint, __pyx_t_2) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
12927 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1232812928
1232912929 /* "pygame_sdl2/display.pyx":55
1233012930 * SDL_SetHint(hint, value)
1233312933 * hint = str(hint)
1233412934 *
1233512935 */
12336 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_3_get_hint, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error)
12337 __Pyx_GOTREF(__pyx_t_3);
12338 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hint, __pyx_t_3) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
12339 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12936 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_3_get_hint, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
12937 __Pyx_GOTREF(__pyx_t_2);
12938 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hint, __pyx_t_2) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
12939 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1234012940
1234112941 /* "pygame_sdl2/display.pyx":67
1234212942 *
1235412954 * global main_done
1235512955 *
1235612956 */
12357 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_5sdl_main_init, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error)
12358 __Pyx_GOTREF(__pyx_t_3);
12359 if (PyDict_SetItem(__pyx_d, __pyx_n_s_sdl_main_init, __pyx_t_3) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
12360 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12957 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_5sdl_main_init, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error)
12958 __Pyx_GOTREF(__pyx_t_2);
12959 if (PyDict_SetItem(__pyx_d, __pyx_n_s_sdl_main_init, __pyx_t_2) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
12960 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1236112961
1236212962 /* "pygame_sdl2/display.pyx":83
1236312963 *
1237712977 */
1237812978 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
1237912979 __Pyx_GOTREF(__pyx_t_2);
12380 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_register_init); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 85, __pyx_L1_error)
12381 __Pyx_GOTREF(__pyx_t_5);
12980 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_register_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
12981 __Pyx_GOTREF(__pyx_t_1);
1238212982 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1238312983
1238412984 /* "pygame_sdl2/display.pyx":86
1239012990 */
1239112991 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_7init, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
1239212992 __Pyx_GOTREF(__pyx_t_2);
12393 __pyx_t_6 = NULL;
12394 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
12395 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
12396 if (likely(__pyx_t_6)) {
12397 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
12398 __Pyx_INCREF(__pyx_t_6);
12399 __Pyx_INCREF(function);
12400 __Pyx_DECREF_SET(__pyx_t_5, function);
12401 }
12402 }
12403 if (!__pyx_t_6) {
12404 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
12405 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12406 __Pyx_GOTREF(__pyx_t_3);
12407 } else {
12408 #if CYTHON_FAST_PYCALL
12409 if (PyFunction_Check(__pyx_t_5)) {
12410 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_2};
12411 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
12412 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12413 __Pyx_GOTREF(__pyx_t_3);
12414 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12415 } else
12416 #endif
12417 #if CYTHON_FAST_PYCCALL
12418 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12419 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_2};
12420 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
12421 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12422 __Pyx_GOTREF(__pyx_t_3);
12423 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12424 } else
12425 #endif
12426 {
12427 __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 85, __pyx_L1_error)
12428 __Pyx_GOTREF(__pyx_t_7);
12429 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
12430 __Pyx_GIVEREF(__pyx_t_2);
12431 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_2);
12432 __pyx_t_2 = 0;
12433 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
12434 __Pyx_GOTREF(__pyx_t_3);
12435 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12436 }
12437 }
12438 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12439 if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
12440 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12993
12994 /* "pygame_sdl2/display.pyx":85
12995 * init_done = False
12996 *
12997 * @pygame_sdl2.register_init # <<<<<<<<<<<<<<
12998 * def init():
12999 *
13000 */
13001 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error)
13002 __Pyx_GOTREF(__pyx_t_4);
13003 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13004 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13005 if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
13006 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1244113007
1244213008 /* "pygame_sdl2/display.pyx":105
1244313009 *
1244613012 * def quit(): # @ReservedAssignment
1244713013 *
1244813014 */
12449 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 105, __pyx_L1_error)
12450 __Pyx_GOTREF(__pyx_t_5);
12451 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 105, __pyx_L1_error)
12452 __Pyx_GOTREF(__pyx_t_7);
12453 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13015 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error)
13016 __Pyx_GOTREF(__pyx_t_4);
13017 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
13018 __Pyx_GOTREF(__pyx_t_2);
13019 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1245413020
1245513021 /* "pygame_sdl2/display.pyx":106
1245613022 *
1245913025 *
1246013026 * global init_done
1246113027 */
12462 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_9quit, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 106, __pyx_L1_error)
12463 __Pyx_GOTREF(__pyx_t_5);
12464 __pyx_t_2 = NULL;
12465 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
12466 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
12467 if (likely(__pyx_t_2)) {
12468 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
12469 __Pyx_INCREF(__pyx_t_2);
12470 __Pyx_INCREF(function);
12471 __Pyx_DECREF_SET(__pyx_t_7, function);
12472 }
12473 }
12474 if (!__pyx_t_2) {
12475 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error)
12476 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12477 __Pyx_GOTREF(__pyx_t_3);
12478 } else {
12479 #if CYTHON_FAST_PYCALL
12480 if (PyFunction_Check(__pyx_t_7)) {
12481 PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_5};
12482 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error)
12483 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12484 __Pyx_GOTREF(__pyx_t_3);
12485 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12486 } else
12487 #endif
12488 #if CYTHON_FAST_PYCCALL
12489 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
12490 PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_5};
12491 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error)
12492 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12493 __Pyx_GOTREF(__pyx_t_3);
12494 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12495 } else
12496 #endif
12497 {
12498 __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 105, __pyx_L1_error)
12499 __Pyx_GOTREF(__pyx_t_6);
12500 __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
12501 __Pyx_GIVEREF(__pyx_t_5);
12502 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
12503 __pyx_t_5 = 0;
12504 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error)
12505 __Pyx_GOTREF(__pyx_t_3);
12506 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12507 }
12508 }
12509 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12510 if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_3) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
12511 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13028 __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_9quit, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error)
13029 __Pyx_GOTREF(__pyx_t_4);
13030
13031 /* "pygame_sdl2/display.pyx":105
13032 *
13033 *
13034 * @pygame_sdl2.register_quit # <<<<<<<<<<<<<<
13035 * def quit(): # @ReservedAssignment
13036 *
13037 */
13038 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
13039 __Pyx_GOTREF(__pyx_t_1);
13040 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13041 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13042 if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_1) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
13043 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1251213044
1251313045 /* "pygame_sdl2/display.pyx":117
1251413046 * init_done = False
1251713049 * return init_done
1251813050 *
1251913051 */
12520 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_11get_init, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error)
12521 __Pyx_GOTREF(__pyx_t_3);
12522 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_3) < 0) __PYX_ERR(0, 117, __pyx_L1_error)
12523 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13052 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_11get_init, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
13053 __Pyx_GOTREF(__pyx_t_1);
13054 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_1) < 0) __PYX_ERR(0, 117, __pyx_L1_error)
13055 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1252413056
1252513057 /* "pygame_sdl2/display.pyx":122
1252613058 *
1255013082 * global _shown_first_window
1255113083 *
1255213084 */
12553 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_13_before_first_window, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error)
12554 __Pyx_GOTREF(__pyx_t_3);
12555 if (PyDict_SetItem(__pyx_d, __pyx_n_s_before_first_window, __pyx_t_3) < 0) __PYX_ERR(0, 127, __pyx_L1_error)
12556 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13085 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_13_before_first_window, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
13086 __Pyx_GOTREF(__pyx_t_1);
13087 if (PyDict_SetItem(__pyx_d, __pyx_n_s_before_first_window, __pyx_t_1) < 0) __PYX_ERR(0, 127, __pyx_L1_error)
13088 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1255713089
1255813090 /* "pygame_sdl2/display.pyx":146
1255913091 *
1256213094 *
1256313095 * if not isinstance(title, bytes):
1256413096 */
12565 __pyx_t_3 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
12566 __Pyx_GOTREF(__pyx_t_3);
12567 __pyx_t_7 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 146, __pyx_L1_error)
12568 __Pyx_GOTREF(__pyx_t_7);
12569 __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 146, __pyx_L1_error)
12570 __Pyx_GOTREF(__pyx_t_6);
12571 __Pyx_GIVEREF(__pyx_t_3);
12572 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
12573 __Pyx_GIVEREF(__pyx_t_7);
12574 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
12575 __pyx_t_3 = 0;
12576 __pyx_t_7 = 0;
12577 __pyx_k__5 = __pyx_t_6;
12578 __Pyx_GIVEREF(__pyx_t_6);
12579 __pyx_t_6 = 0;
13097 __pyx_t_1 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
13098 __Pyx_GOTREF(__pyx_t_1);
13099 __pyx_t_4 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
13100 __Pyx_GOTREF(__pyx_t_4);
13101 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
13102 __Pyx_GOTREF(__pyx_t_2);
13103 __Pyx_GIVEREF(__pyx_t_1);
13104 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
13105 __Pyx_GIVEREF(__pyx_t_4);
13106 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
13107 __pyx_t_1 = 0;
13108 __pyx_t_4 = 0;
13109 __pyx_k__5 = __pyx_t_2;
13110 __Pyx_GIVEREF(__pyx_t_2);
13111 __pyx_t_2 = 0;
1258013112
1258113113 /* "pygame_sdl2/display.pyx":420
1258213114 *
1261213144 * global main_window
1261313145 *
1261413146 */
12615 __pyx_t_6 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 428, __pyx_L1_error)
12616 __Pyx_GOTREF(__pyx_t_6);
12617 __pyx_t_7 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L1_error)
12618 __Pyx_GOTREF(__pyx_t_7);
12619 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error)
12620 __Pyx_GOTREF(__pyx_t_3);
12621 __Pyx_GIVEREF(__pyx_t_6);
12622 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
12623 __Pyx_GIVEREF(__pyx_t_7);
12624 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
12625 __pyx_t_6 = 0;
12626 __pyx_t_7 = 0;
12627 __pyx_k__12 = __pyx_t_3;
12628 __Pyx_GIVEREF(__pyx_t_3);
12629 __pyx_t_3 = 0;
12630 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_15set_mode, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error)
12631 __Pyx_GOTREF(__pyx_t_3);
12632 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mode, __pyx_t_3) < 0) __PYX_ERR(0, 428, __pyx_L1_error)
12633 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13147 __pyx_t_2 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __pyx_L1_error)
13148 __Pyx_GOTREF(__pyx_t_2);
13149 __pyx_t_4 = __Pyx_PyInt_From_int(SDL_WINDOWPOS_UNDEFINED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error)
13150 __Pyx_GOTREF(__pyx_t_4);
13151 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error)
13152 __Pyx_GOTREF(__pyx_t_1);
13153 __Pyx_GIVEREF(__pyx_t_2);
13154 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
13155 __Pyx_GIVEREF(__pyx_t_4);
13156 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
13157 __pyx_t_2 = 0;
13158 __pyx_t_4 = 0;
13159 __pyx_k__14 = __pyx_t_1;
13160 __Pyx_GIVEREF(__pyx_t_1);
13161 __pyx_t_1 = 0;
13162 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_15set_mode, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error)
13163 __Pyx_GOTREF(__pyx_t_1);
13164 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mode, __pyx_t_1) < 0) __PYX_ERR(0, 428, __pyx_L1_error)
13165 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1263413166
1263513167 /* "pygame_sdl2/display.pyx":447
1263613168 * return main_window.surface
1263913171 * if main_window is None:
1264013172 * return None
1264113173 */
12642 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_17get_surface, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error)
12643 __Pyx_GOTREF(__pyx_t_3);
12644 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_surface, __pyx_t_3) < 0) __PYX_ERR(0, 447, __pyx_L1_error)
12645 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13174 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_17get_surface, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
13175 __Pyx_GOTREF(__pyx_t_1);
13176 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_surface, __pyx_t_1) < 0) __PYX_ERR(0, 447, __pyx_L1_error)
13177 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1264613178
1264713179 /* "pygame_sdl2/display.pyx":453
1264813180 * return main_window.get_surface()
1265113183 * """
1265213184 * Returns the Window created by set_mode, or None if no such window
1265313185 */
12654 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_19get_window, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error)
12655 __Pyx_GOTREF(__pyx_t_3);
12656 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_window, __pyx_t_3) < 0) __PYX_ERR(0, 453, __pyx_L1_error)
12657 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13186 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_19get_window, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error)
13187 __Pyx_GOTREF(__pyx_t_1);
13188 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_window, __pyx_t_1) < 0) __PYX_ERR(0, 453, __pyx_L1_error)
13189 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1265813190
1265913191 /* "pygame_sdl2/display.pyx":461
1266013192 * return main_window
1266313195 * if main_window:
1266413196 * main_window.flip()
1266513197 */
12666 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_21flip, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L1_error)
12667 __Pyx_GOTREF(__pyx_t_3);
12668 if (PyDict_SetItem(__pyx_d, __pyx_n_s_flip, __pyx_t_3) < 0) __PYX_ERR(0, 461, __pyx_L1_error)
12669 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13198 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_21flip, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error)
13199 __Pyx_GOTREF(__pyx_t_1);
13200 if (PyDict_SetItem(__pyx_d, __pyx_n_s_flip, __pyx_t_1) < 0) __PYX_ERR(0, 461, __pyx_L1_error)
13201 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1267013202
1267113203 /* "pygame_sdl2/display.pyx":465
1267213204 * main_window.flip()
1267513207 * if main_window:
1267613208 * main_window.update(rectangles)
1267713209 */
12678 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_23update, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error)
12679 __Pyx_GOTREF(__pyx_t_3);
12680 if (PyDict_SetItem(__pyx_d, __pyx_n_s_update, __pyx_t_3) < 0) __PYX_ERR(0, 465, __pyx_L1_error)
12681 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13210 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_23update, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
13211 __Pyx_GOTREF(__pyx_t_1);
13212 if (PyDict_SetItem(__pyx_d, __pyx_n_s_update, __pyx_t_1) < 0) __PYX_ERR(0, 465, __pyx_L1_error)
13213 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1268213214
1268313215 /* "pygame_sdl2/display.pyx":469
1268413216 * main_window.update(rectangles)
1268713219 * cdef const char *driver = SDL_GetCurrentVideoDriver()
1268813220 *
1268913221 */
12690 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_25get_driver, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error)
12691 __Pyx_GOTREF(__pyx_t_3);
12692 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_driver, __pyx_t_3) < 0) __PYX_ERR(0, 469, __pyx_L1_error)
12693 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13222 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_25get_driver, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error)
13223 __Pyx_GOTREF(__pyx_t_1);
13224 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_driver, __pyx_t_1) < 0) __PYX_ERR(0, 469, __pyx_L1_error)
13225 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1269413226
1269513227 /* "pygame_sdl2/display.pyx":477
1269613228 * return driver
1269913231 *
1270013232 * def __init__(self):
1270113233 */
12702 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 477, __pyx_L1_error)
12703 __Pyx_GOTREF(__pyx_t_3);
12704 __Pyx_INCREF(__pyx_builtin_object);
12705 __Pyx_GIVEREF(__pyx_builtin_object);
12706 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_builtin_object);
12707 __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 477, __pyx_L1_error)
12708 __Pyx_GOTREF(__pyx_t_7);
12709 __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_3, __pyx_n_s_Info, __pyx_n_s_Info, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_display, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 477, __pyx_L1_error)
12710 __Pyx_GOTREF(__pyx_t_6);
13234 __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__34); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
13235 __Pyx_GOTREF(__pyx_t_1);
13236 __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__34, __pyx_n_s_Info, __pyx_n_s_Info, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_display, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 477, __pyx_L1_error)
13237 __Pyx_GOTREF(__pyx_t_4);
1271113238
1271213239 /* "pygame_sdl2/display.pyx":479
1271313240 * class Info(object):
1271613243 * cdef SDL_DisplayMode dm
1271713244 * cdef SDL_PixelFormat *format
1271813245 */
12719 __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_4Info_1__init__, 0, __pyx_n_s_Info___init, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 479, __pyx_L1_error)
12720 __Pyx_GOTREF(__pyx_t_5);
12721 if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_init_2, __pyx_t_5) < 0) __PYX_ERR(0, 479, __pyx_L1_error)
12722 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13246 __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_4Info_1__init__, 0, __pyx_n_s_Info___init, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error)
13247 __Pyx_GOTREF(__pyx_t_2);
13248 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init_2, __pyx_t_2) < 0) __PYX_ERR(0, 479, __pyx_L1_error)
13249 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1272313250
1272413251 /* "pygame_sdl2/display.pyx":538
1272513252 * self.blit_sw_A = False
1272813255 * return "<Info({!r})>".format(self.__dict__)
1272913256 *
1273013257 */
12731 __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_4Info_3__repr__, 0, __pyx_n_s_Info___repr, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 538, __pyx_L1_error)
12732 __Pyx_GOTREF(__pyx_t_5);
12733 if (PyObject_SetItem(__pyx_t_6, __pyx_n_s_repr, __pyx_t_5) < 0) __PYX_ERR(0, 538, __pyx_L1_error)
12734 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13258 __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_4Info_3__repr__, 0, __pyx_n_s_Info___repr, NULL, __pyx_n_s_pygame_sdl2_display, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
13259 __Pyx_GOTREF(__pyx_t_2);
13260 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_repr, __pyx_t_2) < 0) __PYX_ERR(0, 538, __pyx_L1_error)
13261 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1273513262
1273613263 /* "pygame_sdl2/display.pyx":477
1273713264 * return driver
1274013267 *
1274113268 * def __init__(self):
1274213269 */
12743 __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_Info, __pyx_t_3, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 477, __pyx_L1_error)
12744 __Pyx_GOTREF(__pyx_t_5);
12745 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Info, __pyx_t_5) < 0) __PYX_ERR(0, 477, __pyx_L1_error)
12746 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12747 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12748 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12749 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13270 __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Info, __pyx_tuple__34, __pyx_t_4, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error)
13271 __Pyx_GOTREF(__pyx_t_2);
13272 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Info, __pyx_t_2) < 0) __PYX_ERR(0, 477, __pyx_L1_error)
13273 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13274 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13275 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1275013276
1275113277 /* "pygame_sdl2/display.pyx":542
1275213278 *
1275513281 * if main_window:
1275613282 * return main_window.get_wm_info()
1275713283 */
12758 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_27get_wm_info, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L1_error)
12759 __Pyx_GOTREF(__pyx_t_3);
12760 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_wm_info, __pyx_t_3) < 0) __PYX_ERR(0, 542, __pyx_L1_error)
12761 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13284 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_27get_wm_info, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error)
13285 __Pyx_GOTREF(__pyx_t_1);
13286 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_wm_info, __pyx_t_1) < 0) __PYX_ERR(0, 542, __pyx_L1_error)
13287 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1276213288
1276313289 /* "pygame_sdl2/display.pyx":549
1276413290 *
1276713293 * """
1276813294 * Returns the number of video displays connected to the system.
1276913295 */
12770 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_29get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 549, __pyx_L1_error)
12771 __Pyx_GOTREF(__pyx_t_3);
12772 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_3) < 0) __PYX_ERR(0, 549, __pyx_L1_error)
12773 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13296 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_29get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error)
13297 __Pyx_GOTREF(__pyx_t_1);
13298 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_1) < 0) __PYX_ERR(0, 549, __pyx_L1_error)
13299 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1277413300
1277513301 /* "pygame_sdl2/display.pyx":562
1277613302 *
1277913305 * """
1278013306 * Returns a list of possible display modes for the display `display`.
1278113307 */
12782 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_31list_modes, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error)
12783 __Pyx_GOTREF(__pyx_t_3);
12784 if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_modes, __pyx_t_3) < 0) __PYX_ERR(0, 562, __pyx_L1_error)
12785 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13308 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_31list_modes, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error)
13309 __Pyx_GOTREF(__pyx_t_1);
13310 if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_modes, __pyx_t_1) < 0) __PYX_ERR(0, 562, __pyx_L1_error)
13311 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1278613312
1278713313 /* "pygame_sdl2/display.pyx":587
1278813314 *
1279113317 * """
1279213318 * Returns true if size is in the result of list_modes().
1279313319 */
12794 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_33mode_ok, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error)
12795 __Pyx_GOTREF(__pyx_t_3);
12796 if (PyDict_SetItem(__pyx_d, __pyx_n_s_mode_ok, __pyx_t_3) < 0) __PYX_ERR(0, 587, __pyx_L1_error)
12797 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13320 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_33mode_ok, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error)
13321 __Pyx_GOTREF(__pyx_t_1);
13322 if (PyDict_SetItem(__pyx_d, __pyx_n_s_mode_ok, __pyx_t_1) < 0) __PYX_ERR(0, 587, __pyx_L1_error)
13323 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1279813324
1279913325 /* "pygame_sdl2/display.pyx":594
1280013326 * return tuple(size) in list_modes()
1280313329 * SDL_GL_ResetAttributes()
1280413330 *
1280513331 */
12806 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_35gl_reset_attributes, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error)
12807 __Pyx_GOTREF(__pyx_t_3);
12808 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_reset_attributes, __pyx_t_3) < 0) __PYX_ERR(0, 594, __pyx_L1_error)
12809 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13332 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_35gl_reset_attributes, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __pyx_L1_error)
13333 __Pyx_GOTREF(__pyx_t_1);
13334 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_reset_attributes, __pyx_t_1) < 0) __PYX_ERR(0, 594, __pyx_L1_error)
13335 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1281013336
1281113337 /* "pygame_sdl2/display.pyx":597
1281213338 * SDL_GL_ResetAttributes()
1281513341 *
1281613342 * if flag == GL_SWAP_CONTROL:
1281713343 */
12818 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_37gl_set_attribute, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error)
12819 __Pyx_GOTREF(__pyx_t_3);
12820 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_set_attribute, __pyx_t_3) < 0) __PYX_ERR(0, 597, __pyx_L1_error)
12821 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13344 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_37gl_set_attribute, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error)
13345 __Pyx_GOTREF(__pyx_t_1);
13346 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_set_attribute, __pyx_t_1) < 0) __PYX_ERR(0, 597, __pyx_L1_error)
13347 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1282213348
1282313349 /* "pygame_sdl2/display.pyx":617
1282413350 * raise error()
1282713353 * cdef int rv
1282813354 *
1282913355 */
12830 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_39gl_get_attribute, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 617, __pyx_L1_error)
12831 __Pyx_GOTREF(__pyx_t_3);
12832 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_get_attribute, __pyx_t_3) < 0) __PYX_ERR(0, 617, __pyx_L1_error)
12833 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13356 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_39gl_get_attribute, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error)
13357 __Pyx_GOTREF(__pyx_t_1);
13358 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_get_attribute, __pyx_t_1) < 0) __PYX_ERR(0, 617, __pyx_L1_error)
13359 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1283413360
1283513361 /* "pygame_sdl2/display.pyx":628
1283613362 * return rv
1283913365 * if path is None:
1284013366 * if SDL_GL_LoadLibrary(NULL):
1284113367 */
12842 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_41gl_load_library, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 628, __pyx_L1_error)
12843 __Pyx_GOTREF(__pyx_t_3);
12844 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_load_library, __pyx_t_3) < 0) __PYX_ERR(0, 628, __pyx_L1_error)
12845 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13368 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_41gl_load_library, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error)
13369 __Pyx_GOTREF(__pyx_t_1);
13370 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_load_library, __pyx_t_1) < 0) __PYX_ERR(0, 628, __pyx_L1_error)
13371 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1284613372
1284713373 /* "pygame_sdl2/display.pyx":636
1284813374 * raise error()
1285113377 * SDL_GL_UnloadLibrary()
1285213378 *
1285313379 */
12854 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_43gl_unload_library, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 636, __pyx_L1_error)
12855 __Pyx_GOTREF(__pyx_t_3);
12856 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_unload_library, __pyx_t_3) < 0) __PYX_ERR(0, 636, __pyx_L1_error)
12857 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13380 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_43gl_unload_library, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error)
13381 __Pyx_GOTREF(__pyx_t_1);
13382 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gl_unload_library, __pyx_t_1) < 0) __PYX_ERR(0, 636, __pyx_L1_error)
13383 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1285813384
1285913385 /* "pygame_sdl2/display.pyx":639
1286013386 * SDL_GL_UnloadLibrary()
1286313389 * if main_window:
1286413390 * return main_window.get_active()
1286513391 */
12866 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_45get_active, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 639, __pyx_L1_error)
12867 __Pyx_GOTREF(__pyx_t_3);
12868 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_active, __pyx_t_3) < 0) __PYX_ERR(0, 639, __pyx_L1_error)
12869 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13392 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_45get_active, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 639, __pyx_L1_error)
13393 __Pyx_GOTREF(__pyx_t_1);
13394 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_active, __pyx_t_1) < 0) __PYX_ERR(0, 639, __pyx_L1_error)
13395 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1287013396
1287113397 /* "pygame_sdl2/display.pyx":644
1287213398 * return False
1287513401 * if main_window:
1287613402 * return main_window.iconify()
1287713403 */
12878 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_47iconify, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 644, __pyx_L1_error)
12879 __Pyx_GOTREF(__pyx_t_3);
12880 if (PyDict_SetItem(__pyx_d, __pyx_n_s_iconify, __pyx_t_3) < 0) __PYX_ERR(0, 644, __pyx_L1_error)
12881 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13404 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_47iconify, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 644, __pyx_L1_error)
13405 __Pyx_GOTREF(__pyx_t_1);
13406 if (PyDict_SetItem(__pyx_d, __pyx_n_s_iconify, __pyx_t_1) < 0) __PYX_ERR(0, 644, __pyx_L1_error)
13407 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1288213408
1288313409 /* "pygame_sdl2/display.pyx":650
1288413410 * return False
1288713413 * if main_window:
1288813414 * return main_window.toggle_fullscreen()
1288913415 */
12890 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_49toggle_fullscreen, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 650, __pyx_L1_error)
12891 __Pyx_GOTREF(__pyx_t_3);
12892 if (PyDict_SetItem(__pyx_d, __pyx_n_s_toggle_fullscreen, __pyx_t_3) < 0) __PYX_ERR(0, 650, __pyx_L1_error)
12893 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13416 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_49toggle_fullscreen, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error)
13417 __Pyx_GOTREF(__pyx_t_1);
13418 if (PyDict_SetItem(__pyx_d, __pyx_n_s_toggle_fullscreen, __pyx_t_1) < 0) __PYX_ERR(0, 650, __pyx_L1_error)
13419 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1289413420
1289513421 /* "pygame_sdl2/display.pyx":656
1289613422 * return True
1289913425 * if main_window:
1290013426 * return main_window.set_gamma(red, green, blue)
1290113427 */
12902 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_51set_gamma, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 656, __pyx_L1_error)
12903 __Pyx_GOTREF(__pyx_t_3);
12904 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma, __pyx_t_3) < 0) __PYX_ERR(0, 656, __pyx_L1_error)
12905 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13428 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_51set_gamma, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error)
13429 __Pyx_GOTREF(__pyx_t_1);
13430 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma, __pyx_t_1) < 0) __PYX_ERR(0, 656, __pyx_L1_error)
13431 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1290613432
1290713433 /* "pygame_sdl2/display.pyx":661
1290813434 * return False
1291113437 * if main_window:
1291213438 * return main_window.set_gamma_ramp(red, green, blue)
1291313439 */
12914 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_53set_gamma_ramp, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error)
12915 __Pyx_GOTREF(__pyx_t_3);
12916 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma_ramp, __pyx_t_3) < 0) __PYX_ERR(0, 661, __pyx_L1_error)
12917 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13440 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_53set_gamma_ramp, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error)
13441 __Pyx_GOTREF(__pyx_t_1);
13442 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_gamma_ramp, __pyx_t_1) < 0) __PYX_ERR(0, 661, __pyx_L1_error)
13443 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1291813444
1291913445 /* "pygame_sdl2/display.pyx":666
1292013446 * return False
1292313449 * global default_icon
1292413450 *
1292513451 */
12926 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_55set_icon, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 666, __pyx_L1_error)
12927 __Pyx_GOTREF(__pyx_t_3);
12928 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_icon, __pyx_t_3) < 0) __PYX_ERR(0, 666, __pyx_L1_error)
12929 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13452 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_55set_icon, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
13453 __Pyx_GOTREF(__pyx_t_1);
13454 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_icon, __pyx_t_1) < 0) __PYX_ERR(0, 666, __pyx_L1_error)
13455 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1293013456
1293113457 /* "pygame_sdl2/display.pyx":674
1293213458 * main_window.set_icon(default_icon)
1293513461 * global default_title
1293613462 *
1293713463 */
12938 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_57set_caption, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error)
12939 __Pyx_GOTREF(__pyx_t_3);
12940 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_caption, __pyx_t_3) < 0) __PYX_ERR(0, 674, __pyx_L1_error)
12941 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13464 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_57set_caption, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 674, __pyx_L1_error)
13465 __Pyx_GOTREF(__pyx_t_1);
13466 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_caption, __pyx_t_1) < 0) __PYX_ERR(0, 674, __pyx_L1_error)
13467 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1294213468
1294313469 /* "pygame_sdl2/display.pyx":682
1294413470 * main_window.set_caption(default_title)
1294713473 * return default_title
1294813474 *
1294913475 */
12950 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_59get_caption, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 682, __pyx_L1_error)
12951 __Pyx_GOTREF(__pyx_t_3);
12952 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_caption, __pyx_t_3) < 0) __PYX_ERR(0, 682, __pyx_L1_error)
12953 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13476 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_59get_caption, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error)
13477 __Pyx_GOTREF(__pyx_t_1);
13478 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_caption, __pyx_t_1) < 0) __PYX_ERR(0, 682, __pyx_L1_error)
13479 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1295413480
1295513481 /* "pygame_sdl2/display.pyx":685
1295613482 * return default_title
1295913485 * if main_window:
1296013486 * return main_window.get_drawable_size()
1296113487 */
12962 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_61get_drawable_size, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error)
12963 __Pyx_GOTREF(__pyx_t_3);
12964 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_drawable_size, __pyx_t_3) < 0) __PYX_ERR(0, 685, __pyx_L1_error)
12965 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13488 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_61get_drawable_size, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 685, __pyx_L1_error)
13489 __Pyx_GOTREF(__pyx_t_1);
13490 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_drawable_size, __pyx_t_1) < 0) __PYX_ERR(0, 685, __pyx_L1_error)
13491 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1296613492
1296713493 /* "pygame_sdl2/display.pyx":690
1296813494 * return None
1297113497 * rv = SDL_GetNumVideoDisplays()
1297213498 * if rv < 0:
1297313499 */
12974 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_63get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 690, __pyx_L1_error)
12975 __Pyx_GOTREF(__pyx_t_3);
12976 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_3) < 0) __PYX_ERR(0, 690, __pyx_L1_error)
12977 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13500 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_63get_num_video_displays, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error)
13501 __Pyx_GOTREF(__pyx_t_1);
13502 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_video_displays, __pyx_t_1) < 0) __PYX_ERR(0, 690, __pyx_L1_error)
13503 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1297813504
1297913505 /* "pygame_sdl2/display.pyx":697
1298013506 * return rv
1298313509 * cdef SDL_Rect rect
1298413510 * rv = SDL_GetDisplayBounds(index, &rect)
1298513511 */
12986 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_65get_display_bounds, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error)
12987 __Pyx_GOTREF(__pyx_t_3);
12988 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_display_bounds, __pyx_t_3) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
12989 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13512 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_65get_display_bounds, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error)
13513 __Pyx_GOTREF(__pyx_t_1);
13514 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_display_bounds, __pyx_t_1) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
13515 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1299013516
1299113517 /* "pygame_sdl2/display.pyx":703
1299213518 * return (rect.x, rect.y, rect.w, rect.h)
1299513521 * return SDL_GetPlatform()
1299613522 *
1299713523 */
12998 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_67get_platform, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __pyx_L1_error)
12999 __Pyx_GOTREF(__pyx_t_3);
13000 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_platform, __pyx_t_3) < 0) __PYX_ERR(0, 703, __pyx_L1_error)
13001 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13524 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_7display_67get_platform, NULL, __pyx_n_s_pygame_sdl2_display); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error)
13525 __Pyx_GOTREF(__pyx_t_1);
13526 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_platform, __pyx_t_1) < 0) __PYX_ERR(0, 703, __pyx_L1_error)
13527 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1300213528
1300313529 /* "pygame_sdl2/display.pyx":1
1300413530 * # Copyright 2014 Patrick Dawson <pat@dw.is> # <<<<<<<<<<<<<<
1300513531 * # Copyright 2014 Tom Rothamel <tom@rothamel.us>
1300613532 * #
1300713533 */
13008 __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error)
13009 __Pyx_GOTREF(__pyx_t_3);
13010 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
13011 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13534 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
13535 __Pyx_GOTREF(__pyx_t_1);
13536 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
13537 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1301213538
1301313539 /*--- Wrapped vars code ---*/
1301413540
1301613542 __pyx_L1_error:;
1301713543 __Pyx_XDECREF(__pyx_t_1);
1301813544 __Pyx_XDECREF(__pyx_t_2);
13019 __Pyx_XDECREF(__pyx_t_3);
13020 __Pyx_XDECREF(__pyx_t_5);
13021 __Pyx_XDECREF(__pyx_t_6);
13022 __Pyx_XDECREF(__pyx_t_7);
13545 __Pyx_XDECREF(__pyx_t_4);
1302313546 if (__pyx_m) {
1302413547 if (__pyx_d) {
13025 __Pyx_AddTraceback("init pygame_sdl2.display", __pyx_clineno, __pyx_lineno, __pyx_filename);
13548 __Pyx_AddTraceback("init pygame_sdl2.display", 0, __pyx_lineno, __pyx_filename);
1302613549 }
1302713550 Py_DECREF(__pyx_m); __pyx_m = 0;
1302813551 } else if (!PyErr_Occurred()) {
1303013553 }
1303113554 __pyx_L0:;
1303213555 __Pyx_RefNannyFinishContext();
13033 #if PY_MAJOR_VERSION < 3
13556 #if CYTHON_PEP489_MULTI_PHASE_INIT
13557 return (__pyx_m != NULL) ? 0 : -1;
13558 #elif PY_MAJOR_VERSION >= 3
13559 return __pyx_m;
13560 #else
1303413561 return;
13035 #else
13036 return __pyx_m;
1303713562 #endif
1303813563 }
1303913564
1305213577 Py_XDECREF(p);
1305313578 Py_XDECREF(m);
1305413579 return (__Pyx_RefNannyAPIStruct *)r;
13580 }
13581 #endif
13582
13583 /* PyObjectGetAttrStr */
13584 #if CYTHON_USE_TYPE_SLOTS
13585 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
13586 PyTypeObject* tp = Py_TYPE(obj);
13587 if (likely(tp->tp_getattro))
13588 return tp->tp_getattro(obj, attr_name);
13589 #if PY_MAJOR_VERSION < 3
13590 if (likely(tp->tp_getattr))
13591 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
13592 #endif
13593 return PyObject_GetAttr(obj, attr_name);
1305513594 }
1305613595 #endif
1305713596
1321213751 }
1321313752
1321413753 /* unicode_tailmatch */
13754 static int __Pyx_PyUnicode_TailmatchTuple(PyObject* s, PyObject* substrings,
13755 Py_ssize_t start, Py_ssize_t end, int direction) {
13756 Py_ssize_t i, count = PyTuple_GET_SIZE(substrings);
13757 for (i = 0; i < count; i++) {
13758 Py_ssize_t result;
13759 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13760 result = PyUnicode_Tailmatch(s, PyTuple_GET_ITEM(substrings, i),
13761 start, end, direction);
13762 #else
13763 PyObject* sub = PySequence_ITEM(substrings, i);
13764 if (unlikely(!sub)) return -1;
13765 result = PyUnicode_Tailmatch(s, sub, start, end, direction);
13766 Py_DECREF(sub);
13767 #endif
13768 if (result) {
13769 return (int) result;
13770 }
13771 }
13772 return 0;
13773 }
1321513774 static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr,
1321613775 Py_ssize_t start, Py_ssize_t end, int direction) {
1321713776 if (unlikely(PyTuple_Check(substr))) {
13218 Py_ssize_t i, count = PyTuple_GET_SIZE(substr);
13219 for (i = 0; i < count; i++) {
13220 Py_ssize_t result;
13221 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13222 result = PyUnicode_Tailmatch(s, PyTuple_GET_ITEM(substr, i),
13223 start, end, direction);
13777 return __Pyx_PyUnicode_TailmatchTuple(s, substr, start, end, direction);
13778 }
13779 return (int) PyUnicode_Tailmatch(s, substr, start, end, direction);
13780 }
13781
13782 /* PyCFunctionFastCall */
13783 #if CYTHON_FAST_PYCCALL
13784 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
13785 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
13786 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
13787 PyObject *self = PyCFunction_GET_SELF(func);
13788 int flags = PyCFunction_GET_FLAGS(func);
13789 assert(PyCFunction_Check(func));
13790 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
13791 assert(nargs >= 0);
13792 assert(nargs == 0 || args != NULL);
13793 /* _PyCFunction_FastCallDict() must not be called with an exception set,
13794 because it may clear it (directly or indirectly) and so the
13795 caller loses its exception */
13796 assert(!PyErr_Occurred());
13797 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
13798 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
13799 } else {
13800 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
13801 }
13802 }
13803 #endif
13804
13805 /* PyFunctionFastCall */
13806 #if CYTHON_FAST_PYCALL
13807 #include "frameobject.h"
13808 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
13809 PyObject *globals) {
13810 PyFrameObject *f;
13811 PyThreadState *tstate = __Pyx_PyThreadState_Current;
13812 PyObject **fastlocals;
13813 Py_ssize_t i;
13814 PyObject *result;
13815 assert(globals != NULL);
13816 /* XXX Perhaps we should create a specialized
13817 PyFrame_New() that doesn't take locals, but does
13818 take builtins without sanity checking them.
13819 */
13820 assert(tstate != NULL);
13821 f = PyFrame_New(tstate, co, globals, NULL);
13822 if (f == NULL) {
13823 return NULL;
13824 }
13825 fastlocals = f->f_localsplus;
13826 for (i = 0; i < na; i++) {
13827 Py_INCREF(*args);
13828 fastlocals[i] = *args++;
13829 }
13830 result = PyEval_EvalFrameEx(f,0);
13831 ++tstate->recursion_depth;
13832 Py_DECREF(f);
13833 --tstate->recursion_depth;
13834 return result;
13835 }
13836 #if 1 || PY_VERSION_HEX < 0x030600B1
13837 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
13838 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
13839 PyObject *globals = PyFunction_GET_GLOBALS(func);
13840 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
13841 PyObject *closure;
13842 #if PY_MAJOR_VERSION >= 3
13843 PyObject *kwdefs;
13844 #endif
13845 PyObject *kwtuple, **k;
13846 PyObject **d;
13847 Py_ssize_t nd;
13848 Py_ssize_t nk;
13849 PyObject *result;
13850 assert(kwargs == NULL || PyDict_Check(kwargs));
13851 nk = kwargs ? PyDict_Size(kwargs) : 0;
13852 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
13853 return NULL;
13854 }
13855 if (
13856 #if PY_MAJOR_VERSION >= 3
13857 co->co_kwonlyargcount == 0 &&
13858 #endif
13859 likely(kwargs == NULL || nk == 0) &&
13860 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
13861 if (argdefs == NULL && co->co_argcount == nargs) {
13862 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
13863 goto done;
13864 }
13865 else if (nargs == 0 && argdefs != NULL
13866 && co->co_argcount == Py_SIZE(argdefs)) {
13867 /* function called with no arguments, but all parameters have
13868 a default value: use default values as arguments .*/
13869 args = &PyTuple_GET_ITEM(argdefs, 0);
13870 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
13871 goto done;
13872 }
13873 }
13874 if (kwargs != NULL) {
13875 Py_ssize_t pos, i;
13876 kwtuple = PyTuple_New(2 * nk);
13877 if (kwtuple == NULL) {
13878 result = NULL;
13879 goto done;
13880 }
13881 k = &PyTuple_GET_ITEM(kwtuple, 0);
13882 pos = i = 0;
13883 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
13884 Py_INCREF(k[i]);
13885 Py_INCREF(k[i+1]);
13886 i += 2;
13887 }
13888 nk = i / 2;
13889 }
13890 else {
13891 kwtuple = NULL;
13892 k = NULL;
13893 }
13894 closure = PyFunction_GET_CLOSURE(func);
13895 #if PY_MAJOR_VERSION >= 3
13896 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
13897 #endif
13898 if (argdefs != NULL) {
13899 d = &PyTuple_GET_ITEM(argdefs, 0);
13900 nd = Py_SIZE(argdefs);
13901 }
13902 else {
13903 d = NULL;
13904 nd = 0;
13905 }
13906 #if PY_MAJOR_VERSION >= 3
13907 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
13908 args, nargs,
13909 k, (int)nk,
13910 d, (int)nd, kwdefs, closure);
1322413911 #else
13225 PyObject* sub = PySequence_ITEM(substr, i);
13226 if (unlikely(!sub)) return -1;
13227 result = PyUnicode_Tailmatch(s, sub, start, end, direction);
13228 Py_DECREF(sub);
13229 #endif
13230 if (result) {
13231 return (int) result;
13232 }
13233 }
13234 return 0;
13235 }
13236 return (int) PyUnicode_Tailmatch(s, substr, start, end, direction);
13237 }
13912 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
13913 args, nargs,
13914 k, (int)nk,
13915 d, (int)nd, closure);
13916 #endif
13917 Py_XDECREF(kwtuple);
13918 done:
13919 Py_LeaveRecursiveCall();
13920 return result;
13921 }
13922 #endif
13923 #endif
1323813924
1323913925 /* PyObjectCall */
1324013926 #if CYTHON_COMPILING_IN_CPYTHON
1325613942 }
1325713943 #endif
1325813944
13259 /* GetModuleGlobalName */
13260 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
13261 PyObject *result;
13262 #if !CYTHON_AVOID_BORROWED_REFS
13263 result = PyDict_GetItem(__pyx_d, name);
13264 if (likely(result)) {
13265 Py_INCREF(result);
13266 } else {
13267 #else
13268 result = PyObject_GetItem(__pyx_d, name);
13269 if (!result) {
13270 PyErr_Clear();
13271 #endif
13272 result = __Pyx_GetBuiltinName(name);
13273 }
13274 return result;
13275 }
13276
13277 /* PyCFunctionFastCall */
13278 #if CYTHON_FAST_PYCCALL
13279 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
13280 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
13281 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
13282 PyObject *self = PyCFunction_GET_SELF(func);
13283 assert(PyCFunction_Check(func));
13284 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
13285 assert(nargs >= 0);
13286 assert(nargs == 0 || args != NULL);
13287 /* _PyCFunction_FastCallDict() must not be called with an exception set,
13288 because it may clear it (directly or indirectly) and so the
13289 caller loses its exception */
13290 assert(!PyErr_Occurred());
13291 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
13292 }
13293 #endif // CYTHON_FAST_PYCCALL
13294
13295 /* PyFunctionFastCall */
13296 #if CYTHON_FAST_PYCALL
13297 #include "frameobject.h"
13298 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
13299 PyObject *globals) {
13300 PyFrameObject *f;
13301 PyThreadState *tstate = PyThreadState_GET();
13302 PyObject **fastlocals;
13303 Py_ssize_t i;
13304 PyObject *result;
13305 assert(globals != NULL);
13306 /* XXX Perhaps we should create a specialized
13307 PyFrame_New() that doesn't take locals, but does
13308 take builtins without sanity checking them.
13309 */
13310 assert(tstate != NULL);
13311 f = PyFrame_New(tstate, co, globals, NULL);
13312 if (f == NULL) {
13313 return NULL;
13314 }
13315 fastlocals = f->f_localsplus;
13316 for (i = 0; i < na; i++) {
13317 Py_INCREF(*args);
13318 fastlocals[i] = *args++;
13319 }
13320 result = PyEval_EvalFrameEx(f,0);
13321 ++tstate->recursion_depth;
13322 Py_DECREF(f);
13323 --tstate->recursion_depth;
13324 return result;
13325 }
13326 #if 1 || PY_VERSION_HEX < 0x030600B1
13327 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
13328 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
13329 PyObject *globals = PyFunction_GET_GLOBALS(func);
13330 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
13331 PyObject *closure;
13332 #if PY_MAJOR_VERSION >= 3
13333 PyObject *kwdefs;
13334 #endif
13335 PyObject *kwtuple, **k;
13336 PyObject **d;
13337 Py_ssize_t nd;
13338 Py_ssize_t nk;
13339 PyObject *result;
13340 assert(kwargs == NULL || PyDict_Check(kwargs));
13341 nk = kwargs ? PyDict_Size(kwargs) : 0;
13342 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
13343 return NULL;
13344 }
13345 if (
13346 #if PY_MAJOR_VERSION >= 3
13347 co->co_kwonlyargcount == 0 &&
13348 #endif
13349 likely(kwargs == NULL || nk == 0) &&
13350 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
13351 if (argdefs == NULL && co->co_argcount == nargs) {
13352 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
13353 goto done;
13354 }
13355 else if (nargs == 0 && argdefs != NULL
13356 && co->co_argcount == Py_SIZE(argdefs)) {
13357 /* function called with no arguments, but all parameters have
13358 a default value: use default values as arguments .*/
13359 args = &PyTuple_GET_ITEM(argdefs, 0);
13360 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
13361 goto done;
13362 }
13363 }
13364 if (kwargs != NULL) {
13365 Py_ssize_t pos, i;
13366 kwtuple = PyTuple_New(2 * nk);
13367 if (kwtuple == NULL) {
13368 result = NULL;
13369 goto done;
13370 }
13371 k = &PyTuple_GET_ITEM(kwtuple, 0);
13372 pos = i = 0;
13373 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
13374 Py_INCREF(k[i]);
13375 Py_INCREF(k[i+1]);
13376 i += 2;
13377 }
13378 nk = i / 2;
13379 }
13380 else {
13381 kwtuple = NULL;
13382 k = NULL;
13383 }
13384 closure = PyFunction_GET_CLOSURE(func);
13385 #if PY_MAJOR_VERSION >= 3
13386 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
13387 #endif
13388 if (argdefs != NULL) {
13389 d = &PyTuple_GET_ITEM(argdefs, 0);
13390 nd = Py_SIZE(argdefs);
13391 }
13392 else {
13393 d = NULL;
13394 nd = 0;
13395 }
13396 #if PY_MAJOR_VERSION >= 3
13397 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
13398 args, nargs,
13399 k, (int)nk,
13400 d, (int)nd, kwdefs, closure);
13401 #else
13402 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
13403 args, nargs,
13404 k, (int)nk,
13405 d, (int)nd, closure);
13406 #endif
13407 Py_XDECREF(kwtuple);
13408 done:
13409 Py_LeaveRecursiveCall();
13410 return result;
13411 }
13412 #endif // CPython < 3.6
13413 #endif // CYTHON_FAST_PYCALL
13414
1341513945 /* PyObjectCallMethO */
13416 #if CYTHON_COMPILING_IN_CPYTHON
13946 #if CYTHON_COMPILING_IN_CPYTHON
1341713947 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
1341813948 PyObject *self, *result;
1341913949 PyCFunction cfunc;
1343313963 #endif
1343413964
1343513965 /* PyObjectCallOneArg */
13436 #if CYTHON_COMPILING_IN_CPYTHON
13966 #if CYTHON_COMPILING_IN_CPYTHON
1343713967 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
1343813968 PyObject *result;
1343913969 PyObject *args = PyTuple_New(1);
1345013980 return __Pyx_PyFunction_FastCall(func, &arg, 1);
1345113981 }
1345213982 #endif
13453 #ifdef __Pyx_CyFunction_USED
13454 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
13455 #else
1345613983 if (likely(PyCFunction_Check(func))) {
13457 #endif
1345813984 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
1345913985 return __Pyx_PyObject_CallMethO(func, arg);
1346013986 #if CYTHON_FAST_PYCCALL
1347614002 }
1347714003 #endif
1347814004
14005 /* GetModuleGlobalName */
14006 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
14007 PyObject *result;
14008 #if !CYTHON_AVOID_BORROWED_REFS
14009 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
14010 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
14011 if (likely(result)) {
14012 Py_INCREF(result);
14013 } else if (unlikely(PyErr_Occurred())) {
14014 result = NULL;
14015 } else {
14016 #else
14017 result = PyDict_GetItem(__pyx_d, name);
14018 if (likely(result)) {
14019 Py_INCREF(result);
14020 } else {
14021 #endif
14022 #else
14023 result = PyObject_GetItem(__pyx_d, name);
14024 if (!result) {
14025 PyErr_Clear();
14026 #endif
14027 result = __Pyx_GetBuiltinName(name);
14028 }
14029 return result;
14030 }
14031
14032 /* GetItemInt */
14033 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
14034 PyObject *r;
14035 if (!j) return NULL;
14036 r = PyObject_GetItem(o, j);
14037 Py_DECREF(j);
14038 return r;
14039 }
14040 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
14041 CYTHON_NCP_UNUSED int wraparound,
14042 CYTHON_NCP_UNUSED int boundscheck) {
14043 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14044 Py_ssize_t wrapped_i = i;
14045 if (wraparound & unlikely(i < 0)) {
14046 wrapped_i += PyList_GET_SIZE(o);
14047 }
14048 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
14049 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
14050 Py_INCREF(r);
14051 return r;
14052 }
14053 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
14054 #else
14055 return PySequence_GetItem(o, i);
14056 #endif
14057 }
14058 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
14059 CYTHON_NCP_UNUSED int wraparound,
14060 CYTHON_NCP_UNUSED int boundscheck) {
14061 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14062 Py_ssize_t wrapped_i = i;
14063 if (wraparound & unlikely(i < 0)) {
14064 wrapped_i += PyTuple_GET_SIZE(o);
14065 }
14066 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
14067 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
14068 Py_INCREF(r);
14069 return r;
14070 }
14071 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
14072 #else
14073 return PySequence_GetItem(o, i);
14074 #endif
14075 }
14076 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
14077 CYTHON_NCP_UNUSED int wraparound,
14078 CYTHON_NCP_UNUSED int boundscheck) {
14079 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
14080 if (is_list || PyList_CheckExact(o)) {
14081 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
14082 if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
14083 PyObject *r = PyList_GET_ITEM(o, n);
14084 Py_INCREF(r);
14085 return r;
14086 }
14087 }
14088 else if (PyTuple_CheckExact(o)) {
14089 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
14090 if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
14091 PyObject *r = PyTuple_GET_ITEM(o, n);
14092 Py_INCREF(r);
14093 return r;
14094 }
14095 } else {
14096 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
14097 if (likely(m && m->sq_item)) {
14098 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
14099 Py_ssize_t l = m->sq_length(o);
14100 if (likely(l >= 0)) {
14101 i += l;
14102 } else {
14103 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
14104 return NULL;
14105 PyErr_Clear();
14106 }
14107 }
14108 return m->sq_item(o, i);
14109 }
14110 }
14111 #else
14112 if (is_list || PySequence_Check(o)) {
14113 return PySequence_GetItem(o, i);
14114 }
14115 #endif
14116 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
14117 }
14118
14119 /* ObjectGetItem */
14120 #if CYTHON_USE_TYPE_SLOTS
14121 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
14122 PyObject *runerr;
14123 Py_ssize_t key_value;
14124 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
14125 if (unlikely(!(m && m->sq_item))) {
14126 PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
14127 return NULL;
14128 }
14129 key_value = __Pyx_PyIndex_AsSsize_t(index);
14130 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
14131 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
14132 }
14133 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
14134 PyErr_Clear();
14135 PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
14136 }
14137 return NULL;
14138 }
14139 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
14140 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
14141 if (likely(m && m->mp_subscript)) {
14142 return m->mp_subscript(obj, key);
14143 }
14144 return __Pyx_PyObject_GetIndex(obj, key);
14145 }
14146 #endif
14147
1347914148 /* PyObjectCallNoArg */
1348014149 #if CYTHON_COMPILING_IN_CPYTHON
1348114150 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
1348514154 }
1348614155 #endif
1348714156 #ifdef __Pyx_CyFunction_USED
13488 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
14157 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
1348914158 #else
1349014159 if (likely(PyCFunction_Check(func))) {
1349114160 #endif
1363714306 "raise: exception class must be a subclass of BaseException");
1363814307 goto bad;
1363914308 }
13640 #if PY_VERSION_HEX >= 0x03030000
1364114309 if (cause) {
13642 #else
13643 if (cause && cause != Py_None) {
13644 #endif
1364514310 PyObject *fixed_cause;
1364614311 if (cause == Py_None) {
1364714312 fixed_cause = NULL;
1366914334 PyErr_Restore(tmp_type, tmp_value, tb);
1367014335 Py_XDECREF(tmp_tb);
1367114336 #else
13672 PyThreadState *tstate = PyThreadState_GET();
14337 PyThreadState *tstate = __Pyx_PyThreadState_Current;
1367314338 PyObject* tmp_tb = tstate->curexc_traceback;
1367414339 if (tb != tmp_tb) {
1367514340 Py_INCREF(tb);
1368514350 #endif
1368614351
1368714352 /* Import */
13688 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
14353 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
1368914354 PyObject *empty_list = 0;
1369014355 PyObject *module = 0;
1369114356 PyObject *global_dict = 0;
1369214357 PyObject *empty_dict = 0;
1369314358 PyObject *list;
13694 #if PY_VERSION_HEX < 0x03030000
14359 #if PY_MAJOR_VERSION < 3
1369514360 PyObject *py_import;
1369614361 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
1369714362 if (!py_import)
1371514380 #if PY_MAJOR_VERSION >= 3
1371614381 if (level == -1) {
1371714382 if (strchr(__Pyx_MODULE_NAME, '.')) {
13718 #if PY_VERSION_HEX < 0x03030000
13719 PyObject *py_level = PyInt_FromLong(1);
13720 if (!py_level)
13721 goto bad;
13722 module = PyObject_CallFunctionObjArgs(py_import,
13723 name, global_dict, empty_dict, list, py_level, NULL);
13724 Py_DECREF(py_level);
13725 #else
1372614383 module = PyImport_ImportModuleLevelObject(
1372714384 name, global_dict, empty_dict, list, 1);
13728 #endif
1372914385 if (!module) {
1373014386 if (!PyErr_ExceptionMatches(PyExc_ImportError))
1373114387 goto bad;
1373614392 }
1373714393 #endif
1373814394 if (!module) {
13739 #if PY_VERSION_HEX < 0x03030000
14395 #if PY_MAJOR_VERSION < 3
1374014396 PyObject *py_level = PyInt_FromLong(level);
1374114397 if (!py_level)
1374214398 goto bad;
1375014406 }
1375114407 }
1375214408 bad:
13753 #if PY_VERSION_HEX < 0x03030000
14409 #if PY_MAJOR_VERSION < 3
1375414410 Py_XDECREF(py_import);
1375514411 #endif
1375614412 Py_XDECREF(empty_list);
1375914415 }
1376014416
1376114417 /* SaveResetException */
13762 #if CYTHON_FAST_THREAD_STATE
14418 #if CYTHON_FAST_THREAD_STATE
1376314419 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
14420 #if PY_VERSION_HEX >= 0x030700A3
14421 *type = tstate->exc_state.exc_type;
14422 *value = tstate->exc_state.exc_value;
14423 *tb = tstate->exc_state.exc_traceback;
14424 #else
1376414425 *type = tstate->exc_type;
1376514426 *value = tstate->exc_value;
1376614427 *tb = tstate->exc_traceback;
14428 #endif
1376714429 Py_XINCREF(*type);
1376814430 Py_XINCREF(*value);
1376914431 Py_XINCREF(*tb);
1377014432 }
1377114433 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
1377214434 PyObject *tmp_type, *tmp_value, *tmp_tb;
14435 #if PY_VERSION_HEX >= 0x030700A3
14436 tmp_type = tstate->exc_state.exc_type;
14437 tmp_value = tstate->exc_state.exc_value;
14438 tmp_tb = tstate->exc_state.exc_traceback;
14439 tstate->exc_state.exc_type = type;
14440 tstate->exc_state.exc_value = value;
14441 tstate->exc_state.exc_traceback = tb;
14442 #else
1377314443 tmp_type = tstate->exc_type;
1377414444 tmp_value = tstate->exc_value;
1377514445 tmp_tb = tstate->exc_traceback;
1377614446 tstate->exc_type = type;
1377714447 tstate->exc_value = value;
1377814448 tstate->exc_traceback = tb;
14449 #endif
1377914450 Py_XDECREF(tmp_type);
1378014451 Py_XDECREF(tmp_value);
1378114452 Py_XDECREF(tmp_tb);
1378314454 #endif
1378414455
1378514456 /* PyErrExceptionMatches */
13786 #if CYTHON_FAST_THREAD_STATE
14457 #if CYTHON_FAST_THREAD_STATE
14458 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
14459 Py_ssize_t i, n;
14460 n = PyTuple_GET_SIZE(tuple);
14461 #if PY_MAJOR_VERSION >= 3
14462 for (i=0; i<n; i++) {
14463 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
14464 }
14465 #endif
14466 for (i=0; i<n; i++) {
14467 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
14468 }
14469 return 0;
14470 }
1378714471 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
1378814472 PyObject *exc_type = tstate->curexc_type;
1378914473 if (exc_type == err) return 1;
1379014474 if (unlikely(!exc_type)) return 0;
13791 return PyErr_GivenExceptionMatches(exc_type, err);
13792 }
13793 #endif
13794
13795 /* GetItemInt */
13796 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
13797 PyObject *r;
13798 if (!j) return NULL;
13799 r = PyObject_GetItem(o, j);
13800 Py_DECREF(j);
13801 return r;
13802 }
13803 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
13804 CYTHON_NCP_UNUSED int wraparound,
13805 CYTHON_NCP_UNUSED int boundscheck) {
13806 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13807 if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
13808 if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
13809 PyObject *r = PyList_GET_ITEM(o, i);
13810 Py_INCREF(r);
13811 return r;
13812 }
13813 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
13814 #else
13815 return PySequence_GetItem(o, i);
13816 #endif
13817 }
13818 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
13819 CYTHON_NCP_UNUSED int wraparound,
13820 CYTHON_NCP_UNUSED int boundscheck) {
13821 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13822 if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
13823 if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
13824 PyObject *r = PyTuple_GET_ITEM(o, i);
13825 Py_INCREF(r);
13826 return r;
13827 }
13828 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
13829 #else
13830 return PySequence_GetItem(o, i);
13831 #endif
13832 }
13833 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
13834 CYTHON_NCP_UNUSED int wraparound,
13835 CYTHON_NCP_UNUSED int boundscheck) {
13836 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
13837 if (is_list || PyList_CheckExact(o)) {
13838 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
13839 if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
13840 PyObject *r = PyList_GET_ITEM(o, n);
13841 Py_INCREF(r);
13842 return r;
13843 }
13844 }
13845 else if (PyTuple_CheckExact(o)) {
13846 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
13847 if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
13848 PyObject *r = PyTuple_GET_ITEM(o, n);
13849 Py_INCREF(r);
13850 return r;
13851 }
13852 } else {
13853 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
13854 if (likely(m && m->sq_item)) {
13855 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
13856 Py_ssize_t l = m->sq_length(o);
13857 if (likely(l >= 0)) {
13858 i += l;
13859 } else {
13860 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
13861 return NULL;
13862 PyErr_Clear();
13863 }
13864 }
13865 return m->sq_item(o, i);
13866 }
13867 }
13868 #else
13869 if (is_list || PySequence_Check(o)) {
13870 return PySequence_GetItem(o, i);
13871 }
13872 #endif
13873 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
13874 }
14475 if (unlikely(PyTuple_Check(err)))
14476 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
14477 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
14478 }
14479 #endif
1387514480
1387614481 /* GetException */
13877 #if CYTHON_FAST_THREAD_STATE
14482 #if CYTHON_FAST_THREAD_STATE
1387814483 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
1387914484 #else
1388014485 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
1391114516 *value = local_value;
1391214517 *tb = local_tb;
1391314518 #if CYTHON_FAST_THREAD_STATE
14519 #if PY_VERSION_HEX >= 0x030700A3
14520 tmp_type = tstate->exc_state.exc_type;
14521 tmp_value = tstate->exc_state.exc_value;
14522 tmp_tb = tstate->exc_state.exc_traceback;
14523 tstate->exc_state.exc_type = local_type;
14524 tstate->exc_state.exc_value = local_value;
14525 tstate->exc_state.exc_traceback = local_tb;
14526 #else
1391414527 tmp_type = tstate->exc_type;
1391514528 tmp_value = tstate->exc_value;
1391614529 tmp_tb = tstate->exc_traceback;
1391714530 tstate->exc_type = local_type;
1391814531 tstate->exc_value = local_value;
1391914532 tstate->exc_traceback = local_tb;
14533 #endif
1392014534 Py_XDECREF(tmp_type);
1392114535 Py_XDECREF(tmp_value);
1392214536 Py_XDECREF(tmp_tb);
1393514549 }
1393614550
1393714551 /* RaiseTooManyValuesToUnpack */
13938 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
14552 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
1393914553 PyErr_Format(PyExc_ValueError,
1394014554 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
1394114555 }
1394214556
1394314557 /* RaiseNeedMoreValuesToUnpack */
13944 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
14558 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
1394514559 PyErr_Format(PyExc_ValueError,
1394614560 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
1394714561 index, (index == 1) ? "" : "s");
1394814562 }
1394914563
1395014564 /* IterFinish */
13951 static CYTHON_INLINE int __Pyx_IterFinish(void) {
14565 static CYTHON_INLINE int __Pyx_IterFinish(void) {
1395214566 #if CYTHON_FAST_THREAD_STATE
13953 PyThreadState *tstate = PyThreadState_GET();
14567 PyThreadState *tstate = __Pyx_PyThreadState_Current;
1395414568 PyObject* exc_type = tstate->curexc_type;
1395514569 if (unlikely(exc_type)) {
13956 if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
14570 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
1395714571 PyObject *exc_value, *exc_tb;
1395814572 exc_value = tstate->curexc_value;
1395914573 exc_tb = tstate->curexc_traceback;
1398314597 }
1398414598
1398514599 /* UnpackItemEndCheck */
13986 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
14600 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
1398714601 if (unlikely(retval)) {
1398814602 Py_DECREF(retval);
1398914603 __Pyx_RaiseTooManyValuesError(expected);
1399514609 }
1399614610
1399714611 /* SwapException */
13998 #if CYTHON_FAST_THREAD_STATE
14612 #if CYTHON_FAST_THREAD_STATE
1399914613 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
1400014614 PyObject *tmp_type, *tmp_value, *tmp_tb;
14615 #if PY_VERSION_HEX >= 0x030700A3
14616 tmp_type = tstate->exc_state.exc_type;
14617 tmp_value = tstate->exc_state.exc_value;
14618 tmp_tb = tstate->exc_state.exc_traceback;
14619 tstate->exc_state.exc_type = *type;
14620 tstate->exc_state.exc_value = *value;
14621 tstate->exc_state.exc_traceback = *tb;
14622 #else
1400114623 tmp_type = tstate->exc_type;
1400214624 tmp_value = tstate->exc_value;
1400314625 tmp_tb = tstate->exc_traceback;
1400414626 tstate->exc_type = *type;
1400514627 tstate->exc_value = *value;
1400614628 tstate->exc_traceback = *tb;
14629 #endif
1400714630 *type = tmp_type;
1400814631 *value = tmp_value;
1400914632 *tb = tmp_tb;
1402014643 #endif
1402114644
1402214645 /* ArgTypeTest */
14023 static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
14024 PyErr_Format(PyExc_TypeError,
14025 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
14026 name, type->tp_name, Py_TYPE(obj)->tp_name);
14027 }
14028 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
14029 const char *name, int exact)
14646 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
1403014647 {
1403114648 if (unlikely(!type)) {
1403214649 PyErr_SetString(PyExc_SystemError, "Missing type object");
1403314650 return 0;
1403414651 }
14035 if (none_allowed && obj == Py_None) return 1;
1403614652 else if (exact) {
14037 if (likely(Py_TYPE(obj) == type)) return 1;
1403814653 #if PY_MAJOR_VERSION == 2
14039 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
14654 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
1404014655 #endif
1404114656 }
1404214657 else {
14043 if (likely(PyObject_TypeCheck(obj, type))) return 1;
14044 }
14045 __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
14658 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
14659 }
14660 PyErr_Format(PyExc_TypeError,
14661 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
14662 name, type->tp_name, Py_TYPE(obj)->tp_name);
1404614663 return 0;
1404714664 }
1404814665
1404914666 /* ExtTypeTest */
14050 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
14667 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
1405114668 if (unlikely(!type)) {
1405214669 PyErr_SetString(PyExc_SystemError, "Missing type object");
1405314670 return 0;
1405414671 }
14055 if (likely(PyObject_TypeCheck(obj, type)))
14672 if (likely(__Pyx_TypeCheck(obj, type)))
1405614673 return 1;
1405714674 PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
1405814675 Py_TYPE(obj)->tp_name, type->tp_name);
1405914676 return 0;
1406014677 }
1406114678
14679 /* PyObjectSetAttrStr */
14680 #if CYTHON_USE_TYPE_SLOTS
14681 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
14682 PyTypeObject* tp = Py_TYPE(obj);
14683 if (likely(tp->tp_setattro))
14684 return tp->tp_setattro(obj, attr_name, value);
14685 #if PY_MAJOR_VERSION < 3
14686 if (likely(tp->tp_setattr))
14687 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
14688 #endif
14689 return PyObject_SetAttr(obj, attr_name, value);
14690 }
14691 #endif
14692
14693 /* PyObject_GenericGetAttrNoDict */
14694 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
14695 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
14696 PyErr_Format(PyExc_AttributeError,
14697 #if PY_MAJOR_VERSION >= 3
14698 "'%.50s' object has no attribute '%U'",
14699 tp->tp_name, attr_name);
14700 #else
14701 "'%.50s' object has no attribute '%.400s'",
14702 tp->tp_name, PyString_AS_STRING(attr_name));
14703 #endif
14704 return NULL;
14705 }
14706 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
14707 PyObject *descr;
14708 PyTypeObject *tp = Py_TYPE(obj);
14709 if (unlikely(!PyString_Check(attr_name))) {
14710 return PyObject_GenericGetAttr(obj, attr_name);
14711 }
14712 assert(!tp->tp_dictoffset);
14713 descr = _PyType_Lookup(tp, attr_name);
14714 if (unlikely(!descr)) {
14715 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
14716 }
14717 Py_INCREF(descr);
14718 #if PY_MAJOR_VERSION < 3
14719 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
14720 #endif
14721 {
14722 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
14723 if (unlikely(f)) {
14724 PyObject *res = f(descr, obj, (PyObject *)tp);
14725 Py_DECREF(descr);
14726 return res;
14727 }
14728 }
14729 return descr;
14730 }
14731 #endif
14732
14733 /* PyObject_GenericGetAttr */
14734 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
14735 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
14736 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
14737 return PyObject_GenericGetAttr(obj, attr_name);
14738 }
14739 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
14740 }
14741 #endif
14742
14743 /* SetupReduce */
14744 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
14745 int ret;
14746 PyObject *name_attr;
14747 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
14748 if (likely(name_attr)) {
14749 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
14750 } else {
14751 ret = -1;
14752 }
14753 if (unlikely(ret < 0)) {
14754 PyErr_Clear();
14755 ret = 0;
14756 }
14757 Py_XDECREF(name_attr);
14758 return ret;
14759 }
14760 static int __Pyx_setup_reduce(PyObject* type_obj) {
14761 int ret = 0;
14762 PyObject *object_reduce = NULL;
14763 PyObject *object_reduce_ex = NULL;
14764 PyObject *reduce = NULL;
14765 PyObject *reduce_ex = NULL;
14766 PyObject *reduce_cython = NULL;
14767 PyObject *setstate = NULL;
14768 PyObject *setstate_cython = NULL;
14769 #if CYTHON_USE_PYTYPE_LOOKUP
14770 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
14771 #else
14772 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
14773 #endif
14774 #if CYTHON_USE_PYTYPE_LOOKUP
14775 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
14776 #else
14777 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
14778 #endif
14779 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
14780 if (reduce_ex == object_reduce_ex) {
14781 #if CYTHON_USE_PYTYPE_LOOKUP
14782 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
14783 #else
14784 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
14785 #endif
14786 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
14787 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
14788 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
14789 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
14790 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
14791 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
14792 if (!setstate) PyErr_Clear();
14793 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
14794 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
14795 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
14796 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
14797 }
14798 PyType_Modified((PyTypeObject*)type_obj);
14799 }
14800 }
14801 goto GOOD;
14802 BAD:
14803 if (!PyErr_Occurred())
14804 PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
14805 ret = -1;
14806 GOOD:
14807 #if !CYTHON_USE_PYTYPE_LOOKUP
14808 Py_XDECREF(object_reduce);
14809 Py_XDECREF(object_reduce_ex);
14810 #endif
14811 Py_XDECREF(reduce);
14812 Py_XDECREF(reduce_ex);
14813 Py_XDECREF(reduce_cython);
14814 Py_XDECREF(setstate);
14815 Py_XDECREF(setstate_cython);
14816 return ret;
14817 }
14818
1406214819 /* GetVTable */
14063 static void* __Pyx_GetVtable(PyObject *dict) {
14820 static void* __Pyx_GetVtable(PyObject *dict) {
1406414821 void* ptr;
1406514822 PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
1406614823 if (!ob)
1408014837 }
1408114838
1408214839 /* ImportFrom */
14083 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
14840 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
1408414841 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
1408514842 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
1408614843 PyErr_Format(PyExc_ImportError,
1409414851 }
1409514852
1409614853 /* CalculateMetaclass */
14097 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
14854 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
1409814855 Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
1409914856 for (i=0; i < nbases; i++) {
1410014857 PyTypeObject *tmptype;
1413314890 }
1413414891
1413514892 /* FetchCommonType */
14136 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
14893 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
1413714894 PyObject* fake_module;
1413814895 PyTypeObject* cached_type = NULL;
1413914896 fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
1417214929 }
1417314930
1417414931 /* CythonFunction */
14175 static PyObject *
14932 #include <structmember.h>
14933 static PyObject *
1417614934 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
1417714935 {
1417814936 if (unlikely(op->func_doc == NULL)) {
1445415212 {0, 0, 0, 0, 0}
1445515213 };
1445615214 static PyMemberDef __pyx_CyFunction_members[] = {
14457 {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
15215 {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
1445815216 {0, 0, 0, 0, 0}
1445915217 };
1446015218 static PyObject *
1453215290 }
1453315291 return 0;
1453415292 }
14535 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
15293 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
1453615294 {
14537 PyObject_GC_UnTrack(m);
1453815295 if (__Pyx_CyFunction_weakreflist(m) != NULL)
1453915296 PyObject_ClearWeakRefs((PyObject *) m);
1454015297 __Pyx_CyFunction_clear(m);
1454115298 PyObject_GC_Del(m);
15299 }
15300 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
15301 {
15302 PyObject_GC_UnTrack(m);
15303 __Pyx__CyFunction_dealloc(m);
1454215304 }
1454315305 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
1454415306 {
1461415376 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
1461515377 size = PyTuple_GET_SIZE(arg);
1461615378 if (likely(size == 1)) {
14617 PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
14618 if (unlikely(!arg0)) return NULL;
15379 PyObject *result, *arg0;
15380 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15381 arg0 = PyTuple_GET_ITEM(arg, 0);
15382 #else
15383 arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
15384 #endif
1461915385 result = (*meth)(self, arg0);
15386 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
1462015387 Py_DECREF(arg0);
15388 #endif
1462115389 return result;
1462215390 }
1462315391 PyErr_Format(PyExc_TypeError,
1472415492 };
1472515493 static int __pyx_CyFunction_init(void) {
1472615494 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
14727 if (__pyx_CyFunctionType == NULL) {
15495 if (unlikely(__pyx_CyFunctionType == NULL)) {
1472815496 return -1;
1472915497 }
1473015498 return 0;
1473215500 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
1473315501 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
1473415502 m->defaults = PyObject_Malloc(size);
14735 if (!m->defaults)
15503 if (unlikely(!m->defaults))
1473615504 return PyErr_NoMemory();
1473715505 memset(m->defaults, 0, size);
1473815506 m->defaults_pyobjects = pyobjects;
1475515523 }
1475615524
1475715525 /* Py3ClassCreate */
14758 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
15526 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
1475915527 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
1476015528 PyObject *ns;
1476115529 if (metaclass) {
1482115589 return result;
1482215590 }
1482315591
15592 /* CLineInTraceback */
15593 #ifndef CYTHON_CLINE_IN_TRACEBACK
15594 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
15595 PyObject *use_cline;
15596 PyObject *ptype, *pvalue, *ptraceback;
15597 #if CYTHON_COMPILING_IN_CPYTHON
15598 PyObject **cython_runtime_dict;
15599 #endif
15600 if (unlikely(!__pyx_cython_runtime)) {
15601 return c_line;
15602 }
15603 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
15604 #if CYTHON_COMPILING_IN_CPYTHON
15605 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
15606 if (likely(cython_runtime_dict)) {
15607 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
15608 } else
15609 #endif
15610 {
15611 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
15612 if (use_cline_obj) {
15613 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
15614 Py_DECREF(use_cline_obj);
15615 } else {
15616 PyErr_Clear();
15617 use_cline = NULL;
15618 }
15619 }
15620 if (!use_cline) {
15621 c_line = 0;
15622 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
15623 }
15624 else if (PyObject_Not(use_cline) != 0) {
15625 c_line = 0;
15626 }
15627 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
15628 return c_line;
15629 }
15630 #endif
15631
1482415632 /* CodeObjectCache */
14825 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
15633 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
1482615634 int start = 0, mid = 0, end = count - 1;
1482715635 if (end >= 0 && code_line > entries[end].code_line) {
1482815636 return count;
1490215710 }
1490315711
1490415712 /* AddTraceback */
14905 #include "compile.h"
15713 #include "compile.h"
1490615714 #include "frameobject.h"
1490715715 #include "traceback.h"
1490815716 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
1496115769 int py_line, const char *filename) {
1496215770 PyCodeObject *py_code = 0;
1496315771 PyFrameObject *py_frame = 0;
14964 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
15772 PyThreadState *tstate = __Pyx_PyThreadState_Current;
15773 if (c_line) {
15774 c_line = __Pyx_CLineForTraceback(tstate, c_line);
15775 }
15776 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
1496515777 if (!py_code) {
1496615778 py_code = __Pyx_CreateCodeObjectForTraceback(
1496715779 funcname, c_line, py_line, filename);
1496815780 if (!py_code) goto bad;
14969 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
15781 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
1497015782 }
1497115783 py_frame = PyFrame_New(
14972 PyThreadState_GET(), /*PyThreadState *tstate,*/
14973 py_code, /*PyCodeObject *code,*/
14974 __pyx_d, /*PyObject *globals,*/
14975 0 /*PyObject *locals*/
15784 tstate, /*PyThreadState *tstate,*/
15785 py_code, /*PyCodeObject *code,*/
15786 __pyx_d, /*PyObject *globals,*/
15787 0 /*PyObject *locals*/
1497615788 );
1497715789 if (!py_frame) goto bad;
1497815790 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
1498315795 }
1498415796
1498515797 /* CIntToPy */
14986 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
15798 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
1498715799 const int neg_one = (int) -1, const_zero = (int) 0;
1498815800 const int is_unsigned = neg_one > const_zero;
1498915801 if (is_unsigned) {
1501415826 }
1501515827
1501615828 /* CIntFromPyVerify */
15017 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
15829 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
1501815830 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
1501915831 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
1502015832 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
1503615848 }
1503715849
1503815850 /* CIntToPy */
15039 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
15851 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
1504015852 const long neg_one = (long) -1, const_zero = (long) 0;
1504115853 const int is_unsigned = neg_one > const_zero;
1504215854 if (is_unsigned) {
1506715879 }
1506815880
1506915881 /* CIntToPy */
15070 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_WindowFlags(SDL_WindowFlags value) {
15882 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_WindowFlags(SDL_WindowFlags value) {
1507115883 const SDL_WindowFlags neg_one = (SDL_WindowFlags) -1, const_zero = (SDL_WindowFlags) 0;
1507215884 const int is_unsigned = neg_one > const_zero;
1507315885 if (is_unsigned) {
1509815910 }
1509915911
1510015912 /* CIntToPy */
15101 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
15913 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
1510215914 const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
1510315915 const int is_unsigned = neg_one > const_zero;
1510415916 if (is_unsigned) {
1512915941 }
1513015942
1513115943 /* CIntToPy */
15132 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
15944 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
1513315945 const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0;
1513415946 const int is_unsigned = neg_one > const_zero;
1513515947 if (is_unsigned) {
1516015972 }
1516115973
1516215974 /* CIntFromPy */
15163 static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
15975 static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
1516415976 const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
1516515977 const int is_unsigned = neg_one > const_zero;
1516615978 #if PY_MAJOR_VERSION < 3
1534916161 }
1535016162
1535116163 /* CIntFromPy */
15352 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
16164 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
1535316165 const int neg_one = (int) -1, const_zero = (int) 0;
1535416166 const int is_unsigned = neg_one > const_zero;
1535516167 #if PY_MAJOR_VERSION < 3
1553816350 }
1553916351
1554016352 /* CIntFromPy */
15541 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
16353 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
1554216354 const long neg_one = (long) -1, const_zero = (long) 0;
1554316355 const int is_unsigned = neg_one > const_zero;
1554416356 #if PY_MAJOR_VERSION < 3
1572716539 }
1572816540
1572916541 /* CIntFromPy */
15730 static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *x) {
16542 static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *x) {
1573116543 const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0;
1573216544 const int is_unsigned = neg_one > const_zero;
1573316545 #if PY_MAJOR_VERSION < 3
1591616728 }
1591716729
1591816730 /* CIntFromPy */
15919 static CYTHON_INLINE SDL_GLattr __Pyx_PyInt_As_SDL_GLattr(PyObject *x) {
16731 static CYTHON_INLINE SDL_GLattr __Pyx_PyInt_As_SDL_GLattr(PyObject *x) {
1592016732 const SDL_GLattr neg_one = (SDL_GLattr) -1, const_zero = (SDL_GLattr) 0;
1592116733 const int is_unsigned = neg_one > const_zero;
1592216734 #if PY_MAJOR_VERSION < 3
1610416916 return (SDL_GLattr) -1;
1610516917 }
1610616918
16919 /* FastTypeChecks */
16920 #if CYTHON_COMPILING_IN_CPYTHON
16921 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
16922 while (a) {
16923 a = a->tp_base;
16924 if (a == b)
16925 return 1;
16926 }
16927 return b == &PyBaseObject_Type;
16928 }
16929 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
16930 PyObject *mro;
16931 if (a == b) return 1;
16932 mro = a->tp_mro;
16933 if (likely(mro)) {
16934 Py_ssize_t i, n;
16935 n = PyTuple_GET_SIZE(mro);
16936 for (i = 0; i < n; i++) {
16937 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
16938 return 1;
16939 }
16940 return 0;
16941 }
16942 return __Pyx_InBases(a, b);
16943 }
16944 #if PY_MAJOR_VERSION == 2
16945 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
16946 PyObject *exception, *value, *tb;
16947 int res;
16948 __Pyx_PyThreadState_declare
16949 __Pyx_PyThreadState_assign
16950 __Pyx_ErrFetch(&exception, &value, &tb);
16951 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
16952 if (unlikely(res == -1)) {
16953 PyErr_WriteUnraisable(err);
16954 res = 0;
16955 }
16956 if (!res) {
16957 res = PyObject_IsSubclass(err, exc_type2);
16958 if (unlikely(res == -1)) {
16959 PyErr_WriteUnraisable(err);
16960 res = 0;
16961 }
16962 }
16963 __Pyx_ErrRestore(exception, value, tb);
16964 return res;
16965 }
16966 #else
16967 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
16968 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
16969 if (!res) {
16970 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
16971 }
16972 return res;
16973 }
16974 #endif
16975 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
16976 Py_ssize_t i, n;
16977 assert(PyExceptionClass_Check(exc_type));
16978 n = PyTuple_GET_SIZE(tuple);
16979 #if PY_MAJOR_VERSION >= 3
16980 for (i=0; i<n; i++) {
16981 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
16982 }
16983 #endif
16984 for (i=0; i<n; i++) {
16985 PyObject *t = PyTuple_GET_ITEM(tuple, i);
16986 #if PY_MAJOR_VERSION < 3
16987 if (likely(exc_type == t)) return 1;
16988 #endif
16989 if (likely(PyExceptionClass_Check(t))) {
16990 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
16991 } else {
16992 }
16993 }
16994 return 0;
16995 }
16996 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
16997 if (likely(err == exc_type)) return 1;
16998 if (likely(PyExceptionClass_Check(err))) {
16999 if (likely(PyExceptionClass_Check(exc_type))) {
17000 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
17001 } else if (likely(PyTuple_Check(exc_type))) {
17002 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
17003 } else {
17004 }
17005 }
17006 return PyErr_GivenExceptionMatches(err, exc_type);
17007 }
17008 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
17009 assert(PyExceptionClass_Check(exc_type1));
17010 assert(PyExceptionClass_Check(exc_type2));
17011 if (likely(err == exc_type1 || err == exc_type2)) return 1;
17012 if (likely(PyExceptionClass_Check(err))) {
17013 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
17014 }
17015 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
17016 }
17017 #endif
17018
1610717019 /* CheckBinaryVersion */
16108 static int __Pyx_check_binary_version(void) {
17020 static int __Pyx_check_binary_version(void) {
1610917021 char ctversion[4], rtversion[4];
1611017022 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
1611117023 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
1612117033 }
1612217034
1612317035 /* VoidPtrExport */
16124 static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) {
17036 static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) {
1612517037 PyObject *d;
1612617038 PyObject *cobj = 0;
1612717039 d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi);
1615217064 }
1615317065
1615417066 /* FunctionExport */
16155 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
17067 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
1615617068 PyObject *d = 0;
1615717069 PyObject *cobj = 0;
1615817070 union {
1618917101 }
1619017102
1619117103 /* ModuleImport */
16192 #ifndef __PYX_HAVE_RT_ImportModule
17104 #ifndef __PYX_HAVE_RT_ImportModule
1619317105 #define __PYX_HAVE_RT_ImportModule
1619417106 static PyObject *__Pyx_ImportModule(const char *name) {
1619517107 PyObject *py_name = 0;
1620717119 #endif
1620817120
1620917121 /* TypeImport */
16210 #ifndef __PYX_HAVE_RT_ImportType
17122 #ifndef __PYX_HAVE_RT_ImportType
1621117123 #define __PYX_HAVE_RT_ImportType
1621217124 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
1621317125 size_t size, int strict)
1627217184 #endif
1627317185
1627417186 /* FunctionImport */
16275 #ifndef __PYX_HAVE_RT_ImportFunction
17187 #ifndef __PYX_HAVE_RT_ImportFunction
1627617188 #define __PYX_HAVE_RT_ImportFunction
1627717189 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
1627817190 PyObject *d = 0;
1632617238 #endif
1632717239
1632817240 /* InitStrings */
16329 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
17241 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
1633017242 while (t->p) {
1633117243 #if PY_MAJOR_VERSION < 3
1633217244 if (t->is_unicode) {
1635117263 #endif
1635217264 if (!*t->p)
1635317265 return -1;
17266 if (PyObject_Hash(*t->p) == -1)
17267 return -1;
1635417268 ++t;
1635517269 }
1635617270 return 0;
1635917273 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
1636017274 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
1636117275 }
16362 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
17276 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
1636317277 Py_ssize_t ignore;
1636417278 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
1636517279 }
16366 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
16367 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
17280 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
17281 #if !CYTHON_PEP393_ENABLED
17282 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
17283 char* defenc_c;
17284 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
17285 if (!defenc) return NULL;
17286 defenc_c = PyBytes_AS_STRING(defenc);
17287 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
17288 {
17289 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
17290 char* c;
17291 for (c = defenc_c; c < end; c++) {
17292 if ((unsigned char) (*c) >= 128) {
17293 PyUnicode_AsASCIIString(o);
17294 return NULL;
17295 }
17296 }
17297 }
17298 #endif
17299 *length = PyBytes_GET_SIZE(defenc);
17300 return defenc_c;
17301 }
17302 #else
17303 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
17304 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
17305 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
17306 if (likely(PyUnicode_IS_ASCII(o))) {
17307 *length = PyUnicode_GET_LENGTH(o);
17308 return PyUnicode_AsUTF8(o);
17309 } else {
17310 PyUnicode_AsASCIIString(o);
17311 return NULL;
17312 }
17313 #else
17314 return PyUnicode_AsUTF8AndSize(o, length);
17315 #endif
17316 }
17317 #endif
17318 #endif
17319 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
17320 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1636817321 if (
1636917322 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1637017323 __Pyx_sys_getdefaultencoding_not_ascii &&
1637117324 #endif
1637217325 PyUnicode_Check(o)) {
16373 #if PY_VERSION_HEX < 0x03030000
16374 char* defenc_c;
16375 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
16376 if (!defenc) return NULL;
16377 defenc_c = PyBytes_AS_STRING(defenc);
16378 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
16379 {
16380 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
16381 char* c;
16382 for (c = defenc_c; c < end; c++) {
16383 if ((unsigned char) (*c) >= 128) {
16384 PyUnicode_AsASCIIString(o);
16385 return NULL;
16386 }
16387 }
16388 }
16389 #endif
16390 *length = PyBytes_GET_SIZE(defenc);
16391 return defenc_c;
16392 #else
16393 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
16394 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
16395 if (PyUnicode_IS_ASCII(o)) {
16396 *length = PyUnicode_GET_LENGTH(o);
16397 return PyUnicode_AsUTF8(o);
16398 } else {
16399 PyUnicode_AsASCIIString(o);
16400 return NULL;
16401 }
16402 #else
16403 return PyUnicode_AsUTF8AndSize(o, length);
16404 #endif
16405 #endif
17326 return __Pyx_PyUnicode_AsStringAndSize(o, length);
1640617327 } else
1640717328 #endif
1640817329 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
1642617347 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
1642717348 else return PyObject_IsTrue(x);
1642817349 }
17350 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
17351 #if PY_MAJOR_VERSION >= 3
17352 if (PyLong_Check(result)) {
17353 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
17354 "__int__ returned non-int (type %.200s). "
17355 "The ability to return an instance of a strict subclass of int "
17356 "is deprecated, and may be removed in a future version of Python.",
17357 Py_TYPE(result)->tp_name)) {
17358 Py_DECREF(result);
17359 return NULL;
17360 }
17361 return result;
17362 }
17363 #endif
17364 PyErr_Format(PyExc_TypeError,
17365 "__%.4s__ returned non-%.4s (type %.200s)",
17366 type_name, type_name, Py_TYPE(result)->tp_name);
17367 Py_DECREF(result);
17368 return NULL;
17369 }
1642917370 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
1643017371 #if CYTHON_USE_TYPE_SLOTS
1643117372 PyNumberMethods *m;
1643317374 const char *name = NULL;
1643417375 PyObject *res = NULL;
1643517376 #if PY_MAJOR_VERSION < 3
16436 if (PyInt_Check(x) || PyLong_Check(x))
17377 if (likely(PyInt_Check(x) || PyLong_Check(x)))
1643717378 #else
16438 if (PyLong_Check(x))
17379 if (likely(PyLong_Check(x)))
1643917380 #endif
1644017381 return __Pyx_NewRef(x);
1644117382 #if CYTHON_USE_TYPE_SLOTS
1644317384 #if PY_MAJOR_VERSION < 3
1644417385 if (m && m->nb_int) {
1644517386 name = "int";
16446 res = PyNumber_Int(x);
17387 res = m->nb_int(x);
1644717388 }
1644817389 else if (m && m->nb_long) {
1644917390 name = "long";
16450 res = PyNumber_Long(x);
17391 res = m->nb_long(x);
1645117392 }
1645217393 #else
16453 if (m && m->nb_int) {
17394 if (likely(m && m->nb_int)) {
1645417395 name = "int";
16455 res = PyNumber_Long(x);
17396 res = m->nb_int(x);
1645617397 }
1645717398 #endif
1645817399 #else
16459 res = PyNumber_Int(x);
16460 #endif
16461 if (res) {
17400 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
17401 res = PyNumber_Int(x);
17402 }
17403 #endif
17404 if (likely(res)) {
1646217405 #if PY_MAJOR_VERSION < 3
16463 if (!PyInt_Check(res) && !PyLong_Check(res)) {
17406 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
1646417407 #else
16465 if (!PyLong_Check(res)) {
16466 #endif
16467 PyErr_Format(PyExc_TypeError,
16468 "__%.4s__ returned non-%.4s (type %.200s)",
16469 name, name, Py_TYPE(res)->tp_name);
16470 Py_DECREF(res);
16471 return NULL;
17408 if (unlikely(!PyLong_CheckExact(res))) {
17409 #endif
17410 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
1647217411 }
1647317412 }
1647417413 else if (!PyErr_Occurred()) {
1653917478 Py_DECREF(x);
1654017479 return ival;
1654117480 }
17481 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
17482 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
17483 }
1654217484 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
1654317485 return PyInt_FromSize_t(ival);
1654417486 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
88 #else
9 #define CYTHON_ABI "0_25_2"
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
102120 #define CYTHON_COMPILING_IN_CPYTHON 1
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
105129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412552
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
423555 #define __PYX_EXTERN_C extern "C"
428560
429561 #define __PYX_HAVE__pygame_sdl2__draw
430562 #define __PYX_HAVE_API__pygame_sdl2__draw
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
437570 #include <omp.h>
438571 #endif /* _OPENMP */
439572
440 #ifdef PYREX_WITHOUT_ASSERTIONS
573 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
441574 #define CYTHON_WITHOUT_ASSERTIONS
442575 #endif
443576
468601 #define __Pyx_sst_abs(value) abs(value)
469602 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
470603 #define __Pyx_sst_abs(value) labs(value)
471 #elif defined (_MSC_VER) && defined (_M_X64)
472 #define __Pyx_sst_abs(value) _abs64(value)
604 #elif defined (_MSC_VER)
605 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
473606 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
474607 #define __Pyx_sst_abs(value) llabs(value)
475608 #elif defined (__GNUC__)
477610 #else
478611 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
479612 #endif
480 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
481 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
613 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
614 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
482615 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
483616 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
484617 #define __Pyx_PyBytes_FromString PyBytes_FromString
491624 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
492625 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
493626 #endif
494 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
495 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
627 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
628 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
629 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
634 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
635 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
496638 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
497639 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
498640 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
499641 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
500642 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
501 #if PY_MAJOR_VERSION < 3
502 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
503 {
643 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
504644 const Py_UNICODE *u_end = u;
505645 while (*u_end++) ;
506646 return (size_t)(u_end - u - 1);
507647 }
508 #else
509 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
510 #endif
511648 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
512649 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
513650 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
514651 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
515652 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
516 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
653 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
517654 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
518655 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
656 #define __Pyx_PySequence_Tuple(obj)\
657 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
519658 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
520659 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
521660 #if CYTHON_ASSUME_SAFE_MACROS
614753 #define likely(x) (x)
615754 #define unlikely(x) (x)
616755 #endif /* __GNUC__ */
617
618 static PyObject *__pyx_m;
756 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
757
758 static PyObject *__pyx_m = NULL;
619759 static PyObject *__pyx_d;
620760 static PyObject *__pyx_b;
761 static PyObject *__pyx_cython_runtime = NULL;
621762 static PyObject *__pyx_empty_tuple;
622763 static PyObject *__pyx_empty_bytes;
623764 static PyObject *__pyx_empty_unicode;
742883 const char* function_name);
743884
744885 /* ArgTypeTest.proto */
745 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
746 const char *name, int exact);
886 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
887 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
888 __Pyx__ArgTypeTest(obj, type, name, exact))
889 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
747890
748891 /* PyObjectGetAttrStr.proto */
749892 #if CYTHON_USE_TYPE_SLOTS
750 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
751 PyTypeObject* tp = Py_TYPE(obj);
752 if (likely(tp->tp_getattro))
753 return tp->tp_getattro(obj, attr_name);
754 #if PY_MAJOR_VERSION < 3
755 if (likely(tp->tp_getattr))
756 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
757 #endif
758 return PyObject_GetAttr(obj, attr_name);
759 }
893 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
760894 #else
761895 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
762896 #endif
841975 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
842976 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
843977 int wraparound, int boundscheck);
844 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
978 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
845979 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
846980 int is_list, int wraparound, int boundscheck);
981
982 /* ObjectGetItem.proto */
983 #if CYTHON_USE_TYPE_SLOTS
984 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
985 #else
986 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
987 #endif
847988
848989 /* RaiseTooManyValuesToUnpack.proto */
849990 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
8681009 /* PyThreadStateGet.proto */
8691010 #if CYTHON_FAST_THREAD_STATE
8701011 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
871 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
1012 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1013 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
8721014 #else
8731015 #define __Pyx_PyThreadState_declare
8741016 #define __Pyx_PyThreadState_assign
1017 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
8751018 #endif
8761019
8771020 /* PyErrFetchRestore.proto */
8781021 #if CYTHON_FAST_THREAD_STATE
1022 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
8791023 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
8801024 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
8811025 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
8821026 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
8831027 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
8841028 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1029 #if CYTHON_COMPILING_IN_CPYTHON
1030 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
8851031 #else
1032 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1033 #endif
1034 #else
1035 #define __Pyx_PyErr_Clear() PyErr_Clear()
1036 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
8861037 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
8871038 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1039 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1040 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
8881041 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
8891042 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
8901043 #endif
9001053
9011054 /* ImportFrom.proto */
9021055 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1056
1057 /* CLineInTraceback.proto */
1058 #ifdef CYTHON_CLINE_IN_TRACEBACK
1059 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1060 #else
1061 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1062 #endif
9031063
9041064 /* CodeObjectCache.proto */
9051065 typedef struct {
9291089 /* CIntFromPy.proto */
9301090 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
9311091
1092 /* FastTypeChecks.proto */
1093 #if CYTHON_COMPILING_IN_CPYTHON
1094 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1095 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1096 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1097 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1098 #else
1099 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1100 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1101 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1102 #endif
1103 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1104
9321105 /* CheckBinaryVersion.proto */
9331106 static int __Pyx_check_binary_version(void);
9341107
9661139
9671140 /* Module declarations from 'pygame_sdl2.draw' */
9681141 #define __Pyx_MODULE_NAME "pygame_sdl2.draw"
1142 extern int __pyx_module_is_main_pygame_sdl2__draw;
9691143 int __pyx_module_is_main_pygame_sdl2__draw = 0;
9701144
9711145 /* Implementation of 'pygame_sdl2.draw' */
10231197 static const char __pyx_k_pygame_sdl2_draw[] = "pygame_sdl2.draw";
10241198 static const char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect";
10251199 static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error";
1200 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
10261201 static const char __pyx_k_pygame_sdl2_gfxdraw[] = "pygame_sdl2.gfxdraw";
10271202 static const char __pyx_k_src_pygame_sdl2_draw_pyx[] = "src/pygame_sdl2/draw.pyx";
10281203 static PyObject *__pyx_kp_u_Not_implemented;
10341209 static PyObject *__pyx_n_s_blend;
10351210 static PyObject *__pyx_n_s_box;
10361211 static PyObject *__pyx_n_s_circle;
1212 static PyObject *__pyx_n_s_cline_in_traceback;
10371213 static PyObject *__pyx_n_s_clip;
10381214 static PyObject *__pyx_n_s_closed;
10391215 static PyObject *__pyx_n_s_color;
11161292 static PyObject *__pyx_codeobj__20;
11171293 static PyObject *__pyx_codeobj__22;
11181294 static PyObject *__pyx_codeobj__24;
1295 /* Late includes */
11191296
11201297 /* "pygame_sdl2/draw.pyx":26
11211298 * from pygame_sdl2.error import error
11451322 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11461323 switch (pos_args) {
11471324 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1325 CYTHON_FALLTHROUGH;
11481326 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1327 CYTHON_FALLTHROUGH;
11491328 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1329 CYTHON_FALLTHROUGH;
11501330 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1331 CYTHON_FALLTHROUGH;
11511332 case 0: break;
11521333 default: goto __pyx_L5_argtuple_error;
11531334 }
11541335 kw_args = PyDict_Size(__pyx_kwds);
11551336 switch (pos_args) {
11561337 case 0:
1157 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
1338 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
11581339 else goto __pyx_L5_argtuple_error;
1340 CYTHON_FALLTHROUGH;
11591341 case 1:
1160 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
1342 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
11611343 else {
11621344 __Pyx_RaiseArgtupleInvalid("rect", 0, 3, 4, 1); __PYX_ERR(0, 26, __pyx_L3_error)
11631345 }
1346 CYTHON_FALLTHROUGH;
11641347 case 2:
1165 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
1348 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
11661349 else {
11671350 __Pyx_RaiseArgtupleInvalid("rect", 0, 3, 4, 2); __PYX_ERR(0, 26, __pyx_L3_error)
11681351 }
1352 CYTHON_FALLTHROUGH;
11691353 case 3:
11701354 if (kw_args > 0) {
1171 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width);
1355 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_width);
11721356 if (value) { values[3] = value; kw_args--; }
11731357 }
11741358 }
11781362 } else {
11791363 switch (PyTuple_GET_SIZE(__pyx_args)) {
11801364 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1365 CYTHON_FALLTHROUGH;
11811366 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11821367 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11831368 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12391424 */
12401425 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
12411426 __Pyx_GOTREF(__pyx_t_1);
1242 __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 27, __pyx_L1_error)
1427 __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 27, __pyx_L1_error)
12431428 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12441429 __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
12451430 if (__pyx_t_3) {
20472232 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20482233 switch (pos_args) {
20492234 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2235 CYTHON_FALLTHROUGH;
20502236 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2237 CYTHON_FALLTHROUGH;
20512238 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2239 CYTHON_FALLTHROUGH;
20522240 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2241 CYTHON_FALLTHROUGH;
20532242 case 0: break;
20542243 default: goto __pyx_L5_argtuple_error;
20552244 }
20562245 kw_args = PyDict_Size(__pyx_kwds);
20572246 switch (pos_args) {
20582247 case 0:
2059 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
2248 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
20602249 else goto __pyx_L5_argtuple_error;
2250 CYTHON_FALLTHROUGH;
20612251 case 1:
2062 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
2252 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
20632253 else {
20642254 __Pyx_RaiseArgtupleInvalid("polygon", 0, 3, 4, 1); __PYX_ERR(0, 44, __pyx_L3_error)
20652255 }
2256 CYTHON_FALLTHROUGH;
20662257 case 2:
2067 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pointlist)) != 0)) kw_args--;
2258 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pointlist)) != 0)) kw_args--;
20682259 else {
20692260 __Pyx_RaiseArgtupleInvalid("polygon", 0, 3, 4, 2); __PYX_ERR(0, 44, __pyx_L3_error)
20702261 }
2262 CYTHON_FALLTHROUGH;
20712263 case 3:
20722264 if (kw_args > 0) {
2073 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width);
2265 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_width);
20742266 if (value) { values[3] = value; kw_args--; }
20752267 }
20762268 }
20802272 } else {
20812273 switch (PyTuple_GET_SIZE(__pyx_args)) {
20822274 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2275 CYTHON_FALLTHROUGH;
20832276 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20842277 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20852278 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
22832476 * n += 1
22842477 */
22852478 while (1) {
2286 __pyx_t_8 = PyObject_Length(__pyx_v_pointlist); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 49, __pyx_L1_error)
2479 __pyx_t_8 = PyObject_Length(__pyx_v_pointlist); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 49, __pyx_L1_error)
22872480 __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
22882481 __Pyx_GOTREF(__pyx_t_1);
22892482 __pyx_t_4 = PyObject_RichCompare(__pyx_v_n, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error)
23032496 __Pyx_GOTREF(__pyx_t_1);
23042497 __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 50, __pyx_L1_error)
23052498 __Pyx_GOTREF(__pyx_t_6);
2306 __pyx_t_3 = PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error)
2499 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error)
23072500 __Pyx_GOTREF(__pyx_t_3);
23082501 __pyx_t_9 = NULL;
23092502 __pyx_t_5 = 0;
26282821 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
26292822 switch (pos_args) {
26302823 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2824 CYTHON_FALLTHROUGH;
26312825 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2826 CYTHON_FALLTHROUGH;
26322827 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2828 CYTHON_FALLTHROUGH;
26332829 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2830 CYTHON_FALLTHROUGH;
26342831 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2832 CYTHON_FALLTHROUGH;
26352833 case 0: break;
26362834 default: goto __pyx_L5_argtuple_error;
26372835 }
26382836 kw_args = PyDict_Size(__pyx_kwds);
26392837 switch (pos_args) {
26402838 case 0:
2641 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
2839 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
26422840 else goto __pyx_L5_argtuple_error;
2841 CYTHON_FALLTHROUGH;
26432842 case 1:
2644 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
2843 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
26452844 else {
26462845 __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, 1); __PYX_ERR(0, 56, __pyx_L3_error)
26472846 }
2847 CYTHON_FALLTHROUGH;
26482848 case 2:
2649 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--;
2849 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--;
26502850 else {
26512851 __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, 2); __PYX_ERR(0, 56, __pyx_L3_error)
26522852 }
2853 CYTHON_FALLTHROUGH;
26532854 case 3:
2654 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_radius)) != 0)) kw_args--;
2855 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_radius)) != 0)) kw_args--;
26552856 else {
26562857 __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, 3); __PYX_ERR(0, 56, __pyx_L3_error)
26572858 }
2859 CYTHON_FALLTHROUGH;
26582860 case 4:
26592861 if (kw_args > 0) {
2660 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width);
2862 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_width);
26612863 if (value) { values[4] = value; kw_args--; }
26622864 }
26632865 }
26672869 } else {
26682870 switch (PyTuple_GET_SIZE(__pyx_args)) {
26692871 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2872 CYTHON_FALLTHROUGH;
26702873 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
26712874 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
26722875 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
27302933 */
27312934 if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) {
27322935 PyObject* sequence = __pyx_v_pos;
2733 #if !CYTHON_COMPILING_IN_PYPY
2734 Py_ssize_t size = Py_SIZE(sequence);
2735 #else
2736 Py_ssize_t size = PySequence_Size(sequence);
2737 #endif
2936 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
27382937 if (unlikely(size != 2)) {
27392938 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
27402939 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
35153714 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
35163715 switch (pos_args) {
35173716 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3717 CYTHON_FALLTHROUGH;
35183718 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3719 CYTHON_FALLTHROUGH;
35193720 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3721 CYTHON_FALLTHROUGH;
35203722 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3723 CYTHON_FALLTHROUGH;
35213724 case 0: break;
35223725 default: goto __pyx_L5_argtuple_error;
35233726 }
35243727 kw_args = PyDict_Size(__pyx_kwds);
35253728 switch (pos_args) {
35263729 case 0:
3527 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
3730 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
35283731 else goto __pyx_L5_argtuple_error;
3732 CYTHON_FALLTHROUGH;
35293733 case 1:
3530 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
3734 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
35313735 else {
35323736 __Pyx_RaiseArgtupleInvalid("ellipse", 0, 3, 4, 1); __PYX_ERR(0, 72, __pyx_L3_error)
35333737 }
3738 CYTHON_FALLTHROUGH;
35343739 case 2:
3535 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
3740 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
35363741 else {
35373742 __Pyx_RaiseArgtupleInvalid("ellipse", 0, 3, 4, 2); __PYX_ERR(0, 72, __pyx_L3_error)
35383743 }
3744 CYTHON_FALLTHROUGH;
35393745 case 3:
35403746 if (kw_args > 0) {
3541 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width);
3747 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_width);
35423748 if (value) { values[3] = value; kw_args--; }
35433749 }
35443750 }
35483754 } else {
35493755 switch (PyTuple_GET_SIZE(__pyx_args)) {
35503756 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3757 CYTHON_FALLTHROUGH;
35513758 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
35523759 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
35533760 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
36523859 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
36533860 switch (pos_args) {
36543861 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3862 CYTHON_FALLTHROUGH;
36553863 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3864 CYTHON_FALLTHROUGH;
36563865 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3866 CYTHON_FALLTHROUGH;
36573867 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3868 CYTHON_FALLTHROUGH;
36583869 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3870 CYTHON_FALLTHROUGH;
36593871 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3872 CYTHON_FALLTHROUGH;
36603873 case 0: break;
36613874 default: goto __pyx_L5_argtuple_error;
36623875 }
36633876 kw_args = PyDict_Size(__pyx_kwds);
36643877 switch (pos_args) {
36653878 case 0:
3666 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
3879 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
36673880 else goto __pyx_L5_argtuple_error;
3881 CYTHON_FALLTHROUGH;
36683882 case 1:
3669 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
3883 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
36703884 else {
36713885 __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 1); __PYX_ERR(0, 75, __pyx_L3_error)
36723886 }
3887 CYTHON_FALLTHROUGH;
36733888 case 2:
3674 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
3889 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
36753890 else {
36763891 __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 2); __PYX_ERR(0, 75, __pyx_L3_error)
36773892 }
3893 CYTHON_FALLTHROUGH;
36783894 case 3:
3679 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start_angle)) != 0)) kw_args--;
3895 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start_angle)) != 0)) kw_args--;
36803896 else {
36813897 __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 3); __PYX_ERR(0, 75, __pyx_L3_error)
36823898 }
3899 CYTHON_FALLTHROUGH;
36833900 case 4:
3684 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stop_angle)) != 0)) kw_args--;
3901 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop_angle)) != 0)) kw_args--;
36853902 else {
36863903 __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 4); __PYX_ERR(0, 75, __pyx_L3_error)
36873904 }
3905 CYTHON_FALLTHROUGH;
36883906 case 5:
36893907 if (kw_args > 0) {
3690 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width);
3908 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_width);
36913909 if (value) { values[5] = value; kw_args--; }
36923910 }
36933911 }
36973915 } else {
36983916 switch (PyTuple_GET_SIZE(__pyx_args)) {
36993917 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3918 CYTHON_FALLTHROUGH;
37003919 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
37013920 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
37023921 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
38044023 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
38054024 switch (pos_args) {
38064025 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4026 CYTHON_FALLTHROUGH;
38074027 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4028 CYTHON_FALLTHROUGH;
38084029 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4030 CYTHON_FALLTHROUGH;
38094031 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4032 CYTHON_FALLTHROUGH;
38104033 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4034 CYTHON_FALLTHROUGH;
38114035 case 0: break;
38124036 default: goto __pyx_L5_argtuple_error;
38134037 }
38144038 kw_args = PyDict_Size(__pyx_kwds);
38154039 switch (pos_args) {
38164040 case 0:
3817 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
4041 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
38184042 else goto __pyx_L5_argtuple_error;
4043 CYTHON_FALLTHROUGH;
38194044 case 1:
3820 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
4045 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
38214046 else {
38224047 __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, 1); __PYX_ERR(0, 78, __pyx_L3_error)
38234048 }
4049 CYTHON_FALLTHROUGH;
38244050 case 2:
3825 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start_pos)) != 0)) kw_args--;
4051 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start_pos)) != 0)) kw_args--;
38264052 else {
38274053 __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, 2); __PYX_ERR(0, 78, __pyx_L3_error)
38284054 }
4055 CYTHON_FALLTHROUGH;
38294056 case 3:
3830 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end_pos)) != 0)) kw_args--;
4057 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end_pos)) != 0)) kw_args--;
38314058 else {
38324059 __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, 3); __PYX_ERR(0, 78, __pyx_L3_error)
38334060 }
4061 CYTHON_FALLTHROUGH;
38344062 case 4:
38354063 if (kw_args > 0) {
3836 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width);
4064 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_width);
38374065 if (value) { values[4] = value; kw_args--; }
38384066 }
38394067 }
38434071 } else {
38444072 switch (PyTuple_GET_SIZE(__pyx_args)) {
38454073 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4074 CYTHON_FALLTHROUGH;
38464075 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
38474076 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
38484077 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
43074536 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
43084537 switch (pos_args) {
43094538 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4539 CYTHON_FALLTHROUGH;
43104540 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4541 CYTHON_FALLTHROUGH;
43114542 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4543 CYTHON_FALLTHROUGH;
43124544 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4545 CYTHON_FALLTHROUGH;
43134546 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4547 CYTHON_FALLTHROUGH;
43144548 case 0: break;
43154549 default: goto __pyx_L5_argtuple_error;
43164550 }
43174551 kw_args = PyDict_Size(__pyx_kwds);
43184552 switch (pos_args) {
43194553 case 0:
4320 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
4554 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
43214555 else goto __pyx_L5_argtuple_error;
4556 CYTHON_FALLTHROUGH;
43224557 case 1:
4323 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
4558 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
43244559 else {
43254560 __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, 1); __PYX_ERR(0, 85, __pyx_L3_error)
43264561 }
4562 CYTHON_FALLTHROUGH;
43274563 case 2:
4328 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--;
4564 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--;
43294565 else {
43304566 __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, 2); __PYX_ERR(0, 85, __pyx_L3_error)
43314567 }
4568 CYTHON_FALLTHROUGH;
43324569 case 3:
4333 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pointlist)) != 0)) kw_args--;
4570 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pointlist)) != 0)) kw_args--;
43344571 else {
43354572 __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, 3); __PYX_ERR(0, 85, __pyx_L3_error)
43364573 }
4574 CYTHON_FALLTHROUGH;
43374575 case 4:
43384576 if (kw_args > 0) {
4339 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width);
4577 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_width);
43404578 if (value) { values[4] = value; kw_args--; }
43414579 }
43424580 }
43464584 } else {
43474585 switch (PyTuple_GET_SIZE(__pyx_args)) {
43484586 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4587 CYTHON_FALLTHROUGH;
43494588 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
43504589 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
43514590 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
44874726 * dirty.union_ip(Rect(pointlist[n+1], (width, width)))
44884727 */
44894728 while (1) {
4490 __pyx_t_8 = PyObject_Length(__pyx_v_pointlist); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 88, __pyx_L1_error)
4729 __pyx_t_8 = PyObject_Length(__pyx_v_pointlist); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 88, __pyx_L1_error)
44914730 __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_8 - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
44924731 __Pyx_GOTREF(__pyx_t_1);
44934732 __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
45054744 */
45064745 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_line); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
45074746 __Pyx_GOTREF(__pyx_t_1);
4508 __pyx_t_7 = PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 89, __pyx_L1_error)
4747 __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 89, __pyx_L1_error)
45094748 __Pyx_GOTREF(__pyx_t_7);
45104749 __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error)
45114750 __Pyx_GOTREF(__pyx_t_4);
4512 __pyx_t_3 = PyObject_GetItem(__pyx_v_pointlist, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
4751 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
45134752 __Pyx_GOTREF(__pyx_t_3);
45144753 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
45154754 __pyx_t_4 = NULL;
45854824 __Pyx_GOTREF(__pyx_t_3);
45864825 __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 90, __pyx_L1_error)
45874826 __Pyx_GOTREF(__pyx_t_7);
4588 __pyx_t_4 = PyObject_GetItem(__pyx_v_pointlist, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error)
4827 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error)
45894828 __Pyx_GOTREF(__pyx_t_4);
45904829 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
45914830 __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 90, __pyx_L1_error)
47254964 */
47264965 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_line); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
47274966 __Pyx_GOTREF(__pyx_t_1);
4728 __pyx_t_11 = PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 93, __pyx_L1_error)
4967 __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 93, __pyx_L1_error)
47294968 __Pyx_GOTREF(__pyx_t_11);
47304969 __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 93, __pyx_L1_error)
47314970 __Pyx_GOTREF(__pyx_t_5);
49355174 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
49365175 switch (pos_args) {
49375176 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5177 CYTHON_FALLTHROUGH;
49385178 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5179 CYTHON_FALLTHROUGH;
49395180 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5181 CYTHON_FALLTHROUGH;
49405182 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5183 CYTHON_FALLTHROUGH;
49415184 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5185 CYTHON_FALLTHROUGH;
49425186 case 0: break;
49435187 default: goto __pyx_L5_argtuple_error;
49445188 }
49455189 kw_args = PyDict_Size(__pyx_kwds);
49465190 switch (pos_args) {
49475191 case 0:
4948 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
5192 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
49495193 else goto __pyx_L5_argtuple_error;
5194 CYTHON_FALLTHROUGH;
49505195 case 1:
4951 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
5196 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
49525197 else {
49535198 __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, 1); __PYX_ERR(0, 96, __pyx_L3_error)
49545199 }
5200 CYTHON_FALLTHROUGH;
49555201 case 2:
4956 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_startpos)) != 0)) kw_args--;
5202 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_startpos)) != 0)) kw_args--;
49575203 else {
49585204 __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, 2); __PYX_ERR(0, 96, __pyx_L3_error)
49595205 }
5206 CYTHON_FALLTHROUGH;
49605207 case 3:
4961 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_endpos)) != 0)) kw_args--;
5208 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_endpos)) != 0)) kw_args--;
49625209 else {
49635210 __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, 3); __PYX_ERR(0, 96, __pyx_L3_error)
49645211 }
5212 CYTHON_FALLTHROUGH;
49655213 case 4:
49665214 if (kw_args > 0) {
4967 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blend);
5215 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blend);
49685216 if (value) { values[4] = value; kw_args--; }
49695217 }
49705218 }
49745222 } else {
49755223 switch (PyTuple_GET_SIZE(__pyx_args)) {
49765224 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5225 CYTHON_FALLTHROUGH;
49775226 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
49785227 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
49795228 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
50355284 */
50365285 if ((likely(PyTuple_CheckExact(__pyx_v_startpos))) || (PyList_CheckExact(__pyx_v_startpos))) {
50375286 PyObject* sequence = __pyx_v_startpos;
5038 #if !CYTHON_COMPILING_IN_PYPY
5039 Py_ssize_t size = Py_SIZE(sequence);
5040 #else
5041 Py_ssize_t size = PySequence_Size(sequence);
5042 #endif
5287 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
50435288 if (unlikely(size != 2)) {
50445289 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
50455290 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
50955340 */
50965341 if ((likely(PyTuple_CheckExact(__pyx_v_endpos))) || (PyList_CheckExact(__pyx_v_endpos))) {
50975342 PyObject* sequence = __pyx_v_endpos;
5098 #if !CYTHON_COMPILING_IN_PYPY
5099 Py_ssize_t size = Py_SIZE(sequence);
5100 #else
5101 Py_ssize_t size = PySequence_Size(sequence);
5102 #endif
5343 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
51035344 if (unlikely(size != 2)) {
51045345 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
51055346 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
54265667 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
54275668 switch (pos_args) {
54285669 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5670 CYTHON_FALLTHROUGH;
54295671 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5672 CYTHON_FALLTHROUGH;
54305673 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5674 CYTHON_FALLTHROUGH;
54315675 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5676 CYTHON_FALLTHROUGH;
54325677 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5678 CYTHON_FALLTHROUGH;
54335679 case 0: break;
54345680 default: goto __pyx_L5_argtuple_error;
54355681 }
54365682 kw_args = PyDict_Size(__pyx_kwds);
54375683 switch (pos_args) {
54385684 case 0:
5439 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
5685 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
54405686 else goto __pyx_L5_argtuple_error;
5687 CYTHON_FALLTHROUGH;
54415688 case 1:
5442 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
5689 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
54435690 else {
54445691 __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, 1); __PYX_ERR(0, 103, __pyx_L3_error)
54455692 }
5693 CYTHON_FALLTHROUGH;
54465694 case 2:
5447 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--;
5695 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--;
54485696 else {
54495697 __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, 2); __PYX_ERR(0, 103, __pyx_L3_error)
54505698 }
5699 CYTHON_FALLTHROUGH;
54515700 case 3:
5452 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pointlist)) != 0)) kw_args--;
5701 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pointlist)) != 0)) kw_args--;
54535702 else {
54545703 __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, 3); __PYX_ERR(0, 103, __pyx_L3_error)
54555704 }
5705 CYTHON_FALLTHROUGH;
54565706 case 4:
54575707 if (kw_args > 0) {
5458 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blend);
5708 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_blend);
54595709 if (value) { values[4] = value; kw_args--; }
54605710 }
54615711 }
54655715 } else {
54665716 switch (PyTuple_GET_SIZE(__pyx_args)) {
54675717 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5718 CYTHON_FALLTHROUGH;
54685719 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
54695720 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
54705721 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
55955846 * dirty.union_ip(r)
55965847 */
55975848 while (1) {
5598 __pyx_t_7 = PyObject_Length(__pyx_v_pointlist); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 106, __pyx_L1_error)
5849 __pyx_t_7 = PyObject_Length(__pyx_v_pointlist); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 106, __pyx_L1_error)
55995850 __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_7 - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
56005851 __Pyx_GOTREF(__pyx_t_1);
56015852 __pyx_t_2 = PyObject_RichCompare(__pyx_v_n, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
56135864 */
56145865 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_aaline); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
56155866 __Pyx_GOTREF(__pyx_t_1);
5616 __pyx_t_6 = PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
5867 __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 107, __pyx_L1_error)
56175868 __Pyx_GOTREF(__pyx_t_6);
56185869 __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error)
56195870 __Pyx_GOTREF(__pyx_t_3);
5620 __pyx_t_4 = PyObject_GetItem(__pyx_v_pointlist, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error)
5871 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error)
56215872 __Pyx_GOTREF(__pyx_t_4);
56225873 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
56235874 __pyx_t_3 = NULL;
57636014 */
57646015 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_aaline); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
57656016 __Pyx_GOTREF(__pyx_t_1);
5766 __pyx_t_4 = PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error)
6017 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_pointlist, __pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error)
57676018 __Pyx_GOTREF(__pyx_t_4);
57686019 __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_pointlist, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 111, __pyx_L1_error)
57696020 __Pyx_GOTREF(__pyx_t_9);
59436194 };
59446195
59456196 #if PY_MAJOR_VERSION >= 3
6197 #if CYTHON_PEP489_MULTI_PHASE_INIT
6198 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
6199 static int __pyx_pymod_exec_draw(PyObject* module); /*proto*/
6200 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
6201 {Py_mod_create, (void*)__pyx_pymod_create},
6202 {Py_mod_exec, (void*)__pyx_pymod_exec_draw},
6203 {0, NULL}
6204 };
6205 #endif
6206
59466207 static struct PyModuleDef __pyx_moduledef = {
5947 #if PY_VERSION_HEX < 0x03020000
5948 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
5949 #else
59506208 PyModuleDef_HEAD_INIT,
5951 #endif
59526209 "draw",
59536210 0, /* m_doc */
6211 #if CYTHON_PEP489_MULTI_PHASE_INIT
6212 0, /* m_size */
6213 #else
59546214 -1, /* m_size */
6215 #endif
59556216 __pyx_methods /* m_methods */,
6217 #if CYTHON_PEP489_MULTI_PHASE_INIT
6218 __pyx_moduledef_slots, /* m_slots */
6219 #else
59566220 NULL, /* m_reload */
6221 #endif
59576222 NULL, /* m_traverse */
59586223 NULL, /* m_clear */
59596224 NULL /* m_free */
59706235 {&__pyx_n_s_blend, __pyx_k_blend, sizeof(__pyx_k_blend), 0, 0, 1, 1},
59716236 {&__pyx_n_s_box, __pyx_k_box, sizeof(__pyx_k_box), 0, 0, 1, 1},
59726237 {&__pyx_n_s_circle, __pyx_k_circle, sizeof(__pyx_k_circle), 0, 0, 1, 1},
6238 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
59736239 {&__pyx_n_s_clip, __pyx_k_clip, sizeof(__pyx_k_clip), 0, 0, 1, 1},
59746240 {&__pyx_n_s_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 0, 1, 1},
59756241 {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1},
60926358 __pyx_tuple__7 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_width, __pyx_n_s_n, __pyx_n_s_r, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 26, __pyx_L1_error)
60936359 __Pyx_GOTREF(__pyx_tuple__7);
60946360 __Pyx_GIVEREF(__pyx_tuple__7);
6095 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_rect, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 26, __pyx_L1_error)
6361 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_rect, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 26, __pyx_L1_error)
60966362
60976363 /* "pygame_sdl2/draw.pyx":44
60986364 * return dirty.clip(surface.get_rect())
61046370 __pyx_tuple__9 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_pointlist, __pyx_n_s_width, __pyx_n_s_dirty, __pyx_n_s_n); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 44, __pyx_L1_error)
61056371 __Pyx_GOTREF(__pyx_tuple__9);
61066372 __Pyx_GIVEREF(__pyx_tuple__9);
6107 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_polygon, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 44, __pyx_L1_error)
6373 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_polygon, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 44, __pyx_L1_error)
61086374
61096375 /* "pygame_sdl2/draw.pyx":56
61106376 * return lines(surface, color, True, pointlist, width)
61166382 __pyx_tuple__11 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_pos, __pyx_n_s_radius, __pyx_n_s_width, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_dirty, __pyx_n_s_n); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 56, __pyx_L1_error)
61176383 __Pyx_GOTREF(__pyx_tuple__11);
61186384 __Pyx_GIVEREF(__pyx_tuple__11);
6119 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_circle, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 56, __pyx_L1_error)
6385 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_circle, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 56, __pyx_L1_error)
61206386
61216387 /* "pygame_sdl2/draw.pyx":72
61226388 * return dirty.clip(surface.get_rect())
61286394 __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_width); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 72, __pyx_L1_error)
61296395 __Pyx_GOTREF(__pyx_tuple__13);
61306396 __Pyx_GIVEREF(__pyx_tuple__13);
6131 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_ellipse, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 72, __pyx_L1_error)
6397 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_ellipse, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 72, __pyx_L1_error)
61326398
61336399 /* "pygame_sdl2/draw.pyx":75
61346400 * raise error("Not implemented.")
61406406 __pyx_tuple__15 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_start_angle, __pyx_n_s_stop_angle, __pyx_n_s_width); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 75, __pyx_L1_error)
61416407 __Pyx_GOTREF(__pyx_tuple__15);
61426408 __Pyx_GIVEREF(__pyx_tuple__15);
6143 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_arc, 75, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 75, __pyx_L1_error)
6409 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_arc, 75, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 75, __pyx_L1_error)
61446410
61456411 /* "pygame_sdl2/draw.pyx":78
61466412 * raise error("Not implemented.")
61526418 __pyx_tuple__17 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_start_pos, __pyx_n_s_end_pos, __pyx_n_s_width, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 78, __pyx_L1_error)
61536419 __Pyx_GOTREF(__pyx_tuple__17);
61546420 __Pyx_GIVEREF(__pyx_tuple__17);
6155 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_line, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 78, __pyx_L1_error)
6421 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_line, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 78, __pyx_L1_error)
61566422
61576423 /* "pygame_sdl2/draw.pyx":85
61586424 * return dirty.clip(surface.get_rect())
61646430 __pyx_tuple__19 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_closed, __pyx_n_s_pointlist, __pyx_n_s_width, __pyx_n_s_n, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 85, __pyx_L1_error)
61656431 __Pyx_GOTREF(__pyx_tuple__19);
61666432 __Pyx_GIVEREF(__pyx_tuple__19);
6167 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_lines, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 85, __pyx_L1_error)
6433 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_lines, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 85, __pyx_L1_error)
61686434
61696435 /* "pygame_sdl2/draw.pyx":96
61706436 * return dirty.clip(surface.get_rect())
61766442 __pyx_tuple__21 = PyTuple_Pack(10, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_startpos, __pyx_n_s_endpos, __pyx_n_s_blend, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_dirty); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 96, __pyx_L1_error)
61776443 __Pyx_GOTREF(__pyx_tuple__21);
61786444 __Pyx_GIVEREF(__pyx_tuple__21);
6179 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_aaline, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 96, __pyx_L1_error)
6445 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_aaline, 96, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 96, __pyx_L1_error)
61806446
61816447 /* "pygame_sdl2/draw.pyx":103
61826448 * return dirty.clip(surface.get_rect())
61886454 __pyx_tuple__23 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_color, __pyx_n_s_closed, __pyx_n_s_pointlist, __pyx_n_s_blend, __pyx_n_s_n, __pyx_n_s_dirty, __pyx_n_s_r); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 103, __pyx_L1_error)
61896455 __Pyx_GOTREF(__pyx_tuple__23);
61906456 __Pyx_GIVEREF(__pyx_tuple__23);
6191 __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_aalines, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 103, __pyx_L1_error)
6457 __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_draw_pyx, __pyx_n_s_aalines, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 103, __pyx_L1_error)
61926458 __Pyx_RefNannyFinishContext();
61936459 return 0;
61946460 __pyx_L1_error:;
62066472 return -1;
62076473 }
62086474
6475 static int __Pyx_modinit_global_init_code(void); /*proto*/
6476 static int __Pyx_modinit_variable_export_code(void); /*proto*/
6477 static int __Pyx_modinit_function_export_code(void); /*proto*/
6478 static int __Pyx_modinit_type_init_code(void); /*proto*/
6479 static int __Pyx_modinit_type_import_code(void); /*proto*/
6480 static int __Pyx_modinit_variable_import_code(void); /*proto*/
6481 static int __Pyx_modinit_function_import_code(void); /*proto*/
6482
6483 static int __Pyx_modinit_global_init_code(void) {
6484 __Pyx_RefNannyDeclarations
6485 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
6486 /*--- Global init code ---*/
6487 __Pyx_RefNannyFinishContext();
6488 return 0;
6489 }
6490
6491 static int __Pyx_modinit_variable_export_code(void) {
6492 __Pyx_RefNannyDeclarations
6493 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
6494 /*--- Variable export code ---*/
6495 __Pyx_RefNannyFinishContext();
6496 return 0;
6497 }
6498
6499 static int __Pyx_modinit_function_export_code(void) {
6500 __Pyx_RefNannyDeclarations
6501 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
6502 /*--- Function export code ---*/
6503 __Pyx_RefNannyFinishContext();
6504 return 0;
6505 }
6506
6507 static int __Pyx_modinit_type_init_code(void) {
6508 __Pyx_RefNannyDeclarations
6509 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
6510 /*--- Type init code ---*/
6511 __Pyx_RefNannyFinishContext();
6512 return 0;
6513 }
6514
6515 static int __Pyx_modinit_type_import_code(void) {
6516 __Pyx_RefNannyDeclarations
6517 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
6518 /*--- Type import code ---*/
6519 __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
6520 __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
6521 __Pyx_RefNannyFinishContext();
6522 return 0;
6523 __pyx_L1_error:;
6524 __Pyx_RefNannyFinishContext();
6525 return -1;
6526 }
6527
6528 static int __Pyx_modinit_variable_import_code(void) {
6529 __Pyx_RefNannyDeclarations
6530 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
6531 /*--- Variable import code ---*/
6532 __Pyx_RefNannyFinishContext();
6533 return 0;
6534 }
6535
6536 static int __Pyx_modinit_function_import_code(void) {
6537 __Pyx_RefNannyDeclarations
6538 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
6539 /*--- Function import code ---*/
6540 __Pyx_RefNannyFinishContext();
6541 return 0;
6542 }
6543
6544
62096545 #if PY_MAJOR_VERSION < 3
6210 PyMODINIT_FUNC initdraw(void); /*proto*/
6211 PyMODINIT_FUNC initdraw(void)
6546 #ifdef CYTHON_NO_PYINIT_EXPORT
6547 #define __Pyx_PyMODINIT_FUNC void
62126548 #else
6213 PyMODINIT_FUNC PyInit_draw(void); /*proto*/
6214 PyMODINIT_FUNC PyInit_draw(void)
6549 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
6550 #endif
6551 #else
6552 #ifdef CYTHON_NO_PYINIT_EXPORT
6553 #define __Pyx_PyMODINIT_FUNC PyObject *
6554 #else
6555 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
6556 #endif
6557 #endif
6558 #ifndef CYTHON_SMALL_CODE
6559 #if defined(__clang__)
6560 #define CYTHON_SMALL_CODE
6561 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
6562 #define CYTHON_SMALL_CODE __attribute__((cold))
6563 #else
6564 #define CYTHON_SMALL_CODE
6565 #endif
6566 #endif
6567
6568
6569 #if PY_MAJOR_VERSION < 3
6570 __Pyx_PyMODINIT_FUNC initdraw(void) CYTHON_SMALL_CODE; /*proto*/
6571 __Pyx_PyMODINIT_FUNC initdraw(void)
6572 #else
6573 __Pyx_PyMODINIT_FUNC PyInit_draw(void) CYTHON_SMALL_CODE; /*proto*/
6574 __Pyx_PyMODINIT_FUNC PyInit_draw(void)
6575 #if CYTHON_PEP489_MULTI_PHASE_INIT
6576 {
6577 return PyModuleDef_Init(&__pyx_moduledef);
6578 }
6579 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
6580 PyObject *value = PyObject_GetAttrString(spec, from_name);
6581 int result = 0;
6582 if (likely(value)) {
6583 result = PyDict_SetItemString(moddict, to_name, value);
6584 Py_DECREF(value);
6585 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
6586 PyErr_Clear();
6587 } else {
6588 result = -1;
6589 }
6590 return result;
6591 }
6592 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
6593 PyObject *module = NULL, *moddict, *modname;
6594 if (__pyx_m)
6595 return __Pyx_NewRef(__pyx_m);
6596 modname = PyObject_GetAttrString(spec, "name");
6597 if (unlikely(!modname)) goto bad;
6598 module = PyModule_NewObject(modname);
6599 Py_DECREF(modname);
6600 if (unlikely(!module)) goto bad;
6601 moddict = PyModule_GetDict(module);
6602 if (unlikely(!moddict)) goto bad;
6603 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
6604 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
6605 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
6606 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
6607 return module;
6608 bad:
6609 Py_XDECREF(module);
6610 return NULL;
6611 }
6612
6613
6614 static int __pyx_pymod_exec_draw(PyObject *__pyx_pyinit_module)
6615 #endif
62156616 #endif
62166617 {
62176618 PyObject *__pyx_t_1 = NULL;
62186619 PyObject *__pyx_t_2 = NULL;
62196620 __Pyx_RefNannyDeclarations
6621 #if CYTHON_PEP489_MULTI_PHASE_INIT
6622 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
6623 #elif PY_MAJOR_VERSION >= 3
6624 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
6625 #endif
62206626 #if CYTHON_REFNANNY
6221 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
6222 if (!__Pyx_RefNanny) {
6223 PyErr_Clear();
6224 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
6225 if (!__Pyx_RefNanny)
6226 Py_FatalError("failed to import 'refnanny' module");
6227 }
6228 #endif
6229 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_draw(void)", 0);
6627 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
6628 if (!__Pyx_RefNanny) {
6629 PyErr_Clear();
6630 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
6631 if (!__Pyx_RefNanny)
6632 Py_FatalError("failed to import 'refnanny' module");
6633 }
6634 #endif
6635 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_draw(void)", 0);
62306636 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
62316637 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
62326638 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
62436649 #ifdef __Pyx_Generator_USED
62446650 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
62456651 #endif
6652 #ifdef __Pyx_AsyncGen_USED
6653 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6654 #endif
62466655 #ifdef __Pyx_StopAsyncIteration_USED
62476656 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
62486657 #endif
62546663 #endif
62556664 #endif
62566665 /*--- Module creation code ---*/
6666 #if CYTHON_PEP489_MULTI_PHASE_INIT
6667 __pyx_m = __pyx_pyinit_module;
6668 Py_INCREF(__pyx_m);
6669 #else
62576670 #if PY_MAJOR_VERSION < 3
62586671 __pyx_m = Py_InitModule4("draw", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
62596672 #else
62606673 __pyx_m = PyModule_Create(&__pyx_moduledef);
62616674 #endif
62626675 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
6676 #endif
62636677 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
62646678 Py_INCREF(__pyx_d);
62656679 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
6680 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
62666681 #if CYTHON_COMPILING_IN_PYPY
62676682 Py_INCREF(__pyx_b);
62686683 #endif
62876702 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
62886703 /*--- Constants init code ---*/
62896704 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
6290 /*--- Global init code ---*/
6291 /*--- Variable export code ---*/
6292 /*--- Function export code ---*/
6293 /*--- Type init code ---*/
6294 /*--- Type import code ---*/
6295 __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
6296 __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
6297 /*--- Variable import code ---*/
6298 /*--- Function import code ---*/
6705 /*--- Global type/function init code ---*/
6706 (void)__Pyx_modinit_global_init_code();
6707 (void)__Pyx_modinit_variable_export_code();
6708 (void)__Pyx_modinit_function_export_code();
6709 (void)__Pyx_modinit_type_init_code();
6710 if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
6711 (void)__Pyx_modinit_variable_import_code();
6712 (void)__Pyx_modinit_function_import_code();
62996713 /*--- Execution code ---*/
63006714 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
63016715 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
64746888 * #
64756889 * # This software is provided 'as-is', without any express or implied
64766890 */
6477 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
6891 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
64786892 __Pyx_GOTREF(__pyx_t_2);
64796893 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
64806894 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
64876901 __Pyx_XDECREF(__pyx_t_2);
64886902 if (__pyx_m) {
64896903 if (__pyx_d) {
6490 __Pyx_AddTraceback("init pygame_sdl2.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
6904 __Pyx_AddTraceback("init pygame_sdl2.draw", 0, __pyx_lineno, __pyx_filename);
64916905 }
64926906 Py_DECREF(__pyx_m); __pyx_m = 0;
64936907 } else if (!PyErr_Occurred()) {
64956909 }
64966910 __pyx_L0:;
64976911 __Pyx_RefNannyFinishContext();
6498 #if PY_MAJOR_VERSION < 3
6912 #if CYTHON_PEP489_MULTI_PHASE_INIT
6913 return (__pyx_m != NULL) ? 0 : -1;
6914 #elif PY_MAJOR_VERSION >= 3
6915 return __pyx_m;
6916 #else
64996917 return;
6500 #else
6501 return __pyx_m;
65026918 #endif
65036919 }
65046920
66637079 }
66647080
66657081 /* ArgTypeTest */
6666 static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
6667 PyErr_Format(PyExc_TypeError,
6668 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
6669 name, type->tp_name, Py_TYPE(obj)->tp_name);
6670 }
6671 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
6672 const char *name, int exact)
7082 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
66737083 {
66747084 if (unlikely(!type)) {
66757085 PyErr_SetString(PyExc_SystemError, "Missing type object");
66767086 return 0;
66777087 }
6678 if (none_allowed && obj == Py_None) return 1;
66797088 else if (exact) {
6680 if (likely(Py_TYPE(obj) == type)) return 1;
66817089 #if PY_MAJOR_VERSION == 2
6682 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
7090 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
66837091 #endif
66847092 }
66857093 else {
6686 if (likely(PyObject_TypeCheck(obj, type))) return 1;
6687 }
6688 __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
7094 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
7095 }
7096 PyErr_Format(PyExc_TypeError,
7097 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
7098 name, type->tp_name, Py_TYPE(obj)->tp_name);
66897099 return 0;
66907100 }
7101
7102 /* PyObjectGetAttrStr */
7103 #if CYTHON_USE_TYPE_SLOTS
7104 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
7105 PyTypeObject* tp = Py_TYPE(obj);
7106 if (likely(tp->tp_getattro))
7107 return tp->tp_getattro(obj, attr_name);
7108 #if PY_MAJOR_VERSION < 3
7109 if (likely(tp->tp_getattr))
7110 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
7111 #endif
7112 return PyObject_GetAttr(obj, attr_name);
7113 }
7114 #endif
66917115
66927116 /* GetBuiltinName */
66937117 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
67077131 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
67087132 PyObject *result;
67097133 #if !CYTHON_AVOID_BORROWED_REFS
7134 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
7135 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
7136 if (likely(result)) {
7137 Py_INCREF(result);
7138 } else if (unlikely(PyErr_Occurred())) {
7139 result = NULL;
7140 } else {
7141 #else
67107142 result = PyDict_GetItem(__pyx_d, name);
67117143 if (likely(result)) {
67127144 Py_INCREF(result);
67137145 } else {
7146 #endif
67147147 #else
67157148 result = PyObject_GetItem(__pyx_d, name);
67167149 if (!result) {
67227155 }
67237156
67247157 /* PyCFunctionFastCall */
6725 #if CYTHON_FAST_PYCCALL
7158 #if CYTHON_FAST_PYCCALL
67267159 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
67277160 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
67287161 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
67297162 PyObject *self = PyCFunction_GET_SELF(func);
7163 int flags = PyCFunction_GET_FLAGS(func);
67307164 assert(PyCFunction_Check(func));
6731 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
7165 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
67327166 assert(nargs >= 0);
67337167 assert(nargs == 0 || args != NULL);
67347168 /* _PyCFunction_FastCallDict() must not be called with an exception set,
67357169 because it may clear it (directly or indirectly) and so the
67367170 caller loses its exception */
67377171 assert(!PyErr_Occurred());
6738 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
6739 }
6740 #endif // CYTHON_FAST_PYCCALL
7172 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
7173 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
7174 } else {
7175 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
7176 }
7177 }
7178 #endif
67417179
67427180 /* PyFunctionFastCall */
6743 #if CYTHON_FAST_PYCALL
7181 #if CYTHON_FAST_PYCALL
67447182 #include "frameobject.h"
67457183 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
67467184 PyObject *globals) {
67477185 PyFrameObject *f;
6748 PyThreadState *tstate = PyThreadState_GET();
7186 PyThreadState *tstate = __Pyx_PyThreadState_Current;
67497187 PyObject **fastlocals;
67507188 Py_ssize_t i;
67517189 PyObject *result;
68567294 Py_LeaveRecursiveCall();
68577295 return result;
68587296 }
6859 #endif // CPython < 3.6
6860 #endif // CYTHON_FAST_PYCALL
7297 #endif
7298 #endif
68617299
68627300 /* PyObjectCall */
6863 #if CYTHON_COMPILING_IN_CPYTHON
7301 #if CYTHON_COMPILING_IN_CPYTHON
68647302 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
68657303 PyObject *result;
68667304 ternaryfunc call = func->ob_type->tp_call;
68807318 #endif
68817319
68827320 /* PyObjectCallMethO */
6883 #if CYTHON_COMPILING_IN_CPYTHON
7321 #if CYTHON_COMPILING_IN_CPYTHON
68847322 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
68857323 PyObject *self, *result;
68867324 PyCFunction cfunc;
69007338 #endif
69017339
69027340 /* PyObjectCallOneArg */
6903 #if CYTHON_COMPILING_IN_CPYTHON
7341 #if CYTHON_COMPILING_IN_CPYTHON
69047342 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
69057343 PyObject *result;
69067344 PyObject *args = PyTuple_New(1);
69177355 return __Pyx_PyFunction_FastCall(func, &arg, 1);
69187356 }
69197357 #endif
6920 #ifdef __Pyx_CyFunction_USED
6921 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
6922 #else
69237358 if (likely(PyCFunction_Check(func))) {
6924 #endif
69257359 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
69267360 return __Pyx_PyObject_CallMethO(func, arg);
69277361 #if CYTHON_FAST_PYCCALL
69767410 a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69777411 break;
69787412 }
7413 CYTHON_FALLTHROUGH;
69797414 case 2:
69807415 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
69817416 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69827417 break;
69837418 }
7419 CYTHON_FALLTHROUGH;
69847420 case -3:
69857421 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
69867422 a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69877423 break;
69887424 }
7425 CYTHON_FALLTHROUGH;
69897426 case 3:
69907427 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
69917428 a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69927429 break;
69937430 }
7431 CYTHON_FALLTHROUGH;
69947432 case -4:
69957433 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
69967434 a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69977435 break;
69987436 }
7437 CYTHON_FALLTHROUGH;
69997438 case 4:
70007439 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
70017440 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
70027441 break;
70037442 }
7443 CYTHON_FALLTHROUGH;
70047444 #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
70057445 default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
70067446 #else
70677507 goto long_long;
70687508 #endif
70697509 }
7510 CYTHON_FALLTHROUGH;
70707511 case 2:
70717512 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
70727513 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
70777518 goto long_long;
70787519 #endif
70797520 }
7521 CYTHON_FALLTHROUGH;
70807522 case -3:
70817523 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
70827524 a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
70877529 goto long_long;
70887530 #endif
70897531 }
7532 CYTHON_FALLTHROUGH;
70907533 case 3:
70917534 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
70927535 a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
70977540 goto long_long;
70987541 #endif
70997542 }
7543 CYTHON_FALLTHROUGH;
71007544 case -4:
71017545 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
71027546 a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
71077551 goto long_long;
71087552 #endif
71097553 }
7554 CYTHON_FALLTHROUGH;
71107555 case 4:
71117556 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
71127557 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
71177562 goto long_long;
71187563 #endif
71197564 }
7565 CYTHON_FALLTHROUGH;
71207566 default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
71217567 }
71227568 }
71537599 }
71547600 #endif
71557601 #ifdef __Pyx_CyFunction_USED
7156 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
7602 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
71577603 #else
71587604 if (likely(PyCFunction_Check(func))) {
71597605 #endif
71667612 #endif
71677613
71687614 /* GetItemInt */
7169 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
7615 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
71707616 PyObject *r;
71717617 if (!j) return NULL;
71727618 r = PyObject_GetItem(o, j);
71777623 CYTHON_NCP_UNUSED int wraparound,
71787624 CYTHON_NCP_UNUSED int boundscheck) {
71797625 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7180 if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
7181 if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
7182 PyObject *r = PyList_GET_ITEM(o, i);
7626 Py_ssize_t wrapped_i = i;
7627 if (wraparound & unlikely(i < 0)) {
7628 wrapped_i += PyList_GET_SIZE(o);
7629 }
7630 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
7631 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
71837632 Py_INCREF(r);
71847633 return r;
71857634 }
71927641 CYTHON_NCP_UNUSED int wraparound,
71937642 CYTHON_NCP_UNUSED int boundscheck) {
71947643 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7195 if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
7196 if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
7197 PyObject *r = PyTuple_GET_ITEM(o, i);
7644 Py_ssize_t wrapped_i = i;
7645 if (wraparound & unlikely(i < 0)) {
7646 wrapped_i += PyTuple_GET_SIZE(o);
7647 }
7648 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
7649 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
71987650 Py_INCREF(r);
71997651 return r;
72007652 }
72467698 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
72477699 }
72487700
7701 /* ObjectGetItem */
7702 #if CYTHON_USE_TYPE_SLOTS
7703 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
7704 PyObject *runerr;
7705 Py_ssize_t key_value;
7706 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
7707 if (unlikely(!(m && m->sq_item))) {
7708 PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
7709 return NULL;
7710 }
7711 key_value = __Pyx_PyIndex_AsSsize_t(index);
7712 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
7713 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
7714 }
7715 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
7716 PyErr_Clear();
7717 PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
7718 }
7719 return NULL;
7720 }
7721 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
7722 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
7723 if (likely(m && m->mp_subscript)) {
7724 return m->mp_subscript(obj, key);
7725 }
7726 return __Pyx_PyObject_GetIndex(obj, key);
7727 }
7728 #endif
7729
72497730 /* RaiseTooManyValuesToUnpack */
72507731 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
72517732 PyErr_Format(PyExc_ValueError,
72627743 /* IterFinish */
72637744 static CYTHON_INLINE int __Pyx_IterFinish(void) {
72647745 #if CYTHON_FAST_THREAD_STATE
7265 PyThreadState *tstate = PyThreadState_GET();
7746 PyThreadState *tstate = __Pyx_PyThreadState_Current;
72667747 PyObject* exc_type = tstate->curexc_type;
72677748 if (unlikely(exc_type)) {
7268 if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
7749 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
72697750 PyObject *exc_value, *exc_tb;
72707751 exc_value = tstate->curexc_value;
72717752 exc_tb = tstate->curexc_traceback;
73457826 goto long_long;
73467827 #endif
73477828 }
7829 CYTHON_FALLTHROUGH;
73487830 case 2:
73497831 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
73507832 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
73557837 goto long_long;
73567838 #endif
73577839 }
7840 CYTHON_FALLTHROUGH;
73587841 case -3:
73597842 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
73607843 a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
73657848 goto long_long;
73667849 #endif
73677850 }
7851 CYTHON_FALLTHROUGH;
73687852 case 3:
73697853 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
73707854 a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
73757859 goto long_long;
73767860 #endif
73777861 }
7862 CYTHON_FALLTHROUGH;
73787863 case -4:
73797864 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
73807865 a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
73857870 goto long_long;
73867871 #endif
73877872 }
7873 CYTHON_FALLTHROUGH;
73887874 case 4:
73897875 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
73907876 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
73957881 goto long_long;
73967882 #endif
73977883 }
7884 CYTHON_FALLTHROUGH;
73987885 default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
73997886 }
74007887 }
75628049 "raise: exception class must be a subclass of BaseException");
75638050 goto bad;
75648051 }
7565 #if PY_VERSION_HEX >= 0x03030000
75668052 if (cause) {
7567 #else
7568 if (cause && cause != Py_None) {
7569 #endif
75708053 PyObject *fixed_cause;
75718054 if (cause == Py_None) {
75728055 fixed_cause = NULL;
75948077 PyErr_Restore(tmp_type, tmp_value, tb);
75958078 Py_XDECREF(tmp_tb);
75968079 #else
7597 PyThreadState *tstate = PyThreadState_GET();
8080 PyThreadState *tstate = __Pyx_PyThreadState_Current;
75988081 PyObject* tmp_tb = tstate->curexc_traceback;
75998082 if (tb != tmp_tb) {
76008083 Py_INCREF(tb);
76108093 #endif
76118094
76128095 /* GetVTable */
7613 static void* __Pyx_GetVtable(PyObject *dict) {
8096 static void* __Pyx_GetVtable(PyObject *dict) {
76148097 void* ptr;
76158098 PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
76168099 if (!ob)
76308113 }
76318114
76328115 /* Import */
7633 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
8116 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
76348117 PyObject *empty_list = 0;
76358118 PyObject *module = 0;
76368119 PyObject *global_dict = 0;
76378120 PyObject *empty_dict = 0;
76388121 PyObject *list;
7639 #if PY_VERSION_HEX < 0x03030000
8122 #if PY_MAJOR_VERSION < 3
76408123 PyObject *py_import;
76418124 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
76428125 if (!py_import)
76608143 #if PY_MAJOR_VERSION >= 3
76618144 if (level == -1) {
76628145 if (strchr(__Pyx_MODULE_NAME, '.')) {
7663 #if PY_VERSION_HEX < 0x03030000
7664 PyObject *py_level = PyInt_FromLong(1);
7665 if (!py_level)
7666 goto bad;
7667 module = PyObject_CallFunctionObjArgs(py_import,
7668 name, global_dict, empty_dict, list, py_level, NULL);
7669 Py_DECREF(py_level);
7670 #else
76718146 module = PyImport_ImportModuleLevelObject(
76728147 name, global_dict, empty_dict, list, 1);
7673 #endif
76748148 if (!module) {
76758149 if (!PyErr_ExceptionMatches(PyExc_ImportError))
76768150 goto bad;
76818155 }
76828156 #endif
76838157 if (!module) {
7684 #if PY_VERSION_HEX < 0x03030000
8158 #if PY_MAJOR_VERSION < 3
76858159 PyObject *py_level = PyInt_FromLong(level);
76868160 if (!py_level)
76878161 goto bad;
76958169 }
76968170 }
76978171 bad:
7698 #if PY_VERSION_HEX < 0x03030000
8172 #if PY_MAJOR_VERSION < 3
76998173 Py_XDECREF(py_import);
77008174 #endif
77018175 Py_XDECREF(empty_list);
77048178 }
77058179
77068180 /* ImportFrom */
7707 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
8181 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
77088182 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
77098183 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
77108184 PyErr_Format(PyExc_ImportError,
77178191 return value;
77188192 }
77198193
8194 /* CLineInTraceback */
8195 #ifndef CYTHON_CLINE_IN_TRACEBACK
8196 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
8197 PyObject *use_cline;
8198 PyObject *ptype, *pvalue, *ptraceback;
8199 #if CYTHON_COMPILING_IN_CPYTHON
8200 PyObject **cython_runtime_dict;
8201 #endif
8202 if (unlikely(!__pyx_cython_runtime)) {
8203 return c_line;
8204 }
8205 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
8206 #if CYTHON_COMPILING_IN_CPYTHON
8207 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
8208 if (likely(cython_runtime_dict)) {
8209 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
8210 } else
8211 #endif
8212 {
8213 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
8214 if (use_cline_obj) {
8215 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
8216 Py_DECREF(use_cline_obj);
8217 } else {
8218 PyErr_Clear();
8219 use_cline = NULL;
8220 }
8221 }
8222 if (!use_cline) {
8223 c_line = 0;
8224 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
8225 }
8226 else if (PyObject_Not(use_cline) != 0) {
8227 c_line = 0;
8228 }
8229 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
8230 return c_line;
8231 }
8232 #endif
8233
77208234 /* CodeObjectCache */
7721 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
8235 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
77228236 int start = 0, mid = 0, end = count - 1;
77238237 if (end >= 0 && code_line > entries[end].code_line) {
77248238 return count;
77988312 }
77998313
78008314 /* AddTraceback */
7801 #include "compile.h"
8315 #include "compile.h"
78028316 #include "frameobject.h"
78038317 #include "traceback.h"
78048318 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
78578371 int py_line, const char *filename) {
78588372 PyCodeObject *py_code = 0;
78598373 PyFrameObject *py_frame = 0;
7860 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
8374 PyThreadState *tstate = __Pyx_PyThreadState_Current;
8375 if (c_line) {
8376 c_line = __Pyx_CLineForTraceback(tstate, c_line);
8377 }
8378 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
78618379 if (!py_code) {
78628380 py_code = __Pyx_CreateCodeObjectForTraceback(
78638381 funcname, c_line, py_line, filename);
78648382 if (!py_code) goto bad;
7865 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
8383 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
78668384 }
78678385 py_frame = PyFrame_New(
7868 PyThreadState_GET(), /*PyThreadState *tstate,*/
7869 py_code, /*PyCodeObject *code,*/
7870 __pyx_d, /*PyObject *globals,*/
7871 0 /*PyObject *locals*/
8386 tstate, /*PyThreadState *tstate,*/
8387 py_code, /*PyCodeObject *code,*/
8388 __pyx_d, /*PyObject *globals,*/
8389 0 /*PyObject *locals*/
78728390 );
78738391 if (!py_frame) goto bad;
78748392 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
78798397 }
78808398
78818399 /* CIntToPy */
7882 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
8400 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
78838401 const long neg_one = (long) -1, const_zero = (long) 0;
78848402 const int is_unsigned = neg_one > const_zero;
78858403 if (is_unsigned) {
79108428 }
79118429
79128430 /* CIntFromPyVerify */
7913 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
8431 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
79148432 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
79158433 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
79168434 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
79328450 }
79338451
79348452 /* CIntFromPy */
7935 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
8453 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
79368454 const long neg_one = (long) -1, const_zero = (long) 0;
79378455 const int is_unsigned = neg_one > const_zero;
79388456 #if PY_MAJOR_VERSION < 3
81218639 }
81228640
81238641 /* CIntFromPy */
8124 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
8642 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
81258643 const int neg_one = (int) -1, const_zero = (int) 0;
81268644 const int is_unsigned = neg_one > const_zero;
81278645 #if PY_MAJOR_VERSION < 3
83098827 return (int) -1;
83108828 }
83118829
8830 /* FastTypeChecks */
8831 #if CYTHON_COMPILING_IN_CPYTHON
8832 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
8833 while (a) {
8834 a = a->tp_base;
8835 if (a == b)
8836 return 1;
8837 }
8838 return b == &PyBaseObject_Type;
8839 }
8840 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
8841 PyObject *mro;
8842 if (a == b) return 1;
8843 mro = a->tp_mro;
8844 if (likely(mro)) {
8845 Py_ssize_t i, n;
8846 n = PyTuple_GET_SIZE(mro);
8847 for (i = 0; i < n; i++) {
8848 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
8849 return 1;
8850 }
8851 return 0;
8852 }
8853 return __Pyx_InBases(a, b);
8854 }
8855 #if PY_MAJOR_VERSION == 2
8856 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
8857 PyObject *exception, *value, *tb;
8858 int res;
8859 __Pyx_PyThreadState_declare
8860 __Pyx_PyThreadState_assign
8861 __Pyx_ErrFetch(&exception, &value, &tb);
8862 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
8863 if (unlikely(res == -1)) {
8864 PyErr_WriteUnraisable(err);
8865 res = 0;
8866 }
8867 if (!res) {
8868 res = PyObject_IsSubclass(err, exc_type2);
8869 if (unlikely(res == -1)) {
8870 PyErr_WriteUnraisable(err);
8871 res = 0;
8872 }
8873 }
8874 __Pyx_ErrRestore(exception, value, tb);
8875 return res;
8876 }
8877 #else
8878 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
8879 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
8880 if (!res) {
8881 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
8882 }
8883 return res;
8884 }
8885 #endif
8886 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
8887 Py_ssize_t i, n;
8888 assert(PyExceptionClass_Check(exc_type));
8889 n = PyTuple_GET_SIZE(tuple);
8890 #if PY_MAJOR_VERSION >= 3
8891 for (i=0; i<n; i++) {
8892 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
8893 }
8894 #endif
8895 for (i=0; i<n; i++) {
8896 PyObject *t = PyTuple_GET_ITEM(tuple, i);
8897 #if PY_MAJOR_VERSION < 3
8898 if (likely(exc_type == t)) return 1;
8899 #endif
8900 if (likely(PyExceptionClass_Check(t))) {
8901 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
8902 } else {
8903 }
8904 }
8905 return 0;
8906 }
8907 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
8908 if (likely(err == exc_type)) return 1;
8909 if (likely(PyExceptionClass_Check(err))) {
8910 if (likely(PyExceptionClass_Check(exc_type))) {
8911 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
8912 } else if (likely(PyTuple_Check(exc_type))) {
8913 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
8914 } else {
8915 }
8916 }
8917 return PyErr_GivenExceptionMatches(err, exc_type);
8918 }
8919 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
8920 assert(PyExceptionClass_Check(exc_type1));
8921 assert(PyExceptionClass_Check(exc_type2));
8922 if (likely(err == exc_type1 || err == exc_type2)) return 1;
8923 if (likely(PyExceptionClass_Check(err))) {
8924 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
8925 }
8926 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
8927 }
8928 #endif
8929
83128930 /* CheckBinaryVersion */
8313 static int __Pyx_check_binary_version(void) {
8931 static int __Pyx_check_binary_version(void) {
83148932 char ctversion[4], rtversion[4];
83158933 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
83168934 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
83268944 }
83278945
83288946 /* ModuleImport */
8329 #ifndef __PYX_HAVE_RT_ImportModule
8947 #ifndef __PYX_HAVE_RT_ImportModule
83308948 #define __PYX_HAVE_RT_ImportModule
83318949 static PyObject *__Pyx_ImportModule(const char *name) {
83328950 PyObject *py_name = 0;
83448962 #endif
83458963
83468964 /* TypeImport */
8347 #ifndef __PYX_HAVE_RT_ImportType
8965 #ifndef __PYX_HAVE_RT_ImportType
83488966 #define __PYX_HAVE_RT_ImportType
83498967 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
83508968 size_t size, int strict)
84099027 #endif
84109028
84119029 /* InitStrings */
8412 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
9030 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
84139031 while (t->p) {
84149032 #if PY_MAJOR_VERSION < 3
84159033 if (t->is_unicode) {
84349052 #endif
84359053 if (!*t->p)
84369054 return -1;
9055 if (PyObject_Hash(*t->p) == -1)
9056 return -1;
84379057 ++t;
84389058 }
84399059 return 0;
84429062 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
84439063 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
84449064 }
8445 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
9065 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
84469066 Py_ssize_t ignore;
84479067 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
84489068 }
8449 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
8450 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
9069 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
9070 #if !CYTHON_PEP393_ENABLED
9071 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
9072 char* defenc_c;
9073 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
9074 if (!defenc) return NULL;
9075 defenc_c = PyBytes_AS_STRING(defenc);
9076 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
9077 {
9078 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
9079 char* c;
9080 for (c = defenc_c; c < end; c++) {
9081 if ((unsigned char) (*c) >= 128) {
9082 PyUnicode_AsASCIIString(o);
9083 return NULL;
9084 }
9085 }
9086 }
9087 #endif
9088 *length = PyBytes_GET_SIZE(defenc);
9089 return defenc_c;
9090 }
9091 #else
9092 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
9093 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
9094 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
9095 if (likely(PyUnicode_IS_ASCII(o))) {
9096 *length = PyUnicode_GET_LENGTH(o);
9097 return PyUnicode_AsUTF8(o);
9098 } else {
9099 PyUnicode_AsASCIIString(o);
9100 return NULL;
9101 }
9102 #else
9103 return PyUnicode_AsUTF8AndSize(o, length);
9104 #endif
9105 }
9106 #endif
9107 #endif
9108 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
9109 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
84519110 if (
84529111 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
84539112 __Pyx_sys_getdefaultencoding_not_ascii &&
84549113 #endif
84559114 PyUnicode_Check(o)) {
8456 #if PY_VERSION_HEX < 0x03030000
8457 char* defenc_c;
8458 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
8459 if (!defenc) return NULL;
8460 defenc_c = PyBytes_AS_STRING(defenc);
8461 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
8462 {
8463 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
8464 char* c;
8465 for (c = defenc_c; c < end; c++) {
8466 if ((unsigned char) (*c) >= 128) {
8467 PyUnicode_AsASCIIString(o);
8468 return NULL;
8469 }
8470 }
8471 }
8472 #endif
8473 *length = PyBytes_GET_SIZE(defenc);
8474 return defenc_c;
8475 #else
8476 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
8477 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
8478 if (PyUnicode_IS_ASCII(o)) {
8479 *length = PyUnicode_GET_LENGTH(o);
8480 return PyUnicode_AsUTF8(o);
8481 } else {
8482 PyUnicode_AsASCIIString(o);
8483 return NULL;
8484 }
8485 #else
8486 return PyUnicode_AsUTF8AndSize(o, length);
8487 #endif
8488 #endif
9115 return __Pyx_PyUnicode_AsStringAndSize(o, length);
84899116 } else
84909117 #endif
84919118 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
85099136 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
85109137 else return PyObject_IsTrue(x);
85119138 }
9139 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
9140 #if PY_MAJOR_VERSION >= 3
9141 if (PyLong_Check(result)) {
9142 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
9143 "__int__ returned non-int (type %.200s). "
9144 "The ability to return an instance of a strict subclass of int "
9145 "is deprecated, and may be removed in a future version of Python.",
9146 Py_TYPE(result)->tp_name)) {
9147 Py_DECREF(result);
9148 return NULL;
9149 }
9150 return result;
9151 }
9152 #endif
9153 PyErr_Format(PyExc_TypeError,
9154 "__%.4s__ returned non-%.4s (type %.200s)",
9155 type_name, type_name, Py_TYPE(result)->tp_name);
9156 Py_DECREF(result);
9157 return NULL;
9158 }
85129159 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
85139160 #if CYTHON_USE_TYPE_SLOTS
85149161 PyNumberMethods *m;
85169163 const char *name = NULL;
85179164 PyObject *res = NULL;
85189165 #if PY_MAJOR_VERSION < 3
8519 if (PyInt_Check(x) || PyLong_Check(x))
9166 if (likely(PyInt_Check(x) || PyLong_Check(x)))
85209167 #else
8521 if (PyLong_Check(x))
9168 if (likely(PyLong_Check(x)))
85229169 #endif
85239170 return __Pyx_NewRef(x);
85249171 #if CYTHON_USE_TYPE_SLOTS
85269173 #if PY_MAJOR_VERSION < 3
85279174 if (m && m->nb_int) {
85289175 name = "int";
8529 res = PyNumber_Int(x);
9176 res = m->nb_int(x);
85309177 }
85319178 else if (m && m->nb_long) {
85329179 name = "long";
8533 res = PyNumber_Long(x);
9180 res = m->nb_long(x);
85349181 }
85359182 #else
8536 if (m && m->nb_int) {
9183 if (likely(m && m->nb_int)) {
85379184 name = "int";
8538 res = PyNumber_Long(x);
9185 res = m->nb_int(x);
85399186 }
85409187 #endif
85419188 #else
8542 res = PyNumber_Int(x);
8543 #endif
8544 if (res) {
9189 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
9190 res = PyNumber_Int(x);
9191 }
9192 #endif
9193 if (likely(res)) {
85459194 #if PY_MAJOR_VERSION < 3
8546 if (!PyInt_Check(res) && !PyLong_Check(res)) {
9195 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
85479196 #else
8548 if (!PyLong_Check(res)) {
8549 #endif
8550 PyErr_Format(PyExc_TypeError,
8551 "__%.4s__ returned non-%.4s (type %.200s)",
8552 name, name, Py_TYPE(res)->tp_name);
8553 Py_DECREF(res);
8554 return NULL;
9197 if (unlikely(!PyLong_CheckExact(res))) {
9198 #endif
9199 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
85559200 }
85569201 }
85579202 else if (!PyErr_Occurred()) {
86229267 Py_DECREF(x);
86239268 return ival;
86249269 }
9270 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
9271 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
9272 }
86259273 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
86269274 return PyInt_FromSize_t(ival);
86279275 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
8 #else
9 #define CYTHON_ABI "0_25_2"
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
8 #else
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
105123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
108132 #define CYTHON_USE_ASYNC_SLOTS 0
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
409549 { \
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420552
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
428560
429561 #define __PYX_HAVE__pygame_sdl2__error
430562 #define __PYX_HAVE_API__pygame_sdl2__error
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
437570 #include <omp.h>
438571 #endif /* _OPENMP */
439572
440 #ifdef PYREX_WITHOUT_ASSERTIONS
573 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
441574 #define CYTHON_WITHOUT_ASSERTIONS
442575 #endif
443576
468601 #define __Pyx_sst_abs(value) abs(value)
469602 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
470603 #define __Pyx_sst_abs(value) labs(value)
471 #elif defined (_MSC_VER) && defined (_M_X64)
472 #define __Pyx_sst_abs(value) _abs64(value)
604 #elif defined (_MSC_VER)
605 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
473606 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
474607 #define __Pyx_sst_abs(value) llabs(value)
475608 #elif defined (__GNUC__)
477610 #else
478611 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
479612 #endif
480 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
481 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
613 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
614 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
482615 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
483616 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
484617 #define __Pyx_PyBytes_FromString PyBytes_FromString
491624 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
492625 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
493626 #endif
494 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
495 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
627 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
628 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
629 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
634 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
635 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
496638 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
497639 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
498640 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
499641 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
500642 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
501 #if PY_MAJOR_VERSION < 3
502 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
503 {
643 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
504644 const Py_UNICODE *u_end = u;
505645 while (*u_end++) ;
506646 return (size_t)(u_end - u - 1);
507647 }
508 #else
509 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
510 #endif
511648 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
512649 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
513650 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
514651 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
515652 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
516 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
653 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
517654 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
518655 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
656 #define __Pyx_PySequence_Tuple(obj)\
657 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
519658 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
520659 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
521660 #if CYTHON_ASSUME_SAFE_MACROS
614753 #define likely(x) (x)
615754 #define unlikely(x) (x)
616755 #endif /* __GNUC__ */
617
618 static PyObject *__pyx_m;
756 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
757
758 static PyObject *__pyx_m = NULL;
619759 static PyObject *__pyx_d;
620760 static PyObject *__pyx_b;
761 static PyObject *__pyx_cython_runtime = NULL;
621762 static PyObject *__pyx_empty_tuple;
622763 static PyObject *__pyx_empty_bytes;
623764 static PyObject *__pyx_empty_unicode;
699840
700841 /* PyObjectGetAttrStr.proto */
701842 #if CYTHON_USE_TYPE_SLOTS
702 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
703 PyTypeObject* tp = Py_TYPE(obj);
704 if (likely(tp->tp_getattro))
705 return tp->tp_getattro(obj, attr_name);
706 #if PY_MAJOR_VERSION < 3
707 if (likely(tp->tp_getattr))
708 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
709 #endif
710 return PyObject_GetAttr(obj, attr_name);
711 }
843 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
712844 #else
713845 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
714846 #endif
728860 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
729861 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
730862
731 /* PyObjectCall.proto */
732 #if CYTHON_COMPILING_IN_CPYTHON
733 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
734 #else
735 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
863 /* PyCFunctionFastCall.proto */
864 #if CYTHON_FAST_PYCCALL
865 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
866 #else
867 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
736868 #endif
737869
738870 /* PyFunctionFastCall.proto */
746878 #endif
747879 #endif
748880
749 /* PyCFunctionFastCall.proto */
750 #if CYTHON_FAST_PYCCALL
751 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
752 #else
753 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
754 #endif
881 /* PyObjectCall.proto */
882 #if CYTHON_COMPILING_IN_CPYTHON
883 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
884 #else
885 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
886 #endif
887
888 /* PyObjectCallMethO.proto */
889 #if CYTHON_COMPILING_IN_CPYTHON
890 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
891 #endif
892
893 /* PyObjectCallOneArg.proto */
894 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
755895
756896 /* CalculateMetaclass.proto */
757897 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
761901
762902 /* CythonFunction.proto */
763903 #define __Pyx_CyFunction_USED 1
764 #include <structmember.h>
765904 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
766905 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
767906 #define __Pyx_CYFUNCTION_CCLASS 0x04
813952 PyObject *dict);
814953 static int __pyx_CyFunction_init(void);
815954
955 /* SetNameInClass.proto */
956 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
957 #define __Pyx_SetNameInClass(ns, name, value)\
958 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
959 #elif CYTHON_COMPILING_IN_CPYTHON
960 #define __Pyx_SetNameInClass(ns, name, value)\
961 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
962 #else
963 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
964 #endif
965
816966 /* Py3ClassCreate.proto */
817967 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
818968 PyObject *mkw, PyObject *modname, PyObject *doc);
819969 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
820970 PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
971
972 /* PyThreadStateGet.proto */
973 #if CYTHON_FAST_THREAD_STATE
974 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
975 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
976 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
977 #else
978 #define __Pyx_PyThreadState_declare
979 #define __Pyx_PyThreadState_assign
980 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
981 #endif
982
983 /* PyErrFetchRestore.proto */
984 #if CYTHON_FAST_THREAD_STATE
985 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
986 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
987 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
988 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
989 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
990 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
991 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
992 #if CYTHON_COMPILING_IN_CPYTHON
993 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
994 #else
995 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
996 #endif
997 #else
998 #define __Pyx_PyErr_Clear() PyErr_Clear()
999 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1000 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1001 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1002 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1003 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1004 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1005 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1006 #endif
1007
1008 /* CLineInTraceback.proto */
1009 #ifdef CYTHON_CLINE_IN_TRACEBACK
1010 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1011 #else
1012 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1013 #endif
8211014
8221015 /* CodeObjectCache.proto */
8231016 typedef struct {
8471040 /* CIntFromPy.proto */
8481041 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
8491042
1043 /* FastTypeChecks.proto */
1044 #if CYTHON_COMPILING_IN_CPYTHON
1045 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1046 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1047 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1048 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1049 #else
1050 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1051 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1052 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1053 #endif
1054 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1055
8501056 /* CheckBinaryVersion.proto */
8511057 static int __Pyx_check_binary_version(void);
8521058
8661072
8671073 /* Module declarations from 'pygame_sdl2.error' */
8681074 #define __Pyx_MODULE_NAME "pygame_sdl2.error"
1075 extern int __pyx_module_is_main_pygame_sdl2__error;
8691076 int __pyx_module_is_main_pygame_sdl2__error = 0;
8701077
8711078 /* Implementation of 'pygame_sdl2.error' */
8871094 static const char __pyx_k_RuntimeError[] = "RuntimeError";
8881095 static const char __pyx_k_error___init[] = "error.__init__";
8891096 static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error";
1097 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
8901098 static const char __pyx_k_src_pygame_sdl2_error_pyx[] = "src/pygame_sdl2/error.pyx";
8911099 static PyObject *__pyx_kp_u_;
8921100 static PyObject *__pyx_n_s_RuntimeError;
1101 static PyObject *__pyx_n_s_cline_in_traceback;
8931102 static PyObject *__pyx_n_s_doc;
8941103 static PyObject *__pyx_n_s_error;
8951104 static PyObject *__pyx_n_s_error___init;
9101119 static PyObject *__pyx_pf_11pygame_sdl2_5error_get_error(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
9111120 static PyObject *__pyx_pf_11pygame_sdl2_5error_2set_error(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_message); /* proto */
9121121 static PyObject *__pyx_tuple__2;
913 static PyObject *__pyx_tuple__4;
1122 static PyObject *__pyx_tuple__3;
9141123 static PyObject *__pyx_tuple__5;
915 static PyObject *__pyx_tuple__7;
916 static PyObject *__pyx_codeobj__3;
917 static PyObject *__pyx_codeobj__6;
918 static PyObject *__pyx_codeobj__8;
1124 static PyObject *__pyx_tuple__6;
1125 static PyObject *__pyx_tuple__8;
1126 static PyObject *__pyx_codeobj__4;
1127 static PyObject *__pyx_codeobj__7;
1128 static PyObject *__pyx_codeobj__9;
1129 /* Late includes */
9191130
9201131 /* "pygame_sdl2/error.pyx":23
9211132 * class error(RuntimeError):
9431154 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9441155 switch (pos_args) {
9451156 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1157 CYTHON_FALLTHROUGH;
9461158 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1159 CYTHON_FALLTHROUGH;
9471160 case 0: break;
9481161 default: goto __pyx_L5_argtuple_error;
9491162 }
9501163 kw_args = PyDict_Size(__pyx_kwds);
9511164 switch (pos_args) {
9521165 case 0:
953 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
1166 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
9541167 else goto __pyx_L5_argtuple_error;
1168 CYTHON_FALLTHROUGH;
9551169 case 1:
9561170 if (kw_args > 0) {
957 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_message);
1171 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message);
9581172 if (value) { values[1] = value; kw_args--; }
9591173 }
9601174 }
9641178 } else {
9651179 switch (PyTuple_GET_SIZE(__pyx_args)) {
9661180 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1181 CYTHON_FALLTHROUGH;
9671182 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9681183 break;
9691184 default: goto __pyx_L5_argtuple_error;
10201235 */
10211236 __pyx_t_3 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
10221237 __Pyx_GOTREF(__pyx_t_3);
1023 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error)
1238 __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error)
10241239 __Pyx_GOTREF(__pyx_t_4);
1025 __Pyx_GIVEREF(__pyx_t_3);
1026 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
1027 __pyx_t_3 = 0;
1028 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
1029 __Pyx_GOTREF(__pyx_t_3);
1030 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1031 __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_3);
1032 __pyx_t_3 = 0;
1240 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1241 __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_4);
1242 __pyx_t_4 = 0;
10331243
10341244 /* "pygame_sdl2/error.pyx":24
10351245 *
10471257 *
10481258 * def get_error():
10491259 */
1050 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_RuntimeError, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error)
1051 __Pyx_GOTREF(__pyx_t_4);
1260 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_RuntimeError, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error)
1261 __Pyx_GOTREF(__pyx_t_3);
10521262 __pyx_t_5 = NULL;
10531263 __pyx_t_6 = 0;
1054 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
1055 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
1264 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
1265 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
10561266 if (likely(__pyx_t_5)) {
1057 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
1267 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
10581268 __Pyx_INCREF(__pyx_t_5);
10591269 __Pyx_INCREF(function);
1060 __Pyx_DECREF_SET(__pyx_t_4, function);
1270 __Pyx_DECREF_SET(__pyx_t_3, function);
10611271 __pyx_t_6 = 1;
10621272 }
10631273 }
10641274 #if CYTHON_FAST_PYCALL
1065 if (PyFunction_Check(__pyx_t_4)) {
1275 if (PyFunction_Check(__pyx_t_3)) {
10661276 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self, __pyx_v_message};
1067 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error)
1277 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error)
10681278 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
1069 __Pyx_GOTREF(__pyx_t_3);
1279 __Pyx_GOTREF(__pyx_t_4);
10701280 } else
10711281 #endif
10721282 #if CYTHON_FAST_PYCCALL
1073 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
1283 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
10741284 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self, __pyx_v_message};
1075 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error)
1285 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error)
10761286 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
1077 __Pyx_GOTREF(__pyx_t_3);
1287 __Pyx_GOTREF(__pyx_t_4);
10781288 } else
10791289 #endif
10801290 {
10891299 __Pyx_INCREF(__pyx_v_message);
10901300 __Pyx_GIVEREF(__pyx_v_message);
10911301 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_message);
1092 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error)
1093 __Pyx_GOTREF(__pyx_t_3);
1302 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error)
1303 __Pyx_GOTREF(__pyx_t_4);
10941304 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10951305 }
1306 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10961307 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1097 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10981308
10991309 /* "pygame_sdl2/error.pyx":23
11001310 * class error(RuntimeError):
11811391 __Pyx_XDECREF(__pyx_r);
11821392 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_message); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
11831393 __Pyx_GOTREF(__pyx_t_2);
1184 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)
1394 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)
11851395 __Pyx_GOTREF(__pyx_t_3);
1186 __Pyx_GIVEREF(__pyx_t_2);
1187 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
1188 __pyx_t_2 = 0;
1189 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
1190 __Pyx_GOTREF(__pyx_t_2);
1191 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1192 __pyx_r = __pyx_t_2;
1193 __pyx_t_2 = 0;
1396 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1397 __pyx_r = __pyx_t_3;
1398 __pyx_t_3 = 0;
11941399 goto __pyx_L0;
11951400
11961401 /* "pygame_sdl2/error.pyx":32
12621467 PyObject *__pyx_r = NULL;
12631468 __Pyx_RefNannyDeclarations
12641469 PyObject *__pyx_t_1 = NULL;
1265 PyObject *__pyx_t_2 = NULL;
1266 char *__pyx_t_3;
1470 char *__pyx_t_2;
12671471 __Pyx_RefNannySetupContext("set_error", 0);
12681472 __Pyx_INCREF(__pyx_v_message);
12691473
12731477 * message = bytes(message) # <<<<<<<<<<<<<<
12741478 * SDL_SetError("%s", <char *> message)
12751479 */
1276 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
1480 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_v_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
12771481 __Pyx_GOTREF(__pyx_t_1);
1278 __Pyx_INCREF(__pyx_v_message);
1279 __Pyx_GIVEREF(__pyx_v_message);
1280 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_message);
1281 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error)
1282 __Pyx_GOTREF(__pyx_t_2);
1283 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1284 __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_2);
1285 __pyx_t_2 = 0;
1482 __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_1);
1483 __pyx_t_1 = 0;
12861484
12871485 /* "pygame_sdl2/error.pyx":39
12881486 * def set_error(message):
12891487 * message = bytes(message)
12901488 * SDL_SetError("%s", <char *> message) # <<<<<<<<<<<<<<
12911489 */
1292 __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_message); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error)
1293 SDL_SetError(((char const *)"%s"), ((char *)__pyx_t_3));
1490 __pyx_t_2 = __Pyx_PyObject_AsWritableString(__pyx_v_message); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error)
1491 (void)(SDL_SetError(((char const *)"%s"), ((char *)__pyx_t_2)));
12941492
12951493 /* "pygame_sdl2/error.pyx":37
12961494 * return ''
13051503 goto __pyx_L0;
13061504 __pyx_L1_error:;
13071505 __Pyx_XDECREF(__pyx_t_1);
1308 __Pyx_XDECREF(__pyx_t_2);
13091506 __Pyx_AddTraceback("pygame_sdl2.error.set_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
13101507 __pyx_r = NULL;
13111508 __pyx_L0:;
13201517 };
13211518
13221519 #if PY_MAJOR_VERSION >= 3
1520 #if CYTHON_PEP489_MULTI_PHASE_INIT
1521 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
1522 static int __pyx_pymod_exec_error(PyObject* module); /*proto*/
1523 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
1524 {Py_mod_create, (void*)__pyx_pymod_create},
1525 {Py_mod_exec, (void*)__pyx_pymod_exec_error},
1526 {0, NULL}
1527 };
1528 #endif
1529
13231530 static struct PyModuleDef __pyx_moduledef = {
1324 #if PY_VERSION_HEX < 0x03020000
1325 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
1326 #else
13271531 PyModuleDef_HEAD_INIT,
1328 #endif
13291532 "error",
13301533 0, /* m_doc */
1534 #if CYTHON_PEP489_MULTI_PHASE_INIT
1535 0, /* m_size */
1536 #else
13311537 -1, /* m_size */
1538 #endif
13321539 __pyx_methods /* m_methods */,
1540 #if CYTHON_PEP489_MULTI_PHASE_INIT
1541 __pyx_moduledef_slots, /* m_slots */
1542 #else
13331543 NULL, /* m_reload */
1544 #endif
13341545 NULL, /* m_traverse */
13351546 NULL, /* m_clear */
13361547 NULL /* m_free */
13401551 static __Pyx_StringTabEntry __pyx_string_tab[] = {
13411552 {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
13421553 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
1554 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
13431555 {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
13441556 {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
13451557 {&__pyx_n_s_error___init, __pyx_k_error___init, sizeof(__pyx_k_error___init), 0, 0, 1, 1},
13691581 __Pyx_RefNannyDeclarations
13701582 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
13711583
1584 /* "pygame_sdl2/error.pyx":21
1585 * from sdl2 cimport *
1586 *
1587 * class error(RuntimeError): # <<<<<<<<<<<<<<
1588 *
1589 * def __init__(self, message=None):
1590 */
1591 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_builtin_RuntimeError); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 21, __pyx_L1_error)
1592 __Pyx_GOTREF(__pyx_tuple__2);
1593 __Pyx_GIVEREF(__pyx_tuple__2);
1594
13721595 /* "pygame_sdl2/error.pyx":23
13731596 * class error(RuntimeError):
13741597 *
13761599 * if message is None:
13771600 * message = str(SDL_GetError())
13781601 */
1379 __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 23, __pyx_L1_error)
1380 __Pyx_GOTREF(__pyx_tuple__2);
1381 __Pyx_GIVEREF(__pyx_tuple__2);
1382 __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_error_pyx, __pyx_n_s_init, 23, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 23, __pyx_L1_error)
1383 __pyx_tuple__4 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 23, __pyx_L1_error)
1384 __Pyx_GOTREF(__pyx_tuple__4);
1385 __Pyx_GIVEREF(__pyx_tuple__4);
1602 __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 23, __pyx_L1_error)
1603 __Pyx_GOTREF(__pyx_tuple__3);
1604 __Pyx_GIVEREF(__pyx_tuple__3);
1605 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_error_pyx, __pyx_n_s_init, 23, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 23, __pyx_L1_error)
1606 __pyx_tuple__5 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 23, __pyx_L1_error)
1607 __Pyx_GOTREF(__pyx_tuple__5);
1608 __Pyx_GIVEREF(__pyx_tuple__5);
13861609
13871610 /* "pygame_sdl2/error.pyx":29
13881611 * RuntimeError.__init__(self, message)
13911614 * cdef const char *message = SDL_GetError()
13921615 *
13931616 */
1394 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_message); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 29, __pyx_L1_error)
1395 __Pyx_GOTREF(__pyx_tuple__5);
1396 __Pyx_GIVEREF(__pyx_tuple__5);
1397 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_error_pyx, __pyx_n_s_get_error, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 29, __pyx_L1_error)
1617 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_message); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 29, __pyx_L1_error)
1618 __Pyx_GOTREF(__pyx_tuple__6);
1619 __Pyx_GIVEREF(__pyx_tuple__6);
1620 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_error_pyx, __pyx_n_s_get_error, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 29, __pyx_L1_error)
13981621
13991622 /* "pygame_sdl2/error.pyx":37
14001623 * return ''
14031626 * message = bytes(message)
14041627 * SDL_SetError("%s", <char *> message)
14051628 */
1406 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_message); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 37, __pyx_L1_error)
1407 __Pyx_GOTREF(__pyx_tuple__7);
1408 __Pyx_GIVEREF(__pyx_tuple__7);
1409 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_error_pyx, __pyx_n_s_set_error, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 37, __pyx_L1_error)
1629 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_message); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 37, __pyx_L1_error)
1630 __Pyx_GOTREF(__pyx_tuple__8);
1631 __Pyx_GIVEREF(__pyx_tuple__8);
1632 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_error_pyx, __pyx_n_s_set_error, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 37, __pyx_L1_error)
14101633 __Pyx_RefNannyFinishContext();
14111634 return 0;
14121635 __pyx_L1_error:;
14211644 return -1;
14221645 }
14231646
1647 static int __Pyx_modinit_global_init_code(void); /*proto*/
1648 static int __Pyx_modinit_variable_export_code(void); /*proto*/
1649 static int __Pyx_modinit_function_export_code(void); /*proto*/
1650 static int __Pyx_modinit_type_init_code(void); /*proto*/
1651 static int __Pyx_modinit_type_import_code(void); /*proto*/
1652 static int __Pyx_modinit_variable_import_code(void); /*proto*/
1653 static int __Pyx_modinit_function_import_code(void); /*proto*/
1654
1655 static int __Pyx_modinit_global_init_code(void) {
1656 __Pyx_RefNannyDeclarations
1657 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
1658 /*--- Global init code ---*/
1659 __Pyx_RefNannyFinishContext();
1660 return 0;
1661 }
1662
1663 static int __Pyx_modinit_variable_export_code(void) {
1664 __Pyx_RefNannyDeclarations
1665 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
1666 /*--- Variable export code ---*/
1667 __Pyx_RefNannyFinishContext();
1668 return 0;
1669 }
1670
1671 static int __Pyx_modinit_function_export_code(void) {
1672 __Pyx_RefNannyDeclarations
1673 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
1674 /*--- Function export code ---*/
1675 __Pyx_RefNannyFinishContext();
1676 return 0;
1677 }
1678
1679 static int __Pyx_modinit_type_init_code(void) {
1680 __Pyx_RefNannyDeclarations
1681 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
1682 /*--- Type init code ---*/
1683 __Pyx_RefNannyFinishContext();
1684 return 0;
1685 }
1686
1687 static int __Pyx_modinit_type_import_code(void) {
1688 __Pyx_RefNannyDeclarations
1689 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
1690 /*--- Type import code ---*/
1691 __Pyx_RefNannyFinishContext();
1692 return 0;
1693 }
1694
1695 static int __Pyx_modinit_variable_import_code(void) {
1696 __Pyx_RefNannyDeclarations
1697 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
1698 /*--- Variable import code ---*/
1699 __Pyx_RefNannyFinishContext();
1700 return 0;
1701 }
1702
1703 static int __Pyx_modinit_function_import_code(void) {
1704 __Pyx_RefNannyDeclarations
1705 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
1706 /*--- Function import code ---*/
1707 __Pyx_RefNannyFinishContext();
1708 return 0;
1709 }
1710
1711
14241712 #if PY_MAJOR_VERSION < 3
1425 PyMODINIT_FUNC initerror(void); /*proto*/
1426 PyMODINIT_FUNC initerror(void)
1427 #else
1428 PyMODINIT_FUNC PyInit_error(void); /*proto*/
1429 PyMODINIT_FUNC PyInit_error(void)
1713 #ifdef CYTHON_NO_PYINIT_EXPORT
1714 #define __Pyx_PyMODINIT_FUNC void
1715 #else
1716 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
1717 #endif
1718 #else
1719 #ifdef CYTHON_NO_PYINIT_EXPORT
1720 #define __Pyx_PyMODINIT_FUNC PyObject *
1721 #else
1722 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
1723 #endif
1724 #endif
1725 #ifndef CYTHON_SMALL_CODE
1726 #if defined(__clang__)
1727 #define CYTHON_SMALL_CODE
1728 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
1729 #define CYTHON_SMALL_CODE __attribute__((cold))
1730 #else
1731 #define CYTHON_SMALL_CODE
1732 #endif
1733 #endif
1734
1735
1736 #if PY_MAJOR_VERSION < 3
1737 __Pyx_PyMODINIT_FUNC initerror(void) CYTHON_SMALL_CODE; /*proto*/
1738 __Pyx_PyMODINIT_FUNC initerror(void)
1739 #else
1740 __Pyx_PyMODINIT_FUNC PyInit_error(void) CYTHON_SMALL_CODE; /*proto*/
1741 __Pyx_PyMODINIT_FUNC PyInit_error(void)
1742 #if CYTHON_PEP489_MULTI_PHASE_INIT
1743 {
1744 return PyModuleDef_Init(&__pyx_moduledef);
1745 }
1746 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
1747 PyObject *value = PyObject_GetAttrString(spec, from_name);
1748 int result = 0;
1749 if (likely(value)) {
1750 result = PyDict_SetItemString(moddict, to_name, value);
1751 Py_DECREF(value);
1752 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
1753 PyErr_Clear();
1754 } else {
1755 result = -1;
1756 }
1757 return result;
1758 }
1759 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
1760 PyObject *module = NULL, *moddict, *modname;
1761 if (__pyx_m)
1762 return __Pyx_NewRef(__pyx_m);
1763 modname = PyObject_GetAttrString(spec, "name");
1764 if (unlikely(!modname)) goto bad;
1765 module = PyModule_NewObject(modname);
1766 Py_DECREF(modname);
1767 if (unlikely(!module)) goto bad;
1768 moddict = PyModule_GetDict(module);
1769 if (unlikely(!moddict)) goto bad;
1770 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
1771 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
1772 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
1773 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
1774 return module;
1775 bad:
1776 Py_XDECREF(module);
1777 return NULL;
1778 }
1779
1780
1781 static int __pyx_pymod_exec_error(PyObject *__pyx_pyinit_module)
1782 #endif
14301783 #endif
14311784 {
14321785 PyObject *__pyx_t_1 = NULL;
14331786 PyObject *__pyx_t_2 = NULL;
14341787 PyObject *__pyx_t_3 = NULL;
1435 PyObject *__pyx_t_4 = NULL;
14361788 __Pyx_RefNannyDeclarations
1789 #if CYTHON_PEP489_MULTI_PHASE_INIT
1790 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
1791 #elif PY_MAJOR_VERSION >= 3
1792 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
1793 #endif
14371794 #if CYTHON_REFNANNY
1438 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
1439 if (!__Pyx_RefNanny) {
1440 PyErr_Clear();
1441 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
1442 if (!__Pyx_RefNanny)
1443 Py_FatalError("failed to import 'refnanny' module");
1444 }
1445 #endif
1446 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_error(void)", 0);
1795 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
1796 if (!__Pyx_RefNanny) {
1797 PyErr_Clear();
1798 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
1799 if (!__Pyx_RefNanny)
1800 Py_FatalError("failed to import 'refnanny' module");
1801 }
1802 #endif
1803 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_error(void)", 0);
14471804 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
14481805 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
14491806 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
14601817 #ifdef __Pyx_Generator_USED
14611818 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
14621819 #endif
1820 #ifdef __Pyx_AsyncGen_USED
1821 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1822 #endif
14631823 #ifdef __Pyx_StopAsyncIteration_USED
14641824 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
14651825 #endif
14711831 #endif
14721832 #endif
14731833 /*--- Module creation code ---*/
1834 #if CYTHON_PEP489_MULTI_PHASE_INIT
1835 __pyx_m = __pyx_pyinit_module;
1836 Py_INCREF(__pyx_m);
1837 #else
14741838 #if PY_MAJOR_VERSION < 3
14751839 __pyx_m = Py_InitModule4("error", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
14761840 #else
14771841 __pyx_m = PyModule_Create(&__pyx_moduledef);
14781842 #endif
14791843 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
1844 #endif
14801845 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
14811846 Py_INCREF(__pyx_d);
14821847 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
1848 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
14831849 #if CYTHON_COMPILING_IN_PYPY
14841850 Py_INCREF(__pyx_b);
14851851 #endif
15041870 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15051871 /*--- Constants init code ---*/
15061872 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1507 /*--- Global init code ---*/
1508 /*--- Variable export code ---*/
1509 /*--- Function export code ---*/
1510 /*--- Type init code ---*/
1511 /*--- Type import code ---*/
1512 /*--- Variable import code ---*/
1513 /*--- Function import code ---*/
1873 /*--- Global type/function init code ---*/
1874 (void)__Pyx_modinit_global_init_code();
1875 (void)__Pyx_modinit_variable_export_code();
1876 (void)__Pyx_modinit_function_export_code();
1877 (void)__Pyx_modinit_type_init_code();
1878 (void)__Pyx_modinit_type_import_code();
1879 (void)__Pyx_modinit_variable_import_code();
1880 (void)__Pyx_modinit_function_import_code();
15141881 /*--- Execution code ---*/
15151882 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
15161883 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15231890 *
15241891 * def __init__(self, message=None):
15251892 */
1526 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
1893 __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
15271894 __Pyx_GOTREF(__pyx_t_1);
1528 __Pyx_INCREF(__pyx_builtin_RuntimeError);
1529 __Pyx_GIVEREF(__pyx_builtin_RuntimeError);
1530 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_RuntimeError);
1531 __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
1895 __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__2, __pyx_n_s_error, __pyx_n_s_error, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_error, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
15321896 __Pyx_GOTREF(__pyx_t_2);
1533 __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_error, __pyx_n_s_error, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_error, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error)
1534 __Pyx_GOTREF(__pyx_t_3);
15351897
15361898 /* "pygame_sdl2/error.pyx":23
15371899 * class error(RuntimeError):
15401902 * if message is None:
15411903 * message = str(SDL_GetError())
15421904 */
1543 __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5error_5error_1__init__, 0, __pyx_n_s_error___init, NULL, __pyx_n_s_pygame_sdl2_error, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 23, __pyx_L1_error)
1544 __Pyx_GOTREF(__pyx_t_4);
1545 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__4);
1546 if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
1547 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1905 __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5error_5error_1__init__, 0, __pyx_n_s_error___init, NULL, __pyx_n_s_pygame_sdl2_error, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error)
1906 __Pyx_GOTREF(__pyx_t_3);
1907 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__5);
1908 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
1909 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15481910
15491911 /* "pygame_sdl2/error.pyx":21
15501912 * from sdl2 cimport *
15531915 *
15541916 * def __init__(self, message=None):
15551917 */
1556 __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_error, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 21, __pyx_L1_error)
1557 __Pyx_GOTREF(__pyx_t_4);
1558 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_4) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
1559 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1918 __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_error, __pyx_tuple__2, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error)
1919 __Pyx_GOTREF(__pyx_t_3);
1920 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_3) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
15601921 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15611922 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15621923 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15901951 * #
15911952 * # This software is provided 'as-is', without any express or implied
15921953 */
1593 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
1954 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
15941955 __Pyx_GOTREF(__pyx_t_1);
15951956 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15961957 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16021963 __Pyx_XDECREF(__pyx_t_1);
16031964 __Pyx_XDECREF(__pyx_t_2);
16041965 __Pyx_XDECREF(__pyx_t_3);
1605 __Pyx_XDECREF(__pyx_t_4);
16061966 if (__pyx_m) {
16071967 if (__pyx_d) {
1608 __Pyx_AddTraceback("init pygame_sdl2.error", __pyx_clineno, __pyx_lineno, __pyx_filename);
1968 __Pyx_AddTraceback("init pygame_sdl2.error", 0, __pyx_lineno, __pyx_filename);
16091969 }
16101970 Py_DECREF(__pyx_m); __pyx_m = 0;
16111971 } else if (!PyErr_Occurred()) {
16131973 }
16141974 __pyx_L0:;
16151975 __Pyx_RefNannyFinishContext();
1616 #if PY_MAJOR_VERSION < 3
1976 #if CYTHON_PEP489_MULTI_PHASE_INIT
1977 return (__pyx_m != NULL) ? 0 : -1;
1978 #elif PY_MAJOR_VERSION >= 3
1979 return __pyx_m;
1980 #else
16171981 return;
1618 #else
1619 return __pyx_m;
16201982 #endif
16211983 }
16221984
16351997 Py_XDECREF(p);
16361998 Py_XDECREF(m);
16371999 return (__Pyx_RefNannyAPIStruct *)r;
2000 }
2001 #endif
2002
2003 /* PyObjectGetAttrStr */
2004 #if CYTHON_USE_TYPE_SLOTS
2005 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
2006 PyTypeObject* tp = Py_TYPE(obj);
2007 if (likely(tp->tp_getattro))
2008 return tp->tp_getattro(obj, attr_name);
2009 #if PY_MAJOR_VERSION < 3
2010 if (likely(tp->tp_getattr))
2011 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
2012 #endif
2013 return PyObject_GetAttr(obj, attr_name);
16382014 }
16392015 #endif
16402016
17942170 (num_expected == 1) ? "" : "s", num_found);
17952171 }
17962172
2173 /* PyCFunctionFastCall */
2174 #if CYTHON_FAST_PYCCALL
2175 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
2176 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
2177 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
2178 PyObject *self = PyCFunction_GET_SELF(func);
2179 int flags = PyCFunction_GET_FLAGS(func);
2180 assert(PyCFunction_Check(func));
2181 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
2182 assert(nargs >= 0);
2183 assert(nargs == 0 || args != NULL);
2184 /* _PyCFunction_FastCallDict() must not be called with an exception set,
2185 because it may clear it (directly or indirectly) and so the
2186 caller loses its exception */
2187 assert(!PyErr_Occurred());
2188 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
2189 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
2190 } else {
2191 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
2192 }
2193 }
2194 #endif
2195
2196 /* PyFunctionFastCall */
2197 #if CYTHON_FAST_PYCALL
2198 #include "frameobject.h"
2199 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
2200 PyObject *globals) {
2201 PyFrameObject *f;
2202 PyThreadState *tstate = __Pyx_PyThreadState_Current;
2203 PyObject **fastlocals;
2204 Py_ssize_t i;
2205 PyObject *result;
2206 assert(globals != NULL);
2207 /* XXX Perhaps we should create a specialized
2208 PyFrame_New() that doesn't take locals, but does
2209 take builtins without sanity checking them.
2210 */
2211 assert(tstate != NULL);
2212 f = PyFrame_New(tstate, co, globals, NULL);
2213 if (f == NULL) {
2214 return NULL;
2215 }
2216 fastlocals = f->f_localsplus;
2217 for (i = 0; i < na; i++) {
2218 Py_INCREF(*args);
2219 fastlocals[i] = *args++;
2220 }
2221 result = PyEval_EvalFrameEx(f,0);
2222 ++tstate->recursion_depth;
2223 Py_DECREF(f);
2224 --tstate->recursion_depth;
2225 return result;
2226 }
2227 #if 1 || PY_VERSION_HEX < 0x030600B1
2228 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
2229 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
2230 PyObject *globals = PyFunction_GET_GLOBALS(func);
2231 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
2232 PyObject *closure;
2233 #if PY_MAJOR_VERSION >= 3
2234 PyObject *kwdefs;
2235 #endif
2236 PyObject *kwtuple, **k;
2237 PyObject **d;
2238 Py_ssize_t nd;
2239 Py_ssize_t nk;
2240 PyObject *result;
2241 assert(kwargs == NULL || PyDict_Check(kwargs));
2242 nk = kwargs ? PyDict_Size(kwargs) : 0;
2243 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
2244 return NULL;
2245 }
2246 if (
2247 #if PY_MAJOR_VERSION >= 3
2248 co->co_kwonlyargcount == 0 &&
2249 #endif
2250 likely(kwargs == NULL || nk == 0) &&
2251 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
2252 if (argdefs == NULL && co->co_argcount == nargs) {
2253 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
2254 goto done;
2255 }
2256 else if (nargs == 0 && argdefs != NULL
2257 && co->co_argcount == Py_SIZE(argdefs)) {
2258 /* function called with no arguments, but all parameters have
2259 a default value: use default values as arguments .*/
2260 args = &PyTuple_GET_ITEM(argdefs, 0);
2261 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
2262 goto done;
2263 }
2264 }
2265 if (kwargs != NULL) {
2266 Py_ssize_t pos, i;
2267 kwtuple = PyTuple_New(2 * nk);
2268 if (kwtuple == NULL) {
2269 result = NULL;
2270 goto done;
2271 }
2272 k = &PyTuple_GET_ITEM(kwtuple, 0);
2273 pos = i = 0;
2274 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
2275 Py_INCREF(k[i]);
2276 Py_INCREF(k[i+1]);
2277 i += 2;
2278 }
2279 nk = i / 2;
2280 }
2281 else {
2282 kwtuple = NULL;
2283 k = NULL;
2284 }
2285 closure = PyFunction_GET_CLOSURE(func);
2286 #if PY_MAJOR_VERSION >= 3
2287 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
2288 #endif
2289 if (argdefs != NULL) {
2290 d = &PyTuple_GET_ITEM(argdefs, 0);
2291 nd = Py_SIZE(argdefs);
2292 }
2293 else {
2294 d = NULL;
2295 nd = 0;
2296 }
2297 #if PY_MAJOR_VERSION >= 3
2298 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
2299 args, nargs,
2300 k, (int)nk,
2301 d, (int)nd, kwdefs, closure);
2302 #else
2303 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
2304 args, nargs,
2305 k, (int)nk,
2306 d, (int)nd, closure);
2307 #endif
2308 Py_XDECREF(kwtuple);
2309 done:
2310 Py_LeaveRecursiveCall();
2311 return result;
2312 }
2313 #endif
2314 #endif
2315
17972316 /* PyObjectCall */
17982317 #if CYTHON_COMPILING_IN_CPYTHON
17992318 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
18142333 }
18152334 #endif
18162335
1817 /* PyFunctionFastCall */
2336 /* PyObjectCallMethO */
2337 #if CYTHON_COMPILING_IN_CPYTHON
2338 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
2339 PyObject *self, *result;
2340 PyCFunction cfunc;
2341 cfunc = PyCFunction_GET_FUNCTION(func);
2342 self = PyCFunction_GET_SELF(func);
2343 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
2344 return NULL;
2345 result = cfunc(self, arg);
2346 Py_LeaveRecursiveCall();
2347 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
2348 PyErr_SetString(
2349 PyExc_SystemError,
2350 "NULL result without error in PyObject_Call");
2351 }
2352 return result;
2353 }
2354 #endif
2355
2356 /* PyObjectCallOneArg */
2357 #if CYTHON_COMPILING_IN_CPYTHON
2358 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
2359 PyObject *result;
2360 PyObject *args = PyTuple_New(1);
2361 if (unlikely(!args)) return NULL;
2362 Py_INCREF(arg);
2363 PyTuple_SET_ITEM(args, 0, arg);
2364 result = __Pyx_PyObject_Call(func, args, NULL);
2365 Py_DECREF(args);
2366 return result;
2367 }
2368 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
18182369 #if CYTHON_FAST_PYCALL
1819 #include "frameobject.h"
1820 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
1821 PyObject *globals) {
1822 PyFrameObject *f;
1823 PyThreadState *tstate = PyThreadState_GET();
1824 PyObject **fastlocals;
1825 Py_ssize_t i;
2370 if (PyFunction_Check(func)) {
2371 return __Pyx_PyFunction_FastCall(func, &arg, 1);
2372 }
2373 #endif
2374 if (likely(PyCFunction_Check(func))) {
2375 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
2376 return __Pyx_PyObject_CallMethO(func, arg);
2377 #if CYTHON_FAST_PYCCALL
2378 } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
2379 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
2380 #endif
2381 }
2382 }
2383 return __Pyx__PyObject_CallOneArg(func, arg);
2384 }
2385 #else
2386 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
18262387 PyObject *result;
1827 assert(globals != NULL);
1828 /* XXX Perhaps we should create a specialized
1829 PyFrame_New() that doesn't take locals, but does
1830 take builtins without sanity checking them.
1831 */
1832 assert(tstate != NULL);
1833 f = PyFrame_New(tstate, co, globals, NULL);
1834 if (f == NULL) {
1835 return NULL;
1836 }
1837 fastlocals = f->f_localsplus;
1838 for (i = 0; i < na; i++) {
1839 Py_INCREF(*args);
1840 fastlocals[i] = *args++;
1841 }
1842 result = PyEval_EvalFrameEx(f,0);
1843 ++tstate->recursion_depth;
1844 Py_DECREF(f);
1845 --tstate->recursion_depth;
2388 PyObject *args = PyTuple_Pack(1, arg);
2389 if (unlikely(!args)) return NULL;
2390 result = __Pyx_PyObject_Call(func, args, NULL);
2391 Py_DECREF(args);
18462392 return result;
18472393 }
1848 #if 1 || PY_VERSION_HEX < 0x030600B1
1849 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
1850 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
1851 PyObject *globals = PyFunction_GET_GLOBALS(func);
1852 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
1853 PyObject *closure;
1854 #if PY_MAJOR_VERSION >= 3
1855 PyObject *kwdefs;
1856 #endif
1857 PyObject *kwtuple, **k;
1858 PyObject **d;
1859 Py_ssize_t nd;
1860 Py_ssize_t nk;
1861 PyObject *result;
1862 assert(kwargs == NULL || PyDict_Check(kwargs));
1863 nk = kwargs ? PyDict_Size(kwargs) : 0;
1864 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
1865 return NULL;
1866 }
1867 if (
1868 #if PY_MAJOR_VERSION >= 3
1869 co->co_kwonlyargcount == 0 &&
1870 #endif
1871 likely(kwargs == NULL || nk == 0) &&
1872 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
1873 if (argdefs == NULL && co->co_argcount == nargs) {
1874 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
1875 goto done;
1876 }
1877 else if (nargs == 0 && argdefs != NULL
1878 && co->co_argcount == Py_SIZE(argdefs)) {
1879 /* function called with no arguments, but all parameters have
1880 a default value: use default values as arguments .*/
1881 args = &PyTuple_GET_ITEM(argdefs, 0);
1882 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
1883 goto done;
1884 }
1885 }
1886 if (kwargs != NULL) {
1887 Py_ssize_t pos, i;
1888 kwtuple = PyTuple_New(2 * nk);
1889 if (kwtuple == NULL) {
1890 result = NULL;
1891 goto done;
1892 }
1893 k = &PyTuple_GET_ITEM(kwtuple, 0);
1894 pos = i = 0;
1895 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
1896 Py_INCREF(k[i]);
1897 Py_INCREF(k[i+1]);
1898 i += 2;
1899 }
1900 nk = i / 2;
1901 }
1902 else {
1903 kwtuple = NULL;
1904 k = NULL;
1905 }
1906 closure = PyFunction_GET_CLOSURE(func);
1907 #if PY_MAJOR_VERSION >= 3
1908 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
1909 #endif
1910 if (argdefs != NULL) {
1911 d = &PyTuple_GET_ITEM(argdefs, 0);
1912 nd = Py_SIZE(argdefs);
1913 }
1914 else {
1915 d = NULL;
1916 nd = 0;
1917 }
1918 #if PY_MAJOR_VERSION >= 3
1919 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
1920 args, nargs,
1921 k, (int)nk,
1922 d, (int)nd, kwdefs, closure);
1923 #else
1924 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
1925 args, nargs,
1926 k, (int)nk,
1927 d, (int)nd, closure);
1928 #endif
1929 Py_XDECREF(kwtuple);
1930 done:
1931 Py_LeaveRecursiveCall();
1932 return result;
1933 }
1934 #endif // CPython < 3.6
1935 #endif // CYTHON_FAST_PYCALL
1936
1937 /* PyCFunctionFastCall */
1938 #if CYTHON_FAST_PYCCALL
1939 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
1940 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
1941 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
1942 PyObject *self = PyCFunction_GET_SELF(func);
1943 assert(PyCFunction_Check(func));
1944 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
1945 assert(nargs >= 0);
1946 assert(nargs == 0 || args != NULL);
1947 /* _PyCFunction_FastCallDict() must not be called with an exception set,
1948 because it may clear it (directly or indirectly) and so the
1949 caller loses its exception */
1950 assert(!PyErr_Occurred());
1951 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
1952 }
1953 #endif // CYTHON_FAST_PYCCALL
2394 #endif
19542395
19552396 /* CalculateMetaclass */
19562397 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
20312472 }
20322473
20332474 /* CythonFunction */
2475 #include <structmember.h>
20342476 static PyObject *
20352477 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
20362478 {
23132755 {0, 0, 0, 0, 0}
23142756 };
23152757 static PyMemberDef __pyx_CyFunction_members[] = {
2316 {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
2758 {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
23172759 {0, 0, 0, 0, 0}
23182760 };
23192761 static PyObject *
23912833 }
23922834 return 0;
23932835 }
2394 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
2836 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
23952837 {
2396 PyObject_GC_UnTrack(m);
23972838 if (__Pyx_CyFunction_weakreflist(m) != NULL)
23982839 PyObject_ClearWeakRefs((PyObject *) m);
23992840 __Pyx_CyFunction_clear(m);
24002841 PyObject_GC_Del(m);
2842 }
2843 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
2844 {
2845 PyObject_GC_UnTrack(m);
2846 __Pyx__CyFunction_dealloc(m);
24012847 }
24022848 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
24032849 {
24732919 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
24742920 size = PyTuple_GET_SIZE(arg);
24752921 if (likely(size == 1)) {
2476 PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
2477 if (unlikely(!arg0)) return NULL;
2922 PyObject *result, *arg0;
2923 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2924 arg0 = PyTuple_GET_ITEM(arg, 0);
2925 #else
2926 arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
2927 #endif
24782928 result = (*meth)(self, arg0);
2929 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
24792930 Py_DECREF(arg0);
2931 #endif
24802932 return result;
24812933 }
24822934 PyErr_Format(PyExc_TypeError,
25833035 };
25843036 static int __pyx_CyFunction_init(void) {
25853037 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
2586 if (__pyx_CyFunctionType == NULL) {
3038 if (unlikely(__pyx_CyFunctionType == NULL)) {
25873039 return -1;
25883040 }
25893041 return 0;
25913043 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
25923044 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
25933045 m->defaults = PyObject_Malloc(size);
2594 if (!m->defaults)
3046 if (unlikely(!m->defaults))
25953047 return PyErr_NoMemory();
25963048 memset(m->defaults, 0, size);
25973049 m->defaults_pyobjects = pyobjects;
26793131 Py_XDECREF(owned_metaclass);
26803132 return result;
26813133 }
3134
3135 /* PyErrFetchRestore */
3136 #if CYTHON_FAST_THREAD_STATE
3137 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
3138 PyObject *tmp_type, *tmp_value, *tmp_tb;
3139 tmp_type = tstate->curexc_type;
3140 tmp_value = tstate->curexc_value;
3141 tmp_tb = tstate->curexc_traceback;
3142 tstate->curexc_type = type;
3143 tstate->curexc_value = value;
3144 tstate->curexc_traceback = tb;
3145 Py_XDECREF(tmp_type);
3146 Py_XDECREF(tmp_value);
3147 Py_XDECREF(tmp_tb);
3148 }
3149 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
3150 *type = tstate->curexc_type;
3151 *value = tstate->curexc_value;
3152 *tb = tstate->curexc_traceback;
3153 tstate->curexc_type = 0;
3154 tstate->curexc_value = 0;
3155 tstate->curexc_traceback = 0;
3156 }
3157 #endif
3158
3159 /* CLineInTraceback */
3160 #ifndef CYTHON_CLINE_IN_TRACEBACK
3161 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
3162 PyObject *use_cline;
3163 PyObject *ptype, *pvalue, *ptraceback;
3164 #if CYTHON_COMPILING_IN_CPYTHON
3165 PyObject **cython_runtime_dict;
3166 #endif
3167 if (unlikely(!__pyx_cython_runtime)) {
3168 return c_line;
3169 }
3170 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
3171 #if CYTHON_COMPILING_IN_CPYTHON
3172 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
3173 if (likely(cython_runtime_dict)) {
3174 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
3175 } else
3176 #endif
3177 {
3178 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
3179 if (use_cline_obj) {
3180 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
3181 Py_DECREF(use_cline_obj);
3182 } else {
3183 PyErr_Clear();
3184 use_cline = NULL;
3185 }
3186 }
3187 if (!use_cline) {
3188 c_line = 0;
3189 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
3190 }
3191 else if (PyObject_Not(use_cline) != 0) {
3192 c_line = 0;
3193 }
3194 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
3195 return c_line;
3196 }
3197 #endif
26823198
26833199 /* CodeObjectCache */
26843200 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
28203336 int py_line, const char *filename) {
28213337 PyCodeObject *py_code = 0;
28223338 PyFrameObject *py_frame = 0;
2823 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
3339 PyThreadState *tstate = __Pyx_PyThreadState_Current;
3340 if (c_line) {
3341 c_line = __Pyx_CLineForTraceback(tstate, c_line);
3342 }
3343 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
28243344 if (!py_code) {
28253345 py_code = __Pyx_CreateCodeObjectForTraceback(
28263346 funcname, c_line, py_line, filename);
28273347 if (!py_code) goto bad;
2828 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
3348 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
28293349 }
28303350 py_frame = PyFrame_New(
2831 PyThreadState_GET(), /*PyThreadState *tstate,*/
2832 py_code, /*PyCodeObject *code,*/
2833 __pyx_d, /*PyObject *globals,*/
2834 0 /*PyObject *locals*/
3351 tstate, /*PyThreadState *tstate,*/
3352 py_code, /*PyCodeObject *code,*/
3353 __pyx_d, /*PyObject *globals,*/
3354 0 /*PyObject *locals*/
28353355 );
28363356 if (!py_frame) goto bad;
28373357 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
32723792 return (int) -1;
32733793 }
32743794
3795 /* FastTypeChecks */
3796 #if CYTHON_COMPILING_IN_CPYTHON
3797 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
3798 while (a) {
3799 a = a->tp_base;
3800 if (a == b)
3801 return 1;
3802 }
3803 return b == &PyBaseObject_Type;
3804 }
3805 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
3806 PyObject *mro;
3807 if (a == b) return 1;
3808 mro = a->tp_mro;
3809 if (likely(mro)) {
3810 Py_ssize_t i, n;
3811 n = PyTuple_GET_SIZE(mro);
3812 for (i = 0; i < n; i++) {
3813 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
3814 return 1;
3815 }
3816 return 0;
3817 }
3818 return __Pyx_InBases(a, b);
3819 }
3820 #if PY_MAJOR_VERSION == 2
3821 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
3822 PyObject *exception, *value, *tb;
3823 int res;
3824 __Pyx_PyThreadState_declare
3825 __Pyx_PyThreadState_assign
3826 __Pyx_ErrFetch(&exception, &value, &tb);
3827 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
3828 if (unlikely(res == -1)) {
3829 PyErr_WriteUnraisable(err);
3830 res = 0;
3831 }
3832 if (!res) {
3833 res = PyObject_IsSubclass(err, exc_type2);
3834 if (unlikely(res == -1)) {
3835 PyErr_WriteUnraisable(err);
3836 res = 0;
3837 }
3838 }
3839 __Pyx_ErrRestore(exception, value, tb);
3840 return res;
3841 }
3842 #else
3843 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
3844 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
3845 if (!res) {
3846 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
3847 }
3848 return res;
3849 }
3850 #endif
3851 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
3852 Py_ssize_t i, n;
3853 assert(PyExceptionClass_Check(exc_type));
3854 n = PyTuple_GET_SIZE(tuple);
3855 #if PY_MAJOR_VERSION >= 3
3856 for (i=0; i<n; i++) {
3857 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
3858 }
3859 #endif
3860 for (i=0; i<n; i++) {
3861 PyObject *t = PyTuple_GET_ITEM(tuple, i);
3862 #if PY_MAJOR_VERSION < 3
3863 if (likely(exc_type == t)) return 1;
3864 #endif
3865 if (likely(PyExceptionClass_Check(t))) {
3866 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
3867 } else {
3868 }
3869 }
3870 return 0;
3871 }
3872 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
3873 if (likely(err == exc_type)) return 1;
3874 if (likely(PyExceptionClass_Check(err))) {
3875 if (likely(PyExceptionClass_Check(exc_type))) {
3876 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
3877 } else if (likely(PyTuple_Check(exc_type))) {
3878 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
3879 } else {
3880 }
3881 }
3882 return PyErr_GivenExceptionMatches(err, exc_type);
3883 }
3884 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
3885 assert(PyExceptionClass_Check(exc_type1));
3886 assert(PyExceptionClass_Check(exc_type2));
3887 if (likely(err == exc_type1 || err == exc_type2)) return 1;
3888 if (likely(PyExceptionClass_Check(err))) {
3889 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
3890 }
3891 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
3892 }
3893 #endif
3894
32753895 /* CheckBinaryVersion */
32763896 static int __Pyx_check_binary_version(void) {
32773897 char ctversion[4], rtversion[4];
33143934 #endif
33153935 if (!*t->p)
33163936 return -1;
3937 if (PyObject_Hash(*t->p) == -1)
3938 return -1;
33173939 ++t;
33183940 }
33193941 return 0;
33223944 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
33233945 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
33243946 }
3325 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
3947 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
33263948 Py_ssize_t ignore;
33273949 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
33283950 }
3329 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
3330 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
3951 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
3952 #if !CYTHON_PEP393_ENABLED
3953 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
3954 char* defenc_c;
3955 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
3956 if (!defenc) return NULL;
3957 defenc_c = PyBytes_AS_STRING(defenc);
3958 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
3959 {
3960 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
3961 char* c;
3962 for (c = defenc_c; c < end; c++) {
3963 if ((unsigned char) (*c) >= 128) {
3964 PyUnicode_AsASCIIString(o);
3965 return NULL;
3966 }
3967 }
3968 }
3969 #endif
3970 *length = PyBytes_GET_SIZE(defenc);
3971 return defenc_c;
3972 }
3973 #else
3974 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
3975 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
3976 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
3977 if (likely(PyUnicode_IS_ASCII(o))) {
3978 *length = PyUnicode_GET_LENGTH(o);
3979 return PyUnicode_AsUTF8(o);
3980 } else {
3981 PyUnicode_AsASCIIString(o);
3982 return NULL;
3983 }
3984 #else
3985 return PyUnicode_AsUTF8AndSize(o, length);
3986 #endif
3987 }
3988 #endif
3989 #endif
3990 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
3991 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
33313992 if (
33323993 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
33333994 __Pyx_sys_getdefaultencoding_not_ascii &&
33343995 #endif
33353996 PyUnicode_Check(o)) {
3336 #if PY_VERSION_HEX < 0x03030000
3337 char* defenc_c;
3338 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
3339 if (!defenc) return NULL;
3340 defenc_c = PyBytes_AS_STRING(defenc);
3341 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
3342 {
3343 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
3344 char* c;
3345 for (c = defenc_c; c < end; c++) {
3346 if ((unsigned char) (*c) >= 128) {
3347 PyUnicode_AsASCIIString(o);
3348 return NULL;
3349 }
3350 }
3351 }
3352 #endif
3353 *length = PyBytes_GET_SIZE(defenc);
3354 return defenc_c;
3355 #else
3356 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
3357 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
3358 if (PyUnicode_IS_ASCII(o)) {
3359 *length = PyUnicode_GET_LENGTH(o);
3360 return PyUnicode_AsUTF8(o);
3361 } else {
3362 PyUnicode_AsASCIIString(o);
3363 return NULL;
3364 }
3365 #else
3366 return PyUnicode_AsUTF8AndSize(o, length);
3367 #endif
3368 #endif
3997 return __Pyx_PyUnicode_AsStringAndSize(o, length);
33693998 } else
33703999 #endif
33714000 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
33894018 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
33904019 else return PyObject_IsTrue(x);
33914020 }
4021 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
4022 #if PY_MAJOR_VERSION >= 3
4023 if (PyLong_Check(result)) {
4024 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
4025 "__int__ returned non-int (type %.200s). "
4026 "The ability to return an instance of a strict subclass of int "
4027 "is deprecated, and may be removed in a future version of Python.",
4028 Py_TYPE(result)->tp_name)) {
4029 Py_DECREF(result);
4030 return NULL;
4031 }
4032 return result;
4033 }
4034 #endif
4035 PyErr_Format(PyExc_TypeError,
4036 "__%.4s__ returned non-%.4s (type %.200s)",
4037 type_name, type_name, Py_TYPE(result)->tp_name);
4038 Py_DECREF(result);
4039 return NULL;
4040 }
33924041 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
33934042 #if CYTHON_USE_TYPE_SLOTS
33944043 PyNumberMethods *m;
33964045 const char *name = NULL;
33974046 PyObject *res = NULL;
33984047 #if PY_MAJOR_VERSION < 3
3399 if (PyInt_Check(x) || PyLong_Check(x))
3400 #else
3401 if (PyLong_Check(x))
4048 if (likely(PyInt_Check(x) || PyLong_Check(x)))
4049 #else
4050 if (likely(PyLong_Check(x)))
34024051 #endif
34034052 return __Pyx_NewRef(x);
34044053 #if CYTHON_USE_TYPE_SLOTS
34064055 #if PY_MAJOR_VERSION < 3
34074056 if (m && m->nb_int) {
34084057 name = "int";
3409 res = PyNumber_Int(x);
4058 res = m->nb_int(x);
34104059 }
34114060 else if (m && m->nb_long) {
34124061 name = "long";
3413 res = PyNumber_Long(x);
4062 res = m->nb_long(x);
34144063 }
34154064 #else
3416 if (m && m->nb_int) {
4065 if (likely(m && m->nb_int)) {
34174066 name = "int";
3418 res = PyNumber_Long(x);
4067 res = m->nb_int(x);
34194068 }
34204069 #endif
34214070 #else
3422 res = PyNumber_Int(x);
3423 #endif
3424 if (res) {
4071 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
4072 res = PyNumber_Int(x);
4073 }
4074 #endif
4075 if (likely(res)) {
34254076 #if PY_MAJOR_VERSION < 3
3426 if (!PyInt_Check(res) && !PyLong_Check(res)) {
3427 #else
3428 if (!PyLong_Check(res)) {
3429 #endif
3430 PyErr_Format(PyExc_TypeError,
3431 "__%.4s__ returned non-%.4s (type %.200s)",
3432 name, name, Py_TYPE(res)->tp_name);
3433 Py_DECREF(res);
3434 return NULL;
4077 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
4078 #else
4079 if (unlikely(!PyLong_CheckExact(res))) {
4080 #endif
4081 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
34354082 }
34364083 }
34374084 else if (!PyErr_Occurred()) {
35024149 Py_DECREF(x);
35034150 return ival;
35044151 }
4152 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
4153 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
4154 }
35054155 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
35064156 return PyInt_FromSize_t(ival);
35074157 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
88 #else
9 #define CYTHON_ABI "0_25_2"
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
102120 #define CYTHON_COMPILING_IN_CPYTHON 1
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
105129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412552
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
423555 #define __PYX_EXTERN_C extern "C"
428560
429561 #define __PYX_HAVE__pygame_sdl2__event
430562 #define __PYX_HAVE_API__pygame_sdl2__event
563 /* Early includes */
431564 #include <string.h>
432565 #include <stdio.h>
433566 #include <stdint.h>
437570 #include <omp.h>
438571 #endif /* _OPENMP */
439572
440 #ifdef PYREX_WITHOUT_ASSERTIONS
573 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
441574 #define CYTHON_WITHOUT_ASSERTIONS
442575 #endif
443576
468601 #define __Pyx_sst_abs(value) abs(value)
469602 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
470603 #define __Pyx_sst_abs(value) labs(value)
471 #elif defined (_MSC_VER) && defined (_M_X64)
472 #define __Pyx_sst_abs(value) _abs64(value)
604 #elif defined (_MSC_VER)
605 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
473606 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
474607 #define __Pyx_sst_abs(value) llabs(value)
475608 #elif defined (__GNUC__)
477610 #else
478611 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
479612 #endif
480 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
481 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
613 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
614 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
482615 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
483616 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
484617 #define __Pyx_PyBytes_FromString PyBytes_FromString
491624 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
492625 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
493626 #endif
494 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
495 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
627 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
628 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
629 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
634 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
635 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
496638 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
497639 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
498640 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
499641 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
500642 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
501 #if PY_MAJOR_VERSION < 3
502 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
503 {
643 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
504644 const Py_UNICODE *u_end = u;
505645 while (*u_end++) ;
506646 return (size_t)(u_end - u - 1);
507647 }
508 #else
509 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
510 #endif
511648 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
512649 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
513650 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
514651 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
515652 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
516 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
653 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
517654 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
518655 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
656 #define __Pyx_PySequence_Tuple(obj)\
657 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
519658 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
520659 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
521660 #if CYTHON_ASSUME_SAFE_MACROS
614753 #define likely(x) (x)
615754 #define unlikely(x) (x)
616755 #endif /* __GNUC__ */
617
618 static PyObject *__pyx_m;
756 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
757
758 static PyObject *__pyx_m = NULL;
619759 static PyObject *__pyx_d;
620760 static PyObject *__pyx_b;
761 static PyObject *__pyx_cython_runtime = NULL;
621762 static PyObject *__pyx_empty_tuple;
622763 static PyObject *__pyx_empty_bytes;
623764 static PyObject *__pyx_empty_unicode;
634775 "src/pygame_sdl2/display.pxd",
635776 "include/event_names.pxi",
636777 };
778 /* NoFastGil.proto */
779 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
780 #define __Pyx_PyGILState_Release PyGILState_Release
781 #define __Pyx_FastGIL_Remember()
782 #define __Pyx_FastGIL_Forget()
783 #define __Pyx_FastGilFuncInit()
784
785 /* ForceInitThreads.proto */
786 #ifndef __PYX_FORCE_INIT_THREADS
787 #define __PYX_FORCE_INIT_THREADS 0
788 #endif
789
637790
638791 /*--- Type declarations ---*/
639792 struct __pyx_obj_11pygame_sdl2_7surface_Surface;
761914
762915 /* PyObjectGetAttrStr.proto */
763916 #if CYTHON_USE_TYPE_SLOTS
764 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
765 PyTypeObject* tp = Py_TYPE(obj);
766 if (likely(tp->tp_getattro))
767 return tp->tp_getattro(obj, attr_name);
768 #if PY_MAJOR_VERSION < 3
769 if (likely(tp->tp_getattr))
770 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
771 #endif
772 return PyObject_GetAttr(obj, attr_name);
773 }
917 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
774918 #else
775919 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
776920 #endif
792936
793937 /* PyObjectSetAttrStr.proto */
794938 #if CYTHON_USE_TYPE_SLOTS
795 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
796 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
797 PyTypeObject* tp = Py_TYPE(obj);
798 if (likely(tp->tp_setattro))
799 return tp->tp_setattro(obj, attr_name, value);
800 #if PY_MAJOR_VERSION < 3
801 if (likely(tp->tp_setattr))
802 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
803 #endif
804 return PyObject_SetAttr(obj, attr_name, value);
805 }
939 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
940 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
806941 #else
807942 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
808943 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
844979 /* GetModuleGlobalName.proto */
845980 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
846981
982 /* GetItemInt.proto */
983 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
984 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
985 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
986 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
987 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
988 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
989 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
990 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
991 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
992 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
993 int wraparound, int boundscheck);
994 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
995 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
996 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
997 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
998 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
999 int wraparound, int boundscheck);
1000 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1001 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1002 int is_list, int wraparound, int boundscheck);
1003
1004 /* ObjectGetItem.proto */
1005 #if CYTHON_USE_TYPE_SLOTS
1006 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1007 #else
1008 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1009 #endif
1010
8471011 /* PyThreadStateGet.proto */
8481012 #if CYTHON_FAST_THREAD_STATE
8491013 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
850 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
1014 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1015 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
8511016 #else
8521017 #define __Pyx_PyThreadState_declare
8531018 #define __Pyx_PyThreadState_assign
1019 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
8541020 #endif
8551021
8561022 /* SaveResetException.proto */
8871053 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
8881054 #endif
8891055
1056 /* PyObjectFormat.proto */
1057 #if CYTHON_USE_UNICODE_WRITER
1058 static PyObject* __Pyx_PyObject_Format(PyObject* s, PyObject* f);
1059 #else
1060 #define __Pyx_PyObject_Format(s, f) PyObject_Format(s, f)
1061 #endif
1062
1063 /* PyObjectFormatAndDecref.proto */
1064 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
1065 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);
1066
8901067 /* IncludeStringH.proto */
8911068 #include <string.h>
1069
1070 /* JoinPyUnicode.proto */
1071 static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
1072 Py_UCS4 max_char);
1073
1074 /* decode_c_string_utf16.proto */
1075 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1076 int byteorder = 0;
1077 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1078 }
1079 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1080 int byteorder = -1;
1081 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1082 }
1083 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1084 int byteorder = 1;
1085 return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1086 }
8921087
8931088 /* decode_c_string.proto */
8941089 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
9121107
9131108 /* PyErrFetchRestore.proto */
9141109 #if CYTHON_FAST_THREAD_STATE
1110 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
9151111 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
9161112 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
9171113 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
9181114 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
9191115 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
9201116 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1117 #if CYTHON_COMPILING_IN_CPYTHON
1118 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
9211119 #else
1120 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1121 #endif
1122 #else
1123 #define __Pyx_PyErr_Clear() PyErr_Clear()
1124 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
9221125 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
9231126 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1127 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1128 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
9241129 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
9251130 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
9261131 #endif
9481153 #endif
9491154
9501155 /* PyObjectLookupSpecial.proto */
951 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
1156 #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
9521157 static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
9531158 PyObject *res;
9541159 PyTypeObject *tp = Py_TYPE(obj);
9751180
9761181 /* PyObjectCallMethod1.proto */
9771182 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
1183 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg);
9781184
9791185 /* append.proto */
9801186 static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);
10271233 static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
10281234
10291235 /* UnpackTuple2.proto */
1030 static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
1031 int is_tuple, int has_known_size, int decref_tuple);
1236 #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
1237 (likely(is_tuple || PyTuple_Check(tuple)) ?\
1238 (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
1239 __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
1240 (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
1241 __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
1242 static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
1243 PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
1244 static int __Pyx_unpack_tuple2_generic(
1245 PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);
10321246
10331247 /* dict_iter.proto */
10341248 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
10621276 __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
10631277 (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
10641278 __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
1065 static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
1279 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
10661280 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
10671281 int is_list, int wraparound, int boundscheck);
10681282
10781292 /* Import.proto */
10791293 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
10801294
1081 /* GetItemInt.proto */
1082 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1083 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1084 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1085 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1086 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1087 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1088 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1089 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1090 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1091 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1092 int wraparound, int boundscheck);
1093 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1094 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1095 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1096 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1097 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1098 int wraparound, int boundscheck);
1099 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1100 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1101 int is_list, int wraparound, int boundscheck);
1102
11031295 /* CalculateMetaclass.proto */
11041296 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
11051297
11081300
11091301 /* CythonFunction.proto */
11101302 #define __Pyx_CyFunction_USED 1
1111 #include <structmember.h>
11121303 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
11131304 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
11141305 #define __Pyx_CYFUNCTION_CCLASS 0x04
11601351 PyObject *dict);
11611352 static int __pyx_CyFunction_init(void);
11621353
1354 /* SetNameInClass.proto */
1355 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
1356 #define __Pyx_SetNameInClass(ns, name, value)\
1357 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
1358 #elif CYTHON_COMPILING_IN_CPYTHON
1359 #define __Pyx_SetNameInClass(ns, name, value)\
1360 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
1361 #else
1362 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
1363 #endif
1364
11631365 /* Py3ClassCreate.proto */
11641366 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
11651367 PyObject *mkw, PyObject *modname, PyObject *doc);
11661368 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
11671369 PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
1370
1371 /* CLineInTraceback.proto */
1372 #ifdef CYTHON_CLINE_IN_TRACEBACK
1373 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1374 #else
1375 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1376 #endif
11681377
11691378 /* CodeObjectCache.proto */
11701379 typedef struct {
12151424 /* CIntToPy.proto */
12161425 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value);
12171426
1218 /* ForceInitThreads.proto */
1219 #ifndef __PYX_FORCE_INIT_THREADS
1220 #define __PYX_FORCE_INIT_THREADS 0
1221 #endif
1222
12231427 /* CIntToPy.proto */
12241428 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value);
12251429
12341438
12351439 /* CIntFromPy.proto */
12361440 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1441
1442 /* FastTypeChecks.proto */
1443 #if CYTHON_COMPILING_IN_CPYTHON
1444 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1445 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1446 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1447 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1448 #else
1449 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1450 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1451 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1452 #endif
1453 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
12371454
12381455 /* CheckBinaryVersion.proto */
12391456 static int __Pyx_check_binary_version(void);
13101527 static PyObject *__pyx_f_11pygame_sdl2_5event_get_events(PyObject *); /*proto*/
13111528 static int __pyx_f_11pygame_sdl2_5event_poll_sdl(void); /*proto*/
13121529 #define __Pyx_MODULE_NAME "pygame_sdl2.event"
1530 extern int __pyx_module_is_main_pygame_sdl2__event;
13131531 int __pyx_module_is_main_pygame_sdl2__event = 0;
13141532
13151533 /* Implementation of 'pygame_sdl2.event' */
13171535 static PyObject *__pyx_builtin_object;
13181536 static PyObject *__pyx_builtin_property;
13191537 static PyObject *__pyx_builtin_KeyError;
1320 static const char __pyx_k_[] = "";
1538 static const char __pyx_k_[] = "-";
13211539 static const char __pyx_k_d[] = "d";
13221540 static const char __pyx_k_e[] = "e";
13231541 static const char __pyx_k_h[] = "h";
1542 static const char __pyx_k_i[] = "i";
13241543 static const char __pyx_k_t[] = "t";
13251544 static const char __pyx_k_w[] = "w";
13261545 static const char __pyx_k_x[] = "x";
13271546 static const char __pyx_k_y[] = "y";
1547 static const char __pyx_k__2[] = " ";
1548 static const char __pyx_k__3[] = ")>";
1549 static const char __pyx_k__4[] = "";
13281550 static const char __pyx_k_dx[] = "dx";
13291551 static const char __pyx_k_dy[] = "dy";
13301552 static const char __pyx_k_eq[] = "__eq__";
13691591 static const char __pyx_k_text[] = "text";
13701592 static const char __pyx_k_type[] = "type";
13711593 static const char __pyx_k_wait[] = "wait";
1372 static const char __pyx_k_Event[] = "Event";
1594 static const char __pyx_k_Event[] = "<Event(";
13731595 static const char __pyx_k_KEYUP[] = "KEYUP";
13741596 static const char __pyx_k_RLock[] = "RLock";
13751597 static const char __pyx_k_clear[] = "clear";
14011623 static const char __pyx_k_type_2[] = "_type";
14021624 static const char __pyx_k_unichr[] = "unichr";
14031625 static const char __pyx_k_update[] = "update";
1626 static const char __pyx_k_Event_2[] = "Event";
14041627 static const char __pyx_k_KEYDOWN[] = "KEYDOWN";
14051628 static const char __pyx_k_NOEVENT[] = "NOEVENT";
14061629 static const char __pyx_k_UNKNOWN[] = "UNKNOWN";
14351658 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
14361659 static const char __pyx_k_text_input[] = "text_input";
14371660 static const char __pyx_k_ACTIVEEVENT[] = "ACTIVEEVENT";
1438 static const char __pyx_k_Event_d_s_s[] = "<Event(%d-%s %s)>";
14391661 static const char __pyx_k_JOYBUTTONUP[] = "JOYBUTTONUP";
14401662 static const char __pyx_k_MOUSEMOTION[] = "MOUSEMOTION";
14411663 static const char __pyx_k_TEXTEDITING[] = "TEXTEDITING";
14761698 static const char __pyx_k_copy_event_queue[] = "copy_event_queue";
14771699 static const char __pyx_k_pygame_sdl2_event[] = "pygame_sdl2.event";
14781700 static const char __pyx_k_CONTROLLERBUTTONUP[] = "CONTROLLERBUTTONUP";
1701 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
14791702 static const char __pyx_k_EventType___nonzero[] = "EventType.__nonzero__";
14801703 static const char __pyx_k_get_standard_events[] = "get_standard_events";
14811704 static const char __pyx_k_CONTROLLERAXISMOTION[] = "CONTROLLERAXISMOTION";
15111734 static PyObject *__pyx_n_u_DOLLARGESTURE;
15121735 static PyObject *__pyx_n_u_DOLLARRECORD;
15131736 static PyObject *__pyx_n_u_DROPFILE;
1514 static PyObject *__pyx_n_s_Event;
1737 static PyObject *__pyx_kp_u_Event;
15151738 static PyObject *__pyx_n_s_EventType;
15161739 static PyObject *__pyx_n_s_EventType___eq;
15171740 static PyObject *__pyx_n_s_EventType___init;
15201743 static PyObject *__pyx_n_s_EventType___repr;
15211744 static PyObject *__pyx_n_s_EventType_dict;
15221745 static PyObject *__pyx_n_s_EventType_type;
1523 static PyObject *__pyx_kp_u_Event_d_s_s;
1746 static PyObject *__pyx_n_s_Event_2;
15241747 static PyObject *__pyx_n_u_FINGERDOWN;
15251748 static PyObject *__pyx_n_u_FINGERMOTION;
15261749 static PyObject *__pyx_n_u_FINGERUP;
15571780 static PyObject *__pyx_n_s_VIDEORESIZE;
15581781 static PyObject *__pyx_n_u_VIDEORESIZE;
15591782 static PyObject *__pyx_n_u_WINDOWEVENT;
1783 static PyObject *__pyx_kp_u__2;
1784 static PyObject *__pyx_kp_u__3;
1785 static PyObject *__pyx_kp_u__4;
15601786 static PyObject *__pyx_n_s_append;
15611787 static PyObject *__pyx_n_s_axis;
15621788 static PyObject *__pyx_n_s_ball;
15641790 static PyObject *__pyx_n_s_buttons;
15651791 static PyObject *__pyx_n_s_chr;
15661792 static PyObject *__pyx_n_s_clear;
1793 static PyObject *__pyx_n_s_cline_in_traceback;
15671794 static PyObject *__pyx_n_s_code;
15681795 static PyObject *__pyx_n_s_copy;
15691796 static PyObject *__pyx_n_s_copy_event_queue;
15701797 static PyObject *__pyx_n_s_d;
1798 static PyObject *__pyx_n_u_d;
15711799 static PyObject *__pyx_n_s_dDist;
15721800 static PyObject *__pyx_n_s_dTheta;
15731801 static PyObject *__pyx_n_s_data1;
16001828 static PyObject *__pyx_n_s_get_standard_events;
16011829 static PyObject *__pyx_n_s_h;
16021830 static PyObject *__pyx_n_s_hat;
1831 static PyObject *__pyx_n_s_i;
16031832 static PyObject *__pyx_n_s_import;
16041833 static PyObject *__pyx_n_s_init;
16051834 static PyObject *__pyx_n_s_init_2;
17041933 static PyObject *__pyx_int_2;
17051934 static PyObject *__pyx_int_3;
17061935 static PyObject *__pyx_int_4;
1707 static PyObject *__pyx_tuple__2;
1708 static PyObject *__pyx_tuple__3;
1709 static PyObject *__pyx_tuple__4;
17101936 static PyObject *__pyx_tuple__5;
17111937 static PyObject *__pyx_tuple__6;
17121938 static PyObject *__pyx_tuple__7;
17131939 static PyObject *__pyx_tuple__8;
17141940 static PyObject *__pyx_tuple__9;
1715 static PyObject *__pyx_slice__13;
1941 static PyObject *__pyx_slice__16;
17161942 static PyObject *__pyx_tuple__10;
17171943 static PyObject *__pyx_tuple__11;
17181944 static PyObject *__pyx_tuple__12;
1945 static PyObject *__pyx_tuple__13;
17191946 static PyObject *__pyx_tuple__14;
1720 static PyObject *__pyx_tuple__16;
1947 static PyObject *__pyx_tuple__15;
17211948 static PyObject *__pyx_tuple__17;
1722 static PyObject *__pyx_tuple__19;
1949 static PyObject *__pyx_tuple__18;
1950 static PyObject *__pyx_tuple__20;
17231951 static PyObject *__pyx_tuple__21;
17241952 static PyObject *__pyx_tuple__23;
17251953 static PyObject *__pyx_tuple__25;
17261954 static PyObject *__pyx_tuple__27;
17271955 static PyObject *__pyx_tuple__29;
17281956 static PyObject *__pyx_tuple__31;
1729 static PyObject *__pyx_tuple__34;
1730 static PyObject *__pyx_tuple__36;
1957 static PyObject *__pyx_tuple__33;
1958 static PyObject *__pyx_tuple__35;
17311959 static PyObject *__pyx_tuple__38;
1732 static PyObject *__pyx_tuple__41;
1733 static PyObject *__pyx_tuple__43;
1734 static PyObject *__pyx_tuple__45;
1735 static PyObject *__pyx_tuple__47;
1736 static PyObject *__pyx_tuple__49;
1960 static PyObject *__pyx_tuple__40;
1961 static PyObject *__pyx_tuple__42;
1962 static PyObject *__pyx_tuple__44;
1963 static PyObject *__pyx_tuple__46;
1964 static PyObject *__pyx_tuple__48;
1965 static PyObject *__pyx_tuple__50;
17371966 static PyObject *__pyx_tuple__52;
1738 static PyObject *__pyx_tuple__55;
1967 static PyObject *__pyx_tuple__54;
17391968 static PyObject *__pyx_tuple__57;
1740 static PyObject *__pyx_codeobj__15;
1741 static PyObject *__pyx_codeobj__18;
1742 static PyObject *__pyx_codeobj__20;
1969 static PyObject *__pyx_tuple__60;
1970 static PyObject *__pyx_tuple__62;
1971 static PyObject *__pyx_codeobj__19;
17431972 static PyObject *__pyx_codeobj__22;
17441973 static PyObject *__pyx_codeobj__24;
17451974 static PyObject *__pyx_codeobj__26;
17461975 static PyObject *__pyx_codeobj__28;
17471976 static PyObject *__pyx_codeobj__30;
17481977 static PyObject *__pyx_codeobj__32;
1749 static PyObject *__pyx_codeobj__33;
1750 static PyObject *__pyx_codeobj__35;
1978 static PyObject *__pyx_codeobj__34;
1979 static PyObject *__pyx_codeobj__36;
17511980 static PyObject *__pyx_codeobj__37;
17521981 static PyObject *__pyx_codeobj__39;
1753 static PyObject *__pyx_codeobj__40;
1754 static PyObject *__pyx_codeobj__42;
1755 static PyObject *__pyx_codeobj__44;
1756 static PyObject *__pyx_codeobj__46;
1757 static PyObject *__pyx_codeobj__48;
1758 static PyObject *__pyx_codeobj__50;
1982 static PyObject *__pyx_codeobj__41;
1983 static PyObject *__pyx_codeobj__43;
1984 static PyObject *__pyx_codeobj__45;
1985 static PyObject *__pyx_codeobj__47;
1986 static PyObject *__pyx_codeobj__49;
17591987 static PyObject *__pyx_codeobj__51;
17601988 static PyObject *__pyx_codeobj__53;
1761 static PyObject *__pyx_codeobj__54;
1989 static PyObject *__pyx_codeobj__55;
17621990 static PyObject *__pyx_codeobj__56;
17631991 static PyObject *__pyx_codeobj__58;
17641992 static PyObject *__pyx_codeobj__59;
1765 static PyObject *__pyx_codeobj__60;
1993 static PyObject *__pyx_codeobj__61;
1994 static PyObject *__pyx_codeobj__63;
1995 static PyObject *__pyx_codeobj__64;
1996 static PyObject *__pyx_codeobj__65;
1997 /* Late includes */
17661998 PyObject *event_queue = 0;
17671999
17682000 /* "pygame_sdl2/event.pyx":57
17952027 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17962028 switch (pos_args) {
17972029 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2030 CYTHON_FALLTHROUGH;
17982031 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2032 CYTHON_FALLTHROUGH;
17992033 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2034 CYTHON_FALLTHROUGH;
18002035 case 0: break;
18012036 default: goto __pyx_L5_argtuple_error;
18022037 }
18032038 kw_args = PyDict_Size(__pyx_kwds);
18042039 switch (pos_args) {
18052040 case 0:
1806 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2041 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
18072042 else goto __pyx_L5_argtuple_error;
2043 CYTHON_FALLTHROUGH;
18082044 case 1:
1809 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
2045 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
18102046 else {
18112047 __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 57, __pyx_L3_error)
18122048 }
2049 CYTHON_FALLTHROUGH;
18132050 case 2:
18142051 if (kw_args > 0) {
1815 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dict);
2052 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dict);
18162053 if (value) { values[2] = value; kw_args--; }
18172054 }
18182055 }
18222059 } else {
18232060 switch (PyTuple_GET_SIZE(__pyx_args)) {
18242061 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2062 CYTHON_FALLTHROUGH;
18252063 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18262064 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18272065 break;
20612299 PyObject *__pyx_t_7 = NULL;
20622300 PyObject *__pyx_t_8 = NULL;
20632301 int __pyx_t_9;
2302 Py_ssize_t __pyx_t_10;
2303 Py_UCS4 __pyx_t_11;
20642304 __Pyx_RefNannySetupContext("__repr__", 0);
20652305
20662306 /* "pygame_sdl2/event.pyx":66
21472387 __Pyx_GOTREF(__pyx_t_2);
21482388 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L4_error)
21492389 __Pyx_GOTREF(__pyx_t_1);
2150 __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L4_error)
2390 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L4_error)
21512391 __Pyx_GOTREF(__pyx_t_3);
21522392 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21532393 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21652405 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21662406 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
21672407 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
2168 goto __pyx_L11_try_end;
2408 goto __pyx_L9_try_end;
21692409 __pyx_L4_error:;
2170 __Pyx_PyThreadState_assign
21712410 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
21722411 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21732412 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22122451 * ename = event_names[self.type]
22132452 * except KeyError:
22142453 */
2215 __Pyx_PyThreadState_assign
22162454 __Pyx_XGIVEREF(__pyx_t_6);
22172455 __Pyx_XGIVEREF(__pyx_t_7);
22182456 __Pyx_XGIVEREF(__pyx_t_8);
22192457 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
22202458 goto __pyx_L1_error;
22212459 __pyx_L5_exception_handled:;
2222 __Pyx_PyThreadState_assign
22232460 __Pyx_XGIVEREF(__pyx_t_6);
22242461 __Pyx_XGIVEREF(__pyx_t_7);
22252462 __Pyx_XGIVEREF(__pyx_t_8);
22262463 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
2227 __pyx_L11_try_end:;
2464 __pyx_L9_try_end:;
22282465 }
22292466 }
22302467 __pyx_L3:;
22792516 * @property
22802517 */
22812518 __Pyx_XDECREF(__pyx_r);
2282 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
2519 __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
22832520 __Pyx_GOTREF(__pyx_t_2);
2284 __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
2521 __pyx_t_10 = 0;
2522 __pyx_t_11 = 127;
2523 __Pyx_INCREF(__pyx_kp_u_Event);
2524 __pyx_t_10 += 7;
2525 __Pyx_GIVEREF(__pyx_kp_u_Event);
2526 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Event);
2527 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
22852528 __Pyx_GOTREF(__pyx_t_3);
2286 __Pyx_GIVEREF(__pyx_t_2);
2287 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
2288 __Pyx_INCREF(__pyx_v_ename);
2289 __Pyx_GIVEREF(__pyx_v_ename);
2290 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_ename);
2291 __Pyx_INCREF(__pyx_v_d);
2292 __Pyx_GIVEREF(__pyx_v_d);
2293 PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_d);
2294 __pyx_t_2 = 0;
2295 __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_Event_d_s_s, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
2296 __Pyx_GOTREF(__pyx_t_2);
2529 __pyx_t_1 = __Pyx_PyObject_Format(__pyx_t_3, __pyx_n_u_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
2530 __Pyx_GOTREF(__pyx_t_1);
22972531 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2298 __pyx_r = __pyx_t_2;
2299 __pyx_t_2 = 0;
2532 __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_11;
2533 __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
2534 __Pyx_GIVEREF(__pyx_t_1);
2535 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
2536 __pyx_t_1 = 0;
2537 __Pyx_INCREF(__pyx_kp_u_);
2538 __pyx_t_10 += 1;
2539 __Pyx_GIVEREF(__pyx_kp_u_);
2540 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_);
2541 __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_ename), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
2542 __Pyx_GOTREF(__pyx_t_1);
2543 __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_11;
2544 __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
2545 __Pyx_GIVEREF(__pyx_t_1);
2546 PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1);
2547 __pyx_t_1 = 0;
2548 __Pyx_INCREF(__pyx_kp_u__2);
2549 __pyx_t_10 += 1;
2550 __Pyx_GIVEREF(__pyx_kp_u__2);
2551 PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__2);
2552 __pyx_t_1 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_d), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
2553 __Pyx_GOTREF(__pyx_t_1);
2554 __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_11;
2555 __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
2556 __Pyx_GIVEREF(__pyx_t_1);
2557 PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_t_1);
2558 __pyx_t_1 = 0;
2559 __Pyx_INCREF(__pyx_kp_u__3);
2560 __pyx_t_10 += 2;
2561 __Pyx_GIVEREF(__pyx_kp_u__3);
2562 PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_kp_u__3);
2563 __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 7, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 76, __pyx_L1_error)
2564 __Pyx_GOTREF(__pyx_t_1);
2565 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2566 __pyx_r = __pyx_t_1;
2567 __pyx_t_1 = 0;
23002568 goto __pyx_L0;
23012569
23022570 /* "pygame_sdl2/event.pyx":65
24702738 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
24712739 switch (pos_args) {
24722740 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2741 CYTHON_FALLTHROUGH;
24732742 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2743 CYTHON_FALLTHROUGH;
24742744 case 0: break;
24752745 default: goto __pyx_L5_argtuple_error;
24762746 }
24772747 kw_args = PyDict_Size(__pyx_kwds);
24782748 switch (pos_args) {
24792749 case 0:
2480 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2750 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
24812751 else goto __pyx_L5_argtuple_error;
2752 CYTHON_FALLTHROUGH;
24822753 case 1:
2483 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
2754 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
24842755 else {
24852756 __Pyx_RaiseArgtupleInvalid("__eq__", 1, 2, 2, 1); __PYX_ERR(0, 86, __pyx_L3_error)
24862757 }
25852856 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
25862857 switch (pos_args) {
25872858 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2859 CYTHON_FALLTHROUGH;
25882860 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2861 CYTHON_FALLTHROUGH;
25892862 case 0: break;
25902863 default: goto __pyx_L5_argtuple_error;
25912864 }
25922865 kw_args = PyDict_Size(__pyx_kwds);
25932866 switch (pos_args) {
25942867 case 0:
2595 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2868 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
25962869 else goto __pyx_L5_argtuple_error;
2870 CYTHON_FALLTHROUGH;
25972871 case 1:
2598 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
2872 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
25992873 else {
26002874 __Pyx_RaiseArgtupleInvalid("__ne__", 1, 2, 2, 1); __PYX_ERR(0, 89, __pyx_L3_error)
26012875 }
28043078 * cdef make_keyboard_event(SDL_KeyboardEvent *e):
28053079 */
28063080 __Pyx_XDECREF(__pyx_r);
2807 __Pyx_INCREF(__pyx_kp_u_);
2808 __pyx_r = __pyx_kp_u_;
3081 __Pyx_INCREF(__pyx_kp_u__4);
3082 __pyx_r = __pyx_kp_u__4;
28093083 goto __pyx_L0;
28103084
28113085 /* "pygame_sdl2/event.pyx":97
28553129 * 'key' : e.keysym.sym,
28563130 * 'mod' : e.keysym.mod,
28573131 */
2858 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
3132 __pyx_t_1 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
28593133 __Pyx_GOTREF(__pyx_t_1);
28603134 __pyx_t_2 = __Pyx_PyInt_From_SDL_Scancode(__pyx_v_e->keysym.scancode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
28613135 __Pyx_GOTREF(__pyx_t_2);
28853159 __Pyx_GOTREF(__pyx_t_2);
28863160 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_mod, __pyx_t_2) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
28873161 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2888 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_unicode, __pyx_kp_u_) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
3162 if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_unicode, __pyx_kp_u__4) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
28893163
28903164 /* "pygame_sdl2/event.pyx":111
28913165 * 'mod' : e.keysym.mod,
30783352 __Pyx_GIVEREF(__pyx_t_2);
30793353 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
30803354 __pyx_t_2 = 0;
3081 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
3355 __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
30823356 __Pyx_GOTREF(__pyx_t_2);
30833357 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dict, __pyx_v_dargs) < 0) __PYX_ERR(0, 124, __pyx_L1_error)
30843358 __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->repeat); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error)
32213495 __Pyx_GIVEREF(__pyx_t_3);
32223496 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
32233497 __pyx_t_3 = 0;
3224 __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error)
3498 __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error)
32253499 __Pyx_GOTREF(__pyx_t_3);
32263500 __pyx_t_1 = __Pyx_PyInt_From_int32_t(__pyx_v_e->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
32273501 __Pyx_GOTREF(__pyx_t_1);
33823656 __Pyx_GIVEREF(__pyx_t_4);
33833657 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
33843658 __pyx_t_4 = 0;
3385 __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error)
3659 __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error)
33863660 __Pyx_GOTREF(__pyx_t_4);
33873661 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_button, __pyx_v_btn) < 0) __PYX_ERR(0, 139, __pyx_L1_error)
33883662 __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error)
34913765 __Pyx_GIVEREF(__pyx_t_3);
34923766 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
34933767 __pyx_t_3 = 0;
3494 __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
3768 __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
34953769 __Pyx_GOTREF(__pyx_t_3);
34963770 __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error)
34973771 __Pyx_GOTREF(__pyx_t_5);
36023876 __Pyx_XDECREF(__pyx_r);
36033877 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 162, __pyx_L1_error)
36043878 __Pyx_GOTREF(__pyx_t_5);
3605 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
3879 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
36063880 __Pyx_GOTREF(__pyx_t_3);
36073881 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
36083882 __pyx_r = __pyx_t_3;
36183892 *
36193893 * # MOUSEBUTTONUP event should follow immediately after
36203894 */
3621 SDL_GetMouseState((&__pyx_v_x), (&__pyx_v_y));
3895 (void)(SDL_GetMouseState((&__pyx_v_x), (&__pyx_v_y)));
36223896
36233897 /* "pygame_sdl2/event.pyx":168
36243898 *
36383912 __Pyx_GIVEREF(__pyx_t_2);
36393913 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
36403914 __pyx_t_2 = 0;
3641 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
3915 __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
36423916 __Pyx_GOTREF(__pyx_t_2);
36433917 __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_btn); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 168, __pyx_L1_error)
36443918 __Pyx_GOTREF(__pyx_t_8);
37294003 __Pyx_GIVEREF(__pyx_t_5);
37304004 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
37314005 __pyx_t_5 = 0;
3732 __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error)
4006 __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error)
37334007 __Pyx_GOTREF(__pyx_t_5);
37344008 __pyx_t_10 = __Pyx_PyInt_From_long(__pyx_v_btn); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 169, __pyx_L1_error)
37354009 __Pyx_GOTREF(__pyx_t_10);
38184092 __Pyx_GIVEREF(__pyx_t_2);
38194093 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
38204094 __pyx_t_2 = 0;
3821 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error)
4095 __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error)
38224096 __Pyx_GOTREF(__pyx_t_2);
38234097 __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
38244098 __Pyx_GOTREF(__pyx_t_4);
38934167 __Pyx_GIVEREF(__pyx_t_2);
38944168 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
38954169 __pyx_t_2 = 0;
3896 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error)
4170 __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error)
38974171 __Pyx_GOTREF(__pyx_t_2);
38984172 __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error)
38994173 __Pyx_GOTREF(__pyx_t_4);
39744248 __Pyx_GIVEREF(__pyx_t_2);
39754249 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
39764250 __pyx_t_2 = 0;
3977 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
4251 __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
39784252 __Pyx_GOTREF(__pyx_t_2);
39794253 __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error)
39804254 __Pyx_GOTREF(__pyx_t_4);
40654339 __Pyx_GIVEREF(__pyx_t_2);
40664340 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
40674341 __pyx_t_2 = 0;
4068 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
4342 __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
40694343 __Pyx_GOTREF(__pyx_t_2);
40704344 __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
40714345 __Pyx_GOTREF(__pyx_t_4);
41444418 __Pyx_GIVEREF(__pyx_t_2);
41454419 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
41464420 __pyx_t_2 = 0;
4147 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error)
4421 __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error)
41484422 __Pyx_GOTREF(__pyx_t_2);
41494423 __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->which); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
41504424 __Pyx_GOTREF(__pyx_t_4);
42204494 __Pyx_GIVEREF(__pyx_t_2);
42214495 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
42224496 __pyx_t_2 = 0;
4223 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
4497 __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
42244498 __Pyx_GOTREF(__pyx_t_2);
42254499 __pyx_t_4 = __pyx_v_e->text;
42264500 __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error)
42934567 __Pyx_GIVEREF(__pyx_t_2);
42944568 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
42954569 __pyx_t_2 = 0;
4296 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error)
4570 __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error)
42974571 __Pyx_GOTREF(__pyx_t_2);
42984572 __pyx_t_4 = __pyx_v_e->text;
42994573 __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 190, __pyx_L1_error)
43854659 __Pyx_GIVEREF(__pyx_t_2);
43864660 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
43874661 __pyx_t_2 = 0;
4388 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error)
4662 __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error)
43894663 __Pyx_GOTREF(__pyx_t_2);
43904664 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_1) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
43914665 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_1) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
44334707 __Pyx_GIVEREF(__pyx_t_2);
44344708 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
44354709 __pyx_t_2 = 0;
4436 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
4710 __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
44374711 __Pyx_GOTREF(__pyx_t_2);
44384712 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_1) < 0) __PYX_ERR(0, 197, __pyx_L1_error)
44394713 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_0) < 0) __PYX_ERR(0, 197, __pyx_L1_error)
44814755 __Pyx_GIVEREF(__pyx_t_2);
44824756 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
44834757 __pyx_t_2 = 0;
4484 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
4758 __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
44854759 __Pyx_GOTREF(__pyx_t_2);
44864760 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_2) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
44874761 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_1) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
45294803 __Pyx_GIVEREF(__pyx_t_2);
45304804 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
45314805 __pyx_t_2 = 0;
4532 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error)
4806 __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error)
45334807 __Pyx_GOTREF(__pyx_t_2);
45344808 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_2) < 0) __PYX_ERR(0, 203, __pyx_L1_error)
45354809 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_0) < 0) __PYX_ERR(0, 203, __pyx_L1_error)
45774851 __Pyx_GIVEREF(__pyx_t_2);
45784852 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
45794853 __pyx_t_2 = 0;
4580 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error)
4854 __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error)
45814855 __Pyx_GOTREF(__pyx_t_2);
45824856 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_4) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
45834857 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_1) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
46254899 __Pyx_GIVEREF(__pyx_t_2);
46264900 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
46274901 __pyx_t_2 = 0;
4628 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
4902 __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
46294903 __Pyx_GOTREF(__pyx_t_2);
46304904 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_state, __pyx_int_4) < 0) __PYX_ERR(0, 209, __pyx_L1_error)
46314905 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_gain, __pyx_int_0) < 0) __PYX_ERR(0, 209, __pyx_L1_error)
46734947 __Pyx_GIVEREF(__pyx_t_2);
46744948 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
46754949 __pyx_t_2 = 0;
4676 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error)
4950 __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error)
46774951 __Pyx_GOTREF(__pyx_t_2);
46784952 __pyx_t_4 = __Pyx_PyInt_From_int32_t(__pyx_v_e->data1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error)
46794953 __Pyx_GOTREF(__pyx_t_4);
48145088 __Pyx_GIVEREF(__pyx_t_2);
48155089 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
48165090 __pyx_t_2 = 0;
4817 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error)
5091 __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error)
48185092 __Pyx_GOTREF(__pyx_t_2);
48195093 __pyx_t_3 = __Pyx_PyInt_From_uint8_t(__pyx_v_e->event); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error)
48205094 __Pyx_GOTREF(__pyx_t_3);
52095483 __Pyx_GIVEREF(__pyx_t_4);
52105484 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
52115485 __pyx_t_4 = 0;
5212 __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __pyx_L1_error)
5486 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __pyx_L1_error)
52135487 __Pyx_GOTREF(__pyx_t_4);
52145488 __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->jdevice.which); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error)
52155489 __Pyx_GOTREF(__pyx_t_6);
53595633 __Pyx_GIVEREF(__pyx_t_4);
53605634 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
53615635 __pyx_t_4 = 0;
5362 __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
5636 __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
53635637 __Pyx_GOTREF(__pyx_t_4);
53645638 __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_e->caxis.which); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error)
53655639 __Pyx_GOTREF(__pyx_t_2);
54275701 __Pyx_GIVEREF(__pyx_t_4);
54285702 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
54295703 __pyx_t_4 = 0;
5430 __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
5704 __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
54315705 __Pyx_GOTREF(__pyx_t_4);
54325706 __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->cbutton.which); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error)
54335707 __Pyx_GOTREF(__pyx_t_6);
54965770 __Pyx_GIVEREF(__pyx_t_4);
54975771 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
54985772 __pyx_t_4 = 0;
5499 __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
5773 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
55005774 __Pyx_GOTREF(__pyx_t_4);
55015775 __pyx_t_2 = __Pyx_PyInt_From_int32_t(__pyx_v_e->cdevice.which); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error)
55025776 __Pyx_GOTREF(__pyx_t_2);
55575831 __Pyx_GIVEREF(__pyx_t_4);
55585832 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
55595833 __pyx_t_4 = 0;
5560 __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error)
5834 __pyx_t_4 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 254, __pyx_L1_error)
55615835 __Pyx_GOTREF(__pyx_t_4);
55625836 __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_e->tfinger.touchId); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error)
55635837 __Pyx_GOTREF(__pyx_t_6);
56325906 __Pyx_GIVEREF(__pyx_t_4);
56335907 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
56345908 __pyx_t_4 = 0;
5635 __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error)
5909 __pyx_t_4 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error)
56365910 __Pyx_GOTREF(__pyx_t_4);
56375911 __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_e->mgesture.touchId); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error)
56385912 __Pyx_GOTREF(__pyx_t_2);
57556029 __Pyx_GIVEREF(__pyx_t_4);
57566030 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
57576031 __pyx_t_4 = 0;
5758 __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error)
6032 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error)
57596033 __Pyx_GOTREF(__pyx_t_4);
57606034 __pyx_t_6 = __Pyx_PyInt_From_int32_t(__pyx_v_e->user.code); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 263, __pyx_L1_error)
57616035 __Pyx_GOTREF(__pyx_t_6);
59246198 if (unlikely(!__pyx_t_4)) {
59256199 PyObject* exc_type = PyErr_Occurred();
59266200 if (exc_type) {
5927 if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
6201 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
59286202 else __PYX_ERR(0, 286, __pyx_L1_error)
59296203 }
59306204 break;
59926266 __pyx_L1_error:;
59936267 __Pyx_XDECREF(__pyx_t_1);
59946268 __Pyx_XDECREF(__pyx_t_4);
5995 __Pyx_WriteUnraisable("pygame_sdl2.event.has_event", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
6269 __Pyx_WriteUnraisable("pygame_sdl2.event.has_event", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
59966270 __pyx_r = 0;
59976271 __pyx_L0:;
59986272 __Pyx_XDECREF(__pyx_v_i);
61336407 if (unlikely(!__pyx_t_7)) {
61346408 PyObject* exc_type = PyErr_Occurred();
61356409 if (exc_type) {
6136 if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
6410 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
61376411 else __PYX_ERR(0, 307, __pyx_L1_error)
61386412 }
61396413 break;
61646438 * else:
61656439 * new_queue.append(i)
61666440 */
6167 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_v_i); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 309, __pyx_L1_error)
6441 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_v_i); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 309, __pyx_L1_error)
61686442
61696443 /* "pygame_sdl2/event.pyx":308
61706444 *
61846458 * event_queue = new_queue
61856459 */
61866460 /*else*/ {
6187 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_new_queue, __pyx_v_i); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 311, __pyx_L1_error)
6461 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_new_queue, __pyx_v_i); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 311, __pyx_L1_error)
61886462 }
61896463 __pyx_L8:;
61906464
63366610 */
63376611 __pyx_t_1 = __pyx_f_11pygame_sdl2_5event_make_event((&__pyx_v_evt)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L7_error)
63386612 __Pyx_GOTREF(__pyx_t_1);
6339 __pyx_t_10 = __Pyx_PyObject_Append(event_queue, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 328, __pyx_L7_error)
6613 __pyx_t_10 = __Pyx_PyObject_Append(event_queue, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 328, __pyx_L7_error)
63406614 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
63416615 }
63426616
63516625 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
63526626 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
63536627 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6354 goto __pyx_L14_try_end;
6628 goto __pyx_L12_try_end;
63556629 __pyx_L7_error:;
6356 __Pyx_PyThreadState_assign
63576630 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
63586631 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
63596632 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
63896662 goto __pyx_L8_exception_handled;
63906663 }
63916664 __pyx_L9_except_error:;
6392 __Pyx_PyThreadState_assign
63936665 __Pyx_XGIVEREF(__pyx_t_6);
63946666 __Pyx_XGIVEREF(__pyx_t_7);
63956667 __Pyx_XGIVEREF(__pyx_t_8);
63966668 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
63976669 goto __pyx_L1_error;
63986670 __pyx_L8_exception_handled:;
6399 __Pyx_PyThreadState_assign
64006671 __Pyx_XGIVEREF(__pyx_t_6);
64016672 __Pyx_XGIVEREF(__pyx_t_7);
64026673 __Pyx_XGIVEREF(__pyx_t_8);
64036674 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
6404 __pyx_L14_try_end:;
6675 __pyx_L12_try_end:;
64056676 }
64066677 }
64076678 /*finally:*/ {
64086679 /*normal exit:*/{
64096680 if (__pyx_t_2) {
6410 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL);
6681 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL);
64116682 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
64126683 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 326, __pyx_L1_error)
64136684 __Pyx_GOTREF(__pyx_t_8);
64176688 }
64186689 __pyx_L6:;
64196690 }
6420 goto __pyx_L20;
6691 goto __pyx_L18;
64216692 __pyx_L3_error:;
64226693 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
64236694 goto __pyx_L1_error;
6424 __pyx_L20:;
6695 __pyx_L18:;
64256696 }
64266697
64276698 /* "pygame_sdl2/event.pyx":330
65456816 *
65466817 *
65476818 */
6548 __pyx_t_9 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_9 == 1)) __PYX_ERR(0, 335, __pyx_L7_error)
6819 __pyx_t_9 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_9 == ((int)1))) __PYX_ERR(0, 335, __pyx_L7_error)
65496820
65506821 /* "pygame_sdl2/event.pyx":334
65516822 *
65586829 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
65596830 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
65606831 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6561 goto __pyx_L14_try_end;
6832 goto __pyx_L12_try_end;
65626833 __pyx_L7_error:;
6563 __Pyx_PyThreadState_assign
65646834 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
65656835 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
65666836 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
65966866 goto __pyx_L8_exception_handled;
65976867 }
65986868 __pyx_L9_except_error:;
6599 __Pyx_PyThreadState_assign
66006869 __Pyx_XGIVEREF(__pyx_t_6);
66016870 __Pyx_XGIVEREF(__pyx_t_7);
66026871 __Pyx_XGIVEREF(__pyx_t_8);
66036872 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
66046873 goto __pyx_L1_error;
66056874 __pyx_L8_exception_handled:;
6606 __Pyx_PyThreadState_assign
66076875 __Pyx_XGIVEREF(__pyx_t_6);
66086876 __Pyx_XGIVEREF(__pyx_t_7);
66096877 __Pyx_XGIVEREF(__pyx_t_8);
66106878 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
6611 __pyx_L14_try_end:;
6879 __pyx_L12_try_end:;
66126880 }
66136881 }
66146882 /*finally:*/ {
66156883 /*normal exit:*/{
66166884 if (__pyx_t_2) {
6617 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__4, NULL);
6885 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL);
66186886 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66196887 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 334, __pyx_L1_error)
66206888 __Pyx_GOTREF(__pyx_t_8);
66246892 }
66256893 __pyx_L6:;
66266894 }
6627 goto __pyx_L18;
6895 goto __pyx_L16;
66286896 __pyx_L3_error:;
66296897 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66306898 goto __pyx_L1_error;
6631 __pyx_L18:;
6899 __pyx_L16:;
66326900 }
66336901
66346902 /* "pygame_sdl2/event.pyx":333
66806948 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
66816949 switch (pos_args) {
66826950 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6951 CYTHON_FALLTHROUGH;
66836952 case 0: break;
66846953 default: goto __pyx_L5_argtuple_error;
66856954 }
66876956 switch (pos_args) {
66886957 case 0:
66896958 if (kw_args > 0) {
6690 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t);
6959 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t);
66916960 if (value) { values[0] = value; kw_args--; }
66926961 }
66936962 }
66976966 } else {
66986967 switch (PyTuple_GET_SIZE(__pyx_args)) {
66996968 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6969 CYTHON_FALLTHROUGH;
67006970 case 0: break;
67016971 default: goto __pyx_L5_argtuple_error;
67026972 }
67877057 *
67887058 * if t is None:
67897059 */
6790 __pyx_t_9 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_9 == 1)) __PYX_ERR(0, 343, __pyx_L7_error)
7060 __pyx_t_9 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_9 == ((int)1))) __PYX_ERR(0, 343, __pyx_L7_error)
67917061
67927062 /* "pygame_sdl2/event.pyx":345
67937063 * poll_sdl()
68317101 * rv = event_queue
68327102 * event_queue = [ ]
68337103 */
6834 goto __pyx_L15;
7104 goto __pyx_L13;
68357105 }
68367106
68377107 /* "pygame_sdl2/event.pyx":349
68707140 * rv = get_events(( t, ))
68717141 *
68727142 */
6873 goto __pyx_L15;
7143 goto __pyx_L13;
68747144 }
68757145
68767146 /* "pygame_sdl2/event.pyx":353
68867156 __pyx_v_rv = __pyx_t_3;
68877157 __pyx_t_3 = 0;
68887158 }
6889 __pyx_L15:;
7159 __pyx_L13:;
68907160
68917161 /* "pygame_sdl2/event.pyx":342
68927162 * global event_queue
68997169 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
69007170 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
69017171 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6902 goto __pyx_L14_try_end;
7172 goto __pyx_L12_try_end;
69037173 __pyx_L7_error:;
6904 __Pyx_PyThreadState_assign
69057174 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
69067175 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
69077176 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
69377206 goto __pyx_L8_exception_handled;
69387207 }
69397208 __pyx_L9_except_error:;
6940 __Pyx_PyThreadState_assign
69417209 __Pyx_XGIVEREF(__pyx_t_6);
69427210 __Pyx_XGIVEREF(__pyx_t_7);
69437211 __Pyx_XGIVEREF(__pyx_t_8);
69447212 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
69457213 goto __pyx_L1_error;
69467214 __pyx_L8_exception_handled:;
6947 __Pyx_PyThreadState_assign
69487215 __Pyx_XGIVEREF(__pyx_t_6);
69497216 __Pyx_XGIVEREF(__pyx_t_7);
69507217 __Pyx_XGIVEREF(__pyx_t_8);
69517218 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
6952 __pyx_L14_try_end:;
7219 __pyx_L12_try_end:;
69537220 }
69547221 }
69557222 /*finally:*/ {
69567223 /*normal exit:*/{
69577224 if (__pyx_t_2) {
6958 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__5, NULL);
7225 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL);
69597226 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
69607227 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 342, __pyx_L1_error)
69617228 __Pyx_GOTREF(__pyx_t_8);
69657232 }
69667233 __pyx_L6:;
69677234 }
6968 goto __pyx_L19;
7235 goto __pyx_L17;
69697236 __pyx_L3_error:;
69707237 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
69717238 goto __pyx_L1_error;
6972 __pyx_L19:;
7239 __pyx_L17:;
69737240 }
69747241
69757242 /* "pygame_sdl2/event.pyx":355
70987365 *
70997366 * if event_queue:
71007367 */
7101 __pyx_t_9 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_9 == 1)) __PYX_ERR(0, 361, __pyx_L7_error)
7368 __pyx_t_9 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_9 == ((int)1))) __PYX_ERR(0, 361, __pyx_L7_error)
71027369
71037370 /* "pygame_sdl2/event.pyx":363
71047371 * poll_sdl()
71567423 */
71577424 }
71587425 __pyx_L7_error:;
7159 __Pyx_PyThreadState_assign
71607426 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
71617427 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
71627428 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
71927458 goto __pyx_L8_exception_handled;
71937459 }
71947460 __pyx_L9_except_error:;
7195 __Pyx_PyThreadState_assign
71967461 __Pyx_XGIVEREF(__pyx_t_6);
71977462 __Pyx_XGIVEREF(__pyx_t_7);
71987463 __Pyx_XGIVEREF(__pyx_t_8);
71997464 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
72007465 goto __pyx_L1_error;
72017466 __pyx_L11_try_return:;
7202 __Pyx_PyThreadState_assign
72037467 __Pyx_XGIVEREF(__pyx_t_6);
72047468 __Pyx_XGIVEREF(__pyx_t_7);
72057469 __Pyx_XGIVEREF(__pyx_t_8);
72067470 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
72077471 goto __pyx_L4_return;
72087472 __pyx_L8_exception_handled:;
7209 __Pyx_PyThreadState_assign
72107473 __Pyx_XGIVEREF(__pyx_t_6);
72117474 __Pyx_XGIVEREF(__pyx_t_7);
72127475 __Pyx_XGIVEREF(__pyx_t_8);
72167479 /*finally:*/ {
72177480 /*normal exit:*/{
72187481 if (__pyx_t_2) {
7219 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL);
7482 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, NULL);
72207483 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
72217484 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 360, __pyx_L1_error)
72227485 __Pyx_GOTREF(__pyx_t_8);
72287491 __pyx_t_8 = __pyx_r;
72297492 __pyx_r = 0;
72307493 if (__pyx_t_2) {
7231 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL);
7494 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, NULL);
72327495 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
72337496 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 360, __pyx_L1_error)
72347497 __Pyx_GOTREF(__pyx_t_7);
72407503 }
72417504 __pyx_L6:;
72427505 }
7243 goto __pyx_L19;
7506 goto __pyx_L17;
72447507 __pyx_L3_error:;
72457508 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
72467509 goto __pyx_L1_error;
7247 __pyx_L19:;
7510 __pyx_L17:;
72487511 }
72497512
72507513 /* "pygame_sdl2/event.pyx":358
73637626 *
73647627 * if event_queue:
73657628 */
7366 __pyx_t_9 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_9 == 1)) __PYX_ERR(0, 375, __pyx_L7_error)
7629 __pyx_t_9 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_9 == ((int)1))) __PYX_ERR(0, 375, __pyx_L7_error)
73677630
73687631 /* "pygame_sdl2/event.pyx":377
73697632 * poll_sdl()
74097672 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
74107673 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
74117674 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7412 goto __pyx_L14_try_end;
7675 goto __pyx_L12_try_end;
74137676 __pyx_L7_error:;
7414 __Pyx_PyThreadState_assign
74157677 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
74167678 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
74177679 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
74477709 goto __pyx_L8_exception_handled;
74487710 }
74497711 __pyx_L9_except_error:;
7450 __Pyx_PyThreadState_assign
74517712 __Pyx_XGIVEREF(__pyx_t_6);
74527713 __Pyx_XGIVEREF(__pyx_t_7);
74537714 __Pyx_XGIVEREF(__pyx_t_8);
74547715 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
74557716 goto __pyx_L1_error;
74567717 __pyx_L11_try_return:;
7457 __Pyx_PyThreadState_assign
74587718 __Pyx_XGIVEREF(__pyx_t_6);
74597719 __Pyx_XGIVEREF(__pyx_t_7);
74607720 __Pyx_XGIVEREF(__pyx_t_8);
74617721 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
74627722 goto __pyx_L4_return;
74637723 __pyx_L8_exception_handled:;
7464 __Pyx_PyThreadState_assign
74657724 __Pyx_XGIVEREF(__pyx_t_6);
74667725 __Pyx_XGIVEREF(__pyx_t_7);
74677726 __Pyx_XGIVEREF(__pyx_t_8);
74687727 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
7469 __pyx_L14_try_end:;
7728 __pyx_L12_try_end:;
74707729 }
74717730 }
74727731 /*finally:*/ {
74737732 /*normal exit:*/{
74747733 if (__pyx_t_2) {
7475 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL);
7734 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__11, NULL);
74767735 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
74777736 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 374, __pyx_L1_error)
74787737 __Pyx_GOTREF(__pyx_t_8);
74847743 __pyx_t_8 = __pyx_r;
74857744 __pyx_r = 0;
74867745 if (__pyx_t_2) {
7487 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, NULL);
7746 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__12, NULL);
74887747 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
74897748 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 374, __pyx_L1_error)
74907749 __Pyx_GOTREF(__pyx_t_7);
74967755 }
74977756 __pyx_L6:;
74987757 }
7499 goto __pyx_L19;
7758 goto __pyx_L17;
75007759 __pyx_L3_error:;
75017760 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
75027761 goto __pyx_L1_error;
7503 __pyx_L19:;
7762 __pyx_L17:;
75047763 }
75057764
75067765 /* "pygame_sdl2/event.pyx":380
75147773 #ifdef WITH_THREAD
75157774 PyThreadState *_save;
75167775 Py_UNBLOCK_THREADS
7776 __Pyx_FastGIL_Remember();
75177777 #endif
75187778 /*try:*/ {
75197779
75377797 /*finally:*/ {
75387798 /*normal exit:*/{
75397799 #ifdef WITH_THREAD
7800 __Pyx_FastGIL_Forget();
75407801 Py_BLOCK_THREADS
75417802 #endif
7542 goto __pyx_L22;
7803 goto __pyx_L20;
75437804 }
7544 __pyx_L22:;
7805 __pyx_L20:;
75457806 }
75467807 }
75477808
76417902 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
76427903 switch (pos_args) {
76437904 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7905 CYTHON_FALLTHROUGH;
76447906 case 0: break;
76457907 default: goto __pyx_L5_argtuple_error;
76467908 }
76487910 switch (pos_args) {
76497911 case 0:
76507912 if (kw_args > 0) {
7651 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t);
7913 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t);
76527914 if (value) { values[0] = value; kw_args--; }
76537915 }
76547916 }
76587920 } else {
76597921 switch (PyTuple_GET_SIZE(__pyx_args)) {
76607922 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7923 CYTHON_FALLTHROUGH;
76617924 case 0: break;
76627925 default: goto __pyx_L5_argtuple_error;
76637926 }
77488011 *
77498012 * if t is None:
77508013 */
7751 __pyx_t_9 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_9 == 1)) __PYX_ERR(0, 392, __pyx_L7_error)
8014 __pyx_t_9 = __pyx_f_11pygame_sdl2_5event_poll_sdl(); if (unlikely(__pyx_t_9 == ((int)1))) __PYX_ERR(0, 392, __pyx_L7_error)
77528015
77538016 /* "pygame_sdl2/event.pyx":394
77548017 * poll_sdl()
77718034 __Pyx_XDECREF(__pyx_r);
77728035 __pyx_t_1 = event_queue;
77738036 __Pyx_INCREF(__pyx_t_1);
7774 __pyx_t_12 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 395, __pyx_L7_error)
8037 __pyx_t_12 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(0, 395, __pyx_L7_error)
77758038 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
77768039 __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_t_12 != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L7_error)
77778040 __Pyx_GOTREF(__pyx_t_1);
78538116 */
78548117 }
78558118 __pyx_L7_error:;
7856 __Pyx_PyThreadState_assign
78578119 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
78588120 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
78598121 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
78898151 goto __pyx_L8_exception_handled;
78908152 }
78918153 __pyx_L9_except_error:;
7892 __Pyx_PyThreadState_assign
78938154 __Pyx_XGIVEREF(__pyx_t_6);
78948155 __Pyx_XGIVEREF(__pyx_t_7);
78958156 __Pyx_XGIVEREF(__pyx_t_8);
78968157 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
78978158 goto __pyx_L1_error;
78988159 __pyx_L11_try_return:;
7899 __Pyx_PyThreadState_assign
79008160 __Pyx_XGIVEREF(__pyx_t_6);
79018161 __Pyx_XGIVEREF(__pyx_t_7);
79028162 __Pyx_XGIVEREF(__pyx_t_8);
79038163 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
79048164 goto __pyx_L4_return;
79058165 __pyx_L8_exception_handled:;
7906 __Pyx_PyThreadState_assign
79078166 __Pyx_XGIVEREF(__pyx_t_6);
79088167 __Pyx_XGIVEREF(__pyx_t_7);
79098168 __Pyx_XGIVEREF(__pyx_t_8);
79138172 /*finally:*/ {
79148173 /*normal exit:*/{
79158174 if (__pyx_t_2) {
7916 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, NULL);
8175 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__13, NULL);
79178176 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
79188177 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 391, __pyx_L1_error)
79198178 __Pyx_GOTREF(__pyx_t_8);
79258184 __pyx_t_8 = __pyx_r;
79268185 __pyx_r = 0;
79278186 if (__pyx_t_2) {
7928 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__11, NULL);
8187 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__14, NULL);
79298188 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
79308189 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 391, __pyx_L1_error)
79318190 __Pyx_GOTREF(__pyx_t_7);
79378196 }
79388197 __pyx_L6:;
79398198 }
7940 goto __pyx_L19;
8199 goto __pyx_L17;
79418200 __pyx_L3_error:;
79428201 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
79438202 goto __pyx_L1_error;
7944 __pyx_L19:;
8203 __pyx_L17:;
79458204 }
79468205
79478206 /* "pygame_sdl2/event.pyx":389
79938252 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
79948253 switch (pos_args) {
79958254 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8255 CYTHON_FALLTHROUGH;
79968256 case 0: break;
79978257 default: goto __pyx_L5_argtuple_error;
79988258 }
80008260 switch (pos_args) {
80018261 case 0:
80028262 if (kw_args > 0) {
8003 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t);
8263 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t);
80048264 if (value) { values[0] = value; kw_args--; }
80058265 }
80068266 }
80108270 } else {
80118271 switch (PyTuple_GET_SIZE(__pyx_args)) {
80128272 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8273 CYTHON_FALLTHROUGH;
80138274 case 0: break;
80148275 default: goto __pyx_L5_argtuple_error;
80158276 }
81428403 }
81438404
81448405 static PyObject *__pyx_pf_11pygame_sdl2_5event_12get_standard_events(CYTHON_UNUSED PyObject *__pyx_self) {
8406 PyObject *__pyx_7genexpr__pyx_v_i = NULL;
81458407 PyObject *__pyx_r = NULL;
81468408 __Pyx_RefNannyDeclarations
81478409 PyObject *__pyx_t_1 = NULL;
81658427 */
81668428 __Pyx_XDECREF(__pyx_r);
81678429 { /* enter inner scope */
8168 PyObject *__pyx_7genexpr__pyx_v_i = NULL;
81698430 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L5_error)
81708431 __Pyx_GOTREF(__pyx_t_1);
81718432 __pyx_t_3 = 0;
81728433 __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 412, __pyx_L5_error)
81738434 __Pyx_GOTREF(__pyx_t_6);
81748435 if (unlikely(__pyx_t_6 == Py_None)) {
8175 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
8436 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
81768437 __PYX_ERR(0, 412, __pyx_L5_error)
81778438 }
81788439 __pyx_t_7 = __Pyx_dict_iterator(__pyx_t_6, 0, __pyx_n_s_keys, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 412, __pyx_L5_error)
82128473 }
82138474 }
82148475 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8215 __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i);
8476 __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i); __pyx_7genexpr__pyx_v_i = 0;
82168477 goto __pyx_L11_exit_scope;
82178478 __pyx_L5_error:;
8218 __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i);
8479 __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i); __pyx_7genexpr__pyx_v_i = 0;
82198480 goto __pyx_L1_error;
82208481 __pyx_L11_exit_scope:;
82218482 } /* exit inner scope */
82408501 __Pyx_AddTraceback("pygame_sdl2.event.get_standard_events", __pyx_clineno, __pyx_lineno, __pyx_filename);
82418502 __pyx_r = NULL;
82428503 __pyx_L0:;
8504 __Pyx_XDECREF(__pyx_7genexpr__pyx_v_i);
82438505 __Pyx_XGIVEREF(__pyx_r);
82448506 __Pyx_RefNannyFinishContext();
82458507 return __pyx_r;
83058567 __Pyx_XDECREF(__pyx_r);
83068568 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 416, __pyx_L3_error)
83078569 __Pyx_GOTREF(__pyx_t_4);
8308 __pyx_t_5 = PyObject_GetItem(__pyx_t_4, __pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 416, __pyx_L3_error)
8570 __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 416, __pyx_L3_error)
83098571 __Pyx_GOTREF(__pyx_t_5);
83108572 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
83118573 __pyx_r = __pyx_t_5;
83218583 */
83228584 }
83238585 __pyx_L3_error:;
8324 __Pyx_PyThreadState_assign
83258586 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
83268587 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
83278588
83658626 * return event_names[t]
83668627 * except KeyError:
83678628 */
8368 __Pyx_PyThreadState_assign
83698629 __Pyx_XGIVEREF(__pyx_t_1);
83708630 __Pyx_XGIVEREF(__pyx_t_2);
83718631 __Pyx_XGIVEREF(__pyx_t_3);
83728632 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
83738633 goto __pyx_L1_error;
83748634 __pyx_L7_try_return:;
8375 __Pyx_PyThreadState_assign
83768635 __Pyx_XGIVEREF(__pyx_t_1);
83778636 __Pyx_XGIVEREF(__pyx_t_2);
83788637 __Pyx_XGIVEREF(__pyx_t_3);
83798638 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
83808639 goto __pyx_L0;
83818640 __pyx_L6_except_return:;
8382 __Pyx_PyThreadState_assign
83838641 __Pyx_XGIVEREF(__pyx_t_1);
83848642 __Pyx_XGIVEREF(__pyx_t_2);
83858643 __Pyx_XGIVEREF(__pyx_t_3);
84338691 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
84348692 switch (pos_args) {
84358693 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8694 CYTHON_FALLTHROUGH;
84368695 case 0: break;
84378696 default: goto __pyx_L5_argtuple_error;
84388697 }
84408699 switch (pos_args) {
84418700 case 0:
84428701 if (kw_args > 0) {
8443 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t);
8702 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t);
84448703 if (value) { values[0] = value; kw_args--; }
84458704 }
84468705 }
84508709 } else {
84518710 switch (PyTuple_GET_SIZE(__pyx_args)) {
84528711 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8712 CYTHON_FALLTHROUGH;
84538713 case 0: break;
84548714 default: goto __pyx_L5_argtuple_error;
84558715 }
85128772 __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 422, __pyx_L1_error)
85138773 __Pyx_GOTREF(__pyx_t_6);
85148774 if (unlikely(__pyx_t_6 == Py_None)) {
8515 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
8775 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
85168776 __PYX_ERR(0, 422, __pyx_L1_error)
85178777 }
85188778 __pyx_t_7 = __Pyx_dict_iterator(__pyx_t_6, 0, __pyx_n_s_keys, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error)
85378797 * SDL_EventState(t, SDL_IGNORE)
85388798 */
85398799 __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_et); if (unlikely((__pyx_t_9 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L1_error)
8540 SDL_EventState(__pyx_t_9, SDL_ENABLE);
8800 (void)(SDL_EventState(__pyx_t_9, SDL_ENABLE));
85418801 }
85428802 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
85438803
85808840 * for et in t:
85818841 */
85828842 __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_t); if (unlikely((__pyx_t_9 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error)
8583 SDL_EventState(__pyx_t_9, SDL_IGNORE);
8843 (void)(SDL_EventState(__pyx_t_9, SDL_IGNORE));
85848844
85858845 /* "pygame_sdl2/event.pyx":424
85868846 * for et in event_names.keys():
86328892 if (unlikely(!__pyx_t_7)) {
86338893 PyObject* exc_type = PyErr_Occurred();
86348894 if (exc_type) {
8635 if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
8895 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
86368896 else __PYX_ERR(0, 427, __pyx_L1_error)
86378897 }
86388898 break;
86508910 * def set_allowed(t=None):
86518911 */
86528912 __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_et); if (unlikely((__pyx_t_9 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L1_error)
8653 SDL_EventState(__pyx_t_9, SDL_IGNORE);
8913 (void)(SDL_EventState(__pyx_t_9, SDL_IGNORE));
86548914
86558915 /* "pygame_sdl2/event.pyx":427
86568916 * SDL_EventState(t, SDL_IGNORE)
87138973 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
87148974 switch (pos_args) {
87158975 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8976 CYTHON_FALLTHROUGH;
87168977 case 0: break;
87178978 default: goto __pyx_L5_argtuple_error;
87188979 }
87208981 switch (pos_args) {
87218982 case 0:
87228983 if (kw_args > 0) {
8723 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t);
8984 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t);
87248985 if (value) { values[0] = value; kw_args--; }
87258986 }
87268987 }
87308991 } else {
87318992 switch (PyTuple_GET_SIZE(__pyx_args)) {
87328993 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8994 CYTHON_FALLTHROUGH;
87338995 case 0: break;
87348996 default: goto __pyx_L5_argtuple_error;
87358997 }
87929054 __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L1_error)
87939055 __Pyx_GOTREF(__pyx_t_6);
87949056 if (unlikely(__pyx_t_6 == Py_None)) {
8795 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "keys");
9057 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
87969058 __PYX_ERR(0, 432, __pyx_L1_error)
87979059 }
87989060 __pyx_t_7 = __Pyx_dict_iterator(__pyx_t_6, 0, __pyx_n_s_keys, (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 432, __pyx_L1_error)
88179079 * SDL_EventState(t, SDL_ENABLE)
88189080 */
88199081 __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_et); if (unlikely((__pyx_t_9 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L1_error)
8820 SDL_EventState(__pyx_t_9, SDL_IGNORE);
9082 (void)(SDL_EventState(__pyx_t_9, SDL_IGNORE));
88219083 }
88229084 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
88239085
88609122 * for et in t:
88619123 */
88629124 __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_t); if (unlikely((__pyx_t_9 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L1_error)
8863 SDL_EventState(__pyx_t_9, SDL_ENABLE);
9125 (void)(SDL_EventState(__pyx_t_9, SDL_ENABLE));
88649126
88659127 /* "pygame_sdl2/event.pyx":434
88669128 * for et in event_names.keys():
89129174 if (unlikely(!__pyx_t_7)) {
89139175 PyObject* exc_type = PyErr_Occurred();
89149176 if (exc_type) {
8915 if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9177 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
89169178 else __PYX_ERR(0, 437, __pyx_L1_error)
89179179 }
89189180 break;
89309192 * def get_blocked(t):
89319193 */
89329194 __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_et); if (unlikely((__pyx_t_9 == ((Uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L1_error)
8933 SDL_EventState(__pyx_t_9, SDL_ENABLE);
9195 (void)(SDL_EventState(__pyx_t_9, SDL_ENABLE));
89349196
89359197 /* "pygame_sdl2/event.pyx":437
89369198 * SDL_EventState(t, SDL_ENABLE)
93169578 */
93179579 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
93189580 __Pyx_GOTREF(__pyx_t_1);
9319 __pyx_t_2 = PyObject_IsInstance(__pyx_v_e, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 475, __pyx_L1_error)
9581 __pyx_t_2 = PyObject_IsInstance(__pyx_v_e, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 475, __pyx_L1_error)
93209582 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
93219583 __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
9322 if (__pyx_t_3) {
9584 if (unlikely(__pyx_t_3)) {
93239585
93249586 /* "pygame_sdl2/event.pyx":476
93259587 *
93339595 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 476, __pyx_L1_error)
93349596 __Pyx_GOTREF(__pyx_t_4);
93359597 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9336 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error)
9598 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error)
93379599 __Pyx_GOTREF(__pyx_t_1);
93389600 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
93399601 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
94649726 *
94659727 * def register(name):
94669728 */
9467 SDL_PushEvent((&__pyx_v_event));
9729 (void)(SDL_PushEvent((&__pyx_v_event)));
94689730
94699731 /* "pygame_sdl2/event.pyx":468
94709732 * return mousewheel_buttons
96129874 * # Usually called by display.init.
96139875 */
96149876 __Pyx_XDECREF(__pyx_r);
9615 __pyx_t_1 = __Pyx_PyObject_GetSlice(event_queue, 0, 0, NULL, NULL, &__pyx_slice__13, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
9877 __pyx_t_1 = __Pyx_PyObject_GetSlice(event_queue, 0, 0, NULL, NULL, &__pyx_slice__16, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
96169878 __Pyx_GOTREF(__pyx_t_1);
96179879 __pyx_r = __pyx_t_1;
96189880 __pyx_t_1 = 0;
97209982 * raise pygame_sdl2.error.error()
97219983 */
97229984 __pyx_t_1 = (SDL_InitSubSystem(SDL_INIT_EVENTS) != 0);
9723 if (__pyx_t_1) {
9985 if (unlikely(__pyx_t_1)) {
97249986
97259987 /* "pygame_sdl2/event.pyx":517
97269988 *
980210064 };
980310065
980410066 #if PY_MAJOR_VERSION >= 3
10067 #if CYTHON_PEP489_MULTI_PHASE_INIT
10068 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
10069 static int __pyx_pymod_exec_event(PyObject* module); /*proto*/
10070 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
10071 {Py_mod_create, (void*)__pyx_pymod_create},
10072 {Py_mod_exec, (void*)__pyx_pymod_exec_event},
10073 {0, NULL}
10074 };
10075 #endif
10076
980510077 static struct PyModuleDef __pyx_moduledef = {
9806 #if PY_VERSION_HEX < 0x03020000
9807 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
9808 #else
980910078 PyModuleDef_HEAD_INIT,
9810 #endif
981110079 "event",
981210080 0, /* m_doc */
10081 #if CYTHON_PEP489_MULTI_PHASE_INIT
10082 0, /* m_size */
10083 #else
981310084 -1, /* m_size */
10085 #endif
981410086 __pyx_methods /* m_methods */,
10087 #if CYTHON_PEP489_MULTI_PHASE_INIT
10088 __pyx_moduledef_slots, /* m_slots */
10089 #else
981510090 NULL, /* m_reload */
10091 #endif
981610092 NULL, /* m_traverse */
981710093 NULL, /* m_clear */
981810094 NULL /* m_free */
983910115 {&__pyx_n_u_DOLLARGESTURE, __pyx_k_DOLLARGESTURE, sizeof(__pyx_k_DOLLARGESTURE), 0, 1, 0, 1},
984010116 {&__pyx_n_u_DOLLARRECORD, __pyx_k_DOLLARRECORD, sizeof(__pyx_k_DOLLARRECORD), 0, 1, 0, 1},
984110117 {&__pyx_n_u_DROPFILE, __pyx_k_DROPFILE, sizeof(__pyx_k_DROPFILE), 0, 1, 0, 1},
9842 {&__pyx_n_s_Event, __pyx_k_Event, sizeof(__pyx_k_Event), 0, 0, 1, 1},
10118 {&__pyx_kp_u_Event, __pyx_k_Event, sizeof(__pyx_k_Event), 0, 1, 0, 0},
984310119 {&__pyx_n_s_EventType, __pyx_k_EventType, sizeof(__pyx_k_EventType), 0, 0, 1, 1},
984410120 {&__pyx_n_s_EventType___eq, __pyx_k_EventType___eq, sizeof(__pyx_k_EventType___eq), 0, 0, 1, 1},
984510121 {&__pyx_n_s_EventType___init, __pyx_k_EventType___init, sizeof(__pyx_k_EventType___init), 0, 0, 1, 1},
984810124 {&__pyx_n_s_EventType___repr, __pyx_k_EventType___repr, sizeof(__pyx_k_EventType___repr), 0, 0, 1, 1},
984910125 {&__pyx_n_s_EventType_dict, __pyx_k_EventType_dict, sizeof(__pyx_k_EventType_dict), 0, 0, 1, 1},
985010126 {&__pyx_n_s_EventType_type, __pyx_k_EventType_type, sizeof(__pyx_k_EventType_type), 0, 0, 1, 1},
9851 {&__pyx_kp_u_Event_d_s_s, __pyx_k_Event_d_s_s, sizeof(__pyx_k_Event_d_s_s), 0, 1, 0, 0},
10127 {&__pyx_n_s_Event_2, __pyx_k_Event_2, sizeof(__pyx_k_Event_2), 0, 0, 1, 1},
985210128 {&__pyx_n_u_FINGERDOWN, __pyx_k_FINGERDOWN, sizeof(__pyx_k_FINGERDOWN), 0, 1, 0, 1},
985310129 {&__pyx_n_u_FINGERMOTION, __pyx_k_FINGERMOTION, sizeof(__pyx_k_FINGERMOTION), 0, 1, 0, 1},
985410130 {&__pyx_n_u_FINGERUP, __pyx_k_FINGERUP, sizeof(__pyx_k_FINGERUP), 0, 1, 0, 1},
988510161 {&__pyx_n_s_VIDEORESIZE, __pyx_k_VIDEORESIZE, sizeof(__pyx_k_VIDEORESIZE), 0, 0, 1, 1},
988610162 {&__pyx_n_u_VIDEORESIZE, __pyx_k_VIDEORESIZE, sizeof(__pyx_k_VIDEORESIZE), 0, 1, 0, 1},
988710163 {&__pyx_n_u_WINDOWEVENT, __pyx_k_WINDOWEVENT, sizeof(__pyx_k_WINDOWEVENT), 0, 1, 0, 1},
10164 {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
10165 {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0},
10166 {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0},
988810167 {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
988910168 {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1},
989010169 {&__pyx_n_s_ball, __pyx_k_ball, sizeof(__pyx_k_ball), 0, 0, 1, 1},
989210171 {&__pyx_n_s_buttons, __pyx_k_buttons, sizeof(__pyx_k_buttons), 0, 0, 1, 1},
989310172 {&__pyx_n_s_chr, __pyx_k_chr, sizeof(__pyx_k_chr), 0, 0, 1, 1},
989410173 {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1},
10174 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
989510175 {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1},
989610176 {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
989710177 {&__pyx_n_s_copy_event_queue, __pyx_k_copy_event_queue, sizeof(__pyx_k_copy_event_queue), 0, 0, 1, 1},
989810178 {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
10179 {&__pyx_n_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 1},
989910180 {&__pyx_n_s_dDist, __pyx_k_dDist, sizeof(__pyx_k_dDist), 0, 0, 1, 1},
990010181 {&__pyx_n_s_dTheta, __pyx_k_dTheta, sizeof(__pyx_k_dTheta), 0, 0, 1, 1},
990110182 {&__pyx_n_s_data1, __pyx_k_data1, sizeof(__pyx_k_data1), 0, 0, 1, 1},
992810209 {&__pyx_n_s_get_standard_events, __pyx_k_get_standard_events, sizeof(__pyx_k_get_standard_events), 0, 0, 1, 1},
992910210 {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
993010211 {&__pyx_n_s_hat, __pyx_k_hat, sizeof(__pyx_k_hat), 0, 0, 1, 1},
10212 {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
993110213 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
993210214 {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
993310215 {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1},
1002410306 *
1002510307 * # This is not the mouse position at the time of the event
1002610308 */
10027 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 162, __pyx_L1_error)
10028 __Pyx_GOTREF(__pyx_tuple__2);
10029 __Pyx_GIVEREF(__pyx_tuple__2);
10309 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 162, __pyx_L1_error)
10310 __Pyx_GOTREF(__pyx_tuple__5);
10311 __Pyx_GIVEREF(__pyx_tuple__5);
1003010312
1003110313 /* "pygame_sdl2/event.pyx":326
1003210314 * cdef SDL_Event evt
1003510317 * while SDL_PollEvent(&evt):
1003610318 * event_queue.append(make_event(&evt))
1003710319 */
10038 __pyx_tuple__3 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 326, __pyx_L1_error)
10039 __Pyx_GOTREF(__pyx_tuple__3);
10040 __Pyx_GIVEREF(__pyx_tuple__3);
10320 __pyx_tuple__6 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 326, __pyx_L1_error)
10321 __Pyx_GOTREF(__pyx_tuple__6);
10322 __Pyx_GIVEREF(__pyx_tuple__6);
1004110323
1004210324 /* "pygame_sdl2/event.pyx":334
1004310325 *
1004610328 * poll_sdl()
1004710329 *
1004810330 */
10049 __pyx_tuple__4 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 334, __pyx_L1_error)
10050 __Pyx_GOTREF(__pyx_tuple__4);
10051 __Pyx_GIVEREF(__pyx_tuple__4);
10331 __pyx_tuple__7 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 334, __pyx_L1_error)
10332 __Pyx_GOTREF(__pyx_tuple__7);
10333 __Pyx_GIVEREF(__pyx_tuple__7);
1005210334
1005310335 /* "pygame_sdl2/event.pyx":342
1005410336 * global event_queue
1005710339 * poll_sdl()
1005810340 *
1005910341 */
10060 __pyx_tuple__5 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 342, __pyx_L1_error)
10061 __Pyx_GOTREF(__pyx_tuple__5);
10062 __Pyx_GIVEREF(__pyx_tuple__5);
10342 __pyx_tuple__8 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 342, __pyx_L1_error)
10343 __Pyx_GOTREF(__pyx_tuple__8);
10344 __Pyx_GIVEREF(__pyx_tuple__8);
1006310345
1006410346 /* "pygame_sdl2/event.pyx":360
1006510347 * def poll():
1006810350 * poll_sdl()
1006910351 *
1007010352 */
10071 __pyx_tuple__6 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 360, __pyx_L1_error)
10072 __Pyx_GOTREF(__pyx_tuple__6);
10073 __Pyx_GIVEREF(__pyx_tuple__6);
10074 __pyx_tuple__7 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 360, __pyx_L1_error)
10075 __Pyx_GOTREF(__pyx_tuple__7);
10076 __Pyx_GIVEREF(__pyx_tuple__7);
10353 __pyx_tuple__9 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 360, __pyx_L1_error)
10354 __Pyx_GOTREF(__pyx_tuple__9);
10355 __Pyx_GIVEREF(__pyx_tuple__9);
10356 __pyx_tuple__10 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 360, __pyx_L1_error)
10357 __Pyx_GOTREF(__pyx_tuple__10);
10358 __Pyx_GIVEREF(__pyx_tuple__10);
1007710359
1007810360 /* "pygame_sdl2/event.pyx":374
1007910361 * cdef int result
1008210364 * poll_sdl()
1008310365 *
1008410366 */
10085 __pyx_tuple__8 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 374, __pyx_L1_error)
10086 __Pyx_GOTREF(__pyx_tuple__8);
10087 __Pyx_GIVEREF(__pyx_tuple__8);
10088 __pyx_tuple__9 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 374, __pyx_L1_error)
10089 __Pyx_GOTREF(__pyx_tuple__9);
10090 __Pyx_GIVEREF(__pyx_tuple__9);
10367 __pyx_tuple__11 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 374, __pyx_L1_error)
10368 __Pyx_GOTREF(__pyx_tuple__11);
10369 __Pyx_GIVEREF(__pyx_tuple__11);
10370 __pyx_tuple__12 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 374, __pyx_L1_error)
10371 __Pyx_GOTREF(__pyx_tuple__12);
10372 __Pyx_GIVEREF(__pyx_tuple__12);
1009110373
1009210374 /* "pygame_sdl2/event.pyx":391
1009310375 * def peek(t=None):
1009610378 * poll_sdl()
1009710379 *
1009810380 */
10099 __pyx_tuple__10 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 391, __pyx_L1_error)
10100 __Pyx_GOTREF(__pyx_tuple__10);
10101 __Pyx_GIVEREF(__pyx_tuple__10);
10102 __pyx_tuple__11 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 391, __pyx_L1_error)
10103 __Pyx_GOTREF(__pyx_tuple__11);
10104 __Pyx_GIVEREF(__pyx_tuple__11);
10381 __pyx_tuple__13 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 391, __pyx_L1_error)
10382 __Pyx_GOTREF(__pyx_tuple__13);
10383 __Pyx_GIVEREF(__pyx_tuple__13);
10384 __pyx_tuple__14 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 391, __pyx_L1_error)
10385 __Pyx_GOTREF(__pyx_tuple__14);
10386 __Pyx_GIVEREF(__pyx_tuple__14);
1010510387
1010610388 /* "pygame_sdl2/event.pyx":476
1010710389 *
1011010392 *
1011110393 * if get_blocked(e.type):
1011210394 */
10113 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_event_post_must_be_called_with_a); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 476, __pyx_L1_error)
10114 __Pyx_GOTREF(__pyx_tuple__12);
10115 __Pyx_GIVEREF(__pyx_tuple__12);
10395 __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_event_post_must_be_called_with_a); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 476, __pyx_L1_error)
10396 __Pyx_GOTREF(__pyx_tuple__15);
10397 __Pyx_GIVEREF(__pyx_tuple__15);
1011610398
1011710399 /* "pygame_sdl2/event.pyx":508
1011810400 * """
1012110403 *
1012210404 * # Usually called by display.init.
1012310405 */
10124 __pyx_slice__13 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) __PYX_ERR(0, 508, __pyx_L1_error)
10125 __Pyx_GOTREF(__pyx_slice__13);
10126 __Pyx_GIVEREF(__pyx_slice__13);
10406 __pyx_slice__16 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__16)) __PYX_ERR(0, 508, __pyx_L1_error)
10407 __Pyx_GOTREF(__pyx_slice__16);
10408 __Pyx_GIVEREF(__pyx_slice__16);
10409
10410 /* "pygame_sdl2/event.pyx":55
10411 * cdef bint mousewheel_buttons = 1
10412 *
10413 * class EventType(object): # <<<<<<<<<<<<<<
10414 *
10415 * def __init__(self, type, dict=None, **kwargs):
10416 */
10417 __pyx_tuple__17 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 55, __pyx_L1_error)
10418 __Pyx_GOTREF(__pyx_tuple__17);
10419 __Pyx_GIVEREF(__pyx_tuple__17);
1012710420
1012810421 /* "pygame_sdl2/event.pyx":57
1012910422 * class EventType(object):
1013210425 * self._type = type
1013310426 *
1013410427 */
10135 __pyx_tuple__14 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_type, __pyx_n_s_dict, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 57, __pyx_L1_error)
10136 __Pyx_GOTREF(__pyx_tuple__14);
10137 __Pyx_GIVEREF(__pyx_tuple__14);
10138 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_init, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 57, __pyx_L1_error)
10139 __pyx_tuple__16 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 57, __pyx_L1_error)
10140 __Pyx_GOTREF(__pyx_tuple__16);
10141 __Pyx_GIVEREF(__pyx_tuple__16);
10428 __pyx_tuple__18 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_type, __pyx_n_s_dict, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 57, __pyx_L1_error)
10429 __Pyx_GOTREF(__pyx_tuple__18);
10430 __Pyx_GIVEREF(__pyx_tuple__18);
10431 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_init, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 57, __pyx_L1_error)
10432 __pyx_tuple__20 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 57, __pyx_L1_error)
10433 __Pyx_GOTREF(__pyx_tuple__20);
10434 __Pyx_GIVEREF(__pyx_tuple__20);
1014210435
1014310436 /* "pygame_sdl2/event.pyx":65
1014410437 * self.__dict__.update(kwargs)
1014710440 * if SDL_USEREVENT <= self.type < VIDEOEXPOSE:
1014810441 * ename = "UserEvent%d" % (self.type - SDL_USEREVENT)
1014910442 */
10150 __pyx_tuple__17 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ename, __pyx_n_s_d); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 65, __pyx_L1_error)
10151 __Pyx_GOTREF(__pyx_tuple__17);
10152 __Pyx_GIVEREF(__pyx_tuple__17);
10153 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_repr, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 65, __pyx_L1_error)
10443 __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ename, __pyx_n_s_d); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 65, __pyx_L1_error)
10444 __Pyx_GOTREF(__pyx_tuple__21);
10445 __Pyx_GIVEREF(__pyx_tuple__21);
10446 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_repr, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 65, __pyx_L1_error)
1015410447
1015510448 /* "pygame_sdl2/event.pyx":79
1015610449 *
1015910452 * return self.__dict__
1016010453 *
1016110454 */
10162 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 79, __pyx_L1_error)
10163 __Pyx_GOTREF(__pyx_tuple__19);
10164 __Pyx_GIVEREF(__pyx_tuple__19);
10165 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_dict, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 79, __pyx_L1_error)
10455 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 79, __pyx_L1_error)
10456 __Pyx_GOTREF(__pyx_tuple__23);
10457 __Pyx_GIVEREF(__pyx_tuple__23);
10458 __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_dict, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 79, __pyx_L1_error)
1016610459
1016710460 /* "pygame_sdl2/event.pyx":83
1016810461 *
1017110464 * return self._type
1017210465 *
1017310466 */
10174 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 83, __pyx_L1_error)
10175 __Pyx_GOTREF(__pyx_tuple__21);
10176 __Pyx_GIVEREF(__pyx_tuple__21);
10177 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_type, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 83, __pyx_L1_error)
10467 __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 83, __pyx_L1_error)
10468 __Pyx_GOTREF(__pyx_tuple__25);
10469 __Pyx_GIVEREF(__pyx_tuple__25);
10470 __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_type, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 83, __pyx_L1_error)
1017810471
1017910472 /* "pygame_sdl2/event.pyx":86
1018010473 * return self._type
1018310476 * return self.__dict__ == other.__dict__
1018410477 *
1018510478 */
10186 __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 86, __pyx_L1_error)
10187 __Pyx_GOTREF(__pyx_tuple__23);
10188 __Pyx_GIVEREF(__pyx_tuple__23);
10189 __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_eq, 86, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 86, __pyx_L1_error)
10479 __pyx_tuple__27 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 86, __pyx_L1_error)
10480 __Pyx_GOTREF(__pyx_tuple__27);
10481 __Pyx_GIVEREF(__pyx_tuple__27);
10482 __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_eq, 86, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 86, __pyx_L1_error)
1019010483
1019110484 /* "pygame_sdl2/event.pyx":89
1019210485 * return self.__dict__ == other.__dict__
1019510488 * return not (self == other)
1019610489 *
1019710490 */
10198 __pyx_tuple__25 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 89, __pyx_L1_error)
10199 __Pyx_GOTREF(__pyx_tuple__25);
10200 __Pyx_GIVEREF(__pyx_tuple__25);
10201 __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_ne, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 89, __pyx_L1_error)
10491 __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 89, __pyx_L1_error)
10492 __Pyx_GOTREF(__pyx_tuple__29);
10493 __Pyx_GIVEREF(__pyx_tuple__29);
10494 __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_ne, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 89, __pyx_L1_error)
1020210495
1020310496 /* "pygame_sdl2/event.pyx":92
1020410497 * return not (self == other)
1020710500 * return self.type != 0
1020810501 *
1020910502 */
10210 __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 92, __pyx_L1_error)
10211 __Pyx_GOTREF(__pyx_tuple__27);
10212 __Pyx_GIVEREF(__pyx_tuple__27);
10213 __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_nonzero, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 92, __pyx_L1_error)
10503 __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 92, __pyx_L1_error)
10504 __Pyx_GOTREF(__pyx_tuple__31);
10505 __Pyx_GIVEREF(__pyx_tuple__31);
10506 __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_nonzero, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 92, __pyx_L1_error)
1021410507
1021510508 /* "pygame_sdl2/event.pyx":275
1021610509 *
1021910512 *
1022010513 *
1022110514 */
10222 __pyx_tuple__29 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 275, __pyx_L1_error)
10223 __Pyx_GOTREF(__pyx_tuple__29);
10224 __Pyx_GIVEREF(__pyx_tuple__29);
10515 __pyx_tuple__33 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 275, __pyx_L1_error)
10516 __Pyx_GOTREF(__pyx_tuple__33);
10517 __Pyx_GIVEREF(__pyx_tuple__33);
1022510518
1022610519 /* "pygame_sdl2/event.pyx":333
1022710520 *
1023010523 * with lock:
1023110524 * poll_sdl()
1023210525 */
10233 __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_pump, 333, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 333, __pyx_L1_error)
10526 __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_pump, 333, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 333, __pyx_L1_error)
1023410527
1023510528 /* "pygame_sdl2/event.pyx":338
1023610529 *
1023910532 *
1024010533 * global event_queue
1024110534 */
10242 __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_t, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 338, __pyx_L1_error)
10243 __Pyx_GOTREF(__pyx_tuple__31);
10244 __Pyx_GIVEREF(__pyx_tuple__31);
10245 __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_get, 338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 338, __pyx_L1_error)
10535 __pyx_tuple__35 = PyTuple_Pack(2, __pyx_n_s_t, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 338, __pyx_L1_error)
10536 __Pyx_GOTREF(__pyx_tuple__35);
10537 __Pyx_GIVEREF(__pyx_tuple__35);
10538 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_get, 338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 338, __pyx_L1_error)
1024610539
1024710540 /* "pygame_sdl2/event.pyx":358
1024810541 *
1025110544 *
1025210545 * with lock:
1025310546 */
10254 __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_poll, 358, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 358, __pyx_L1_error)
10547 __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_poll, 358, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 358, __pyx_L1_error)
1025510548
1025610549 /* "pygame_sdl2/event.pyx":369
1025710550 *
1026010553 *
1026110554 * cdef SDL_Event evt
1026210555 */
10263 __pyx_tuple__34 = PyTuple_Pack(2, __pyx_n_s_evt, __pyx_n_s_result); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 369, __pyx_L1_error)
10264 __Pyx_GOTREF(__pyx_tuple__34);
10265 __Pyx_GIVEREF(__pyx_tuple__34);
10266 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_wait, 369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 369, __pyx_L1_error)
10267
10268 /* "pygame_sdl2/event.pyx":389
10269 *
10270 *
10271 * def peek(t=None): # <<<<<<<<<<<<<<
10272 *
10273 * with lock:
10274 */
10275 __pyx_tuple__36 = PyTuple_Pack(1, __pyx_n_s_t); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 389, __pyx_L1_error)
10276 __Pyx_GOTREF(__pyx_tuple__36);
10277 __Pyx_GIVEREF(__pyx_tuple__36);
10278 __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_peek, 389, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 389, __pyx_L1_error)
10279
10280 /* "pygame_sdl2/event.pyx":402
10281 *
10282 *
10283 * def clear(t=None): # <<<<<<<<<<<<<<
10284 *
10285 * # Clear is implemented in terms of get.
10286 */
10287 __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_t); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 402, __pyx_L1_error)
10556 __pyx_tuple__38 = PyTuple_Pack(2, __pyx_n_s_evt, __pyx_n_s_result); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 369, __pyx_L1_error)
1028810557 __Pyx_GOTREF(__pyx_tuple__38);
1028910558 __Pyx_GIVEREF(__pyx_tuple__38);
10290 __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_clear, 402, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 402, __pyx_L1_error)
10559 __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_wait, 369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 369, __pyx_L1_error)
10560
10561 /* "pygame_sdl2/event.pyx":389
10562 *
10563 *
10564 * def peek(t=None): # <<<<<<<<<<<<<<
10565 *
10566 * with lock:
10567 */
10568 __pyx_tuple__40 = PyTuple_Pack(1, __pyx_n_s_t); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 389, __pyx_L1_error)
10569 __Pyx_GOTREF(__pyx_tuple__40);
10570 __Pyx_GIVEREF(__pyx_tuple__40);
10571 __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_peek, 389, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 389, __pyx_L1_error)
10572
10573 /* "pygame_sdl2/event.pyx":402
10574 *
10575 *
10576 * def clear(t=None): # <<<<<<<<<<<<<<
10577 *
10578 * # Clear is implemented in terms of get.
10579 */
10580 __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_t); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 402, __pyx_L1_error)
10581 __Pyx_GOTREF(__pyx_tuple__42);
10582 __Pyx_GIVEREF(__pyx_tuple__42);
10583 __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_clear, 402, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 402, __pyx_L1_error)
1029110584
1029210585 /* "pygame_sdl2/event.pyx":407
1029310586 * get(t)
1029610589 * """
1029710590 * Returns a list of standard events that pygame_sdl2 knows about.
1029810591 */
10299 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_get_standard_events, 407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 407, __pyx_L1_error)
10592 __pyx_tuple__44 = PyTuple_Pack(1, __pyx_n_s_i); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 407, __pyx_L1_error)
10593 __Pyx_GOTREF(__pyx_tuple__44);
10594 __Pyx_GIVEREF(__pyx_tuple__44);
10595 __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_get_standard_events, 407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 407, __pyx_L1_error)
1030010596
1030110597 /* "pygame_sdl2/event.pyx":414
1030210598 * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ]
1030510601 * try:
1030610602 * return event_names[t]
1030710603 */
10308 __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_t); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 414, __pyx_L1_error)
10309 __Pyx_GOTREF(__pyx_tuple__41);
10310 __Pyx_GIVEREF(__pyx_tuple__41);
10311 __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_event_name, 414, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 414, __pyx_L1_error)
10604 __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_s_t); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 414, __pyx_L1_error)
10605 __Pyx_GOTREF(__pyx_tuple__46);
10606 __Pyx_GIVEREF(__pyx_tuple__46);
10607 __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_event_name, 414, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 414, __pyx_L1_error)
1031210608
1031310609 /* "pygame_sdl2/event.pyx":420
1031410610 * return "UNKNOWN"
1031710613 * if t == None:
1031810614 * for et in event_names.keys():
1031910615 */
10320 __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_t, __pyx_n_s_et); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 420, __pyx_L1_error)
10321 __Pyx_GOTREF(__pyx_tuple__43);
10322 __Pyx_GIVEREF(__pyx_tuple__43);
10323 __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_set_blocked, 420, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 420, __pyx_L1_error)
10616 __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_t, __pyx_n_s_et); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 420, __pyx_L1_error)
10617 __Pyx_GOTREF(__pyx_tuple__48);
10618 __Pyx_GIVEREF(__pyx_tuple__48);
10619 __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_set_blocked, 420, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 420, __pyx_L1_error)
1032410620
1032510621 /* "pygame_sdl2/event.pyx":430
1032610622 * SDL_EventState(et, SDL_IGNORE)
1032910625 * if t == None:
1033010626 * for et in event_names.keys():
1033110627 */
10332 __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_t, __pyx_n_s_et); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 430, __pyx_L1_error)
10333 __Pyx_GOTREF(__pyx_tuple__45);
10334 __Pyx_GIVEREF(__pyx_tuple__45);
10335 __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_set_allowed, 430, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 430, __pyx_L1_error)
10628 __pyx_tuple__50 = PyTuple_Pack(2, __pyx_n_s_t, __pyx_n_s_et); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 430, __pyx_L1_error)
10629 __Pyx_GOTREF(__pyx_tuple__50);
10630 __Pyx_GIVEREF(__pyx_tuple__50);
10631 __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_set_allowed, 430, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 430, __pyx_L1_error)
1033610632
1033710633 /* "pygame_sdl2/event.pyx":440
1033810634 * SDL_EventState(et, SDL_ENABLE)
1034110637 * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE
1034210638 *
1034310639 */
10344 __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_t); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 440, __pyx_L1_error)
10345 __Pyx_GOTREF(__pyx_tuple__47);
10346 __Pyx_GIVEREF(__pyx_tuple__47);
10347 __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_get_blocked, 440, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 440, __pyx_L1_error)
10640 __pyx_tuple__52 = PyTuple_Pack(1, __pyx_n_s_t); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 440, __pyx_L1_error)
10641 __Pyx_GOTREF(__pyx_tuple__52);
10642 __Pyx_GIVEREF(__pyx_tuple__52);
10643 __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_get_blocked, 440, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 440, __pyx_L1_error)
1034810644
1034910645 /* "pygame_sdl2/event.pyx":443
1035010646 * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE
1035310649 * SDL_SetWindowGrab(main_window.window, on)
1035410650 *
1035510651 */
10356 __pyx_tuple__49 = PyTuple_Pack(1, __pyx_n_s_on); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 443, __pyx_L1_error)
10357 __Pyx_GOTREF(__pyx_tuple__49);
10358 __Pyx_GIVEREF(__pyx_tuple__49);
10359 __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_set_grab, 443, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 443, __pyx_L1_error)
10652 __pyx_tuple__54 = PyTuple_Pack(1, __pyx_n_s_on); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 443, __pyx_L1_error)
10653 __Pyx_GOTREF(__pyx_tuple__54);
10654 __Pyx_GIVEREF(__pyx_tuple__54);
10655 __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_set_grab, 443, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 443, __pyx_L1_error)
1036010656
1036110657 /* "pygame_sdl2/event.pyx":446
1036210658 * SDL_SetWindowGrab(main_window.window, on)
1036510661 * return SDL_GetWindowGrab(main_window.window)
1036610662 *
1036710663 */
10368 __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_get_grab, 446, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 446, __pyx_L1_error)
10664 __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_get_grab, 446, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 446, __pyx_L1_error)
1036910665
1037010666 /* "pygame_sdl2/event.pyx":449
1037110667 * return SDL_GetWindowGrab(main_window.window)
1037410670 * """
1037510671 * If true (the default), the mousewheel will generate events involving
1037610672 */
10377 __pyx_tuple__52 = PyTuple_Pack(1, __pyx_n_s_flag); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 449, __pyx_L1_error)
10378 __Pyx_GOTREF(__pyx_tuple__52);
10379 __Pyx_GIVEREF(__pyx_tuple__52);
10380 __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_set_mousewheel_buttons, 449, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 449, __pyx_L1_error)
10673 __pyx_tuple__57 = PyTuple_Pack(1, __pyx_n_s_flag); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 449, __pyx_L1_error)
10674 __Pyx_GOTREF(__pyx_tuple__57);
10675 __Pyx_GIVEREF(__pyx_tuple__57);
10676 __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_set_mousewheel_buttons, 449, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 449, __pyx_L1_error)
1038110677
1038210678 /* "pygame_sdl2/event.pyx":461
1038310679 * mousewheel_buttons = flag
1038610682 * """
1038710683 * Returns the value set by mousehweel buttons,.
1038810684 */
10389 __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_get_mousewheel_buttons, 461, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 461, __pyx_L1_error)
10685 __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_get_mousewheel_buttons, 461, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 461, __pyx_L1_error)
1039010686
1039110687 /* "pygame_sdl2/event.pyx":468
1039210688 * return mousewheel_buttons
1039510691 * """
1039610692 * Posts event object `e` to the event queue.
1039710693 */
10398 __pyx_tuple__55 = PyTuple_Pack(2, __pyx_n_s_e, __pyx_n_s_event); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 468, __pyx_L1_error)
10399 __Pyx_GOTREF(__pyx_tuple__55);
10400 __Pyx_GIVEREF(__pyx_tuple__55);
10401 __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_post, 468, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 468, __pyx_L1_error)
10694 __pyx_tuple__60 = PyTuple_Pack(2, __pyx_n_s_e, __pyx_n_s_event); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 468, __pyx_L1_error)
10695 __Pyx_GOTREF(__pyx_tuple__60);
10696 __Pyx_GIVEREF(__pyx_tuple__60);
10697 __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_post, 468, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 468, __pyx_L1_error)
1040210698
1040310699 /* "pygame_sdl2/event.pyx":488
1040410700 * SDL_PushEvent(&event)
1040710703 * """
1040810704 * Registers a unique event number and returns that number.
1040910705 */
10410 __pyx_tuple__57 = PyTuple_Pack(2, __pyx_n_s_name, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 488, __pyx_L1_error)
10411 __Pyx_GOTREF(__pyx_tuple__57);
10412 __Pyx_GIVEREF(__pyx_tuple__57);
10413 __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_register, 488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 488, __pyx_L1_error)
10706 __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_s_name, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 488, __pyx_L1_error)
10707 __Pyx_GOTREF(__pyx_tuple__62);
10708 __Pyx_GIVEREF(__pyx_tuple__62);
10709 __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_register, 488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 488, __pyx_L1_error)
1041410710
1041510711 /* "pygame_sdl2/event.pyx":502
1041610712 * return rv
1041910715 * """
1042010716 * Returns a copy of the event queue. The copy cannot be used for modifying
1042110717 */
10422 __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_copy_event_queue, 502, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 502, __pyx_L1_error)
10718 __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_copy_event_queue, 502, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 502, __pyx_L1_error)
1042310719
1042410720 /* "pygame_sdl2/event.pyx":511
1042510721 *
1042810724 * if not SDL_WasInit(SDL_INIT_EVENTS):
1042910725 *
1043010726 */
10431 __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_init_2, 511, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 511, __pyx_L1_error)
10727 __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_event_pyx, __pyx_n_s_init_2, 511, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 511, __pyx_L1_error)
1043210728 __Pyx_RefNannyFinishContext();
1043310729 return 0;
1043410730 __pyx_L1_error:;
1044810744 return -1;
1044910745 }
1045010746
10747 static int __Pyx_modinit_global_init_code(void); /*proto*/
10748 static int __Pyx_modinit_variable_export_code(void); /*proto*/
10749 static int __Pyx_modinit_function_export_code(void); /*proto*/
10750 static int __Pyx_modinit_type_init_code(void); /*proto*/
10751 static int __Pyx_modinit_type_import_code(void); /*proto*/
10752 static int __Pyx_modinit_variable_import_code(void); /*proto*/
10753 static int __Pyx_modinit_function_import_code(void); /*proto*/
10754
10755 static int __Pyx_modinit_global_init_code(void) {
10756 __Pyx_RefNannyDeclarations
10757 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
10758 /*--- Global init code ---*/
10759 event_queue = Py_None; Py_INCREF(Py_None);
10760 __Pyx_RefNannyFinishContext();
10761 return 0;
10762 }
10763
10764 static int __Pyx_modinit_variable_export_code(void) {
10765 __Pyx_RefNannyDeclarations
10766 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
10767 /*--- Variable export code ---*/
10768 __Pyx_RefNannyFinishContext();
10769 return 0;
10770 }
10771
10772 static int __Pyx_modinit_function_export_code(void) {
10773 __Pyx_RefNannyDeclarations
10774 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
10775 /*--- Function export code ---*/
10776 __Pyx_RefNannyFinishContext();
10777 return 0;
10778 }
10779
10780 static int __Pyx_modinit_type_init_code(void) {
10781 __Pyx_RefNannyDeclarations
10782 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
10783 /*--- Type init code ---*/
10784 __Pyx_RefNannyFinishContext();
10785 return 0;
10786 }
10787
10788 static int __Pyx_modinit_type_import_code(void) {
10789 __Pyx_RefNannyDeclarations
10790 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
10791 /*--- Type import code ---*/
10792 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
10793 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
10794 sizeof(PyTypeObject),
10795 #else
10796 sizeof(PyHeapTypeObject),
10797 #endif
10798 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(1, 9, __pyx_L1_error)
10799 __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error)
10800 __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error)
10801 __pyx_ptype_11pygame_sdl2_7display_Window = __Pyx_ImportType("pygame_sdl2.display", "Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7display_Window)) __PYX_ERR(3, 23, __pyx_L1_error)
10802 __Pyx_RefNannyFinishContext();
10803 return 0;
10804 __pyx_L1_error:;
10805 __Pyx_RefNannyFinishContext();
10806 return -1;
10807 }
10808
10809 static int __Pyx_modinit_variable_import_code(void) {
10810 __Pyx_RefNannyDeclarations
10811 PyObject *__pyx_t_1 = NULL;
10812 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
10813 /*--- Variable import code ---*/
10814 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.display"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
10815 if (__Pyx_ImportVoidPtr(__pyx_t_1, "main_window", (void **)&__pyx_vp_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10816 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10817 __Pyx_RefNannyFinishContext();
10818 return 0;
10819 __pyx_L1_error:;
10820 __Pyx_XDECREF(__pyx_t_1);
10821 __Pyx_RefNannyFinishContext();
10822 return -1;
10823 }
10824
10825 static int __Pyx_modinit_function_import_code(void) {
10826 __Pyx_RefNannyDeclarations
10827 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
10828 /*--- Function import code ---*/
10829 __Pyx_RefNannyFinishContext();
10830 return 0;
10831 }
10832
10833
1045110834 #if PY_MAJOR_VERSION < 3
10452 PyMODINIT_FUNC initevent(void); /*proto*/
10453 PyMODINIT_FUNC initevent(void)
10835 #ifdef CYTHON_NO_PYINIT_EXPORT
10836 #define __Pyx_PyMODINIT_FUNC void
1045410837 #else
10455 PyMODINIT_FUNC PyInit_event(void); /*proto*/
10456 PyMODINIT_FUNC PyInit_event(void)
10838 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
10839 #endif
10840 #else
10841 #ifdef CYTHON_NO_PYINIT_EXPORT
10842 #define __Pyx_PyMODINIT_FUNC PyObject *
10843 #else
10844 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
10845 #endif
10846 #endif
10847 #ifndef CYTHON_SMALL_CODE
10848 #if defined(__clang__)
10849 #define CYTHON_SMALL_CODE
10850 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
10851 #define CYTHON_SMALL_CODE __attribute__((cold))
10852 #else
10853 #define CYTHON_SMALL_CODE
10854 #endif
10855 #endif
10856
10857
10858 #if PY_MAJOR_VERSION < 3
10859 __Pyx_PyMODINIT_FUNC initevent(void) CYTHON_SMALL_CODE; /*proto*/
10860 __Pyx_PyMODINIT_FUNC initevent(void)
10861 #else
10862 __Pyx_PyMODINIT_FUNC PyInit_event(void) CYTHON_SMALL_CODE; /*proto*/
10863 __Pyx_PyMODINIT_FUNC PyInit_event(void)
10864 #if CYTHON_PEP489_MULTI_PHASE_INIT
10865 {
10866 return PyModuleDef_Init(&__pyx_moduledef);
10867 }
10868 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
10869 PyObject *value = PyObject_GetAttrString(spec, from_name);
10870 int result = 0;
10871 if (likely(value)) {
10872 result = PyDict_SetItemString(moddict, to_name, value);
10873 Py_DECREF(value);
10874 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
10875 PyErr_Clear();
10876 } else {
10877 result = -1;
10878 }
10879 return result;
10880 }
10881 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
10882 PyObject *module = NULL, *moddict, *modname;
10883 if (__pyx_m)
10884 return __Pyx_NewRef(__pyx_m);
10885 modname = PyObject_GetAttrString(spec, "name");
10886 if (unlikely(!modname)) goto bad;
10887 module = PyModule_NewObject(modname);
10888 Py_DECREF(modname);
10889 if (unlikely(!module)) goto bad;
10890 moddict = PyModule_GetDict(module);
10891 if (unlikely(!moddict)) goto bad;
10892 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
10893 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
10894 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
10895 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
10896 return module;
10897 bad:
10898 Py_XDECREF(module);
10899 return NULL;
10900 }
10901
10902
10903 static int __pyx_pymod_exec_event(PyObject *__pyx_pyinit_module)
10904 #endif
1045710905 #endif
1045810906 {
1045910907 PyObject *__pyx_t_1 = NULL;
1046010908 PyObject *__pyx_t_2 = NULL;
10461 PyObject *__pyx_t_3 = NULL;
10462 int __pyx_t_4;
10909 int __pyx_t_3;
10910 PyObject *__pyx_t_4 = NULL;
1046310911 PyObject *__pyx_t_5 = NULL;
10464 PyObject *__pyx_t_6 = NULL;
10465 PyObject *__pyx_t_7 = NULL;
1046610912 __Pyx_RefNannyDeclarations
10913 #if CYTHON_PEP489_MULTI_PHASE_INIT
10914 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
10915 #elif PY_MAJOR_VERSION >= 3
10916 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
10917 #endif
1046710918 #if CYTHON_REFNANNY
10468 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
10469 if (!__Pyx_RefNanny) {
10470 PyErr_Clear();
10471 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
10472 if (!__Pyx_RefNanny)
10473 Py_FatalError("failed to import 'refnanny' module");
10474 }
10475 #endif
10476 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_event(void)", 0);
10919 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
10920 if (!__Pyx_RefNanny) {
10921 PyErr_Clear();
10922 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
10923 if (!__Pyx_RefNanny)
10924 Py_FatalError("failed to import 'refnanny' module");
10925 }
10926 #endif
10927 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_event(void)", 0);
1047710928 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1047810929 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
1047910930 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
1049010941 #ifdef __Pyx_Generator_USED
1049110942 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1049210943 #endif
10944 #ifdef __Pyx_AsyncGen_USED
10945 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10946 #endif
1049310947 #ifdef __Pyx_StopAsyncIteration_USED
1049410948 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1049510949 #endif
1050110955 #endif
1050210956 #endif
1050310957 /*--- Module creation code ---*/
10958 #if CYTHON_PEP489_MULTI_PHASE_INIT
10959 __pyx_m = __pyx_pyinit_module;
10960 Py_INCREF(__pyx_m);
10961 #else
1050410962 #if PY_MAJOR_VERSION < 3
1050510963 __pyx_m = Py_InitModule4("event", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
1050610964 #else
1050710965 __pyx_m = PyModule_Create(&__pyx_moduledef);
1050810966 #endif
1050910967 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
10968 #endif
1051010969 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
1051110970 Py_INCREF(__pyx_d);
1051210971 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
10972 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
1051310973 #if CYTHON_COMPILING_IN_PYPY
1051410974 Py_INCREF(__pyx_b);
1051510975 #endif
1053410994 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1053510995 /*--- Constants init code ---*/
1053610996 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10537 /*--- Global init code ---*/
10538 event_queue = Py_None; Py_INCREF(Py_None);
10539 /*--- Variable export code ---*/
10540 /*--- Function export code ---*/
10541 /*--- Type init code ---*/
10542 /*--- Type import code ---*/
10543 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
10544 #if CYTHON_COMPILING_IN_PYPY
10545 sizeof(PyTypeObject),
10546 #else
10547 sizeof(PyHeapTypeObject),
10548 #endif
10549 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(1, 9, __pyx_L1_error)
10550 __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error)
10551 __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error)
10552 __pyx_ptype_11pygame_sdl2_7display_Window = __Pyx_ImportType("pygame_sdl2.display", "Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7display_Window)) __PYX_ERR(3, 23, __pyx_L1_error)
10553 /*--- Variable import code ---*/
10554 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.display"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
10555 if (__Pyx_ImportVoidPtr(__pyx_t_1, "main_window", (void **)&__pyx_vp_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10556 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10557 /*--- Function import code ---*/
10997 /*--- Global type/function init code ---*/
10998 (void)__Pyx_modinit_global_init_code();
10999 (void)__Pyx_modinit_variable_export_code();
11000 (void)__Pyx_modinit_function_export_code();
11001 (void)__Pyx_modinit_type_init_code();
11002 if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
11003 if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error;
11004 (void)__Pyx_modinit_function_import_code();
1055811005 /*--- Execution code ---*/
1055911006 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
1056011007 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1056711014 * import pygame_sdl2
1056811015 * import sys
1056911016 */
10570 __pyx_t_2 = __Pyx_Import(__pyx_n_s_threading, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
10571 __Pyx_GOTREF(__pyx_t_2);
10572 if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
10573 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11017 __pyx_t_1 = __Pyx_Import(__pyx_n_s_threading, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
11018 __Pyx_GOTREF(__pyx_t_1);
11019 if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_1) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
11020 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1057411021
1057511022 /* "pygame_sdl2/event.pyx":25
1057611023 * from pygame_sdl2.display cimport Window, main_window
1057911026 * import sys
1058011027 *
1058111028 */
10582 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
10583 __Pyx_GOTREF(__pyx_t_2);
10584 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
10585 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11029 __pyx_t_1 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
11030 __Pyx_GOTREF(__pyx_t_1);
11031 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
11032 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1058611033
1058711034 /* "pygame_sdl2/event.pyx":26
1058811035 * import threading
1059111038 *
1059211039 * if sys.version_info[0] >= 3:
1059311040 */
10594 __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
10595 __Pyx_GOTREF(__pyx_t_2);
10596 if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
10597 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11041 __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
11042 __Pyx_GOTREF(__pyx_t_1);
11043 if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
11044 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1059811045
1059911046 /* "pygame_sdl2/event.pyx":28
1060011047 * import sys
1060311050 * unichr = chr
1060411051 *
1060511052 */
10606 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
11053 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
11054 __Pyx_GOTREF(__pyx_t_1);
11055 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
1060711056 __Pyx_GOTREF(__pyx_t_2);
10608 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
10609 __Pyx_GOTREF(__pyx_t_3);
11057 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11058 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
11059 __Pyx_GOTREF(__pyx_t_1);
1061011060 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10611 __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
10612 __Pyx_GOTREF(__pyx_t_2);
10613 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10614 __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
11061 __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
11062 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11063 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 28, __pyx_L1_error)
1061511064 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10616 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 28, __pyx_L1_error)
10617 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10618 if (__pyx_t_4) {
11065 if (__pyx_t_3) {
1061911066
1062011067 /* "pygame_sdl2/event.pyx":29
1062111068 *
1064211089 * SDL_QUIT : 'QUIT',
1064311090 * SDL_APP_TERMINATING : 'APP_TERMINATING',
1064411091 */
10645 __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error)
10646 __Pyx_GOTREF(__pyx_t_3);
10647 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FIRSTEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 5, __pyx_L1_error)
11092 __pyx_t_2 = __Pyx_PyDict_NewPresized(42); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 5, __pyx_L1_error)
1064811093 __Pyx_GOTREF(__pyx_t_2);
10649 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_NOEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10650 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11094 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_FIRSTEVENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 5, __pyx_L1_error)
11095 __Pyx_GOTREF(__pyx_t_1);
11096 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_NOEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11097 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1065111098
1065211099 /* "include/event_names.pxi":6
1065311100 * event_names = {
1065611103 * SDL_APP_TERMINATING : 'APP_TERMINATING',
1065711104 * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY',
1065811105 */
10659 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_QUIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 6, __pyx_L1_error)
10660 __Pyx_GOTREF(__pyx_t_2);
10661 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_QUIT) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10662 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11106 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_QUIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 6, __pyx_L1_error)
11107 __Pyx_GOTREF(__pyx_t_1);
11108 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_QUIT) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11109 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1066311110
1066411111 /* "include/event_names.pxi":7
1066511112 * SDL_FIRSTEVENT : u'NOEVENT',
1066811115 * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY',
1066911116 * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND',
1067011117 */
10671 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_TERMINATING); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 7, __pyx_L1_error)
10672 __Pyx_GOTREF(__pyx_t_2);
10673 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_APP_TERMINATING) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10674 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11118 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_TERMINATING); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 7, __pyx_L1_error)
11119 __Pyx_GOTREF(__pyx_t_1);
11120 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_APP_TERMINATING) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11121 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1067511122
1067611123 /* "include/event_names.pxi":8
1067711124 * SDL_QUIT : 'QUIT',
1068011127 * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND',
1068111128 * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND',
1068211129 */
10683 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_LOWMEMORY); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 8, __pyx_L1_error)
10684 __Pyx_GOTREF(__pyx_t_2);
10685 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_APP_LOWMEMORY) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10686 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11130 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_LOWMEMORY); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 8, __pyx_L1_error)
11131 __Pyx_GOTREF(__pyx_t_1);
11132 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_APP_LOWMEMORY) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11133 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1068711134
1068811135 /* "include/event_names.pxi":9
1068911136 * SDL_APP_TERMINATING : 'APP_TERMINATING',
1069211139 * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND',
1069311140 * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND',
1069411141 */
10695 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_WILLENTERBACKGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 9, __pyx_L1_error)
10696 __Pyx_GOTREF(__pyx_t_2);
10697 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_APP_WILLENTERBACKGROUND) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10698 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11142 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_WILLENTERBACKGROUND); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
11143 __Pyx_GOTREF(__pyx_t_1);
11144 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_APP_WILLENTERBACKGROUND) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11145 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1069911146
1070011147 /* "include/event_names.pxi":10
1070111148 * SDL_APP_LOWMEMORY : 'APP_LOWMEMORY',
1070411151 * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND',
1070511152 * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND',
1070611153 */
10707 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_DIDENTERBACKGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 10, __pyx_L1_error)
10708 __Pyx_GOTREF(__pyx_t_2);
10709 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_APP_DIDENTERBACKGROUND) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10710 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11154 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_DIDENTERBACKGROUND); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 10, __pyx_L1_error)
11155 __Pyx_GOTREF(__pyx_t_1);
11156 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_APP_DIDENTERBACKGROUND) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11157 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1071111158
1071211159 /* "include/event_names.pxi":11
1071311160 * SDL_APP_WILLENTERBACKGROUND : 'APP_WILLENTERBACKGROUND',
1071611163 * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND',
1071711164 * SDL_WINDOWEVENT : 'WINDOWEVENT',
1071811165 */
10719 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_WILLENTERFOREGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 11, __pyx_L1_error)
10720 __Pyx_GOTREF(__pyx_t_2);
10721 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_APP_WILLENTERFOREGROUND) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10722 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11166 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_WILLENTERFOREGROUND); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 11, __pyx_L1_error)
11167 __Pyx_GOTREF(__pyx_t_1);
11168 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_APP_WILLENTERFOREGROUND) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11169 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1072311170
1072411171 /* "include/event_names.pxi":12
1072511172 * SDL_APP_DIDENTERBACKGROUND : 'APP_DIDENTERBACKGROUND',
1072811175 * SDL_WINDOWEVENT : 'WINDOWEVENT',
1072911176 * SDL_SYSWMEVENT : 'SYSWMEVENT',
1073011177 */
10731 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_DIDENTERFOREGROUND); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 12, __pyx_L1_error)
10732 __Pyx_GOTREF(__pyx_t_2);
10733 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_APP_DIDENTERFOREGROUND) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10734 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11178 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_APP_DIDENTERFOREGROUND); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
11179 __Pyx_GOTREF(__pyx_t_1);
11180 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_APP_DIDENTERFOREGROUND) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11181 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1073511182
1073611183 /* "include/event_names.pxi":13
1073711184 * SDL_APP_WILLENTERFOREGROUND : 'APP_WILLENTERFOREGROUND',
1074011187 * SDL_SYSWMEVENT : 'SYSWMEVENT',
1074111188 * SDL_KEYDOWN : 'KEYDOWN',
1074211189 */
10743 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_WINDOWEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 13, __pyx_L1_error)
10744 __Pyx_GOTREF(__pyx_t_2);
10745 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_WINDOWEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10746 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11190 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_WINDOWEVENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 13, __pyx_L1_error)
11191 __Pyx_GOTREF(__pyx_t_1);
11192 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_WINDOWEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11193 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1074711194
1074811195 /* "include/event_names.pxi":14
1074911196 * SDL_APP_DIDENTERFOREGROUND : 'APP_DIDENTERFOREGROUND',
1075211199 * SDL_KEYDOWN : 'KEYDOWN',
1075311200 * SDL_KEYUP : 'KEYUP',
1075411201 */
10755 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_SYSWMEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 14, __pyx_L1_error)
10756 __Pyx_GOTREF(__pyx_t_2);
10757 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_SYSWMEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10758 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11202 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_SYSWMEVENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 14, __pyx_L1_error)
11203 __Pyx_GOTREF(__pyx_t_1);
11204 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_SYSWMEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11205 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1075911206
1076011207 /* "include/event_names.pxi":15
1076111208 * SDL_WINDOWEVENT : 'WINDOWEVENT',
1076411211 * SDL_KEYUP : 'KEYUP',
1076511212 * SDL_TEXTEDITING : 'TEXTEDITING',
1076611213 */
10767 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 15, __pyx_L1_error)
10768 __Pyx_GOTREF(__pyx_t_2);
10769 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_KEYDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10770 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11214 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYDOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 15, __pyx_L1_error)
11215 __Pyx_GOTREF(__pyx_t_1);
11216 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_KEYDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11217 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1077111218
1077211219 /* "include/event_names.pxi":16
1077311220 * SDL_SYSWMEVENT : 'SYSWMEVENT',
1077611223 * SDL_TEXTEDITING : 'TEXTEDITING',
1077711224 * SDL_TEXTINPUT : 'TEXTINPUT',
1077811225 */
10779 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 16, __pyx_L1_error)
10780 __Pyx_GOTREF(__pyx_t_2);
10781 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_KEYUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10782 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11226 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_KEYUP); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 16, __pyx_L1_error)
11227 __Pyx_GOTREF(__pyx_t_1);
11228 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_KEYUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11229 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1078311230
1078411231 /* "include/event_names.pxi":17
1078511232 * SDL_KEYDOWN : 'KEYDOWN',
1078811235 * SDL_TEXTINPUT : 'TEXTINPUT',
1078911236 * SDL_MOUSEMOTION : 'MOUSEMOTION',
1079011237 */
10791 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_TEXTEDITING); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 17, __pyx_L1_error)
10792 __Pyx_GOTREF(__pyx_t_2);
10793 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_TEXTEDITING) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10794 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11238 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_TEXTEDITING); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 17, __pyx_L1_error)
11239 __Pyx_GOTREF(__pyx_t_1);
11240 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_TEXTEDITING) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11241 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1079511242
1079611243 /* "include/event_names.pxi":18
1079711244 * SDL_KEYUP : 'KEYUP',
1080011247 * SDL_MOUSEMOTION : 'MOUSEMOTION',
1080111248 * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN',
1080211249 */
10803 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_TEXTINPUT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 18, __pyx_L1_error)
10804 __Pyx_GOTREF(__pyx_t_2);
10805 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_TEXTINPUT) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10806 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11250 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_TEXTINPUT); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 18, __pyx_L1_error)
11251 __Pyx_GOTREF(__pyx_t_1);
11252 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_TEXTINPUT) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11253 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1080711254
1080811255 /* "include/event_names.pxi":19
1080911256 * SDL_TEXTEDITING : 'TEXTEDITING',
1081211259 * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN',
1081311260 * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP',
1081411261 */
10815 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 19, __pyx_L1_error)
10816 __Pyx_GOTREF(__pyx_t_2);
10817 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_MOUSEMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10818 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11262 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEMOTION); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 19, __pyx_L1_error)
11263 __Pyx_GOTREF(__pyx_t_1);
11264 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_MOUSEMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11265 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1081911266
1082011267 /* "include/event_names.pxi":20
1082111268 * SDL_TEXTINPUT : 'TEXTINPUT',
1082411271 * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP',
1082511272 * SDL_MOUSEWHEEL : 'MOUSEWHEEL',
1082611273 */
10827 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 20, __pyx_L1_error)
10828 __Pyx_GOTREF(__pyx_t_2);
10829 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_MOUSEBUTTONDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10830 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11274 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONDOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 20, __pyx_L1_error)
11275 __Pyx_GOTREF(__pyx_t_1);
11276 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_MOUSEBUTTONDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11277 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1083111278
1083211279 /* "include/event_names.pxi":21
1083311280 * SDL_MOUSEMOTION : 'MOUSEMOTION',
1083611283 * SDL_MOUSEWHEEL : 'MOUSEWHEEL',
1083711284 * SDL_JOYAXISMOTION : 'JOYAXISMOTION',
1083811285 */
10839 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 21, __pyx_L1_error)
10840 __Pyx_GOTREF(__pyx_t_2);
10841 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_MOUSEBUTTONUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10842 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11286 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEBUTTONUP); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 21, __pyx_L1_error)
11287 __Pyx_GOTREF(__pyx_t_1);
11288 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_MOUSEBUTTONUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11289 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1084311290
1084411291 /* "include/event_names.pxi":22
1084511292 * SDL_MOUSEBUTTONDOWN : 'MOUSEBUTTONDOWN',
1084811295 * SDL_JOYAXISMOTION : 'JOYAXISMOTION',
1084911296 * SDL_JOYBALLMOTION : 'JOYBALLMOTION',
1085011297 */
10851 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEWHEEL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 22, __pyx_L1_error)
10852 __Pyx_GOTREF(__pyx_t_2);
10853 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_MOUSEWHEEL) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10854 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11298 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_MOUSEWHEEL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 22, __pyx_L1_error)
11299 __Pyx_GOTREF(__pyx_t_1);
11300 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_MOUSEWHEEL) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11301 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1085511302
1085611303 /* "include/event_names.pxi":23
1085711304 * SDL_MOUSEBUTTONUP : 'MOUSEBUTTONUP',
1086011307 * SDL_JOYBALLMOTION : 'JOYBALLMOTION',
1086111308 * SDL_JOYHATMOTION : 'JOYHATMOTION',
1086211309 */
10863 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYAXISMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 23, __pyx_L1_error)
10864 __Pyx_GOTREF(__pyx_t_2);
10865 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_JOYAXISMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10866 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11310 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYAXISMOTION); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 23, __pyx_L1_error)
11311 __Pyx_GOTREF(__pyx_t_1);
11312 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_JOYAXISMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11313 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1086711314
1086811315 /* "include/event_names.pxi":24
1086911316 * SDL_MOUSEWHEEL : 'MOUSEWHEEL',
1087211319 * SDL_JOYHATMOTION : 'JOYHATMOTION',
1087311320 * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN',
1087411321 */
10875 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBALLMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 24, __pyx_L1_error)
10876 __Pyx_GOTREF(__pyx_t_2);
10877 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_JOYBALLMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10878 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11322 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBALLMOTION); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 24, __pyx_L1_error)
11323 __Pyx_GOTREF(__pyx_t_1);
11324 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_JOYBALLMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11325 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1087911326
1088011327 /* "include/event_names.pxi":25
1088111328 * SDL_JOYAXISMOTION : 'JOYAXISMOTION',
1088411331 * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN',
1088511332 * SDL_JOYBUTTONUP : 'JOYBUTTONUP',
1088611333 */
10887 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYHATMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 25, __pyx_L1_error)
10888 __Pyx_GOTREF(__pyx_t_2);
10889 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_JOYHATMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10890 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11334 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYHATMOTION); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 25, __pyx_L1_error)
11335 __Pyx_GOTREF(__pyx_t_1);
11336 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_JOYHATMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11337 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1089111338
1089211339 /* "include/event_names.pxi":26
1089311340 * SDL_JOYBALLMOTION : 'JOYBALLMOTION',
1089611343 * SDL_JOYBUTTONUP : 'JOYBUTTONUP',
1089711344 * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED',
1089811345 */
10899 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBUTTONDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 26, __pyx_L1_error)
10900 __Pyx_GOTREF(__pyx_t_2);
10901 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_JOYBUTTONDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10902 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11346 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBUTTONDOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 26, __pyx_L1_error)
11347 __Pyx_GOTREF(__pyx_t_1);
11348 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_JOYBUTTONDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11349 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1090311350
1090411351 /* "include/event_names.pxi":27
1090511352 * SDL_JOYHATMOTION : 'JOYHATMOTION',
1090811355 * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED',
1090911356 * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED',
1091011357 */
10911 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBUTTONUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 27, __pyx_L1_error)
10912 __Pyx_GOTREF(__pyx_t_2);
10913 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_JOYBUTTONUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10914 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11358 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYBUTTONUP); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 27, __pyx_L1_error)
11359 __Pyx_GOTREF(__pyx_t_1);
11360 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_JOYBUTTONUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11361 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1091511362
1091611363 /* "include/event_names.pxi":28
1091711364 * SDL_JOYBUTTONDOWN : 'JOYBUTTONDOWN',
1092011367 * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED',
1092111368 * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION',
1092211369 */
10923 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYDEVICEADDED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 28, __pyx_L1_error)
10924 __Pyx_GOTREF(__pyx_t_2);
10925 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_JOYDEVICEADDED) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10926 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11370 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYDEVICEADDED); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 28, __pyx_L1_error)
11371 __Pyx_GOTREF(__pyx_t_1);
11372 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_JOYDEVICEADDED) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11373 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1092711374
1092811375 /* "include/event_names.pxi":29
1092911376 * SDL_JOYBUTTONUP : 'JOYBUTTONUP',
1093211379 * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION',
1093311380 * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN',
1093411381 */
10935 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYDEVICEREMOVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 29, __pyx_L1_error)
10936 __Pyx_GOTREF(__pyx_t_2);
10937 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_JOYDEVICEREMOVED) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10938 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11382 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_JOYDEVICEREMOVED); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 29, __pyx_L1_error)
11383 __Pyx_GOTREF(__pyx_t_1);
11384 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_JOYDEVICEREMOVED) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11385 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1093911386
1094011387 /* "include/event_names.pxi":30
1094111388 * SDL_JOYDEVICEADDED : 'JOYDEVICEADDED',
1094411391 * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN',
1094511392 * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP',
1094611393 */
10947 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERAXISMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 30, __pyx_L1_error)
10948 __Pyx_GOTREF(__pyx_t_2);
10949 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_CONTROLLERAXISMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10950 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11394 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERAXISMOTION); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 30, __pyx_L1_error)
11395 __Pyx_GOTREF(__pyx_t_1);
11396 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_CONTROLLERAXISMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11397 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1095111398
1095211399 /* "include/event_names.pxi":31
1095311400 * SDL_JOYDEVICEREMOVED : 'JOYDEVICEREMOVED',
1095611403 * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP',
1095711404 * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED',
1095811405 */
10959 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERBUTTONDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 31, __pyx_L1_error)
10960 __Pyx_GOTREF(__pyx_t_2);
10961 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_CONTROLLERBUTTONDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10962 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11406 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERBUTTONDOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 31, __pyx_L1_error)
11407 __Pyx_GOTREF(__pyx_t_1);
11408 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_CONTROLLERBUTTONDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11409 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1096311410
1096411411 /* "include/event_names.pxi":32
1096511412 * SDL_CONTROLLERAXISMOTION : 'CONTROLLERAXISMOTION',
1096811415 * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED',
1096911416 * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED',
1097011417 */
10971 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERBUTTONUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 32, __pyx_L1_error)
10972 __Pyx_GOTREF(__pyx_t_2);
10973 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_CONTROLLERBUTTONUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10974 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11418 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERBUTTONUP); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 32, __pyx_L1_error)
11419 __Pyx_GOTREF(__pyx_t_1);
11420 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_CONTROLLERBUTTONUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11421 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1097511422
1097611423 /* "include/event_names.pxi":33
1097711424 * SDL_CONTROLLERBUTTONDOWN : 'CONTROLLERBUTTONDOWN',
1098011427 * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED',
1098111428 * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED',
1098211429 */
10983 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEADDED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 33, __pyx_L1_error)
10984 __Pyx_GOTREF(__pyx_t_2);
10985 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_CONTROLLERDEVICEADDED) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10986 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11430 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEADDED); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 33, __pyx_L1_error)
11431 __Pyx_GOTREF(__pyx_t_1);
11432 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_CONTROLLERDEVICEADDED) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11433 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1098711434
1098811435 /* "include/event_names.pxi":34
1098911436 * SDL_CONTROLLERBUTTONUP : 'CONTROLLERBUTTONUP',
1099211439 * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED',
1099311440 * SDL_FINGERDOWN : 'FINGERDOWN',
1099411441 */
10995 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEREMOVED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 34, __pyx_L1_error)
10996 __Pyx_GOTREF(__pyx_t_2);
10997 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_CONTROLLERDEVICEREMOVED) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
10998 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11442 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEREMOVED); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 34, __pyx_L1_error)
11443 __Pyx_GOTREF(__pyx_t_1);
11444 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_CONTROLLERDEVICEREMOVED) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11445 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1099911446
1100011447 /* "include/event_names.pxi":35
1100111448 * SDL_CONTROLLERDEVICEADDED : 'CONTROLLERDEVICEADDED',
1100411451 * SDL_FINGERDOWN : 'FINGERDOWN',
1100511452 * SDL_FINGERUP : 'FINGERUP',
1100611453 */
11007 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEREMAPPED); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 35, __pyx_L1_error)
11008 __Pyx_GOTREF(__pyx_t_2);
11009 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_CONTROLLERDEVICEREMAPPED) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11010 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11454 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_CONTROLLERDEVICEREMAPPED); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 35, __pyx_L1_error)
11455 __Pyx_GOTREF(__pyx_t_1);
11456 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_CONTROLLERDEVICEREMAPPED) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11457 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1101111458
1101211459 /* "include/event_names.pxi":36
1101311460 * SDL_CONTROLLERDEVICEREMOVED : 'CONTROLLERDEVICEREMOVED',
1101611463 * SDL_FINGERUP : 'FINGERUP',
1101711464 * SDL_FINGERMOTION : 'FINGERMOTION',
1101811465 */
11019 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERDOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 36, __pyx_L1_error)
11020 __Pyx_GOTREF(__pyx_t_2);
11021 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_FINGERDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11022 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11466 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERDOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 36, __pyx_L1_error)
11467 __Pyx_GOTREF(__pyx_t_1);
11468 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_FINGERDOWN) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11469 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1102311470
1102411471 /* "include/event_names.pxi":37
1102511472 * SDL_CONTROLLERDEVICEREMAPPED : 'CONTROLLERDEVICEREMAPPED',
1102811475 * SDL_FINGERMOTION : 'FINGERMOTION',
1102911476 * SDL_DOLLARGESTURE : 'DOLLARGESTURE',
1103011477 */
11031 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERUP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 37, __pyx_L1_error)
11032 __Pyx_GOTREF(__pyx_t_2);
11033 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_FINGERUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11034 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11478 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERUP); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 37, __pyx_L1_error)
11479 __Pyx_GOTREF(__pyx_t_1);
11480 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_FINGERUP) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11481 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1103511482
1103611483 /* "include/event_names.pxi":38
1103711484 * SDL_FINGERDOWN : 'FINGERDOWN',
1104011487 * SDL_DOLLARGESTURE : 'DOLLARGESTURE',
1104111488 * SDL_DOLLARRECORD : 'DOLLARRECORD',
1104211489 */
11043 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERMOTION); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 38, __pyx_L1_error)
11044 __Pyx_GOTREF(__pyx_t_2);
11045 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_FINGERMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11046 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11490 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_FINGERMOTION); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 38, __pyx_L1_error)
11491 __Pyx_GOTREF(__pyx_t_1);
11492 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_FINGERMOTION) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11493 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1104711494
1104811495 /* "include/event_names.pxi":39
1104911496 * SDL_FINGERUP : 'FINGERUP',
1105211499 * SDL_DOLLARRECORD : 'DOLLARRECORD',
1105311500 * SDL_MULTIGESTURE : 'MULTIGESTURE',
1105411501 */
11055 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DOLLARGESTURE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 39, __pyx_L1_error)
11056 __Pyx_GOTREF(__pyx_t_2);
11057 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_DOLLARGESTURE) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11058 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11502 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_DOLLARGESTURE); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 39, __pyx_L1_error)
11503 __Pyx_GOTREF(__pyx_t_1);
11504 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_DOLLARGESTURE) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11505 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1105911506
1106011507 /* "include/event_names.pxi":40
1106111508 * SDL_FINGERMOTION : 'FINGERMOTION',
1106411511 * SDL_MULTIGESTURE : 'MULTIGESTURE',
1106511512 * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE',
1106611513 */
11067 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DOLLARRECORD); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 40, __pyx_L1_error)
11068 __Pyx_GOTREF(__pyx_t_2);
11069 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_DOLLARRECORD) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11070 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11514 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_DOLLARRECORD); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 40, __pyx_L1_error)
11515 __Pyx_GOTREF(__pyx_t_1);
11516 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_DOLLARRECORD) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11517 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1107111518
1107211519 /* "include/event_names.pxi":41
1107311520 * SDL_DOLLARGESTURE : 'DOLLARGESTURE',
1107611523 * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE',
1107711524 * SDL_DROPFILE : 'DROPFILE',
1107811525 */
11079 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_MULTIGESTURE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 41, __pyx_L1_error)
11080 __Pyx_GOTREF(__pyx_t_2);
11081 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_MULTIGESTURE) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11082 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11526 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_MULTIGESTURE); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 41, __pyx_L1_error)
11527 __Pyx_GOTREF(__pyx_t_1);
11528 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_MULTIGESTURE) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11529 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1108311530
1108411531 /* "include/event_names.pxi":42
1108511532 * SDL_DOLLARRECORD : 'DOLLARRECORD',
1108811535 * SDL_DROPFILE : 'DROPFILE',
1108911536 * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET',
1109011537 */
11091 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_CLIPBOARDUPDATE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 42, __pyx_L1_error)
11092 __Pyx_GOTREF(__pyx_t_2);
11093 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_CLIPBOARDUPDATE) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11094 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11538 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_CLIPBOARDUPDATE); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 42, __pyx_L1_error)
11539 __Pyx_GOTREF(__pyx_t_1);
11540 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_CLIPBOARDUPDATE) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11541 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1109511542
1109611543 /* "include/event_names.pxi":43
1109711544 * SDL_MULTIGESTURE : 'MULTIGESTURE',
1110011547 * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET',
1110111548 * SDL_USEREVENT : 'USEREVENT',
1110211549 */
11103 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPFILE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 43, __pyx_L1_error)
11104 __Pyx_GOTREF(__pyx_t_2);
11105 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_DROPFILE) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11106 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11550 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_DROPFILE); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 43, __pyx_L1_error)
11551 __Pyx_GOTREF(__pyx_t_1);
11552 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_DROPFILE) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11553 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1110711554
1110811555 /* "include/event_names.pxi":44
1110911556 * SDL_CLIPBOARDUPDATE : 'CLIPBOARDUPDATE',
1111211559 * SDL_USEREVENT : 'USEREVENT',
1111311560 * SDL_LASTEVENT : 'LASTEVENT',
1111411561 */
11115 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_RENDER_TARGETS_RESET); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 44, __pyx_L1_error)
11116 __Pyx_GOTREF(__pyx_t_2);
11117 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_RENDER_TARGETS_RESET) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11118 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11562 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_RENDER_TARGETS_RESET); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 44, __pyx_L1_error)
11563 __Pyx_GOTREF(__pyx_t_1);
11564 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_RENDER_TARGETS_RESET) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11565 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1111911566
1112011567 /* "include/event_names.pxi":45
1112111568 * SDL_DROPFILE : 'DROPFILE',
1112411571 * SDL_LASTEVENT : 'LASTEVENT',
1112511572 * }
1112611573 */
11127 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 45, __pyx_L1_error)
11128 __Pyx_GOTREF(__pyx_t_2);
11129 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_USEREVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11130 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11574 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_USEREVENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 45, __pyx_L1_error)
11575 __Pyx_GOTREF(__pyx_t_1);
11576 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_USEREVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11577 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1113111578
1113211579 /* "include/event_names.pxi":46
1113311580 * SDL_RENDER_TARGETS_RESET : 'RENDER_TARGETS_RESET',
1113511582 * SDL_LASTEVENT : 'LASTEVENT', # <<<<<<<<<<<<<<
1113611583 * }
1113711584 */
11138 __pyx_t_2 = __Pyx_PyInt_From_SDL_EventType(SDL_LASTEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 46, __pyx_L1_error)
11139 __Pyx_GOTREF(__pyx_t_2);
11140 if (PyDict_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_LASTEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11585 __pyx_t_1 = __Pyx_PyInt_From_SDL_EventType(SDL_LASTEVENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 46, __pyx_L1_error)
11586 __Pyx_GOTREF(__pyx_t_1);
11587 if (PyDict_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_LASTEVENT) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
11588 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11589 if (PyDict_SetItem(__pyx_d, __pyx_n_s_event_names, __pyx_t_2) < 0) __PYX_ERR(4, 4, __pyx_L1_error)
1114111590 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11142 if (PyDict_SetItem(__pyx_d, __pyx_n_s_event_names, __pyx_t_3) < 0) __PYX_ERR(4, 4, __pyx_L1_error)
11143 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1114411591
1114511592 /* "pygame_sdl2/event.pyx":34
1114611593 *
1114911596 * VIDEORESIZE = SDL_LASTEVENT - 2
1115011597 * VIDEOEXPOSE = SDL_LASTEVENT - 3
1115111598 */
11152 __pyx_t_3 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error)
11153 __Pyx_GOTREF(__pyx_t_3);
11154 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACTIVEEVENT, __pyx_t_3) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
11155 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11599 __pyx_t_2 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
11600 __Pyx_GOTREF(__pyx_t_2);
11601 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACTIVEEVENT, __pyx_t_2) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
11602 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1115611603
1115711604 /* "pygame_sdl2/event.pyx":35
1115811605 * # Add events to emulate SDL 1.2. These also need to be added in locals.
1116111608 * VIDEOEXPOSE = SDL_LASTEVENT - 3
1116211609 *
1116311610 */
11164 __pyx_t_3 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error)
11165 __Pyx_GOTREF(__pyx_t_3);
11166 if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEORESIZE, __pyx_t_3) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
11167 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11611 __pyx_t_2 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
11612 __Pyx_GOTREF(__pyx_t_2);
11613 if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEORESIZE, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
11614 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1116811615
1116911616 /* "pygame_sdl2/event.pyx":36
1117011617 * ACTIVEEVENT = SDL_LASTEVENT - 1
1117311620 *
1117411621 * event_names[ACTIVEEVENT] = "ACTIVEEVENT"
1117511622 */
11176 __pyx_t_3 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error)
11177 __Pyx_GOTREF(__pyx_t_3);
11178 if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEOEXPOSE, __pyx_t_3) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
11179 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11623 __pyx_t_2 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
11624 __Pyx_GOTREF(__pyx_t_2);
11625 if (PyDict_SetItem(__pyx_d, __pyx_n_s_VIDEOEXPOSE, __pyx_t_2) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
11626 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1118011627
1118111628 /* "pygame_sdl2/event.pyx":38
1118211629 * VIDEOEXPOSE = SDL_LASTEVENT - 3
1118511632 * event_names[VIDEORESIZE] = "VIDEORESIZE"
1118611633 * event_names[VIDEOEXPOSE] = "VIDEOEXPOSE"
1118711634 */
11188 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error)
11189 __Pyx_GOTREF(__pyx_t_3);
11190 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error)
11635 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error)
1119111636 __Pyx_GOTREF(__pyx_t_2);
11192 if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_ACTIVEEVENT) < 0)) __PYX_ERR(0, 38, __pyx_L1_error)
11193 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11637 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ACTIVEEVENT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
11638 __Pyx_GOTREF(__pyx_t_1);
11639 if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_ACTIVEEVENT) < 0)) __PYX_ERR(0, 38, __pyx_L1_error)
1119411640 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11641 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1119511642
1119611643 /* "pygame_sdl2/event.pyx":39
1119711644 *
1120011647 * event_names[VIDEOEXPOSE] = "VIDEOEXPOSE"
1120111648 *
1120211649 */
11203 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
11650 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
11651 __Pyx_GOTREF(__pyx_t_1);
11652 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEORESIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
1120411653 __Pyx_GOTREF(__pyx_t_2);
11205 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEORESIZE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error)
11206 __Pyx_GOTREF(__pyx_t_3);
11207 if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_3, __pyx_n_u_VIDEORESIZE) < 0)) __PYX_ERR(0, 39, __pyx_L1_error)
11654 if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_t_2, __pyx_n_u_VIDEORESIZE) < 0)) __PYX_ERR(0, 39, __pyx_L1_error)
11655 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1120811656 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11209 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1121011657
1121111658 /* "pygame_sdl2/event.pyx":40
1121211659 * event_names[ACTIVEEVENT] = "ACTIVEEVENT"
1121511662 *
1121611663 * # This is used for events posted to the event queue. This won't be returned
1121711664 */
11218 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error)
11219 __Pyx_GOTREF(__pyx_t_3);
11220 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEOEXPOSE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
11665 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_event_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
1122111666 __Pyx_GOTREF(__pyx_t_2);
11222 if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_t_2, __pyx_n_u_VIDEOEXPOSE) < 0)) __PYX_ERR(0, 40, __pyx_L1_error)
11223 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11667 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_VIDEOEXPOSE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
11668 __Pyx_GOTREF(__pyx_t_1);
11669 if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_1, __pyx_n_u_VIDEOEXPOSE) < 0)) __PYX_ERR(0, 40, __pyx_L1_error)
1122411670 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11671 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1122511672
1122611673 /* "pygame_sdl2/event.pyx":46
1122711674 * # giving the type.
1123911686 *
1124011687 * # If true, the mousewheel is mapped to buttons 4 and 5. Otherwise, a
1124111688 */
11242 __pyx_t_2 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
11243 __Pyx_GOTREF(__pyx_t_2);
11244 if (PyDict_SetItem(__pyx_d, __pyx_n_s_USEREVENT_MAX, __pyx_t_2) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
11245 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11689 __pyx_t_1 = __Pyx_PyInt_From_long((SDL_LASTEVENT - 5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
11690 __Pyx_GOTREF(__pyx_t_1);
11691 if (PyDict_SetItem(__pyx_d, __pyx_n_s_USEREVENT_MAX, __pyx_t_1) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
11692 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1124611693
1124711694 /* "pygame_sdl2/event.pyx":53
1124811695 * # If true, the mousewheel is mapped to buttons 4 and 5. Otherwise, a
1126011707 *
1126111708 * def __init__(self, type, dict=None, **kwargs):
1126211709 */
11263 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
11710 __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
11711 __Pyx_GOTREF(__pyx_t_1);
11712 __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_tuple__17, __pyx_n_s_EventType, __pyx_n_s_EventType, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_event, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
1126411713 __Pyx_GOTREF(__pyx_t_2);
11265 __Pyx_INCREF(__pyx_builtin_object);
11266 __Pyx_GIVEREF(__pyx_builtin_object);
11267 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object);
11268 __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error)
11269 __Pyx_GOTREF(__pyx_t_3);
11270 __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_EventType, __pyx_n_s_EventType, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_event, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 55, __pyx_L1_error)
11271 __Pyx_GOTREF(__pyx_t_5);
1127211714
1127311715 /* "pygame_sdl2/event.pyx":57
1127411716 * class EventType(object):
1127711719 * self._type = type
1127811720 *
1127911721 */
11280 __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_1__init__, 0, __pyx_n_s_EventType___init, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 57, __pyx_L1_error)
11281 __Pyx_GOTREF(__pyx_t_6);
11282 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_tuple__16);
11283 if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_6) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
11284 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11722 __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_1__init__, 0, __pyx_n_s_EventType___init, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error)
11723 __Pyx_GOTREF(__pyx_t_4);
11724 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__20);
11725 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
11726 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1128511727
1128611728 /* "pygame_sdl2/event.pyx":65
1128711729 * self.__dict__.update(kwargs)
1129011732 * if SDL_USEREVENT <= self.type < VIDEOEXPOSE:
1129111733 * ename = "UserEvent%d" % (self.type - SDL_USEREVENT)
1129211734 */
11293 __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_3__repr__, 0, __pyx_n_s_EventType___repr, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 65, __pyx_L1_error)
11294 __Pyx_GOTREF(__pyx_t_6);
11295 if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_repr, __pyx_t_6) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
11296 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11735 __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_3__repr__, 0, __pyx_n_s_EventType___repr, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error)
11736 __Pyx_GOTREF(__pyx_t_4);
11737 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr, __pyx_t_4) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
11738 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1129711739
1129811740 /* "pygame_sdl2/event.pyx":79
1129911741 *
1130211744 * return self.__dict__
1130311745 *
1130411746 */
11305 __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_5dict, 0, __pyx_n_s_EventType_dict, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 79, __pyx_L1_error)
11306 __Pyx_GOTREF(__pyx_t_6);
11747 __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_5dict, 0, __pyx_n_s_EventType_dict, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error)
11748 __Pyx_GOTREF(__pyx_t_4);
1130711749
1130811750 /* "pygame_sdl2/event.pyx":78
1130911751 * return '<Event(%d-%s %s)>' % (self.type, ename, d)
1131211754 * def dict(self):
1131311755 * return self.__dict__
1131411756 */
11315 __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error)
11316 __Pyx_GOTREF(__pyx_t_7);
11317 __Pyx_GIVEREF(__pyx_t_6);
11318 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
11319 __pyx_t_6 = 0;
11320 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 78, __pyx_L1_error)
11321 __Pyx_GOTREF(__pyx_t_6);
11322 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11323 if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_dict, __pyx_t_6) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
11324 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11757 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
11758 __Pyx_GOTREF(__pyx_t_5);
11759 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11760 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_dict, __pyx_t_5) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
11761 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1132511762
1132611763 /* "pygame_sdl2/event.pyx":83
1132711764 *
1133011767 * return self._type
1133111768 *
1133211769 */
11333 __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_7type, 0, __pyx_n_s_EventType_type, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 83, __pyx_L1_error)
11334 __Pyx_GOTREF(__pyx_t_6);
11770 __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_7type, 0, __pyx_n_s_EventType_type, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error)
11771 __Pyx_GOTREF(__pyx_t_5);
1133511772
1133611773 /* "pygame_sdl2/event.pyx":82
1133711774 * return self.__dict__
1134011777 * def type(self):
1134111778 * return self._type
1134211779 */
11343 __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 82, __pyx_L1_error)
11344 __Pyx_GOTREF(__pyx_t_7);
11345 __Pyx_GIVEREF(__pyx_t_6);
11346 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
11347 __pyx_t_6 = 0;
11348 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 82, __pyx_L1_error)
11349 __Pyx_GOTREF(__pyx_t_6);
11350 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11351 if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_type, __pyx_t_6) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
11352 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11780 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error)
11781 __Pyx_GOTREF(__pyx_t_4);
11782 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11783 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_type, __pyx_t_4) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
11784 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1135311785
1135411786 /* "pygame_sdl2/event.pyx":86
1135511787 * return self._type
1135811790 * return self.__dict__ == other.__dict__
1135911791 *
1136011792 */
11361 __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_9__eq__, 0, __pyx_n_s_EventType___eq, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 86, __pyx_L1_error)
11362 __Pyx_GOTREF(__pyx_t_6);
11363 if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_eq, __pyx_t_6) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
11364 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11793 __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_9__eq__, 0, __pyx_n_s_EventType___eq, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
11794 __Pyx_GOTREF(__pyx_t_4);
11795 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_eq, __pyx_t_4) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
11796 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1136511797
1136611798 /* "pygame_sdl2/event.pyx":89
1136711799 * return self.__dict__ == other.__dict__
1137011802 * return not (self == other)
1137111803 *
1137211804 */
11373 __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_11__ne__, 0, __pyx_n_s_EventType___ne, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error)
11374 __Pyx_GOTREF(__pyx_t_6);
11375 if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_ne, __pyx_t_6) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
11376 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11805 __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_11__ne__, 0, __pyx_n_s_EventType___ne, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error)
11806 __Pyx_GOTREF(__pyx_t_4);
11807 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_ne, __pyx_t_4) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
11808 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1137711809
1137811810 /* "pygame_sdl2/event.pyx":92
1137911811 * return not (self == other)
1138211814 * return self.type != 0
1138311815 *
1138411816 */
11385 __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_13__nonzero__, 0, __pyx_n_s_EventType___nonzero, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 92, __pyx_L1_error)
11386 __Pyx_GOTREF(__pyx_t_6);
11387 if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_nonzero, __pyx_t_6) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
11388 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11817 __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9EventType_13__nonzero__, 0, __pyx_n_s_EventType___nonzero, NULL, __pyx_n_s_pygame_sdl2_event, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
11818 __Pyx_GOTREF(__pyx_t_4);
11819 if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_nonzero, __pyx_t_4) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
11820 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1138911821
1139011822 /* "pygame_sdl2/event.pyx":55
1139111823 * cdef bint mousewheel_buttons = 1
1139411826 *
1139511827 * def __init__(self, type, dict=None, **kwargs):
1139611828 */
11397 __pyx_t_6 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_EventType, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 55, __pyx_L1_error)
11398 __Pyx_GOTREF(__pyx_t_6);
11399 if (PyDict_SetItem(__pyx_d, __pyx_n_s_EventType, __pyx_t_6) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
11400 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11401 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11402 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11829 __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_EventType, __pyx_tuple__17, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error)
11830 __Pyx_GOTREF(__pyx_t_4);
11831 if (PyDict_SetItem(__pyx_d, __pyx_n_s_EventType, __pyx_t_4) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
11832 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1140311833 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11834 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1140411835
1140511836 /* "pygame_sdl2/event.pyx":95
1140611837 * return self.type != 0
1140911840 *
1141011841 * cdef get_textinput():
1141111842 */
11412 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error)
11413 __Pyx_GOTREF(__pyx_t_2);
11414 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Event, __pyx_t_2) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
11415 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11843 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
11844 __Pyx_GOTREF(__pyx_t_1);
11845 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Event_2, __pyx_t_1) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
11846 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1141611847
1141711848 /* "pygame_sdl2/event.pyx":269
1141811849 *
1142111852 *
1142211853 * # The lock that protects the event queue.
1142311854 */
11424 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error)
11425 __Pyx_GOTREF(__pyx_t_2);
11855 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
11856 __Pyx_GOTREF(__pyx_t_1);
1142611857 __Pyx_XGOTREF(event_queue);
11427 __Pyx_DECREF_SET(event_queue, __pyx_t_2);
11428 __Pyx_GIVEREF(__pyx_t_2);
11429 __pyx_t_2 = 0;
11858 __Pyx_DECREF_SET(event_queue, __pyx_t_1);
11859 __Pyx_GIVEREF(__pyx_t_1);
11860 __pyx_t_1 = 0;
1143011861
1143111862 /* "pygame_sdl2/event.pyx":272
1143211863 *
1143511866 *
1143611867 * # This is the object that is returned when no event exists.
1143711868 */
11438 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
11439 __Pyx_GOTREF(__pyx_t_3);
11440 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RLock); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error)
11441 __Pyx_GOTREF(__pyx_t_5);
11442 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11443 __pyx_t_3 = NULL;
11444 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
11445 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
11446 if (likely(__pyx_t_3)) {
11447 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
11448 __Pyx_INCREF(__pyx_t_3);
11449 __Pyx_INCREF(function);
11450 __Pyx_DECREF_SET(__pyx_t_5, function);
11451 }
11452 }
11453 if (__pyx_t_3) {
11454 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
11455 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11456 } else {
11457 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
11458 }
11869 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
11870 __Pyx_GOTREF(__pyx_t_1);
11871 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_RLock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
1145911872 __Pyx_GOTREF(__pyx_t_2);
11460 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11461 if (PyDict_SetItem(__pyx_d, __pyx_n_s_lock, __pyx_t_2) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
11873 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11874 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
11875 __Pyx_GOTREF(__pyx_t_1);
1146211876 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11877 if (PyDict_SetItem(__pyx_d, __pyx_n_s_lock, __pyx_t_1) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
11878 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1146311879
1146411880 /* "pygame_sdl2/event.pyx":275
1146511881 *
1146811884 *
1146911885 *
1147011886 */
11471 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error)
11887 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EventType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error)
11888 __Pyx_GOTREF(__pyx_t_1);
11889 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 275, __pyx_L1_error)
1147211890 __Pyx_GOTREF(__pyx_t_2);
11473 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 275, __pyx_L1_error)
11474 __Pyx_GOTREF(__pyx_t_5);
11891 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11892 if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOEVENT_EVENT, __pyx_t_2) < 0) __PYX_ERR(0, 275, __pyx_L1_error)
1147511893 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11476 if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOEVENT_EVENT, __pyx_t_5) < 0) __PYX_ERR(0, 275, __pyx_L1_error)
11477 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1147811894
1147911895 /* "pygame_sdl2/event.pyx":333
1148011896 *
1148311899 * with lock:
1148411900 * poll_sdl()
1148511901 */
11486 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_1pump, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 333, __pyx_L1_error)
11487 __Pyx_GOTREF(__pyx_t_5);
11488 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pump, __pyx_t_5) < 0) __PYX_ERR(0, 333, __pyx_L1_error)
11489 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11902 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_1pump, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error)
11903 __Pyx_GOTREF(__pyx_t_2);
11904 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pump, __pyx_t_2) < 0) __PYX_ERR(0, 333, __pyx_L1_error)
11905 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1149011906
1149111907 /* "pygame_sdl2/event.pyx":338
1149211908 *
1149511911 *
1149611912 * global event_queue
1149711913 */
11498 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_3get, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 338, __pyx_L1_error)
11499 __Pyx_GOTREF(__pyx_t_5);
11500 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get, __pyx_t_5) < 0) __PYX_ERR(0, 338, __pyx_L1_error)
11501 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11914 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_3get, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error)
11915 __Pyx_GOTREF(__pyx_t_2);
11916 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(0, 338, __pyx_L1_error)
11917 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1150211918
1150311919 /* "pygame_sdl2/event.pyx":358
1150411920 *
1150711923 *
1150811924 * with lock:
1150911925 */
11510 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_5poll, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 358, __pyx_L1_error)
11511 __Pyx_GOTREF(__pyx_t_5);
11512 if (PyDict_SetItem(__pyx_d, __pyx_n_s_poll, __pyx_t_5) < 0) __PYX_ERR(0, 358, __pyx_L1_error)
11513 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11926 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_5poll, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error)
11927 __Pyx_GOTREF(__pyx_t_2);
11928 if (PyDict_SetItem(__pyx_d, __pyx_n_s_poll, __pyx_t_2) < 0) __PYX_ERR(0, 358, __pyx_L1_error)
11929 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1151411930
1151511931 /* "pygame_sdl2/event.pyx":369
1151611932 *
1151911935 *
1152011936 * cdef SDL_Event evt
1152111937 */
11522 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_7wait, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 369, __pyx_L1_error)
11523 __Pyx_GOTREF(__pyx_t_5);
11524 if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait, __pyx_t_5) < 0) __PYX_ERR(0, 369, __pyx_L1_error)
11525 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11938 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_7wait, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error)
11939 __Pyx_GOTREF(__pyx_t_2);
11940 if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait, __pyx_t_2) < 0) __PYX_ERR(0, 369, __pyx_L1_error)
11941 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1152611942
1152711943 /* "pygame_sdl2/event.pyx":389
1152811944 *
1153111947 *
1153211948 * with lock:
1153311949 */
11534 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9peek, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 389, __pyx_L1_error)
11535 __Pyx_GOTREF(__pyx_t_5);
11536 if (PyDict_SetItem(__pyx_d, __pyx_n_s_peek, __pyx_t_5) < 0) __PYX_ERR(0, 389, __pyx_L1_error)
11537 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11950 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_9peek, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
11951 __Pyx_GOTREF(__pyx_t_2);
11952 if (PyDict_SetItem(__pyx_d, __pyx_n_s_peek, __pyx_t_2) < 0) __PYX_ERR(0, 389, __pyx_L1_error)
11953 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1153811954
1153911955 /* "pygame_sdl2/event.pyx":402
1154011956 *
1154311959 *
1154411960 * # Clear is implemented in terms of get.
1154511961 */
11546 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_11clear, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
11547 __Pyx_GOTREF(__pyx_t_5);
11548 if (PyDict_SetItem(__pyx_d, __pyx_n_s_clear, __pyx_t_5) < 0) __PYX_ERR(0, 402, __pyx_L1_error)
11549 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11962 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_11clear, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
11963 __Pyx_GOTREF(__pyx_t_2);
11964 if (PyDict_SetItem(__pyx_d, __pyx_n_s_clear, __pyx_t_2) < 0) __PYX_ERR(0, 402, __pyx_L1_error)
11965 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1155011966
1155111967 /* "pygame_sdl2/event.pyx":407
1155211968 * get(t)
1155511971 * """
1155611972 * Returns a list of standard events that pygame_sdl2 knows about.
1155711973 */
11558 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_13get_standard_events, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __pyx_L1_error)
11559 __Pyx_GOTREF(__pyx_t_5);
11560 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_standard_events, __pyx_t_5) < 0) __PYX_ERR(0, 407, __pyx_L1_error)
11561 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11974 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_13get_standard_events, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error)
11975 __Pyx_GOTREF(__pyx_t_2);
11976 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_standard_events, __pyx_t_2) < 0) __PYX_ERR(0, 407, __pyx_L1_error)
11977 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1156211978
1156311979 /* "pygame_sdl2/event.pyx":414
1156411980 * return [ i for i in event_names.keys() if (i < SDL_USEREVENT) or (i > USEREVENT_MAX) ]
1156711983 * try:
1156811984 * return event_names[t]
1156911985 */
11570 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_15event_name, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 414, __pyx_L1_error)
11571 __Pyx_GOTREF(__pyx_t_5);
11572 if (PyDict_SetItem(__pyx_d, __pyx_n_s_event_name, __pyx_t_5) < 0) __PYX_ERR(0, 414, __pyx_L1_error)
11573 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11986 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_15event_name, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error)
11987 __Pyx_GOTREF(__pyx_t_2);
11988 if (PyDict_SetItem(__pyx_d, __pyx_n_s_event_name, __pyx_t_2) < 0) __PYX_ERR(0, 414, __pyx_L1_error)
11989 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1157411990
1157511991 /* "pygame_sdl2/event.pyx":420
1157611992 * return "UNKNOWN"
1157911995 * if t == None:
1158011996 * for et in event_names.keys():
1158111997 */
11582 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_17set_blocked, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 420, __pyx_L1_error)
11583 __Pyx_GOTREF(__pyx_t_5);
11584 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_blocked, __pyx_t_5) < 0) __PYX_ERR(0, 420, __pyx_L1_error)
11585 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11998 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_17set_blocked, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
11999 __Pyx_GOTREF(__pyx_t_2);
12000 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_blocked, __pyx_t_2) < 0) __PYX_ERR(0, 420, __pyx_L1_error)
12001 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1158612002
1158712003 /* "pygame_sdl2/event.pyx":430
1158812004 * SDL_EventState(et, SDL_IGNORE)
1159112007 * if t == None:
1159212008 * for et in event_names.keys():
1159312009 */
11594 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_19set_allowed, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error)
11595 __Pyx_GOTREF(__pyx_t_5);
11596 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_allowed, __pyx_t_5) < 0) __PYX_ERR(0, 430, __pyx_L1_error)
11597 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12010 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_19set_allowed, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error)
12011 __Pyx_GOTREF(__pyx_t_2);
12012 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_allowed, __pyx_t_2) < 0) __PYX_ERR(0, 430, __pyx_L1_error)
12013 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1159812014
1159912015 /* "pygame_sdl2/event.pyx":440
1160012016 * SDL_EventState(et, SDL_ENABLE)
1160312019 * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE
1160412020 *
1160512021 */
11606 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_21get_blocked, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 440, __pyx_L1_error)
11607 __Pyx_GOTREF(__pyx_t_5);
11608 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_blocked, __pyx_t_5) < 0) __PYX_ERR(0, 440, __pyx_L1_error)
11609 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12022 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_21get_blocked, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error)
12023 __Pyx_GOTREF(__pyx_t_2);
12024 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_blocked, __pyx_t_2) < 0) __PYX_ERR(0, 440, __pyx_L1_error)
12025 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1161012026
1161112027 /* "pygame_sdl2/event.pyx":443
1161212028 * return SDL_EventState(t, SDL_QUERY) == SDL_IGNORE
1161512031 * SDL_SetWindowGrab(main_window.window, on)
1161612032 *
1161712033 */
11618 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_23set_grab, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 443, __pyx_L1_error)
11619 __Pyx_GOTREF(__pyx_t_5);
11620 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_grab, __pyx_t_5) < 0) __PYX_ERR(0, 443, __pyx_L1_error)
11621 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12034 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_23set_grab, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error)
12035 __Pyx_GOTREF(__pyx_t_2);
12036 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_grab, __pyx_t_2) < 0) __PYX_ERR(0, 443, __pyx_L1_error)
12037 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1162212038
1162312039 /* "pygame_sdl2/event.pyx":446
1162412040 * SDL_SetWindowGrab(main_window.window, on)
1162712043 * return SDL_GetWindowGrab(main_window.window)
1162812044 *
1162912045 */
11630 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_25get_grab, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 446, __pyx_L1_error)
11631 __Pyx_GOTREF(__pyx_t_5);
11632 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_grab, __pyx_t_5) < 0) __PYX_ERR(0, 446, __pyx_L1_error)
11633 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12046 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_25get_grab, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error)
12047 __Pyx_GOTREF(__pyx_t_2);
12048 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_grab, __pyx_t_2) < 0) __PYX_ERR(0, 446, __pyx_L1_error)
12049 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1163412050
1163512051 /* "pygame_sdl2/event.pyx":449
1163612052 * return SDL_GetWindowGrab(main_window.window)
1163912055 * """
1164012056 * If true (the default), the mousewheel will generate events involving
1164112057 */
11642 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_27set_mousewheel_buttons, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error)
11643 __Pyx_GOTREF(__pyx_t_5);
11644 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mousewheel_buttons, __pyx_t_5) < 0) __PYX_ERR(0, 449, __pyx_L1_error)
11645 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12058 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_27set_mousewheel_buttons, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
12059 __Pyx_GOTREF(__pyx_t_2);
12060 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mousewheel_buttons, __pyx_t_2) < 0) __PYX_ERR(0, 449, __pyx_L1_error)
12061 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1164612062
1164712063 /* "pygame_sdl2/event.pyx":461
1164812064 * mousewheel_buttons = flag
1165112067 * """
1165212068 * Returns the value set by mousehweel buttons,.
1165312069 */
11654 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_29get_mousewheel_buttons, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 461, __pyx_L1_error)
11655 __Pyx_GOTREF(__pyx_t_5);
11656 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_mousewheel_buttons, __pyx_t_5) < 0) __PYX_ERR(0, 461, __pyx_L1_error)
11657 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12070 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_29get_mousewheel_buttons, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
12071 __Pyx_GOTREF(__pyx_t_2);
12072 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_mousewheel_buttons, __pyx_t_2) < 0) __PYX_ERR(0, 461, __pyx_L1_error)
12073 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1165812074
1165912075 /* "pygame_sdl2/event.pyx":468
1166012076 * return mousewheel_buttons
1166312079 * """
1166412080 * Posts event object `e` to the event queue.
1166512081 */
11666 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_31post, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error)
11667 __Pyx_GOTREF(__pyx_t_5);
11668 if (PyDict_SetItem(__pyx_d, __pyx_n_s_post, __pyx_t_5) < 0) __PYX_ERR(0, 468, __pyx_L1_error)
11669 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12082 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_31post, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error)
12083 __Pyx_GOTREF(__pyx_t_2);
12084 if (PyDict_SetItem(__pyx_d, __pyx_n_s_post, __pyx_t_2) < 0) __PYX_ERR(0, 468, __pyx_L1_error)
12085 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1167012086
1167112087 /* "pygame_sdl2/event.pyx":488
1167212088 * SDL_PushEvent(&event)
1167512091 * """
1167612092 * Registers a unique event number and returns that number.
1167712093 */
11678 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_33register, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 488, __pyx_L1_error)
11679 __Pyx_GOTREF(__pyx_t_5);
11680 if (PyDict_SetItem(__pyx_d, __pyx_n_s_register, __pyx_t_5) < 0) __PYX_ERR(0, 488, __pyx_L1_error)
11681 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12094 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_33register, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
12095 __Pyx_GOTREF(__pyx_t_2);
12096 if (PyDict_SetItem(__pyx_d, __pyx_n_s_register, __pyx_t_2) < 0) __PYX_ERR(0, 488, __pyx_L1_error)
12097 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1168212098
1168312099 /* "pygame_sdl2/event.pyx":502
1168412100 * return rv
1168712103 * """
1168812104 * Returns a copy of the event queue. The copy cannot be used for modifying
1168912105 */
11690 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_35copy_event_queue, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __pyx_L1_error)
11691 __Pyx_GOTREF(__pyx_t_5);
11692 if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy_event_queue, __pyx_t_5) < 0) __PYX_ERR(0, 502, __pyx_L1_error)
11693 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12106 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_35copy_event_queue, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error)
12107 __Pyx_GOTREF(__pyx_t_2);
12108 if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy_event_queue, __pyx_t_2) < 0) __PYX_ERR(0, 502, __pyx_L1_error)
12109 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1169412110
1169512111 /* "pygame_sdl2/event.pyx":511
1169612112 *
1169912115 * if not SDL_WasInit(SDL_INIT_EVENTS):
1170012116 *
1170112117 */
11702 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_37init, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 511, __pyx_L1_error)
11703 __Pyx_GOTREF(__pyx_t_5);
11704 if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_2, __pyx_t_5) < 0) __PYX_ERR(0, 511, __pyx_L1_error)
11705 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12118 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5event_37init, NULL, __pyx_n_s_pygame_sdl2_event); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __pyx_L1_error)
12119 __Pyx_GOTREF(__pyx_t_2);
12120 if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_2, __pyx_t_2) < 0) __PYX_ERR(0, 511, __pyx_L1_error)
12121 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1170612122
1170712123 /* "pygame_sdl2/event.pyx":1
1170812124 * # Copyright 2014 Patrick Dawson <pat@dw.is> # <<<<<<<<<<<<<<
1170912125 * # Copyright 2014 Tom Rothamel <tom@rothamel.us>
1171012126 * #
1171112127 */
11712 __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1, __pyx_L1_error)
11713 __Pyx_GOTREF(__pyx_t_5);
11714 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
11715 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12128 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
12129 __Pyx_GOTREF(__pyx_t_2);
12130 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12131 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1171612132
1171712133 /*--- Wrapped vars code ---*/
1171812134
1172012136 __pyx_L1_error:;
1172112137 __Pyx_XDECREF(__pyx_t_1);
1172212138 __Pyx_XDECREF(__pyx_t_2);
11723 __Pyx_XDECREF(__pyx_t_3);
12139 __Pyx_XDECREF(__pyx_t_4);
1172412140 __Pyx_XDECREF(__pyx_t_5);
11725 __Pyx_XDECREF(__pyx_t_6);
11726 __Pyx_XDECREF(__pyx_t_7);
1172712141 if (__pyx_m) {
1172812142 if (__pyx_d) {
11729 __Pyx_AddTraceback("init pygame_sdl2.event", __pyx_clineno, __pyx_lineno, __pyx_filename);
12143 __Pyx_AddTraceback("init pygame_sdl2.event", 0, __pyx_lineno, __pyx_filename);
1173012144 }
1173112145 Py_DECREF(__pyx_m); __pyx_m = 0;
1173212146 } else if (!PyErr_Occurred()) {
1173412148 }
1173512149 __pyx_L0:;
1173612150 __Pyx_RefNannyFinishContext();
11737 #if PY_MAJOR_VERSION < 3
12151 #if CYTHON_PEP489_MULTI_PHASE_INIT
12152 return (__pyx_m != NULL) ? 0 : -1;
12153 #elif PY_MAJOR_VERSION >= 3
12154 return __pyx_m;
12155 #else
1173812156 return;
11739 #else
11740 return __pyx_m;
1174112157 #endif
1174212158 }
1174312159
1175612172 Py_XDECREF(p);
1175712173 Py_XDECREF(m);
1175812174 return (__Pyx_RefNannyAPIStruct *)r;
12175 }
12176 #endif
12177
12178 /* PyObjectGetAttrStr */
12179 #if CYTHON_USE_TYPE_SLOTS
12180 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
12181 PyTypeObject* tp = Py_TYPE(obj);
12182 if (likely(tp->tp_getattro))
12183 return tp->tp_getattro(obj, attr_name);
12184 #if PY_MAJOR_VERSION < 3
12185 if (likely(tp->tp_getattr))
12186 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
12187 #endif
12188 return PyObject_GetAttr(obj, attr_name);
1175912189 }
1176012190 #endif
1176112191
1191512345 return -1;
1191612346 }
1191712347
12348 /* PyObjectSetAttrStr */
12349 #if CYTHON_USE_TYPE_SLOTS
12350 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
12351 PyTypeObject* tp = Py_TYPE(obj);
12352 if (likely(tp->tp_setattro))
12353 return tp->tp_setattro(obj, attr_name, value);
12354 #if PY_MAJOR_VERSION < 3
12355 if (likely(tp->tp_setattr))
12356 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
12357 #endif
12358 return PyObject_SetAttr(obj, attr_name, value);
12359 }
12360 #endif
12361
1191812362 /* PyCFunctionFastCall */
1191912363 #if CYTHON_FAST_PYCCALL
1192012364 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
1192112365 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
1192212366 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
1192312367 PyObject *self = PyCFunction_GET_SELF(func);
12368 int flags = PyCFunction_GET_FLAGS(func);
1192412369 assert(PyCFunction_Check(func));
11925 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
12370 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
1192612371 assert(nargs >= 0);
1192712372 assert(nargs == 0 || args != NULL);
1192812373 /* _PyCFunction_FastCallDict() must not be called with an exception set,
1192912374 because it may clear it (directly or indirectly) and so the
1193012375 caller loses its exception */
1193112376 assert(!PyErr_Occurred());
11932 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
11933 }
11934 #endif // CYTHON_FAST_PYCCALL
12377 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
12378 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
12379 } else {
12380 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
12381 }
12382 }
12383 #endif
1193512384
1193612385 /* PyFunctionFastCall */
1193712386 #if CYTHON_FAST_PYCALL
1193912388 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
1194012389 PyObject *globals) {
1194112390 PyFrameObject *f;
11942 PyThreadState *tstate = PyThreadState_GET();
12391 PyThreadState *tstate = __Pyx_PyThreadState_Current;
1194312392 PyObject **fastlocals;
1194412393 Py_ssize_t i;
1194512394 PyObject *result;
1205012499 Py_LeaveRecursiveCall();
1205112500 return result;
1205212501 }
12053 #endif // CPython < 3.6
12054 #endif // CYTHON_FAST_PYCALL
12502 #endif
12503 #endif
1205512504
1205612505 /* PyObjectCall */
1205712506 #if CYTHON_COMPILING_IN_CPYTHON
1211112560 return __Pyx_PyFunction_FastCall(func, &arg, 1);
1211212561 }
1211312562 #endif
12114 #ifdef __Pyx_CyFunction_USED
12115 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
12116 #else
1211712563 if (likely(PyCFunction_Check(func))) {
12118 #endif
1211912564 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
1212012565 return __Pyx_PyObject_CallMethO(func, arg);
1212112566 #if CYTHON_FAST_PYCCALL
1213812583 #endif
1213912584
1214012585 /* GetModuleGlobalName */
12141 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
12586 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
1214212587 PyObject *result;
1214312588 #if !CYTHON_AVOID_BORROWED_REFS
12589 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
12590 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
12591 if (likely(result)) {
12592 Py_INCREF(result);
12593 } else if (unlikely(PyErr_Occurred())) {
12594 result = NULL;
12595 } else {
12596 #else
1214412597 result = PyDict_GetItem(__pyx_d, name);
1214512598 if (likely(result)) {
1214612599 Py_INCREF(result);
1214712600 } else {
12601 #endif
1214812602 #else
1214912603 result = PyObject_GetItem(__pyx_d, name);
1215012604 if (!result) {
1215512609 return result;
1215612610 }
1215712611
12612 /* GetItemInt */
12613 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
12614 PyObject *r;
12615 if (!j) return NULL;
12616 r = PyObject_GetItem(o, j);
12617 Py_DECREF(j);
12618 return r;
12619 }
12620 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
12621 CYTHON_NCP_UNUSED int wraparound,
12622 CYTHON_NCP_UNUSED int boundscheck) {
12623 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12624 Py_ssize_t wrapped_i = i;
12625 if (wraparound & unlikely(i < 0)) {
12626 wrapped_i += PyList_GET_SIZE(o);
12627 }
12628 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
12629 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
12630 Py_INCREF(r);
12631 return r;
12632 }
12633 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
12634 #else
12635 return PySequence_GetItem(o, i);
12636 #endif
12637 }
12638 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
12639 CYTHON_NCP_UNUSED int wraparound,
12640 CYTHON_NCP_UNUSED int boundscheck) {
12641 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12642 Py_ssize_t wrapped_i = i;
12643 if (wraparound & unlikely(i < 0)) {
12644 wrapped_i += PyTuple_GET_SIZE(o);
12645 }
12646 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
12647 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
12648 Py_INCREF(r);
12649 return r;
12650 }
12651 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
12652 #else
12653 return PySequence_GetItem(o, i);
12654 #endif
12655 }
12656 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
12657 CYTHON_NCP_UNUSED int wraparound,
12658 CYTHON_NCP_UNUSED int boundscheck) {
12659 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
12660 if (is_list || PyList_CheckExact(o)) {
12661 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
12662 if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
12663 PyObject *r = PyList_GET_ITEM(o, n);
12664 Py_INCREF(r);
12665 return r;
12666 }
12667 }
12668 else if (PyTuple_CheckExact(o)) {
12669 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
12670 if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
12671 PyObject *r = PyTuple_GET_ITEM(o, n);
12672 Py_INCREF(r);
12673 return r;
12674 }
12675 } else {
12676 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
12677 if (likely(m && m->sq_item)) {
12678 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
12679 Py_ssize_t l = m->sq_length(o);
12680 if (likely(l >= 0)) {
12681 i += l;
12682 } else {
12683 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
12684 return NULL;
12685 PyErr_Clear();
12686 }
12687 }
12688 return m->sq_item(o, i);
12689 }
12690 }
12691 #else
12692 if (is_list || PySequence_Check(o)) {
12693 return PySequence_GetItem(o, i);
12694 }
12695 #endif
12696 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
12697 }
12698
12699 /* ObjectGetItem */
12700 #if CYTHON_USE_TYPE_SLOTS
12701 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
12702 PyObject *runerr;
12703 Py_ssize_t key_value;
12704 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
12705 if (unlikely(!(m && m->sq_item))) {
12706 PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
12707 return NULL;
12708 }
12709 key_value = __Pyx_PyIndex_AsSsize_t(index);
12710 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
12711 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
12712 }
12713 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
12714 PyErr_Clear();
12715 PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
12716 }
12717 return NULL;
12718 }
12719 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
12720 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
12721 if (likely(m && m->mp_subscript)) {
12722 return m->mp_subscript(obj, key);
12723 }
12724 return __Pyx_PyObject_GetIndex(obj, key);
12725 }
12726 #endif
12727
1215812728 /* SaveResetException */
1215912729 #if CYTHON_FAST_THREAD_STATE
1216012730 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
12731 #if PY_VERSION_HEX >= 0x030700A3
12732 *type = tstate->exc_state.exc_type;
12733 *value = tstate->exc_state.exc_value;
12734 *tb = tstate->exc_state.exc_traceback;
12735 #else
1216112736 *type = tstate->exc_type;
1216212737 *value = tstate->exc_value;
1216312738 *tb = tstate->exc_traceback;
12739 #endif
1216412740 Py_XINCREF(*type);
1216512741 Py_XINCREF(*value);
1216612742 Py_XINCREF(*tb);
1216712743 }
1216812744 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
1216912745 PyObject *tmp_type, *tmp_value, *tmp_tb;
12746 #if PY_VERSION_HEX >= 0x030700A3
12747 tmp_type = tstate->exc_state.exc_type;
12748 tmp_value = tstate->exc_state.exc_value;
12749 tmp_tb = tstate->exc_state.exc_traceback;
12750 tstate->exc_state.exc_type = type;
12751 tstate->exc_state.exc_value = value;
12752 tstate->exc_state.exc_traceback = tb;
12753 #else
1217012754 tmp_type = tstate->exc_type;
1217112755 tmp_value = tstate->exc_value;
1217212756 tmp_tb = tstate->exc_traceback;
1217312757 tstate->exc_type = type;
1217412758 tstate->exc_value = value;
1217512759 tstate->exc_traceback = tb;
12760 #endif
1217612761 Py_XDECREF(tmp_type);
1217712762 Py_XDECREF(tmp_value);
1217812763 Py_XDECREF(tmp_tb);
1218112766
1218212767 /* PyErrExceptionMatches */
1218312768 #if CYTHON_FAST_THREAD_STATE
12769 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
12770 Py_ssize_t i, n;
12771 n = PyTuple_GET_SIZE(tuple);
12772 #if PY_MAJOR_VERSION >= 3
12773 for (i=0; i<n; i++) {
12774 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
12775 }
12776 #endif
12777 for (i=0; i<n; i++) {
12778 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
12779 }
12780 return 0;
12781 }
1218412782 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
1218512783 PyObject *exc_type = tstate->curexc_type;
1218612784 if (exc_type == err) return 1;
1218712785 if (unlikely(!exc_type)) return 0;
12188 return PyErr_GivenExceptionMatches(exc_type, err);
12786 if (unlikely(PyTuple_Check(err)))
12787 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
12788 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
1218912789 }
1219012790 #endif
1219112791
1222712827 *value = local_value;
1222812828 *tb = local_tb;
1222912829 #if CYTHON_FAST_THREAD_STATE
12830 #if PY_VERSION_HEX >= 0x030700A3
12831 tmp_type = tstate->exc_state.exc_type;
12832 tmp_value = tstate->exc_state.exc_value;
12833 tmp_tb = tstate->exc_state.exc_traceback;
12834 tstate->exc_state.exc_type = local_type;
12835 tstate->exc_state.exc_value = local_value;
12836 tstate->exc_state.exc_traceback = local_tb;
12837 #else
1223012838 tmp_type = tstate->exc_type;
1223112839 tmp_value = tstate->exc_value;
1223212840 tmp_tb = tstate->exc_traceback;
1223312841 tstate->exc_type = local_type;
1223412842 tstate->exc_value = local_value;
1223512843 tstate->exc_traceback = local_tb;
12844 #endif
1223612845 Py_XDECREF(tmp_type);
1223712846 Py_XDECREF(tmp_value);
1223812847 Py_XDECREF(tmp_tb);
1225912868 }
1226012869 #endif
1226112870 #ifdef __Pyx_CyFunction_USED
12262 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
12871 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
1226312872 #else
1226412873 if (likely(PyCFunction_Check(func))) {
1226512874 #endif
1227012879 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
1227112880 }
1227212881 #endif
12882
12883 /* PyObjectFormat */
12884 #if CYTHON_USE_UNICODE_WRITER
12885 static PyObject* __Pyx_PyObject_Format(PyObject* obj, PyObject* format_spec) {
12886 int ret;
12887 _PyUnicodeWriter writer;
12888 if (likely(PyFloat_CheckExact(obj))) {
12889 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000
12890 _PyUnicodeWriter_Init(&writer, 0);
12891 #else
12892 _PyUnicodeWriter_Init(&writer);
12893 #endif
12894 ret = _PyFloat_FormatAdvancedWriter(
12895 &writer,
12896 obj,
12897 format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
12898 } else if (likely(PyLong_CheckExact(obj))) {
12899 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x03040000
12900 _PyUnicodeWriter_Init(&writer, 0);
12901 #else
12902 _PyUnicodeWriter_Init(&writer);
12903 #endif
12904 ret = _PyLong_FormatAdvancedWriter(
12905 &writer,
12906 obj,
12907 format_spec, 0, PyUnicode_GET_LENGTH(format_spec));
12908 } else {
12909 return PyObject_Format(obj, format_spec);
12910 }
12911 if (unlikely(ret == -1)) {
12912 _PyUnicodeWriter_Dealloc(&writer);
12913 return NULL;
12914 }
12915 return _PyUnicodeWriter_Finish(&writer);
12916 }
12917 #endif
12918
12919 /* PyObjectFormatAndDecref */
12920 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
12921 if (unlikely(!s)) return NULL;
12922 if (likely(PyUnicode_CheckExact(s))) return s;
12923 #if PY_MAJOR_VERSION < 3
12924 if (likely(PyString_CheckExact(s))) {
12925 PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
12926 Py_DECREF(s);
12927 return result;
12928 }
12929 #endif
12930 return __Pyx_PyObject_FormatAndDecref(s, f);
12931 }
12932 static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
12933 PyObject *result = PyObject_Format(s, f);
12934 Py_DECREF(s);
12935 return result;
12936 }
12937
12938 /* JoinPyUnicode */
12939 static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
12940 CYTHON_UNUSED Py_UCS4 max_char) {
12941 #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12942 PyObject *result_uval;
12943 int result_ukind;
12944 Py_ssize_t i, char_pos;
12945 void *result_udata;
12946 #if CYTHON_PEP393_ENABLED
12947 result_uval = PyUnicode_New(result_ulength, max_char);
12948 if (unlikely(!result_uval)) return NULL;
12949 result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
12950 result_udata = PyUnicode_DATA(result_uval);
12951 #else
12952 result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
12953 if (unlikely(!result_uval)) return NULL;
12954 result_ukind = sizeof(Py_UNICODE);
12955 result_udata = PyUnicode_AS_UNICODE(result_uval);
12956 #endif
12957 char_pos = 0;
12958 for (i=0; i < value_count; i++) {
12959 int ukind;
12960 Py_ssize_t ulength;
12961 void *udata;
12962 PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
12963 if (unlikely(__Pyx_PyUnicode_READY(uval)))
12964 goto bad;
12965 ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
12966 if (unlikely(!ulength))
12967 continue;
12968 if (unlikely(char_pos + ulength < 0))
12969 goto overflow;
12970 ukind = __Pyx_PyUnicode_KIND(uval);
12971 udata = __Pyx_PyUnicode_DATA(uval);
12972 if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
12973 memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind));
12974 } else {
12975 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
12976 _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
12977 #else
12978 Py_ssize_t j;
12979 for (j=0; j < ulength; j++) {
12980 Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
12981 __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
12982 }
12983 #endif
12984 }
12985 char_pos += ulength;
12986 }
12987 return result_uval;
12988 overflow:
12989 PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
12990 bad:
12991 Py_DECREF(result_uval);
12992 return NULL;
12993 #else
12994 result_ulength++;
12995 value_count++;
12996 return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
12997 #endif
12998 }
1227312999
1227413000 /* decode_c_string */
1227513001 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1234313069 goto long_long;
1234413070 #endif
1234513071 }
13072 CYTHON_FALLTHROUGH;
1234613073 case 2:
1234713074 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
1234813075 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
1235313080 goto long_long;
1235413081 #endif
1235513082 }
13083 CYTHON_FALLTHROUGH;
1235613084 case -3:
1235713085 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
1235813086 a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
1236313091 goto long_long;
1236413092 #endif
1236513093 }
13094 CYTHON_FALLTHROUGH;
1236613095 case 3:
1236713096 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
1236813097 a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
1237313102 goto long_long;
1237413103 #endif
1237513104 }
13105 CYTHON_FALLTHROUGH;
1237613106 case -4:
1237713107 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
1237813108 a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
1238313113 goto long_long;
1238413114 #endif
1238513115 }
13116 CYTHON_FALLTHROUGH;
1238613117 case 4:
1238713118 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
1238813119 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
1239313124 goto long_long;
1239413125 #endif
1239513126 }
13127 CYTHON_FALLTHROUGH;
1239613128 default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
1239713129 }
1239813130 }
1248713219 }
1248813220
1248913221 /* PyObjectCallMethod1 */
12490 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
12491 PyObject *method, *result = NULL;
12492 method = __Pyx_PyObject_GetAttrStr(obj, method_name);
12493 if (unlikely(!method)) goto done;
13222 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
13223 PyObject *result = NULL;
1249413224 #if CYTHON_UNPACK_METHODS
1249513225 if (likely(PyMethod_Check(method))) {
1249613226 PyObject *self = PyMethod_GET_SELF(method);
1251813248 Py_INCREF(arg);
1251913249 PyTuple_SET_ITEM(args, 1, arg);
1252013250 Py_INCREF(function);
12521 Py_DECREF(method); method = NULL;
1252213251 result = __Pyx_PyObject_Call(function, args, NULL);
1252313252 Py_DECREF(args);
1252413253 Py_DECREF(function);
1252713256 }
1252813257 #endif
1252913258 result = __Pyx_PyObject_CallOneArg(method, arg);
13259 goto done;
1253013260 done:
12531 Py_XDECREF(method);
13261 return result;
13262 }
13263 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
13264 PyObject *method, *result;
13265 method = __Pyx_PyObject_GetAttrStr(obj, method_name);
13266 if (unlikely(!method)) return NULL;
13267 result = __Pyx__PyObject_CallMethod1(method, arg);
13268 Py_DECREF(method);
1253213269 return result;
1253313270 }
1253413271
1258813325 /* IterFinish */
1258913326 static CYTHON_INLINE int __Pyx_IterFinish(void) {
1259013327 #if CYTHON_FAST_THREAD_STATE
12591 PyThreadState *tstate = PyThreadState_GET();
13328 PyThreadState *tstate = __Pyx_PyThreadState_Current;
1259213329 PyObject* exc_type = tstate->curexc_type;
1259313330 if (unlikely(exc_type)) {
12594 if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
13331 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
1259513332 PyObject *exc_value, *exc_tb;
1259613333 exc_value = tstate->curexc_value;
1259713334 exc_tb = tstate->curexc_traceback;
1268413421 }
1268513422
1268613423 /* UnpackTuple2 */
12687 static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
12688 int is_tuple, int has_known_size, int decref_tuple) {
13424 static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
13425 PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
13426 PyObject *value1 = NULL, *value2 = NULL;
13427 #if CYTHON_COMPILING_IN_PYPY
13428 value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad;
13429 value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad;
13430 #else
13431 value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1);
13432 value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2);
13433 #endif
13434 if (decref_tuple) {
13435 Py_DECREF(tuple);
13436 }
13437 *pvalue1 = value1;
13438 *pvalue2 = value2;
13439 return 0;
13440 #if CYTHON_COMPILING_IN_PYPY
13441 bad:
13442 Py_XDECREF(value1);
13443 Py_XDECREF(value2);
13444 if (decref_tuple) { Py_XDECREF(tuple); }
13445 return -1;
13446 #endif
13447 }
13448 static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
13449 int has_known_size, int decref_tuple) {
1268913450 Py_ssize_t index;
1269013451 PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
12691 if (!is_tuple && unlikely(!PyTuple_Check(tuple))) {
12692 iternextfunc iternext;
12693 iter = PyObject_GetIter(tuple);
12694 if (unlikely(!iter)) goto bad;
12695 if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
12696 iternext = Py_TYPE(iter)->tp_iternext;
12697 value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
12698 value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
12699 if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
12700 Py_DECREF(iter);
12701 } else {
12702 if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) {
12703 __Pyx_UnpackTupleError(tuple, 2);
12704 goto bad;
12705 }
12706 #if CYTHON_COMPILING_IN_PYPY
12707 value1 = PySequence_ITEM(tuple, 0);
12708 if (unlikely(!value1)) goto bad;
12709 value2 = PySequence_ITEM(tuple, 1);
12710 if (unlikely(!value2)) goto bad;
12711 #else
12712 value1 = PyTuple_GET_ITEM(tuple, 0);
12713 value2 = PyTuple_GET_ITEM(tuple, 1);
12714 Py_INCREF(value1);
12715 Py_INCREF(value2);
12716 #endif
12717 if (decref_tuple) { Py_DECREF(tuple); }
12718 }
13452 iternextfunc iternext;
13453 iter = PyObject_GetIter(tuple);
13454 if (unlikely(!iter)) goto bad;
13455 if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
13456 iternext = Py_TYPE(iter)->tp_iternext;
13457 value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
13458 value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
13459 if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
13460 Py_DECREF(iter);
1271913461 *pvalue1 = value1;
1272013462 *pvalue2 = value2;
1272113463 return 0;
1273513477 Py_ssize_t* p_orig_length, int* p_source_is_dict) {
1273613478 is_dict = is_dict || likely(PyDict_CheckExact(iterable));
1273713479 *p_source_is_dict = is_dict;
13480 if (is_dict) {
1273813481 #if !CYTHON_COMPILING_IN_PYPY
12739 if (is_dict) {
1274013482 *p_orig_length = PyDict_Size(iterable);
1274113483 Py_INCREF(iterable);
1274213484 return iterable;
12743 }
12744 #endif
13485 #elif PY_MAJOR_VERSION >= 3
13486 static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
13487 PyObject **pp = NULL;
13488 if (method_name) {
13489 const char *name = PyUnicode_AsUTF8(method_name);
13490 if (strcmp(name, "iteritems") == 0) pp = &py_items;
13491 else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
13492 else if (strcmp(name, "itervalues") == 0) pp = &py_values;
13493 if (pp) {
13494 if (!*pp) {
13495 *pp = PyUnicode_FromString(name + 4);
13496 if (!*pp)
13497 return NULL;
13498 }
13499 method_name = *pp;
13500 }
13501 }
13502 #endif
13503 }
1274513504 *p_orig_length = 0;
1274613505 if (method_name) {
1274713506 PyObject* iter;
1294213701 "raise: exception class must be a subclass of BaseException");
1294313702 goto bad;
1294413703 }
12945 #if PY_VERSION_HEX >= 0x03030000
1294613704 if (cause) {
12947 #else
12948 if (cause && cause != Py_None) {
12949 #endif
1295013705 PyObject *fixed_cause;
1295113706 if (cause == Py_None) {
1295213707 fixed_cause = NULL;
1297413729 PyErr_Restore(tmp_type, tmp_value, tb);
1297513730 Py_XDECREF(tmp_tb);
1297613731 #else
12977 PyThreadState *tstate = PyThreadState_GET();
13732 PyThreadState *tstate = __Pyx_PyThreadState_Current;
1297813733 PyObject* tmp_tb = tstate->curexc_traceback;
1297913734 if (tb != tmp_tb) {
1298013735 Py_INCREF(tb);
1299013745 #endif
1299113746
1299213747 /* SetItemInt */
12993 static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
13748 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
1299413749 int r;
1299513750 if (!j) return -1;
1299613751 r = PyObject_SetItem(o, j, v);
1303813793 }
1303913794
1304013795 /* SliceObject */
13041 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
13796 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
1304213797 Py_ssize_t cstart, Py_ssize_t cstop,
1304313798 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
1304413799 int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
1313513890 }
1313613891
1313713892 /* GetVTable */
13138 static void* __Pyx_GetVtable(PyObject *dict) {
13893 static void* __Pyx_GetVtable(PyObject *dict) {
1313913894 void* ptr;
1314013895 PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
1314113896 if (!ob)
1315513910 }
1315613911
1315713912 /* Import */
13158 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
13913 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
1315913914 PyObject *empty_list = 0;
1316013915 PyObject *module = 0;
1316113916 PyObject *global_dict = 0;
1316213917 PyObject *empty_dict = 0;
1316313918 PyObject *list;
13164 #if PY_VERSION_HEX < 0x03030000
13919 #if PY_MAJOR_VERSION < 3
1316513920 PyObject *py_import;
1316613921 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
1316713922 if (!py_import)
1318513940 #if PY_MAJOR_VERSION >= 3
1318613941 if (level == -1) {
1318713942 if (strchr(__Pyx_MODULE_NAME, '.')) {
13188 #if PY_VERSION_HEX < 0x03030000
13189 PyObject *py_level = PyInt_FromLong(1);
13190 if (!py_level)
13191 goto bad;
13192 module = PyObject_CallFunctionObjArgs(py_import,
13193 name, global_dict, empty_dict, list, py_level, NULL);
13194 Py_DECREF(py_level);
13195 #else
1319613943 module = PyImport_ImportModuleLevelObject(
1319713944 name, global_dict, empty_dict, list, 1);
13198 #endif
1319913945 if (!module) {
1320013946 if (!PyErr_ExceptionMatches(PyExc_ImportError))
1320113947 goto bad;
1320613952 }
1320713953 #endif
1320813954 if (!module) {
13209 #if PY_VERSION_HEX < 0x03030000
13955 #if PY_MAJOR_VERSION < 3
1321013956 PyObject *py_level = PyInt_FromLong(level);
1321113957 if (!py_level)
1321213958 goto bad;
1322013966 }
1322113967 }
1322213968 bad:
13223 #if PY_VERSION_HEX < 0x03030000
13969 #if PY_MAJOR_VERSION < 3
1322413970 Py_XDECREF(py_import);
1322513971 #endif
1322613972 Py_XDECREF(empty_list);
1322813974 return module;
1322913975 }
1323013976
13231 /* GetItemInt */
13232 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
13233 PyObject *r;
13234 if (!j) return NULL;
13235 r = PyObject_GetItem(o, j);
13236 Py_DECREF(j);
13237 return r;
13238 }
13239 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
13240 CYTHON_NCP_UNUSED int wraparound,
13241 CYTHON_NCP_UNUSED int boundscheck) {
13242 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13243 if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
13244 if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
13245 PyObject *r = PyList_GET_ITEM(o, i);
13246 Py_INCREF(r);
13247 return r;
13248 }
13249 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
13250 #else
13251 return PySequence_GetItem(o, i);
13252 #endif
13253 }
13254 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
13255 CYTHON_NCP_UNUSED int wraparound,
13256 CYTHON_NCP_UNUSED int boundscheck) {
13257 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13258 if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
13259 if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
13260 PyObject *r = PyTuple_GET_ITEM(o, i);
13261 Py_INCREF(r);
13262 return r;
13263 }
13264 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
13265 #else
13266 return PySequence_GetItem(o, i);
13267 #endif
13268 }
13269 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
13270 CYTHON_NCP_UNUSED int wraparound,
13271 CYTHON_NCP_UNUSED int boundscheck) {
13272 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
13273 if (is_list || PyList_CheckExact(o)) {
13274 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
13275 if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
13276 PyObject *r = PyList_GET_ITEM(o, n);
13277 Py_INCREF(r);
13278 return r;
13279 }
13280 }
13281 else if (PyTuple_CheckExact(o)) {
13282 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
13283 if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
13284 PyObject *r = PyTuple_GET_ITEM(o, n);
13285 Py_INCREF(r);
13286 return r;
13287 }
13288 } else {
13289 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
13290 if (likely(m && m->sq_item)) {
13291 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
13292 Py_ssize_t l = m->sq_length(o);
13293 if (likely(l >= 0)) {
13294 i += l;
13295 } else {
13296 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
13297 return NULL;
13298 PyErr_Clear();
13299 }
13300 }
13301 return m->sq_item(o, i);
13302 }
13303 }
13304 #else
13305 if (is_list || PySequence_Check(o)) {
13306 return PySequence_GetItem(o, i);
13307 }
13308 #endif
13309 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
13310 }
13311
1331213977 /* CalculateMetaclass */
13313 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
13978 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
1331413979 Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
1331513980 for (i=0; i < nbases; i++) {
1331613981 PyTypeObject *tmptype;
1334914014 }
1335014015
1335114016 /* FetchCommonType */
13352 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
14017 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
1335314018 PyObject* fake_module;
1335414019 PyTypeObject* cached_type = NULL;
1335514020 fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
1338814053 }
1338914054
1339014055 /* CythonFunction */
13391 static PyObject *
14056 #include <structmember.h>
14057 static PyObject *
1339214058 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
1339314059 {
1339414060 if (unlikely(op->func_doc == NULL)) {
1367014336 {0, 0, 0, 0, 0}
1367114337 };
1367214338 static PyMemberDef __pyx_CyFunction_members[] = {
13673 {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
14339 {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
1367414340 {0, 0, 0, 0, 0}
1367514341 };
1367614342 static PyObject *
1374814414 }
1374914415 return 0;
1375014416 }
13751 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
14417 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
1375214418 {
13753 PyObject_GC_UnTrack(m);
1375414419 if (__Pyx_CyFunction_weakreflist(m) != NULL)
1375514420 PyObject_ClearWeakRefs((PyObject *) m);
1375614421 __Pyx_CyFunction_clear(m);
1375714422 PyObject_GC_Del(m);
14423 }
14424 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
14425 {
14426 PyObject_GC_UnTrack(m);
14427 __Pyx__CyFunction_dealloc(m);
1375814428 }
1375914429 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
1376014430 {
1383014500 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
1383114501 size = PyTuple_GET_SIZE(arg);
1383214502 if (likely(size == 1)) {
13833 PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
13834 if (unlikely(!arg0)) return NULL;
14503 PyObject *result, *arg0;
14504 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14505 arg0 = PyTuple_GET_ITEM(arg, 0);
14506 #else
14507 arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
14508 #endif
1383514509 result = (*meth)(self, arg0);
14510 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
1383614511 Py_DECREF(arg0);
14512 #endif
1383714513 return result;
1383814514 }
1383914515 PyErr_Format(PyExc_TypeError,
1394014616 };
1394114617 static int __pyx_CyFunction_init(void) {
1394214618 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
13943 if (__pyx_CyFunctionType == NULL) {
14619 if (unlikely(__pyx_CyFunctionType == NULL)) {
1394414620 return -1;
1394514621 }
1394614622 return 0;
1394814624 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
1394914625 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
1395014626 m->defaults = PyObject_Malloc(size);
13951 if (!m->defaults)
14627 if (unlikely(!m->defaults))
1395214628 return PyErr_NoMemory();
1395314629 memset(m->defaults, 0, size);
1395414630 m->defaults_pyobjects = pyobjects;
1397114647 }
1397214648
1397314649 /* Py3ClassCreate */
13974 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
14650 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
1397514651 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
1397614652 PyObject *ns;
1397714653 if (metaclass) {
1403714713 return result;
1403814714 }
1403914715
14716 /* CLineInTraceback */
14717 #ifndef CYTHON_CLINE_IN_TRACEBACK
14718 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
14719 PyObject *use_cline;
14720 PyObject *ptype, *pvalue, *ptraceback;
14721 #if CYTHON_COMPILING_IN_CPYTHON
14722 PyObject **cython_runtime_dict;
14723 #endif
14724 if (unlikely(!__pyx_cython_runtime)) {
14725 return c_line;
14726 }
14727 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
14728 #if CYTHON_COMPILING_IN_CPYTHON
14729 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
14730 if (likely(cython_runtime_dict)) {
14731 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
14732 } else
14733 #endif
14734 {
14735 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
14736 if (use_cline_obj) {
14737 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
14738 Py_DECREF(use_cline_obj);
14739 } else {
14740 PyErr_Clear();
14741 use_cline = NULL;
14742 }
14743 }
14744 if (!use_cline) {
14745 c_line = 0;
14746 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
14747 }
14748 else if (PyObject_Not(use_cline) != 0) {
14749 c_line = 0;
14750 }
14751 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
14752 return c_line;
14753 }
14754 #endif
14755
1404014756 /* CodeObjectCache */
14041 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
14757 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
1404214758 int start = 0, mid = 0, end = count - 1;
1404314759 if (end >= 0 && code_line > entries[end].code_line) {
1404414760 return count;
1411814834 }
1411914835
1412014836 /* AddTraceback */
14121 #include "compile.h"
14837 #include "compile.h"
1412214838 #include "frameobject.h"
1412314839 #include "traceback.h"
1412414840 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
1417714893 int py_line, const char *filename) {
1417814894 PyCodeObject *py_code = 0;
1417914895 PyFrameObject *py_frame = 0;
14180 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
14896 PyThreadState *tstate = __Pyx_PyThreadState_Current;
14897 if (c_line) {
14898 c_line = __Pyx_CLineForTraceback(tstate, c_line);
14899 }
14900 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
1418114901 if (!py_code) {
1418214902 py_code = __Pyx_CreateCodeObjectForTraceback(
1418314903 funcname, c_line, py_line, filename);
1418414904 if (!py_code) goto bad;
14185 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
14905 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
1418614906 }
1418714907 py_frame = PyFrame_New(
14188 PyThreadState_GET(), /*PyThreadState *tstate,*/
14189 py_code, /*PyCodeObject *code,*/
14190 __pyx_d, /*PyObject *globals,*/
14191 0 /*PyObject *locals*/
14908 tstate, /*PyThreadState *tstate,*/
14909 py_code, /*PyCodeObject *code,*/
14910 __pyx_d, /*PyObject *globals,*/
14911 0 /*PyObject *locals*/
1419214912 );
1419314913 if (!py_frame) goto bad;
1419414914 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
1419914919 }
1420014920
1420114921 /* CIntToPy */
14202 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
14922 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
1420314923 const long neg_one = (long) -1, const_zero = (long) 0;
1420414924 const int is_unsigned = neg_one > const_zero;
1420514925 if (is_unsigned) {
1423014950 }
1423114951
1423214952 /* CIntToPy */
14233 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_EventType(SDL_EventType value) {
14953 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_EventType(SDL_EventType value) {
1423414954 const SDL_EventType neg_one = (SDL_EventType) -1, const_zero = (SDL_EventType) 0;
1423514955 const int is_unsigned = neg_one > const_zero;
1423614956 if (is_unsigned) {
1426114981 }
1426214982
1426314983 /* CIntToPy */
14264 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Scancode(SDL_Scancode value) {
14984 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Scancode(SDL_Scancode value) {
1426514985 const SDL_Scancode neg_one = (SDL_Scancode) -1, const_zero = (SDL_Scancode) 0;
1426614986 const int is_unsigned = neg_one > const_zero;
1426714987 if (is_unsigned) {
1429215012 }
1429315013
1429415014 /* CIntToPy */
14295 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) {
15015 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) {
1429615016 const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0;
1429715017 const int is_unsigned = neg_one > const_zero;
1429815018 if (is_unsigned) {
1432315043 }
1432415044
1432515045 /* CIntToPy */
14326 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) {
15046 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) {
1432715047 const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0;
1432815048 const int is_unsigned = neg_one > const_zero;
1432915049 if (is_unsigned) {
1435415074 }
1435515075
1435615076 /* CIntToPy */
14357 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
15077 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
1435815078 const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0;
1435915079 const int is_unsigned = neg_one > const_zero;
1436015080 if (is_unsigned) {
1438515105 }
1438615106
1438715107 /* CIntToPy */
14388 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
15108 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
1438915109 const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
1439015110 const int is_unsigned = neg_one > const_zero;
1439115111 if (is_unsigned) {
1441615136 }
1441715137
1441815138 /* CIntToPy */
14419 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
15139 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
1442015140 const int neg_one = (int) -1, const_zero = (int) 0;
1442115141 const int is_unsigned = neg_one > const_zero;
1442215142 if (is_unsigned) {
1444715167 }
1444815168
1444915169 /* CIntToPy */
14450 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) {
15170 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int16_t(int16_t value) {
1445115171 const int16_t neg_one = (int16_t) -1, const_zero = (int16_t) 0;
1445215172 const int is_unsigned = neg_one > const_zero;
1445315173 if (is_unsigned) {
1447815198 }
1447915199
1448015200 /* CIntToPy */
14481 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) {
15201 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) {
1448215202 const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0;
1448315203 const int is_unsigned = neg_one > const_zero;
1448415204 if (is_unsigned) {
1450915229 }
1451015230
1451115231 /* CIntFromPyVerify */
14512 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
15232 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
1451315233 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
1451415234 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
1451515235 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
1453115251 }
1453215252
1453315253 /* CIntToPy */
14534 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value) {
15254 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value) {
1453515255 const SDL_bool neg_one = (SDL_bool) -1, const_zero = (SDL_bool) 0;
1453615256 const int is_unsigned = neg_one > const_zero;
1453715257 if (is_unsigned) {
1456215282 }
1456315283
1456415284 /* CIntFromPy */
14565 static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
15285 static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
1456615286 const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
1456715287 const int is_unsigned = neg_one > const_zero;
1456815288 #if PY_MAJOR_VERSION < 3
1475115471 }
1475215472
1475315473 /* CIntFromPy */
14754 static CYTHON_INLINE SDL_bool __Pyx_PyInt_As_SDL_bool(PyObject *x) {
15474 static CYTHON_INLINE SDL_bool __Pyx_PyInt_As_SDL_bool(PyObject *x) {
1475515475 const SDL_bool neg_one = (SDL_bool) -1, const_zero = (SDL_bool) 0;
1475615476 const int is_unsigned = neg_one > const_zero;
1475715477 #if PY_MAJOR_VERSION < 3
1494015660 }
1494115661
1494215662 /* CIntFromPy */
14943 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
15663 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
1494415664 const long neg_one = (long) -1, const_zero = (long) 0;
1494515665 const int is_unsigned = neg_one > const_zero;
1494615666 #if PY_MAJOR_VERSION < 3
1512915849 }
1513015850
1513115851 /* CIntFromPy */
15132 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
15852 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
1513315853 const int neg_one = (int) -1, const_zero = (int) 0;
1513415854 const int is_unsigned = neg_one > const_zero;
1513515855 #if PY_MAJOR_VERSION < 3
1531716037 return (int) -1;
1531816038 }
1531916039
16040 /* FastTypeChecks */
16041 #if CYTHON_COMPILING_IN_CPYTHON
16042 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
16043 while (a) {
16044 a = a->tp_base;
16045 if (a == b)
16046 return 1;
16047 }
16048 return b == &PyBaseObject_Type;
16049 }
16050 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
16051 PyObject *mro;
16052 if (a == b) return 1;
16053 mro = a->tp_mro;
16054 if (likely(mro)) {
16055 Py_ssize_t i, n;
16056 n = PyTuple_GET_SIZE(mro);
16057 for (i = 0; i < n; i++) {
16058 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
16059 return 1;
16060 }
16061 return 0;
16062 }
16063 return __Pyx_InBases(a, b);
16064 }
16065 #if PY_MAJOR_VERSION == 2
16066 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
16067 PyObject *exception, *value, *tb;
16068 int res;
16069 __Pyx_PyThreadState_declare
16070 __Pyx_PyThreadState_assign
16071 __Pyx_ErrFetch(&exception, &value, &tb);
16072 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
16073 if (unlikely(res == -1)) {
16074 PyErr_WriteUnraisable(err);
16075 res = 0;
16076 }
16077 if (!res) {
16078 res = PyObject_IsSubclass(err, exc_type2);
16079 if (unlikely(res == -1)) {
16080 PyErr_WriteUnraisable(err);
16081 res = 0;
16082 }
16083 }
16084 __Pyx_ErrRestore(exception, value, tb);
16085 return res;
16086 }
16087 #else
16088 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
16089 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
16090 if (!res) {
16091 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
16092 }
16093 return res;
16094 }
16095 #endif
16096 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
16097 Py_ssize_t i, n;
16098 assert(PyExceptionClass_Check(exc_type));
16099 n = PyTuple_GET_SIZE(tuple);
16100 #if PY_MAJOR_VERSION >= 3
16101 for (i=0; i<n; i++) {
16102 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
16103 }
16104 #endif
16105 for (i=0; i<n; i++) {
16106 PyObject *t = PyTuple_GET_ITEM(tuple, i);
16107 #if PY_MAJOR_VERSION < 3
16108 if (likely(exc_type == t)) return 1;
16109 #endif
16110 if (likely(PyExceptionClass_Check(t))) {
16111 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
16112 } else {
16113 }
16114 }
16115 return 0;
16116 }
16117 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
16118 if (likely(err == exc_type)) return 1;
16119 if (likely(PyExceptionClass_Check(err))) {
16120 if (likely(PyExceptionClass_Check(exc_type))) {
16121 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
16122 } else if (likely(PyTuple_Check(exc_type))) {
16123 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
16124 } else {
16125 }
16126 }
16127 return PyErr_GivenExceptionMatches(err, exc_type);
16128 }
16129 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
16130 assert(PyExceptionClass_Check(exc_type1));
16131 assert(PyExceptionClass_Check(exc_type2));
16132 if (likely(err == exc_type1 || err == exc_type2)) return 1;
16133 if (likely(PyExceptionClass_Check(err))) {
16134 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
16135 }
16136 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
16137 }
16138 #endif
16139
1532016140 /* CheckBinaryVersion */
15321 static int __Pyx_check_binary_version(void) {
16141 static int __Pyx_check_binary_version(void) {
1532216142 char ctversion[4], rtversion[4];
1532316143 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
1532416144 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
1533416154 }
1533516155
1533616156 /* ModuleImport */
15337 #ifndef __PYX_HAVE_RT_ImportModule
16157 #ifndef __PYX_HAVE_RT_ImportModule
1533816158 #define __PYX_HAVE_RT_ImportModule
1533916159 static PyObject *__Pyx_ImportModule(const char *name) {
1534016160 PyObject *py_name = 0;
1535216172 #endif
1535316173
1535416174 /* TypeImport */
15355 #ifndef __PYX_HAVE_RT_ImportType
16175 #ifndef __PYX_HAVE_RT_ImportType
1535616176 #define __PYX_HAVE_RT_ImportType
1535716177 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
1535816178 size_t size, int strict)
1541716237 #endif
1541816238
1541916239 /* VoidPtrImport */
15420 #ifndef __PYX_HAVE_RT_ImportVoidPtr
16240 #ifndef __PYX_HAVE_RT_ImportVoidPtr
1542116241 #define __PYX_HAVE_RT_ImportVoidPtr
1542216242 static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) {
1542316243 PyObject *d = 0;
1546616286 #endif
1546716287
1546816288 /* InitStrings */
15469 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
16289 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
1547016290 while (t->p) {
1547116291 #if PY_MAJOR_VERSION < 3
1547216292 if (t->is_unicode) {
1549116311 #endif
1549216312 if (!*t->p)
1549316313 return -1;
16314 if (PyObject_Hash(*t->p) == -1)
16315 return -1;
1549416316 ++t;
1549516317 }
1549616318 return 0;
1549916321 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
1550016322 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
1550116323 }
15502 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
16324 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
1550316325 Py_ssize_t ignore;
1550416326 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
1550516327 }
15506 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
15507 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
16328 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
16329 #if !CYTHON_PEP393_ENABLED
16330 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
16331 char* defenc_c;
16332 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
16333 if (!defenc) return NULL;
16334 defenc_c = PyBytes_AS_STRING(defenc);
16335 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
16336 {
16337 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
16338 char* c;
16339 for (c = defenc_c; c < end; c++) {
16340 if ((unsigned char) (*c) >= 128) {
16341 PyUnicode_AsASCIIString(o);
16342 return NULL;
16343 }
16344 }
16345 }
16346 #endif
16347 *length = PyBytes_GET_SIZE(defenc);
16348 return defenc_c;
16349 }
16350 #else
16351 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
16352 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
16353 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
16354 if (likely(PyUnicode_IS_ASCII(o))) {
16355 *length = PyUnicode_GET_LENGTH(o);
16356 return PyUnicode_AsUTF8(o);
16357 } else {
16358 PyUnicode_AsASCIIString(o);
16359 return NULL;
16360 }
16361 #else
16362 return PyUnicode_AsUTF8AndSize(o, length);
16363 #endif
16364 }
16365 #endif
16366 #endif
16367 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
16368 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1550816369 if (
1550916370 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1551016371 __Pyx_sys_getdefaultencoding_not_ascii &&
1551116372 #endif
1551216373 PyUnicode_Check(o)) {
15513 #if PY_VERSION_HEX < 0x03030000
15514 char* defenc_c;
15515 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
15516 if (!defenc) return NULL;
15517 defenc_c = PyBytes_AS_STRING(defenc);
15518 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
15519 {
15520 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
15521 char* c;
15522 for (c = defenc_c; c < end; c++) {
15523 if ((unsigned char) (*c) >= 128) {
15524 PyUnicode_AsASCIIString(o);
15525 return NULL;
15526 }
15527 }
15528 }
15529 #endif
15530 *length = PyBytes_GET_SIZE(defenc);
15531 return defenc_c;
15532 #else
15533 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
15534 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
15535 if (PyUnicode_IS_ASCII(o)) {
15536 *length = PyUnicode_GET_LENGTH(o);
15537 return PyUnicode_AsUTF8(o);
15538 } else {
15539 PyUnicode_AsASCIIString(o);
15540 return NULL;
15541 }
15542 #else
15543 return PyUnicode_AsUTF8AndSize(o, length);
15544 #endif
15545 #endif
16374 return __Pyx_PyUnicode_AsStringAndSize(o, length);
1554616375 } else
1554716376 #endif
1554816377 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
1556616395 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
1556716396 else return PyObject_IsTrue(x);
1556816397 }
16398 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
16399 #if PY_MAJOR_VERSION >= 3
16400 if (PyLong_Check(result)) {
16401 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
16402 "__int__ returned non-int (type %.200s). "
16403 "The ability to return an instance of a strict subclass of int "
16404 "is deprecated, and may be removed in a future version of Python.",
16405 Py_TYPE(result)->tp_name)) {
16406 Py_DECREF(result);
16407 return NULL;
16408 }
16409 return result;
16410 }
16411 #endif
16412 PyErr_Format(PyExc_TypeError,
16413 "__%.4s__ returned non-%.4s (type %.200s)",
16414 type_name, type_name, Py_TYPE(result)->tp_name);
16415 Py_DECREF(result);
16416 return NULL;
16417 }
1556916418 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
1557016419 #if CYTHON_USE_TYPE_SLOTS
1557116420 PyNumberMethods *m;
1557316422 const char *name = NULL;
1557416423 PyObject *res = NULL;
1557516424 #if PY_MAJOR_VERSION < 3
15576 if (PyInt_Check(x) || PyLong_Check(x))
16425 if (likely(PyInt_Check(x) || PyLong_Check(x)))
1557716426 #else
15578 if (PyLong_Check(x))
16427 if (likely(PyLong_Check(x)))
1557916428 #endif
1558016429 return __Pyx_NewRef(x);
1558116430 #if CYTHON_USE_TYPE_SLOTS
1558316432 #if PY_MAJOR_VERSION < 3
1558416433 if (m && m->nb_int) {
1558516434 name = "int";
15586 res = PyNumber_Int(x);
16435 res = m->nb_int(x);
1558716436 }
1558816437 else if (m && m->nb_long) {
1558916438 name = "long";
15590 res = PyNumber_Long(x);
16439 res = m->nb_long(x);
1559116440 }
1559216441 #else
15593 if (m && m->nb_int) {
16442 if (likely(m && m->nb_int)) {
1559416443 name = "int";
15595 res = PyNumber_Long(x);
16444 res = m->nb_int(x);
1559616445 }
1559716446 #endif
1559816447 #else
15599 res = PyNumber_Int(x);
15600 #endif
15601 if (res) {
16448 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
16449 res = PyNumber_Int(x);
16450 }
16451 #endif
16452 if (likely(res)) {
1560216453 #if PY_MAJOR_VERSION < 3
15603 if (!PyInt_Check(res) && !PyLong_Check(res)) {
16454 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
1560416455 #else
15605 if (!PyLong_Check(res)) {
15606 #endif
15607 PyErr_Format(PyExc_TypeError,
15608 "__%.4s__ returned non-%.4s (type %.200s)",
15609 name, name, Py_TYPE(res)->tp_name);
15610 Py_DECREF(res);
15611 return NULL;
16456 if (unlikely(!PyLong_CheckExact(res))) {
16457 #endif
16458 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
1561216459 }
1561316460 }
1561416461 else if (!PyErr_Occurred()) {
1567916526 Py_DECREF(x);
1568016527 return ival;
1568116528 }
16529 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
16530 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
16531 }
1568216532 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
1568316533 return PyInt_FromSize_t(ival);
1568416534 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
8 #else
9 #define CYTHON_ABI "0_25_2"
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
8 #else
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
102120 #define CYTHON_COMPILING_IN_CPYTHON 1
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
105129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
409549 { \
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420552
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
428560
429561 #define __PYX_HAVE__pygame_sdl2__font
430562 #define __PYX_HAVE_API__pygame_sdl2__font
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
438571 #include <omp.h>
439572 #endif /* _OPENMP */
440573
441 #ifdef PYREX_WITHOUT_ASSERTIONS
574 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
442575 #define CYTHON_WITHOUT_ASSERTIONS
443576 #endif
444577
469602 #define __Pyx_sst_abs(value) abs(value)
470603 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
471604 #define __Pyx_sst_abs(value) labs(value)
472 #elif defined (_MSC_VER) && defined (_M_X64)
473 #define __Pyx_sst_abs(value) _abs64(value)
605 #elif defined (_MSC_VER)
606 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
474607 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
475608 #define __Pyx_sst_abs(value) llabs(value)
476609 #elif defined (__GNUC__)
478611 #else
479612 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
480613 #endif
481 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
482 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
614 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
615 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
483616 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
484617 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
485618 #define __Pyx_PyBytes_FromString PyBytes_FromString
492625 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
493626 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
494627 #endif
495 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
496 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
628 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
629 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
634 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
635 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
638 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
497639 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
498640 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
499641 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
500642 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
501643 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
502 #if PY_MAJOR_VERSION < 3
503 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
504 {
644 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
505645 const Py_UNICODE *u_end = u;
506646 while (*u_end++) ;
507647 return (size_t)(u_end - u - 1);
508648 }
509 #else
510 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
511 #endif
512649 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
513650 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
514651 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
515652 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
516653 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
517 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
654 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
518655 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
519656 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
657 #define __Pyx_PySequence_Tuple(obj)\
658 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
520659 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
521660 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
522661 #if CYTHON_ASSUME_SAFE_MACROS
615754 #define likely(x) (x)
616755 #define unlikely(x) (x)
617756 #endif /* __GNUC__ */
618
619 static PyObject *__pyx_m;
757 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
758
759 static PyObject *__pyx_m = NULL;
620760 static PyObject *__pyx_d;
621761 static PyObject *__pyx_b;
762 static PyObject *__pyx_cython_runtime = NULL;
622763 static PyObject *__pyx_empty_tuple;
623764 static PyObject *__pyx_empty_bytes;
624765 static PyObject *__pyx_empty_unicode;
629770
630771
631772 static const char *__pyx_f[] = {
773 "stringsource",
632774 "src/pygame_sdl2/font.pyx",
633775 "src/pygame_sdl2/surface.pxd",
634776 "src/pygame_sdl2/color.pxd",
819961
820962 /* PyObjectGetAttrStr.proto */
821963 #if CYTHON_USE_TYPE_SLOTS
822 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
823 PyTypeObject* tp = Py_TYPE(obj);
824 if (likely(tp->tp_getattro))
825 return tp->tp_getattro(obj, attr_name);
826 #if PY_MAJOR_VERSION < 3
827 if (likely(tp->tp_getattr))
828 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
829 #endif
830 return PyObject_GetAttr(obj, attr_name);
831 }
964 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
832965 #else
833966 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
834967 #endif
968
969 /* GetBuiltinName.proto */
970 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
835971
836972 /* Import.proto */
837973 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
838
839 /* GetBuiltinName.proto */
840 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
841974
842975 /* GetModuleGlobalName.proto */
843976 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
8801013 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
8811014
8821015 /* KeywordStringCheck.proto */
883 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
1016 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
8841017
8851018 /* RaiseDoubleKeywords.proto */
8861019 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
9001033 /* PyThreadStateGet.proto */
9011034 #if CYTHON_FAST_THREAD_STATE
9021035 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
903 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
1036 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1037 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
9041038 #else
9051039 #define __Pyx_PyThreadState_declare
9061040 #define __Pyx_PyThreadState_assign
1041 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
9071042 #endif
9081043
9091044 /* PyErrFetchRestore.proto */
9101045 #if CYTHON_FAST_THREAD_STATE
1046 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
9111047 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
9121048 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
9131049 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
9141050 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
9151051 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
9161052 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
917 #else
1053 #if CYTHON_COMPILING_IN_CPYTHON
1054 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1055 #else
1056 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1057 #endif
1058 #else
1059 #define __Pyx_PyErr_Clear() PyErr_Clear()
1060 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
9181061 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
9191062 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1063 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1064 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
9201065 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
9211066 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
9221067 #endif
9681113 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
9691114 #endif
9701115
1116 /* PyObject_GenericGetAttrNoDict.proto */
1117 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1118 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1119 #else
1120 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1121 #endif
1122
1123 /* PyObject_GenericGetAttr.proto */
1124 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1125 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1126 #else
1127 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1128 #endif
1129
9711130 /* SetVTable.proto */
9721131 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
9731132
1133 /* SetupReduce.proto */
1134 static int __Pyx_setup_reduce(PyObject* type_obj);
1135
9741136 /* GetVTable.proto */
9751137 static void* __Pyx_GetVtable(PyObject *dict);
9761138
9771139 /* ImportFrom.proto */
9781140 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1141
1142 /* CLineInTraceback.proto */
1143 #ifdef CYTHON_CLINE_IN_TRACEBACK
1144 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1145 #else
1146 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1147 #endif
9791148
9801149 /* CodeObjectCache.proto */
9811150 typedef struct {
10081177 /* CIntFromPy.proto */
10091178 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
10101179
1180 /* FastTypeChecks.proto */
1181 #if CYTHON_COMPILING_IN_CPYTHON
1182 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1183 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1184 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1185 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1186 #else
1187 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1188 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1189 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1190 #endif
1191 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1192
10111193 /* CheckBinaryVersion.proto */
10121194 static int __Pyx_check_binary_version(void);
10131195
10591241 /* Module declarations from 'pygame_sdl2.font' */
10601242 static PyTypeObject *__pyx_ptype_11pygame_sdl2_4font_Font = 0;
10611243 #define __Pyx_MODULE_NAME "pygame_sdl2.font"
1244 extern int __pyx_module_is_main_pygame_sdl2__font;
10621245 int __pyx_module_is_main_pygame_sdl2__font = 0;
10631246
10641247 /* Implementation of 'pygame_sdl2.font' */
1248 static PyObject *__pyx_builtin_TypeError;
10651249 static const char __pyx_k__2[] = " ";
10661250 static const char __pyx_k_fi[] = "fi";
10671251 static const char __pyx_k_os[] = "os";
10721256 static const char __pyx_k_init[] = "init";
10731257 static const char __pyx_k_join[] = "join";
10741258 static const char __pyx_k_main[] = "__main__";
1259 static const char __pyx_k_name[] = "__name__";
10751260 static const char __pyx_k_path[] = "path";
10761261 static const char __pyx_k_quit[] = "quit";
10771262 static const char __pyx_k_sans[] = "sans";
10841269 static const char __pyx_k_encode[] = "encode";
10851270 static const char __pyx_k_exists[] = "exists";
10861271 static const char __pyx_k_import[] = "__import__";
1272 static const char __pyx_k_reduce[] = "__reduce__";
10871273 static const char __pyx_k_SysFont[] = "SysFont";
10881274 static const char __pyx_k_convert[] = "convert";
10891275 static const char __pyx_k_default[] = "default";
10901276 static const char __pyx_k_dirname[] = "dirname";
10911277 static const char __pyx_k_get_init[] = "get_init";
1278 static const char __pyx_k_getstate[] = "__getstate__";
1279 static const char __pyx_k_setstate[] = "__setstate__";
1280 static const char __pyx_k_TypeError[] = "TypeError";
10921281 static const char __pyx_k_antialias[] = "antialias";
10931282 static const char __pyx_k_get_fonts[] = "get_fonts";
1283 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
10941284 static const char __pyx_k_background[] = "background";
10951285 static const char __pyx_k_match_font[] = "match_font";
10961286 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
10971287 static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2";
1288 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
10981289 static const char __pyx_k_register_init[] = "register_init";
10991290 static const char __pyx_k_register_quit[] = "register_quit";
11001291 static const char __pyx_k_DejaVuSans_ttf[] = "DejaVuSans.ttf";
1292 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
11011293 static const char __pyx_k_get_default_font[] = "get_default_font";
11021294 static const char __pyx_k_pygame_sdl2_font[] = "pygame_sdl2.font";
11031295 static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error";
1296 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
11041297 static const char __pyx_k_pygame_sdl2_sysfont[] = "pygame_sdl2.sysfont";
11051298 static const char __pyx_k_src_pygame_sdl2_font_pyx[] = "src/pygame_sdl2/font.pyx";
1299 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
11061300 static PyObject *__pyx_kp_u_DejaVuSans_ttf;
11071301 static PyObject *__pyx_n_s_SysFont;
1302 static PyObject *__pyx_n_s_TypeError;
11081303 static PyObject *__pyx_kp_u__2;
11091304 static PyObject *__pyx_n_s_antialias;
11101305 static PyObject *__pyx_n_s_background;
11111306 static PyObject *__pyx_n_s_blit;
1307 static PyObject *__pyx_n_s_cline_in_traceback;
11121308 static PyObject *__pyx_n_s_color;
11131309 static PyObject *__pyx_n_s_convert;
11141310 static PyObject *__pyx_n_s_copy;
11231319 static PyObject *__pyx_n_s_get_default_font;
11241320 static PyObject *__pyx_n_s_get_fonts;
11251321 static PyObject *__pyx_n_s_get_init;
1322 static PyObject *__pyx_n_s_getstate;
11261323 static PyObject *__pyx_n_s_import;
11271324 static PyObject *__pyx_n_s_init;
11281325 static PyObject *__pyx_n_s_join;
11291326 static PyObject *__pyx_n_s_main;
11301327 static PyObject *__pyx_n_s_match_font;
1328 static PyObject *__pyx_n_s_name;
1329 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
11311330 static PyObject *__pyx_n_s_os;
11321331 static PyObject *__pyx_n_s_path;
11331332 static PyObject *__pyx_n_s_pygame_sdl2;
11361335 static PyObject *__pyx_n_s_pygame_sdl2_sysfont;
11371336 static PyObject *__pyx_n_s_pyx_vtable;
11381337 static PyObject *__pyx_n_s_quit;
1338 static PyObject *__pyx_n_s_reduce;
1339 static PyObject *__pyx_n_s_reduce_cython;
1340 static PyObject *__pyx_n_s_reduce_ex;
11391341 static PyObject *__pyx_n_s_register_init;
11401342 static PyObject *__pyx_n_s_register_quit;
11411343 static PyObject *__pyx_n_u_sans;
1344 static PyObject *__pyx_n_s_setstate;
1345 static PyObject *__pyx_n_s_setstate_cython;
11421346 static PyObject *__pyx_n_s_size;
11431347 static PyObject *__pyx_kp_s_src_pygame_sdl2_font_pyx;
11441348 static PyObject *__pyx_n_s_test;
11641368 static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_26get_ascent(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */
11651369 static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_28get_descent(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */
11661370 static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_30metrics(struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, PyObject *__pyx_v_text); /* proto */
1371 static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self); /* proto */
1372 static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
11671373 static PyObject *__pyx_tp_new_11pygame_sdl2_4font_Font(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
11681374 static PyObject *__pyx_int_0;
11691375 static PyObject *__pyx_tuple_;
11731379 static PyObject *__pyx_tuple__6;
11741380 static PyObject *__pyx_tuple__7;
11751381 static PyObject *__pyx_tuple__8;
1176 static PyObject *__pyx_tuple__12;
1177 static PyObject *__pyx_codeobj__9;
1178 static PyObject *__pyx_codeobj__10;
1382 static PyObject *__pyx_tuple__9;
1383 static PyObject *__pyx_tuple__10;
1384 static PyObject *__pyx_tuple__14;
11791385 static PyObject *__pyx_codeobj__11;
1386 static PyObject *__pyx_codeobj__12;
11801387 static PyObject *__pyx_codeobj__13;
1388 static PyObject *__pyx_codeobj__15;
1389 /* Late includes */
11811390
11821391 /* "pygame_sdl2/font.pyx":30
11831392 *
12131422 *
12141423 * @pygame_sdl2.register_quit
12151424 */
1216 TTF_Init();
1425 (void)(TTF_Init());
12171426
12181427 /* "pygame_sdl2/font.pyx":30
12191428 *
13171526 * def get_default_font():
13181527 */
13191528 __Pyx_XDECREF(__pyx_r);
1320 __pyx_t_1 = __Pyx_PyBool_FromLong((TTF_WasInit() != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
1529 __pyx_t_1 = __Pyx_PyBool_FromLong((TTF_WasInit() != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error)
13211530 __Pyx_GOTREF(__pyx_t_1);
13221531 __pyx_r = __pyx_t_1;
13231532 __pyx_t_1 = 0;
13871596 *
13881597 * default = os.path.join(os.path.dirname(__file__), "DejaVuSans.ttf")
13891598 */
1390 __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
1599 __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 41, __pyx_L1_error)
13911600 __Pyx_GOTREF(__pyx_t_1);
13921601 __pyx_v_os = __pyx_t_1;
13931602 __pyx_t_1 = 0;
13991608 *
14001609 * if os.path.exists(default):
14011610 */
1402 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
1611 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 43, __pyx_L1_error)
14031612 __Pyx_GOTREF(__pyx_t_2);
1404 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 43, __pyx_L1_error)
1613 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 43, __pyx_L1_error)
14051614 __Pyx_GOTREF(__pyx_t_3);
14061615 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1407 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 43, __pyx_L1_error)
1616 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 43, __pyx_L1_error)
14081617 __Pyx_GOTREF(__pyx_t_4);
1409 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_dirname); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 43, __pyx_L1_error)
1618 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_dirname); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 43, __pyx_L1_error)
14101619 __Pyx_GOTREF(__pyx_t_5);
14111620 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1412 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 43, __pyx_L1_error)
1621 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 43, __pyx_L1_error)
14131622 __Pyx_GOTREF(__pyx_t_4);
14141623 __pyx_t_6 = NULL;
14151624 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
14221631 }
14231632 }
14241633 if (!__pyx_t_6) {
1425 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
1634 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 43, __pyx_L1_error)
14261635 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14271636 __Pyx_GOTREF(__pyx_t_2);
14281637 } else {
14291638 #if CYTHON_FAST_PYCALL
14301639 if (PyFunction_Check(__pyx_t_5)) {
14311640 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
1432 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
1641 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 43, __pyx_L1_error)
14331642 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
14341643 __Pyx_GOTREF(__pyx_t_2);
14351644 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14381647 #if CYTHON_FAST_PYCCALL
14391648 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
14401649 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
1441 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
1650 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 43, __pyx_L1_error)
14421651 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
14431652 __Pyx_GOTREF(__pyx_t_2);
14441653 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14451654 } else
14461655 #endif
14471656 {
1448 __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L1_error)
1657 __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 43, __pyx_L1_error)
14491658 __Pyx_GOTREF(__pyx_t_7);
14501659 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
14511660 __Pyx_GIVEREF(__pyx_t_4);
14521661 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
14531662 __pyx_t_4 = 0;
1454 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
1663 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 43, __pyx_L1_error)
14551664 __Pyx_GOTREF(__pyx_t_2);
14561665 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14571666 }
14721681 #if CYTHON_FAST_PYCALL
14731682 if (PyFunction_Check(__pyx_t_3)) {
14741683 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_kp_u_DejaVuSans_ttf};
1475 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
1684 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 43, __pyx_L1_error)
14761685 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14771686 __Pyx_GOTREF(__pyx_t_1);
14781687 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14811690 #if CYTHON_FAST_PYCCALL
14821691 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
14831692 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_kp_u_DejaVuSans_ttf};
1484 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
1693 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 43, __pyx_L1_error)
14851694 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14861695 __Pyx_GOTREF(__pyx_t_1);
14871696 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14881697 } else
14891698 #endif
14901699 {
1491 __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 43, __pyx_L1_error)
1700 __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 43, __pyx_L1_error)
14921701 __Pyx_GOTREF(__pyx_t_7);
14931702 if (__pyx_t_5) {
14941703 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
14991708 __Pyx_GIVEREF(__pyx_kp_u_DejaVuSans_ttf);
15001709 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_u_DejaVuSans_ttf);
15011710 __pyx_t_2 = 0;
1502 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
1711 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 43, __pyx_L1_error)
15031712 __Pyx_GOTREF(__pyx_t_1);
15041713 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15051714 }
15141723 * return default
15151724 *
15161725 */
1517 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error)
1726 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_os, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 45, __pyx_L1_error)
15181727 __Pyx_GOTREF(__pyx_t_3);
1519 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exists); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L1_error)
1728 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exists); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 45, __pyx_L1_error)
15201729 __Pyx_GOTREF(__pyx_t_7);
15211730 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15221731 __pyx_t_3 = NULL;
15301739 }
15311740 }
15321741 if (!__pyx_t_3) {
1533 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_default); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
1742 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_default); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 45, __pyx_L1_error)
15341743 __Pyx_GOTREF(__pyx_t_1);
15351744 } else {
15361745 #if CYTHON_FAST_PYCALL
15371746 if (PyFunction_Check(__pyx_t_7)) {
15381747 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_default};
1539 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
1748 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 45, __pyx_L1_error)
15401749 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15411750 __Pyx_GOTREF(__pyx_t_1);
15421751 } else
15441753 #if CYTHON_FAST_PYCCALL
15451754 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
15461755 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_default};
1547 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
1756 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 45, __pyx_L1_error)
15481757 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15491758 __Pyx_GOTREF(__pyx_t_1);
15501759 } else
15511760 #endif
15521761 {
1553 __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
1762 __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 45, __pyx_L1_error)
15541763 __Pyx_GOTREF(__pyx_t_2);
15551764 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
15561765 __Pyx_INCREF(__pyx_v_default);
15571766 __Pyx_GIVEREF(__pyx_v_default);
15581767 PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_default);
1559 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
1768 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 45, __pyx_L1_error)
15601769 __Pyx_GOTREF(__pyx_t_1);
15611770 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15621771 }
15631772 }
15641773 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1565 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 45, __pyx_L1_error)
1774 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(1, 45, __pyx_L1_error)
15661775 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15671776 if (__pyx_t_9) {
15681777
15951804 * cdef class Font:
15961805 */
15971806 __Pyx_XDECREF(__pyx_r);
1598 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_match_font); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
1807 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_match_font); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 48, __pyx_L1_error)
15991808 __Pyx_GOTREF(__pyx_t_1);
1600 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 48, __pyx_L1_error)
1809 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 48, __pyx_L1_error)
16011810 __Pyx_GOTREF(__pyx_t_7);
16021811 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16031812 __pyx_r = __pyx_t_7;
17801989 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17811990 switch (pos_args) {
17821991 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1992 CYTHON_FALLTHROUGH;
17831993 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1994 CYTHON_FALLTHROUGH;
17841995 case 0: break;
17851996 default: goto __pyx_L5_argtuple_error;
17861997 }
17871998 kw_args = PyDict_Size(__pyx_kwds);
17881999 switch (pos_args) {
17892000 case 0:
1790 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fi)) != 0)) kw_args--;
2001 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fi)) != 0)) kw_args--;
17912002 else goto __pyx_L5_argtuple_error;
2003 CYTHON_FALLTHROUGH;
17922004 case 1:
1793 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
2005 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
17942006 else {
1795 __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 62, __pyx_L3_error)
2007 __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(1, 62, __pyx_L3_error)
17962008 }
17972009 }
17982010 if (unlikely(kw_args > 0)) {
1799 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 62, __pyx_L3_error)
2011 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 62, __pyx_L3_error)
18002012 }
18012013 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18022014 goto __pyx_L5_argtuple_error;
18092021 }
18102022 goto __pyx_L4_argument_unpacking_done;
18112023 __pyx_L5_argtuple_error:;
1812 __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 62, __pyx_L3_error)
2024 __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 62, __pyx_L3_error)
18132025 __pyx_L3_error:;
18142026 __Pyx_AddTraceback("pygame_sdl2.font.Font.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18152027 __Pyx_RefNannyFinishContext();
18532065 * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size)
18542066 * if self.font == NULL:
18552067 */
1856 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_default_font); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error)
2068 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_default_font); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 64, __pyx_L1_error)
18572069 __Pyx_GOTREF(__pyx_t_4);
18582070 __pyx_t_5 = NULL;
18592071 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
18662078 }
18672079 }
18682080 if (__pyx_t_5) {
1869 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error)
2081 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 64, __pyx_L1_error)
18702082 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18712083 } else {
1872 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error)
2084 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 64, __pyx_L1_error)
18732085 }
18742086 __Pyx_GOTREF(__pyx_t_3);
18752087 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18922104 * if self.font == NULL:
18932105 * raise error()
18942106 */
1895 __pyx_t_6 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(0, 65, __pyx_L1_error)
1896 __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L1_error)
2107 __pyx_t_6 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_6 == ((SDL_RWops *)NULL))) __PYX_ERR(1, 65, __pyx_L1_error)
2108 __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_size); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 65, __pyx_L1_error)
18972109 __pyx_v_self->font = TTF_OpenFontRW(__pyx_t_6, 1, __pyx_t_7);
18982110
18992111 /* "pygame_sdl2/font.pyx":66
19042116 *
19052117 */
19062118 __pyx_t_2 = ((__pyx_v_self->font == NULL) != 0);
1907 if (__pyx_t_2) {
2119 if (unlikely(__pyx_t_2)) {
19082120
19092121 /* "pygame_sdl2/font.pyx":67
19102122 * self.font = TTF_OpenFontRW(to_rwops(fi), 1, size)
19132125 *
19142126 * def render(self, text, antialias, color, background=None):
19152127 */
1916 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __pyx_L1_error)
2128 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 67, __pyx_L1_error)
19172129 __Pyx_GOTREF(__pyx_t_4);
19182130 __pyx_t_5 = NULL;
19192131 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19262138 }
19272139 }
19282140 if (__pyx_t_5) {
1929 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error)
2141 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 67, __pyx_L1_error)
19302142 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19312143 } else {
1932 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error)
2144 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 67, __pyx_L1_error)
19332145 }
19342146 __Pyx_GOTREF(__pyx_t_3);
19352147 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19362148 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
19372149 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1938 __PYX_ERR(0, 67, __pyx_L1_error)
2150 __PYX_ERR(1, 67, __pyx_L1_error)
19392151
19402152 /* "pygame_sdl2/font.pyx":66
19412153 * fi = get_default_font()
19962208 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19972209 switch (pos_args) {
19982210 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2211 CYTHON_FALLTHROUGH;
19992212 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2213 CYTHON_FALLTHROUGH;
20002214 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2215 CYTHON_FALLTHROUGH;
20012216 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2217 CYTHON_FALLTHROUGH;
20022218 case 0: break;
20032219 default: goto __pyx_L5_argtuple_error;
20042220 }
20052221 kw_args = PyDict_Size(__pyx_kwds);
20062222 switch (pos_args) {
20072223 case 0:
2008 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--;
2224 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_text)) != 0)) kw_args--;
20092225 else goto __pyx_L5_argtuple_error;
2226 CYTHON_FALLTHROUGH;
20102227 case 1:
2011 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_antialias)) != 0)) kw_args--;
2228 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_antialias)) != 0)) kw_args--;
20122229 else {
2013 __Pyx_RaiseArgtupleInvalid("render", 0, 3, 4, 1); __PYX_ERR(0, 69, __pyx_L3_error)
2230 __Pyx_RaiseArgtupleInvalid("render", 0, 3, 4, 1); __PYX_ERR(1, 69, __pyx_L3_error)
20142231 }
2232 CYTHON_FALLTHROUGH;
20152233 case 2:
2016 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
2234 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
20172235 else {
2018 __Pyx_RaiseArgtupleInvalid("render", 0, 3, 4, 2); __PYX_ERR(0, 69, __pyx_L3_error)
2236 __Pyx_RaiseArgtupleInvalid("render", 0, 3, 4, 2); __PYX_ERR(1, 69, __pyx_L3_error)
20192237 }
2238 CYTHON_FALLTHROUGH;
20202239 case 3:
20212240 if (kw_args > 0) {
2022 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_background);
2241 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_background);
20232242 if (value) { values[3] = value; kw_args--; }
20242243 }
20252244 }
20262245 if (unlikely(kw_args > 0)) {
2027 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "render") < 0)) __PYX_ERR(0, 69, __pyx_L3_error)
2246 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "render") < 0)) __PYX_ERR(1, 69, __pyx_L3_error)
20282247 }
20292248 } else {
20302249 switch (PyTuple_GET_SIZE(__pyx_args)) {
20312250 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2251 CYTHON_FALLTHROUGH;
20322252 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20332253 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20342254 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20432263 }
20442264 goto __pyx_L4_argument_unpacking_done;
20452265 __pyx_L5_argtuple_error:;
2046 __Pyx_RaiseArgtupleInvalid("render", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 69, __pyx_L3_error)
2266 __Pyx_RaiseArgtupleInvalid("render", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 69, __pyx_L3_error)
20472267 __pyx_L3_error:;
20482268 __Pyx_AddTraceback("pygame_sdl2.font.Font.render", __pyx_clineno, __pyx_lineno, __pyx_filename);
20492269 __Pyx_RefNannyFinishContext();
20842304 * w, h = self.size(" ")
20852305 * return Surface((0, h))
20862306 */
2087 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_text); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 73, __pyx_L1_error)
2307 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_text); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 73, __pyx_L1_error)
20882308 __pyx_t_2 = ((!__pyx_t_1) != 0);
20892309 if (__pyx_t_2) {
20902310
20952315 * return Surface((0, h))
20962316 *
20972317 */
2098 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error)
2318 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 74, __pyx_L1_error)
20992319 __Pyx_GOTREF(__pyx_t_3);
2100 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error)
2320 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 74, __pyx_L1_error)
21012321 __Pyx_GOTREF(__pyx_t_4);
21022322 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21032323 if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
21042324 PyObject* sequence = __pyx_t_4;
2105 #if !CYTHON_COMPILING_IN_PYPY
2106 Py_ssize_t size = Py_SIZE(sequence);
2107 #else
2108 Py_ssize_t size = PySequence_Size(sequence);
2109 #endif
2325 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
21102326 if (unlikely(size != 2)) {
21112327 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
21122328 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
2113 __PYX_ERR(0, 74, __pyx_L1_error)
2329 __PYX_ERR(1, 74, __pyx_L1_error)
21142330 }
21152331 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21162332 if (likely(PyTuple_CheckExact(sequence))) {
21232339 __Pyx_INCREF(__pyx_t_3);
21242340 __Pyx_INCREF(__pyx_t_5);
21252341 #else
2126 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error)
2342 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 74, __pyx_L1_error)
21272343 __Pyx_GOTREF(__pyx_t_3);
2128 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error)
2344 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 74, __pyx_L1_error)
21292345 __Pyx_GOTREF(__pyx_t_5);
21302346 #endif
21312347 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21322348 } else {
21332349 Py_ssize_t index = -1;
2134 __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 74, __pyx_L1_error)
2350 __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 74, __pyx_L1_error)
21352351 __Pyx_GOTREF(__pyx_t_6);
21362352 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21372353 __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
21392355 __Pyx_GOTREF(__pyx_t_3);
21402356 index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
21412357 __Pyx_GOTREF(__pyx_t_5);
2142 if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 74, __pyx_L1_error)
2358 if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(1, 74, __pyx_L1_error)
21432359 __pyx_t_7 = NULL;
21442360 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21452361 goto __pyx_L5_unpacking_done;
21472363 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21482364 __pyx_t_7 = NULL;
21492365 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
2150 __PYX_ERR(0, 74, __pyx_L1_error)
2366 __PYX_ERR(1, 74, __pyx_L1_error)
21512367 __pyx_L5_unpacking_done:;
21522368 }
21532369 __pyx_v_w = __pyx_t_3;
21632379 * to_sdl_color(color, &fg)
21642380 */
21652381 __Pyx_XDECREF(__pyx_r);
2166 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error)
2382 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 75, __pyx_L1_error)
21672383 __Pyx_GOTREF(__pyx_t_4);
21682384 __Pyx_INCREF(__pyx_int_0);
21692385 __Pyx_GIVEREF(__pyx_int_0);
21712387 __Pyx_INCREF(__pyx_v_h);
21722388 __Pyx_GIVEREF(__pyx_v_h);
21732389 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_h);
2174 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error)
2390 __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 75, __pyx_L1_error)
21752391 __Pyx_GOTREF(__pyx_t_5);
2176 __Pyx_GIVEREF(__pyx_t_4);
2177 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
2178 __pyx_t_4 = 0;
2179 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error)
2180 __Pyx_GOTREF(__pyx_t_4);
2181 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2182 __pyx_r = __pyx_t_4;
2183 __pyx_t_4 = 0;
2392 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2393 __pyx_r = __pyx_t_5;
2394 __pyx_t_5 = 0;
21842395 goto __pyx_L0;
21852396
21862397 /* "pygame_sdl2/font.pyx":73
21992410 *
22002411 * TTF_SetFontStyle(self.font, self.style)
22012412 */
2202 __pyx_t_4 = __pyx_f_11pygame_sdl2_5color_to_sdl_color(__pyx_v_color, (&__pyx_v_fg)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error)
2203 __Pyx_GOTREF(__pyx_t_4);
2204 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2413 __pyx_t_5 = __pyx_f_11pygame_sdl2_5color_to_sdl_color(__pyx_v_color, (&__pyx_v_fg)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 77, __pyx_L1_error)
2414 __Pyx_GOTREF(__pyx_t_5);
2415 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22052416
22062417 /* "pygame_sdl2/font.pyx":79
22072418 * to_sdl_color(color, &fg)
22192430 * surf = TTF_RenderUTF8_Blended(self.font, text.encode('utf-8'), fg)
22202431 * else:
22212432 */
2222 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_antialias); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 80, __pyx_L1_error)
2433 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_antialias); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 80, __pyx_L1_error)
22232434 if (__pyx_t_2) {
22242435
22252436 /* "pygame_sdl2/font.pyx":81
22292440 * else:
22302441 * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg)
22312442 */
2232 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error)
2443 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 81, __pyx_L1_error)
2444 __Pyx_GOTREF(__pyx_t_5);
2445 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 81, __pyx_L1_error)
22332446 __Pyx_GOTREF(__pyx_t_4);
2234 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 81, __pyx_L1_error)
2235 __Pyx_GOTREF(__pyx_t_5);
2447 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2448 __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(1, 81, __pyx_L1_error)
2449 __pyx_v_surf = TTF_RenderUTF8_Blended(__pyx_v_self->font, __pyx_t_8, __pyx_v_fg);
22362450 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2237 __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_t_5); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error)
2238 __pyx_v_surf = TTF_RenderUTF8_Blended(__pyx_v_self->font, __pyx_t_8, __pyx_v_fg);
2239 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22402451
22412452 /* "pygame_sdl2/font.pyx":80
22422453 *
22562467 * if surf == NULL:
22572468 */
22582469 /*else*/ {
2259 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error)
2470 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 83, __pyx_L1_error)
2471 __Pyx_GOTREF(__pyx_t_4);
2472 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 83, __pyx_L1_error)
22602473 __Pyx_GOTREF(__pyx_t_5);
2261 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error)
2262 __Pyx_GOTREF(__pyx_t_4);
2474 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2475 __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_t_5); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(1, 83, __pyx_L1_error)
2476 __pyx_v_surf = TTF_RenderUTF8_Solid(__pyx_v_self->font, __pyx_t_9, __pyx_v_fg);
22632477 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2264 __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error)
2265 __pyx_v_surf = TTF_RenderUTF8_Solid(__pyx_v_self->font, __pyx_t_9, __pyx_v_fg);
2266 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22672478 }
22682479 __pyx_L6:;
22692480
22752486 *
22762487 */
22772488 __pyx_t_2 = ((__pyx_v_surf == NULL) != 0);
2278 if (__pyx_t_2) {
2489 if (unlikely(__pyx_t_2)) {
22792490
22802491 /* "pygame_sdl2/font.pyx":86
22812492 *
22842495 *
22852496 * cdef Surface rv = Surface(())
22862497 */
2287 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error)
2288 __Pyx_GOTREF(__pyx_t_5);
2498 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 86, __pyx_L1_error)
2499 __Pyx_GOTREF(__pyx_t_4);
22892500 __pyx_t_3 = NULL;
2290 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
2291 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
2501 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
2502 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
22922503 if (likely(__pyx_t_3)) {
2293 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
2504 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
22942505 __Pyx_INCREF(__pyx_t_3);
22952506 __Pyx_INCREF(function);
2296 __Pyx_DECREF_SET(__pyx_t_5, function);
2507 __Pyx_DECREF_SET(__pyx_t_4, function);
22972508 }
22982509 }
22992510 if (__pyx_t_3) {
2300 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
2511 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 86, __pyx_L1_error)
23012512 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23022513 } else {
2303 __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
2304 }
2305 __Pyx_GOTREF(__pyx_t_4);
2514 __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 86, __pyx_L1_error)
2515 }
2516 __Pyx_GOTREF(__pyx_t_5);
2517 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2518 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
23062519 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2307 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
2308 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2309 __PYX_ERR(0, 86, __pyx_L1_error)
2520 __PYX_ERR(1, 86, __pyx_L1_error)
23102521
23112522 /* "pygame_sdl2/font.pyx":85
23122523 * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg)
23242535 * rv.take_surface(surf)
23252536 *
23262537 */
2327 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error)
2328 __Pyx_GOTREF(__pyx_t_4);
2329 __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_4);
2330 __pyx_t_4 = 0;
2538 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 88, __pyx_L1_error)
2539 __Pyx_GOTREF(__pyx_t_5);
2540 __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_5);
2541 __pyx_t_5 = 0;
23312542
23322543 /* "pygame_sdl2/font.pyx":89
23332544 *
23552566 *
23562567 * if background is not None:
23572568 */
2358 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rv), __pyx_n_s_convert); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 92, __pyx_L1_error)
2359 __Pyx_GOTREF(__pyx_t_5);
2569 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rv), __pyx_n_s_convert); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 92, __pyx_L1_error)
2570 __Pyx_GOTREF(__pyx_t_4);
23602571 __pyx_t_3 = NULL;
2361 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
2362 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
2572 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
2573 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
23632574 if (likely(__pyx_t_3)) {
2364 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
2575 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
23652576 __Pyx_INCREF(__pyx_t_3);
23662577 __Pyx_INCREF(function);
2367 __Pyx_DECREF_SET(__pyx_t_5, function);
2578 __Pyx_DECREF_SET(__pyx_t_4, function);
23682579 }
23692580 }
23702581 if (__pyx_t_3) {
2371 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
2582 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 92, __pyx_L1_error)
23722583 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23732584 } else {
2374 __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
2375 }
2376 __Pyx_GOTREF(__pyx_t_4);
2377 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2378 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(0, 92, __pyx_L1_error)
2379 __Pyx_DECREF_SET(__pyx_v_rv, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_4));
2380 __pyx_t_4 = 0;
2585 __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 92, __pyx_L1_error)
2586 }
2587 __Pyx_GOTREF(__pyx_t_5);
2588 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2589 if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_11pygame_sdl2_7surface_Surface))))) __PYX_ERR(1, 92, __pyx_L1_error)
2590 __Pyx_DECREF_SET(__pyx_v_rv, ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_5));
2591 __pyx_t_5 = 0;
23812592
23822593 /* "pygame_sdl2/font.pyx":91
23832594 * rv.take_surface(surf)
24062617 * bgsurf.fill(background)
24072618 * bgsurf.blit(rv, (0,0))
24082619 */
2409 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rv), __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 95, __pyx_L1_error)
2410 __Pyx_GOTREF(__pyx_t_5);
2620 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rv), __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 95, __pyx_L1_error)
2621 __Pyx_GOTREF(__pyx_t_4);
24112622 __pyx_t_3 = NULL;
2412 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
2413 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
2623 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
2624 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
24142625 if (likely(__pyx_t_3)) {
2415 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
2626 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
24162627 __Pyx_INCREF(__pyx_t_3);
24172628 __Pyx_INCREF(function);
2418 __Pyx_DECREF_SET(__pyx_t_5, function);
2629 __Pyx_DECREF_SET(__pyx_t_4, function);
24192630 }
24202631 }
24212632 if (__pyx_t_3) {
2422 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
2633 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 95, __pyx_L1_error)
24232634 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24242635 } else {
2425 __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 95, __pyx_L1_error)
2426 }
2427 __Pyx_GOTREF(__pyx_t_4);
2428 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2429 __pyx_v_bgsurf = __pyx_t_4;
2430 __pyx_t_4 = 0;
2636 __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 95, __pyx_L1_error)
2637 }
2638 __Pyx_GOTREF(__pyx_t_5);
2639 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2640 __pyx_v_bgsurf = __pyx_t_5;
2641 __pyx_t_5 = 0;
24312642
24322643 /* "pygame_sdl2/font.pyx":96
24332644 * if background is not None:
24362647 * bgsurf.blit(rv, (0,0))
24372648 * return bgsurf
24382649 */
2439 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_bgsurf, __pyx_n_s_fill); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
2440 __Pyx_GOTREF(__pyx_t_5);
2650 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_bgsurf, __pyx_n_s_fill); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 96, __pyx_L1_error)
2651 __Pyx_GOTREF(__pyx_t_4);
24412652 __pyx_t_3 = NULL;
2442 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
2443 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
2653 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
2654 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
24442655 if (likely(__pyx_t_3)) {
2445 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
2656 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
24462657 __Pyx_INCREF(__pyx_t_3);
24472658 __Pyx_INCREF(function);
2448 __Pyx_DECREF_SET(__pyx_t_5, function);
2659 __Pyx_DECREF_SET(__pyx_t_4, function);
24492660 }
24502661 }
24512662 if (!__pyx_t_3) {
2452 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_background); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
2453 __Pyx_GOTREF(__pyx_t_4);
2663 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_background); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 96, __pyx_L1_error)
2664 __Pyx_GOTREF(__pyx_t_5);
24542665 } else {
24552666 #if CYTHON_FAST_PYCALL
2456 if (PyFunction_Check(__pyx_t_5)) {
2667 if (PyFunction_Check(__pyx_t_4)) {
24572668 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_background};
2458 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
2669 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 96, __pyx_L1_error)
24592670 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2460 __Pyx_GOTREF(__pyx_t_4);
2671 __Pyx_GOTREF(__pyx_t_5);
24612672 } else
24622673 #endif
24632674 #if CYTHON_FAST_PYCCALL
2464 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
2675 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
24652676 PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_background};
2466 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
2677 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 96, __pyx_L1_error)
24672678 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2468 __Pyx_GOTREF(__pyx_t_4);
2679 __Pyx_GOTREF(__pyx_t_5);
24692680 } else
24702681 #endif
24712682 {
2472 __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 96, __pyx_L1_error)
2683 __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 96, __pyx_L1_error)
24732684 __Pyx_GOTREF(__pyx_t_6);
24742685 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
24752686 __Pyx_INCREF(__pyx_v_background);
24762687 __Pyx_GIVEREF(__pyx_v_background);
24772688 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_background);
2478 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
2479 __Pyx_GOTREF(__pyx_t_4);
2689 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 96, __pyx_L1_error)
2690 __Pyx_GOTREF(__pyx_t_5);
24802691 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24812692 }
24822693 }
2694 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24832695 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2484 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24852696
24862697 /* "pygame_sdl2/font.pyx":97
24872698 * bgsurf = rv.copy()
24902701 * return bgsurf
24912702 * return rv
24922703 */
2493 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_bgsurf, __pyx_n_s_blit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
2494 __Pyx_GOTREF(__pyx_t_5);
2704 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_bgsurf, __pyx_n_s_blit); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 97, __pyx_L1_error)
2705 __Pyx_GOTREF(__pyx_t_4);
24952706 __pyx_t_6 = NULL;
24962707 __pyx_t_10 = 0;
2497 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
2498 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
2708 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
2709 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
24992710 if (likely(__pyx_t_6)) {
2500 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
2711 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
25012712 __Pyx_INCREF(__pyx_t_6);
25022713 __Pyx_INCREF(function);
2503 __Pyx_DECREF_SET(__pyx_t_5, function);
2714 __Pyx_DECREF_SET(__pyx_t_4, function);
25042715 __pyx_t_10 = 1;
25052716 }
25062717 }
25072718 #if CYTHON_FAST_PYCALL
2508 if (PyFunction_Check(__pyx_t_5)) {
2719 if (PyFunction_Check(__pyx_t_4)) {
25092720 PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_rv), __pyx_tuple__7};
2510 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
2721 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 97, __pyx_L1_error)
25112722 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
2512 __Pyx_GOTREF(__pyx_t_4);
2723 __Pyx_GOTREF(__pyx_t_5);
25132724 } else
25142725 #endif
25152726 #if CYTHON_FAST_PYCCALL
2516 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
2727 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
25172728 PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_rv), __pyx_tuple__7};
2518 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
2729 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 97, __pyx_L1_error)
25192730 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
2520 __Pyx_GOTREF(__pyx_t_4);
2731 __Pyx_GOTREF(__pyx_t_5);
25212732 } else
25222733 #endif
25232734 {
2524 __pyx_t_3 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error)
2735 __pyx_t_3 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 97, __pyx_L1_error)
25252736 __Pyx_GOTREF(__pyx_t_3);
25262737 if (__pyx_t_6) {
25272738 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
25322743 __Pyx_INCREF(__pyx_tuple__7);
25332744 __Pyx_GIVEREF(__pyx_tuple__7);
25342745 PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_10, __pyx_tuple__7);
2535 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
2536 __Pyx_GOTREF(__pyx_t_4);
2746 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 97, __pyx_L1_error)
2747 __Pyx_GOTREF(__pyx_t_5);
25372748 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25382749 }
2750 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25392751 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2540 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25412752
25422753 /* "pygame_sdl2/font.pyx":98
25432754 * bgsurf.fill(background)
26382849 * raise error()
26392850 * return w, h
26402851 */
2641 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
2852 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 103, __pyx_L1_error)
26422853 __Pyx_GOTREF(__pyx_t_1);
2643 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
2854 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 103, __pyx_L1_error)
26442855 __Pyx_GOTREF(__pyx_t_2);
26452856 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2646 __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L1_error)
2857 __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(1, 103, __pyx_L1_error)
26472858 __pyx_t_4 = ((TTF_SizeUTF8(__pyx_v_self->font, __pyx_t_3, (&__pyx_v_w), (&__pyx_v_h)) != 0) != 0);
26482859 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2649 if (__pyx_t_4) {
2860 if (unlikely(__pyx_t_4)) {
26502861
26512862 /* "pygame_sdl2/font.pyx":104
26522863 * cdef int w, h
26552866 * return w, h
26562867 *
26572868 */
2658 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
2869 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 104, __pyx_L1_error)
26592870 __Pyx_GOTREF(__pyx_t_1);
26602871 __pyx_t_5 = NULL;
26612872 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
26682879 }
26692880 }
26702881 if (__pyx_t_5) {
2671 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
2882 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 104, __pyx_L1_error)
26722883 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26732884 } else {
2674 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
2885 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 104, __pyx_L1_error)
26752886 }
26762887 __Pyx_GOTREF(__pyx_t_2);
26772888 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26782889 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
26792890 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2680 __PYX_ERR(0, 104, __pyx_L1_error)
2891 __PYX_ERR(1, 104, __pyx_L1_error)
26812892
26822893 /* "pygame_sdl2/font.pyx":103
26832894 * def size(self, text):
26962907 * cdef set_style(self, flag, on):
26972908 */
26982909 __Pyx_XDECREF(__pyx_r);
2699 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
2910 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 105, __pyx_L1_error)
27002911 __Pyx_GOTREF(__pyx_t_2);
2701 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
2912 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 105, __pyx_L1_error)
27022913 __Pyx_GOTREF(__pyx_t_1);
2703 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 105, __pyx_L1_error)
2914 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 105, __pyx_L1_error)
27042915 __Pyx_GOTREF(__pyx_t_5);
27052916 __Pyx_GIVEREF(__pyx_t_2);
27062917 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
27582969 * self.style |= flag
27592970 * else:
27602971 */
2761 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_on); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 108, __pyx_L1_error)
2972 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_on); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 108, __pyx_L1_error)
27622973 if (__pyx_t_1) {
27632974
27642975 /* "pygame_sdl2/font.pyx":109
27682979 * else:
27692980 * self.style &= ~flag
27702981 */
2771 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->style); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
2982 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->style); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 109, __pyx_L1_error)
27722983 __Pyx_GOTREF(__pyx_t_2);
2773 __pyx_t_3 = PyNumber_InPlaceOr(__pyx_t_2, __pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L1_error)
2984 __pyx_t_3 = PyNumber_InPlaceOr(__pyx_t_2, __pyx_v_flag); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 109, __pyx_L1_error)
27742985 __Pyx_GOTREF(__pyx_t_3);
27752986 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2776 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 109, __pyx_L1_error)
2987 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 109, __pyx_L1_error)
27772988 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27782989 __pyx_v_self->style = __pyx_t_4;
27792990
27953006 * def set_underline(self, on):
27963007 */
27973008 /*else*/ {
2798 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->style); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error)
3009 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->style); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 111, __pyx_L1_error)
27993010 __Pyx_GOTREF(__pyx_t_3);
2800 __pyx_t_2 = PyNumber_Invert(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
3011 __pyx_t_2 = PyNumber_Invert(__pyx_v_flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 111, __pyx_L1_error)
28013012 __Pyx_GOTREF(__pyx_t_2);
2802 __pyx_t_5 = PyNumber_InPlaceAnd(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 111, __pyx_L1_error)
3013 __pyx_t_5 = PyNumber_InPlaceAnd(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 111, __pyx_L1_error)
28033014 __Pyx_GOTREF(__pyx_t_5);
28043015 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28053016 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2806 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L1_error)
3017 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 111, __pyx_L1_error)
28073018 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28083019 __pyx_v_self->style = __pyx_t_4;
28093020 }
28673078 *
28683079 * def get_underline(self):
28693080 */
2870 __pyx_t_1 = __Pyx_PyInt_From_int(TTF_STYLE_UNDERLINE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
3081 __pyx_t_1 = __Pyx_PyInt_From_int(TTF_STYLE_UNDERLINE); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 114, __pyx_L1_error)
28713082 __Pyx_GOTREF(__pyx_t_1);
2872 __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *)__pyx_v_self->__pyx_vtab)->set_style(__pyx_v_self, __pyx_t_1, __pyx_v_on); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
3083 __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *)__pyx_v_self->__pyx_vtab)->set_style(__pyx_v_self, __pyx_t_1, __pyx_v_on); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 114, __pyx_L1_error)
28733084 __Pyx_GOTREF(__pyx_t_2);
28743085 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28753086 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29313142 * def set_bold(self, on):
29323143 */
29333144 __Pyx_XDECREF(__pyx_r);
2934 __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->style & TTF_STYLE_UNDERLINE)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
3145 __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->style & TTF_STYLE_UNDERLINE)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error)
29353146 __Pyx_GOTREF(__pyx_t_1);
29363147 __pyx_r = __pyx_t_1;
29373148 __pyx_t_1 = 0;
29913202 *
29923203 * def get_bold(self):
29933204 */
2994 __pyx_t_1 = __Pyx_PyInt_From_int(TTF_STYLE_BOLD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
3205 __pyx_t_1 = __Pyx_PyInt_From_int(TTF_STYLE_BOLD); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 120, __pyx_L1_error)
29953206 __Pyx_GOTREF(__pyx_t_1);
2996 __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *)__pyx_v_self->__pyx_vtab)->set_style(__pyx_v_self, __pyx_t_1, __pyx_v_on); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
3207 __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *)__pyx_v_self->__pyx_vtab)->set_style(__pyx_v_self, __pyx_t_1, __pyx_v_on); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 120, __pyx_L1_error)
29973208 __Pyx_GOTREF(__pyx_t_2);
29983209 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29993210 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30553266 * def set_italic(self, on):
30563267 */
30573268 __Pyx_XDECREF(__pyx_r);
3058 __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->style & TTF_STYLE_BOLD)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
3269 __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->style & TTF_STYLE_BOLD)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 123, __pyx_L1_error)
30593270 __Pyx_GOTREF(__pyx_t_1);
30603271 __pyx_r = __pyx_t_1;
30613272 __pyx_t_1 = 0;
31153326 *
31163327 * def get_italic(self):
31173328 */
3118 __pyx_t_1 = __Pyx_PyInt_From_int(TTF_STYLE_ITALIC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
3329 __pyx_t_1 = __Pyx_PyInt_From_int(TTF_STYLE_ITALIC); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 126, __pyx_L1_error)
31193330 __Pyx_GOTREF(__pyx_t_1);
3120 __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *)__pyx_v_self->__pyx_vtab)->set_style(__pyx_v_self, __pyx_t_1, __pyx_v_on); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
3331 __pyx_t_2 = ((struct __pyx_vtabstruct_11pygame_sdl2_4font_Font *)__pyx_v_self->__pyx_vtab)->set_style(__pyx_v_self, __pyx_t_1, __pyx_v_on); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 126, __pyx_L1_error)
31213332 __Pyx_GOTREF(__pyx_t_2);
31223333 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
31233334 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
31793390 * def get_linesize(self):
31803391 */
31813392 __Pyx_XDECREF(__pyx_r);
3182 __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->style & TTF_STYLE_ITALIC)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
3393 __pyx_t_1 = __Pyx_PyInt_From_int((__pyx_v_self->style & TTF_STYLE_ITALIC)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error)
31833394 __Pyx_GOTREF(__pyx_t_1);
31843395 __pyx_r = __pyx_t_1;
31853396 __pyx_t_1 = 0;
32393450 * def get_height(self):
32403451 */
32413452 __Pyx_XDECREF(__pyx_r);
3242 __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontLineSkip(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
3453 __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontLineSkip(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 132, __pyx_L1_error)
32433454 __Pyx_GOTREF(__pyx_t_1);
32443455 __pyx_r = __pyx_t_1;
32453456 __pyx_t_1 = 0;
32993510 * def get_ascent(self):
33003511 */
33013512 __Pyx_XDECREF(__pyx_r);
3302 __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontHeight(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
3513 __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontHeight(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 135, __pyx_L1_error)
33033514 __Pyx_GOTREF(__pyx_t_1);
33043515 __pyx_r = __pyx_t_1;
33053516 __pyx_t_1 = 0;
33593570 * def get_descent(self):
33603571 */
33613572 __Pyx_XDECREF(__pyx_r);
3362 __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontAscent(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error)
3573 __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontAscent(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 138, __pyx_L1_error)
33633574 __Pyx_GOTREF(__pyx_t_1);
33643575 __pyx_r = __pyx_t_1;
33653576 __pyx_t_1 = 0;
34193630 * def metrics(self, text not None):
34203631 */
34213632 __Pyx_XDECREF(__pyx_r);
3422 __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontDescent(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
3633 __pyx_t_1 = __Pyx_PyInt_From_int(TTF_FontDescent(__pyx_v_self->font)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 141, __pyx_L1_error)
34233634 __Pyx_GOTREF(__pyx_t_1);
34243635 __pyx_r = __pyx_t_1;
34253636 __pyx_t_1 = 0;
34593670 __Pyx_RefNannyDeclarations
34603671 __Pyx_RefNannySetupContext("metrics (wrapper)", 0);
34613672 if (unlikely(((PyObject *)__pyx_v_text) == Py_None)) {
3462 PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "text"); __PYX_ERR(0, 143, __pyx_L1_error)
3673 PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "text"); __PYX_ERR(1, 143, __pyx_L1_error)
34633674 }
34643675 __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_30metrics(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), ((PyObject *)__pyx_v_text));
34653676
35043715 *
35053716 * for ch in text:
35063717 */
3507 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
3718 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 146, __pyx_L1_error)
35083719 __Pyx_GOTREF(__pyx_t_1);
35093720 __pyx_v_rv = ((PyObject*)__pyx_t_1);
35103721 __pyx_t_1 = 0;
35203731 __pyx_t_1 = __pyx_v_text; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
35213732 __pyx_t_3 = NULL;
35223733 } else {
3523 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
3734 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 148, __pyx_L1_error)
35243735 __Pyx_GOTREF(__pyx_t_1);
3525 __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
3736 __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
35263737 }
35273738 for (;;) {
35283739 if (likely(!__pyx_t_3)) {
35293740 if (likely(PyList_CheckExact(__pyx_t_1))) {
35303741 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
35313742 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3532 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 148, __pyx_L1_error)
3743 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 148, __pyx_L1_error)
35333744 #else
3534 __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
3745 __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 148, __pyx_L1_error)
35353746 __Pyx_GOTREF(__pyx_t_4);
35363747 #endif
35373748 } else {
35383749 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
35393750 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3540 __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 148, __pyx_L1_error)
3751 __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 148, __pyx_L1_error)
35413752 #else
3542 __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
3753 __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 148, __pyx_L1_error)
35433754 __Pyx_GOTREF(__pyx_t_4);
35443755 #endif
35453756 }
35483759 if (unlikely(!__pyx_t_4)) {
35493760 PyObject* exc_type = PyErr_Occurred();
35503761 if (exc_type) {
3551 if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3552 else __PYX_ERR(0, 148, __pyx_L1_error)
3762 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3763 else __PYX_ERR(1, 148, __pyx_L1_error)
35533764 }
35543765 break;
35553766 }
35653776 *
35663777 * if TTF_GlyphMetrics(self.font, chnum, &minx, &maxx, &miny, &maxy, &advance) == 0:
35673778 */
3568 __pyx_t_5 = __Pyx_PyObject_Ord(__pyx_v_ch); if (unlikely(__pyx_t_5 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 149, __pyx_L1_error)
3779 __pyx_t_5 = __Pyx_PyObject_Ord(__pyx_v_ch); if (unlikely(__pyx_t_5 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(1, 149, __pyx_L1_error)
35693780 __pyx_v_chnum = __pyx_t_5;
35703781
35713782 /* "pygame_sdl2/font.pyx":151
35853796 * else:
35863797 * rv.append(None)
35873798 */
3588 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
3799 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_minx); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 152, __pyx_L1_error)
35893800 __Pyx_GOTREF(__pyx_t_4);
3590 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_maxx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 152, __pyx_L1_error)
3801 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_maxx); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 152, __pyx_L1_error)
35913802 __Pyx_GOTREF(__pyx_t_7);
3592 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_miny); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 152, __pyx_L1_error)
3803 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_miny); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 152, __pyx_L1_error)
35933804 __Pyx_GOTREF(__pyx_t_8);
3594 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_maxy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 152, __pyx_L1_error)
3805 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_maxy); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 152, __pyx_L1_error)
35953806 __Pyx_GOTREF(__pyx_t_9);
3596 __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_advance); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 152, __pyx_L1_error)
3807 __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_advance); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 152, __pyx_L1_error)
35973808 __Pyx_GOTREF(__pyx_t_10);
3598 __pyx_t_11 = PyTuple_New(5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 152, __pyx_L1_error)
3809 __pyx_t_11 = PyTuple_New(5); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 152, __pyx_L1_error)
35993810 __Pyx_GOTREF(__pyx_t_11);
36003811 __Pyx_GIVEREF(__pyx_t_4);
36013812 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4);
36123823 __pyx_t_8 = 0;
36133824 __pyx_t_9 = 0;
36143825 __pyx_t_10 = 0;
3615 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_t_11); if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 152, __pyx_L1_error)
3826 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_t_11); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(1, 152, __pyx_L1_error)
36163827 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
36173828
36183829 /* "pygame_sdl2/font.pyx":151
36333844 * return rv
36343845 */
36353846 /*else*/ {
3636 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_rv, Py_None); if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 154, __pyx_L1_error)
3847 __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_rv, Py_None); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(1, 154, __pyx_L1_error)
36373848 }
36383849 __pyx_L5:;
36393850
36833894 __Pyx_RefNannyFinishContext();
36843895 return __pyx_r;
36853896 }
3897
3898 /* "(tree fragment)":1
3899 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3900 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3901 * def __setstate_cython__(self, __pyx_state):
3902 */
3903
3904 /* Python wrapper */
3905 static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_33__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3906 static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_33__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3907 PyObject *__pyx_r = 0;
3908 __Pyx_RefNannyDeclarations
3909 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3910 __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_32__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self));
3911
3912 /* function exit code */
3913 __Pyx_RefNannyFinishContext();
3914 return __pyx_r;
3915 }
3916
3917 static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_32__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self) {
3918 PyObject *__pyx_r = NULL;
3919 __Pyx_RefNannyDeclarations
3920 PyObject *__pyx_t_1 = NULL;
3921 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3922
3923 /* "(tree fragment)":2
3924 * def __reduce_cython__(self):
3925 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3926 * def __setstate_cython__(self, __pyx_state):
3927 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3928 */
3929 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
3930 __Pyx_GOTREF(__pyx_t_1);
3931 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3932 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3933 __PYX_ERR(0, 2, __pyx_L1_error)
3934
3935 /* "(tree fragment)":1
3936 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3937 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3938 * def __setstate_cython__(self, __pyx_state):
3939 */
3940
3941 /* function exit code */
3942 __pyx_L1_error:;
3943 __Pyx_XDECREF(__pyx_t_1);
3944 __Pyx_AddTraceback("pygame_sdl2.font.Font.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3945 __pyx_r = NULL;
3946 __Pyx_XGIVEREF(__pyx_r);
3947 __Pyx_RefNannyFinishContext();
3948 return __pyx_r;
3949 }
3950
3951 /* "(tree fragment)":3
3952 * def __reduce_cython__(self):
3953 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3954 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3955 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3956 */
3957
3958 /* Python wrapper */
3959 static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_35__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
3960 static PyObject *__pyx_pw_11pygame_sdl2_4font_4Font_35__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3961 PyObject *__pyx_r = 0;
3962 __Pyx_RefNannyDeclarations
3963 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3964 __pyx_r = __pyx_pf_11pygame_sdl2_4font_4Font_34__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_4font_Font *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3965
3966 /* function exit code */
3967 __Pyx_RefNannyFinishContext();
3968 return __pyx_r;
3969 }
3970
3971 static PyObject *__pyx_pf_11pygame_sdl2_4font_4Font_34__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4font_Font *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3972 PyObject *__pyx_r = NULL;
3973 __Pyx_RefNannyDeclarations
3974 PyObject *__pyx_t_1 = NULL;
3975 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3976
3977 /* "(tree fragment)":4
3978 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3979 * def __setstate_cython__(self, __pyx_state):
3980 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3981 */
3982 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
3983 __Pyx_GOTREF(__pyx_t_1);
3984 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3985 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3986 __PYX_ERR(0, 4, __pyx_L1_error)
3987
3988 /* "(tree fragment)":3
3989 * def __reduce_cython__(self):
3990 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3991 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3992 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3993 */
3994
3995 /* function exit code */
3996 __pyx_L1_error:;
3997 __Pyx_XDECREF(__pyx_t_1);
3998 __Pyx_AddTraceback("pygame_sdl2.font.Font.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3999 __pyx_r = NULL;
4000 __Pyx_XGIVEREF(__pyx_r);
4001 __Pyx_RefNannyFinishContext();
4002 return __pyx_r;
4003 }
36864004 static struct __pyx_vtabstruct_11pygame_sdl2_4font_Font __pyx_vtable_11pygame_sdl2_4font_Font;
36874005
36884006 static PyObject *__pyx_tp_new_11pygame_sdl2_4font_Font(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
37044022 }
37054023
37064024 static void __pyx_tp_dealloc_11pygame_sdl2_4font_Font(PyObject *o) {
3707 #if PY_VERSION_HEX >= 0x030400a1
3708 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
4025 #if CYTHON_USE_TP_FINALIZE
4026 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
37094027 if (PyObject_CallFinalizerFromDealloc(o)) return;
37104028 }
37114029 #endif
37344052 {"get_ascent", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_27get_ascent, METH_NOARGS, 0},
37354053 {"get_descent", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_29get_descent, METH_NOARGS, 0},
37364054 {"metrics", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_31metrics, METH_O, 0},
4055 {"__reduce_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_33__reduce_cython__, METH_NOARGS, 0},
4056 {"__setstate_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_4font_4Font_35__setstate_cython__, METH_O, 0},
37374057 {0, 0, 0, 0}
37384058 };
37394059
38004120 };
38014121
38024122 #if PY_MAJOR_VERSION >= 3
4123 #if CYTHON_PEP489_MULTI_PHASE_INIT
4124 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
4125 static int __pyx_pymod_exec_font(PyObject* module); /*proto*/
4126 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
4127 {Py_mod_create, (void*)__pyx_pymod_create},
4128 {Py_mod_exec, (void*)__pyx_pymod_exec_font},
4129 {0, NULL}
4130 };
4131 #endif
4132
38034133 static struct PyModuleDef __pyx_moduledef = {
3804 #if PY_VERSION_HEX < 0x03020000
3805 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
3806 #else
38074134 PyModuleDef_HEAD_INIT,
3808 #endif
38094135 "font",
38104136 0, /* m_doc */
4137 #if CYTHON_PEP489_MULTI_PHASE_INIT
4138 0, /* m_size */
4139 #else
38114140 -1, /* m_size */
4141 #endif
38124142 __pyx_methods /* m_methods */,
4143 #if CYTHON_PEP489_MULTI_PHASE_INIT
4144 __pyx_moduledef_slots, /* m_slots */
4145 #else
38134146 NULL, /* m_reload */
4147 #endif
38144148 NULL, /* m_traverse */
38154149 NULL, /* m_clear */
38164150 NULL /* m_free */
38204154 static __Pyx_StringTabEntry __pyx_string_tab[] = {
38214155 {&__pyx_kp_u_DejaVuSans_ttf, __pyx_k_DejaVuSans_ttf, sizeof(__pyx_k_DejaVuSans_ttf), 0, 1, 0, 0},
38224156 {&__pyx_n_s_SysFont, __pyx_k_SysFont, sizeof(__pyx_k_SysFont), 0, 0, 1, 1},
4157 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
38234158 {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
38244159 {&__pyx_n_s_antialias, __pyx_k_antialias, sizeof(__pyx_k_antialias), 0, 0, 1, 1},
38254160 {&__pyx_n_s_background, __pyx_k_background, sizeof(__pyx_k_background), 0, 0, 1, 1},
38264161 {&__pyx_n_s_blit, __pyx_k_blit, sizeof(__pyx_k_blit), 0, 0, 1, 1},
4162 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
38274163 {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1},
38284164 {&__pyx_n_s_convert, __pyx_k_convert, sizeof(__pyx_k_convert), 0, 0, 1, 1},
38294165 {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
38384174 {&__pyx_n_s_get_default_font, __pyx_k_get_default_font, sizeof(__pyx_k_get_default_font), 0, 0, 1, 1},
38394175 {&__pyx_n_s_get_fonts, __pyx_k_get_fonts, sizeof(__pyx_k_get_fonts), 0, 0, 1, 1},
38404176 {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1},
4177 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
38414178 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
38424179 {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
38434180 {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
38444181 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
38454182 {&__pyx_n_s_match_font, __pyx_k_match_font, sizeof(__pyx_k_match_font), 0, 0, 1, 1},
4183 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
4184 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
38464185 {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
38474186 {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
38484187 {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1},
38514190 {&__pyx_n_s_pygame_sdl2_sysfont, __pyx_k_pygame_sdl2_sysfont, sizeof(__pyx_k_pygame_sdl2_sysfont), 0, 0, 1, 1},
38524191 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
38534192 {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1},
4193 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
4194 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
4195 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
38544196 {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1},
38554197 {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1},
38564198 {&__pyx_n_u_sans, __pyx_k_sans, sizeof(__pyx_k_sans), 0, 1, 0, 1},
4199 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
4200 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
38574201 {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
38584202 {&__pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_k_src_pygame_sdl2_font_pyx, sizeof(__pyx_k_src_pygame_sdl2_font_pyx), 0, 0, 1, 0},
38594203 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
38624206 {0, 0, 0, 0, 0, 0, 0}
38634207 };
38644208 static int __Pyx_InitCachedBuiltins(void) {
4209 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error)
38654210 return 0;
4211 __pyx_L1_error:;
4212 return -1;
38664213 }
38674214
38684215 static int __Pyx_InitCachedConstants(void) {
38764223 *
38774224 * cdef class Font:
38784225 */
3879 __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_u_sans); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 48, __pyx_L1_error)
4226 __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_u_sans); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 48, __pyx_L1_error)
38804227 __Pyx_GOTREF(__pyx_tuple_);
38814228 __Pyx_GIVEREF(__pyx_tuple_);
38824229
38874234 * return Surface((0, h))
38884235 *
38894236 */
3890 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u__2); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 74, __pyx_L1_error)
4237 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u__2); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 74, __pyx_L1_error)
38914238 __Pyx_GOTREF(__pyx_tuple__3);
38924239 __Pyx_GIVEREF(__pyx_tuple__3);
38934240
38984245 * else:
38994246 * surf = TTF_RenderUTF8_Solid(self.font, text.encode('utf-8'), fg)
39004247 */
3901 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 81, __pyx_L1_error)
4248 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 81, __pyx_L1_error)
39024249 __Pyx_GOTREF(__pyx_tuple__4);
39034250 __Pyx_GIVEREF(__pyx_tuple__4);
39044251
39094256 *
39104257 * if surf == NULL:
39114258 */
3912 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 83, __pyx_L1_error)
4259 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 83, __pyx_L1_error)
39134260 __Pyx_GOTREF(__pyx_tuple__5);
39144261 __Pyx_GIVEREF(__pyx_tuple__5);
39154262
39204267 * rv.take_surface(surf)
39214268 *
39224269 */
3923 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 88, __pyx_L1_error)
4270 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 88, __pyx_L1_error)
39244271 __Pyx_GOTREF(__pyx_tuple__6);
39254272 __Pyx_GIVEREF(__pyx_tuple__6);
39264273
39314278 * return bgsurf
39324279 * return rv
39334280 */
3934 __pyx_tuple__7 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 97, __pyx_L1_error)
4281 __pyx_tuple__7 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 97, __pyx_L1_error)
39354282 __Pyx_GOTREF(__pyx_tuple__7);
39364283 __Pyx_GIVEREF(__pyx_tuple__7);
39374284
39424289 * raise error()
39434290 * return w, h
39444291 */
3945 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 103, __pyx_L1_error)
4292 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_utf_8); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 103, __pyx_L1_error)
39464293 __Pyx_GOTREF(__pyx_tuple__8);
39474294 __Pyx_GIVEREF(__pyx_tuple__8);
4295
4296 /* "(tree fragment)":2
4297 * def __reduce_cython__(self):
4298 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4299 * def __setstate_cython__(self, __pyx_state):
4300 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4301 */
4302 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 2, __pyx_L1_error)
4303 __Pyx_GOTREF(__pyx_tuple__9);
4304 __Pyx_GIVEREF(__pyx_tuple__9);
4305
4306 /* "(tree fragment)":4
4307 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4308 * def __setstate_cython__(self, __pyx_state):
4309 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4310 */
4311 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 4, __pyx_L1_error)
4312 __Pyx_GOTREF(__pyx_tuple__10);
4313 __Pyx_GIVEREF(__pyx_tuple__10);
39484314
39494315 /* "pygame_sdl2/font.pyx":30
39504316 *
39534319 * TTF_Init()
39544320 *
39554321 */
3956 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_init, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 30, __pyx_L1_error)
4322 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_init, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(1, 30, __pyx_L1_error)
39574323
39584324 /* "pygame_sdl2/font.pyx":34
39594325 *
39624328 * TTF_Quit()
39634329 *
39644330 */
3965 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_quit, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 34, __pyx_L1_error)
4331 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_quit, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(1, 34, __pyx_L1_error)
39664332
39674333 /* "pygame_sdl2/font.pyx":37
39684334 * TTF_Quit()
39714337 * return TTF_WasInit() != 0
39724338 *
39734339 */
3974 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_init, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 37, __pyx_L1_error)
4340 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_init, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(1, 37, __pyx_L1_error)
39754341
39764342 /* "pygame_sdl2/font.pyx":40
39774343 * return TTF_WasInit() != 0
39804346 * import os
39814347 *
39824348 */
3983 __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_s_os, __pyx_n_s_default); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 40, __pyx_L1_error)
3984 __Pyx_GOTREF(__pyx_tuple__12);
3985 __Pyx_GIVEREF(__pyx_tuple__12);
3986 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_default_font, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 40, __pyx_L1_error)
4349 __pyx_tuple__14 = PyTuple_Pack(2, __pyx_n_s_os, __pyx_n_s_default); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 40, __pyx_L1_error)
4350 __Pyx_GOTREF(__pyx_tuple__14);
4351 __Pyx_GIVEREF(__pyx_tuple__14);
4352 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_font_pyx, __pyx_n_s_get_default_font, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(1, 40, __pyx_L1_error)
39874353 __Pyx_RefNannyFinishContext();
39884354 return 0;
39894355 __pyx_L1_error:;
39924358 }
39934359
39944360 static int __Pyx_InitGlobals(void) {
3995 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
3996 __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
4361 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
4362 __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error)
39974363 return 0;
39984364 __pyx_L1_error:;
39994365 return -1;
40004366 }
40014367
4368 static int __Pyx_modinit_global_init_code(void); /*proto*/
4369 static int __Pyx_modinit_variable_export_code(void); /*proto*/
4370 static int __Pyx_modinit_function_export_code(void); /*proto*/
4371 static int __Pyx_modinit_type_init_code(void); /*proto*/
4372 static int __Pyx_modinit_type_import_code(void); /*proto*/
4373 static int __Pyx_modinit_variable_import_code(void); /*proto*/
4374 static int __Pyx_modinit_function_import_code(void); /*proto*/
4375
4376 static int __Pyx_modinit_global_init_code(void) {
4377 __Pyx_RefNannyDeclarations
4378 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
4379 /*--- Global init code ---*/
4380 __Pyx_RefNannyFinishContext();
4381 return 0;
4382 }
4383
4384 static int __Pyx_modinit_variable_export_code(void) {
4385 __Pyx_RefNannyDeclarations
4386 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
4387 /*--- Variable export code ---*/
4388 __Pyx_RefNannyFinishContext();
4389 return 0;
4390 }
4391
4392 static int __Pyx_modinit_function_export_code(void) {
4393 __Pyx_RefNannyDeclarations
4394 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
4395 /*--- Function export code ---*/
4396 __Pyx_RefNannyFinishContext();
4397 return 0;
4398 }
4399
4400 static int __Pyx_modinit_type_init_code(void) {
4401 __Pyx_RefNannyDeclarations
4402 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
4403 /*--- Type init code ---*/
4404 __pyx_vtabptr_11pygame_sdl2_4font_Font = &__pyx_vtable_11pygame_sdl2_4font_Font;
4405 __pyx_vtable_11pygame_sdl2_4font_Font.set_style = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_4font_Font *, PyObject *, PyObject *))__pyx_f_11pygame_sdl2_4font_4Font_set_style;
4406 if (PyType_Ready(&__pyx_type_11pygame_sdl2_4font_Font) < 0) __PYX_ERR(1, 50, __pyx_L1_error)
4407 __pyx_type_11pygame_sdl2_4font_Font.tp_print = 0;
4408 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11pygame_sdl2_4font_Font.tp_dictoffset && __pyx_type_11pygame_sdl2_4font_Font.tp_getattro == PyObject_GenericGetAttr)) {
4409 __pyx_type_11pygame_sdl2_4font_Font.tp_getattro = __Pyx_PyObject_GenericGetAttr;
4410 }
4411 if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_4font_Font.tp_dict, __pyx_vtabptr_11pygame_sdl2_4font_Font) < 0) __PYX_ERR(1, 50, __pyx_L1_error)
4412 if (PyObject_SetAttrString(__pyx_m, "Font", (PyObject *)&__pyx_type_11pygame_sdl2_4font_Font) < 0) __PYX_ERR(1, 50, __pyx_L1_error)
4413 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11pygame_sdl2_4font_Font) < 0) __PYX_ERR(1, 50, __pyx_L1_error)
4414 __pyx_ptype_11pygame_sdl2_4font_Font = &__pyx_type_11pygame_sdl2_4font_Font;
4415 __Pyx_RefNannyFinishContext();
4416 return 0;
4417 __pyx_L1_error:;
4418 __Pyx_RefNannyFinishContext();
4419 return -1;
4420 }
4421
4422 static int __Pyx_modinit_type_import_code(void) {
4423 __Pyx_RefNannyDeclarations
4424 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
4425 /*--- Type import code ---*/
4426 __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error)
4427 __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error)
4428 __pyx_ptype_11pygame_sdl2_5color_Color = __Pyx_ImportType("pygame_sdl2.color", "Color", sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_5color_Color)) __PYX_ERR(3, 26, __pyx_L1_error)
4429 __pyx_vtabptr_11pygame_sdl2_5color_Color = (struct __pyx_vtabstruct_11pygame_sdl2_5color_Color*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_5color_Color->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_5color_Color)) __PYX_ERR(3, 26, __pyx_L1_error)
4430 __Pyx_RefNannyFinishContext();
4431 return 0;
4432 __pyx_L1_error:;
4433 __Pyx_RefNannyFinishContext();
4434 return -1;
4435 }
4436
4437 static int __Pyx_modinit_variable_import_code(void) {
4438 __Pyx_RefNannyDeclarations
4439 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
4440 /*--- Variable import code ---*/
4441 __Pyx_RefNannyFinishContext();
4442 return 0;
4443 }
4444
4445 static int __Pyx_modinit_function_import_code(void) {
4446 __Pyx_RefNannyDeclarations
4447 PyObject *__pyx_t_1 = NULL;
4448 PyObject *__pyx_t_2 = NULL;
4449 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
4450 /*--- Function import code ---*/
4451 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.color"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error)
4452 if (__Pyx_ImportFunction(__pyx_t_1, "to_sdl_color", (void (**)(void))&__pyx_f_11pygame_sdl2_5color_to_sdl_color, "PyObject *(PyObject *, SDL_Color *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
4453 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4454 __pyx_t_2 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_2) __PYX_ERR(1, 1, __pyx_L1_error)
4455 if (__Pyx_ImportFunction(__pyx_t_2, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
4456 Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4457 __Pyx_RefNannyFinishContext();
4458 return 0;
4459 __pyx_L1_error:;
4460 __Pyx_XDECREF(__pyx_t_1);
4461 __Pyx_XDECREF(__pyx_t_2);
4462 __Pyx_RefNannyFinishContext();
4463 return -1;
4464 }
4465
4466
40024467 #if PY_MAJOR_VERSION < 3
4003 PyMODINIT_FUNC initfont(void); /*proto*/
4004 PyMODINIT_FUNC initfont(void)
4005 #else
4006 PyMODINIT_FUNC PyInit_font(void); /*proto*/
4007 PyMODINIT_FUNC PyInit_font(void)
4468 #ifdef CYTHON_NO_PYINIT_EXPORT
4469 #define __Pyx_PyMODINIT_FUNC void
4470 #else
4471 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
4472 #endif
4473 #else
4474 #ifdef CYTHON_NO_PYINIT_EXPORT
4475 #define __Pyx_PyMODINIT_FUNC PyObject *
4476 #else
4477 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
4478 #endif
4479 #endif
4480 #ifndef CYTHON_SMALL_CODE
4481 #if defined(__clang__)
4482 #define CYTHON_SMALL_CODE
4483 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
4484 #define CYTHON_SMALL_CODE __attribute__((cold))
4485 #else
4486 #define CYTHON_SMALL_CODE
4487 #endif
4488 #endif
4489
4490
4491 #if PY_MAJOR_VERSION < 3
4492 __Pyx_PyMODINIT_FUNC initfont(void) CYTHON_SMALL_CODE; /*proto*/
4493 __Pyx_PyMODINIT_FUNC initfont(void)
4494 #else
4495 __Pyx_PyMODINIT_FUNC PyInit_font(void) CYTHON_SMALL_CODE; /*proto*/
4496 __Pyx_PyMODINIT_FUNC PyInit_font(void)
4497 #if CYTHON_PEP489_MULTI_PHASE_INIT
4498 {
4499 return PyModuleDef_Init(&__pyx_moduledef);
4500 }
4501 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
4502 PyObject *value = PyObject_GetAttrString(spec, from_name);
4503 int result = 0;
4504 if (likely(value)) {
4505 result = PyDict_SetItemString(moddict, to_name, value);
4506 Py_DECREF(value);
4507 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
4508 PyErr_Clear();
4509 } else {
4510 result = -1;
4511 }
4512 return result;
4513 }
4514 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
4515 PyObject *module = NULL, *moddict, *modname;
4516 if (__pyx_m)
4517 return __Pyx_NewRef(__pyx_m);
4518 modname = PyObject_GetAttrString(spec, "name");
4519 if (unlikely(!modname)) goto bad;
4520 module = PyModule_NewObject(modname);
4521 Py_DECREF(modname);
4522 if (unlikely(!module)) goto bad;
4523 moddict = PyModule_GetDict(module);
4524 if (unlikely(!moddict)) goto bad;
4525 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
4526 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
4527 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
4528 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
4529 return module;
4530 bad:
4531 Py_XDECREF(module);
4532 return NULL;
4533 }
4534
4535
4536 static int __pyx_pymod_exec_font(PyObject *__pyx_pyinit_module)
4537 #endif
40084538 #endif
40094539 {
40104540 PyObject *__pyx_t_1 = NULL;
40114541 PyObject *__pyx_t_2 = NULL;
40124542 PyObject *__pyx_t_3 = NULL;
4013 PyObject *__pyx_t_4 = NULL;
4014 PyObject *__pyx_t_5 = NULL;
4015 PyObject *__pyx_t_6 = NULL;
4016 PyObject *__pyx_t_7 = NULL;
40174543 __Pyx_RefNannyDeclarations
4544 #if CYTHON_PEP489_MULTI_PHASE_INIT
4545 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
4546 #elif PY_MAJOR_VERSION >= 3
4547 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
4548 #endif
40184549 #if CYTHON_REFNANNY
4019 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
4020 if (!__Pyx_RefNanny) {
4021 PyErr_Clear();
4022 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
4023 if (!__Pyx_RefNanny)
4024 Py_FatalError("failed to import 'refnanny' module");
4025 }
4026 #endif
4027 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_font(void)", 0);
4028 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4029 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
4030 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
4031 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
4550 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
4551 if (!__Pyx_RefNanny) {
4552 PyErr_Clear();
4553 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
4554 if (!__Pyx_RefNanny)
4555 Py_FatalError("failed to import 'refnanny' module");
4556 }
4557 #endif
4558 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_font(void)", 0);
4559 if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
4560 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error)
4561 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error)
4562 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error)
40324563 #ifdef __Pyx_CyFunction_USED
4033 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4564 if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
40344565 #endif
40354566 #ifdef __Pyx_FusedFunction_USED
4036 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4567 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
40374568 #endif
40384569 #ifdef __Pyx_Coroutine_USED
4039 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4570 if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
40404571 #endif
40414572 #ifdef __Pyx_Generator_USED
4042 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4573 if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
4574 #endif
4575 #ifdef __Pyx_AsyncGen_USED
4576 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
40434577 #endif
40444578 #ifdef __Pyx_StopAsyncIteration_USED
4045 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4579 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
40464580 #endif
40474581 /*--- Library function declarations ---*/
40484582 /*--- Threads initialization code ---*/
40524586 #endif
40534587 #endif
40544588 /*--- Module creation code ---*/
4589 #if CYTHON_PEP489_MULTI_PHASE_INIT
4590 __pyx_m = __pyx_pyinit_module;
4591 Py_INCREF(__pyx_m);
4592 #else
40554593 #if PY_MAJOR_VERSION < 3
40564594 __pyx_m = Py_InitModule4("font", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
40574595 #else
40584596 __pyx_m = PyModule_Create(&__pyx_moduledef);
40594597 #endif
4060 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
4061 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
4598 if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
4599 #endif
4600 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error)
40624601 Py_INCREF(__pyx_d);
4063 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
4602 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error)
4603 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error)
40644604 #if CYTHON_COMPILING_IN_PYPY
40654605 Py_INCREF(__pyx_b);
40664606 #endif
4067 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
4607 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
40684608 /*--- Initialize various global constants etc. ---*/
4069 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4609 if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
40704610 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
4071 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4611 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
40724612 #endif
40734613 if (__pyx_module_is_main_pygame_sdl2__font) {
4074 if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4614 if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
40754615 }
40764616 #if PY_MAJOR_VERSION >= 3
40774617 {
4078 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
4618 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error)
40794619 if (!PyDict_GetItemString(modules, "pygame_sdl2.font")) {
4080 if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.font", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
4620 if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.font", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
40814621 }
40824622 }
40834623 #endif
40844624 /*--- Builtin init code ---*/
4085 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4625 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
40864626 /*--- Constants init code ---*/
4087 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4088 /*--- Global init code ---*/
4089 /*--- Variable export code ---*/
4090 /*--- Function export code ---*/
4091 /*--- Type init code ---*/
4092 __pyx_vtabptr_11pygame_sdl2_4font_Font = &__pyx_vtable_11pygame_sdl2_4font_Font;
4093 __pyx_vtable_11pygame_sdl2_4font_Font.set_style = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_4font_Font *, PyObject *, PyObject *))__pyx_f_11pygame_sdl2_4font_4Font_set_style;
4094 if (PyType_Ready(&__pyx_type_11pygame_sdl2_4font_Font) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
4095 __pyx_type_11pygame_sdl2_4font_Font.tp_print = 0;
4096 if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_4font_Font.tp_dict, __pyx_vtabptr_11pygame_sdl2_4font_Font) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
4097 if (PyObject_SetAttrString(__pyx_m, "Font", (PyObject *)&__pyx_type_11pygame_sdl2_4font_Font) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
4098 __pyx_ptype_11pygame_sdl2_4font_Font = &__pyx_type_11pygame_sdl2_4font_Font;
4099 /*--- Type import code ---*/
4100 __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
4101 __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
4102 __pyx_ptype_11pygame_sdl2_5color_Color = __Pyx_ImportType("pygame_sdl2.color", "Color", sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_5color_Color)) __PYX_ERR(2, 26, __pyx_L1_error)
4103 __pyx_vtabptr_11pygame_sdl2_5color_Color = (struct __pyx_vtabstruct_11pygame_sdl2_5color_Color*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_5color_Color->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_5color_Color)) __PYX_ERR(2, 26, __pyx_L1_error)
4104 /*--- Variable import code ---*/
4105 /*--- Function import code ---*/
4106 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.color"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
4107 if (__Pyx_ImportFunction(__pyx_t_1, "to_sdl_color", (void (**)(void))&__pyx_f_11pygame_sdl2_5color_to_sdl_color, "PyObject *(PyObject *, SDL_Color *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4108 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4109 __pyx_t_2 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error)
4110 if (__Pyx_ImportFunction(__pyx_t_2, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4111 Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4627 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
4628 /*--- Global type/function init code ---*/
4629 (void)__Pyx_modinit_global_init_code();
4630 (void)__Pyx_modinit_variable_export_code();
4631 (void)__Pyx_modinit_function_export_code();
4632 if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
4633 if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
4634 (void)__Pyx_modinit_variable_import_code();
4635 if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error;
41124636 /*--- Execution code ---*/
41134637 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
4114 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4638 if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
41154639 #endif
41164640
41174641 /* "pygame_sdl2/font.pyx":25
41214645 * from pygame_sdl2.error import error
41224646 * import pygame_sdl2
41234647 */
4124 __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
4125 __Pyx_GOTREF(__pyx_t_3);
4648 __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error)
4649 __Pyx_GOTREF(__pyx_t_1);
41264650 __Pyx_INCREF(__pyx_n_s_SysFont);
41274651 __Pyx_GIVEREF(__pyx_n_s_SysFont);
4128 PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_SysFont);
4652 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_SysFont);
41294653 __Pyx_INCREF(__pyx_n_s_match_font);
41304654 __Pyx_GIVEREF(__pyx_n_s_match_font);
4131 PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_match_font);
4655 PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_match_font);
41324656 __Pyx_INCREF(__pyx_n_s_get_fonts);
41334657 __Pyx_GIVEREF(__pyx_n_s_get_fonts);
4134 PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_get_fonts);
4135 __pyx_t_4 = __Pyx_Import(__pyx_n_s_pygame_sdl2_sysfont, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error)
4136 __Pyx_GOTREF(__pyx_t_4);
4137 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4138 __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_SysFont); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
4139 __Pyx_GOTREF(__pyx_t_3);
4140 if (PyDict_SetItem(__pyx_d, __pyx_n_s_SysFont, __pyx_t_3) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
4141 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4142 __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_match_font); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
4143 __Pyx_GOTREF(__pyx_t_3);
4144 if (PyDict_SetItem(__pyx_d, __pyx_n_s_match_font, __pyx_t_3) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
4145 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4146 __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_get_fonts); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
4147 __Pyx_GOTREF(__pyx_t_3);
4148 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_fonts, __pyx_t_3) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
4149 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4150 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4658 PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_get_fonts);
4659 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_sysfont, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error)
4660 __Pyx_GOTREF(__pyx_t_2);
4661 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4662 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_SysFont); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error)
4663 __Pyx_GOTREF(__pyx_t_1);
4664 if (PyDict_SetItem(__pyx_d, __pyx_n_s_SysFont, __pyx_t_1) < 0) __PYX_ERR(1, 25, __pyx_L1_error)
4665 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4666 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_match_font); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error)
4667 __Pyx_GOTREF(__pyx_t_1);
4668 if (PyDict_SetItem(__pyx_d, __pyx_n_s_match_font, __pyx_t_1) < 0) __PYX_ERR(1, 25, __pyx_L1_error)
4669 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4670 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_fonts); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error)
4671 __Pyx_GOTREF(__pyx_t_1);
4672 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_fonts, __pyx_t_1) < 0) __PYX_ERR(1, 25, __pyx_L1_error)
4673 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4674 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41514675
41524676 /* "pygame_sdl2/font.pyx":26
41534677 *
41564680 * import pygame_sdl2
41574681 *
41584682 */
4159 __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error)
4160 __Pyx_GOTREF(__pyx_t_4);
4683 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 26, __pyx_L1_error)
4684 __Pyx_GOTREF(__pyx_t_2);
41614685 __Pyx_INCREF(__pyx_n_s_error);
41624686 __Pyx_GIVEREF(__pyx_n_s_error);
4163 PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_error);
4164 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
4165 __Pyx_GOTREF(__pyx_t_3);
4166 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4167 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error)
4168 __Pyx_GOTREF(__pyx_t_4);
4169 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_4) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
4170 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4171 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4687 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error);
4688 __pyx_t_1 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 26, __pyx_L1_error)
4689 __Pyx_GOTREF(__pyx_t_1);
4690 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4691 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 26, __pyx_L1_error)
4692 __Pyx_GOTREF(__pyx_t_2);
4693 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(1, 26, __pyx_L1_error)
4694 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4695 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41724696
41734697 /* "pygame_sdl2/font.pyx":27
41744698 * from pygame_sdl2.sysfont import SysFont, match_font, get_fonts
41774701 *
41784702 * @pygame_sdl2.register_init
41794703 */
4180 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error)
4181 __Pyx_GOTREF(__pyx_t_3);
4182 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_3) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
4183 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4704 __pyx_t_1 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 27, __pyx_L1_error)
4705 __Pyx_GOTREF(__pyx_t_1);
4706 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_1) < 0) __PYX_ERR(1, 27, __pyx_L1_error)
4707 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41844708
41854709 /* "pygame_sdl2/font.pyx":29
41864710 * import pygame_sdl2
41894713 * def init():
41904714 * TTF_Init()
41914715 */
4192 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error)
4193 __Pyx_GOTREF(__pyx_t_4);
4194 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_register_init); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 29, __pyx_L1_error)
4195 __Pyx_GOTREF(__pyx_t_5);
4196 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4716 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 29, __pyx_L1_error)
4717 __Pyx_GOTREF(__pyx_t_1);
4718 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_register_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 29, __pyx_L1_error)
4719 __Pyx_GOTREF(__pyx_t_2);
4720 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41974721
41984722 /* "pygame_sdl2/font.pyx":30
41994723 *
42024726 * TTF_Init()
42034727 *
42044728 */
4205 __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4font_1init, NULL, __pyx_n_s_pygame_sdl2_font); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error)
4206 __Pyx_GOTREF(__pyx_t_4);
4207 __pyx_t_6 = NULL;
4208 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
4209 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
4210 if (likely(__pyx_t_6)) {
4211 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
4212 __Pyx_INCREF(__pyx_t_6);
4213 __Pyx_INCREF(function);
4214 __Pyx_DECREF_SET(__pyx_t_5, function);
4215 }
4216 }
4217 if (!__pyx_t_6) {
4218 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
4219 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4220 __Pyx_GOTREF(__pyx_t_3);
4221 } else {
4222 #if CYTHON_FAST_PYCALL
4223 if (PyFunction_Check(__pyx_t_5)) {
4224 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
4225 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
4226 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4227 __Pyx_GOTREF(__pyx_t_3);
4228 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4229 } else
4230 #endif
4231 #if CYTHON_FAST_PYCCALL
4232 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
4233 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
4234 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
4235 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4236 __Pyx_GOTREF(__pyx_t_3);
4237 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4238 } else
4239 #endif
4240 {
4241 __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 29, __pyx_L1_error)
4242 __Pyx_GOTREF(__pyx_t_7);
4243 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
4244 __Pyx_GIVEREF(__pyx_t_4);
4245 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
4246 __pyx_t_4 = 0;
4247 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
4248 __Pyx_GOTREF(__pyx_t_3);
4249 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4250 }
4251 }
4252 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4253 if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
4729 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4font_1init, NULL, __pyx_n_s_pygame_sdl2_font); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error)
4730 __Pyx_GOTREF(__pyx_t_1);
4731
4732 /* "pygame_sdl2/font.pyx":29
4733 * import pygame_sdl2
4734 *
4735 * @pygame_sdl2.register_init # <<<<<<<<<<<<<<
4736 * def init():
4737 * TTF_Init()
4738 */
4739 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 29, __pyx_L1_error)
4740 __Pyx_GOTREF(__pyx_t_3);
4741 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4742 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4743 if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(1, 30, __pyx_L1_error)
42544744 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
42554745
42564746 /* "pygame_sdl2/font.pyx":33
42604750 * def quit(): # @ReservedAssignment
42614751 * TTF_Quit()
42624752 */
4263 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 33, __pyx_L1_error)
4264 __Pyx_GOTREF(__pyx_t_5);
4265 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 33, __pyx_L1_error)
4266 __Pyx_GOTREF(__pyx_t_7);
4267 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4753 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 33, __pyx_L1_error)
4754 __Pyx_GOTREF(__pyx_t_3);
4755 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 33, __pyx_L1_error)
4756 __Pyx_GOTREF(__pyx_t_1);
4757 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
42684758
42694759 /* "pygame_sdl2/font.pyx":34
42704760 *
42734763 * TTF_Quit()
42744764 *
42754765 */
4276 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4font_3quit, NULL, __pyx_n_s_pygame_sdl2_font); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 34, __pyx_L1_error)
4277 __Pyx_GOTREF(__pyx_t_5);
4278 __pyx_t_4 = NULL;
4279 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
4280 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
4281 if (likely(__pyx_t_4)) {
4282 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
4283 __Pyx_INCREF(__pyx_t_4);
4284 __Pyx_INCREF(function);
4285 __Pyx_DECREF_SET(__pyx_t_7, function);
4286 }
4287 }
4288 if (!__pyx_t_4) {
4289 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)
4290 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4291 __Pyx_GOTREF(__pyx_t_3);
4292 } else {
4293 #if CYTHON_FAST_PYCALL
4294 if (PyFunction_Check(__pyx_t_7)) {
4295 PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
4296 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)
4297 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4298 __Pyx_GOTREF(__pyx_t_3);
4299 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4300 } else
4301 #endif
4302 #if CYTHON_FAST_PYCCALL
4303 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
4304 PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
4305 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)
4306 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4307 __Pyx_GOTREF(__pyx_t_3);
4308 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4309 } else
4310 #endif
4311 {
4312 __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 33, __pyx_L1_error)
4313 __Pyx_GOTREF(__pyx_t_6);
4314 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
4315 __Pyx_GIVEREF(__pyx_t_5);
4316 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
4317 __pyx_t_5 = 0;
4318 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)
4319 __Pyx_GOTREF(__pyx_t_3);
4320 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4321 }
4322 }
4323 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4324 if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_3) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
4766 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4font_3quit, NULL, __pyx_n_s_pygame_sdl2_font); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 34, __pyx_L1_error)
4767 __Pyx_GOTREF(__pyx_t_3);
4768
4769 /* "pygame_sdl2/font.pyx":33
4770 * TTF_Init()
4771 *
4772 * @pygame_sdl2.register_quit # <<<<<<<<<<<<<<
4773 * def quit(): # @ReservedAssignment
4774 * TTF_Quit()
4775 */
4776 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 33, __pyx_L1_error)
4777 __Pyx_GOTREF(__pyx_t_2);
4778 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
43254779 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4780 if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) __PYX_ERR(1, 34, __pyx_L1_error)
4781 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
43264782
43274783 /* "pygame_sdl2/font.pyx":37
43284784 * TTF_Quit()
43314787 * return TTF_WasInit() != 0
43324788 *
43334789 */
4334 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4font_5get_init, NULL, __pyx_n_s_pygame_sdl2_font); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error)
4335 __Pyx_GOTREF(__pyx_t_3);
4336 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_3) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
4337 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4790 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4font_5get_init, NULL, __pyx_n_s_pygame_sdl2_font); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L1_error)
4791 __Pyx_GOTREF(__pyx_t_2);
4792 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_2) < 0) __PYX_ERR(1, 37, __pyx_L1_error)
4793 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
43384794
43394795 /* "pygame_sdl2/font.pyx":40
43404796 * return TTF_WasInit() != 0
43434799 * import os
43444800 *
43454801 */
4346 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4font_7get_default_font, NULL, __pyx_n_s_pygame_sdl2_font); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error)
4347 __Pyx_GOTREF(__pyx_t_3);
4348 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_default_font, __pyx_t_3) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
4349 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4802 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4font_7get_default_font, NULL, __pyx_n_s_pygame_sdl2_font); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 40, __pyx_L1_error)
4803 __Pyx_GOTREF(__pyx_t_2);
4804 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_default_font, __pyx_t_2) < 0) __PYX_ERR(1, 40, __pyx_L1_error)
4805 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
43504806
43514807 /* "pygame_sdl2/font.pyx":1
43524808 * # Copyright 2014 Patrick Dawson <pat@dw.is> # <<<<<<<<<<<<<<
43534809 * #
43544810 * # This software is provided 'as-is', without any express or implied
43554811 */
4356 __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error)
4357 __Pyx_GOTREF(__pyx_t_3);
4358 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4359 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4812 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
4813 __Pyx_GOTREF(__pyx_t_2);
4814 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
4815 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
43604816
43614817 /*--- Wrapped vars code ---*/
43624818
43654821 __Pyx_XDECREF(__pyx_t_1);
43664822 __Pyx_XDECREF(__pyx_t_2);
43674823 __Pyx_XDECREF(__pyx_t_3);
4368 __Pyx_XDECREF(__pyx_t_4);
4369 __Pyx_XDECREF(__pyx_t_5);
4370 __Pyx_XDECREF(__pyx_t_6);
4371 __Pyx_XDECREF(__pyx_t_7);
43724824 if (__pyx_m) {
43734825 if (__pyx_d) {
4374 __Pyx_AddTraceback("init pygame_sdl2.font", __pyx_clineno, __pyx_lineno, __pyx_filename);
4826 __Pyx_AddTraceback("init pygame_sdl2.font", 0, __pyx_lineno, __pyx_filename);
43754827 }
43764828 Py_DECREF(__pyx_m); __pyx_m = 0;
43774829 } else if (!PyErr_Occurred()) {
43794831 }
43804832 __pyx_L0:;
43814833 __Pyx_RefNannyFinishContext();
4382 #if PY_MAJOR_VERSION < 3
4834 #if CYTHON_PEP489_MULTI_PHASE_INIT
4835 return (__pyx_m != NULL) ? 0 : -1;
4836 #elif PY_MAJOR_VERSION >= 3
4837 return __pyx_m;
4838 #else
43834839 return;
4384 #else
4385 return __pyx_m;
43864840 #endif
43874841 }
43884842
44044858 }
44054859 #endif
44064860
4861 /* PyObjectGetAttrStr */
4862 #if CYTHON_USE_TYPE_SLOTS
4863 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
4864 PyTypeObject* tp = Py_TYPE(obj);
4865 if (likely(tp->tp_getattro))
4866 return tp->tp_getattro(obj, attr_name);
4867 #if PY_MAJOR_VERSION < 3
4868 if (likely(tp->tp_getattr))
4869 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
4870 #endif
4871 return PyObject_GetAttr(obj, attr_name);
4872 }
4873 #endif
4874
4875 /* GetBuiltinName */
4876 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
4877 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
4878 if (unlikely(!result)) {
4879 PyErr_Format(PyExc_NameError,
4880 #if PY_MAJOR_VERSION >= 3
4881 "name '%U' is not defined", name);
4882 #else
4883 "name '%.200s' is not defined", PyString_AS_STRING(name));
4884 #endif
4885 }
4886 return result;
4887 }
4888
44074889 /* Import */
44084890 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
44094891 PyObject *empty_list = 0;
44114893 PyObject *global_dict = 0;
44124894 PyObject *empty_dict = 0;
44134895 PyObject *list;
4414 #if PY_VERSION_HEX < 0x03030000
4896 #if PY_MAJOR_VERSION < 3
44154897 PyObject *py_import;
44164898 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
44174899 if (!py_import)
44354917 #if PY_MAJOR_VERSION >= 3
44364918 if (level == -1) {
44374919 if (strchr(__Pyx_MODULE_NAME, '.')) {
4438 #if PY_VERSION_HEX < 0x03030000
4439 PyObject *py_level = PyInt_FromLong(1);
4440 if (!py_level)
4441 goto bad;
4442 module = PyObject_CallFunctionObjArgs(py_import,
4443 name, global_dict, empty_dict, list, py_level, NULL);
4444 Py_DECREF(py_level);
4445 #else
44464920 module = PyImport_ImportModuleLevelObject(
44474921 name, global_dict, empty_dict, list, 1);
4448 #endif
44494922 if (!module) {
44504923 if (!PyErr_ExceptionMatches(PyExc_ImportError))
44514924 goto bad;
44564929 }
44574930 #endif
44584931 if (!module) {
4459 #if PY_VERSION_HEX < 0x03030000
4932 #if PY_MAJOR_VERSION < 3
44604933 PyObject *py_level = PyInt_FromLong(level);
44614934 if (!py_level)
44624935 goto bad;
44704943 }
44714944 }
44724945 bad:
4473 #if PY_VERSION_HEX < 0x03030000
4946 #if PY_MAJOR_VERSION < 3
44744947 Py_XDECREF(py_import);
44754948 #endif
44764949 Py_XDECREF(empty_list);
44784951 return module;
44794952 }
44804953
4481 /* GetBuiltinName */
4482 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
4483 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
4484 if (unlikely(!result)) {
4485 PyErr_Format(PyExc_NameError,
4486 #if PY_MAJOR_VERSION >= 3
4487 "name '%U' is not defined", name);
4488 #else
4489 "name '%.200s' is not defined", PyString_AS_STRING(name));
4490 #endif
4491 }
4492 return result;
4493 }
4494
44954954 /* GetModuleGlobalName */
44964955 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
44974956 PyObject *result;
44984957 #if !CYTHON_AVOID_BORROWED_REFS
4958 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
4959 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
4960 if (likely(result)) {
4961 Py_INCREF(result);
4962 } else if (unlikely(PyErr_Occurred())) {
4963 result = NULL;
4964 } else {
4965 #else
44994966 result = PyDict_GetItem(__pyx_d, name);
45004967 if (likely(result)) {
45014968 Py_INCREF(result);
45024969 } else {
4970 #endif
45034971 #else
45044972 result = PyObject_GetItem(__pyx_d, name);
45054973 if (!result) {
45114979 }
45124980
45134981 /* PyCFunctionFastCall */
4514 #if CYTHON_FAST_PYCCALL
4982 #if CYTHON_FAST_PYCCALL
45154983 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
45164984 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
45174985 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
45184986 PyObject *self = PyCFunction_GET_SELF(func);
4987 int flags = PyCFunction_GET_FLAGS(func);
45194988 assert(PyCFunction_Check(func));
4520 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
4989 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
45214990 assert(nargs >= 0);
45224991 assert(nargs == 0 || args != NULL);
45234992 /* _PyCFunction_FastCallDict() must not be called with an exception set,
45244993 because it may clear it (directly or indirectly) and so the
45254994 caller loses its exception */
45264995 assert(!PyErr_Occurred());
4527 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
4528 }
4529 #endif // CYTHON_FAST_PYCCALL
4996 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
4997 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
4998 } else {
4999 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
5000 }
5001 }
5002 #endif
45305003
45315004 /* PyFunctionFastCall */
4532 #if CYTHON_FAST_PYCALL
5005 #if CYTHON_FAST_PYCALL
45335006 #include "frameobject.h"
45345007 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
45355008 PyObject *globals) {
45365009 PyFrameObject *f;
4537 PyThreadState *tstate = PyThreadState_GET();
5010 PyThreadState *tstate = __Pyx_PyThreadState_Current;
45385011 PyObject **fastlocals;
45395012 Py_ssize_t i;
45405013 PyObject *result;
46455118 Py_LeaveRecursiveCall();
46465119 return result;
46475120 }
4648 #endif // CPython < 3.6
4649 #endif // CYTHON_FAST_PYCALL
5121 #endif
5122 #endif
46505123
46515124 /* PyObjectCall */
4652 #if CYTHON_COMPILING_IN_CPYTHON
5125 #if CYTHON_COMPILING_IN_CPYTHON
46535126 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
46545127 PyObject *result;
46555128 ternaryfunc call = func->ob_type->tp_call;
46695142 #endif
46705143
46715144 /* PyObjectCallMethO */
4672 #if CYTHON_COMPILING_IN_CPYTHON
5145 #if CYTHON_COMPILING_IN_CPYTHON
46735146 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
46745147 PyObject *self, *result;
46755148 PyCFunction cfunc;
46895162 #endif
46905163
46915164 /* PyObjectCallOneArg */
4692 #if CYTHON_COMPILING_IN_CPYTHON
5165 #if CYTHON_COMPILING_IN_CPYTHON
46935166 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
46945167 PyObject *result;
46955168 PyObject *args = PyTuple_New(1);
47065179 return __Pyx_PyFunction_FastCall(func, &arg, 1);
47075180 }
47085181 #endif
4709 #ifdef __Pyx_CyFunction_USED
4710 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
4711 #else
47125182 if (likely(PyCFunction_Check(func))) {
4713 #endif
47145183 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
47155184 return __Pyx_PyObject_CallMethO(func, arg);
47165185 #if CYTHON_FAST_PYCCALL
47595228 }
47605229
47615230 /* KeywordStringCheck */
4762 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
5231 static int __Pyx_CheckKeywordStrings(
47635232 PyObject *kwdict,
47645233 const char* function_name,
47655234 int kw_allowed)
47735242 #else
47745243 while (PyDict_Next(kwdict, &pos, &key, 0)) {
47755244 #if PY_MAJOR_VERSION < 3
4776 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
5245 if (unlikely(!PyString_Check(key)))
47775246 #endif
47785247 if (unlikely(!PyUnicode_Check(key)))
47795248 goto invalid_keyword_type;
49235392 }
49245393 #endif
49255394 #ifdef __Pyx_CyFunction_USED
4926 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
5395 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
49275396 #else
49285397 if (likely(PyCFunction_Check(func))) {
49295398 #endif
50755544 "raise: exception class must be a subclass of BaseException");
50765545 goto bad;
50775546 }
5078 #if PY_VERSION_HEX >= 0x03030000
50795547 if (cause) {
5080 #else
5081 if (cause && cause != Py_None) {
5082 #endif
50835548 PyObject *fixed_cause;
50845549 if (cause == Py_None) {
50855550 fixed_cause = NULL;
51075572 PyErr_Restore(tmp_type, tmp_value, tb);
51085573 Py_XDECREF(tmp_tb);
51095574 #else
5110 PyThreadState *tstate = PyThreadState_GET();
5575 PyThreadState *tstate = __Pyx_PyThreadState_Current;
51115576 PyObject* tmp_tb = tstate->curexc_traceback;
51125577 if (tb != tmp_tb) {
51135578 Py_INCREF(tb);
51235588 #endif
51245589
51255590 /* RaiseTooManyValuesToUnpack */
5126 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
5591 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
51275592 PyErr_Format(PyExc_ValueError,
51285593 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
51295594 }
51305595
51315596 /* RaiseNeedMoreValuesToUnpack */
5132 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
5597 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
51335598 PyErr_Format(PyExc_ValueError,
51345599 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
51355600 index, (index == 1) ? "" : "s");
51365601 }
51375602
51385603 /* IterFinish */
5139 static CYTHON_INLINE int __Pyx_IterFinish(void) {
5604 static CYTHON_INLINE int __Pyx_IterFinish(void) {
51405605 #if CYTHON_FAST_THREAD_STATE
5141 PyThreadState *tstate = PyThreadState_GET();
5606 PyThreadState *tstate = __Pyx_PyThreadState_Current;
51425607 PyObject* exc_type = tstate->curexc_type;
51435608 if (unlikely(exc_type)) {
5144 if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
5609 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
51455610 PyObject *exc_value, *exc_tb;
51465611 exc_value = tstate->curexc_value;
51475612 exc_tb = tstate->curexc_traceback;
51715636 }
51725637
51735638 /* UnpackItemEndCheck */
5174 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
5639 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
51755640 if (unlikely(retval)) {
51765641 Py_DECREF(retval);
51775642 __Pyx_RaiseTooManyValuesError(expected);
51835648 }
51845649
51855650 /* ExtTypeTest */
5186 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
5651 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
51875652 if (unlikely(!type)) {
51885653 PyErr_SetString(PyExc_SystemError, "Missing type object");
51895654 return 0;
51905655 }
5191 if (likely(PyObject_TypeCheck(obj, type)))
5656 if (likely(__Pyx_TypeCheck(obj, type)))
51925657 return 1;
51935658 PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
51945659 Py_TYPE(obj)->tp_name, type->tp_name);
51965661 }
51975662
51985663 /* UnicodeAsUCS4 */
5199 static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) {
5664 static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) {
52005665 Py_ssize_t length;
52015666 #if CYTHON_PEP393_ENABLED
52025667 length = PyUnicode_GET_LENGTH(x);
52275692 }
52285693
52295694 /* object_ord */
5230 static long __Pyx__PyObject_Ord(PyObject* c) {
5695 static long __Pyx__PyObject_Ord(PyObject* c) {
52315696 Py_ssize_t size;
52325697 if (PyBytes_Check(c)) {
52335698 size = PyBytes_GET_SIZE(c);
52555720 return (long)(Py_UCS4)-1;
52565721 }
52575722
5723 /* PyObject_GenericGetAttrNoDict */
5724 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
5725 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
5726 PyErr_Format(PyExc_AttributeError,
5727 #if PY_MAJOR_VERSION >= 3
5728 "'%.50s' object has no attribute '%U'",
5729 tp->tp_name, attr_name);
5730 #else
5731 "'%.50s' object has no attribute '%.400s'",
5732 tp->tp_name, PyString_AS_STRING(attr_name));
5733 #endif
5734 return NULL;
5735 }
5736 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
5737 PyObject *descr;
5738 PyTypeObject *tp = Py_TYPE(obj);
5739 if (unlikely(!PyString_Check(attr_name))) {
5740 return PyObject_GenericGetAttr(obj, attr_name);
5741 }
5742 assert(!tp->tp_dictoffset);
5743 descr = _PyType_Lookup(tp, attr_name);
5744 if (unlikely(!descr)) {
5745 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
5746 }
5747 Py_INCREF(descr);
5748 #if PY_MAJOR_VERSION < 3
5749 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
5750 #endif
5751 {
5752 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
5753 if (unlikely(f)) {
5754 PyObject *res = f(descr, obj, (PyObject *)tp);
5755 Py_DECREF(descr);
5756 return res;
5757 }
5758 }
5759 return descr;
5760 }
5761 #endif
5762
5763 /* PyObject_GenericGetAttr */
5764 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
5765 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
5766 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
5767 return PyObject_GenericGetAttr(obj, attr_name);
5768 }
5769 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
5770 }
5771 #endif
5772
52585773 /* SetVTable */
5259 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
5774 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
52605775 #if PY_VERSION_HEX >= 0x02070000
52615776 PyObject *ob = PyCapsule_New(vtable, 0, 0);
52625777 #else
52735788 return -1;
52745789 }
52755790
5791 /* SetupReduce */
5792 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
5793 int ret;
5794 PyObject *name_attr;
5795 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
5796 if (likely(name_attr)) {
5797 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
5798 } else {
5799 ret = -1;
5800 }
5801 if (unlikely(ret < 0)) {
5802 PyErr_Clear();
5803 ret = 0;
5804 }
5805 Py_XDECREF(name_attr);
5806 return ret;
5807 }
5808 static int __Pyx_setup_reduce(PyObject* type_obj) {
5809 int ret = 0;
5810 PyObject *object_reduce = NULL;
5811 PyObject *object_reduce_ex = NULL;
5812 PyObject *reduce = NULL;
5813 PyObject *reduce_ex = NULL;
5814 PyObject *reduce_cython = NULL;
5815 PyObject *setstate = NULL;
5816 PyObject *setstate_cython = NULL;
5817 #if CYTHON_USE_PYTYPE_LOOKUP
5818 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
5819 #else
5820 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
5821 #endif
5822 #if CYTHON_USE_PYTYPE_LOOKUP
5823 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
5824 #else
5825 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
5826 #endif
5827 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
5828 if (reduce_ex == object_reduce_ex) {
5829 #if CYTHON_USE_PYTYPE_LOOKUP
5830 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
5831 #else
5832 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
5833 #endif
5834 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
5835 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
5836 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
5837 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
5838 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
5839 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
5840 if (!setstate) PyErr_Clear();
5841 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
5842 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
5843 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
5844 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
5845 }
5846 PyType_Modified((PyTypeObject*)type_obj);
5847 }
5848 }
5849 goto GOOD;
5850 BAD:
5851 if (!PyErr_Occurred())
5852 PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
5853 ret = -1;
5854 GOOD:
5855 #if !CYTHON_USE_PYTYPE_LOOKUP
5856 Py_XDECREF(object_reduce);
5857 Py_XDECREF(object_reduce_ex);
5858 #endif
5859 Py_XDECREF(reduce);
5860 Py_XDECREF(reduce_ex);
5861 Py_XDECREF(reduce_cython);
5862 Py_XDECREF(setstate);
5863 Py_XDECREF(setstate_cython);
5864 return ret;
5865 }
5866
52765867 /* GetVTable */
5277 static void* __Pyx_GetVtable(PyObject *dict) {
5868 static void* __Pyx_GetVtable(PyObject *dict) {
52785869 void* ptr;
52795870 PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
52805871 if (!ob)
52945885 }
52955886
52965887 /* ImportFrom */
5297 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
5888 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
52985889 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
52995890 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
53005891 PyErr_Format(PyExc_ImportError,
53075898 return value;
53085899 }
53095900
5901 /* CLineInTraceback */
5902 #ifndef CYTHON_CLINE_IN_TRACEBACK
5903 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
5904 PyObject *use_cline;
5905 PyObject *ptype, *pvalue, *ptraceback;
5906 #if CYTHON_COMPILING_IN_CPYTHON
5907 PyObject **cython_runtime_dict;
5908 #endif
5909 if (unlikely(!__pyx_cython_runtime)) {
5910 return c_line;
5911 }
5912 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
5913 #if CYTHON_COMPILING_IN_CPYTHON
5914 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
5915 if (likely(cython_runtime_dict)) {
5916 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
5917 } else
5918 #endif
5919 {
5920 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
5921 if (use_cline_obj) {
5922 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
5923 Py_DECREF(use_cline_obj);
5924 } else {
5925 PyErr_Clear();
5926 use_cline = NULL;
5927 }
5928 }
5929 if (!use_cline) {
5930 c_line = 0;
5931 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
5932 }
5933 else if (PyObject_Not(use_cline) != 0) {
5934 c_line = 0;
5935 }
5936 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
5937 return c_line;
5938 }
5939 #endif
5940
53105941 /* CodeObjectCache */
5311 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
5942 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
53125943 int start = 0, mid = 0, end = count - 1;
53135944 if (end >= 0 && code_line > entries[end].code_line) {
53145945 return count;
53886019 }
53896020
53906021 /* AddTraceback */
5391 #include "compile.h"
6022 #include "compile.h"
53926023 #include "frameobject.h"
53936024 #include "traceback.h"
53946025 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
54476078 int py_line, const char *filename) {
54486079 PyCodeObject *py_code = 0;
54496080 PyFrameObject *py_frame = 0;
5450 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
6081 PyThreadState *tstate = __Pyx_PyThreadState_Current;
6082 if (c_line) {
6083 c_line = __Pyx_CLineForTraceback(tstate, c_line);
6084 }
6085 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
54516086 if (!py_code) {
54526087 py_code = __Pyx_CreateCodeObjectForTraceback(
54536088 funcname, c_line, py_line, filename);
54546089 if (!py_code) goto bad;
5455 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
6090 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
54566091 }
54576092 py_frame = PyFrame_New(
5458 PyThreadState_GET(), /*PyThreadState *tstate,*/
5459 py_code, /*PyCodeObject *code,*/
5460 __pyx_d, /*PyObject *globals,*/
5461 0 /*PyObject *locals*/
6093 tstate, /*PyThreadState *tstate,*/
6094 py_code, /*PyCodeObject *code,*/
6095 __pyx_d, /*PyObject *globals,*/
6096 0 /*PyObject *locals*/
54626097 );
54636098 if (!py_frame) goto bad;
54646099 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
54696104 }
54706105
54716106 /* CIntFromPyVerify */
5472 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
6107 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
54736108 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
54746109 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
54756110 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
54916126 }
54926127
54936128 /* CIntToPy */
5494 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
6129 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
54956130 const int neg_one = (int) -1, const_zero = (int) 0;
54966131 const int is_unsigned = neg_one > const_zero;
54976132 if (is_unsigned) {
55226157 }
55236158
55246159 /* CIntFromPy */
5525 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
6160 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
55266161 const int neg_one = (int) -1, const_zero = (int) 0;
55276162 const int is_unsigned = neg_one > const_zero;
55286163 #if PY_MAJOR_VERSION < 3
57116346 }
57126347
57136348 /* CIntToPy */
5714 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
6349 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
57156350 const long neg_one = (long) -1, const_zero = (long) 0;
57166351 const int is_unsigned = neg_one > const_zero;
57176352 if (is_unsigned) {
57426377 }
57436378
57446379 /* CIntFromPy */
5745 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
6380 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
57466381 const long neg_one = (long) -1, const_zero = (long) 0;
57476382 const int is_unsigned = neg_one > const_zero;
57486383 #if PY_MAJOR_VERSION < 3
59306565 return (long) -1;
59316566 }
59326567
6568 /* FastTypeChecks */
6569 #if CYTHON_COMPILING_IN_CPYTHON
6570 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
6571 while (a) {
6572 a = a->tp_base;
6573 if (a == b)
6574 return 1;
6575 }
6576 return b == &PyBaseObject_Type;
6577 }
6578 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
6579 PyObject *mro;
6580 if (a == b) return 1;
6581 mro = a->tp_mro;
6582 if (likely(mro)) {
6583 Py_ssize_t i, n;
6584 n = PyTuple_GET_SIZE(mro);
6585 for (i = 0; i < n; i++) {
6586 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
6587 return 1;
6588 }
6589 return 0;
6590 }
6591 return __Pyx_InBases(a, b);
6592 }
6593 #if PY_MAJOR_VERSION == 2
6594 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
6595 PyObject *exception, *value, *tb;
6596 int res;
6597 __Pyx_PyThreadState_declare
6598 __Pyx_PyThreadState_assign
6599 __Pyx_ErrFetch(&exception, &value, &tb);
6600 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
6601 if (unlikely(res == -1)) {
6602 PyErr_WriteUnraisable(err);
6603 res = 0;
6604 }
6605 if (!res) {
6606 res = PyObject_IsSubclass(err, exc_type2);
6607 if (unlikely(res == -1)) {
6608 PyErr_WriteUnraisable(err);
6609 res = 0;
6610 }
6611 }
6612 __Pyx_ErrRestore(exception, value, tb);
6613 return res;
6614 }
6615 #else
6616 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
6617 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
6618 if (!res) {
6619 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
6620 }
6621 return res;
6622 }
6623 #endif
6624 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
6625 Py_ssize_t i, n;
6626 assert(PyExceptionClass_Check(exc_type));
6627 n = PyTuple_GET_SIZE(tuple);
6628 #if PY_MAJOR_VERSION >= 3
6629 for (i=0; i<n; i++) {
6630 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
6631 }
6632 #endif
6633 for (i=0; i<n; i++) {
6634 PyObject *t = PyTuple_GET_ITEM(tuple, i);
6635 #if PY_MAJOR_VERSION < 3
6636 if (likely(exc_type == t)) return 1;
6637 #endif
6638 if (likely(PyExceptionClass_Check(t))) {
6639 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
6640 } else {
6641 }
6642 }
6643 return 0;
6644 }
6645 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
6646 if (likely(err == exc_type)) return 1;
6647 if (likely(PyExceptionClass_Check(err))) {
6648 if (likely(PyExceptionClass_Check(exc_type))) {
6649 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
6650 } else if (likely(PyTuple_Check(exc_type))) {
6651 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
6652 } else {
6653 }
6654 }
6655 return PyErr_GivenExceptionMatches(err, exc_type);
6656 }
6657 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
6658 assert(PyExceptionClass_Check(exc_type1));
6659 assert(PyExceptionClass_Check(exc_type2));
6660 if (likely(err == exc_type1 || err == exc_type2)) return 1;
6661 if (likely(PyExceptionClass_Check(err))) {
6662 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
6663 }
6664 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
6665 }
6666 #endif
6667
59336668 /* CheckBinaryVersion */
5934 static int __Pyx_check_binary_version(void) {
6669 static int __Pyx_check_binary_version(void) {
59356670 char ctversion[4], rtversion[4];
59366671 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
59376672 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
59476682 }
59486683
59496684 /* ModuleImport */
5950 #ifndef __PYX_HAVE_RT_ImportModule
6685 #ifndef __PYX_HAVE_RT_ImportModule
59516686 #define __PYX_HAVE_RT_ImportModule
59526687 static PyObject *__Pyx_ImportModule(const char *name) {
59536688 PyObject *py_name = 0;
59656700 #endif
59666701
59676702 /* TypeImport */
5968 #ifndef __PYX_HAVE_RT_ImportType
6703 #ifndef __PYX_HAVE_RT_ImportType
59696704 #define __PYX_HAVE_RT_ImportType
59706705 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
59716706 size_t size, int strict)
60306765 #endif
60316766
60326767 /* FunctionImport */
6033 #ifndef __PYX_HAVE_RT_ImportFunction
6768 #ifndef __PYX_HAVE_RT_ImportFunction
60346769 #define __PYX_HAVE_RT_ImportFunction
60356770 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
60366771 PyObject *d = 0;
60846819 #endif
60856820
60866821 /* InitStrings */
6087 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
6822 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
60886823 while (t->p) {
60896824 #if PY_MAJOR_VERSION < 3
60906825 if (t->is_unicode) {
61096844 #endif
61106845 if (!*t->p)
61116846 return -1;
6847 if (PyObject_Hash(*t->p) == -1)
6848 return -1;
61126849 ++t;
61136850 }
61146851 return 0;
61176854 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
61186855 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
61196856 }
6120 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
6857 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
61216858 Py_ssize_t ignore;
61226859 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
61236860 }
6124 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6125 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
6861 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
6862 #if !CYTHON_PEP393_ENABLED
6863 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6864 char* defenc_c;
6865 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
6866 if (!defenc) return NULL;
6867 defenc_c = PyBytes_AS_STRING(defenc);
6868 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6869 {
6870 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
6871 char* c;
6872 for (c = defenc_c; c < end; c++) {
6873 if ((unsigned char) (*c) >= 128) {
6874 PyUnicode_AsASCIIString(o);
6875 return NULL;
6876 }
6877 }
6878 }
6879 #endif
6880 *length = PyBytes_GET_SIZE(defenc);
6881 return defenc_c;
6882 }
6883 #else
6884 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6885 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
6886 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6887 if (likely(PyUnicode_IS_ASCII(o))) {
6888 *length = PyUnicode_GET_LENGTH(o);
6889 return PyUnicode_AsUTF8(o);
6890 } else {
6891 PyUnicode_AsASCIIString(o);
6892 return NULL;
6893 }
6894 #else
6895 return PyUnicode_AsUTF8AndSize(o, length);
6896 #endif
6897 }
6898 #endif
6899 #endif
6900 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6901 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
61266902 if (
61276903 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
61286904 __Pyx_sys_getdefaultencoding_not_ascii &&
61296905 #endif
61306906 PyUnicode_Check(o)) {
6131 #if PY_VERSION_HEX < 0x03030000
6132 char* defenc_c;
6133 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
6134 if (!defenc) return NULL;
6135 defenc_c = PyBytes_AS_STRING(defenc);
6136 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6137 {
6138 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
6139 char* c;
6140 for (c = defenc_c; c < end; c++) {
6141 if ((unsigned char) (*c) >= 128) {
6142 PyUnicode_AsASCIIString(o);
6143 return NULL;
6144 }
6145 }
6146 }
6147 #endif
6148 *length = PyBytes_GET_SIZE(defenc);
6149 return defenc_c;
6150 #else
6151 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
6152 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6153 if (PyUnicode_IS_ASCII(o)) {
6154 *length = PyUnicode_GET_LENGTH(o);
6155 return PyUnicode_AsUTF8(o);
6156 } else {
6157 PyUnicode_AsASCIIString(o);
6158 return NULL;
6159 }
6160 #else
6161 return PyUnicode_AsUTF8AndSize(o, length);
6162 #endif
6163 #endif
6907 return __Pyx_PyUnicode_AsStringAndSize(o, length);
61646908 } else
61656909 #endif
61666910 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
61846928 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
61856929 else return PyObject_IsTrue(x);
61866930 }
6931 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
6932 #if PY_MAJOR_VERSION >= 3
6933 if (PyLong_Check(result)) {
6934 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
6935 "__int__ returned non-int (type %.200s). "
6936 "The ability to return an instance of a strict subclass of int "
6937 "is deprecated, and may be removed in a future version of Python.",
6938 Py_TYPE(result)->tp_name)) {
6939 Py_DECREF(result);
6940 return NULL;
6941 }
6942 return result;
6943 }
6944 #endif
6945 PyErr_Format(PyExc_TypeError,
6946 "__%.4s__ returned non-%.4s (type %.200s)",
6947 type_name, type_name, Py_TYPE(result)->tp_name);
6948 Py_DECREF(result);
6949 return NULL;
6950 }
61876951 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
61886952 #if CYTHON_USE_TYPE_SLOTS
61896953 PyNumberMethods *m;
61916955 const char *name = NULL;
61926956 PyObject *res = NULL;
61936957 #if PY_MAJOR_VERSION < 3
6194 if (PyInt_Check(x) || PyLong_Check(x))
6195 #else
6196 if (PyLong_Check(x))
6958 if (likely(PyInt_Check(x) || PyLong_Check(x)))
6959 #else
6960 if (likely(PyLong_Check(x)))
61976961 #endif
61986962 return __Pyx_NewRef(x);
61996963 #if CYTHON_USE_TYPE_SLOTS
62016965 #if PY_MAJOR_VERSION < 3
62026966 if (m && m->nb_int) {
62036967 name = "int";
6204 res = PyNumber_Int(x);
6968 res = m->nb_int(x);
62056969 }
62066970 else if (m && m->nb_long) {
62076971 name = "long";
6208 res = PyNumber_Long(x);
6972 res = m->nb_long(x);
62096973 }
62106974 #else
6211 if (m && m->nb_int) {
6975 if (likely(m && m->nb_int)) {
62126976 name = "int";
6213 res = PyNumber_Long(x);
6977 res = m->nb_int(x);
62146978 }
62156979 #endif
62166980 #else
6217 res = PyNumber_Int(x);
6218 #endif
6219 if (res) {
6981 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
6982 res = PyNumber_Int(x);
6983 }
6984 #endif
6985 if (likely(res)) {
62206986 #if PY_MAJOR_VERSION < 3
6221 if (!PyInt_Check(res) && !PyLong_Check(res)) {
6222 #else
6223 if (!PyLong_Check(res)) {
6224 #endif
6225 PyErr_Format(PyExc_TypeError,
6226 "__%.4s__ returned non-%.4s (type %.200s)",
6227 name, name, Py_TYPE(res)->tp_name);
6228 Py_DECREF(res);
6229 return NULL;
6987 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
6988 #else
6989 if (unlikely(!PyLong_CheckExact(res))) {
6990 #endif
6991 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
62306992 }
62316993 }
62326994 else if (!PyErr_Occurred()) {
62977059 Py_DECREF(x);
62987060 return ival;
62997061 }
7062 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
7063 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
7064 }
63007065 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
63017066 return PyInt_FromSize_t(ival);
63027067 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
88 #else
9 #define CYTHON_ABI "0_25_2"
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
102120 #define CYTHON_COMPILING_IN_CPYTHON 1
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
105129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412552
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
423555 #define __PYX_EXTERN_C extern "C"
428560
429561 #define __PYX_HAVE__pygame_sdl2__gfxdraw
430562 #define __PYX_HAVE_API__pygame_sdl2__gfxdraw
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
440573 #include <omp.h>
441574 #endif /* _OPENMP */
442575
443 #ifdef PYREX_WITHOUT_ASSERTIONS
576 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
444577 #define CYTHON_WITHOUT_ASSERTIONS
445578 #endif
446579
471604 #define __Pyx_sst_abs(value) abs(value)
472605 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
473606 #define __Pyx_sst_abs(value) labs(value)
474 #elif defined (_MSC_VER) && defined (_M_X64)
475 #define __Pyx_sst_abs(value) _abs64(value)
607 #elif defined (_MSC_VER)
608 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
476609 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
477610 #define __Pyx_sst_abs(value) llabs(value)
478611 #elif defined (__GNUC__)
480613 #else
481614 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
482615 #endif
483 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
484 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
616 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
617 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
485618 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
486619 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
487620 #define __Pyx_PyBytes_FromString PyBytes_FromString
494627 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
495628 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
496629 #endif
497 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
498 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
630 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
634 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
635 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
636 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
638 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
639 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
640 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
499641 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
500642 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
501643 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
502644 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
503645 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
504 #if PY_MAJOR_VERSION < 3
505 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
506 {
646 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
507647 const Py_UNICODE *u_end = u;
508648 while (*u_end++) ;
509649 return (size_t)(u_end - u - 1);
510650 }
511 #else
512 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
513 #endif
514651 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
515652 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
516653 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
517654 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
518655 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
519 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
656 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
520657 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
521658 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
659 #define __Pyx_PySequence_Tuple(obj)\
660 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
522661 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
523662 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
524663 #if CYTHON_ASSUME_SAFE_MACROS
617756 #define likely(x) (x)
618757 #define unlikely(x) (x)
619758 #endif /* __GNUC__ */
620
621 static PyObject *__pyx_m;
759 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
760
761 static PyObject *__pyx_m = NULL;
622762 static PyObject *__pyx_d;
623763 static PyObject *__pyx_b;
764 static PyObject *__pyx_cython_runtime = NULL;
624765 static PyObject *__pyx_empty_tuple;
625766 static PyObject *__pyx_empty_bytes;
626767 static PyObject *__pyx_empty_unicode;
779920
780921 /* PyObjectGetAttrStr.proto */
781922 #if CYTHON_USE_TYPE_SLOTS
782 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
783 PyTypeObject* tp = Py_TYPE(obj);
784 if (likely(tp->tp_getattro))
785 return tp->tp_getattro(obj, attr_name);
786 #if PY_MAJOR_VERSION < 3
787 if (likely(tp->tp_getattr))
788 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
789 #endif
790 return PyObject_GetAttr(obj, attr_name);
791 }
923 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
792924 #else
793925 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
794926 #endif
809941 const char* function_name);
810942
811943 /* ArgTypeTest.proto */
812 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
813 const char *name, int exact);
814
815 /* PyObjectCall.proto */
816 #if CYTHON_COMPILING_IN_CPYTHON
817 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
818 #else
819 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
820 #endif
821
822 /* GetModuleGlobalName.proto */
823 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
944 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
945 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
946 __Pyx__ArgTypeTest(obj, type, name, exact))
947 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
824948
825949 /* PyCFunctionFastCall.proto */
826950 #if CYTHON_FAST_PYCCALL
840964 #endif
841965 #endif
842966
967 /* PyObjectCall.proto */
968 #if CYTHON_COMPILING_IN_CPYTHON
969 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
970 #else
971 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
972 #endif
973
843974 /* PyObjectCallMethO.proto */
844975 #if CYTHON_COMPILING_IN_CPYTHON
845976 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
848979 /* PyObjectCallOneArg.proto */
849980 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
850981
982 /* GetModuleGlobalName.proto */
983 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
984
851985 /* RaiseTooManyValuesToUnpack.proto */
852986 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
853987
860994 /* UnpackItemEndCheck.proto */
861995 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
862996
997 /* GetItemInt.proto */
998 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
999 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1000 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1001 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1002 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1003 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1004 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1005 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1006 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1007 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1008 int wraparound, int boundscheck);
1009 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1010 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1011 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1012 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1013 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1014 int wraparound, int boundscheck);
1015 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1016 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1017 int is_list, int wraparound, int boundscheck);
1018
1019 /* ObjectGetItem.proto */
1020 #if CYTHON_USE_TYPE_SLOTS
1021 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1022 #else
1023 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1024 #endif
1025
8631026 /* GetVTable.proto */
8641027 static void* __Pyx_GetVtable(PyObject *dict);
8651028
8681031
8691032 /* ImportFrom.proto */
8701033 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1034
1035 /* PyThreadStateGet.proto */
1036 #if CYTHON_FAST_THREAD_STATE
1037 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1038 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1039 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1040 #else
1041 #define __Pyx_PyThreadState_declare
1042 #define __Pyx_PyThreadState_assign
1043 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1044 #endif
1045
1046 /* PyErrFetchRestore.proto */
1047 #if CYTHON_FAST_THREAD_STATE
1048 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1049 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1050 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1051 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1052 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1053 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1054 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1055 #if CYTHON_COMPILING_IN_CPYTHON
1056 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1057 #else
1058 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1059 #endif
1060 #else
1061 #define __Pyx_PyErr_Clear() PyErr_Clear()
1062 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1063 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1064 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1065 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1066 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1067 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1068 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1069 #endif
1070
1071 /* CLineInTraceback.proto */
1072 #ifdef CYTHON_CLINE_IN_TRACEBACK
1073 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1074 #else
1075 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1076 #endif
8711077
8721078 /* CodeObjectCache.proto */
8731079 typedef struct {
9031109 /* CIntFromPy.proto */
9041110 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
9051111
1112 /* FastTypeChecks.proto */
1113 #if CYTHON_COMPILING_IN_CPYTHON
1114 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1115 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1116 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1117 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1118 #else
1119 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1120 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1121 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1122 #endif
1123 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1124
9061125 /* CheckBinaryVersion.proto */
9071126 static int __Pyx_check_binary_version(void);
9081127
9471166
9481167 /* Module declarations from 'pygame_sdl2.gfxdraw' */
9491168 #define __Pyx_MODULE_NAME "pygame_sdl2.gfxdraw"
1169 extern int __pyx_module_is_main_pygame_sdl2__gfxdraw;
9501170 int __pyx_module_is_main_pygame_sdl2__gfxdraw = 0;
9511171
9521172 /* Implementation of 'pygame_sdl2.gfxdraw' */
10241244 static const char __pyx_k_textured_polygon[] = "textured_polygon";
10251245 static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error";
10261246 static const char __pyx_k_rounded_rectangle[] = "rounded_rectangle";
1247 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
10271248 static const char __pyx_k_pygame_sdl2_gfxdraw[] = "pygame_sdl2.gfxdraw";
10281249 static const char __pyx_k_src_pygame_sdl2_gfxdraw_pyx[] = "src/pygame_sdl2/gfxdraw.pyx";
10291250 static PyObject *__pyx_n_s_Rect;
10371258 static PyObject *__pyx_n_s_box;
10381259 static PyObject *__pyx_n_s_c;
10391260 static PyObject *__pyx_n_s_circle;
1261 static PyObject *__pyx_n_s_cline_in_traceback;
10401262 static PyObject *__pyx_n_s_color;
10411263 static PyObject *__pyx_n_s_ellipse;
10421264 static PyObject *__pyx_n_s_end;
11811403 static PyObject *__pyx_codeobj__50;
11821404 static PyObject *__pyx_codeobj__52;
11831405 static PyObject *__pyx_codeobj__54;
1406 /* Late includes */
11841407
11851408 /* "pygame_sdl2/gfxdraw.pyx":29
11861409 *
12091432 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12101433 switch (pos_args) {
12111434 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1435 CYTHON_FALLTHROUGH;
12121436 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1437 CYTHON_FALLTHROUGH;
12131438 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1439 CYTHON_FALLTHROUGH;
12141440 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1441 CYTHON_FALLTHROUGH;
12151442 case 0: break;
12161443 default: goto __pyx_L5_argtuple_error;
12171444 }
12181445 kw_args = PyDict_Size(__pyx_kwds);
12191446 switch (pos_args) {
12201447 case 0:
1221 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
1448 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
12221449 else goto __pyx_L5_argtuple_error;
1450 CYTHON_FALLTHROUGH;
12231451 case 1:
1224 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
1452 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
12251453 else {
12261454 __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, 1); __PYX_ERR(0, 29, __pyx_L3_error)
12271455 }
1456 CYTHON_FALLTHROUGH;
12281457 case 2:
1229 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
1458 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
12301459 else {
12311460 __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, 2); __PYX_ERR(0, 29, __pyx_L3_error)
12321461 }
1462 CYTHON_FALLTHROUGH;
12331463 case 3:
1234 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
1464 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
12351465 else {
12361466 __Pyx_RaiseArgtupleInvalid("pixel", 1, 4, 4, 3); __PYX_ERR(0, 29, __pyx_L3_error)
12371467 }
12771507 PyObject *__pyx_r = NULL;
12781508 __Pyx_RefNannyDeclarations
12791509 PyObject *__pyx_t_1 = NULL;
1280 PyObject *__pyx_t_2 = NULL;
1510 Sint16 __pyx_t_2;
12811511 Sint16 __pyx_t_3;
1282 Sint16 __pyx_t_4;
12831512 __Pyx_RefNannySetupContext("pixel", 0);
12841513
12851514 /* "pygame_sdl2/gfxdraw.pyx":30
12891518 * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a)
12901519 *
12911520 */
1292 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
1521 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
12931522 __Pyx_GOTREF(__pyx_t_1);
1294 __Pyx_INCREF(__pyx_v_color);
1295 __Pyx_GIVEREF(__pyx_v_color);
1296 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
1297 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
1298 __Pyx_GOTREF(__pyx_t_2);
1299 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1300 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
1301 __pyx_t_2 = 0;
1523 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
1524 __pyx_t_1 = 0;
13021525
13031526 /* "pygame_sdl2/gfxdraw.pyx":31
13041527 * def pixel(Surface surface, x, y, color):
13071530 *
13081531 * def hline(Surface surface, x1, x2, y, color):
13091532 */
1310 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error)
1311 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error)
1312 pixelRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
1533 __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error)
1534 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L1_error)
1535 (void)(pixelRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
13131536
13141537 /* "pygame_sdl2/gfxdraw.pyx":29
13151538 *
13241547 goto __pyx_L0;
13251548 __pyx_L1_error:;
13261549 __Pyx_XDECREF(__pyx_t_1);
1327 __Pyx_XDECREF(__pyx_t_2);
13281550 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pixel", __pyx_clineno, __pyx_lineno, __pyx_filename);
13291551 __pyx_r = NULL;
13301552 __pyx_L0:;
13621584 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13631585 switch (pos_args) {
13641586 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
1587 CYTHON_FALLTHROUGH;
13651588 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1589 CYTHON_FALLTHROUGH;
13661590 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1591 CYTHON_FALLTHROUGH;
13671592 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1593 CYTHON_FALLTHROUGH;
13681594 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1595 CYTHON_FALLTHROUGH;
13691596 case 0: break;
13701597 default: goto __pyx_L5_argtuple_error;
13711598 }
13721599 kw_args = PyDict_Size(__pyx_kwds);
13731600 switch (pos_args) {
13741601 case 0:
1375 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
1602 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
13761603 else goto __pyx_L5_argtuple_error;
1604 CYTHON_FALLTHROUGH;
13771605 case 1:
1378 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
1606 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
13791607 else {
13801608 __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 1); __PYX_ERR(0, 33, __pyx_L3_error)
13811609 }
1610 CYTHON_FALLTHROUGH;
13821611 case 2:
1383 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
1612 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
13841613 else {
13851614 __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 2); __PYX_ERR(0, 33, __pyx_L3_error)
13861615 }
1616 CYTHON_FALLTHROUGH;
13871617 case 3:
1388 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
1618 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
13891619 else {
13901620 __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 3); __PYX_ERR(0, 33, __pyx_L3_error)
13911621 }
1622 CYTHON_FALLTHROUGH;
13921623 case 4:
1393 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
1624 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
13941625 else {
13951626 __Pyx_RaiseArgtupleInvalid("hline", 1, 5, 5, 4); __PYX_ERR(0, 33, __pyx_L3_error)
13961627 }
14381669 PyObject *__pyx_r = NULL;
14391670 __Pyx_RefNannyDeclarations
14401671 PyObject *__pyx_t_1 = NULL;
1441 PyObject *__pyx_t_2 = NULL;
1672 Sint16 __pyx_t_2;
14421673 Sint16 __pyx_t_3;
14431674 Sint16 __pyx_t_4;
1444 Sint16 __pyx_t_5;
14451675 __Pyx_RefNannySetupContext("hline", 0);
14461676
14471677 /* "pygame_sdl2/gfxdraw.pyx":34
14511681 * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a)
14521682 *
14531683 */
1454 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
1684 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
14551685 __Pyx_GOTREF(__pyx_t_1);
1456 __Pyx_INCREF(__pyx_v_color);
1457 __Pyx_GIVEREF(__pyx_v_color);
1458 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
1459 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
1460 __Pyx_GOTREF(__pyx_t_2);
1461 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1462 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
1463 __pyx_t_2 = 0;
1686 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
1687 __pyx_t_1 = 0;
14641688
14651689 /* "pygame_sdl2/gfxdraw.pyx":35
14661690 * def hline(Surface surface, x1, x2, y, color):
14691693 *
14701694 * def vline(Surface surface, x, y1, y2, color):
14711695 */
1472 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error)
1473 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error)
1474 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error)
1475 hlineRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
1696 __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error)
1697 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error)
1698 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 35, __pyx_L1_error)
1699 (void)(hlineRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
14761700
14771701 /* "pygame_sdl2/gfxdraw.pyx":33
14781702 * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a)
14871711 goto __pyx_L0;
14881712 __pyx_L1_error:;
14891713 __Pyx_XDECREF(__pyx_t_1);
1490 __Pyx_XDECREF(__pyx_t_2);
14911714 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.hline", __pyx_clineno, __pyx_lineno, __pyx_filename);
14921715 __pyx_r = NULL;
14931716 __pyx_L0:;
15251748 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15261749 switch (pos_args) {
15271750 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
1751 CYTHON_FALLTHROUGH;
15281752 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1753 CYTHON_FALLTHROUGH;
15291754 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1755 CYTHON_FALLTHROUGH;
15301756 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1757 CYTHON_FALLTHROUGH;
15311758 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1759 CYTHON_FALLTHROUGH;
15321760 case 0: break;
15331761 default: goto __pyx_L5_argtuple_error;
15341762 }
15351763 kw_args = PyDict_Size(__pyx_kwds);
15361764 switch (pos_args) {
15371765 case 0:
1538 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
1766 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
15391767 else goto __pyx_L5_argtuple_error;
1768 CYTHON_FALLTHROUGH;
15401769 case 1:
1541 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
1770 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
15421771 else {
15431772 __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 1); __PYX_ERR(0, 37, __pyx_L3_error)
15441773 }
1774 CYTHON_FALLTHROUGH;
15451775 case 2:
1546 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
1776 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
15471777 else {
15481778 __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 2); __PYX_ERR(0, 37, __pyx_L3_error)
15491779 }
1780 CYTHON_FALLTHROUGH;
15501781 case 3:
1551 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
1782 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
15521783 else {
15531784 __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 3); __PYX_ERR(0, 37, __pyx_L3_error)
15541785 }
1786 CYTHON_FALLTHROUGH;
15551787 case 4:
1556 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
1788 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
15571789 else {
15581790 __Pyx_RaiseArgtupleInvalid("vline", 1, 5, 5, 4); __PYX_ERR(0, 37, __pyx_L3_error)
15591791 }
16011833 PyObject *__pyx_r = NULL;
16021834 __Pyx_RefNannyDeclarations
16031835 PyObject *__pyx_t_1 = NULL;
1604 PyObject *__pyx_t_2 = NULL;
1836 Sint16 __pyx_t_2;
16051837 Sint16 __pyx_t_3;
16061838 Sint16 __pyx_t_4;
1607 Sint16 __pyx_t_5;
16081839 __Pyx_RefNannySetupContext("vline", 0);
16091840
16101841 /* "pygame_sdl2/gfxdraw.pyx":38
16141845 * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a)
16151846 *
16161847 */
1617 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
1848 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
16181849 __Pyx_GOTREF(__pyx_t_1);
1619 __Pyx_INCREF(__pyx_v_color);
1620 __Pyx_GIVEREF(__pyx_v_color);
1621 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
1622 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error)
1623 __Pyx_GOTREF(__pyx_t_2);
1624 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1625 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
1626 __pyx_t_2 = 0;
1850 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
1851 __pyx_t_1 = 0;
16271852
16281853 /* "pygame_sdl2/gfxdraw.pyx":39
16291854 * def vline(Surface surface, x, y1, y2, color):
16321857 *
16331858 * def rectangle(Surface surface, rect, color):
16341859 */
1635 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error)
1636 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error)
1637 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error)
1638 vlineRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
1860 __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error)
1861 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error)
1862 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error)
1863 (void)(vlineRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
16391864
16401865 /* "pygame_sdl2/gfxdraw.pyx":37
16411866 * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a)
16501875 goto __pyx_L0;
16511876 __pyx_L1_error:;
16521877 __Pyx_XDECREF(__pyx_t_1);
1653 __Pyx_XDECREF(__pyx_t_2);
16541878 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.vline", __pyx_clineno, __pyx_lineno, __pyx_filename);
16551879 __pyx_r = NULL;
16561880 __pyx_L0:;
16861910 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16871911 switch (pos_args) {
16881912 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1913 CYTHON_FALLTHROUGH;
16891914 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1915 CYTHON_FALLTHROUGH;
16901916 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1917 CYTHON_FALLTHROUGH;
16911918 case 0: break;
16921919 default: goto __pyx_L5_argtuple_error;
16931920 }
16941921 kw_args = PyDict_Size(__pyx_kwds);
16951922 switch (pos_args) {
16961923 case 0:
1697 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
1924 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
16981925 else goto __pyx_L5_argtuple_error;
1926 CYTHON_FALLTHROUGH;
16991927 case 1:
1700 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
1928 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
17011929 else {
17021930 __Pyx_RaiseArgtupleInvalid("rectangle", 1, 3, 3, 1); __PYX_ERR(0, 41, __pyx_L3_error)
17031931 }
1932 CYTHON_FALLTHROUGH;
17041933 case 2:
1705 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
1934 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
17061935 else {
17071936 __Pyx_RaiseArgtupleInvalid("rectangle", 1, 3, 3, 2); __PYX_ERR(0, 41, __pyx_L3_error)
17081937 }
17461975 PyObject *__pyx_r = NULL;
17471976 __Pyx_RefNannyDeclarations
17481977 PyObject *__pyx_t_1 = NULL;
1749 PyObject *__pyx_t_2 = NULL;
1978 int __pyx_t_2;
17501979 int __pyx_t_3;
1751 int __pyx_t_4;
1980 PyObject *__pyx_t_4 = NULL;
17521981 PyObject *__pyx_t_5 = NULL;
17531982 PyObject *__pyx_t_6 = NULL;
17541983 Sint16 __pyx_t_7;
17651994 * if not isinstance(rect, Rect):
17661995 * rect = Rect(rect)
17671996 */
1768 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
1997 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
17691998 __Pyx_GOTREF(__pyx_t_1);
1770 __Pyx_INCREF(__pyx_v_color);
1771 __Pyx_GIVEREF(__pyx_v_color);
1772 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
1773 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
1774 __Pyx_GOTREF(__pyx_t_2);
1775 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1776 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
1777 __pyx_t_2 = 0;
1999 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
2000 __pyx_t_1 = 0;
17782001
17792002 /* "pygame_sdl2/gfxdraw.pyx":43
17802003 * def rectangle(Surface surface, rect, color):
17832006 * rect = Rect(rect)
17842007 * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
17852008 */
1786 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
1787 __Pyx_GOTREF(__pyx_t_2);
1788 __pyx_t_3 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 43, __pyx_L1_error)
1789 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1790 __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
1791 if (__pyx_t_4) {
2009 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
2010 __Pyx_GOTREF(__pyx_t_1);
2011 __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 43, __pyx_L1_error)
2012 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2013 __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
2014 if (__pyx_t_3) {
17922015
17932016 /* "pygame_sdl2/gfxdraw.pyx":44
17942017 * cdef Color c = Color(color)
17972020 * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
17982021 *
17992022 */
1800 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
1801 __Pyx_GOTREF(__pyx_t_1);
2023 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 44, __pyx_L1_error)
2024 __Pyx_GOTREF(__pyx_t_4);
18022025 __pyx_t_5 = NULL;
1803 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
1804 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
2026 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
2027 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
18052028 if (likely(__pyx_t_5)) {
1806 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
2029 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
18072030 __Pyx_INCREF(__pyx_t_5);
18082031 __Pyx_INCREF(function);
1809 __Pyx_DECREF_SET(__pyx_t_1, function);
2032 __Pyx_DECREF_SET(__pyx_t_4, function);
18102033 }
18112034 }
18122035 if (!__pyx_t_5) {
1813 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
1814 __Pyx_GOTREF(__pyx_t_2);
2036 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
2037 __Pyx_GOTREF(__pyx_t_1);
18152038 } else {
18162039 #if CYTHON_FAST_PYCALL
1817 if (PyFunction_Check(__pyx_t_1)) {
2040 if (PyFunction_Check(__pyx_t_4)) {
18182041 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_rect};
1819 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
2042 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
18202043 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
1821 __Pyx_GOTREF(__pyx_t_2);
2044 __Pyx_GOTREF(__pyx_t_1);
18222045 } else
18232046 #endif
18242047 #if CYTHON_FAST_PYCCALL
1825 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
2048 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
18262049 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_rect};
1827 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
2050 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
18282051 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
1829 __Pyx_GOTREF(__pyx_t_2);
2052 __Pyx_GOTREF(__pyx_t_1);
18302053 } else
18312054 #endif
18322055 {
18362059 __Pyx_INCREF(__pyx_v_rect);
18372060 __Pyx_GIVEREF(__pyx_v_rect);
18382061 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_rect);
1839 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
1840 __Pyx_GOTREF(__pyx_t_2);
2062 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
2063 __Pyx_GOTREF(__pyx_t_1);
18412064 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18422065 }
18432066 }
1844 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1845 __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_2);
1846 __pyx_t_2 = 0;
2067 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2068 __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_1);
2069 __pyx_t_1 = 0;
18472070
18482071 /* "pygame_sdl2/gfxdraw.pyx":43
18492072 * def rectangle(Surface surface, rect, color):
18612084 *
18622085 * def rounded_rectangle(Surface surface, rect, rad, color):
18632086 */
1864 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
1865 __Pyx_GOTREF(__pyx_t_2);
1866 __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error)
1867 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1868 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
1869 __Pyx_GOTREF(__pyx_t_2);
1870 __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error)
1871 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1872 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
1873 __Pyx_GOTREF(__pyx_t_2);
1874 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
2087 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
18752088 __Pyx_GOTREF(__pyx_t_1);
1876 __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 45, __pyx_L1_error)
2089 __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error)
2090 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2091 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
2092 __Pyx_GOTREF(__pyx_t_1);
2093 __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error)
2094 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2095 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
2096 __Pyx_GOTREF(__pyx_t_1);
2097 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error)
2098 __Pyx_GOTREF(__pyx_t_4);
2099 __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 45, __pyx_L1_error)
18772100 __Pyx_GOTREF(__pyx_t_6);
1878 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18792101 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2102 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18802103 __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error)
18812104 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18822105 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 45, __pyx_L1_error)
18832106 __Pyx_GOTREF(__pyx_t_6);
1884 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
2107 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error)
2108 __Pyx_GOTREF(__pyx_t_4);
2109 __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
18852110 __Pyx_GOTREF(__pyx_t_1);
1886 __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
1887 __Pyx_GOTREF(__pyx_t_2);
18882111 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2112 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2113 __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error)
18892114 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1890 __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L1_error)
1891 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1892 rectangleRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
2115 (void)(rectangleRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
18932116
18942117 /* "pygame_sdl2/gfxdraw.pyx":41
18952118 * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a)
19042127 goto __pyx_L0;
19052128 __pyx_L1_error:;
19062129 __Pyx_XDECREF(__pyx_t_1);
1907 __Pyx_XDECREF(__pyx_t_2);
2130 __Pyx_XDECREF(__pyx_t_4);
19082131 __Pyx_XDECREF(__pyx_t_5);
19092132 __Pyx_XDECREF(__pyx_t_6);
19102133 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename);
19442167 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19452168 switch (pos_args) {
19462169 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2170 CYTHON_FALLTHROUGH;
19472171 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2172 CYTHON_FALLTHROUGH;
19482173 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2174 CYTHON_FALLTHROUGH;
19492175 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2176 CYTHON_FALLTHROUGH;
19502177 case 0: break;
19512178 default: goto __pyx_L5_argtuple_error;
19522179 }
19532180 kw_args = PyDict_Size(__pyx_kwds);
19542181 switch (pos_args) {
19552182 case 0:
1956 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
2183 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
19572184 else goto __pyx_L5_argtuple_error;
2185 CYTHON_FALLTHROUGH;
19582186 case 1:
1959 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
2187 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
19602188 else {
19612189 __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, 1); __PYX_ERR(0, 47, __pyx_L3_error)
19622190 }
2191 CYTHON_FALLTHROUGH;
19632192 case 2:
1964 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rad)) != 0)) kw_args--;
2193 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rad)) != 0)) kw_args--;
19652194 else {
19662195 __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, 2); __PYX_ERR(0, 47, __pyx_L3_error)
19672196 }
2197 CYTHON_FALLTHROUGH;
19682198 case 3:
1969 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
2199 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
19702200 else {
19712201 __Pyx_RaiseArgtupleInvalid("rounded_rectangle", 1, 4, 4, 3); __PYX_ERR(0, 47, __pyx_L3_error)
19722202 }
20122242 PyObject *__pyx_r = NULL;
20132243 __Pyx_RefNannyDeclarations
20142244 PyObject *__pyx_t_1 = NULL;
2015 PyObject *__pyx_t_2 = NULL;
2245 int __pyx_t_2;
20162246 int __pyx_t_3;
2017 int __pyx_t_4;
2247 PyObject *__pyx_t_4 = NULL;
20182248 PyObject *__pyx_t_5 = NULL;
20192249 PyObject *__pyx_t_6 = NULL;
20202250 Sint16 __pyx_t_7;
20322262 * if not isinstance(rect, Rect):
20332263 * rect = Rect(rect)
20342264 */
2035 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
2265 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
20362266 __Pyx_GOTREF(__pyx_t_1);
2037 __Pyx_INCREF(__pyx_v_color);
2038 __Pyx_GIVEREF(__pyx_v_color);
2039 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
2040 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error)
2041 __Pyx_GOTREF(__pyx_t_2);
2042 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2043 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
2044 __pyx_t_2 = 0;
2267 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
2268 __pyx_t_1 = 0;
20452269
20462270 /* "pygame_sdl2/gfxdraw.pyx":49
20472271 * def rounded_rectangle(Surface surface, rect, rad, color):
20502274 * rect = Rect(rect)
20512275 * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
20522276 */
2053 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
2054 __Pyx_GOTREF(__pyx_t_2);
2055 __pyx_t_3 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 49, __pyx_L1_error)
2056 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2057 __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
2058 if (__pyx_t_4) {
2277 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
2278 __Pyx_GOTREF(__pyx_t_1);
2279 __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 49, __pyx_L1_error)
2280 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2281 __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
2282 if (__pyx_t_3) {
20592283
20602284 /* "pygame_sdl2/gfxdraw.pyx":50
20612285 * cdef Color c = Color(color)
20642288 * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
20652289 *
20662290 */
2067 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
2068 __Pyx_GOTREF(__pyx_t_1);
2291 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error)
2292 __Pyx_GOTREF(__pyx_t_4);
20692293 __pyx_t_5 = NULL;
2070 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
2071 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
2294 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
2295 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
20722296 if (likely(__pyx_t_5)) {
2073 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
2297 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
20742298 __Pyx_INCREF(__pyx_t_5);
20752299 __Pyx_INCREF(function);
2076 __Pyx_DECREF_SET(__pyx_t_1, function);
2300 __Pyx_DECREF_SET(__pyx_t_4, function);
20772301 }
20782302 }
20792303 if (!__pyx_t_5) {
2080 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)
2081 __Pyx_GOTREF(__pyx_t_2);
2304 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
2305 __Pyx_GOTREF(__pyx_t_1);
20822306 } else {
20832307 #if CYTHON_FAST_PYCALL
2084 if (PyFunction_Check(__pyx_t_1)) {
2308 if (PyFunction_Check(__pyx_t_4)) {
20852309 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_rect};
2086 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)
2310 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
20872311 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2088 __Pyx_GOTREF(__pyx_t_2);
2312 __Pyx_GOTREF(__pyx_t_1);
20892313 } else
20902314 #endif
20912315 #if CYTHON_FAST_PYCCALL
2092 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
2316 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
20932317 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_rect};
2094 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)
2318 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
20952319 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2096 __Pyx_GOTREF(__pyx_t_2);
2320 __Pyx_GOTREF(__pyx_t_1);
20972321 } else
20982322 #endif
20992323 {
21032327 __Pyx_INCREF(__pyx_v_rect);
21042328 __Pyx_GIVEREF(__pyx_v_rect);
21052329 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_rect);
2106 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)
2107 __Pyx_GOTREF(__pyx_t_2);
2330 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
2331 __Pyx_GOTREF(__pyx_t_1);
21082332 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21092333 }
21102334 }
2111 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2112 __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_2);
2113 __pyx_t_2 = 0;
2335 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2336 __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_1);
2337 __pyx_t_1 = 0;
21142338
21152339 /* "pygame_sdl2/gfxdraw.pyx":49
21162340 * def rounded_rectangle(Surface surface, rect, rad, color):
21282352 *
21292353 * def box(Surface surface, rect, color):
21302354 */
2131 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
2132 __Pyx_GOTREF(__pyx_t_2);
2133 __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error)
2134 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2135 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
2136 __Pyx_GOTREF(__pyx_t_2);
2137 __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error)
2138 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2139 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
2140 __Pyx_GOTREF(__pyx_t_2);
2141 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
2355 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
21422356 __Pyx_GOTREF(__pyx_t_1);
2143 __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 51, __pyx_L1_error)
2357 __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error)
2358 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2359 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
2360 __Pyx_GOTREF(__pyx_t_1);
2361 __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error)
2362 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2363 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
2364 __Pyx_GOTREF(__pyx_t_1);
2365 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error)
2366 __Pyx_GOTREF(__pyx_t_4);
2367 __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 51, __pyx_L1_error)
21442368 __Pyx_GOTREF(__pyx_t_6);
2145 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21462369 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2370 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21472371 __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error)
21482372 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21492373 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 51, __pyx_L1_error)
21502374 __Pyx_GOTREF(__pyx_t_6);
2151 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
2375 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 51, __pyx_L1_error)
2376 __Pyx_GOTREF(__pyx_t_4);
2377 __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
21522378 __Pyx_GOTREF(__pyx_t_1);
2153 __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
2154 __Pyx_GOTREF(__pyx_t_2);
21552379 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2380 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2381 __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error)
21562382 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2157 __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error)
2158 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21592383 __pyx_t_11 = __Pyx_PyInt_As_int16_t(__pyx_v_rad); if (unlikely((__pyx_t_11 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error)
2160 roundedRectangleRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
2384 (void)(roundedRectangleRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
21612385
21622386 /* "pygame_sdl2/gfxdraw.pyx":47
21632387 * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
21722396 goto __pyx_L0;
21732397 __pyx_L1_error:;
21742398 __Pyx_XDECREF(__pyx_t_1);
2175 __Pyx_XDECREF(__pyx_t_2);
2399 __Pyx_XDECREF(__pyx_t_4);
21762400 __Pyx_XDECREF(__pyx_t_5);
21772401 __Pyx_XDECREF(__pyx_t_6);
21782402 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_rectangle", __pyx_clineno, __pyx_lineno, __pyx_filename);
22112435 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
22122436 switch (pos_args) {
22132437 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2438 CYTHON_FALLTHROUGH;
22142439 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2440 CYTHON_FALLTHROUGH;
22152441 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2442 CYTHON_FALLTHROUGH;
22162443 case 0: break;
22172444 default: goto __pyx_L5_argtuple_error;
22182445 }
22192446 kw_args = PyDict_Size(__pyx_kwds);
22202447 switch (pos_args) {
22212448 case 0:
2222 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
2449 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
22232450 else goto __pyx_L5_argtuple_error;
2451 CYTHON_FALLTHROUGH;
22242452 case 1:
2225 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
2453 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
22262454 else {
22272455 __Pyx_RaiseArgtupleInvalid("box", 1, 3, 3, 1); __PYX_ERR(0, 53, __pyx_L3_error)
22282456 }
2457 CYTHON_FALLTHROUGH;
22292458 case 2:
2230 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
2459 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
22312460 else {
22322461 __Pyx_RaiseArgtupleInvalid("box", 1, 3, 3, 2); __PYX_ERR(0, 53, __pyx_L3_error)
22332462 }
22712500 PyObject *__pyx_r = NULL;
22722501 __Pyx_RefNannyDeclarations
22732502 PyObject *__pyx_t_1 = NULL;
2274 PyObject *__pyx_t_2 = NULL;
2503 int __pyx_t_2;
22752504 int __pyx_t_3;
2276 int __pyx_t_4;
2505 PyObject *__pyx_t_4 = NULL;
22772506 PyObject *__pyx_t_5 = NULL;
22782507 PyObject *__pyx_t_6 = NULL;
22792508 Sint16 __pyx_t_7;
22902519 * if not isinstance(rect, Rect):
22912520 * rect = Rect(rect)
22922521 */
2293 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error)
2522 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error)
22942523 __Pyx_GOTREF(__pyx_t_1);
2295 __Pyx_INCREF(__pyx_v_color);
2296 __Pyx_GIVEREF(__pyx_v_color);
2297 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
2298 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error)
2299 __Pyx_GOTREF(__pyx_t_2);
2300 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2301 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
2302 __pyx_t_2 = 0;
2524 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
2525 __pyx_t_1 = 0;
23032526
23042527 /* "pygame_sdl2/gfxdraw.pyx":55
23052528 * def box(Surface surface, rect, color):
23082531 * rect = Rect(rect)
23092532 * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
23102533 */
2311 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
2312 __Pyx_GOTREF(__pyx_t_2);
2313 __pyx_t_3 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 55, __pyx_L1_error)
2314 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2315 __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
2316 if (__pyx_t_4) {
2534 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
2535 __Pyx_GOTREF(__pyx_t_1);
2536 __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 55, __pyx_L1_error)
2537 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2538 __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
2539 if (__pyx_t_3) {
23172540
23182541 /* "pygame_sdl2/gfxdraw.pyx":56
23192542 * cdef Color c = Color(color)
23222545 * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
23232546 *
23242547 */
2325 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
2326 __Pyx_GOTREF(__pyx_t_1);
2548 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error)
2549 __Pyx_GOTREF(__pyx_t_4);
23272550 __pyx_t_5 = NULL;
2328 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
2329 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
2551 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
2552 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
23302553 if (likely(__pyx_t_5)) {
2331 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
2554 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
23322555 __Pyx_INCREF(__pyx_t_5);
23332556 __Pyx_INCREF(function);
2334 __Pyx_DECREF_SET(__pyx_t_1, function);
2557 __Pyx_DECREF_SET(__pyx_t_4, function);
23352558 }
23362559 }
23372560 if (!__pyx_t_5) {
2338 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
2339 __Pyx_GOTREF(__pyx_t_2);
2561 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
2562 __Pyx_GOTREF(__pyx_t_1);
23402563 } else {
23412564 #if CYTHON_FAST_PYCALL
2342 if (PyFunction_Check(__pyx_t_1)) {
2565 if (PyFunction_Check(__pyx_t_4)) {
23432566 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_rect};
2344 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
2567 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
23452568 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2346 __Pyx_GOTREF(__pyx_t_2);
2569 __Pyx_GOTREF(__pyx_t_1);
23472570 } else
23482571 #endif
23492572 #if CYTHON_FAST_PYCCALL
2350 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
2573 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
23512574 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_rect};
2352 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
2575 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
23532576 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2354 __Pyx_GOTREF(__pyx_t_2);
2577 __Pyx_GOTREF(__pyx_t_1);
23552578 } else
23562579 #endif
23572580 {
23612584 __Pyx_INCREF(__pyx_v_rect);
23622585 __Pyx_GIVEREF(__pyx_v_rect);
23632586 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_rect);
2364 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
2365 __Pyx_GOTREF(__pyx_t_2);
2587 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
2588 __Pyx_GOTREF(__pyx_t_1);
23662589 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23672590 }
23682591 }
2369 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2370 __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_2);
2371 __pyx_t_2 = 0;
2592 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2593 __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_1);
2594 __pyx_t_1 = 0;
23722595
23732596 /* "pygame_sdl2/gfxdraw.pyx":55
23742597 * def box(Surface surface, rect, color):
23862609 *
23872610 * def rounded_box(Surface surface, rect, rad, color):
23882611 */
2389 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
2390 __Pyx_GOTREF(__pyx_t_2);
2391 __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error)
2392 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2393 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
2394 __Pyx_GOTREF(__pyx_t_2);
2395 __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error)
2396 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2397 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
2398 __Pyx_GOTREF(__pyx_t_2);
2399 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
2612 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
24002613 __Pyx_GOTREF(__pyx_t_1);
2401 __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 57, __pyx_L1_error)
2614 __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error)
2615 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2616 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
2617 __Pyx_GOTREF(__pyx_t_1);
2618 __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error)
2619 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2620 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
2621 __Pyx_GOTREF(__pyx_t_1);
2622 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error)
2623 __Pyx_GOTREF(__pyx_t_4);
2624 __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 57, __pyx_L1_error)
24022625 __Pyx_GOTREF(__pyx_t_6);
2403 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24042626 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2627 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24052628 __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error)
24062629 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24072630 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 57, __pyx_L1_error)
24082631 __Pyx_GOTREF(__pyx_t_6);
2409 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
2632 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error)
2633 __Pyx_GOTREF(__pyx_t_4);
2634 __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
24102635 __Pyx_GOTREF(__pyx_t_1);
2411 __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
2412 __Pyx_GOTREF(__pyx_t_2);
24132636 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2637 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2638 __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error)
24142639 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2415 __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error)
2416 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2417 boxRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
2640 (void)(boxRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
24182641
24192642 /* "pygame_sdl2/gfxdraw.pyx":53
24202643 * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
24292652 goto __pyx_L0;
24302653 __pyx_L1_error:;
24312654 __Pyx_XDECREF(__pyx_t_1);
2432 __Pyx_XDECREF(__pyx_t_2);
2655 __Pyx_XDECREF(__pyx_t_4);
24332656 __Pyx_XDECREF(__pyx_t_5);
24342657 __Pyx_XDECREF(__pyx_t_6);
24352658 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.box", __pyx_clineno, __pyx_lineno, __pyx_filename);
24692692 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
24702693 switch (pos_args) {
24712694 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2695 CYTHON_FALLTHROUGH;
24722696 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2697 CYTHON_FALLTHROUGH;
24732698 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2699 CYTHON_FALLTHROUGH;
24742700 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2701 CYTHON_FALLTHROUGH;
24752702 case 0: break;
24762703 default: goto __pyx_L5_argtuple_error;
24772704 }
24782705 kw_args = PyDict_Size(__pyx_kwds);
24792706 switch (pos_args) {
24802707 case 0:
2481 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
2708 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
24822709 else goto __pyx_L5_argtuple_error;
2710 CYTHON_FALLTHROUGH;
24832711 case 1:
2484 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
2712 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
24852713 else {
24862714 __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, 1); __PYX_ERR(0, 59, __pyx_L3_error)
24872715 }
2716 CYTHON_FALLTHROUGH;
24882717 case 2:
2489 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rad)) != 0)) kw_args--;
2718 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rad)) != 0)) kw_args--;
24902719 else {
24912720 __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, 2); __PYX_ERR(0, 59, __pyx_L3_error)
24922721 }
2722 CYTHON_FALLTHROUGH;
24932723 case 3:
2494 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
2724 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
24952725 else {
24962726 __Pyx_RaiseArgtupleInvalid("rounded_box", 1, 4, 4, 3); __PYX_ERR(0, 59, __pyx_L3_error)
24972727 }
25372767 PyObject *__pyx_r = NULL;
25382768 __Pyx_RefNannyDeclarations
25392769 PyObject *__pyx_t_1 = NULL;
2540 PyObject *__pyx_t_2 = NULL;
2770 int __pyx_t_2;
25412771 int __pyx_t_3;
2542 int __pyx_t_4;
2772 PyObject *__pyx_t_4 = NULL;
25432773 PyObject *__pyx_t_5 = NULL;
25442774 PyObject *__pyx_t_6 = NULL;
25452775 Sint16 __pyx_t_7;
25572787 * if not isinstance(rect, Rect):
25582788 * rect = Rect(rect)
25592789 */
2560 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
2790 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
25612791 __Pyx_GOTREF(__pyx_t_1);
2562 __Pyx_INCREF(__pyx_v_color);
2563 __Pyx_GIVEREF(__pyx_v_color);
2564 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
2565 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error)
2566 __Pyx_GOTREF(__pyx_t_2);
2567 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2568 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
2569 __pyx_t_2 = 0;
2792 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
2793 __pyx_t_1 = 0;
25702794
25712795 /* "pygame_sdl2/gfxdraw.pyx":61
25722796 * def rounded_box(Surface surface, rect, rad, color):
25752799 * rect = Rect(rect)
25762800 * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
25772801 */
2578 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error)
2579 __Pyx_GOTREF(__pyx_t_2);
2580 __pyx_t_3 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 61, __pyx_L1_error)
2581 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2582 __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
2583 if (__pyx_t_4) {
2802 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
2803 __Pyx_GOTREF(__pyx_t_1);
2804 __pyx_t_2 = PyObject_IsInstance(__pyx_v_rect, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 61, __pyx_L1_error)
2805 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2806 __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
2807 if (__pyx_t_3) {
25842808
25852809 /* "pygame_sdl2/gfxdraw.pyx":62
25862810 * cdef Color c = Color(color)
25892813 * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
25902814 *
25912815 */
2592 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
2593 __Pyx_GOTREF(__pyx_t_1);
2816 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error)
2817 __Pyx_GOTREF(__pyx_t_4);
25942818 __pyx_t_5 = NULL;
2595 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
2596 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
2819 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
2820 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
25972821 if (likely(__pyx_t_5)) {
2598 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
2822 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
25992823 __Pyx_INCREF(__pyx_t_5);
26002824 __Pyx_INCREF(function);
2601 __Pyx_DECREF_SET(__pyx_t_1, function);
2825 __Pyx_DECREF_SET(__pyx_t_4, function);
26022826 }
26032827 }
26042828 if (!__pyx_t_5) {
2605 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
2606 __Pyx_GOTREF(__pyx_t_2);
2829 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
2830 __Pyx_GOTREF(__pyx_t_1);
26072831 } else {
26082832 #if CYTHON_FAST_PYCALL
2609 if (PyFunction_Check(__pyx_t_1)) {
2833 if (PyFunction_Check(__pyx_t_4)) {
26102834 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_rect};
2611 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
2835 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
26122836 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2613 __Pyx_GOTREF(__pyx_t_2);
2837 __Pyx_GOTREF(__pyx_t_1);
26142838 } else
26152839 #endif
26162840 #if CYTHON_FAST_PYCCALL
2617 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
2841 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
26182842 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_rect};
2619 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
2843 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
26202844 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2621 __Pyx_GOTREF(__pyx_t_2);
2845 __Pyx_GOTREF(__pyx_t_1);
26222846 } else
26232847 #endif
26242848 {
26282852 __Pyx_INCREF(__pyx_v_rect);
26292853 __Pyx_GIVEREF(__pyx_v_rect);
26302854 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_rect);
2631 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
2632 __Pyx_GOTREF(__pyx_t_2);
2855 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
2856 __Pyx_GOTREF(__pyx_t_1);
26332857 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26342858 }
26352859 }
2636 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2637 __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_2);
2638 __pyx_t_2 = 0;
2860 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2861 __Pyx_DECREF_SET(__pyx_v_rect, __pyx_t_1);
2862 __pyx_t_1 = 0;
26392863
26402864 /* "pygame_sdl2/gfxdraw.pyx":61
26412865 * def rounded_box(Surface surface, rect, rad, color):
26532877 *
26542878 * def line(Surface surface, x1, y1, x2, y2, color):
26552879 */
2656 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
2657 __Pyx_GOTREF(__pyx_t_2);
2658 __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error)
2659 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2660 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
2661 __Pyx_GOTREF(__pyx_t_2);
2662 __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error)
2663 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2664 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
2665 __Pyx_GOTREF(__pyx_t_2);
2666 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
2880 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
26672881 __Pyx_GOTREF(__pyx_t_1);
2668 __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 63, __pyx_L1_error)
2882 __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error)
2883 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2884 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
2885 __Pyx_GOTREF(__pyx_t_1);
2886 __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error)
2887 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2888 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
2889 __Pyx_GOTREF(__pyx_t_1);
2890 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error)
2891 __Pyx_GOTREF(__pyx_t_4);
2892 __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 63, __pyx_L1_error)
26692893 __Pyx_GOTREF(__pyx_t_6);
2670 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26712894 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2895 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26722896 __pyx_t_9 = __Pyx_PyInt_As_int16_t(__pyx_t_6); if (unlikely((__pyx_t_9 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error)
26732897 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26742898 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 63, __pyx_L1_error)
26752899 __Pyx_GOTREF(__pyx_t_6);
2676 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
2900 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error)
2901 __Pyx_GOTREF(__pyx_t_4);
2902 __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
26772903 __Pyx_GOTREF(__pyx_t_1);
2678 __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
2679 __Pyx_GOTREF(__pyx_t_2);
26802904 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2905 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2906 __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_1); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error)
26812907 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2682 __pyx_t_10 = __Pyx_PyInt_As_int16_t(__pyx_t_2); if (unlikely((__pyx_t_10 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error)
2683 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26842908 __pyx_t_11 = __Pyx_PyInt_As_int16_t(__pyx_v_rad); if (unlikely((__pyx_t_11 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 63, __pyx_L1_error)
2685 roundedBoxRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
2909 (void)(roundedBoxRGBA(__pyx_v_surface->surface, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
26862910
26872911 /* "pygame_sdl2/gfxdraw.pyx":59
26882912 * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
26972921 goto __pyx_L0;
26982922 __pyx_L1_error:;
26992923 __Pyx_XDECREF(__pyx_t_1);
2700 __Pyx_XDECREF(__pyx_t_2);
2924 __Pyx_XDECREF(__pyx_t_4);
27012925 __Pyx_XDECREF(__pyx_t_5);
27022926 __Pyx_XDECREF(__pyx_t_6);
27032927 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.rounded_box", __pyx_clineno, __pyx_lineno, __pyx_filename);
27392963 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
27402964 switch (pos_args) {
27412965 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
2966 CYTHON_FALLTHROUGH;
27422967 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2968 CYTHON_FALLTHROUGH;
27432969 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2970 CYTHON_FALLTHROUGH;
27442971 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2972 CYTHON_FALLTHROUGH;
27452973 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2974 CYTHON_FALLTHROUGH;
27462975 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2976 CYTHON_FALLTHROUGH;
27472977 case 0: break;
27482978 default: goto __pyx_L5_argtuple_error;
27492979 }
27502980 kw_args = PyDict_Size(__pyx_kwds);
27512981 switch (pos_args) {
27522982 case 0:
2753 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
2983 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
27542984 else goto __pyx_L5_argtuple_error;
2985 CYTHON_FALLTHROUGH;
27552986 case 1:
2756 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
2987 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
27572988 else {
27582989 __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 1); __PYX_ERR(0, 65, __pyx_L3_error)
27592990 }
2991 CYTHON_FALLTHROUGH;
27602992 case 2:
2761 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
2993 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
27622994 else {
27632995 __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 2); __PYX_ERR(0, 65, __pyx_L3_error)
27642996 }
2997 CYTHON_FALLTHROUGH;
27652998 case 3:
2766 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
2999 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
27673000 else {
27683001 __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 3); __PYX_ERR(0, 65, __pyx_L3_error)
27693002 }
3003 CYTHON_FALLTHROUGH;
27703004 case 4:
2771 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
3005 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
27723006 else {
27733007 __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 4); __PYX_ERR(0, 65, __pyx_L3_error)
27743008 }
3009 CYTHON_FALLTHROUGH;
27753010 case 5:
2776 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
3011 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
27773012 else {
27783013 __Pyx_RaiseArgtupleInvalid("line", 1, 6, 6, 5); __PYX_ERR(0, 65, __pyx_L3_error)
27793014 }
28233058 PyObject *__pyx_r = NULL;
28243059 __Pyx_RefNannyDeclarations
28253060 PyObject *__pyx_t_1 = NULL;
2826 PyObject *__pyx_t_2 = NULL;
3061 Sint16 __pyx_t_2;
28273062 Sint16 __pyx_t_3;
28283063 Sint16 __pyx_t_4;
28293064 Sint16 __pyx_t_5;
2830 Sint16 __pyx_t_6;
28313065 __Pyx_RefNannySetupContext("line", 0);
28323066
28333067 /* "pygame_sdl2/gfxdraw.pyx":66
28373071 * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
28383072 *
28393073 */
2840 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
3074 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
28413075 __Pyx_GOTREF(__pyx_t_1);
2842 __Pyx_INCREF(__pyx_v_color);
2843 __Pyx_GIVEREF(__pyx_v_color);
2844 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
2845 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 66, __pyx_L1_error)
2846 __Pyx_GOTREF(__pyx_t_2);
2847 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2848 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
2849 __pyx_t_2 = 0;
3076 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
3077 __pyx_t_1 = 0;
28503078
28513079 /* "pygame_sdl2/gfxdraw.pyx":67
28523080 * def line(Surface surface, x1, y1, x2, y2, color):
28553083 *
28563084 * def aaline(Surface surface, x1, y1, x2, y2, color):
28573085 */
2858 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error)
2859 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error)
2860 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error)
2861 __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error)
2862 lineRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
3086 __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error)
3087 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error)
3088 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error)
3089 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 67, __pyx_L1_error)
3090 (void)(lineRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
28633091
28643092 /* "pygame_sdl2/gfxdraw.pyx":65
28653093 * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
28743102 goto __pyx_L0;
28753103 __pyx_L1_error:;
28763104 __Pyx_XDECREF(__pyx_t_1);
2877 __Pyx_XDECREF(__pyx_t_2);
28783105 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.line", __pyx_clineno, __pyx_lineno, __pyx_filename);
28793106 __pyx_r = NULL;
28803107 __pyx_L0:;
29133140 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
29143141 switch (pos_args) {
29153142 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3143 CYTHON_FALLTHROUGH;
29163144 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3145 CYTHON_FALLTHROUGH;
29173146 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3147 CYTHON_FALLTHROUGH;
29183148 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3149 CYTHON_FALLTHROUGH;
29193150 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3151 CYTHON_FALLTHROUGH;
29203152 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3153 CYTHON_FALLTHROUGH;
29213154 case 0: break;
29223155 default: goto __pyx_L5_argtuple_error;
29233156 }
29243157 kw_args = PyDict_Size(__pyx_kwds);
29253158 switch (pos_args) {
29263159 case 0:
2927 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
3160 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
29283161 else goto __pyx_L5_argtuple_error;
3162 CYTHON_FALLTHROUGH;
29293163 case 1:
2930 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
3164 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
29313165 else {
29323166 __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 1); __PYX_ERR(0, 69, __pyx_L3_error)
29333167 }
3168 CYTHON_FALLTHROUGH;
29343169 case 2:
2935 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
3170 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
29363171 else {
29373172 __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 2); __PYX_ERR(0, 69, __pyx_L3_error)
29383173 }
3174 CYTHON_FALLTHROUGH;
29393175 case 3:
2940 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
3176 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
29413177 else {
29423178 __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 3); __PYX_ERR(0, 69, __pyx_L3_error)
29433179 }
3180 CYTHON_FALLTHROUGH;
29443181 case 4:
2945 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
3182 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
29463183 else {
29473184 __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 4); __PYX_ERR(0, 69, __pyx_L3_error)
29483185 }
3186 CYTHON_FALLTHROUGH;
29493187 case 5:
2950 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
3188 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
29513189 else {
29523190 __Pyx_RaiseArgtupleInvalid("aaline", 1, 6, 6, 5); __PYX_ERR(0, 69, __pyx_L3_error)
29533191 }
29973235 PyObject *__pyx_r = NULL;
29983236 __Pyx_RefNannyDeclarations
29993237 PyObject *__pyx_t_1 = NULL;
3000 PyObject *__pyx_t_2 = NULL;
3238 Sint16 __pyx_t_2;
30013239 Sint16 __pyx_t_3;
30023240 Sint16 __pyx_t_4;
30033241 Sint16 __pyx_t_5;
3004 Sint16 __pyx_t_6;
30053242 __Pyx_RefNannySetupContext("aaline", 0);
30063243
30073244 /* "pygame_sdl2/gfxdraw.pyx":70
30113248 * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
30123249 *
30133250 */
3014 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
3251 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
30153252 __Pyx_GOTREF(__pyx_t_1);
3016 __Pyx_INCREF(__pyx_v_color);
3017 __Pyx_GIVEREF(__pyx_v_color);
3018 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
3019 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
3020 __Pyx_GOTREF(__pyx_t_2);
3021 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3022 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
3023 __pyx_t_2 = 0;
3253 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
3254 __pyx_t_1 = 0;
30243255
30253256 /* "pygame_sdl2/gfxdraw.pyx":71
30263257 * def aaline(Surface surface, x1, y1, x2, y2, color):
30293260 *
30303261 * def thick_line(Surface surface, x1, y1, x2, y2, width, color):
30313262 */
3032 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error)
3033 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error)
3034 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error)
3035 __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error)
3036 aalineRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
3263 __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error)
3264 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error)
3265 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error)
3266 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error)
3267 (void)(aalineRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
30373268
30383269 /* "pygame_sdl2/gfxdraw.pyx":69
30393270 * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
30483279 goto __pyx_L0;
30493280 __pyx_L1_error:;
30503281 __Pyx_XDECREF(__pyx_t_1);
3051 __Pyx_XDECREF(__pyx_t_2);
30523282 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaline", __pyx_clineno, __pyx_lineno, __pyx_filename);
30533283 __pyx_r = NULL;
30543284 __pyx_L0:;
30883318 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
30893319 switch (pos_args) {
30903320 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3321 CYTHON_FALLTHROUGH;
30913322 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3323 CYTHON_FALLTHROUGH;
30923324 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3325 CYTHON_FALLTHROUGH;
30933326 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3327 CYTHON_FALLTHROUGH;
30943328 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3329 CYTHON_FALLTHROUGH;
30953330 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3331 CYTHON_FALLTHROUGH;
30963332 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3333 CYTHON_FALLTHROUGH;
30973334 case 0: break;
30983335 default: goto __pyx_L5_argtuple_error;
30993336 }
31003337 kw_args = PyDict_Size(__pyx_kwds);
31013338 switch (pos_args) {
31023339 case 0:
3103 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
3340 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
31043341 else goto __pyx_L5_argtuple_error;
3342 CYTHON_FALLTHROUGH;
31053343 case 1:
3106 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
3344 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
31073345 else {
31083346 __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 1); __PYX_ERR(0, 73, __pyx_L3_error)
31093347 }
3348 CYTHON_FALLTHROUGH;
31103349 case 2:
3111 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
3350 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
31123351 else {
31133352 __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 2); __PYX_ERR(0, 73, __pyx_L3_error)
31143353 }
3354 CYTHON_FALLTHROUGH;
31153355 case 3:
3116 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
3356 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
31173357 else {
31183358 __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 3); __PYX_ERR(0, 73, __pyx_L3_error)
31193359 }
3360 CYTHON_FALLTHROUGH;
31203361 case 4:
3121 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
3362 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
31223363 else {
31233364 __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 4); __PYX_ERR(0, 73, __pyx_L3_error)
31243365 }
3366 CYTHON_FALLTHROUGH;
31253367 case 5:
3126 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--;
3368 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--;
31273369 else {
31283370 __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 5); __PYX_ERR(0, 73, __pyx_L3_error)
31293371 }
3372 CYTHON_FALLTHROUGH;
31303373 case 6:
3131 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
3374 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
31323375 else {
31333376 __Pyx_RaiseArgtupleInvalid("thick_line", 1, 7, 7, 6); __PYX_ERR(0, 73, __pyx_L3_error)
31343377 }
31843427 PyObject *__pyx_r = NULL;
31853428 __Pyx_RefNannyDeclarations
31863429 PyObject *__pyx_t_1 = NULL;
3187 PyObject *__pyx_t_2 = NULL;
3430 int __pyx_t_2;
31883431 int __pyx_t_3;
31893432 int __pyx_t_4;
3190 int __pyx_t_5;
3191 Uint8 __pyx_t_6;
3433 Uint8 __pyx_t_5;
31923434 __Pyx_RefNannySetupContext("thick_line", 0);
31933435
31943436 /* "pygame_sdl2/gfxdraw.pyx":74
31983440 *
31993441 * # This locks up in c code when trying to draw a zero-length line. So make
32003442 */
3201 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
3443 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
32023444 __Pyx_GOTREF(__pyx_t_1);
3203 __Pyx_INCREF(__pyx_v_color);
3204 __Pyx_GIVEREF(__pyx_v_color);
3205 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
3206 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error)
3207 __Pyx_GOTREF(__pyx_t_2);
3208 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3209 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
3210 __pyx_t_2 = 0;
3445 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
3446 __pyx_t_1 = 0;
32113447
32123448 /* "pygame_sdl2/gfxdraw.pyx":79
32133449 * # sure that doesn't happen.
32163452 * y1int = y1
32173453 * x2int = x2
32183454 */
3219 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_x1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error)
3220 __pyx_v_x1int = __pyx_t_3;
3455 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_x1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L1_error)
3456 __pyx_v_x1int = __pyx_t_2;
32213457
32223458 /* "pygame_sdl2/gfxdraw.pyx":80
32233459 * cdef int x1int, y1int, x2int, y2int
32263462 * x2int = x2
32273463 * y2int = y2
32283464 */
3229 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_y1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
3230 __pyx_v_y1int = __pyx_t_3;
3465 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_y1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
3466 __pyx_v_y1int = __pyx_t_2;
32313467
32323468 /* "pygame_sdl2/gfxdraw.pyx":81
32333469 * x1int = x1
32363472 * y2int = y2
32373473 *
32383474 */
3239 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_x2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error)
3240 __pyx_v_x2int = __pyx_t_3;
3475 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_x2); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error)
3476 __pyx_v_x2int = __pyx_t_2;
32413477
32423478 /* "pygame_sdl2/gfxdraw.pyx":82
32433479 * y1int = y1
32463482 *
32473483 *
32483484 */
3249 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_y2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error)
3250 __pyx_v_y2int = __pyx_t_3;
3485 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_y2); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error)
3486 __pyx_v_y2int = __pyx_t_2;
32513487
32523488 /* "pygame_sdl2/gfxdraw.pyx":85
32533489 *
32563492 * return
32573493 *
32583494 */
3259 __pyx_t_5 = ((__pyx_v_x1int == __pyx_v_x2int) != 0);
3260 if (__pyx_t_5) {
3495 __pyx_t_4 = ((__pyx_v_x1int == __pyx_v_x2int) != 0);
3496 if (__pyx_t_4) {
32613497 } else {
3262 __pyx_t_4 = __pyx_t_5;
3498 __pyx_t_3 = __pyx_t_4;
32633499 goto __pyx_L4_bool_binop_done;
32643500 }
3265 __pyx_t_5 = ((__pyx_v_y1int == __pyx_v_y2int) != 0);
3266 __pyx_t_4 = __pyx_t_5;
3501 __pyx_t_4 = ((__pyx_v_y1int == __pyx_v_y2int) != 0);
3502 __pyx_t_3 = __pyx_t_4;
32673503 __pyx_L4_bool_binop_done:;
3268 if (__pyx_t_4) {
3504 if (__pyx_t_3) {
32693505
32703506 /* "pygame_sdl2/gfxdraw.pyx":86
32713507 *
32943530 *
32953531 * def circle(Surface surface, x, y, r, color):
32963532 */
3297 __pyx_t_6 = __Pyx_PyInt_As_uint8_t(__pyx_v_width); if (unlikely((__pyx_t_6 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error)
3298 thickLineRGBA(__pyx_v_surface->surface, __pyx_v_x1int, __pyx_v_y1int, __pyx_v_x2int, __pyx_v_y2int, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
3533 __pyx_t_5 = __Pyx_PyInt_As_uint8_t(__pyx_v_width); if (unlikely((__pyx_t_5 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L1_error)
3534 (void)(thickLineRGBA(__pyx_v_surface->surface, __pyx_v_x1int, __pyx_v_y1int, __pyx_v_x2int, __pyx_v_y2int, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
32993535
33003536 /* "pygame_sdl2/gfxdraw.pyx":73
33013537 * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
33103546 goto __pyx_L0;
33113547 __pyx_L1_error:;
33123548 __Pyx_XDECREF(__pyx_t_1);
3313 __Pyx_XDECREF(__pyx_t_2);
33143549 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.thick_line", __pyx_clineno, __pyx_lineno, __pyx_filename);
33153550 __pyx_r = NULL;
33163551 __pyx_L0:;
33483583 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
33493584 switch (pos_args) {
33503585 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3586 CYTHON_FALLTHROUGH;
33513587 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3588 CYTHON_FALLTHROUGH;
33523589 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3590 CYTHON_FALLTHROUGH;
33533591 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3592 CYTHON_FALLTHROUGH;
33543593 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3594 CYTHON_FALLTHROUGH;
33553595 case 0: break;
33563596 default: goto __pyx_L5_argtuple_error;
33573597 }
33583598 kw_args = PyDict_Size(__pyx_kwds);
33593599 switch (pos_args) {
33603600 case 0:
3361 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
3601 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
33623602 else goto __pyx_L5_argtuple_error;
3603 CYTHON_FALLTHROUGH;
33633604 case 1:
3364 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
3605 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
33653606 else {
33663607 __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 1); __PYX_ERR(0, 90, __pyx_L3_error)
33673608 }
3609 CYTHON_FALLTHROUGH;
33683610 case 2:
3369 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
3611 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
33703612 else {
33713613 __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 2); __PYX_ERR(0, 90, __pyx_L3_error)
33723614 }
3615 CYTHON_FALLTHROUGH;
33733616 case 3:
3374 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
3617 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
33753618 else {
33763619 __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 3); __PYX_ERR(0, 90, __pyx_L3_error)
33773620 }
3621 CYTHON_FALLTHROUGH;
33783622 case 4:
3379 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
3623 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
33803624 else {
33813625 __Pyx_RaiseArgtupleInvalid("circle", 1, 5, 5, 4); __PYX_ERR(0, 90, __pyx_L3_error)
33823626 }
34243668 PyObject *__pyx_r = NULL;
34253669 __Pyx_RefNannyDeclarations
34263670 PyObject *__pyx_t_1 = NULL;
3427 PyObject *__pyx_t_2 = NULL;
3671 Sint16 __pyx_t_2;
34283672 Sint16 __pyx_t_3;
34293673 Sint16 __pyx_t_4;
3430 Sint16 __pyx_t_5;
34313674 __Pyx_RefNannySetupContext("circle", 0);
34323675
34333676 /* "pygame_sdl2/gfxdraw.pyx":91
34373680 * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
34383681 *
34393682 */
3440 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
3683 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
34413684 __Pyx_GOTREF(__pyx_t_1);
3442 __Pyx_INCREF(__pyx_v_color);
3443 __Pyx_GIVEREF(__pyx_v_color);
3444 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
3445 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
3446 __Pyx_GOTREF(__pyx_t_2);
3447 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3448 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
3449 __pyx_t_2 = 0;
3685 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
3686 __pyx_t_1 = 0;
34503687
34513688 /* "pygame_sdl2/gfxdraw.pyx":92
34523689 * def circle(Surface surface, x, y, r, color):
34553692 *
34563693 * def arc(Surface surface, x, y, r, start, end, color):
34573694 */
3458 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error)
3459 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error)
3460 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error)
3461 circleRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
3695 __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error)
3696 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error)
3697 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error)
3698 (void)(circleRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
34623699
34633700 /* "pygame_sdl2/gfxdraw.pyx":90
34643701 * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a)
34733710 goto __pyx_L0;
34743711 __pyx_L1_error:;
34753712 __Pyx_XDECREF(__pyx_t_1);
3476 __Pyx_XDECREF(__pyx_t_2);
34773713 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.circle", __pyx_clineno, __pyx_lineno, __pyx_filename);
34783714 __pyx_r = NULL;
34793715 __pyx_L0:;
35133749 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
35143750 switch (pos_args) {
35153751 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
3752 CYTHON_FALLTHROUGH;
35163753 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
3754 CYTHON_FALLTHROUGH;
35173755 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3756 CYTHON_FALLTHROUGH;
35183757 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3758 CYTHON_FALLTHROUGH;
35193759 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3760 CYTHON_FALLTHROUGH;
35203761 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3762 CYTHON_FALLTHROUGH;
35213763 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3764 CYTHON_FALLTHROUGH;
35223765 case 0: break;
35233766 default: goto __pyx_L5_argtuple_error;
35243767 }
35253768 kw_args = PyDict_Size(__pyx_kwds);
35263769 switch (pos_args) {
35273770 case 0:
3528 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
3771 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
35293772 else goto __pyx_L5_argtuple_error;
3773 CYTHON_FALLTHROUGH;
35303774 case 1:
3531 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
3775 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
35323776 else {
35333777 __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 1); __PYX_ERR(0, 94, __pyx_L3_error)
35343778 }
3779 CYTHON_FALLTHROUGH;
35353780 case 2:
3536 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
3781 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
35373782 else {
35383783 __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 2); __PYX_ERR(0, 94, __pyx_L3_error)
35393784 }
3785 CYTHON_FALLTHROUGH;
35403786 case 3:
3541 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
3787 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
35423788 else {
35433789 __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 3); __PYX_ERR(0, 94, __pyx_L3_error)
35443790 }
3791 CYTHON_FALLTHROUGH;
35453792 case 4:
3546 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
3793 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
35473794 else {
35483795 __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 4); __PYX_ERR(0, 94, __pyx_L3_error)
35493796 }
3797 CYTHON_FALLTHROUGH;
35503798 case 5:
3551 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
3799 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
35523800 else {
35533801 __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 5); __PYX_ERR(0, 94, __pyx_L3_error)
35543802 }
3803 CYTHON_FALLTHROUGH;
35553804 case 6:
3556 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
3805 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
35573806 else {
35583807 __Pyx_RaiseArgtupleInvalid("arc", 1, 7, 7, 6); __PYX_ERR(0, 94, __pyx_L3_error)
35593808 }
36053854 PyObject *__pyx_r = NULL;
36063855 __Pyx_RefNannyDeclarations
36073856 PyObject *__pyx_t_1 = NULL;
3608 PyObject *__pyx_t_2 = NULL;
3857 Sint16 __pyx_t_2;
36093858 Sint16 __pyx_t_3;
36103859 Sint16 __pyx_t_4;
36113860 Sint16 __pyx_t_5;
36123861 Sint16 __pyx_t_6;
3613 Sint16 __pyx_t_7;
36143862 __Pyx_RefNannySetupContext("arc", 0);
36153863
36163864 /* "pygame_sdl2/gfxdraw.pyx":95
36203868 * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
36213869 *
36223870 */
3623 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
3871 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
36243872 __Pyx_GOTREF(__pyx_t_1);
3625 __Pyx_INCREF(__pyx_v_color);
3626 __Pyx_GIVEREF(__pyx_v_color);
3627 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
3628 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error)
3629 __Pyx_GOTREF(__pyx_t_2);
3630 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3631 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
3632 __pyx_t_2 = 0;
3873 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
3874 __pyx_t_1 = 0;
36333875
36343876 /* "pygame_sdl2/gfxdraw.pyx":96
36353877 * def arc(Surface surface, x, y, r, start, end, color):
36383880 *
36393881 * def aacircle(Surface surface, x, y, r, color):
36403882 */
3641 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
3642 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
3643 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
3644 __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_start); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
3645 __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_end); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
3646 arcRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
3883 __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
3884 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
3885 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
3886 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_start); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
3887 __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_end); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
3888 (void)(arcRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
36473889
36483890 /* "pygame_sdl2/gfxdraw.pyx":94
36493891 * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
36583900 goto __pyx_L0;
36593901 __pyx_L1_error:;
36603902 __Pyx_XDECREF(__pyx_t_1);
3661 __Pyx_XDECREF(__pyx_t_2);
36623903 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.arc", __pyx_clineno, __pyx_lineno, __pyx_filename);
36633904 __pyx_r = NULL;
36643905 __pyx_L0:;
36963937 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
36973938 switch (pos_args) {
36983939 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3940 CYTHON_FALLTHROUGH;
36993941 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3942 CYTHON_FALLTHROUGH;
37003943 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3944 CYTHON_FALLTHROUGH;
37013945 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3946 CYTHON_FALLTHROUGH;
37023947 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3948 CYTHON_FALLTHROUGH;
37033949 case 0: break;
37043950 default: goto __pyx_L5_argtuple_error;
37053951 }
37063952 kw_args = PyDict_Size(__pyx_kwds);
37073953 switch (pos_args) {
37083954 case 0:
3709 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
3955 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
37103956 else goto __pyx_L5_argtuple_error;
3957 CYTHON_FALLTHROUGH;
37113958 case 1:
3712 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
3959 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
37133960 else {
37143961 __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 1); __PYX_ERR(0, 98, __pyx_L3_error)
37153962 }
3963 CYTHON_FALLTHROUGH;
37163964 case 2:
3717 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
3965 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
37183966 else {
37193967 __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 2); __PYX_ERR(0, 98, __pyx_L3_error)
37203968 }
3969 CYTHON_FALLTHROUGH;
37213970 case 3:
3722 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
3971 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
37233972 else {
37243973 __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 3); __PYX_ERR(0, 98, __pyx_L3_error)
37253974 }
3975 CYTHON_FALLTHROUGH;
37263976 case 4:
3727 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
3977 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
37283978 else {
37293979 __Pyx_RaiseArgtupleInvalid("aacircle", 1, 5, 5, 4); __PYX_ERR(0, 98, __pyx_L3_error)
37303980 }
37724022 PyObject *__pyx_r = NULL;
37734023 __Pyx_RefNannyDeclarations
37744024 PyObject *__pyx_t_1 = NULL;
3775 PyObject *__pyx_t_2 = NULL;
4025 Sint16 __pyx_t_2;
37764026 Sint16 __pyx_t_3;
37774027 Sint16 __pyx_t_4;
3778 Sint16 __pyx_t_5;
37794028 __Pyx_RefNannySetupContext("aacircle", 0);
37804029
37814030 /* "pygame_sdl2/gfxdraw.pyx":99
37854034 * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
37864035 *
37874036 */
3788 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
4037 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
37894038 __Pyx_GOTREF(__pyx_t_1);
3790 __Pyx_INCREF(__pyx_v_color);
3791 __Pyx_GIVEREF(__pyx_v_color);
3792 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
3793 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error)
3794 __Pyx_GOTREF(__pyx_t_2);
3795 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3796 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
3797 __pyx_t_2 = 0;
4039 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
4040 __pyx_t_1 = 0;
37984041
37994042 /* "pygame_sdl2/gfxdraw.pyx":100
38004043 * def aacircle(Surface surface, x, y, r, color):
38034046 *
38044047 * def filled_circle(Surface surface, x, y, r, color):
38054048 */
3806 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error)
3807 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error)
3808 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error)
3809 aacircleRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
4049 __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error)
4050 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error)
4051 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 100, __pyx_L1_error)
4052 (void)(aacircleRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
38104053
38114054 /* "pygame_sdl2/gfxdraw.pyx":98
38124055 * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
38214064 goto __pyx_L0;
38224065 __pyx_L1_error:;
38234066 __Pyx_XDECREF(__pyx_t_1);
3824 __Pyx_XDECREF(__pyx_t_2);
38254067 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aacircle", __pyx_clineno, __pyx_lineno, __pyx_filename);
38264068 __pyx_r = NULL;
38274069 __pyx_L0:;
38594101 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
38604102 switch (pos_args) {
38614103 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4104 CYTHON_FALLTHROUGH;
38624105 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4106 CYTHON_FALLTHROUGH;
38634107 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4108 CYTHON_FALLTHROUGH;
38644109 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4110 CYTHON_FALLTHROUGH;
38654111 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4112 CYTHON_FALLTHROUGH;
38664113 case 0: break;
38674114 default: goto __pyx_L5_argtuple_error;
38684115 }
38694116 kw_args = PyDict_Size(__pyx_kwds);
38704117 switch (pos_args) {
38714118 case 0:
3872 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
4119 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
38734120 else goto __pyx_L5_argtuple_error;
4121 CYTHON_FALLTHROUGH;
38744122 case 1:
3875 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4123 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
38764124 else {
38774125 __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 1); __PYX_ERR(0, 102, __pyx_L3_error)
38784126 }
4127 CYTHON_FALLTHROUGH;
38794128 case 2:
3880 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
4129 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
38814130 else {
38824131 __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 2); __PYX_ERR(0, 102, __pyx_L3_error)
38834132 }
4133 CYTHON_FALLTHROUGH;
38844134 case 3:
3885 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
4135 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
38864136 else {
38874137 __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 3); __PYX_ERR(0, 102, __pyx_L3_error)
38884138 }
4139 CYTHON_FALLTHROUGH;
38894140 case 4:
3890 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
4141 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
38914142 else {
38924143 __Pyx_RaiseArgtupleInvalid("filled_circle", 1, 5, 5, 4); __PYX_ERR(0, 102, __pyx_L3_error)
38934144 }
39354186 PyObject *__pyx_r = NULL;
39364187 __Pyx_RefNannyDeclarations
39374188 PyObject *__pyx_t_1 = NULL;
3938 PyObject *__pyx_t_2 = NULL;
4189 Sint16 __pyx_t_2;
39394190 Sint16 __pyx_t_3;
39404191 Sint16 __pyx_t_4;
3941 Sint16 __pyx_t_5;
39424192 __Pyx_RefNannySetupContext("filled_circle", 0);
39434193
39444194 /* "pygame_sdl2/gfxdraw.pyx":103
39484198 * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
39494199 *
39504200 */
3951 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
4201 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
39524202 __Pyx_GOTREF(__pyx_t_1);
3953 __Pyx_INCREF(__pyx_v_color);
3954 __Pyx_GIVEREF(__pyx_v_color);
3955 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
3956 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
3957 __Pyx_GOTREF(__pyx_t_2);
3958 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3959 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
3960 __pyx_t_2 = 0;
4203 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
4204 __pyx_t_1 = 0;
39614205
39624206 /* "pygame_sdl2/gfxdraw.pyx":104
39634207 * def filled_circle(Surface surface, x, y, r, color):
39664210 *
39674211 * def ellipse(Surface surface, x, y, rx, ry, color):
39684212 */
3969 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
3970 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
3971 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
3972 filledCircleRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
4213 __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
4214 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
4215 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error)
4216 (void)(filledCircleRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
39734217
39744218 /* "pygame_sdl2/gfxdraw.pyx":102
39754219 * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
39844228 goto __pyx_L0;
39854229 __pyx_L1_error:;
39864230 __Pyx_XDECREF(__pyx_t_1);
3987 __Pyx_XDECREF(__pyx_t_2);
39884231 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_circle", __pyx_clineno, __pyx_lineno, __pyx_filename);
39894232 __pyx_r = NULL;
39904233 __pyx_L0:;
40234266 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
40244267 switch (pos_args) {
40254268 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4269 CYTHON_FALLTHROUGH;
40264270 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4271 CYTHON_FALLTHROUGH;
40274272 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4273 CYTHON_FALLTHROUGH;
40284274 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4275 CYTHON_FALLTHROUGH;
40294276 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4277 CYTHON_FALLTHROUGH;
40304278 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4279 CYTHON_FALLTHROUGH;
40314280 case 0: break;
40324281 default: goto __pyx_L5_argtuple_error;
40334282 }
40344283 kw_args = PyDict_Size(__pyx_kwds);
40354284 switch (pos_args) {
40364285 case 0:
4037 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
4286 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
40384287 else goto __pyx_L5_argtuple_error;
4288 CYTHON_FALLTHROUGH;
40394289 case 1:
4040 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4290 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
40414291 else {
40424292 __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 1); __PYX_ERR(0, 106, __pyx_L3_error)
40434293 }
4294 CYTHON_FALLTHROUGH;
40444295 case 2:
4045 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
4296 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
40464297 else {
40474298 __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 2); __PYX_ERR(0, 106, __pyx_L3_error)
40484299 }
4300 CYTHON_FALLTHROUGH;
40494301 case 3:
4050 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rx)) != 0)) kw_args--;
4302 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rx)) != 0)) kw_args--;
40514303 else {
40524304 __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 3); __PYX_ERR(0, 106, __pyx_L3_error)
40534305 }
4306 CYTHON_FALLTHROUGH;
40544307 case 4:
4055 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ry)) != 0)) kw_args--;
4308 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ry)) != 0)) kw_args--;
40564309 else {
40574310 __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 4); __PYX_ERR(0, 106, __pyx_L3_error)
40584311 }
4312 CYTHON_FALLTHROUGH;
40594313 case 5:
4060 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
4314 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
40614315 else {
40624316 __Pyx_RaiseArgtupleInvalid("ellipse", 1, 6, 6, 5); __PYX_ERR(0, 106, __pyx_L3_error)
40634317 }
41074361 PyObject *__pyx_r = NULL;
41084362 __Pyx_RefNannyDeclarations
41094363 PyObject *__pyx_t_1 = NULL;
4110 PyObject *__pyx_t_2 = NULL;
4364 Sint16 __pyx_t_2;
41114365 Sint16 __pyx_t_3;
41124366 Sint16 __pyx_t_4;
41134367 Sint16 __pyx_t_5;
4114 Sint16 __pyx_t_6;
41154368 __Pyx_RefNannySetupContext("ellipse", 0);
41164369
41174370 /* "pygame_sdl2/gfxdraw.pyx":107
41214374 * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
41224375 *
41234376 */
4124 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
4377 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
41254378 __Pyx_GOTREF(__pyx_t_1);
4126 __Pyx_INCREF(__pyx_v_color);
4127 __Pyx_GIVEREF(__pyx_v_color);
4128 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
4129 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
4130 __Pyx_GOTREF(__pyx_t_2);
4131 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4132 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
4133 __pyx_t_2 = 0;
4379 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
4380 __pyx_t_1 = 0;
41344381
41354382 /* "pygame_sdl2/gfxdraw.pyx":108
41364383 * def ellipse(Surface surface, x, y, rx, ry, color):
41394386 *
41404387 * def aaellipse(Surface surface, x, y, rx, ry, color):
41414388 */
4142 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error)
4143 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error)
4144 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_rx); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error)
4145 __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_ry); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error)
4146 ellipseRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
4389 __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error)
4390 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error)
4391 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_rx); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error)
4392 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_ry); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L1_error)
4393 (void)(ellipseRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
41474394
41484395 /* "pygame_sdl2/gfxdraw.pyx":106
41494396 * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
41584405 goto __pyx_L0;
41594406 __pyx_L1_error:;
41604407 __Pyx_XDECREF(__pyx_t_1);
4161 __Pyx_XDECREF(__pyx_t_2);
41624408 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename);
41634409 __pyx_r = NULL;
41644410 __pyx_L0:;
41974443 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
41984444 switch (pos_args) {
41994445 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4446 CYTHON_FALLTHROUGH;
42004447 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4448 CYTHON_FALLTHROUGH;
42014449 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4450 CYTHON_FALLTHROUGH;
42024451 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4452 CYTHON_FALLTHROUGH;
42034453 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4454 CYTHON_FALLTHROUGH;
42044455 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4456 CYTHON_FALLTHROUGH;
42054457 case 0: break;
42064458 default: goto __pyx_L5_argtuple_error;
42074459 }
42084460 kw_args = PyDict_Size(__pyx_kwds);
42094461 switch (pos_args) {
42104462 case 0:
4211 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
4463 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
42124464 else goto __pyx_L5_argtuple_error;
4465 CYTHON_FALLTHROUGH;
42134466 case 1:
4214 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4467 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
42154468 else {
42164469 __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 1); __PYX_ERR(0, 110, __pyx_L3_error)
42174470 }
4471 CYTHON_FALLTHROUGH;
42184472 case 2:
4219 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
4473 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
42204474 else {
42214475 __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 2); __PYX_ERR(0, 110, __pyx_L3_error)
42224476 }
4477 CYTHON_FALLTHROUGH;
42234478 case 3:
4224 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rx)) != 0)) kw_args--;
4479 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rx)) != 0)) kw_args--;
42254480 else {
42264481 __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 3); __PYX_ERR(0, 110, __pyx_L3_error)
42274482 }
4483 CYTHON_FALLTHROUGH;
42284484 case 4:
4229 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ry)) != 0)) kw_args--;
4485 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ry)) != 0)) kw_args--;
42304486 else {
42314487 __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 4); __PYX_ERR(0, 110, __pyx_L3_error)
42324488 }
4489 CYTHON_FALLTHROUGH;
42334490 case 5:
4234 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
4491 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
42354492 else {
42364493 __Pyx_RaiseArgtupleInvalid("aaellipse", 1, 6, 6, 5); __PYX_ERR(0, 110, __pyx_L3_error)
42374494 }
42814538 PyObject *__pyx_r = NULL;
42824539 __Pyx_RefNannyDeclarations
42834540 PyObject *__pyx_t_1 = NULL;
4284 PyObject *__pyx_t_2 = NULL;
4541 Sint16 __pyx_t_2;
42854542 Sint16 __pyx_t_3;
42864543 Sint16 __pyx_t_4;
42874544 Sint16 __pyx_t_5;
4288 Sint16 __pyx_t_6;
42894545 __Pyx_RefNannySetupContext("aaellipse", 0);
42904546
42914547 /* "pygame_sdl2/gfxdraw.pyx":111
42954551 * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
42964552 *
42974553 */
4298 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
4554 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
42994555 __Pyx_GOTREF(__pyx_t_1);
4300 __Pyx_INCREF(__pyx_v_color);
4301 __Pyx_GIVEREF(__pyx_v_color);
4302 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
4303 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
4304 __Pyx_GOTREF(__pyx_t_2);
4305 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4306 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
4307 __pyx_t_2 = 0;
4556 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
4557 __pyx_t_1 = 0;
43084558
43094559 /* "pygame_sdl2/gfxdraw.pyx":112
43104560 * def aaellipse(Surface surface, x, y, rx, ry, color):
43134563 *
43144564 * def filled_ellipse(Surface surface, x, y, rx, ry, color):
43154565 */
4316 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error)
4317 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error)
4318 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_rx); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error)
4319 __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_ry); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error)
4320 aaellipseRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
4566 __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error)
4567 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error)
4568 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_rx); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error)
4569 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_ry); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 112, __pyx_L1_error)
4570 (void)(aaellipseRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
43214571
43224572 /* "pygame_sdl2/gfxdraw.pyx":110
43234573 * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
43324582 goto __pyx_L0;
43334583 __pyx_L1_error:;
43344584 __Pyx_XDECREF(__pyx_t_1);
4335 __Pyx_XDECREF(__pyx_t_2);
43364585 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aaellipse", __pyx_clineno, __pyx_lineno, __pyx_filename);
43374586 __pyx_r = NULL;
43384587 __pyx_L0:;
43714620 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
43724621 switch (pos_args) {
43734622 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4623 CYTHON_FALLTHROUGH;
43744624 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4625 CYTHON_FALLTHROUGH;
43754626 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4627 CYTHON_FALLTHROUGH;
43764628 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4629 CYTHON_FALLTHROUGH;
43774630 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4631 CYTHON_FALLTHROUGH;
43784632 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4633 CYTHON_FALLTHROUGH;
43794634 case 0: break;
43804635 default: goto __pyx_L5_argtuple_error;
43814636 }
43824637 kw_args = PyDict_Size(__pyx_kwds);
43834638 switch (pos_args) {
43844639 case 0:
4385 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
4640 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
43864641 else goto __pyx_L5_argtuple_error;
4642 CYTHON_FALLTHROUGH;
43874643 case 1:
4388 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4644 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
43894645 else {
43904646 __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 1); __PYX_ERR(0, 114, __pyx_L3_error)
43914647 }
4648 CYTHON_FALLTHROUGH;
43924649 case 2:
4393 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
4650 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
43944651 else {
43954652 __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 2); __PYX_ERR(0, 114, __pyx_L3_error)
43964653 }
4654 CYTHON_FALLTHROUGH;
43974655 case 3:
4398 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rx)) != 0)) kw_args--;
4656 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rx)) != 0)) kw_args--;
43994657 else {
44004658 __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 3); __PYX_ERR(0, 114, __pyx_L3_error)
44014659 }
4660 CYTHON_FALLTHROUGH;
44024661 case 4:
4403 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ry)) != 0)) kw_args--;
4662 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ry)) != 0)) kw_args--;
44044663 else {
44054664 __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 4); __PYX_ERR(0, 114, __pyx_L3_error)
44064665 }
4666 CYTHON_FALLTHROUGH;
44074667 case 5:
4408 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
4668 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
44094669 else {
44104670 __Pyx_RaiseArgtupleInvalid("filled_ellipse", 1, 6, 6, 5); __PYX_ERR(0, 114, __pyx_L3_error)
44114671 }
44554715 PyObject *__pyx_r = NULL;
44564716 __Pyx_RefNannyDeclarations
44574717 PyObject *__pyx_t_1 = NULL;
4458 PyObject *__pyx_t_2 = NULL;
4718 Sint16 __pyx_t_2;
44594719 Sint16 __pyx_t_3;
44604720 Sint16 __pyx_t_4;
44614721 Sint16 __pyx_t_5;
4462 Sint16 __pyx_t_6;
44634722 __Pyx_RefNannySetupContext("filled_ellipse", 0);
44644723
44654724 /* "pygame_sdl2/gfxdraw.pyx":115
44694728 * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
44704729 *
44714730 */
4472 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
4731 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
44734732 __Pyx_GOTREF(__pyx_t_1);
4474 __Pyx_INCREF(__pyx_v_color);
4475 __Pyx_GIVEREF(__pyx_v_color);
4476 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
4477 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error)
4478 __Pyx_GOTREF(__pyx_t_2);
4479 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4480 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
4481 __pyx_t_2 = 0;
4733 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
4734 __pyx_t_1 = 0;
44824735
44834736 /* "pygame_sdl2/gfxdraw.pyx":116
44844737 * def filled_ellipse(Surface surface, x, y, rx, ry, color):
44874740 *
44884741 * def pie(Surface surface, x, y, r, start, end, color):
44894742 */
4490 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error)
4491 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error)
4492 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_rx); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error)
4493 __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_ry); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error)
4494 filledEllipseRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
4743 __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error)
4744 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error)
4745 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_rx); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error)
4746 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_ry); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error)
4747 (void)(filledEllipseRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
44954748
44964749 /* "pygame_sdl2/gfxdraw.pyx":114
44974750 * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
45064759 goto __pyx_L0;
45074760 __pyx_L1_error:;
45084761 __Pyx_XDECREF(__pyx_t_1);
4509 __Pyx_XDECREF(__pyx_t_2);
45104762 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename);
45114763 __pyx_r = NULL;
45124764 __pyx_L0:;
45464798 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
45474799 switch (pos_args) {
45484800 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4801 CYTHON_FALLTHROUGH;
45494802 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4803 CYTHON_FALLTHROUGH;
45504804 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4805 CYTHON_FALLTHROUGH;
45514806 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4807 CYTHON_FALLTHROUGH;
45524808 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4809 CYTHON_FALLTHROUGH;
45534810 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4811 CYTHON_FALLTHROUGH;
45544812 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4813 CYTHON_FALLTHROUGH;
45554814 case 0: break;
45564815 default: goto __pyx_L5_argtuple_error;
45574816 }
45584817 kw_args = PyDict_Size(__pyx_kwds);
45594818 switch (pos_args) {
45604819 case 0:
4561 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
4820 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
45624821 else goto __pyx_L5_argtuple_error;
4822 CYTHON_FALLTHROUGH;
45634823 case 1:
4564 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4824 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
45654825 else {
45664826 __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 1); __PYX_ERR(0, 118, __pyx_L3_error)
45674827 }
4828 CYTHON_FALLTHROUGH;
45684829 case 2:
4569 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
4830 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
45704831 else {
45714832 __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 2); __PYX_ERR(0, 118, __pyx_L3_error)
45724833 }
4834 CYTHON_FALLTHROUGH;
45734835 case 3:
4574 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
4836 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
45754837 else {
45764838 __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 3); __PYX_ERR(0, 118, __pyx_L3_error)
45774839 }
4840 CYTHON_FALLTHROUGH;
45784841 case 4:
4579 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
4842 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
45804843 else {
45814844 __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 4); __PYX_ERR(0, 118, __pyx_L3_error)
45824845 }
4846 CYTHON_FALLTHROUGH;
45834847 case 5:
4584 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
4848 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
45854849 else {
45864850 __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 5); __PYX_ERR(0, 118, __pyx_L3_error)
45874851 }
4852 CYTHON_FALLTHROUGH;
45884853 case 6:
4589 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
4854 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
45904855 else {
45914856 __Pyx_RaiseArgtupleInvalid("pie", 1, 7, 7, 6); __PYX_ERR(0, 118, __pyx_L3_error)
45924857 }
46384903 PyObject *__pyx_r = NULL;
46394904 __Pyx_RefNannyDeclarations
46404905 PyObject *__pyx_t_1 = NULL;
4641 PyObject *__pyx_t_2 = NULL;
4906 Sint16 __pyx_t_2;
46424907 Sint16 __pyx_t_3;
46434908 Sint16 __pyx_t_4;
46444909 Sint16 __pyx_t_5;
46454910 Sint16 __pyx_t_6;
4646 Sint16 __pyx_t_7;
46474911 __Pyx_RefNannySetupContext("pie", 0);
46484912
46494913 /* "pygame_sdl2/gfxdraw.pyx":119
46534917 * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
46544918 *
46554919 */
4656 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
4920 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
46574921 __Pyx_GOTREF(__pyx_t_1);
4658 __Pyx_INCREF(__pyx_v_color);
4659 __Pyx_GIVEREF(__pyx_v_color);
4660 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
4661 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
4662 __Pyx_GOTREF(__pyx_t_2);
4663 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4664 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
4665 __pyx_t_2 = 0;
4922 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
4923 __pyx_t_1 = 0;
46664924
46674925 /* "pygame_sdl2/gfxdraw.pyx":120
46684926 * def pie(Surface surface, x, y, r, start, end, color):
46714929 *
46724930 * def filled_pie(Surface surface, x, y, r, start, end, color):
46734931 */
4674 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
4675 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
4676 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
4677 __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_start); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
4678 __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_end); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
4679 pieRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
4932 __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
4933 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
4934 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
4935 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_start); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
4936 __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_end); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
4937 (void)(pieRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
46804938
46814939 /* "pygame_sdl2/gfxdraw.pyx":118
46824940 * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
46914949 goto __pyx_L0;
46924950 __pyx_L1_error:;
46934951 __Pyx_XDECREF(__pyx_t_1);
4694 __Pyx_XDECREF(__pyx_t_2);
46954952 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.pie", __pyx_clineno, __pyx_lineno, __pyx_filename);
46964953 __pyx_r = NULL;
46974954 __pyx_L0:;
47314988 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
47324989 switch (pos_args) {
47334990 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
4991 CYTHON_FALLTHROUGH;
47344992 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
4993 CYTHON_FALLTHROUGH;
47354994 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4995 CYTHON_FALLTHROUGH;
47364996 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4997 CYTHON_FALLTHROUGH;
47374998 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4999 CYTHON_FALLTHROUGH;
47385000 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5001 CYTHON_FALLTHROUGH;
47395002 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5003 CYTHON_FALLTHROUGH;
47405004 case 0: break;
47415005 default: goto __pyx_L5_argtuple_error;
47425006 }
47435007 kw_args = PyDict_Size(__pyx_kwds);
47445008 switch (pos_args) {
47455009 case 0:
4746 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
5010 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
47475011 else goto __pyx_L5_argtuple_error;
5012 CYTHON_FALLTHROUGH;
47485013 case 1:
4749 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5014 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
47505015 else {
47515016 __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 1); __PYX_ERR(0, 122, __pyx_L3_error)
47525017 }
5018 CYTHON_FALLTHROUGH;
47535019 case 2:
4754 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
5020 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
47555021 else {
47565022 __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 2); __PYX_ERR(0, 122, __pyx_L3_error)
47575023 }
5024 CYTHON_FALLTHROUGH;
47585025 case 3:
4759 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
5026 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
47605027 else {
47615028 __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 3); __PYX_ERR(0, 122, __pyx_L3_error)
47625029 }
5030 CYTHON_FALLTHROUGH;
47635031 case 4:
4764 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
5032 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
47655033 else {
47665034 __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 4); __PYX_ERR(0, 122, __pyx_L3_error)
47675035 }
5036 CYTHON_FALLTHROUGH;
47685037 case 5:
4769 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
5038 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_end)) != 0)) kw_args--;
47705039 else {
47715040 __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 5); __PYX_ERR(0, 122, __pyx_L3_error)
47725041 }
5042 CYTHON_FALLTHROUGH;
47735043 case 6:
4774 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
5044 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
47755045 else {
47765046 __Pyx_RaiseArgtupleInvalid("filled_pie", 1, 7, 7, 6); __PYX_ERR(0, 122, __pyx_L3_error)
47775047 }
48235093 PyObject *__pyx_r = NULL;
48245094 __Pyx_RefNannyDeclarations
48255095 PyObject *__pyx_t_1 = NULL;
4826 PyObject *__pyx_t_2 = NULL;
5096 Sint16 __pyx_t_2;
48275097 Sint16 __pyx_t_3;
48285098 Sint16 __pyx_t_4;
48295099 Sint16 __pyx_t_5;
48305100 Sint16 __pyx_t_6;
4831 Sint16 __pyx_t_7;
48325101 __Pyx_RefNannySetupContext("filled_pie", 0);
48335102
48345103 /* "pygame_sdl2/gfxdraw.pyx":123
48385107 * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
48395108 *
48405109 */
4841 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
5110 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
48425111 __Pyx_GOTREF(__pyx_t_1);
4843 __Pyx_INCREF(__pyx_v_color);
4844 __Pyx_GIVEREF(__pyx_v_color);
4845 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
4846 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
4847 __Pyx_GOTREF(__pyx_t_2);
4848 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4849 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
4850 __pyx_t_2 = 0;
5112 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
5113 __pyx_t_1 = 0;
48515114
48525115 /* "pygame_sdl2/gfxdraw.pyx":124
48535116 * def filled_pie(Surface surface, x, y, r, start, end, color):
48565119 *
48575120 * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color):
48585121 */
4859 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error)
4860 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error)
4861 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error)
4862 __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_start); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error)
4863 __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_end); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error)
4864 filledPieRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
5122 __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error)
5123 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error)
5124 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_r); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error)
5125 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_start); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error)
5126 __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_end); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 124, __pyx_L1_error)
5127 (void)(filledPieRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
48655128
48665129 /* "pygame_sdl2/gfxdraw.pyx":122
48675130 * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
48765139 goto __pyx_L0;
48775140 __pyx_L1_error:;
48785141 __Pyx_XDECREF(__pyx_t_1);
4879 __Pyx_XDECREF(__pyx_t_2);
48805142 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_pie", __pyx_clineno, __pyx_lineno, __pyx_filename);
48815143 __pyx_r = NULL;
48825144 __pyx_L0:;
49175179 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
49185180 switch (pos_args) {
49195181 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5182 CYTHON_FALLTHROUGH;
49205183 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5184 CYTHON_FALLTHROUGH;
49215185 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5186 CYTHON_FALLTHROUGH;
49225187 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5188 CYTHON_FALLTHROUGH;
49235189 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5190 CYTHON_FALLTHROUGH;
49245191 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5192 CYTHON_FALLTHROUGH;
49255193 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5194 CYTHON_FALLTHROUGH;
49265195 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5196 CYTHON_FALLTHROUGH;
49275197 case 0: break;
49285198 default: goto __pyx_L5_argtuple_error;
49295199 }
49305200 kw_args = PyDict_Size(__pyx_kwds);
49315201 switch (pos_args) {
49325202 case 0:
4933 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
5203 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
49345204 else goto __pyx_L5_argtuple_error;
5205 CYTHON_FALLTHROUGH;
49355206 case 1:
4936 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
5207 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
49375208 else {
49385209 __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 1); __PYX_ERR(0, 126, __pyx_L3_error)
49395210 }
5211 CYTHON_FALLTHROUGH;
49405212 case 2:
4941 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
5213 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
49425214 else {
49435215 __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 2); __PYX_ERR(0, 126, __pyx_L3_error)
49445216 }
5217 CYTHON_FALLTHROUGH;
49455218 case 3:
4946 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
5219 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
49475220 else {
49485221 __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 3); __PYX_ERR(0, 126, __pyx_L3_error)
49495222 }
5223 CYTHON_FALLTHROUGH;
49505224 case 4:
4951 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
5225 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
49525226 else {
49535227 __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 4); __PYX_ERR(0, 126, __pyx_L3_error)
49545228 }
5229 CYTHON_FALLTHROUGH;
49555230 case 5:
4956 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x3)) != 0)) kw_args--;
5231 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x3)) != 0)) kw_args--;
49575232 else {
49585233 __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 5); __PYX_ERR(0, 126, __pyx_L3_error)
49595234 }
5235 CYTHON_FALLTHROUGH;
49605236 case 6:
4961 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y3)) != 0)) kw_args--;
5237 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y3)) != 0)) kw_args--;
49625238 else {
49635239 __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 6); __PYX_ERR(0, 126, __pyx_L3_error)
49645240 }
5241 CYTHON_FALLTHROUGH;
49655242 case 7:
4966 if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
5243 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
49675244 else {
49685245 __Pyx_RaiseArgtupleInvalid("trigon", 1, 8, 8, 7); __PYX_ERR(0, 126, __pyx_L3_error)
49695246 }
50175294 PyObject *__pyx_r = NULL;
50185295 __Pyx_RefNannyDeclarations
50195296 PyObject *__pyx_t_1 = NULL;
5020 PyObject *__pyx_t_2 = NULL;
5297 Sint16 __pyx_t_2;
50215298 Sint16 __pyx_t_3;
50225299 Sint16 __pyx_t_4;
50235300 Sint16 __pyx_t_5;
50245301 Sint16 __pyx_t_6;
50255302 Sint16 __pyx_t_7;
5026 Sint16 __pyx_t_8;
50275303 __Pyx_RefNannySetupContext("trigon", 0);
50285304
50295305 /* "pygame_sdl2/gfxdraw.pyx":127
50335309 * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
50345310 *
50355311 */
5036 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
5312 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
50375313 __Pyx_GOTREF(__pyx_t_1);
5038 __Pyx_INCREF(__pyx_v_color);
5039 __Pyx_GIVEREF(__pyx_v_color);
5040 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
5041 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error)
5042 __Pyx_GOTREF(__pyx_t_2);
5043 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5044 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
5045 __pyx_t_2 = 0;
5314 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
5315 __pyx_t_1 = 0;
50465316
50475317 /* "pygame_sdl2/gfxdraw.pyx":128
50485318 * def trigon(Surface surface, x1, y1, x2, y2, x3, y3, color):
50515321 *
50525322 * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color):
50535323 */
5054 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error)
5055 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error)
5056 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error)
5057 __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error)
5058 __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_x3); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error)
5059 __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_v_y3); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error)
5060 trigonRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
5324 __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error)
5325 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error)
5326 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error)
5327 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error)
5328 __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_x3); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error)
5329 __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_y3); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L1_error)
5330 (void)(trigonRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
50615331
50625332 /* "pygame_sdl2/gfxdraw.pyx":126
50635333 * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
50725342 goto __pyx_L0;
50735343 __pyx_L1_error:;
50745344 __Pyx_XDECREF(__pyx_t_1);
5075 __Pyx_XDECREF(__pyx_t_2);
50765345 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.trigon", __pyx_clineno, __pyx_lineno, __pyx_filename);
50775346 __pyx_r = NULL;
50785347 __pyx_L0:;
51135382 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
51145383 switch (pos_args) {
51155384 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5385 CYTHON_FALLTHROUGH;
51165386 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5387 CYTHON_FALLTHROUGH;
51175388 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5389 CYTHON_FALLTHROUGH;
51185390 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5391 CYTHON_FALLTHROUGH;
51195392 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5393 CYTHON_FALLTHROUGH;
51205394 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5395 CYTHON_FALLTHROUGH;
51215396 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5397 CYTHON_FALLTHROUGH;
51225398 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5399 CYTHON_FALLTHROUGH;
51235400 case 0: break;
51245401 default: goto __pyx_L5_argtuple_error;
51255402 }
51265403 kw_args = PyDict_Size(__pyx_kwds);
51275404 switch (pos_args) {
51285405 case 0:
5129 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
5406 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
51305407 else goto __pyx_L5_argtuple_error;
5408 CYTHON_FALLTHROUGH;
51315409 case 1:
5132 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
5410 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
51335411 else {
51345412 __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 1); __PYX_ERR(0, 130, __pyx_L3_error)
51355413 }
5414 CYTHON_FALLTHROUGH;
51365415 case 2:
5137 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
5416 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
51385417 else {
51395418 __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 2); __PYX_ERR(0, 130, __pyx_L3_error)
51405419 }
5420 CYTHON_FALLTHROUGH;
51415421 case 3:
5142 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
5422 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
51435423 else {
51445424 __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 3); __PYX_ERR(0, 130, __pyx_L3_error)
51455425 }
5426 CYTHON_FALLTHROUGH;
51465427 case 4:
5147 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
5428 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
51485429 else {
51495430 __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 4); __PYX_ERR(0, 130, __pyx_L3_error)
51505431 }
5432 CYTHON_FALLTHROUGH;
51515433 case 5:
5152 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x3)) != 0)) kw_args--;
5434 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x3)) != 0)) kw_args--;
51535435 else {
51545436 __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 5); __PYX_ERR(0, 130, __pyx_L3_error)
51555437 }
5438 CYTHON_FALLTHROUGH;
51565439 case 6:
5157 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y3)) != 0)) kw_args--;
5440 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y3)) != 0)) kw_args--;
51585441 else {
51595442 __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 6); __PYX_ERR(0, 130, __pyx_L3_error)
51605443 }
5444 CYTHON_FALLTHROUGH;
51615445 case 7:
5162 if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
5446 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
51635447 else {
51645448 __Pyx_RaiseArgtupleInvalid("aatrigon", 1, 8, 8, 7); __PYX_ERR(0, 130, __pyx_L3_error)
51655449 }
52135497 PyObject *__pyx_r = NULL;
52145498 __Pyx_RefNannyDeclarations
52155499 PyObject *__pyx_t_1 = NULL;
5216 PyObject *__pyx_t_2 = NULL;
5500 Sint16 __pyx_t_2;
52175501 Sint16 __pyx_t_3;
52185502 Sint16 __pyx_t_4;
52195503 Sint16 __pyx_t_5;
52205504 Sint16 __pyx_t_6;
52215505 Sint16 __pyx_t_7;
5222 Sint16 __pyx_t_8;
52235506 __Pyx_RefNannySetupContext("aatrigon", 0);
52245507
52255508 /* "pygame_sdl2/gfxdraw.pyx":131
52295512 * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
52305513 *
52315514 */
5232 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
5515 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
52335516 __Pyx_GOTREF(__pyx_t_1);
5234 __Pyx_INCREF(__pyx_v_color);
5235 __Pyx_GIVEREF(__pyx_v_color);
5236 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
5237 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error)
5238 __Pyx_GOTREF(__pyx_t_2);
5239 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5240 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
5241 __pyx_t_2 = 0;
5517 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
5518 __pyx_t_1 = 0;
52425519
52435520 /* "pygame_sdl2/gfxdraw.pyx":132
52445521 * def aatrigon(Surface surface, x1, y1, x2, y2, x3, y3, color):
52475524 *
52485525 * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color):
52495526 */
5250 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
5251 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
5252 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
5253 __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
5254 __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_x3); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
5255 __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_v_y3); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
5256 aatrigonRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
5527 __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
5528 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
5529 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
5530 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
5531 __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_x3); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
5532 __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_y3); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
5533 (void)(aatrigonRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
52575534
52585535 /* "pygame_sdl2/gfxdraw.pyx":130
52595536 * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
52685545 goto __pyx_L0;
52695546 __pyx_L1_error:;
52705547 __Pyx_XDECREF(__pyx_t_1);
5271 __Pyx_XDECREF(__pyx_t_2);
52725548 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.aatrigon", __pyx_clineno, __pyx_lineno, __pyx_filename);
52735549 __pyx_r = NULL;
52745550 __pyx_L0:;
53095585 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
53105586 switch (pos_args) {
53115587 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
5588 CYTHON_FALLTHROUGH;
53125589 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5590 CYTHON_FALLTHROUGH;
53135591 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5592 CYTHON_FALLTHROUGH;
53145593 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5594 CYTHON_FALLTHROUGH;
53155595 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5596 CYTHON_FALLTHROUGH;
53165597 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5598 CYTHON_FALLTHROUGH;
53175599 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5600 CYTHON_FALLTHROUGH;
53185601 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5602 CYTHON_FALLTHROUGH;
53195603 case 0: break;
53205604 default: goto __pyx_L5_argtuple_error;
53215605 }
53225606 kw_args = PyDict_Size(__pyx_kwds);
53235607 switch (pos_args) {
53245608 case 0:
5325 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
5609 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
53265610 else goto __pyx_L5_argtuple_error;
5611 CYTHON_FALLTHROUGH;
53275612 case 1:
5328 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
5613 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
53295614 else {
53305615 __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 1); __PYX_ERR(0, 134, __pyx_L3_error)
53315616 }
5617 CYTHON_FALLTHROUGH;
53325618 case 2:
5333 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
5619 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
53345620 else {
53355621 __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 2); __PYX_ERR(0, 134, __pyx_L3_error)
53365622 }
5623 CYTHON_FALLTHROUGH;
53375624 case 3:
5338 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
5625 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
53395626 else {
53405627 __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 3); __PYX_ERR(0, 134, __pyx_L3_error)
53415628 }
5629 CYTHON_FALLTHROUGH;
53425630 case 4:
5343 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
5631 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
53445632 else {
53455633 __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 4); __PYX_ERR(0, 134, __pyx_L3_error)
53465634 }
5635 CYTHON_FALLTHROUGH;
53475636 case 5:
5348 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x3)) != 0)) kw_args--;
5637 if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x3)) != 0)) kw_args--;
53495638 else {
53505639 __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 5); __PYX_ERR(0, 134, __pyx_L3_error)
53515640 }
5641 CYTHON_FALLTHROUGH;
53525642 case 6:
5353 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y3)) != 0)) kw_args--;
5643 if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y3)) != 0)) kw_args--;
53545644 else {
53555645 __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 6); __PYX_ERR(0, 134, __pyx_L3_error)
53565646 }
5647 CYTHON_FALLTHROUGH;
53575648 case 7:
5358 if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
5649 if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
53595650 else {
53605651 __Pyx_RaiseArgtupleInvalid("filled_trigon", 1, 8, 8, 7); __PYX_ERR(0, 134, __pyx_L3_error)
53615652 }
54095700 PyObject *__pyx_r = NULL;
54105701 __Pyx_RefNannyDeclarations
54115702 PyObject *__pyx_t_1 = NULL;
5412 PyObject *__pyx_t_2 = NULL;
5703 Sint16 __pyx_t_2;
54135704 Sint16 __pyx_t_3;
54145705 Sint16 __pyx_t_4;
54155706 Sint16 __pyx_t_5;
54165707 Sint16 __pyx_t_6;
54175708 Sint16 __pyx_t_7;
5418 Sint16 __pyx_t_8;
54195709 __Pyx_RefNannySetupContext("filled_trigon", 0);
54205710
54215711 /* "pygame_sdl2/gfxdraw.pyx":135
54255715 * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
54265716 *
54275717 */
5428 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
5718 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
54295719 __Pyx_GOTREF(__pyx_t_1);
5430 __Pyx_INCREF(__pyx_v_color);
5431 __Pyx_GIVEREF(__pyx_v_color);
5432 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
5433 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
5434 __Pyx_GOTREF(__pyx_t_2);
5435 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5436 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
5437 __pyx_t_2 = 0;
5720 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
5721 __pyx_t_1 = 0;
54385722
54395723 /* "pygame_sdl2/gfxdraw.pyx":136
54405724 * def filled_trigon(Surface surface, x1, y1, x2, y2, x3, y3, color):
54435727 *
54445728 * def polygon(Surface surface, points, color):
54455729 */
5446 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
5447 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
5448 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
5449 __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
5450 __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_x3); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
5451 __pyx_t_8 = __Pyx_PyInt_As_int16_t(__pyx_v_y3); if (unlikely((__pyx_t_8 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
5452 filledTrigonRGBA(__pyx_v_surface->surface, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
5730 __pyx_t_2 = __Pyx_PyInt_As_int16_t(__pyx_v_x1); if (unlikely((__pyx_t_2 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
5731 __pyx_t_3 = __Pyx_PyInt_As_int16_t(__pyx_v_y1); if (unlikely((__pyx_t_3 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
5732 __pyx_t_4 = __Pyx_PyInt_As_int16_t(__pyx_v_x2); if (unlikely((__pyx_t_4 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
5733 __pyx_t_5 = __Pyx_PyInt_As_int16_t(__pyx_v_y2); if (unlikely((__pyx_t_5 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
5734 __pyx_t_6 = __Pyx_PyInt_As_int16_t(__pyx_v_x3); if (unlikely((__pyx_t_6 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
5735 __pyx_t_7 = __Pyx_PyInt_As_int16_t(__pyx_v_y3); if (unlikely((__pyx_t_7 == ((Sint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
5736 (void)(filledTrigonRGBA(__pyx_v_surface->surface, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
54535737
54545738 /* "pygame_sdl2/gfxdraw.pyx":134
54555739 * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
54645748 goto __pyx_L0;
54655749 __pyx_L1_error:;
54665750 __Pyx_XDECREF(__pyx_t_1);
5467 __Pyx_XDECREF(__pyx_t_2);
54685751 __Pyx_AddTraceback("pygame_sdl2.gfxdraw.filled_trigon", __pyx_clineno, __pyx_lineno, __pyx_filename);
54695752 __pyx_r = NULL;
54705753 __pyx_L0:;
55005783 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
55015784 switch (pos_args) {
55025785 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5786 CYTHON_FALLTHROUGH;
55035787 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5788 CYTHON_FALLTHROUGH;
55045789 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5790 CYTHON_FALLTHROUGH;
55055791 case 0: break;
55065792 default: goto __pyx_L5_argtuple_error;
55075793 }
55085794 kw_args = PyDict_Size(__pyx_kwds);
55095795 switch (pos_args) {
55105796 case 0:
5511 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
5797 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
55125798 else goto __pyx_L5_argtuple_error;
5799 CYTHON_FALLTHROUGH;
55135800 case 1:
5514 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
5801 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
55155802 else {
55165803 __Pyx_RaiseArgtupleInvalid("polygon", 1, 3, 3, 1); __PYX_ERR(0, 138, __pyx_L3_error)
55175804 }
5805 CYTHON_FALLTHROUGH;
55185806 case 2:
5519 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
5807 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
55205808 else {
55215809 __Pyx_RaiseArgtupleInvalid("polygon", 1, 3, 3, 2); __PYX_ERR(0, 138, __pyx_L3_error)
55225810 }
55655853 PyObject *__pyx_r = NULL;
55665854 __Pyx_RefNannyDeclarations
55675855 PyObject *__pyx_t_1 = NULL;
5568 PyObject *__pyx_t_2 = NULL;
5569 Py_ssize_t __pyx_t_3;
5856 Py_ssize_t __pyx_t_2;
5857 PyObject *__pyx_t_3 = NULL;
55705858 PyObject *(*__pyx_t_4)(PyObject *);
55715859 PyObject *__pyx_t_5 = NULL;
55725860 PyObject *__pyx_t_6 = NULL;
55845872 * cdef Sint16 *vx
55855873 * cdef Sint16 *vy
55865874 */
5587 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
5875 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
55885876 __Pyx_GOTREF(__pyx_t_1);
5589 __Pyx_INCREF(__pyx_v_color);
5590 __Pyx_GIVEREF(__pyx_v_color);
5591 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
5592 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
5593 __Pyx_GOTREF(__pyx_t_2);
5594 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5595 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
5596 __pyx_t_2 = 0;
5877 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
5878 __pyx_t_1 = 0;
55975879
55985880 /* "pygame_sdl2/gfxdraw.pyx":142
55995881 * cdef Sint16 *vx
56025884 * vx = <Sint16*>malloc(num_points * sizeof(Sint16))
56035885 * vy = <Sint16*>malloc(num_points * sizeof(Sint16))
56045886 */
5605 __pyx_t_3 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 142, __pyx_L1_error)
5606 __pyx_v_num_points = __pyx_t_3;
5887 __pyx_t_2 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 142, __pyx_L1_error)
5888 __pyx_v_num_points = __pyx_t_2;
56075889
56085890 /* "pygame_sdl2/gfxdraw.pyx":143
56095891 * cdef Sint16 *vy
56305912 * vx[n], vy[n] = points[n]
56315913 * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)
56325914 */
5633 __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
5634 __Pyx_GOTREF(__pyx_t_2);
5635 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
5915 __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
56365916 __Pyx_GOTREF(__pyx_t_1);
5637 __Pyx_GIVEREF(__pyx_t_2);
5638 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
5639 __pyx_t_2 = 0;
5640 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
5641 __Pyx_GOTREF(__pyx_t_2);
5917 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
5918 __Pyx_GOTREF(__pyx_t_3);
56425919 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
56435920 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
56445921 __Pyx_GOTREF(__pyx_t_1);
5645 __Pyx_GIVEREF(__pyx_t_2);
5646 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
5922 __Pyx_GIVEREF(__pyx_t_3);
5923 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
56475924 __Pyx_INCREF(__pyx_v_points);
56485925 __Pyx_GIVEREF(__pyx_v_points);
56495926 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points);
5650 __pyx_t_2 = 0;
5651 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
5652 __Pyx_GOTREF(__pyx_t_2);
5927 __pyx_t_3 = 0;
5928 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
5929 __Pyx_GOTREF(__pyx_t_3);
56535930 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5654 if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
5655 __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
5931 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
5932 __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
56565933 __pyx_t_4 = NULL;
56575934 } else {
5658 __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
5935 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
56595936 __Pyx_GOTREF(__pyx_t_1);
56605937 __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 145, __pyx_L1_error)
56615938 }
5662 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5939 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
56635940 for (;;) {
56645941 if (likely(!__pyx_t_4)) {
56655942 if (likely(PyList_CheckExact(__pyx_t_1))) {
5666 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
5943 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
56675944 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5668 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 145, __pyx_L1_error)
5945 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 145, __pyx_L1_error)
56695946 #else
5670 __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
5671 __Pyx_GOTREF(__pyx_t_2);
5947 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
5948 __Pyx_GOTREF(__pyx_t_3);
56725949 #endif
56735950 } else {
5674 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
5951 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
56755952 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5676 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 145, __pyx_L1_error)
5953 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 145, __pyx_L1_error)
56775954 #else
5678 __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
5679 __Pyx_GOTREF(__pyx_t_2);
5955 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
5956 __Pyx_GOTREF(__pyx_t_3);
56805957 #endif
56815958 }
56825959 } else {
5683 __pyx_t_2 = __pyx_t_4(__pyx_t_1);
5684 if (unlikely(!__pyx_t_2)) {
5960 __pyx_t_3 = __pyx_t_4(__pyx_t_1);
5961 if (unlikely(!__pyx_t_3)) {
56855962 PyObject* exc_type = PyErr_Occurred();
56865963 if (exc_type) {
5687 if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5964 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
56885965 else __PYX_ERR(0, 145, __pyx_L1_error)
56895966 }
56905967 break;
56915968 }
5692 __Pyx_GOTREF(__pyx_t_2);
5693 }
5694 if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
5695 PyObject* sequence = __pyx_t_2;
5696 #if !CYTHON_COMPILING_IN_PYPY
5697 Py_ssize_t size = Py_SIZE(sequence);
5698 #else
5699 Py_ssize_t size = PySequence_Size(sequence);
5700 #endif
5969 __Pyx_GOTREF(__pyx_t_3);
5970 }
5971 if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
5972 PyObject* sequence = __pyx_t_3;
5973 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
57015974 if (unlikely(size != 2)) {
57025975 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
57035976 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
57195992 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 145, __pyx_L1_error)
57205993 __Pyx_GOTREF(__pyx_t_6);
57215994 #endif
5722 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5995 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57235996 } else {
57245997 Py_ssize_t index = -1;
5725 __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 145, __pyx_L1_error)
5998 __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 145, __pyx_L1_error)
57265999 __Pyx_GOTREF(__pyx_t_7);
5727 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6000 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57286001 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
57296002 index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
57306003 __Pyx_GOTREF(__pyx_t_5);
57536026 * polygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)
57546027 * free(vx)
57556028 */
5756 __pyx_t_2 = PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
5757 __Pyx_GOTREF(__pyx_t_2);
5758 if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
5759 PyObject* sequence = __pyx_t_2;
5760 #if !CYTHON_COMPILING_IN_PYPY
5761 Py_ssize_t size = Py_SIZE(sequence);
5762 #else
5763 Py_ssize_t size = PySequence_Size(sequence);
5764 #endif
6029 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
6030 __Pyx_GOTREF(__pyx_t_3);
6031 if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
6032 PyObject* sequence = __pyx_t_3;
6033 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
57656034 if (unlikely(size != 2)) {
57666035 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
57676036 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
57836052 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error)
57846053 __Pyx_GOTREF(__pyx_t_5);
57856054 #endif
5786 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6055 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57876056 } else {
57886057 Py_ssize_t index = -1;
5789 __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 146, __pyx_L1_error)
6058 __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 146, __pyx_L1_error)
57906059 __Pyx_GOTREF(__pyx_t_7);
5791 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6060 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57926061 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
57936062 index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
57946063 __Pyx_GOTREF(__pyx_t_6);
58316100 * free(vx)
58326101 * free(vy)
58336102 */
5834 polygonRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
6103 (void)(polygonRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
58356104
58366105 /* "pygame_sdl2/gfxdraw.pyx":148
58376106 * vx[n], vy[n] = points[n]
58646133 goto __pyx_L0;
58656134 __pyx_L1_error:;
58666135 __Pyx_XDECREF(__pyx_t_1);
5867 __Pyx_XDECREF(__pyx_t_2);
6136 __Pyx_XDECREF(__pyx_t_3);
58686137 __Pyx_XDECREF(__pyx_t_5);
58696138 __Pyx_XDECREF(__pyx_t_6);
58706139 __Pyx_XDECREF(__pyx_t_7);
59056174 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
59066175 switch (pos_args) {
59076176 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6177 CYTHON_FALLTHROUGH;
59086178 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6179 CYTHON_FALLTHROUGH;
59096180 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6181 CYTHON_FALLTHROUGH;
59106182 case 0: break;
59116183 default: goto __pyx_L5_argtuple_error;
59126184 }
59136185 kw_args = PyDict_Size(__pyx_kwds);
59146186 switch (pos_args) {
59156187 case 0:
5916 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
6188 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
59176189 else goto __pyx_L5_argtuple_error;
6190 CYTHON_FALLTHROUGH;
59186191 case 1:
5919 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
6192 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
59206193 else {
59216194 __Pyx_RaiseArgtupleInvalid("aapolygon", 1, 3, 3, 1); __PYX_ERR(0, 151, __pyx_L3_error)
59226195 }
6196 CYTHON_FALLTHROUGH;
59236197 case 2:
5924 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
6198 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
59256199 else {
59266200 __Pyx_RaiseArgtupleInvalid("aapolygon", 1, 3, 3, 2); __PYX_ERR(0, 151, __pyx_L3_error)
59276201 }
59706244 PyObject *__pyx_r = NULL;
59716245 __Pyx_RefNannyDeclarations
59726246 PyObject *__pyx_t_1 = NULL;
5973 PyObject *__pyx_t_2 = NULL;
5974 Py_ssize_t __pyx_t_3;
6247 Py_ssize_t __pyx_t_2;
6248 PyObject *__pyx_t_3 = NULL;
59756249 PyObject *(*__pyx_t_4)(PyObject *);
59766250 PyObject *__pyx_t_5 = NULL;
59776251 PyObject *__pyx_t_6 = NULL;
59896263 * cdef Sint16 *vx
59906264 * cdef Sint16 *vy
59916265 */
5992 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
6266 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
59936267 __Pyx_GOTREF(__pyx_t_1);
5994 __Pyx_INCREF(__pyx_v_color);
5995 __Pyx_GIVEREF(__pyx_v_color);
5996 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
5997 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
5998 __Pyx_GOTREF(__pyx_t_2);
5999 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6000 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
6001 __pyx_t_2 = 0;
6268 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
6269 __pyx_t_1 = 0;
60026270
60036271 /* "pygame_sdl2/gfxdraw.pyx":155
60046272 * cdef Sint16 *vx
60076275 * vx = <Sint16*>malloc(num_points * sizeof(Sint16))
60086276 * vy = <Sint16*>malloc(num_points * sizeof(Sint16))
60096277 */
6010 __pyx_t_3 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 155, __pyx_L1_error)
6011 __pyx_v_num_points = __pyx_t_3;
6278 __pyx_t_2 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 155, __pyx_L1_error)
6279 __pyx_v_num_points = __pyx_t_2;
60126280
60136281 /* "pygame_sdl2/gfxdraw.pyx":156
60146282 * cdef Sint16 *vy
60356303 * vx[n], vy[n] = points[n]
60366304 * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)
60376305 */
6038 __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
6039 __Pyx_GOTREF(__pyx_t_2);
6040 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
6306 __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
60416307 __Pyx_GOTREF(__pyx_t_1);
6042 __Pyx_GIVEREF(__pyx_t_2);
6043 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
6044 __pyx_t_2 = 0;
6045 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
6046 __Pyx_GOTREF(__pyx_t_2);
6308 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
6309 __Pyx_GOTREF(__pyx_t_3);
60476310 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
60486311 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
60496312 __Pyx_GOTREF(__pyx_t_1);
6050 __Pyx_GIVEREF(__pyx_t_2);
6051 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
6313 __Pyx_GIVEREF(__pyx_t_3);
6314 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
60526315 __Pyx_INCREF(__pyx_v_points);
60536316 __Pyx_GIVEREF(__pyx_v_points);
60546317 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points);
6055 __pyx_t_2 = 0;
6056 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
6057 __Pyx_GOTREF(__pyx_t_2);
6318 __pyx_t_3 = 0;
6319 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
6320 __Pyx_GOTREF(__pyx_t_3);
60586321 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6059 if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
6060 __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
6322 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
6323 __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
60616324 __pyx_t_4 = NULL;
60626325 } else {
6063 __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
6326 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
60646327 __Pyx_GOTREF(__pyx_t_1);
60656328 __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
60666329 }
6067 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6330 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
60686331 for (;;) {
60696332 if (likely(!__pyx_t_4)) {
60706333 if (likely(PyList_CheckExact(__pyx_t_1))) {
6071 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
6334 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
60726335 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6073 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 158, __pyx_L1_error)
6336 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 158, __pyx_L1_error)
60746337 #else
6075 __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
6076 __Pyx_GOTREF(__pyx_t_2);
6338 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
6339 __Pyx_GOTREF(__pyx_t_3);
60776340 #endif
60786341 } else {
6079 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
6342 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
60806343 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6081 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 158, __pyx_L1_error)
6344 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 158, __pyx_L1_error)
60826345 #else
6083 __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
6084 __Pyx_GOTREF(__pyx_t_2);
6346 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
6347 __Pyx_GOTREF(__pyx_t_3);
60856348 #endif
60866349 }
60876350 } else {
6088 __pyx_t_2 = __pyx_t_4(__pyx_t_1);
6089 if (unlikely(!__pyx_t_2)) {
6351 __pyx_t_3 = __pyx_t_4(__pyx_t_1);
6352 if (unlikely(!__pyx_t_3)) {
60906353 PyObject* exc_type = PyErr_Occurred();
60916354 if (exc_type) {
6092 if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
6355 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
60936356 else __PYX_ERR(0, 158, __pyx_L1_error)
60946357 }
60956358 break;
60966359 }
6097 __Pyx_GOTREF(__pyx_t_2);
6098 }
6099 if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
6100 PyObject* sequence = __pyx_t_2;
6101 #if !CYTHON_COMPILING_IN_PYPY
6102 Py_ssize_t size = Py_SIZE(sequence);
6103 #else
6104 Py_ssize_t size = PySequence_Size(sequence);
6105 #endif
6360 __Pyx_GOTREF(__pyx_t_3);
6361 }
6362 if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
6363 PyObject* sequence = __pyx_t_3;
6364 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
61066365 if (unlikely(size != 2)) {
61076366 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
61086367 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
61246383 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error)
61256384 __Pyx_GOTREF(__pyx_t_6);
61266385 #endif
6127 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6386 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
61286387 } else {
61296388 Py_ssize_t index = -1;
6130 __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 158, __pyx_L1_error)
6389 __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 158, __pyx_L1_error)
61316390 __Pyx_GOTREF(__pyx_t_7);
6132 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6391 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
61336392 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
61346393 index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
61356394 __Pyx_GOTREF(__pyx_t_5);
61586417 * aapolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)
61596418 * free(vx)
61606419 */
6161 __pyx_t_2 = PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
6162 __Pyx_GOTREF(__pyx_t_2);
6163 if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
6164 PyObject* sequence = __pyx_t_2;
6165 #if !CYTHON_COMPILING_IN_PYPY
6166 Py_ssize_t size = Py_SIZE(sequence);
6167 #else
6168 Py_ssize_t size = PySequence_Size(sequence);
6169 #endif
6420 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
6421 __Pyx_GOTREF(__pyx_t_3);
6422 if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
6423 PyObject* sequence = __pyx_t_3;
6424 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
61706425 if (unlikely(size != 2)) {
61716426 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
61726427 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
61886443 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error)
61896444 __Pyx_GOTREF(__pyx_t_5);
61906445 #endif
6191 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6446 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
61926447 } else {
61936448 Py_ssize_t index = -1;
6194 __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error)
6449 __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error)
61956450 __Pyx_GOTREF(__pyx_t_7);
6196 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6451 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
61976452 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
61986453 index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
61996454 __Pyx_GOTREF(__pyx_t_6);
62366491 * free(vx)
62376492 * free(vy)
62386493 */
6239 aapolygonRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
6494 (void)(aapolygonRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
62406495
62416496 /* "pygame_sdl2/gfxdraw.pyx":161
62426497 * vx[n], vy[n] = points[n]
62696524 goto __pyx_L0;
62706525 __pyx_L1_error:;
62716526 __Pyx_XDECREF(__pyx_t_1);
6272 __Pyx_XDECREF(__pyx_t_2);
6527 __Pyx_XDECREF(__pyx_t_3);
62736528 __Pyx_XDECREF(__pyx_t_5);
62746529 __Pyx_XDECREF(__pyx_t_6);
62756530 __Pyx_XDECREF(__pyx_t_7);
63106565 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
63116566 switch (pos_args) {
63126567 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6568 CYTHON_FALLTHROUGH;
63136569 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6570 CYTHON_FALLTHROUGH;
63146571 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6572 CYTHON_FALLTHROUGH;
63156573 case 0: break;
63166574 default: goto __pyx_L5_argtuple_error;
63176575 }
63186576 kw_args = PyDict_Size(__pyx_kwds);
63196577 switch (pos_args) {
63206578 case 0:
6321 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
6579 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
63226580 else goto __pyx_L5_argtuple_error;
6581 CYTHON_FALLTHROUGH;
63236582 case 1:
6324 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
6583 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
63256584 else {
63266585 __Pyx_RaiseArgtupleInvalid("filled_polygon", 1, 3, 3, 1); __PYX_ERR(0, 164, __pyx_L3_error)
63276586 }
6587 CYTHON_FALLTHROUGH;
63286588 case 2:
6329 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
6589 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
63306590 else {
63316591 __Pyx_RaiseArgtupleInvalid("filled_polygon", 1, 3, 3, 2); __PYX_ERR(0, 164, __pyx_L3_error)
63326592 }
63756635 PyObject *__pyx_r = NULL;
63766636 __Pyx_RefNannyDeclarations
63776637 PyObject *__pyx_t_1 = NULL;
6378 PyObject *__pyx_t_2 = NULL;
6379 Py_ssize_t __pyx_t_3;
6638 Py_ssize_t __pyx_t_2;
6639 PyObject *__pyx_t_3 = NULL;
63806640 PyObject *(*__pyx_t_4)(PyObject *);
63816641 PyObject *__pyx_t_5 = NULL;
63826642 PyObject *__pyx_t_6 = NULL;
63946654 * cdef Sint16 *vx
63956655 * cdef Sint16 *vy
63966656 */
6397 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
6657 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
63986658 __Pyx_GOTREF(__pyx_t_1);
6399 __Pyx_INCREF(__pyx_v_color);
6400 __Pyx_GIVEREF(__pyx_v_color);
6401 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
6402 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error)
6403 __Pyx_GOTREF(__pyx_t_2);
6404 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6405 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
6406 __pyx_t_2 = 0;
6659 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
6660 __pyx_t_1 = 0;
64076661
64086662 /* "pygame_sdl2/gfxdraw.pyx":168
64096663 * cdef Sint16 *vx
64126666 * vx = <Sint16*>malloc(num_points * sizeof(Sint16))
64136667 * vy = <Sint16*>malloc(num_points * sizeof(Sint16))
64146668 */
6415 __pyx_t_3 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 168, __pyx_L1_error)
6416 __pyx_v_num_points = __pyx_t_3;
6669 __pyx_t_2 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 168, __pyx_L1_error)
6670 __pyx_v_num_points = __pyx_t_2;
64176671
64186672 /* "pygame_sdl2/gfxdraw.pyx":169
64196673 * cdef Sint16 *vy
64406694 * vx[n], vy[n] = points[n]
64416695 * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)
64426696 */
6443 __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
6444 __Pyx_GOTREF(__pyx_t_2);
6445 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
6697 __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
64466698 __Pyx_GOTREF(__pyx_t_1);
6447 __Pyx_GIVEREF(__pyx_t_2);
6448 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
6449 __pyx_t_2 = 0;
6450 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
6451 __Pyx_GOTREF(__pyx_t_2);
6699 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
6700 __Pyx_GOTREF(__pyx_t_3);
64526701 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
64536702 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
64546703 __Pyx_GOTREF(__pyx_t_1);
6455 __Pyx_GIVEREF(__pyx_t_2);
6456 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
6704 __Pyx_GIVEREF(__pyx_t_3);
6705 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
64576706 __Pyx_INCREF(__pyx_v_points);
64586707 __Pyx_GIVEREF(__pyx_v_points);
64596708 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points);
6460 __pyx_t_2 = 0;
6461 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
6462 __Pyx_GOTREF(__pyx_t_2);
6709 __pyx_t_3 = 0;
6710 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
6711 __Pyx_GOTREF(__pyx_t_3);
64636712 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6464 if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
6465 __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
6713 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
6714 __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
64666715 __pyx_t_4 = NULL;
64676716 } else {
6468 __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
6717 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
64696718 __Pyx_GOTREF(__pyx_t_1);
64706719 __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
64716720 }
6472 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6721 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
64736722 for (;;) {
64746723 if (likely(!__pyx_t_4)) {
64756724 if (likely(PyList_CheckExact(__pyx_t_1))) {
6476 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
6725 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
64776726 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6478 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
6727 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
64796728 #else
6480 __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
6481 __Pyx_GOTREF(__pyx_t_2);
6729 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
6730 __Pyx_GOTREF(__pyx_t_3);
64826731 #endif
64836732 } else {
6484 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
6733 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
64856734 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6486 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
6735 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 171, __pyx_L1_error)
64876736 #else
6488 __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
6489 __Pyx_GOTREF(__pyx_t_2);
6737 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
6738 __Pyx_GOTREF(__pyx_t_3);
64906739 #endif
64916740 }
64926741 } else {
6493 __pyx_t_2 = __pyx_t_4(__pyx_t_1);
6494 if (unlikely(!__pyx_t_2)) {
6742 __pyx_t_3 = __pyx_t_4(__pyx_t_1);
6743 if (unlikely(!__pyx_t_3)) {
64956744 PyObject* exc_type = PyErr_Occurred();
64966745 if (exc_type) {
6497 if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
6746 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
64986747 else __PYX_ERR(0, 171, __pyx_L1_error)
64996748 }
65006749 break;
65016750 }
6502 __Pyx_GOTREF(__pyx_t_2);
6503 }
6504 if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
6505 PyObject* sequence = __pyx_t_2;
6506 #if !CYTHON_COMPILING_IN_PYPY
6507 Py_ssize_t size = Py_SIZE(sequence);
6508 #else
6509 Py_ssize_t size = PySequence_Size(sequence);
6510 #endif
6751 __Pyx_GOTREF(__pyx_t_3);
6752 }
6753 if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
6754 PyObject* sequence = __pyx_t_3;
6755 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
65116756 if (unlikely(size != 2)) {
65126757 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
65136758 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
65296774 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 171, __pyx_L1_error)
65306775 __Pyx_GOTREF(__pyx_t_6);
65316776 #endif
6532 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6777 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
65336778 } else {
65346779 Py_ssize_t index = -1;
6535 __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 171, __pyx_L1_error)
6780 __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 171, __pyx_L1_error)
65366781 __Pyx_GOTREF(__pyx_t_7);
6537 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6782 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
65386783 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
65396784 index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
65406785 __Pyx_GOTREF(__pyx_t_5);
65636808 * filledPolygonRGBA(surface.surface, vx, vy, num_points, c.r, c.g, c.b, c.a)
65646809 * free(vx)
65656810 */
6566 __pyx_t_2 = PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error)
6567 __Pyx_GOTREF(__pyx_t_2);
6568 if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
6569 PyObject* sequence = __pyx_t_2;
6570 #if !CYTHON_COMPILING_IN_PYPY
6571 Py_ssize_t size = Py_SIZE(sequence);
6572 #else
6573 Py_ssize_t size = PySequence_Size(sequence);
6574 #endif
6811 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error)
6812 __Pyx_GOTREF(__pyx_t_3);
6813 if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
6814 PyObject* sequence = __pyx_t_3;
6815 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
65756816 if (unlikely(size != 2)) {
65766817 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
65776818 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
65936834 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error)
65946835 __Pyx_GOTREF(__pyx_t_5);
65956836 #endif
6596 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6837 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
65976838 } else {
65986839 Py_ssize_t index = -1;
6599 __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error)
6840 __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error)
66006841 __Pyx_GOTREF(__pyx_t_7);
6601 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6842 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
66026843 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
66036844 index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
66046845 __Pyx_GOTREF(__pyx_t_6);
66416882 * free(vx)
66426883 * free(vy)
66436884 */
6644 filledPolygonRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
6885 (void)(filledPolygonRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
66456886
66466887 /* "pygame_sdl2/gfxdraw.pyx":174
66476888 * vx[n], vy[n] = points[n]
66746915 goto __pyx_L0;
66756916 __pyx_L1_error:;
66766917 __Pyx_XDECREF(__pyx_t_1);
6677 __Pyx_XDECREF(__pyx_t_2);
6918 __Pyx_XDECREF(__pyx_t_3);
66786919 __Pyx_XDECREF(__pyx_t_5);
66796920 __Pyx_XDECREF(__pyx_t_6);
66806921 __Pyx_XDECREF(__pyx_t_7);
67176958 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
67186959 switch (pos_args) {
67196960 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6961 CYTHON_FALLTHROUGH;
67206962 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6963 CYTHON_FALLTHROUGH;
67216964 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6965 CYTHON_FALLTHROUGH;
67226966 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6967 CYTHON_FALLTHROUGH;
67236968 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6969 CYTHON_FALLTHROUGH;
67246970 case 0: break;
67256971 default: goto __pyx_L5_argtuple_error;
67266972 }
67276973 kw_args = PyDict_Size(__pyx_kwds);
67286974 switch (pos_args) {
67296975 case 0:
6730 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
6976 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
67316977 else goto __pyx_L5_argtuple_error;
6978 CYTHON_FALLTHROUGH;
67326979 case 1:
6733 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
6980 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
67346981 else {
67356982 __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 1); __PYX_ERR(0, 177, __pyx_L3_error)
67366983 }
6984 CYTHON_FALLTHROUGH;
67376985 case 2:
6738 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_texture)) != 0)) kw_args--;
6986 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_texture)) != 0)) kw_args--;
67396987 else {
67406988 __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 2); __PYX_ERR(0, 177, __pyx_L3_error)
67416989 }
6990 CYTHON_FALLTHROUGH;
67426991 case 3:
6743 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tx)) != 0)) kw_args--;
6992 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tx)) != 0)) kw_args--;
67446993 else {
67456994 __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 3); __PYX_ERR(0, 177, __pyx_L3_error)
67466995 }
6996 CYTHON_FALLTHROUGH;
67476997 case 4:
6748 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ty)) != 0)) kw_args--;
6998 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ty)) != 0)) kw_args--;
67496999 else {
67507000 __Pyx_RaiseArgtupleInvalid("textured_polygon", 1, 5, 5, 4); __PYX_ERR(0, 177, __pyx_L3_error)
67517001 }
68197069 * vx = <Sint16*>malloc(num_points * sizeof(Sint16))
68207070 * vy = <Sint16*>malloc(num_points * sizeof(Sint16))
68217071 */
6822 __pyx_t_1 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 180, __pyx_L1_error)
7072 __pyx_t_1 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 180, __pyx_L1_error)
68237073 __pyx_v_num_points = __pyx_t_1;
68247074
68257075 /* "pygame_sdl2/gfxdraw.pyx":181
68497099 */
68507100 __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
68517101 __Pyx_GOTREF(__pyx_t_2);
6852 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
7102 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
68537103 __Pyx_GOTREF(__pyx_t_3);
6854 __Pyx_GIVEREF(__pyx_t_2);
6855 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
6856 __pyx_t_2 = 0;
6857 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
7104 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7105 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
68587106 __Pyx_GOTREF(__pyx_t_2);
6859 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6860 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
6861 __Pyx_GOTREF(__pyx_t_3);
6862 __Pyx_GIVEREF(__pyx_t_2);
6863 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
7107 __Pyx_GIVEREF(__pyx_t_3);
7108 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
68647109 __Pyx_INCREF(__pyx_v_points);
68657110 __Pyx_GIVEREF(__pyx_v_points);
6866 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_points);
6867 __pyx_t_2 = 0;
6868 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
6869 __Pyx_GOTREF(__pyx_t_2);
6870 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6871 if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
6872 __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
7111 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_points);
7112 __pyx_t_3 = 0;
7113 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
7114 __Pyx_GOTREF(__pyx_t_3);
7115 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7116 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
7117 __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = 0;
68737118 __pyx_t_4 = NULL;
68747119 } else {
6875 __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
6876 __Pyx_GOTREF(__pyx_t_3);
6877 __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error)
7120 __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
7121 __Pyx_GOTREF(__pyx_t_2);
7122 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 183, __pyx_L1_error)
68787123 }
6879 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7124 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
68807125 for (;;) {
68817126 if (likely(!__pyx_t_4)) {
6882 if (likely(PyList_CheckExact(__pyx_t_3))) {
6883 if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break;
7127 if (likely(PyList_CheckExact(__pyx_t_2))) {
7128 if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
68847129 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6885 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 183, __pyx_L1_error)
7130 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 183, __pyx_L1_error)
68867131 #else
6887 __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
6888 __Pyx_GOTREF(__pyx_t_2);
7132 __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
7133 __Pyx_GOTREF(__pyx_t_3);
68897134 #endif
68907135 } else {
6891 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
7136 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
68927137 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6893 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 183, __pyx_L1_error)
7138 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 183, __pyx_L1_error)
68947139 #else
6895 __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
6896 __Pyx_GOTREF(__pyx_t_2);
7140 __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
7141 __Pyx_GOTREF(__pyx_t_3);
68977142 #endif
68987143 }
68997144 } else {
6900 __pyx_t_2 = __pyx_t_4(__pyx_t_3);
6901 if (unlikely(!__pyx_t_2)) {
7145 __pyx_t_3 = __pyx_t_4(__pyx_t_2);
7146 if (unlikely(!__pyx_t_3)) {
69027147 PyObject* exc_type = PyErr_Occurred();
69037148 if (exc_type) {
6904 if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
7149 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
69057150 else __PYX_ERR(0, 183, __pyx_L1_error)
69067151 }
69077152 break;
69087153 }
6909 __Pyx_GOTREF(__pyx_t_2);
6910 }
6911 if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
6912 PyObject* sequence = __pyx_t_2;
6913 #if !CYTHON_COMPILING_IN_PYPY
6914 Py_ssize_t size = Py_SIZE(sequence);
6915 #else
6916 Py_ssize_t size = PySequence_Size(sequence);
6917 #endif
7154 __Pyx_GOTREF(__pyx_t_3);
7155 }
7156 if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
7157 PyObject* sequence = __pyx_t_3;
7158 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
69187159 if (unlikely(size != 2)) {
69197160 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
69207161 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
69367177 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 183, __pyx_L1_error)
69377178 __Pyx_GOTREF(__pyx_t_6);
69387179 #endif
6939 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7180 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
69407181 } else {
69417182 Py_ssize_t index = -1;
6942 __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 183, __pyx_L1_error)
7183 __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 183, __pyx_L1_error)
69437184 __Pyx_GOTREF(__pyx_t_7);
6944 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7185 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
69457186 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
69467187 index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
69477188 __Pyx_GOTREF(__pyx_t_5);
69707211 * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty)
69717212 * free(vx)
69727213 */
6973 __pyx_t_2 = PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error)
6974 __Pyx_GOTREF(__pyx_t_2);
6975 if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
6976 PyObject* sequence = __pyx_t_2;
6977 #if !CYTHON_COMPILING_IN_PYPY
6978 Py_ssize_t size = Py_SIZE(sequence);
6979 #else
6980 Py_ssize_t size = PySequence_Size(sequence);
6981 #endif
7214 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
7215 __Pyx_GOTREF(__pyx_t_3);
7216 if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
7217 PyObject* sequence = __pyx_t_3;
7218 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
69827219 if (unlikely(size != 2)) {
69837220 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
69847221 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
70007237 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 184, __pyx_L1_error)
70017238 __Pyx_GOTREF(__pyx_t_5);
70027239 #endif
7003 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7240 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
70047241 } else {
70057242 Py_ssize_t index = -1;
7006 __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 184, __pyx_L1_error)
7243 __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 184, __pyx_L1_error)
70077244 __Pyx_GOTREF(__pyx_t_7);
7008 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7245 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
70097246 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
70107247 index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
70117248 __Pyx_GOTREF(__pyx_t_6);
70397276 * texturedPolygon(surface.surface, vx, vy, num_points, texture.surface, tx, ty)
70407277 */
70417278 }
7042 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7279 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
70437280
70447281 /* "pygame_sdl2/gfxdraw.pyx":185
70457282 * for n, pt in zip(range(num_points), points):
70507287 */
70517288 __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_tx); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
70527289 __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_ty); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
7053 texturedPolygon(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_texture->surface, __pyx_t_12, __pyx_t_13);
7290 (void)(texturedPolygon(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_v_texture->surface, __pyx_t_12, __pyx_t_13));
70547291
70557292 /* "pygame_sdl2/gfxdraw.pyx":186
70567293 * vx[n], vy[n] = points[n]
71247361 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
71257362 switch (pos_args) {
71267363 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7364 CYTHON_FALLTHROUGH;
71277365 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7366 CYTHON_FALLTHROUGH;
71287367 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7368 CYTHON_FALLTHROUGH;
71297369 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7370 CYTHON_FALLTHROUGH;
71307371 case 0: break;
71317372 default: goto __pyx_L5_argtuple_error;
71327373 }
71337374 kw_args = PyDict_Size(__pyx_kwds);
71347375 switch (pos_args) {
71357376 case 0:
7136 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
7377 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
71377378 else goto __pyx_L5_argtuple_error;
7379 CYTHON_FALLTHROUGH;
71387380 case 1:
7139 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
7381 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
71407382 else {
71417383 __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, 1); __PYX_ERR(0, 189, __pyx_L3_error)
71427384 }
7385 CYTHON_FALLTHROUGH;
71437386 case 2:
7144 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_steps)) != 0)) kw_args--;
7387 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_steps)) != 0)) kw_args--;
71457388 else {
71467389 __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, 2); __PYX_ERR(0, 189, __pyx_L3_error)
71477390 }
7391 CYTHON_FALLTHROUGH;
71487392 case 3:
7149 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
7393 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
71507394 else {
71517395 __Pyx_RaiseArgtupleInvalid("bezier", 1, 4, 4, 3); __PYX_ERR(0, 189, __pyx_L3_error)
71527396 }
71977441 PyObject *__pyx_r = NULL;
71987442 __Pyx_RefNannyDeclarations
71997443 PyObject *__pyx_t_1 = NULL;
7200 PyObject *__pyx_t_2 = NULL;
7201 Py_ssize_t __pyx_t_3;
7444 Py_ssize_t __pyx_t_2;
7445 PyObject *__pyx_t_3 = NULL;
72027446 PyObject *(*__pyx_t_4)(PyObject *);
72037447 PyObject *__pyx_t_5 = NULL;
72047448 PyObject *__pyx_t_6 = NULL;
72177461 * cdef Sint16 *vx
72187462 * cdef Sint16 *vy
72197463 */
7220 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
7464 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_v_color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
72217465 __Pyx_GOTREF(__pyx_t_1);
7222 __Pyx_INCREF(__pyx_v_color);
7223 __Pyx_GIVEREF(__pyx_v_color);
7224 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_color);
7225 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5color_Color), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error)
7226 __Pyx_GOTREF(__pyx_t_2);
7227 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7228 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_2);
7229 __pyx_t_2 = 0;
7466 __pyx_v_c = ((struct __pyx_obj_11pygame_sdl2_5color_Color *)__pyx_t_1);
7467 __pyx_t_1 = 0;
72307468
72317469 /* "pygame_sdl2/gfxdraw.pyx":193
72327470 * cdef Sint16 *vx
72357473 * vx = <Sint16*>malloc(num_points * sizeof(Sint16))
72367474 * vy = <Sint16*>malloc(num_points * sizeof(Sint16))
72377475 */
7238 __pyx_t_3 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 193, __pyx_L1_error)
7239 __pyx_v_num_points = __pyx_t_3;
7476 __pyx_t_2 = PyObject_Length(__pyx_v_points); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 193, __pyx_L1_error)
7477 __pyx_v_num_points = __pyx_t_2;
72407478
72417479 /* "pygame_sdl2/gfxdraw.pyx":194
72427480 * cdef Sint16 *vy
72637501 * vx[n], vy[n] = points[n]
72647502 * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a)
72657503 */
7266 __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
7267 __Pyx_GOTREF(__pyx_t_2);
7268 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
7504 __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_num_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
72697505 __Pyx_GOTREF(__pyx_t_1);
7270 __Pyx_GIVEREF(__pyx_t_2);
7271 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
7272 __pyx_t_2 = 0;
7273 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
7274 __Pyx_GOTREF(__pyx_t_2);
7506 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
7507 __Pyx_GOTREF(__pyx_t_3);
72757508 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
72767509 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
72777510 __Pyx_GOTREF(__pyx_t_1);
7278 __Pyx_GIVEREF(__pyx_t_2);
7279 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
7511 __Pyx_GIVEREF(__pyx_t_3);
7512 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
72807513 __Pyx_INCREF(__pyx_v_points);
72817514 __Pyx_GIVEREF(__pyx_v_points);
72827515 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_points);
7283 __pyx_t_2 = 0;
7284 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
7285 __Pyx_GOTREF(__pyx_t_2);
7516 __pyx_t_3 = 0;
7517 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
7518 __Pyx_GOTREF(__pyx_t_3);
72867519 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7287 if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
7288 __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
7520 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
7521 __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
72897522 __pyx_t_4 = NULL;
72907523 } else {
7291 __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
7524 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
72927525 __Pyx_GOTREF(__pyx_t_1);
72937526 __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error)
72947527 }
7295 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7528 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
72967529 for (;;) {
72977530 if (likely(!__pyx_t_4)) {
72987531 if (likely(PyList_CheckExact(__pyx_t_1))) {
7299 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
7532 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
73007533 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7301 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 196, __pyx_L1_error)
7534 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 196, __pyx_L1_error)
73027535 #else
7303 __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
7304 __Pyx_GOTREF(__pyx_t_2);
7536 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
7537 __Pyx_GOTREF(__pyx_t_3);
73057538 #endif
73067539 } else {
7307 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
7540 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
73087541 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7309 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 196, __pyx_L1_error)
7542 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 196, __pyx_L1_error)
73107543 #else
7311 __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
7312 __Pyx_GOTREF(__pyx_t_2);
7544 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
7545 __Pyx_GOTREF(__pyx_t_3);
73137546 #endif
73147547 }
73157548 } else {
7316 __pyx_t_2 = __pyx_t_4(__pyx_t_1);
7317 if (unlikely(!__pyx_t_2)) {
7549 __pyx_t_3 = __pyx_t_4(__pyx_t_1);
7550 if (unlikely(!__pyx_t_3)) {
73187551 PyObject* exc_type = PyErr_Occurred();
73197552 if (exc_type) {
7320 if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
7553 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
73217554 else __PYX_ERR(0, 196, __pyx_L1_error)
73227555 }
73237556 break;
73247557 }
7325 __Pyx_GOTREF(__pyx_t_2);
7326 }
7327 if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
7328 PyObject* sequence = __pyx_t_2;
7329 #if !CYTHON_COMPILING_IN_PYPY
7330 Py_ssize_t size = Py_SIZE(sequence);
7331 #else
7332 Py_ssize_t size = PySequence_Size(sequence);
7333 #endif
7558 __Pyx_GOTREF(__pyx_t_3);
7559 }
7560 if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
7561 PyObject* sequence = __pyx_t_3;
7562 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
73347563 if (unlikely(size != 2)) {
73357564 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
73367565 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
73527581 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 196, __pyx_L1_error)
73537582 __Pyx_GOTREF(__pyx_t_6);
73547583 #endif
7355 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7584 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
73567585 } else {
73577586 Py_ssize_t index = -1;
7358 __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 196, __pyx_L1_error)
7587 __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 196, __pyx_L1_error)
73597588 __Pyx_GOTREF(__pyx_t_7);
7360 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7589 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
73617590 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
73627591 index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
73637592 __Pyx_GOTREF(__pyx_t_5);
73867615 * bezierRGBA(surface.surface, vx, vy, num_points, steps, c.r, c.g, c.b, c.a)
73877616 * free(vx)
73887617 */
7389 __pyx_t_2 = PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
7390 __Pyx_GOTREF(__pyx_t_2);
7391 if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
7392 PyObject* sequence = __pyx_t_2;
7393 #if !CYTHON_COMPILING_IN_PYPY
7394 Py_ssize_t size = Py_SIZE(sequence);
7395 #else
7396 Py_ssize_t size = PySequence_Size(sequence);
7397 #endif
7618 __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_points, __pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error)
7619 __Pyx_GOTREF(__pyx_t_3);
7620 if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
7621 PyObject* sequence = __pyx_t_3;
7622 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
73987623 if (unlikely(size != 2)) {
73997624 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
74007625 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
74167641 __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error)
74177642 __Pyx_GOTREF(__pyx_t_5);
74187643 #endif
7419 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7644 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
74207645 } else {
74217646 Py_ssize_t index = -1;
7422 __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 197, __pyx_L1_error)
7647 __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 197, __pyx_L1_error)
74237648 __Pyx_GOTREF(__pyx_t_7);
7424 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7649 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
74257650 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
74267651 index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
74277652 __Pyx_GOTREF(__pyx_t_6);
74657690 * free(vy)
74667691 */
74677692 __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_steps); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 198, __pyx_L1_error)
7468 bezierRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_t_12, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a);
7693 (void)(bezierRGBA(__pyx_v_surface->surface, __pyx_v_vx, __pyx_v_vy, __pyx_v_num_points, __pyx_t_12, __pyx_v_c->r, __pyx_v_c->g, __pyx_v_c->b, __pyx_v_c->a));
74697694
74707695 /* "pygame_sdl2/gfxdraw.pyx":199
74717696 * vx[n], vy[n] = points[n]
74957720 goto __pyx_L0;
74967721 __pyx_L1_error:;
74977722 __Pyx_XDECREF(__pyx_t_1);
7498 __Pyx_XDECREF(__pyx_t_2);
7723 __Pyx_XDECREF(__pyx_t_3);
74997724 __Pyx_XDECREF(__pyx_t_5);
75007725 __Pyx_XDECREF(__pyx_t_6);
75017726 __Pyx_XDECREF(__pyx_t_7);
75157740 };
75167741
75177742 #if PY_MAJOR_VERSION >= 3
7743 #if CYTHON_PEP489_MULTI_PHASE_INIT
7744 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
7745 static int __pyx_pymod_exec_gfxdraw(PyObject* module); /*proto*/
7746 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
7747 {Py_mod_create, (void*)__pyx_pymod_create},
7748 {Py_mod_exec, (void*)__pyx_pymod_exec_gfxdraw},
7749 {0, NULL}
7750 };
7751 #endif
7752
75187753 static struct PyModuleDef __pyx_moduledef = {
7519 #if PY_VERSION_HEX < 0x03020000
7520 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
7521 #else
75227754 PyModuleDef_HEAD_INIT,
7523 #endif
75247755 "gfxdraw",
75257756 0, /* m_doc */
7757 #if CYTHON_PEP489_MULTI_PHASE_INIT
7758 0, /* m_size */
7759 #else
75267760 -1, /* m_size */
7761 #endif
75277762 __pyx_methods /* m_methods */,
7763 #if CYTHON_PEP489_MULTI_PHASE_INIT
7764 __pyx_moduledef_slots, /* m_slots */
7765 #else
75287766 NULL, /* m_reload */
7767 #endif
75297768 NULL, /* m_traverse */
75307769 NULL, /* m_clear */
75317770 NULL /* m_free */
75447783 {&__pyx_n_s_box, __pyx_k_box, sizeof(__pyx_k_box), 0, 0, 1, 1},
75457784 {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
75467785 {&__pyx_n_s_circle, __pyx_k_circle, sizeof(__pyx_k_circle), 0, 0, 1, 1},
7786 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
75477787 {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1},
75487788 {&__pyx_n_s_ellipse, __pyx_k_ellipse, sizeof(__pyx_k_ellipse), 0, 0, 1, 1},
75497789 {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
76317871 __pyx_tuple_ = PyTuple_Pack(5, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 29, __pyx_L1_error)
76327872 __Pyx_GOTREF(__pyx_tuple_);
76337873 __Pyx_GIVEREF(__pyx_tuple_);
7634 __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_pixel, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 29, __pyx_L1_error)
7874 __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_pixel, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 29, __pyx_L1_error)
76357875
76367876 /* "pygame_sdl2/gfxdraw.pyx":33
76377877 * pixelRGBA(surface.surface, x, y, c.r, c.g, c.b, c.a)
76437883 __pyx_tuple__3 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_x2, __pyx_n_s_y, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 33, __pyx_L1_error)
76447884 __Pyx_GOTREF(__pyx_tuple__3);
76457885 __Pyx_GIVEREF(__pyx_tuple__3);
7646 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_hline, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 33, __pyx_L1_error)
7886 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_hline, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 33, __pyx_L1_error)
76477887
76487888 /* "pygame_sdl2/gfxdraw.pyx":37
76497889 * hlineRGBA(surface.surface, x1, x2, y, c.r, c.g, c.b, c.a)
76557895 __pyx_tuple__5 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y1, __pyx_n_s_y2, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 37, __pyx_L1_error)
76567896 __Pyx_GOTREF(__pyx_tuple__5);
76577897 __Pyx_GIVEREF(__pyx_tuple__5);
7658 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_vline, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 37, __pyx_L1_error)
7898 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_vline, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 37, __pyx_L1_error)
76597899
76607900 /* "pygame_sdl2/gfxdraw.pyx":41
76617901 * vlineRGBA(surface.surface, x, y1, y2, c.r, c.g, c.b, c.a)
76677907 __pyx_tuple__7 = PyTuple_Pack(4, __pyx_n_s_surface, __pyx_n_s_rect, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 41, __pyx_L1_error)
76687908 __Pyx_GOTREF(__pyx_tuple__7);
76697909 __Pyx_GIVEREF(__pyx_tuple__7);
7670 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_rectangle, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 41, __pyx_L1_error)
7910 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_rectangle, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 41, __pyx_L1_error)
76717911
76727912 /* "pygame_sdl2/gfxdraw.pyx":47
76737913 * rectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
76797919 __pyx_tuple__9 = PyTuple_Pack(5, __pyx_n_s_surface, __pyx_n_s_rect, __pyx_n_s_rad, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 47, __pyx_L1_error)
76807920 __Pyx_GOTREF(__pyx_tuple__9);
76817921 __Pyx_GIVEREF(__pyx_tuple__9);
7682 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_rounded_rectangle, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 47, __pyx_L1_error)
7922 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_rounded_rectangle, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 47, __pyx_L1_error)
76837923
76847924 /* "pygame_sdl2/gfxdraw.pyx":53
76857925 * roundedRectangleRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
76917931 __pyx_tuple__11 = PyTuple_Pack(4, __pyx_n_s_surface, __pyx_n_s_rect, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 53, __pyx_L1_error)
76927932 __Pyx_GOTREF(__pyx_tuple__11);
76937933 __Pyx_GIVEREF(__pyx_tuple__11);
7694 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_box, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 53, __pyx_L1_error)
7934 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_box, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 53, __pyx_L1_error)
76957935
76967936 /* "pygame_sdl2/gfxdraw.pyx":59
76977937 * boxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, c.r, c.g, c.b, c.a)
77037943 __pyx_tuple__13 = PyTuple_Pack(5, __pyx_n_s_surface, __pyx_n_s_rect, __pyx_n_s_rad, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 59, __pyx_L1_error)
77047944 __Pyx_GOTREF(__pyx_tuple__13);
77057945 __Pyx_GIVEREF(__pyx_tuple__13);
7706 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_rounded_box, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 59, __pyx_L1_error)
7946 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_rounded_box, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 59, __pyx_L1_error)
77077947
77087948 /* "pygame_sdl2/gfxdraw.pyx":65
77097949 * roundedBoxRGBA(surface.surface, rect.x, rect.y, rect.x + rect.w, rect.y + rect.h, rad, c.r, c.g, c.b, c.a)
77157955 __pyx_tuple__15 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 65, __pyx_L1_error)
77167956 __Pyx_GOTREF(__pyx_tuple__15);
77177957 __Pyx_GIVEREF(__pyx_tuple__15);
7718 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_line, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 65, __pyx_L1_error)
7958 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_line, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 65, __pyx_L1_error)
77197959
77207960 /* "pygame_sdl2/gfxdraw.pyx":69
77217961 * lineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
77277967 __pyx_tuple__17 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 69, __pyx_L1_error)
77287968 __Pyx_GOTREF(__pyx_tuple__17);
77297969 __Pyx_GIVEREF(__pyx_tuple__17);
7730 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aaline, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 69, __pyx_L1_error)
7970 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aaline, 69, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 69, __pyx_L1_error)
77317971
77327972 /* "pygame_sdl2/gfxdraw.pyx":73
77337973 * aalineRGBA(surface.surface, x1, y1, x2, y2, c.r, c.g, c.b, c.a)
77397979 __pyx_tuple__19 = PyTuple_Pack(12, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_width, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_x1int, __pyx_n_s_y1int, __pyx_n_s_x2int, __pyx_n_s_y2int); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 73, __pyx_L1_error)
77407980 __Pyx_GOTREF(__pyx_tuple__19);
77417981 __Pyx_GIVEREF(__pyx_tuple__19);
7742 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(7, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_thick_line, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 73, __pyx_L1_error)
7982 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(7, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_thick_line, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 73, __pyx_L1_error)
77437983
77447984 /* "pygame_sdl2/gfxdraw.pyx":90
77457985 * thickLineRGBA(surface.surface, x1int, y1int, x2int, y2int, width, c.r, c.g, c.b, c.a)
77517991 __pyx_tuple__21 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 90, __pyx_L1_error)
77527992 __Pyx_GOTREF(__pyx_tuple__21);
77537993 __Pyx_GIVEREF(__pyx_tuple__21);
7754 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_circle, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 90, __pyx_L1_error)
7994 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_circle, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 90, __pyx_L1_error)
77557995
77567996 /* "pygame_sdl2/gfxdraw.pyx":94
77577997 * circleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
77638003 __pyx_tuple__23 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 94, __pyx_L1_error)
77648004 __Pyx_GOTREF(__pyx_tuple__23);
77658005 __Pyx_GIVEREF(__pyx_tuple__23);
7766 __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(7, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_arc, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 94, __pyx_L1_error)
8006 __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(7, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_arc, 94, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 94, __pyx_L1_error)
77678007
77688008 /* "pygame_sdl2/gfxdraw.pyx":98
77698009 * arcRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
77758015 __pyx_tuple__25 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 98, __pyx_L1_error)
77768016 __Pyx_GOTREF(__pyx_tuple__25);
77778017 __Pyx_GIVEREF(__pyx_tuple__25);
7778 __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aacircle, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 98, __pyx_L1_error)
8018 __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aacircle, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 98, __pyx_L1_error)
77798019
77808020 /* "pygame_sdl2/gfxdraw.pyx":102
77818021 * aacircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
77878027 __pyx_tuple__27 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 102, __pyx_L1_error)
77888028 __Pyx_GOTREF(__pyx_tuple__27);
77898029 __Pyx_GIVEREF(__pyx_tuple__27);
7790 __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_circle, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 102, __pyx_L1_error)
8030 __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_circle, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 102, __pyx_L1_error)
77918031
77928032 /* "pygame_sdl2/gfxdraw.pyx":106
77938033 * filledCircleRGBA(surface.surface, x, y, r, c.r, c.g, c.b, c.a)
77998039 __pyx_tuple__29 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx, __pyx_n_s_ry, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 106, __pyx_L1_error)
78008040 __Pyx_GOTREF(__pyx_tuple__29);
78018041 __Pyx_GIVEREF(__pyx_tuple__29);
7802 __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_ellipse, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 106, __pyx_L1_error)
8042 __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_ellipse, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 106, __pyx_L1_error)
78038043
78048044 /* "pygame_sdl2/gfxdraw.pyx":110
78058045 * ellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
78118051 __pyx_tuple__31 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx, __pyx_n_s_ry, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 110, __pyx_L1_error)
78128052 __Pyx_GOTREF(__pyx_tuple__31);
78138053 __Pyx_GIVEREF(__pyx_tuple__31);
7814 __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aaellipse, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 110, __pyx_L1_error)
8054 __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aaellipse, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 110, __pyx_L1_error)
78158055
78168056 /* "pygame_sdl2/gfxdraw.pyx":114
78178057 * aaellipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
78238063 __pyx_tuple__33 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rx, __pyx_n_s_ry, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 114, __pyx_L1_error)
78248064 __Pyx_GOTREF(__pyx_tuple__33);
78258065 __Pyx_GIVEREF(__pyx_tuple__33);
7826 __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_ellipse, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 114, __pyx_L1_error)
8066 __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_ellipse, 114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 114, __pyx_L1_error)
78278067
78288068 /* "pygame_sdl2/gfxdraw.pyx":118
78298069 * filledEllipseRGBA(surface.surface, x, y, rx, ry, c.r, c.g, c.b, c.a)
78358075 __pyx_tuple__35 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 118, __pyx_L1_error)
78368076 __Pyx_GOTREF(__pyx_tuple__35);
78378077 __Pyx_GIVEREF(__pyx_tuple__35);
7838 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(7, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_pie, 118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 118, __pyx_L1_error)
8078 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(7, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_pie, 118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 118, __pyx_L1_error)
78398079
78408080 /* "pygame_sdl2/gfxdraw.pyx":122
78418081 * pieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
78478087 __pyx_tuple__37 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_start, __pyx_n_s_end, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 122, __pyx_L1_error)
78488088 __Pyx_GOTREF(__pyx_tuple__37);
78498089 __Pyx_GIVEREF(__pyx_tuple__37);
7850 __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(7, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_pie, 122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 122, __pyx_L1_error)
8090 __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(7, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_pie, 122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 122, __pyx_L1_error)
78518091
78528092 /* "pygame_sdl2/gfxdraw.pyx":126
78538093 * filledPieRGBA(surface.surface, x, y, r, start, end, c.r, c.g, c.b, c.a)
78598099 __pyx_tuple__39 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_x3, __pyx_n_s_y3, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 126, __pyx_L1_error)
78608100 __Pyx_GOTREF(__pyx_tuple__39);
78618101 __Pyx_GIVEREF(__pyx_tuple__39);
7862 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(8, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_trigon, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 126, __pyx_L1_error)
8102 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(8, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_trigon, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 126, __pyx_L1_error)
78638103
78648104 /* "pygame_sdl2/gfxdraw.pyx":130
78658105 * trigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
78718111 __pyx_tuple__41 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_x3, __pyx_n_s_y3, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 130, __pyx_L1_error)
78728112 __Pyx_GOTREF(__pyx_tuple__41);
78738113 __Pyx_GIVEREF(__pyx_tuple__41);
7874 __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(8, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aatrigon, 130, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 130, __pyx_L1_error)
8114 __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(8, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aatrigon, 130, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 130, __pyx_L1_error)
78758115
78768116 /* "pygame_sdl2/gfxdraw.pyx":134
78778117 * aatrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
78838123 __pyx_tuple__43 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_x3, __pyx_n_s_y3, __pyx_n_s_color, __pyx_n_s_c); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 134, __pyx_L1_error)
78848124 __Pyx_GOTREF(__pyx_tuple__43);
78858125 __Pyx_GIVEREF(__pyx_tuple__43);
7886 __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(8, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_trigon, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 134, __pyx_L1_error)
8126 __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(8, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_trigon, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 134, __pyx_L1_error)
78878127
78888128 /* "pygame_sdl2/gfxdraw.pyx":138
78898129 * filledTrigonRGBA(surface.surface, x1, y1, x2, y2, x3, y3, c.r, c.g, c.b, c.a)
78958135 __pyx_tuple__45 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 138, __pyx_L1_error)
78968136 __Pyx_GOTREF(__pyx_tuple__45);
78978137 __Pyx_GIVEREF(__pyx_tuple__45);
7898 __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_polygon, 138, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 138, __pyx_L1_error)
8138 __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_polygon, 138, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 138, __pyx_L1_error)
78998139
79008140 /* "pygame_sdl2/gfxdraw.pyx":151
79018141 * free(vy)
79078147 __pyx_tuple__47 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 151, __pyx_L1_error)
79088148 __Pyx_GOTREF(__pyx_tuple__47);
79098149 __Pyx_GIVEREF(__pyx_tuple__47);
7910 __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aapolygon, 151, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 151, __pyx_L1_error)
8150 __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_aapolygon, 151, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 151, __pyx_L1_error)
79118151
79128152 /* "pygame_sdl2/gfxdraw.pyx":164
79138153 * free(vy)
79198159 __pyx_tuple__49 = PyTuple_Pack(9, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 164, __pyx_L1_error)
79208160 __Pyx_GOTREF(__pyx_tuple__49);
79218161 __Pyx_GIVEREF(__pyx_tuple__49);
7922 __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_polygon, 164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 164, __pyx_L1_error)
8162 __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_filled_polygon, 164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 164, __pyx_L1_error)
79238163
79248164 /* "pygame_sdl2/gfxdraw.pyx":177
79258165 * free(vy)
79318171 __pyx_tuple__51 = PyTuple_Pack(10, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_texture, __pyx_n_s_tx, __pyx_n_s_ty, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 177, __pyx_L1_error)
79328172 __Pyx_GOTREF(__pyx_tuple__51);
79338173 __Pyx_GIVEREF(__pyx_tuple__51);
7934 __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_textured_polygon, 177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 177, __pyx_L1_error)
8174 __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_textured_polygon, 177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 177, __pyx_L1_error)
79358175
79368176 /* "pygame_sdl2/gfxdraw.pyx":189
79378177 * free(vy)
79438183 __pyx_tuple__53 = PyTuple_Pack(10, __pyx_n_s_surface, __pyx_n_s_points, __pyx_n_s_steps, __pyx_n_s_color, __pyx_n_s_c, __pyx_n_s_vx, __pyx_n_s_vy, __pyx_n_s_num_points, __pyx_n_s_n, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 189, __pyx_L1_error)
79448184 __Pyx_GOTREF(__pyx_tuple__53);
79458185 __Pyx_GIVEREF(__pyx_tuple__53);
7946 __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_bezier, 189, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 189, __pyx_L1_error)
8186 __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_gfxdraw_pyx, __pyx_n_s_bezier, 189, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 189, __pyx_L1_error)
79478187 __Pyx_RefNannyFinishContext();
79488188 return 0;
79498189 __pyx_L1_error:;
79588198 return -1;
79598199 }
79608200
8201 static int __Pyx_modinit_global_init_code(void); /*proto*/
8202 static int __Pyx_modinit_variable_export_code(void); /*proto*/
8203 static int __Pyx_modinit_function_export_code(void); /*proto*/
8204 static int __Pyx_modinit_type_init_code(void); /*proto*/
8205 static int __Pyx_modinit_type_import_code(void); /*proto*/
8206 static int __Pyx_modinit_variable_import_code(void); /*proto*/
8207 static int __Pyx_modinit_function_import_code(void); /*proto*/
8208
8209 static int __Pyx_modinit_global_init_code(void) {
8210 __Pyx_RefNannyDeclarations
8211 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
8212 /*--- Global init code ---*/
8213 __Pyx_RefNannyFinishContext();
8214 return 0;
8215 }
8216
8217 static int __Pyx_modinit_variable_export_code(void) {
8218 __Pyx_RefNannyDeclarations
8219 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
8220 /*--- Variable export code ---*/
8221 __Pyx_RefNannyFinishContext();
8222 return 0;
8223 }
8224
8225 static int __Pyx_modinit_function_export_code(void) {
8226 __Pyx_RefNannyDeclarations
8227 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
8228 /*--- Function export code ---*/
8229 __Pyx_RefNannyFinishContext();
8230 return 0;
8231 }
8232
8233 static int __Pyx_modinit_type_init_code(void) {
8234 __Pyx_RefNannyDeclarations
8235 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
8236 /*--- Type init code ---*/
8237 __Pyx_RefNannyFinishContext();
8238 return 0;
8239 }
8240
8241 static int __Pyx_modinit_type_import_code(void) {
8242 __Pyx_RefNannyDeclarations
8243 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
8244 /*--- Type import code ---*/
8245 __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
8246 __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
8247 __pyx_ptype_11pygame_sdl2_5color_Color = __Pyx_ImportType("pygame_sdl2.color", "Color", sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_5color_Color)) __PYX_ERR(2, 26, __pyx_L1_error)
8248 __pyx_vtabptr_11pygame_sdl2_5color_Color = (struct __pyx_vtabstruct_11pygame_sdl2_5color_Color*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_5color_Color->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_5color_Color)) __PYX_ERR(2, 26, __pyx_L1_error)
8249 __Pyx_RefNannyFinishContext();
8250 return 0;
8251 __pyx_L1_error:;
8252 __Pyx_RefNannyFinishContext();
8253 return -1;
8254 }
8255
8256 static int __Pyx_modinit_variable_import_code(void) {
8257 __Pyx_RefNannyDeclarations
8258 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
8259 /*--- Variable import code ---*/
8260 __Pyx_RefNannyFinishContext();
8261 return 0;
8262 }
8263
8264 static int __Pyx_modinit_function_import_code(void) {
8265 __Pyx_RefNannyDeclarations
8266 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
8267 /*--- Function import code ---*/
8268 __Pyx_RefNannyFinishContext();
8269 return 0;
8270 }
8271
8272
79618273 #if PY_MAJOR_VERSION < 3
7962 PyMODINIT_FUNC initgfxdraw(void); /*proto*/
7963 PyMODINIT_FUNC initgfxdraw(void)
8274 #ifdef CYTHON_NO_PYINIT_EXPORT
8275 #define __Pyx_PyMODINIT_FUNC void
79648276 #else
7965 PyMODINIT_FUNC PyInit_gfxdraw(void); /*proto*/
7966 PyMODINIT_FUNC PyInit_gfxdraw(void)
8277 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
8278 #endif
8279 #else
8280 #ifdef CYTHON_NO_PYINIT_EXPORT
8281 #define __Pyx_PyMODINIT_FUNC PyObject *
8282 #else
8283 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
8284 #endif
8285 #endif
8286 #ifndef CYTHON_SMALL_CODE
8287 #if defined(__clang__)
8288 #define CYTHON_SMALL_CODE
8289 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
8290 #define CYTHON_SMALL_CODE __attribute__((cold))
8291 #else
8292 #define CYTHON_SMALL_CODE
8293 #endif
8294 #endif
8295
8296
8297 #if PY_MAJOR_VERSION < 3
8298 __Pyx_PyMODINIT_FUNC initgfxdraw(void) CYTHON_SMALL_CODE; /*proto*/
8299 __Pyx_PyMODINIT_FUNC initgfxdraw(void)
8300 #else
8301 __Pyx_PyMODINIT_FUNC PyInit_gfxdraw(void) CYTHON_SMALL_CODE; /*proto*/
8302 __Pyx_PyMODINIT_FUNC PyInit_gfxdraw(void)
8303 #if CYTHON_PEP489_MULTI_PHASE_INIT
8304 {
8305 return PyModuleDef_Init(&__pyx_moduledef);
8306 }
8307 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
8308 PyObject *value = PyObject_GetAttrString(spec, from_name);
8309 int result = 0;
8310 if (likely(value)) {
8311 result = PyDict_SetItemString(moddict, to_name, value);
8312 Py_DECREF(value);
8313 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
8314 PyErr_Clear();
8315 } else {
8316 result = -1;
8317 }
8318 return result;
8319 }
8320 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
8321 PyObject *module = NULL, *moddict, *modname;
8322 if (__pyx_m)
8323 return __Pyx_NewRef(__pyx_m);
8324 modname = PyObject_GetAttrString(spec, "name");
8325 if (unlikely(!modname)) goto bad;
8326 module = PyModule_NewObject(modname);
8327 Py_DECREF(modname);
8328 if (unlikely(!module)) goto bad;
8329 moddict = PyModule_GetDict(module);
8330 if (unlikely(!moddict)) goto bad;
8331 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
8332 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
8333 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
8334 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
8335 return module;
8336 bad:
8337 Py_XDECREF(module);
8338 return NULL;
8339 }
8340
8341
8342 static int __pyx_pymod_exec_gfxdraw(PyObject *__pyx_pyinit_module)
8343 #endif
79678344 #endif
79688345 {
79698346 PyObject *__pyx_t_1 = NULL;
79708347 PyObject *__pyx_t_2 = NULL;
79718348 __Pyx_RefNannyDeclarations
8349 #if CYTHON_PEP489_MULTI_PHASE_INIT
8350 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
8351 #elif PY_MAJOR_VERSION >= 3
8352 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
8353 #endif
79728354 #if CYTHON_REFNANNY
7973 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
7974 if (!__Pyx_RefNanny) {
7975 PyErr_Clear();
7976 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
7977 if (!__Pyx_RefNanny)
7978 Py_FatalError("failed to import 'refnanny' module");
7979 }
7980 #endif
7981 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_gfxdraw(void)", 0);
8355 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
8356 if (!__Pyx_RefNanny) {
8357 PyErr_Clear();
8358 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
8359 if (!__Pyx_RefNanny)
8360 Py_FatalError("failed to import 'refnanny' module");
8361 }
8362 #endif
8363 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_gfxdraw(void)", 0);
79828364 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
79838365 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
79848366 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
79958377 #ifdef __Pyx_Generator_USED
79968378 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
79978379 #endif
8380 #ifdef __Pyx_AsyncGen_USED
8381 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8382 #endif
79988383 #ifdef __Pyx_StopAsyncIteration_USED
79998384 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
80008385 #endif
80068391 #endif
80078392 #endif
80088393 /*--- Module creation code ---*/
8394 #if CYTHON_PEP489_MULTI_PHASE_INIT
8395 __pyx_m = __pyx_pyinit_module;
8396 Py_INCREF(__pyx_m);
8397 #else
80098398 #if PY_MAJOR_VERSION < 3
80108399 __pyx_m = Py_InitModule4("gfxdraw", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
80118400 #else
80128401 __pyx_m = PyModule_Create(&__pyx_moduledef);
80138402 #endif
80148403 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
8404 #endif
80158405 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
80168406 Py_INCREF(__pyx_d);
80178407 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
8408 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
80188409 #if CYTHON_COMPILING_IN_PYPY
80198410 Py_INCREF(__pyx_b);
80208411 #endif
80398430 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
80408431 /*--- Constants init code ---*/
80418432 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8042 /*--- Global init code ---*/
8043 /*--- Variable export code ---*/
8044 /*--- Function export code ---*/
8045 /*--- Type init code ---*/
8046 /*--- Type import code ---*/
8047 __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
8048 __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
8049 __pyx_ptype_11pygame_sdl2_5color_Color = __Pyx_ImportType("pygame_sdl2.color", "Color", sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_5color_Color)) __PYX_ERR(2, 26, __pyx_L1_error)
8050 __pyx_vtabptr_11pygame_sdl2_5color_Color = (struct __pyx_vtabstruct_11pygame_sdl2_5color_Color*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_5color_Color->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_5color_Color)) __PYX_ERR(2, 26, __pyx_L1_error)
8051 /*--- Variable import code ---*/
8052 /*--- Function import code ---*/
8433 /*--- Global type/function init code ---*/
8434 (void)__Pyx_modinit_global_init_code();
8435 (void)__Pyx_modinit_variable_export_code();
8436 (void)__Pyx_modinit_function_export_code();
8437 (void)__Pyx_modinit_type_init_code();
8438 if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
8439 (void)__Pyx_modinit_variable_import_code();
8440 (void)__Pyx_modinit_function_import_code();
80538441 /*--- Execution code ---*/
80548442 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
80558443 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
84268814 * #
84278815 * # This software is provided 'as-is', without any express or implied
84288816 */
8429 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
8817 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
84308818 __Pyx_GOTREF(__pyx_t_1);
84318819 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
84328820 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
84398827 __Pyx_XDECREF(__pyx_t_2);
84408828 if (__pyx_m) {
84418829 if (__pyx_d) {
8442 __Pyx_AddTraceback("init pygame_sdl2.gfxdraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
8830 __Pyx_AddTraceback("init pygame_sdl2.gfxdraw", 0, __pyx_lineno, __pyx_filename);
84438831 }
84448832 Py_DECREF(__pyx_m); __pyx_m = 0;
84458833 } else if (!PyErr_Occurred()) {
84478835 }
84488836 __pyx_L0:;
84498837 __Pyx_RefNannyFinishContext();
8450 #if PY_MAJOR_VERSION < 3
8838 #if CYTHON_PEP489_MULTI_PHASE_INIT
8839 return (__pyx_m != NULL) ? 0 : -1;
8840 #elif PY_MAJOR_VERSION >= 3
8841 return __pyx_m;
8842 #else
84518843 return;
8452 #else
8453 return __pyx_m;
84548844 #endif
84558845 }
84568846
84698859 Py_XDECREF(p);
84708860 Py_XDECREF(m);
84718861 return (__Pyx_RefNannyAPIStruct *)r;
8862 }
8863 #endif
8864
8865 /* PyObjectGetAttrStr */
8866 #if CYTHON_USE_TYPE_SLOTS
8867 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
8868 PyTypeObject* tp = Py_TYPE(obj);
8869 if (likely(tp->tp_getattro))
8870 return tp->tp_getattro(obj, attr_name);
8871 #if PY_MAJOR_VERSION < 3
8872 if (likely(tp->tp_getattr))
8873 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
8874 #endif
8875 return PyObject_GetAttr(obj, attr_name);
84728876 }
84738877 #endif
84748878
86299033 }
86309034
86319035 /* ArgTypeTest */
8632 static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
8633 PyErr_Format(PyExc_TypeError,
8634 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
8635 name, type->tp_name, Py_TYPE(obj)->tp_name);
8636 }
8637 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
8638 const char *name, int exact)
9036 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
86399037 {
86409038 if (unlikely(!type)) {
86419039 PyErr_SetString(PyExc_SystemError, "Missing type object");
86429040 return 0;
86439041 }
8644 if (none_allowed && obj == Py_None) return 1;
86459042 else if (exact) {
8646 if (likely(Py_TYPE(obj) == type)) return 1;
86479043 #if PY_MAJOR_VERSION == 2
8648 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
9044 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
86499045 #endif
86509046 }
86519047 else {
8652 if (likely(PyObject_TypeCheck(obj, type))) return 1;
8653 }
8654 __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
9048 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
9049 }
9050 PyErr_Format(PyExc_TypeError,
9051 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
9052 name, type->tp_name, Py_TYPE(obj)->tp_name);
86559053 return 0;
86569054 }
9055
9056 /* PyCFunctionFastCall */
9057 #if CYTHON_FAST_PYCCALL
9058 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
9059 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
9060 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
9061 PyObject *self = PyCFunction_GET_SELF(func);
9062 int flags = PyCFunction_GET_FLAGS(func);
9063 assert(PyCFunction_Check(func));
9064 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
9065 assert(nargs >= 0);
9066 assert(nargs == 0 || args != NULL);
9067 /* _PyCFunction_FastCallDict() must not be called with an exception set,
9068 because it may clear it (directly or indirectly) and so the
9069 caller loses its exception */
9070 assert(!PyErr_Occurred());
9071 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
9072 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
9073 } else {
9074 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
9075 }
9076 }
9077 #endif
9078
9079 /* PyFunctionFastCall */
9080 #if CYTHON_FAST_PYCALL
9081 #include "frameobject.h"
9082 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
9083 PyObject *globals) {
9084 PyFrameObject *f;
9085 PyThreadState *tstate = __Pyx_PyThreadState_Current;
9086 PyObject **fastlocals;
9087 Py_ssize_t i;
9088 PyObject *result;
9089 assert(globals != NULL);
9090 /* XXX Perhaps we should create a specialized
9091 PyFrame_New() that doesn't take locals, but does
9092 take builtins without sanity checking them.
9093 */
9094 assert(tstate != NULL);
9095 f = PyFrame_New(tstate, co, globals, NULL);
9096 if (f == NULL) {
9097 return NULL;
9098 }
9099 fastlocals = f->f_localsplus;
9100 for (i = 0; i < na; i++) {
9101 Py_INCREF(*args);
9102 fastlocals[i] = *args++;
9103 }
9104 result = PyEval_EvalFrameEx(f,0);
9105 ++tstate->recursion_depth;
9106 Py_DECREF(f);
9107 --tstate->recursion_depth;
9108 return result;
9109 }
9110 #if 1 || PY_VERSION_HEX < 0x030600B1
9111 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
9112 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
9113 PyObject *globals = PyFunction_GET_GLOBALS(func);
9114 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
9115 PyObject *closure;
9116 #if PY_MAJOR_VERSION >= 3
9117 PyObject *kwdefs;
9118 #endif
9119 PyObject *kwtuple, **k;
9120 PyObject **d;
9121 Py_ssize_t nd;
9122 Py_ssize_t nk;
9123 PyObject *result;
9124 assert(kwargs == NULL || PyDict_Check(kwargs));
9125 nk = kwargs ? PyDict_Size(kwargs) : 0;
9126 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
9127 return NULL;
9128 }
9129 if (
9130 #if PY_MAJOR_VERSION >= 3
9131 co->co_kwonlyargcount == 0 &&
9132 #endif
9133 likely(kwargs == NULL || nk == 0) &&
9134 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
9135 if (argdefs == NULL && co->co_argcount == nargs) {
9136 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
9137 goto done;
9138 }
9139 else if (nargs == 0 && argdefs != NULL
9140 && co->co_argcount == Py_SIZE(argdefs)) {
9141 /* function called with no arguments, but all parameters have
9142 a default value: use default values as arguments .*/
9143 args = &PyTuple_GET_ITEM(argdefs, 0);
9144 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
9145 goto done;
9146 }
9147 }
9148 if (kwargs != NULL) {
9149 Py_ssize_t pos, i;
9150 kwtuple = PyTuple_New(2 * nk);
9151 if (kwtuple == NULL) {
9152 result = NULL;
9153 goto done;
9154 }
9155 k = &PyTuple_GET_ITEM(kwtuple, 0);
9156 pos = i = 0;
9157 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
9158 Py_INCREF(k[i]);
9159 Py_INCREF(k[i+1]);
9160 i += 2;
9161 }
9162 nk = i / 2;
9163 }
9164 else {
9165 kwtuple = NULL;
9166 k = NULL;
9167 }
9168 closure = PyFunction_GET_CLOSURE(func);
9169 #if PY_MAJOR_VERSION >= 3
9170 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
9171 #endif
9172 if (argdefs != NULL) {
9173 d = &PyTuple_GET_ITEM(argdefs, 0);
9174 nd = Py_SIZE(argdefs);
9175 }
9176 else {
9177 d = NULL;
9178 nd = 0;
9179 }
9180 #if PY_MAJOR_VERSION >= 3
9181 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
9182 args, nargs,
9183 k, (int)nk,
9184 d, (int)nd, kwdefs, closure);
9185 #else
9186 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
9187 args, nargs,
9188 k, (int)nk,
9189 d, (int)nd, closure);
9190 #endif
9191 Py_XDECREF(kwtuple);
9192 done:
9193 Py_LeaveRecursiveCall();
9194 return result;
9195 }
9196 #endif
9197 #endif
86579198
86589199 /* PyObjectCall */
86599200 #if CYTHON_COMPILING_IN_CPYTHON
86759216 }
86769217 #endif
86779218
8678 /* GetModuleGlobalName */
8679 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
8680 PyObject *result;
8681 #if !CYTHON_AVOID_BORROWED_REFS
8682 result = PyDict_GetItem(__pyx_d, name);
8683 if (likely(result)) {
8684 Py_INCREF(result);
8685 } else {
8686 #else
8687 result = PyObject_GetItem(__pyx_d, name);
8688 if (!result) {
8689 PyErr_Clear();
8690 #endif
8691 result = __Pyx_GetBuiltinName(name);
8692 }
8693 return result;
8694 }
8695
8696 /* PyCFunctionFastCall */
8697 #if CYTHON_FAST_PYCCALL
8698 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
8699 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
8700 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
8701 PyObject *self = PyCFunction_GET_SELF(func);
8702 assert(PyCFunction_Check(func));
8703 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
8704 assert(nargs >= 0);
8705 assert(nargs == 0 || args != NULL);
8706 /* _PyCFunction_FastCallDict() must not be called with an exception set,
8707 because it may clear it (directly or indirectly) and so the
8708 caller loses its exception */
8709 assert(!PyErr_Occurred());
8710 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
8711 }
8712 #endif // CYTHON_FAST_PYCCALL
8713
8714 /* PyFunctionFastCall */
8715 #if CYTHON_FAST_PYCALL
8716 #include "frameobject.h"
8717 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
8718 PyObject *globals) {
8719 PyFrameObject *f;
8720 PyThreadState *tstate = PyThreadState_GET();
8721 PyObject **fastlocals;
8722 Py_ssize_t i;
8723 PyObject *result;
8724 assert(globals != NULL);
8725 /* XXX Perhaps we should create a specialized
8726 PyFrame_New() that doesn't take locals, but does
8727 take builtins without sanity checking them.
8728 */
8729 assert(tstate != NULL);
8730 f = PyFrame_New(tstate, co, globals, NULL);
8731 if (f == NULL) {
8732 return NULL;
8733 }
8734 fastlocals = f->f_localsplus;
8735 for (i = 0; i < na; i++) {
8736 Py_INCREF(*args);
8737 fastlocals[i] = *args++;
8738 }
8739 result = PyEval_EvalFrameEx(f,0);
8740 ++tstate->recursion_depth;
8741 Py_DECREF(f);
8742 --tstate->recursion_depth;
8743 return result;
8744 }
8745 #if 1 || PY_VERSION_HEX < 0x030600B1
8746 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
8747 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
8748 PyObject *globals = PyFunction_GET_GLOBALS(func);
8749 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
8750 PyObject *closure;
8751 #if PY_MAJOR_VERSION >= 3
8752 PyObject *kwdefs;
8753 #endif
8754 PyObject *kwtuple, **k;
8755 PyObject **d;
8756 Py_ssize_t nd;
8757 Py_ssize_t nk;
8758 PyObject *result;
8759 assert(kwargs == NULL || PyDict_Check(kwargs));
8760 nk = kwargs ? PyDict_Size(kwargs) : 0;
8761 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
8762 return NULL;
8763 }
8764 if (
8765 #if PY_MAJOR_VERSION >= 3
8766 co->co_kwonlyargcount == 0 &&
8767 #endif
8768 likely(kwargs == NULL || nk == 0) &&
8769 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
8770 if (argdefs == NULL && co->co_argcount == nargs) {
8771 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
8772 goto done;
8773 }
8774 else if (nargs == 0 && argdefs != NULL
8775 && co->co_argcount == Py_SIZE(argdefs)) {
8776 /* function called with no arguments, but all parameters have
8777 a default value: use default values as arguments .*/
8778 args = &PyTuple_GET_ITEM(argdefs, 0);
8779 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
8780 goto done;
8781 }
8782 }
8783 if (kwargs != NULL) {
8784 Py_ssize_t pos, i;
8785 kwtuple = PyTuple_New(2 * nk);
8786 if (kwtuple == NULL) {
8787 result = NULL;
8788 goto done;
8789 }
8790 k = &PyTuple_GET_ITEM(kwtuple, 0);
8791 pos = i = 0;
8792 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
8793 Py_INCREF(k[i]);
8794 Py_INCREF(k[i+1]);
8795 i += 2;
8796 }
8797 nk = i / 2;
8798 }
8799 else {
8800 kwtuple = NULL;
8801 k = NULL;
8802 }
8803 closure = PyFunction_GET_CLOSURE(func);
8804 #if PY_MAJOR_VERSION >= 3
8805 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
8806 #endif
8807 if (argdefs != NULL) {
8808 d = &PyTuple_GET_ITEM(argdefs, 0);
8809 nd = Py_SIZE(argdefs);
8810 }
8811 else {
8812 d = NULL;
8813 nd = 0;
8814 }
8815 #if PY_MAJOR_VERSION >= 3
8816 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
8817 args, nargs,
8818 k, (int)nk,
8819 d, (int)nd, kwdefs, closure);
8820 #else
8821 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
8822 args, nargs,
8823 k, (int)nk,
8824 d, (int)nd, closure);
8825 #endif
8826 Py_XDECREF(kwtuple);
8827 done:
8828 Py_LeaveRecursiveCall();
8829 return result;
8830 }
8831 #endif // CPython < 3.6
8832 #endif // CYTHON_FAST_PYCALL
8833
88349219 /* PyObjectCallMethO */
8835 #if CYTHON_COMPILING_IN_CPYTHON
9220 #if CYTHON_COMPILING_IN_CPYTHON
88369221 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
88379222 PyObject *self, *result;
88389223 PyCFunction cfunc;
88529237 #endif
88539238
88549239 /* PyObjectCallOneArg */
8855 #if CYTHON_COMPILING_IN_CPYTHON
9240 #if CYTHON_COMPILING_IN_CPYTHON
88569241 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
88579242 PyObject *result;
88589243 PyObject *args = PyTuple_New(1);
88699254 return __Pyx_PyFunction_FastCall(func, &arg, 1);
88709255 }
88719256 #endif
8872 #ifdef __Pyx_CyFunction_USED
8873 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
8874 #else
88759257 if (likely(PyCFunction_Check(func))) {
8876 #endif
88779258 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
88789259 return __Pyx_PyObject_CallMethO(func, arg);
88799260 #if CYTHON_FAST_PYCCALL
88959276 }
88969277 #endif
88979278
9279 /* GetModuleGlobalName */
9280 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
9281 PyObject *result;
9282 #if !CYTHON_AVOID_BORROWED_REFS
9283 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
9284 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
9285 if (likely(result)) {
9286 Py_INCREF(result);
9287 } else if (unlikely(PyErr_Occurred())) {
9288 result = NULL;
9289 } else {
9290 #else
9291 result = PyDict_GetItem(__pyx_d, name);
9292 if (likely(result)) {
9293 Py_INCREF(result);
9294 } else {
9295 #endif
9296 #else
9297 result = PyObject_GetItem(__pyx_d, name);
9298 if (!result) {
9299 PyErr_Clear();
9300 #endif
9301 result = __Pyx_GetBuiltinName(name);
9302 }
9303 return result;
9304 }
9305
88989306 /* RaiseTooManyValuesToUnpack */
88999307 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
89009308 PyErr_Format(PyExc_ValueError,
89119319 /* IterFinish */
89129320 static CYTHON_INLINE int __Pyx_IterFinish(void) {
89139321 #if CYTHON_FAST_THREAD_STATE
8914 PyThreadState *tstate = PyThreadState_GET();
9322 PyThreadState *tstate = __Pyx_PyThreadState_Current;
89159323 PyObject* exc_type = tstate->curexc_type;
89169324 if (unlikely(exc_type)) {
8917 if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
9325 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
89189326 PyObject *exc_value, *exc_tb;
89199327 exc_value = tstate->curexc_value;
89209328 exc_tb = tstate->curexc_traceback;
89559363 return 0;
89569364 }
89579365
9366 /* GetItemInt */
9367 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
9368 PyObject *r;
9369 if (!j) return NULL;
9370 r = PyObject_GetItem(o, j);
9371 Py_DECREF(j);
9372 return r;
9373 }
9374 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
9375 CYTHON_NCP_UNUSED int wraparound,
9376 CYTHON_NCP_UNUSED int boundscheck) {
9377 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9378 Py_ssize_t wrapped_i = i;
9379 if (wraparound & unlikely(i < 0)) {
9380 wrapped_i += PyList_GET_SIZE(o);
9381 }
9382 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
9383 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
9384 Py_INCREF(r);
9385 return r;
9386 }
9387 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
9388 #else
9389 return PySequence_GetItem(o, i);
9390 #endif
9391 }
9392 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
9393 CYTHON_NCP_UNUSED int wraparound,
9394 CYTHON_NCP_UNUSED int boundscheck) {
9395 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9396 Py_ssize_t wrapped_i = i;
9397 if (wraparound & unlikely(i < 0)) {
9398 wrapped_i += PyTuple_GET_SIZE(o);
9399 }
9400 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
9401 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
9402 Py_INCREF(r);
9403 return r;
9404 }
9405 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
9406 #else
9407 return PySequence_GetItem(o, i);
9408 #endif
9409 }
9410 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
9411 CYTHON_NCP_UNUSED int wraparound,
9412 CYTHON_NCP_UNUSED int boundscheck) {
9413 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
9414 if (is_list || PyList_CheckExact(o)) {
9415 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
9416 if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
9417 PyObject *r = PyList_GET_ITEM(o, n);
9418 Py_INCREF(r);
9419 return r;
9420 }
9421 }
9422 else if (PyTuple_CheckExact(o)) {
9423 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
9424 if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
9425 PyObject *r = PyTuple_GET_ITEM(o, n);
9426 Py_INCREF(r);
9427 return r;
9428 }
9429 } else {
9430 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
9431 if (likely(m && m->sq_item)) {
9432 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
9433 Py_ssize_t l = m->sq_length(o);
9434 if (likely(l >= 0)) {
9435 i += l;
9436 } else {
9437 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
9438 return NULL;
9439 PyErr_Clear();
9440 }
9441 }
9442 return m->sq_item(o, i);
9443 }
9444 }
9445 #else
9446 if (is_list || PySequence_Check(o)) {
9447 return PySequence_GetItem(o, i);
9448 }
9449 #endif
9450 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
9451 }
9452
9453 /* ObjectGetItem */
9454 #if CYTHON_USE_TYPE_SLOTS
9455 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
9456 PyObject *runerr;
9457 Py_ssize_t key_value;
9458 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
9459 if (unlikely(!(m && m->sq_item))) {
9460 PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
9461 return NULL;
9462 }
9463 key_value = __Pyx_PyIndex_AsSsize_t(index);
9464 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
9465 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
9466 }
9467 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
9468 PyErr_Clear();
9469 PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
9470 }
9471 return NULL;
9472 }
9473 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
9474 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
9475 if (likely(m && m->mp_subscript)) {
9476 return m->mp_subscript(obj, key);
9477 }
9478 return __Pyx_PyObject_GetIndex(obj, key);
9479 }
9480 #endif
9481
89589482 /* GetVTable */
89599483 static void* __Pyx_GetVtable(PyObject *dict) {
89609484 void* ptr;
89829506 PyObject *global_dict = 0;
89839507 PyObject *empty_dict = 0;
89849508 PyObject *list;
8985 #if PY_VERSION_HEX < 0x03030000
9509 #if PY_MAJOR_VERSION < 3
89869510 PyObject *py_import;
89879511 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
89889512 if (!py_import)
90069530 #if PY_MAJOR_VERSION >= 3
90079531 if (level == -1) {
90089532 if (strchr(__Pyx_MODULE_NAME, '.')) {
9009 #if PY_VERSION_HEX < 0x03030000
9010 PyObject *py_level = PyInt_FromLong(1);
9011 if (!py_level)
9012 goto bad;
9013 module = PyObject_CallFunctionObjArgs(py_import,
9014 name, global_dict, empty_dict, list, py_level, NULL);
9015 Py_DECREF(py_level);
9016 #else
90179533 module = PyImport_ImportModuleLevelObject(
90189534 name, global_dict, empty_dict, list, 1);
9019 #endif
90209535 if (!module) {
90219536 if (!PyErr_ExceptionMatches(PyExc_ImportError))
90229537 goto bad;
90279542 }
90289543 #endif
90299544 if (!module) {
9030 #if PY_VERSION_HEX < 0x03030000
9545 #if PY_MAJOR_VERSION < 3
90319546 PyObject *py_level = PyInt_FromLong(level);
90329547 if (!py_level)
90339548 goto bad;
90419556 }
90429557 }
90439558 bad:
9044 #if PY_VERSION_HEX < 0x03030000
9559 #if PY_MAJOR_VERSION < 3
90459560 Py_XDECREF(py_import);
90469561 #endif
90479562 Py_XDECREF(empty_list);
90629577 }
90639578 return value;
90649579 }
9580
9581 /* PyErrFetchRestore */
9582 #if CYTHON_FAST_THREAD_STATE
9583 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
9584 PyObject *tmp_type, *tmp_value, *tmp_tb;
9585 tmp_type = tstate->curexc_type;
9586 tmp_value = tstate->curexc_value;
9587 tmp_tb = tstate->curexc_traceback;
9588 tstate->curexc_type = type;
9589 tstate->curexc_value = value;
9590 tstate->curexc_traceback = tb;
9591 Py_XDECREF(tmp_type);
9592 Py_XDECREF(tmp_value);
9593 Py_XDECREF(tmp_tb);
9594 }
9595 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
9596 *type = tstate->curexc_type;
9597 *value = tstate->curexc_value;
9598 *tb = tstate->curexc_traceback;
9599 tstate->curexc_type = 0;
9600 tstate->curexc_value = 0;
9601 tstate->curexc_traceback = 0;
9602 }
9603 #endif
9604
9605 /* CLineInTraceback */
9606 #ifndef CYTHON_CLINE_IN_TRACEBACK
9607 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
9608 PyObject *use_cline;
9609 PyObject *ptype, *pvalue, *ptraceback;
9610 #if CYTHON_COMPILING_IN_CPYTHON
9611 PyObject **cython_runtime_dict;
9612 #endif
9613 if (unlikely(!__pyx_cython_runtime)) {
9614 return c_line;
9615 }
9616 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
9617 #if CYTHON_COMPILING_IN_CPYTHON
9618 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
9619 if (likely(cython_runtime_dict)) {
9620 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
9621 } else
9622 #endif
9623 {
9624 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
9625 if (use_cline_obj) {
9626 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
9627 Py_DECREF(use_cline_obj);
9628 } else {
9629 PyErr_Clear();
9630 use_cline = NULL;
9631 }
9632 }
9633 if (!use_cline) {
9634 c_line = 0;
9635 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
9636 }
9637 else if (PyObject_Not(use_cline) != 0) {
9638 c_line = 0;
9639 }
9640 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
9641 return c_line;
9642 }
9643 #endif
90659644
90669645 /* CodeObjectCache */
90679646 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
92039782 int py_line, const char *filename) {
92049783 PyCodeObject *py_code = 0;
92059784 PyFrameObject *py_frame = 0;
9206 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
9785 PyThreadState *tstate = __Pyx_PyThreadState_Current;
9786 if (c_line) {
9787 c_line = __Pyx_CLineForTraceback(tstate, c_line);
9788 }
9789 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
92079790 if (!py_code) {
92089791 py_code = __Pyx_CreateCodeObjectForTraceback(
92099792 funcname, c_line, py_line, filename);
92109793 if (!py_code) goto bad;
9211 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
9794 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
92129795 }
92139796 py_frame = PyFrame_New(
9214 PyThreadState_GET(), /*PyThreadState *tstate,*/
9215 py_code, /*PyCodeObject *code,*/
9216 __pyx_d, /*PyObject *globals,*/
9217 0 /*PyObject *locals*/
9797 tstate, /*PyThreadState *tstate,*/
9798 py_code, /*PyCodeObject *code,*/
9799 __pyx_d, /*PyObject *globals,*/
9800 0 /*PyObject *locals*/
92189801 );
92199802 if (!py_frame) goto bad;
92209803 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
1003310616 return (long) -1;
1003410617 }
1003510618
10619 /* FastTypeChecks */
10620 #if CYTHON_COMPILING_IN_CPYTHON
10621 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
10622 while (a) {
10623 a = a->tp_base;
10624 if (a == b)
10625 return 1;
10626 }
10627 return b == &PyBaseObject_Type;
10628 }
10629 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
10630 PyObject *mro;
10631 if (a == b) return 1;
10632 mro = a->tp_mro;
10633 if (likely(mro)) {
10634 Py_ssize_t i, n;
10635 n = PyTuple_GET_SIZE(mro);
10636 for (i = 0; i < n; i++) {
10637 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
10638 return 1;
10639 }
10640 return 0;
10641 }
10642 return __Pyx_InBases(a, b);
10643 }
10644 #if PY_MAJOR_VERSION == 2
10645 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
10646 PyObject *exception, *value, *tb;
10647 int res;
10648 __Pyx_PyThreadState_declare
10649 __Pyx_PyThreadState_assign
10650 __Pyx_ErrFetch(&exception, &value, &tb);
10651 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
10652 if (unlikely(res == -1)) {
10653 PyErr_WriteUnraisable(err);
10654 res = 0;
10655 }
10656 if (!res) {
10657 res = PyObject_IsSubclass(err, exc_type2);
10658 if (unlikely(res == -1)) {
10659 PyErr_WriteUnraisable(err);
10660 res = 0;
10661 }
10662 }
10663 __Pyx_ErrRestore(exception, value, tb);
10664 return res;
10665 }
10666 #else
10667 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
10668 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
10669 if (!res) {
10670 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
10671 }
10672 return res;
10673 }
10674 #endif
10675 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
10676 Py_ssize_t i, n;
10677 assert(PyExceptionClass_Check(exc_type));
10678 n = PyTuple_GET_SIZE(tuple);
10679 #if PY_MAJOR_VERSION >= 3
10680 for (i=0; i<n; i++) {
10681 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
10682 }
10683 #endif
10684 for (i=0; i<n; i++) {
10685 PyObject *t = PyTuple_GET_ITEM(tuple, i);
10686 #if PY_MAJOR_VERSION < 3
10687 if (likely(exc_type == t)) return 1;
10688 #endif
10689 if (likely(PyExceptionClass_Check(t))) {
10690 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
10691 } else {
10692 }
10693 }
10694 return 0;
10695 }
10696 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
10697 if (likely(err == exc_type)) return 1;
10698 if (likely(PyExceptionClass_Check(err))) {
10699 if (likely(PyExceptionClass_Check(exc_type))) {
10700 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
10701 } else if (likely(PyTuple_Check(exc_type))) {
10702 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
10703 } else {
10704 }
10705 }
10706 return PyErr_GivenExceptionMatches(err, exc_type);
10707 }
10708 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
10709 assert(PyExceptionClass_Check(exc_type1));
10710 assert(PyExceptionClass_Check(exc_type2));
10711 if (likely(err == exc_type1 || err == exc_type2)) return 1;
10712 if (likely(PyExceptionClass_Check(err))) {
10713 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
10714 }
10715 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
10716 }
10717 #endif
10718
1003610719 /* CheckBinaryVersion */
1003710720 static int __Pyx_check_binary_version(void) {
1003810721 char ctversion[4], rtversion[4];
1015810841 #endif
1015910842 if (!*t->p)
1016010843 return -1;
10844 if (PyObject_Hash(*t->p) == -1)
10845 return -1;
1016110846 ++t;
1016210847 }
1016310848 return 0;
1016610851 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
1016710852 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
1016810853 }
10169 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
10854 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
1017010855 Py_ssize_t ignore;
1017110856 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
1017210857 }
10173 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
10174 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
10858 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
10859 #if !CYTHON_PEP393_ENABLED
10860 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
10861 char* defenc_c;
10862 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
10863 if (!defenc) return NULL;
10864 defenc_c = PyBytes_AS_STRING(defenc);
10865 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
10866 {
10867 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
10868 char* c;
10869 for (c = defenc_c; c < end; c++) {
10870 if ((unsigned char) (*c) >= 128) {
10871 PyUnicode_AsASCIIString(o);
10872 return NULL;
10873 }
10874 }
10875 }
10876 #endif
10877 *length = PyBytes_GET_SIZE(defenc);
10878 return defenc_c;
10879 }
10880 #else
10881 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
10882 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
10883 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
10884 if (likely(PyUnicode_IS_ASCII(o))) {
10885 *length = PyUnicode_GET_LENGTH(o);
10886 return PyUnicode_AsUTF8(o);
10887 } else {
10888 PyUnicode_AsASCIIString(o);
10889 return NULL;
10890 }
10891 #else
10892 return PyUnicode_AsUTF8AndSize(o, length);
10893 #endif
10894 }
10895 #endif
10896 #endif
10897 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
10898 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1017510899 if (
1017610900 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1017710901 __Pyx_sys_getdefaultencoding_not_ascii &&
1017810902 #endif
1017910903 PyUnicode_Check(o)) {
10180 #if PY_VERSION_HEX < 0x03030000
10181 char* defenc_c;
10182 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
10183 if (!defenc) return NULL;
10184 defenc_c = PyBytes_AS_STRING(defenc);
10185 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
10186 {
10187 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
10188 char* c;
10189 for (c = defenc_c; c < end; c++) {
10190 if ((unsigned char) (*c) >= 128) {
10191 PyUnicode_AsASCIIString(o);
10192 return NULL;
10193 }
10194 }
10195 }
10196 #endif
10197 *length = PyBytes_GET_SIZE(defenc);
10198 return defenc_c;
10199 #else
10200 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
10201 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
10202 if (PyUnicode_IS_ASCII(o)) {
10203 *length = PyUnicode_GET_LENGTH(o);
10204 return PyUnicode_AsUTF8(o);
10205 } else {
10206 PyUnicode_AsASCIIString(o);
10207 return NULL;
10208 }
10209 #else
10210 return PyUnicode_AsUTF8AndSize(o, length);
10211 #endif
10212 #endif
10904 return __Pyx_PyUnicode_AsStringAndSize(o, length);
1021310905 } else
1021410906 #endif
1021510907 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
1023310925 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
1023410926 else return PyObject_IsTrue(x);
1023510927 }
10928 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
10929 #if PY_MAJOR_VERSION >= 3
10930 if (PyLong_Check(result)) {
10931 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
10932 "__int__ returned non-int (type %.200s). "
10933 "The ability to return an instance of a strict subclass of int "
10934 "is deprecated, and may be removed in a future version of Python.",
10935 Py_TYPE(result)->tp_name)) {
10936 Py_DECREF(result);
10937 return NULL;
10938 }
10939 return result;
10940 }
10941 #endif
10942 PyErr_Format(PyExc_TypeError,
10943 "__%.4s__ returned non-%.4s (type %.200s)",
10944 type_name, type_name, Py_TYPE(result)->tp_name);
10945 Py_DECREF(result);
10946 return NULL;
10947 }
1023610948 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
1023710949 #if CYTHON_USE_TYPE_SLOTS
1023810950 PyNumberMethods *m;
1024010952 const char *name = NULL;
1024110953 PyObject *res = NULL;
1024210954 #if PY_MAJOR_VERSION < 3
10243 if (PyInt_Check(x) || PyLong_Check(x))
10955 if (likely(PyInt_Check(x) || PyLong_Check(x)))
1024410956 #else
10245 if (PyLong_Check(x))
10957 if (likely(PyLong_Check(x)))
1024610958 #endif
1024710959 return __Pyx_NewRef(x);
1024810960 #if CYTHON_USE_TYPE_SLOTS
1025010962 #if PY_MAJOR_VERSION < 3
1025110963 if (m && m->nb_int) {
1025210964 name = "int";
10253 res = PyNumber_Int(x);
10965 res = m->nb_int(x);
1025410966 }
1025510967 else if (m && m->nb_long) {
1025610968 name = "long";
10257 res = PyNumber_Long(x);
10969 res = m->nb_long(x);
1025810970 }
1025910971 #else
10260 if (m && m->nb_int) {
10972 if (likely(m && m->nb_int)) {
1026110973 name = "int";
10262 res = PyNumber_Long(x);
10974 res = m->nb_int(x);
1026310975 }
1026410976 #endif
1026510977 #else
10266 res = PyNumber_Int(x);
10267 #endif
10268 if (res) {
10978 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
10979 res = PyNumber_Int(x);
10980 }
10981 #endif
10982 if (likely(res)) {
1026910983 #if PY_MAJOR_VERSION < 3
10270 if (!PyInt_Check(res) && !PyLong_Check(res)) {
10984 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
1027110985 #else
10272 if (!PyLong_Check(res)) {
10273 #endif
10274 PyErr_Format(PyExc_TypeError,
10275 "__%.4s__ returned non-%.4s (type %.200s)",
10276 name, name, Py_TYPE(res)->tp_name);
10277 Py_DECREF(res);
10278 return NULL;
10986 if (unlikely(!PyLong_CheckExact(res))) {
10987 #endif
10988 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
1027910989 }
1028010990 }
1028110991 else if (!PyErr_Occurred()) {
1034611056 Py_DECREF(x);
1034711057 return ival;
1034811058 }
11059 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
11060 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
11061 }
1034911062 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
1035011063 return PyInt_FromSize_t(ival);
1035111064 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
8 #else
9 #define CYTHON_ABI "0_25_2"
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
8 #else
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
102120 #define CYTHON_COMPILING_IN_CPYTHON 1
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
105129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
409549 { \
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420552
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
428560
429561 #define __PYX_HAVE__pygame_sdl2__image
430562 #define __PYX_HAVE_API__pygame_sdl2__image
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
440573 #include <omp.h>
441574 #endif /* _OPENMP */
442575
443 #ifdef PYREX_WITHOUT_ASSERTIONS
576 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
444577 #define CYTHON_WITHOUT_ASSERTIONS
445578 #endif
446579
471604 #define __Pyx_sst_abs(value) abs(value)
472605 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
473606 #define __Pyx_sst_abs(value) labs(value)
474 #elif defined (_MSC_VER) && defined (_M_X64)
475 #define __Pyx_sst_abs(value) _abs64(value)
607 #elif defined (_MSC_VER)
608 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
476609 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
477610 #define __Pyx_sst_abs(value) llabs(value)
478611 #elif defined (__GNUC__)
480613 #else
481614 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
482615 #endif
483 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
484 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
616 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
617 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
485618 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
486619 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
487620 #define __Pyx_PyBytes_FromString PyBytes_FromString
494627 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
495628 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
496629 #endif
497 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
498 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
630 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
634 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
635 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
636 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
638 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
639 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
640 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
499641 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
500642 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
501643 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
502644 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
503645 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
504 #if PY_MAJOR_VERSION < 3
505 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
506 {
646 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
507647 const Py_UNICODE *u_end = u;
508648 while (*u_end++) ;
509649 return (size_t)(u_end - u - 1);
510650 }
511 #else
512 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
513 #endif
514651 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
515652 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
516653 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
517654 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
518655 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
519 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
656 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
520657 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
521658 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
659 #define __Pyx_PySequence_Tuple(obj)\
660 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
522661 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
523662 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
524663 #if CYTHON_ASSUME_SAFE_MACROS
617756 #define likely(x) (x)
618757 #define unlikely(x) (x)
619758 #endif /* __GNUC__ */
620
621 static PyObject *__pyx_m;
759 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
760
761 static PyObject *__pyx_m = NULL;
622762 static PyObject *__pyx_d;
623763 static PyObject *__pyx_b;
764 static PyObject *__pyx_cython_runtime = NULL;
624765 static PyObject *__pyx_empty_tuple;
625766 static PyObject *__pyx_empty_bytes;
626767 static PyObject *__pyx_empty_unicode;
634775 "src/pygame_sdl2/image.pyx",
635776 "src/pygame_sdl2/surface.pxd",
636777 };
778 /* NoFastGil.proto */
779 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
780 #define __Pyx_PyGILState_Release PyGILState_Release
781 #define __Pyx_FastGIL_Remember()
782 #define __Pyx_FastGIL_Forget()
783 #define __Pyx_FastGilFuncInit()
784
785 /* ForceInitThreads.proto */
786 #ifndef __PYX_FORCE_INIT_THREADS
787 #define __PYX_FORCE_INIT_THREADS 0
788 #endif
789
637790
638791 /*--- Type declarations ---*/
639792 struct __pyx_obj_11pygame_sdl2_7surface_Surface;
746899
747900 /* PyObjectGetAttrStr.proto */
748901 #if CYTHON_USE_TYPE_SLOTS
749 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
750 PyTypeObject* tp = Py_TYPE(obj);
751 if (likely(tp->tp_getattro))
752 return tp->tp_getattro(obj, attr_name);
753 #if PY_MAJOR_VERSION < 3
754 if (likely(tp->tp_getattr))
755 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
756 #endif
757 return PyObject_GetAttr(obj, attr_name);
758 }
902 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
759903 #else
760904 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
761905 #endif
809953 /* PyThreadStateGet.proto */
810954 #if CYTHON_FAST_THREAD_STATE
811955 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
812 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
956 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
957 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
813958 #else
814959 #define __Pyx_PyThreadState_declare
815960 #define __Pyx_PyThreadState_assign
961 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
816962 #endif
817963
818964 /* PyErrFetchRestore.proto */
819965 #if CYTHON_FAST_THREAD_STATE
966 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
820967 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
821968 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
822969 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
823970 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
824971 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
825972 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
826 #else
973 #if CYTHON_COMPILING_IN_CPYTHON
974 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
975 #else
976 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
977 #endif
978 #else
979 #define __Pyx_PyErr_Clear() PyErr_Clear()
980 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
827981 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
828982 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
983 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
984 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
829985 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
830986 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
831987 #endif
8511007 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
8521008 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
8531009 int wraparound, int boundscheck);
854 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1010 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
8551011 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
8561012 int is_list, int wraparound, int boundscheck);
8571013
8931049 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
8941050 #endif
8951051
896 /* PyErrExceptionMatches.proto */
897 #if CYTHON_FAST_THREAD_STATE
898 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
899 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
900 #else
901 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
902 #endif
1052 /* FastTypeChecks.proto */
1053 #if CYTHON_COMPILING_IN_CPYTHON
1054 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1055 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1056 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1057 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1058 #else
1059 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1060 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1061 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1062 #endif
1063 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
9031064
9041065 /* GetException.proto */
9051066 #if CYTHON_FAST_THREAD_STATE
9101071 #endif
9111072
9121073 /* ArgTypeTest.proto */
913 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
914 const char *name, int exact);
1074 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1075 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1076 __Pyx__ArgTypeTest(obj, type, name, exact))
1077 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
9151078
9161079 /* GetVTable.proto */
9171080 static void* __Pyx_GetVtable(PyObject *dict);
9211084
9221085 /* ImportFrom.proto */
9231086 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1087
1088 /* CLineInTraceback.proto */
1089 #ifdef CYTHON_CLINE_IN_TRACEBACK
1090 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1091 #else
1092 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1093 #endif
9241094
9251095 /* CodeObjectCache.proto */
9261096 typedef struct {
9441114 /* CIntToPy.proto */
9451115 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
9461116
947 /* ForceInitThreads.proto */
948 #ifndef __PYX_FORCE_INIT_THREADS
949 #define __PYX_FORCE_INIT_THREADS 0
950 #endif
951
9521117 /* CIntFromPy.proto */
9531118 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
9541119
10021167 static int __pyx_v_11pygame_sdl2_5image_image_formats;
10031168 static PyObject *__pyx_f_11pygame_sdl2_5image_process_namehint(PyObject *); /*proto*/
10041169 #define __Pyx_MODULE_NAME "pygame_sdl2.image"
1170 extern int __pyx_module_is_main_pygame_sdl2__image;
10051171 int __pyx_module_is_main_pygame_sdl2__image = 0;
10061172
10071173 /* Implementation of 'pygame_sdl2.image' */
10581224 static const char __pyx_k_filesystem_encode[] = "filesystem_encode";
10591225 static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error";
10601226 static const char __pyx_k_pygame_sdl2_image[] = "pygame_sdl2.image";
1227 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
10611228 static const char __pyx_k_pygame_sdl2_compat[] = "pygame_sdl2.compat";
10621229 static const char __pyx_k_Unsupported_format_s[] = "Unsupported format: %s";
10631230 static const char __pyx_k_src_pygame_sdl2_image_pyx[] = "src/pygame_sdl2/image.pyx";
10731240 static PyObject *__pyx_kp_b__3;
10741241 static PyObject *__pyx_n_u_ascii;
10751242 static PyObject *__pyx_n_s_bytes;
1243 static PyObject *__pyx_n_s_cline_in_traceback;
10761244 static PyObject *__pyx_n_s_compression;
10771245 static PyObject *__pyx_n_s_compression_level;
10781246 static PyObject *__pyx_n_s_convert;
11351303 static PyObject *__pyx_codeobj__10;
11361304 static PyObject *__pyx_codeobj__12;
11371305 static PyObject *__pyx_codeobj__13;
1306 /* Late includes */
11381307
11391308 /* "pygame_sdl2/image.pyx":33
11401309 * cdef int image_formats = 0
11841353 *
11851354 */
11861355 __pyx_t_1 = ((__pyx_v_11pygame_sdl2_5image_image_formats == 0) != 0);
1187 if (__pyx_t_1) {
1356 if (unlikely(__pyx_t_1)) {
11881357
11891358 /* "pygame_sdl2/image.pyx":37
11901359 * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP)
13301499 */
13311500 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
13321501 __Pyx_GOTREF(__pyx_t_1);
1333 __pyx_t_2 = PyObject_IsInstance(__pyx_v_namehint, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 47, __pyx_L1_error)
1502 __pyx_t_2 = PyObject_IsInstance(__pyx_v_namehint, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 47, __pyx_L1_error)
13341503 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13351504 __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
13361505 if (__pyx_t_3) {
16011770 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16021771 switch (pos_args) {
16031772 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1773 CYTHON_FALLTHROUGH;
16041774 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1775 CYTHON_FALLTHROUGH;
16051776 case 0: break;
16061777 default: goto __pyx_L5_argtuple_error;
16071778 }
16081779 kw_args = PyDict_Size(__pyx_kwds);
16091780 switch (pos_args) {
16101781 case 0:
1611 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fi)) != 0)) kw_args--;
1782 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fi)) != 0)) kw_args--;
16121783 else goto __pyx_L5_argtuple_error;
1784 CYTHON_FALLTHROUGH;
16131785 case 1:
16141786 if (kw_args > 0) {
1615 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_namehint);
1787 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_namehint);
16161788 if (value) { values[1] = value; kw_args--; }
16171789 }
16181790 }
16221794 } else {
16231795 switch (PyTuple_GET_SIZE(__pyx_args)) {
16241796 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1797 CYTHON_FALLTHROUGH;
16251798 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16261799 break;
16271800 default: goto __pyx_L5_argtuple_error;
16641837 PyObject *__pyx_t_8 = NULL;
16651838 PyObject *__pyx_t_9 = NULL;
16661839 PyObject *__pyx_t_10 = NULL;
1667 int __pyx_t_11;
1840 PyObject *__pyx_t_11 = NULL;
1841 int __pyx_t_12;
16681842 __Pyx_RefNannySetupContext("load", 0);
16691843 __Pyx_INCREF(__pyx_v_namehint);
16701844
17511925 *
17521926 * if namehint == "":
17531927 */
1754 __pyx_t_6 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_6 == NULL)) __PYX_ERR(0, 72, __pyx_L1_error)
1928 __pyx_t_6 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_6 == ((SDL_RWops *)NULL))) __PYX_ERR(0, 72, __pyx_L1_error)
17551929 __pyx_v_rwops = __pyx_t_6;
17561930
17571931 /* "pygame_sdl2/image.pyx":74
17751949 #ifdef WITH_THREAD
17761950 PyThreadState *_save;
17771951 Py_UNBLOCK_THREADS
1952 __Pyx_FastGIL_Remember();
17781953 #endif
17791954 /*try:*/ {
17801955
17981973 /*finally:*/ {
17991974 /*normal exit:*/{
18001975 #ifdef WITH_THREAD
1976 __Pyx_FastGIL_Forget();
18011977 Py_BLOCK_THREADS
18021978 #endif
18031979 goto __pyx_L8;
18362012 *
18372013 * with nogil:
18382014 */
1839 __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_namehint); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
2015 __pyx_t_7 = __Pyx_PyObject_AsWritableString(__pyx_v_namehint); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L1_error)
18402016 __pyx_v_ftype = __pyx_t_7;
18412017
18422018 /* "pygame_sdl2/image.pyx":82
18502026 #ifdef WITH_THREAD
18512027 PyThreadState *_save;
18522028 Py_UNBLOCK_THREADS
2029 __Pyx_FastGIL_Remember();
18532030 #endif
18542031 /*try:*/ {
18552032
18732050 /*finally:*/ {
18742051 /*normal exit:*/{
18752052 #ifdef WITH_THREAD
2053 __Pyx_FastGIL_Forget();
18762054 Py_BLOCK_THREADS
18772055 #endif
18782056 goto __pyx_L11;
18912069 *
18922070 */
18932071 __pyx_t_2 = ((__pyx_v_img == NULL) != 0);
1894 if (__pyx_t_2) {
2072 if (unlikely(__pyx_t_2)) {
18952073
18962074 /* "pygame_sdl2/image.pyx":86
18972075 *
22502428 */
22512429 }
22522430 __pyx_L18_error:;
2253 __Pyx_PyThreadState_assign
22542431 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22552432 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
22562433 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22622439 * return surf
22632440 *
22642441 */
2265 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 114, __pyx_L20_except_error)
2266 __Pyx_GOTREF(__pyx_t_3);
2267 __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_t_3);
2268 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2269 if (__pyx_t_11) {
2442 __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
2443 __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 114, __pyx_L20_except_error)
2444 __Pyx_GOTREF(__pyx_t_11);
2445 __pyx_t_12 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_3, __pyx_t_11);
2446 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
2447 __Pyx_ErrRestore(__pyx_t_3, __pyx_t_4, __pyx_t_5);
2448 __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0;
2449 if (__pyx_t_12) {
22702450 __Pyx_AddTraceback("pygame_sdl2.image.load", __pyx_clineno, __pyx_lineno, __pyx_filename);
2271 if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 114, __pyx_L20_except_error)
2451 if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 114, __pyx_L20_except_error)
2452 __Pyx_GOTREF(__pyx_t_5);
2453 __Pyx_GOTREF(__pyx_t_4);
22722454 __Pyx_GOTREF(__pyx_t_3);
2273 __Pyx_GOTREF(__pyx_t_4);
2274 __Pyx_GOTREF(__pyx_t_5);
22752455
22762456 /* "pygame_sdl2/image.pyx":115
22772457 * return surf.convert()
22982478 * if has_alpha:
22992479 * return surf.convert_alpha()
23002480 */
2301 __Pyx_PyThreadState_assign
23022481 __Pyx_XGIVEREF(__pyx_t_8);
23032482 __Pyx_XGIVEREF(__pyx_t_9);
23042483 __Pyx_XGIVEREF(__pyx_t_10);
23052484 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
23062485 goto __pyx_L1_error;
23072486 __pyx_L22_try_return:;
2308 __Pyx_PyThreadState_assign
23092487 __Pyx_XGIVEREF(__pyx_t_8);
23102488 __Pyx_XGIVEREF(__pyx_t_9);
23112489 __Pyx_XGIVEREF(__pyx_t_10);
23122490 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
23132491 goto __pyx_L0;
23142492 __pyx_L21_except_return:;
2315 __Pyx_PyThreadState_assign
23162493 __Pyx_XGIVEREF(__pyx_t_8);
23172494 __Pyx_XGIVEREF(__pyx_t_9);
23182495 __Pyx_XGIVEREF(__pyx_t_10);
23332510 __Pyx_XDECREF(__pyx_t_3);
23342511 __Pyx_XDECREF(__pyx_t_4);
23352512 __Pyx_XDECREF(__pyx_t_5);
2513 __Pyx_XDECREF(__pyx_t_11);
23362514 __Pyx_AddTraceback("pygame_sdl2.image.load", __pyx_clineno, __pyx_lineno, __pyx_filename);
23372515 __pyx_r = NULL;
23382516 __pyx_L0:;
23702548 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
23712549 switch (pos_args) {
23722550 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2551 CYTHON_FALLTHROUGH;
23732552 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2553 CYTHON_FALLTHROUGH;
23742554 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2555 CYTHON_FALLTHROUGH;
23752556 case 0: break;
23762557 default: goto __pyx_L5_argtuple_error;
23772558 }
23782559 kw_args = PyDict_Size(__pyx_kwds);
23792560 switch (pos_args) {
23802561 case 0:
2381 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
2562 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
23822563 else goto __pyx_L5_argtuple_error;
2564 CYTHON_FALLTHROUGH;
23832565 case 1:
2384 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
2566 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_filename)) != 0)) kw_args--;
23852567 else {
23862568 __Pyx_RaiseArgtupleInvalid("save", 0, 2, 3, 1); __PYX_ERR(0, 123, __pyx_L3_error)
23872569 }
2570 CYTHON_FALLTHROUGH;
23882571 case 2:
23892572 if (kw_args > 0) {
2390 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_compression);
2573 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compression);
23912574 if (value) { values[2] = value; kw_args--; }
23922575 }
23932576 }
23972580 } else {
23982581 switch (PyTuple_GET_SIZE(__pyx_args)) {
23992582 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2583 CYTHON_FALLTHROUGH;
24002584 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
24012585 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
24022586 break;
24572641 */
24582642 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
24592643 __Pyx_GOTREF(__pyx_t_1);
2460 __pyx_t_2 = PyObject_IsInstance(__pyx_v_filename, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 125, __pyx_L1_error)
2644 __pyx_t_2 = PyObject_IsInstance(__pyx_v_filename, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 125, __pyx_L1_error)
24612645 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24622646 __pyx_t_3 = (__pyx_t_2 != 0);
24632647 if (__pyx_t_3) {
26362820 * cdef SDL_RWops *rwops
26372821 * cdef int compression_level = compression
26382822 */
2639 __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L1_error)
2823 __pyx_t_7 = __Pyx_PyObject_AsWritableString(__pyx_v_filename); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L1_error)
26402824 __pyx_v_fn = __pyx_t_7;
26412825
26422826 /* "pygame_sdl2/image.pyx":135
26702854 #ifdef WITH_THREAD
26712855 PyThreadState *_save;
26722856 Py_UNBLOCK_THREADS
2857 __Pyx_FastGIL_Remember();
26732858 #endif
26742859 /*try:*/ {
26752860
26932878 /*finally:*/ {
26942879 /*normal exit:*/{
26952880 #ifdef WITH_THREAD
2881 __Pyx_FastGIL_Forget();
26962882 Py_BLOCK_THREADS
26972883 #endif
26982884 goto __pyx_L7;
27302916 */
27312917 __pyx_t_10.__pyx_n = 1;
27322918 __pyx_t_10.mode = __pyx_n_u_wb;
2733 __pyx_t_9 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_filename, &__pyx_t_10); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(0, 141, __pyx_L1_error)
2919 __pyx_t_9 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_filename, &__pyx_t_10); if (unlikely(__pyx_t_9 == ((SDL_RWops *)NULL))) __PYX_ERR(0, 141, __pyx_L1_error)
27342920 __pyx_v_rwops = __pyx_t_9;
27352921
27362922 /* "pygame_sdl2/image.pyx":142
27442930 #ifdef WITH_THREAD
27452931 PyThreadState *_save;
27462932 Py_UNBLOCK_THREADS
2933 __Pyx_FastGIL_Remember();
27472934 #endif
27482935 /*try:*/ {
27492936
27672954 /*finally:*/ {
27682955 /*normal exit:*/{
27692956 #ifdef WITH_THREAD
2957 __Pyx_FastGIL_Forget();
27702958 Py_BLOCK_THREADS
27712959 #endif
27722960 goto __pyx_L10;
28012989 __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_v_ext, __pyx_kp_b_JPEG, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 144, __pyx_L1_error)
28022990 __pyx_t_3 = __pyx_t_2;
28032991 __pyx_L11_bool_binop_done:;
2804 if (__pyx_t_3) {
2992 if (likely(__pyx_t_3)) {
28052993
28062994 /* "pygame_sdl2/image.pyx":145
28072995 * err = SDL_SaveBMP_RW(surface.surface, rwops, 1)
28143002 #ifdef WITH_THREAD
28153003 PyThreadState *_save;
28163004 Py_UNBLOCK_THREADS
3005 __Pyx_FastGIL_Remember();
28173006 #endif
28183007 /*try:*/ {
28193008
28373026 /*finally:*/ {
28383027 /*normal exit:*/{
28393028 #ifdef WITH_THREAD
3029 __Pyx_FastGIL_Forget();
28403030 Py_BLOCK_THREADS
28413031 #endif
28423032 goto __pyx_L15;
28653055 /*else*/ {
28663056 __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_Unsupported_format_s, __pyx_v_ext); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
28673057 __Pyx_GOTREF(__pyx_t_4);
2868 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
3058 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
28693059 __Pyx_GOTREF(__pyx_t_1);
2870 __Pyx_GIVEREF(__pyx_t_4);
2871 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
2872 __pyx_t_4 = 0;
2873 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
2874 __Pyx_GOTREF(__pyx_t_4);
3060 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3061 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
28753062 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2876 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
2877 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28783063 __PYX_ERR(0, 148, __pyx_L1_error)
28793064 }
28803065 __pyx_L4:;
28873072 *
28883073 */
28893074 __pyx_t_3 = ((__pyx_v_err != 0) != 0);
2890 if (__pyx_t_3) {
3075 if (unlikely(__pyx_t_3)) {
28913076
28923077 /* "pygame_sdl2/image.pyx":151
28933078 *
28963081 *
28973082 * def get_extended():
28983083 */
2899 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
2900 __Pyx_GOTREF(__pyx_t_1);
3084 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error)
3085 __Pyx_GOTREF(__pyx_t_4);
29013086 __pyx_t_5 = NULL;
2902 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
2903 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
3087 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
3088 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
29043089 if (likely(__pyx_t_5)) {
2905 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
3090 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
29063091 __Pyx_INCREF(__pyx_t_5);
29073092 __Pyx_INCREF(function);
2908 __Pyx_DECREF_SET(__pyx_t_1, function);
3093 __Pyx_DECREF_SET(__pyx_t_4, function);
29093094 }
29103095 }
29113096 if (__pyx_t_5) {
2912 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error)
3097 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
29133098 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
29143099 } else {
2915 __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error)
2916 }
2917 __Pyx_GOTREF(__pyx_t_4);
3100 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
3101 }
3102 __Pyx_GOTREF(__pyx_t_1);
3103 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3104 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
29183105 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2919 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
2920 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29213106 __PYX_ERR(0, 151, __pyx_L1_error)
29223107
29233108 /* "pygame_sdl2/image.pyx":150
30123197 };
30133198
30143199 #if PY_MAJOR_VERSION >= 3
3200 #if CYTHON_PEP489_MULTI_PHASE_INIT
3201 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
3202 static int __pyx_pymod_exec_image(PyObject* module); /*proto*/
3203 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
3204 {Py_mod_create, (void*)__pyx_pymod_create},
3205 {Py_mod_exec, (void*)__pyx_pymod_exec_image},
3206 {0, NULL}
3207 };
3208 #endif
3209
30153210 static struct PyModuleDef __pyx_moduledef = {
3016 #if PY_VERSION_HEX < 0x03020000
3017 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
3018 #else
30193211 PyModuleDef_HEAD_INIT,
3020 #endif
30213212 "image",
30223213 0, /* m_doc */
3214 #if CYTHON_PEP489_MULTI_PHASE_INIT
3215 0, /* m_size */
3216 #else
30233217 -1, /* m_size */
3218 #endif
30243219 __pyx_methods /* m_methods */,
3220 #if CYTHON_PEP489_MULTI_PHASE_INIT
3221 __pyx_moduledef_slots, /* m_slots */
3222 #else
30253223 NULL, /* m_reload */
3224 #endif
30263225 NULL, /* m_traverse */
30273226 NULL, /* m_clear */
30283227 NULL /* m_free */
30423241 {&__pyx_kp_b__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 0, 0},
30433242 {&__pyx_n_u_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 1, 0, 1},
30443243 {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1},
3244 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
30453245 {&__pyx_n_s_compression, __pyx_k_compression, sizeof(__pyx_k_compression), 0, 0, 1, 1},
30463246 {&__pyx_n_s_compression_level, __pyx_k_compression_level, sizeof(__pyx_k_compression_level), 0, 0, 1, 1},
30473247 {&__pyx_n_s_convert, __pyx_k_convert, sizeof(__pyx_k_convert), 0, 0, 1, 1},
31503350 * global image_formats
31513351 * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP)
31523352 */
3153 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_init, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 33, __pyx_L1_error)
3353 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_init, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 33, __pyx_L1_error)
31543354
31553355 /* "pygame_sdl2/image.pyx":41
31563356 * init()
31593359 * IMG_Quit()
31603360 *
31613361 */
3162 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_quit, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 41, __pyx_L1_error)
3362 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_quit, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 41, __pyx_L1_error)
31633363
31643364 /* "pygame_sdl2/image.pyx":61
31653365 * return ext.upper()
31713371 __pyx_tuple__9 = PyTuple_Pack(8, __pyx_n_s_fi, __pyx_n_s_namehint, __pyx_n_s_img, __pyx_n_s_rwops, __pyx_n_s_ftype, __pyx_n_s_surf, __pyx_n_s_n, __pyx_n_s_has_alpha); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 61, __pyx_L1_error)
31723372 __Pyx_GOTREF(__pyx_tuple__9);
31733373 __Pyx_GIVEREF(__pyx_tuple__9);
3174 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_load, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 61, __pyx_L1_error)
3374 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_load, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 61, __pyx_L1_error)
31753375
31763376 /* "pygame_sdl2/image.pyx":123
31773377 * int Pygame_SDL2_SavePNG(const char *, SDL_Surface *, int) nogil
31833383 __pyx_tuple__11 = PyTuple_Pack(8, __pyx_n_s_surface, __pyx_n_s_filename, __pyx_n_s_compression, __pyx_n_s_ext, __pyx_n_s_err, __pyx_n_s_fn, __pyx_n_s_rwops, __pyx_n_s_compression_level); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 123, __pyx_L1_error)
31843384 __Pyx_GOTREF(__pyx_tuple__11);
31853385 __Pyx_GIVEREF(__pyx_tuple__11);
3186 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_save, 123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 123, __pyx_L1_error)
3386 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_save, 123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 123, __pyx_L1_error)
31873387
31883388 /* "pygame_sdl2/image.pyx":153
31893389 * raise error()
31923392 * # This may be called before init.
31933393 * return True
31943394 */
3195 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_get_extended, 153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 153, __pyx_L1_error)
3395 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_image_pyx, __pyx_n_s_get_extended, 153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 153, __pyx_L1_error)
31963396 __Pyx_RefNannyFinishContext();
31973397 return 0;
31983398 __pyx_L1_error:;
32093409 return -1;
32103410 }
32113411
3412 static int __Pyx_modinit_global_init_code(void); /*proto*/
3413 static int __Pyx_modinit_variable_export_code(void); /*proto*/
3414 static int __Pyx_modinit_function_export_code(void); /*proto*/
3415 static int __Pyx_modinit_type_init_code(void); /*proto*/
3416 static int __Pyx_modinit_type_import_code(void); /*proto*/
3417 static int __Pyx_modinit_variable_import_code(void); /*proto*/
3418 static int __Pyx_modinit_function_import_code(void); /*proto*/
3419
3420 static int __Pyx_modinit_global_init_code(void) {
3421 __Pyx_RefNannyDeclarations
3422 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
3423 /*--- Global init code ---*/
3424 __Pyx_RefNannyFinishContext();
3425 return 0;
3426 }
3427
3428 static int __Pyx_modinit_variable_export_code(void) {
3429 __Pyx_RefNannyDeclarations
3430 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
3431 /*--- Variable export code ---*/
3432 __Pyx_RefNannyFinishContext();
3433 return 0;
3434 }
3435
3436 static int __Pyx_modinit_function_export_code(void) {
3437 __Pyx_RefNannyDeclarations
3438 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
3439 /*--- Function export code ---*/
3440 __Pyx_RefNannyFinishContext();
3441 return 0;
3442 }
3443
3444 static int __Pyx_modinit_type_init_code(void) {
3445 __Pyx_RefNannyDeclarations
3446 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
3447 /*--- Type init code ---*/
3448 __Pyx_RefNannyFinishContext();
3449 return 0;
3450 }
3451
3452 static int __Pyx_modinit_type_import_code(void) {
3453 __Pyx_RefNannyDeclarations
3454 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
3455 /*--- Type import code ---*/
3456 __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
3457 __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
3458 __Pyx_RefNannyFinishContext();
3459 return 0;
3460 __pyx_L1_error:;
3461 __Pyx_RefNannyFinishContext();
3462 return -1;
3463 }
3464
3465 static int __Pyx_modinit_variable_import_code(void) {
3466 __Pyx_RefNannyDeclarations
3467 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
3468 /*--- Variable import code ---*/
3469 __Pyx_RefNannyFinishContext();
3470 return 0;
3471 }
3472
3473 static int __Pyx_modinit_function_import_code(void) {
3474 __Pyx_RefNannyDeclarations
3475 PyObject *__pyx_t_1 = NULL;
3476 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
3477 /*--- Function import code ---*/
3478 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
3479 if (__Pyx_ImportFunction(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3480 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3481 __Pyx_RefNannyFinishContext();
3482 return 0;
3483 __pyx_L1_error:;
3484 __Pyx_XDECREF(__pyx_t_1);
3485 __Pyx_RefNannyFinishContext();
3486 return -1;
3487 }
3488
3489
32123490 #if PY_MAJOR_VERSION < 3
3213 PyMODINIT_FUNC initimage(void); /*proto*/
3214 PyMODINIT_FUNC initimage(void)
3215 #else
3216 PyMODINIT_FUNC PyInit_image(void); /*proto*/
3217 PyMODINIT_FUNC PyInit_image(void)
3491 #ifdef CYTHON_NO_PYINIT_EXPORT
3492 #define __Pyx_PyMODINIT_FUNC void
3493 #else
3494 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
3495 #endif
3496 #else
3497 #ifdef CYTHON_NO_PYINIT_EXPORT
3498 #define __Pyx_PyMODINIT_FUNC PyObject *
3499 #else
3500 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
3501 #endif
3502 #endif
3503 #ifndef CYTHON_SMALL_CODE
3504 #if defined(__clang__)
3505 #define CYTHON_SMALL_CODE
3506 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
3507 #define CYTHON_SMALL_CODE __attribute__((cold))
3508 #else
3509 #define CYTHON_SMALL_CODE
3510 #endif
3511 #endif
3512
3513
3514 #if PY_MAJOR_VERSION < 3
3515 __Pyx_PyMODINIT_FUNC initimage(void) CYTHON_SMALL_CODE; /*proto*/
3516 __Pyx_PyMODINIT_FUNC initimage(void)
3517 #else
3518 __Pyx_PyMODINIT_FUNC PyInit_image(void) CYTHON_SMALL_CODE; /*proto*/
3519 __Pyx_PyMODINIT_FUNC PyInit_image(void)
3520 #if CYTHON_PEP489_MULTI_PHASE_INIT
3521 {
3522 return PyModuleDef_Init(&__pyx_moduledef);
3523 }
3524 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
3525 PyObject *value = PyObject_GetAttrString(spec, from_name);
3526 int result = 0;
3527 if (likely(value)) {
3528 result = PyDict_SetItemString(moddict, to_name, value);
3529 Py_DECREF(value);
3530 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
3531 PyErr_Clear();
3532 } else {
3533 result = -1;
3534 }
3535 return result;
3536 }
3537 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
3538 PyObject *module = NULL, *moddict, *modname;
3539 if (__pyx_m)
3540 return __Pyx_NewRef(__pyx_m);
3541 modname = PyObject_GetAttrString(spec, "name");
3542 if (unlikely(!modname)) goto bad;
3543 module = PyModule_NewObject(modname);
3544 Py_DECREF(modname);
3545 if (unlikely(!module)) goto bad;
3546 moddict = PyModule_GetDict(module);
3547 if (unlikely(!moddict)) goto bad;
3548 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
3549 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
3550 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
3551 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
3552 return module;
3553 bad:
3554 Py_XDECREF(module);
3555 return NULL;
3556 }
3557
3558
3559 static int __pyx_pymod_exec_image(PyObject *__pyx_pyinit_module)
3560 #endif
32183561 #endif
32193562 {
32203563 PyObject *__pyx_t_1 = NULL;
32213564 PyObject *__pyx_t_2 = NULL;
3222 PyObject *__pyx_t_3 = NULL;
3223 PyObject *__pyx_t_4 = NULL;
32243565 __Pyx_RefNannyDeclarations
3566 #if CYTHON_PEP489_MULTI_PHASE_INIT
3567 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
3568 #elif PY_MAJOR_VERSION >= 3
3569 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
3570 #endif
32253571 #if CYTHON_REFNANNY
3226 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
3227 if (!__Pyx_RefNanny) {
3228 PyErr_Clear();
3229 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
3230 if (!__Pyx_RefNanny)
3231 Py_FatalError("failed to import 'refnanny' module");
3232 }
3233 #endif
3234 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_image(void)", 0);
3572 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
3573 if (!__Pyx_RefNanny) {
3574 PyErr_Clear();
3575 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
3576 if (!__Pyx_RefNanny)
3577 Py_FatalError("failed to import 'refnanny' module");
3578 }
3579 #endif
3580 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_image(void)", 0);
32353581 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32363582 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
32373583 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
32483594 #ifdef __Pyx_Generator_USED
32493595 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32503596 #endif
3597 #ifdef __Pyx_AsyncGen_USED
3598 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3599 #endif
32513600 #ifdef __Pyx_StopAsyncIteration_USED
32523601 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32533602 #endif
32593608 #endif
32603609 #endif
32613610 /*--- Module creation code ---*/
3611 #if CYTHON_PEP489_MULTI_PHASE_INIT
3612 __pyx_m = __pyx_pyinit_module;
3613 Py_INCREF(__pyx_m);
3614 #else
32623615 #if PY_MAJOR_VERSION < 3
32633616 __pyx_m = Py_InitModule4("image", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
32643617 #else
32653618 __pyx_m = PyModule_Create(&__pyx_moduledef);
32663619 #endif
32673620 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
3621 #endif
32683622 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
32693623 Py_INCREF(__pyx_d);
32703624 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
3625 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
32713626 #if CYTHON_COMPILING_IN_PYPY
32723627 Py_INCREF(__pyx_b);
32733628 #endif
32923647 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32933648 /*--- Constants init code ---*/
32943649 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3295 /*--- Global init code ---*/
3296 /*--- Variable export code ---*/
3297 /*--- Function export code ---*/
3298 /*--- Type init code ---*/
3299 /*--- Type import code ---*/
3300 __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
3301 __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
3302 /*--- Variable import code ---*/
3303 /*--- Function import code ---*/
3304 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
3305 if (__Pyx_ImportFunction(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3306 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3650 /*--- Global type/function init code ---*/
3651 (void)__Pyx_modinit_global_init_code();
3652 (void)__Pyx_modinit_variable_export_code();
3653 (void)__Pyx_modinit_function_export_code();
3654 (void)__Pyx_modinit_type_init_code();
3655 if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
3656 (void)__Pyx_modinit_variable_import_code();
3657 if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error;
33073658 /*--- Execution code ---*/
33083659 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
33093660 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33163667 * from pygame_sdl2.compat import bytes_, unicode_, filesystem_encode
33173668 *
33183669 */
3319 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
3320 __Pyx_GOTREF(__pyx_t_2);
3670 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
3671 __Pyx_GOTREF(__pyx_t_1);
33213672 __Pyx_INCREF(__pyx_n_s_error);
33223673 __Pyx_GIVEREF(__pyx_n_s_error);
3323 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error);
3324 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error)
3325 __Pyx_GOTREF(__pyx_t_3);
3674 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_error);
3675 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
3676 __Pyx_GOTREF(__pyx_t_2);
3677 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3678 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
3679 __Pyx_GOTREF(__pyx_t_1);
3680 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_1) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
3681 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33263682 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3327 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
3328 __Pyx_GOTREF(__pyx_t_2);
3329 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
3330 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3331 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
33323683
33333684 /* "pygame_sdl2/image.pyx":25
33343685 *
33373688 *
33383689 * import os
33393690 */
3340 __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
3341 __Pyx_GOTREF(__pyx_t_3);
3691 __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
3692 __Pyx_GOTREF(__pyx_t_2);
33423693 __Pyx_INCREF(__pyx_n_s_bytes);
33433694 __Pyx_GIVEREF(__pyx_n_s_bytes);
3344 PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_bytes);
3695 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_bytes);
33453696 __Pyx_INCREF(__pyx_n_s_unicode);
33463697 __Pyx_GIVEREF(__pyx_n_s_unicode);
3347 PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_unicode);
3698 PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_unicode);
33483699 __Pyx_INCREF(__pyx_n_s_filesystem_encode);
33493700 __Pyx_GIVEREF(__pyx_n_s_filesystem_encode);
3350 PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_filesystem_encode);
3351 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_compat, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
3701 PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_filesystem_encode);
3702 __pyx_t_1 = __Pyx_Import(__pyx_n_s_pygame_sdl2_compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
3703 __Pyx_GOTREF(__pyx_t_1);
3704 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3705 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
33523706 __Pyx_GOTREF(__pyx_t_2);
3353 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3354 __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
3355 __Pyx_GOTREF(__pyx_t_3);
3356 if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes, __pyx_t_3) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
3357 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3358 __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
3359 __Pyx_GOTREF(__pyx_t_3);
3360 if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicode, __pyx_t_3) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
3361 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3362 __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_filesystem_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
3363 __Pyx_GOTREF(__pyx_t_3);
3364 if (PyDict_SetItem(__pyx_d, __pyx_n_s_filesystem_encode, __pyx_t_3) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
3365 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3707 if (PyDict_SetItem(__pyx_d, __pyx_n_s_bytes, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
33663708 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3709 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
3710 __Pyx_GOTREF(__pyx_t_2);
3711 if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicode, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
3712 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3713 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_filesystem_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
3714 __Pyx_GOTREF(__pyx_t_2);
3715 if (PyDict_SetItem(__pyx_d, __pyx_n_s_filesystem_encode, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
3716 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3717 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33673718
33683719 /* "pygame_sdl2/image.pyx":27
33693720 * from pygame_sdl2.compat import bytes_, unicode_, filesystem_encode
33723723 * import pygame_sdl2
33733724 *
33743725 */
3375 __pyx_t_2 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
3376 __Pyx_GOTREF(__pyx_t_2);
3377 if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
3378 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3726 __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
3727 __Pyx_GOTREF(__pyx_t_1);
3728 if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
3729 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33793730
33803731 /* "pygame_sdl2/image.pyx":28
33813732 *
33843735 *
33853736 *
33863737 */
3387 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
3388 __Pyx_GOTREF(__pyx_t_2);
3389 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
3390 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3738 __pyx_t_1 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
3739 __Pyx_GOTREF(__pyx_t_1);
3740 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
3741 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33913742
33923743 /* "pygame_sdl2/image.pyx":31
33933744 *
34053756 * global image_formats
34063757 * image_formats = IMG_Init(IMG_INIT_JPG | IMG_INIT_PNG | IMG_INIT_TIF | IMG_INIT_WEBP)
34073758 */
3408 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5image_1init, NULL, __pyx_n_s_pygame_sdl2_image); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
3409 __Pyx_GOTREF(__pyx_t_2);
3410 if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
3411 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3759 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5image_1init, NULL, __pyx_n_s_pygame_sdl2_image); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
3760 __Pyx_GOTREF(__pyx_t_1);
3761 if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
3762 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34123763
34133764 /* "pygame_sdl2/image.pyx":39
34143765 * raise error()
34173768 *
34183769 * def quit(): # @ReservedAssignment
34193770 */
3420 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error)
3421 __Pyx_GOTREF(__pyx_t_3);
3422 __pyx_t_4 = NULL;
3423 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3424 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
3425 if (likely(__pyx_t_4)) {
3426 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3427 __Pyx_INCREF(__pyx_t_4);
3428 __Pyx_INCREF(function);
3429 __Pyx_DECREF_SET(__pyx_t_3, function);
3430 }
3431 }
3432 if (__pyx_t_4) {
3433 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
3434 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3435 } else {
3436 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
3437 }
3771 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
3772 __Pyx_GOTREF(__pyx_t_1);
3773 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
34383774 __Pyx_GOTREF(__pyx_t_2);
3439 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3775 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34403776 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34413777
34423778 /* "pygame_sdl2/image.pyx":41
34923828 * #
34933829 * # This software is provided 'as-is', without any express or implied
34943830 */
3495 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
3831 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
34963832 __Pyx_GOTREF(__pyx_t_2);
34973833 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
34983834 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
35033839 __pyx_L1_error:;
35043840 __Pyx_XDECREF(__pyx_t_1);
35053841 __Pyx_XDECREF(__pyx_t_2);
3506 __Pyx_XDECREF(__pyx_t_3);
3507 __Pyx_XDECREF(__pyx_t_4);
35083842 if (__pyx_m) {
35093843 if (__pyx_d) {
3510 __Pyx_AddTraceback("init pygame_sdl2.image", __pyx_clineno, __pyx_lineno, __pyx_filename);
3844 __Pyx_AddTraceback("init pygame_sdl2.image", 0, __pyx_lineno, __pyx_filename);
35113845 }
35123846 Py_DECREF(__pyx_m); __pyx_m = 0;
35133847 } else if (!PyErr_Occurred()) {
35153849 }
35163850 __pyx_L0:;
35173851 __Pyx_RefNannyFinishContext();
3518 #if PY_MAJOR_VERSION < 3
3852 #if CYTHON_PEP489_MULTI_PHASE_INIT
3853 return (__pyx_m != NULL) ? 0 : -1;
3854 #elif PY_MAJOR_VERSION >= 3
3855 return __pyx_m;
3856 #else
35193857 return;
3520 #else
3521 return __pyx_m;
35223858 #endif
35233859 }
35243860
35403876 }
35413877 #endif
35423878
3879 /* PyObjectGetAttrStr */
3880 #if CYTHON_USE_TYPE_SLOTS
3881 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
3882 PyTypeObject* tp = Py_TYPE(obj);
3883 if (likely(tp->tp_getattro))
3884 return tp->tp_getattro(obj, attr_name);
3885 #if PY_MAJOR_VERSION < 3
3886 if (likely(tp->tp_getattr))
3887 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
3888 #endif
3889 return PyObject_GetAttr(obj, attr_name);
3890 }
3891 #endif
3892
35433893 /* GetBuiltinName */
35443894 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
35453895 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
35583908 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
35593909 PyObject *result;
35603910 #if !CYTHON_AVOID_BORROWED_REFS
3911 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
3912 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
3913 if (likely(result)) {
3914 Py_INCREF(result);
3915 } else if (unlikely(PyErr_Occurred())) {
3916 result = NULL;
3917 } else {
3918 #else
35613919 result = PyDict_GetItem(__pyx_d, name);
35623920 if (likely(result)) {
35633921 Py_INCREF(result);
35643922 } else {
3923 #endif
35653924 #else
35663925 result = PyObject_GetItem(__pyx_d, name);
35673926 if (!result) {
35733932 }
35743933
35753934 /* PyCFunctionFastCall */
3576 #if CYTHON_FAST_PYCCALL
3935 #if CYTHON_FAST_PYCCALL
35773936 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
35783937 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
35793938 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
35803939 PyObject *self = PyCFunction_GET_SELF(func);
3940 int flags = PyCFunction_GET_FLAGS(func);
35813941 assert(PyCFunction_Check(func));
3582 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
3942 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
35833943 assert(nargs >= 0);
35843944 assert(nargs == 0 || args != NULL);
35853945 /* _PyCFunction_FastCallDict() must not be called with an exception set,
35863946 because it may clear it (directly or indirectly) and so the
35873947 caller loses its exception */
35883948 assert(!PyErr_Occurred());
3589 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
3590 }
3591 #endif // CYTHON_FAST_PYCCALL
3949 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
3950 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
3951 } else {
3952 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
3953 }
3954 }
3955 #endif
35923956
35933957 /* PyFunctionFastCall */
3594 #if CYTHON_FAST_PYCALL
3958 #if CYTHON_FAST_PYCALL
35953959 #include "frameobject.h"
35963960 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
35973961 PyObject *globals) {
35983962 PyFrameObject *f;
3599 PyThreadState *tstate = PyThreadState_GET();
3963 PyThreadState *tstate = __Pyx_PyThreadState_Current;
36003964 PyObject **fastlocals;
36013965 Py_ssize_t i;
36023966 PyObject *result;
37074071 Py_LeaveRecursiveCall();
37084072 return result;
37094073 }
3710 #endif // CPython < 3.6
3711 #endif // CYTHON_FAST_PYCALL
4074 #endif
4075 #endif
37124076
37134077 /* PyObjectCall */
3714 #if CYTHON_COMPILING_IN_CPYTHON
4078 #if CYTHON_COMPILING_IN_CPYTHON
37154079 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
37164080 PyObject *result;
37174081 ternaryfunc call = func->ob_type->tp_call;
37314095 #endif
37324096
37334097 /* PyObjectCallMethO */
3734 #if CYTHON_COMPILING_IN_CPYTHON
4098 #if CYTHON_COMPILING_IN_CPYTHON
37354099 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
37364100 PyObject *self, *result;
37374101 PyCFunction cfunc;
37514115 #endif
37524116
37534117 /* PyObjectCallOneArg */
3754 #if CYTHON_COMPILING_IN_CPYTHON
4118 #if CYTHON_COMPILING_IN_CPYTHON
37554119 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
37564120 PyObject *result;
37574121 PyObject *args = PyTuple_New(1);
37684132 return __Pyx_PyFunction_FastCall(func, &arg, 1);
37694133 }
37704134 #endif
3771 #ifdef __Pyx_CyFunction_USED
3772 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
3773 #else
37744135 if (likely(PyCFunction_Check(func))) {
3775 #endif
37764136 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
37774137 return __Pyx_PyObject_CallMethO(func, arg);
37784138 #if CYTHON_FAST_PYCCALL
38034163 }
38044164 #endif
38054165 #ifdef __Pyx_CyFunction_USED
3806 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
4166 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
38074167 #else
38084168 if (likely(PyCFunction_Check(func))) {
38094169 #endif
39554315 "raise: exception class must be a subclass of BaseException");
39564316 goto bad;
39574317 }
3958 #if PY_VERSION_HEX >= 0x03030000
39594318 if (cause) {
3960 #else
3961 if (cause && cause != Py_None) {
3962 #endif
39634319 PyObject *fixed_cause;
39644320 if (cause == Py_None) {
39654321 fixed_cause = NULL;
39874343 PyErr_Restore(tmp_type, tmp_value, tb);
39884344 Py_XDECREF(tmp_tb);
39894345 #else
3990 PyThreadState *tstate = PyThreadState_GET();
4346 PyThreadState *tstate = __Pyx_PyThreadState_Current;
39914347 PyObject* tmp_tb = tstate->curexc_traceback;
39924348 if (tb != tmp_tb) {
39934349 Py_INCREF(tb);
40034359 #endif
40044360
40054361 /* GetItemInt */
4006 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
4362 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
40074363 PyObject *r;
40084364 if (!j) return NULL;
40094365 r = PyObject_GetItem(o, j);
40144370 CYTHON_NCP_UNUSED int wraparound,
40154371 CYTHON_NCP_UNUSED int boundscheck) {
40164372 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4017 if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
4018 if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
4019 PyObject *r = PyList_GET_ITEM(o, i);
4373 Py_ssize_t wrapped_i = i;
4374 if (wraparound & unlikely(i < 0)) {
4375 wrapped_i += PyList_GET_SIZE(o);
4376 }
4377 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
4378 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
40204379 Py_INCREF(r);
40214380 return r;
40224381 }
40294388 CYTHON_NCP_UNUSED int wraparound,
40304389 CYTHON_NCP_UNUSED int boundscheck) {
40314390 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4032 if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
4033 if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
4034 PyObject *r = PyTuple_GET_ITEM(o, i);
4391 Py_ssize_t wrapped_i = i;
4392 if (wraparound & unlikely(i < 0)) {
4393 wrapped_i += PyTuple_GET_SIZE(o);
4394 }
4395 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
4396 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
40354397 Py_INCREF(r);
40364398 return r;
40374399 }
40844446 }
40854447
40864448 /* BytesEquals */
4087 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
4449 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
40884450 #if CYTHON_COMPILING_IN_PYPY
40894451 return PyObject_RichCompareBool(s1, s2, equals);
40904452 #else
41024464 } else if (length == 1) {
41034465 return (equals == Py_EQ);
41044466 } else {
4105 int result = memcmp(ps1, ps2, (size_t)length);
4467 int result;
4468 #if CYTHON_USE_UNICODE_INTERNALS
4469 Py_hash_t hash1, hash2;
4470 hash1 = ((PyBytesObject*)s1)->ob_shash;
4471 hash2 = ((PyBytesObject*)s2)->ob_shash;
4472 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
4473 return (equals == Py_NE);
4474 }
4475 #endif
4476 result = memcmp(ps1, ps2, (size_t)length);
41064477 return (equals == Py_EQ) ? (result == 0) : (result != 0);
41074478 }
41084479 } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
41224493 }
41234494
41244495 /* SliceObject */
4125 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
4496 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
41264497 Py_ssize_t cstart, Py_ssize_t cstop,
41274498 PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
41284499 int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
42194590 }
42204591
42214592 /* RaiseDoubleKeywords */
4222 static void __Pyx_RaiseDoubleKeywordsError(
4593 static void __Pyx_RaiseDoubleKeywordsError(
42234594 const char* func_name,
42244595 PyObject* kw_name)
42254596 {
42334604 }
42344605
42354606 /* ParseKeywords */
4236 static int __Pyx_ParseOptionalKeywords(
4607 static int __Pyx_ParseOptionalKeywords(
42374608 PyObject *kwds,
42384609 PyObject **argnames[],
42394610 PyObject *kwds2,
43354706 }
43364707
43374708 /* RaiseArgTupleInvalid */
4338 static void __Pyx_RaiseArgtupleInvalid(
4709 static void __Pyx_RaiseArgtupleInvalid(
43394710 const char* func_name,
43404711 int exact,
43414712 Py_ssize_t num_min,
43614732 }
43624733
43634734 /* UnicodeEquals */
4364 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
4735 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
43654736 #if CYTHON_COMPILING_IN_PYPY
43664737 return PyObject_RichCompareBool(s1, s2, equals);
43674738 #else
44014772 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
44024773 goto return_ne;
44034774 }
4775 #if CYTHON_USE_UNICODE_INTERNALS
4776 {
4777 Py_hash_t hash1, hash2;
4778 #if CYTHON_PEP393_ENABLED
4779 hash1 = ((PyASCIIObject*)s1)->hash;
4780 hash2 = ((PyASCIIObject*)s2)->hash;
4781 #else
4782 hash1 = ((PyUnicodeObject*)s1)->hash;
4783 hash2 = ((PyUnicodeObject*)s2)->hash;
4784 #endif
4785 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
4786 goto return_ne;
4787 }
4788 }
4789 #endif
44044790 kind = __Pyx_PyUnicode_KIND(s1);
44054791 if (kind != __Pyx_PyUnicode_KIND(s2)) {
44064792 goto return_ne;
44254811 } else {
44264812 int result;
44274813 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
4814 #if PY_MAJOR_VERSION < 3
4815 Py_XDECREF(owned_ref);
4816 #endif
44284817 if (!py_result)
44294818 return -1;
44304819 result = __Pyx_PyObject_IsTrue(py_result);
44454834 }
44464835
44474836 /* SaveResetException */
4448 #if CYTHON_FAST_THREAD_STATE
4837 #if CYTHON_FAST_THREAD_STATE
44494838 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
4839 #if PY_VERSION_HEX >= 0x030700A3
4840 *type = tstate->exc_state.exc_type;
4841 *value = tstate->exc_state.exc_value;
4842 *tb = tstate->exc_state.exc_traceback;
4843 #else
44504844 *type = tstate->exc_type;
44514845 *value = tstate->exc_value;
44524846 *tb = tstate->exc_traceback;
4847 #endif
44534848 Py_XINCREF(*type);
44544849 Py_XINCREF(*value);
44554850 Py_XINCREF(*tb);
44564851 }
44574852 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
44584853 PyObject *tmp_type, *tmp_value, *tmp_tb;
4854 #if PY_VERSION_HEX >= 0x030700A3
4855 tmp_type = tstate->exc_state.exc_type;
4856 tmp_value = tstate->exc_state.exc_value;
4857 tmp_tb = tstate->exc_state.exc_traceback;
4858 tstate->exc_state.exc_type = type;
4859 tstate->exc_state.exc_value = value;
4860 tstate->exc_state.exc_traceback = tb;
4861 #else
44594862 tmp_type = tstate->exc_type;
44604863 tmp_value = tstate->exc_value;
44614864 tmp_tb = tstate->exc_traceback;
44624865 tstate->exc_type = type;
44634866 tstate->exc_value = value;
44644867 tstate->exc_traceback = tb;
4868 #endif
44654869 Py_XDECREF(tmp_type);
44664870 Py_XDECREF(tmp_value);
44674871 Py_XDECREF(tmp_tb);
44684872 }
44694873 #endif
44704874
4471 /* PyErrExceptionMatches */
4472 #if CYTHON_FAST_THREAD_STATE
4473 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
4474 PyObject *exc_type = tstate->curexc_type;
4475 if (exc_type == err) return 1;
4476 if (unlikely(!exc_type)) return 0;
4477 return PyErr_GivenExceptionMatches(exc_type, err);
4875 /* FastTypeChecks */
4876 #if CYTHON_COMPILING_IN_CPYTHON
4877 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
4878 while (a) {
4879 a = a->tp_base;
4880 if (a == b)
4881 return 1;
4882 }
4883 return b == &PyBaseObject_Type;
4884 }
4885 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
4886 PyObject *mro;
4887 if (a == b) return 1;
4888 mro = a->tp_mro;
4889 if (likely(mro)) {
4890 Py_ssize_t i, n;
4891 n = PyTuple_GET_SIZE(mro);
4892 for (i = 0; i < n; i++) {
4893 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
4894 return 1;
4895 }
4896 return 0;
4897 }
4898 return __Pyx_InBases(a, b);
4899 }
4900 #if PY_MAJOR_VERSION == 2
4901 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
4902 PyObject *exception, *value, *tb;
4903 int res;
4904 __Pyx_PyThreadState_declare
4905 __Pyx_PyThreadState_assign
4906 __Pyx_ErrFetch(&exception, &value, &tb);
4907 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
4908 if (unlikely(res == -1)) {
4909 PyErr_WriteUnraisable(err);
4910 res = 0;
4911 }
4912 if (!res) {
4913 res = PyObject_IsSubclass(err, exc_type2);
4914 if (unlikely(res == -1)) {
4915 PyErr_WriteUnraisable(err);
4916 res = 0;
4917 }
4918 }
4919 __Pyx_ErrRestore(exception, value, tb);
4920 return res;
4921 }
4922 #else
4923 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
4924 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
4925 if (!res) {
4926 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
4927 }
4928 return res;
4929 }
4930 #endif
4931 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
4932 Py_ssize_t i, n;
4933 assert(PyExceptionClass_Check(exc_type));
4934 n = PyTuple_GET_SIZE(tuple);
4935 #if PY_MAJOR_VERSION >= 3
4936 for (i=0; i<n; i++) {
4937 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
4938 }
4939 #endif
4940 for (i=0; i<n; i++) {
4941 PyObject *t = PyTuple_GET_ITEM(tuple, i);
4942 #if PY_MAJOR_VERSION < 3
4943 if (likely(exc_type == t)) return 1;
4944 #endif
4945 if (likely(PyExceptionClass_Check(t))) {
4946 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
4947 } else {
4948 }
4949 }
4950 return 0;
4951 }
4952 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
4953 if (likely(err == exc_type)) return 1;
4954 if (likely(PyExceptionClass_Check(err))) {
4955 if (likely(PyExceptionClass_Check(exc_type))) {
4956 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
4957 } else if (likely(PyTuple_Check(exc_type))) {
4958 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
4959 } else {
4960 }
4961 }
4962 return PyErr_GivenExceptionMatches(err, exc_type);
4963 }
4964 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
4965 assert(PyExceptionClass_Check(exc_type1));
4966 assert(PyExceptionClass_Check(exc_type2));
4967 if (likely(err == exc_type1 || err == exc_type2)) return 1;
4968 if (likely(PyExceptionClass_Check(err))) {
4969 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
4970 }
4971 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
44784972 }
44794973 #endif
44804974
44814975 /* GetException */
4482 #if CYTHON_FAST_THREAD_STATE
4976 #if CYTHON_FAST_THREAD_STATE
44834977 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
44844978 #else
44854979 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
45165010 *value = local_value;
45175011 *tb = local_tb;
45185012 #if CYTHON_FAST_THREAD_STATE
5013 #if PY_VERSION_HEX >= 0x030700A3
5014 tmp_type = tstate->exc_state.exc_type;
5015 tmp_value = tstate->exc_state.exc_value;
5016 tmp_tb = tstate->exc_state.exc_traceback;
5017 tstate->exc_state.exc_type = local_type;
5018 tstate->exc_state.exc_value = local_value;
5019 tstate->exc_state.exc_traceback = local_tb;
5020 #else
45195021 tmp_type = tstate->exc_type;
45205022 tmp_value = tstate->exc_value;
45215023 tmp_tb = tstate->exc_traceback;
45225024 tstate->exc_type = local_type;
45235025 tstate->exc_value = local_value;
45245026 tstate->exc_traceback = local_tb;
5027 #endif
45255028 Py_XDECREF(tmp_type);
45265029 Py_XDECREF(tmp_value);
45275030 Py_XDECREF(tmp_tb);
45405043 }
45415044
45425045 /* ArgTypeTest */
4543 static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
4544 PyErr_Format(PyExc_TypeError,
4545 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
4546 name, type->tp_name, Py_TYPE(obj)->tp_name);
4547 }
4548 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
4549 const char *name, int exact)
5046 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
45505047 {
45515048 if (unlikely(!type)) {
45525049 PyErr_SetString(PyExc_SystemError, "Missing type object");
45535050 return 0;
45545051 }
4555 if (none_allowed && obj == Py_None) return 1;
45565052 else if (exact) {
4557 if (likely(Py_TYPE(obj) == type)) return 1;
45585053 #if PY_MAJOR_VERSION == 2
4559 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
5054 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
45605055 #endif
45615056 }
45625057 else {
4563 if (likely(PyObject_TypeCheck(obj, type))) return 1;
4564 }
4565 __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
5058 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
5059 }
5060 PyErr_Format(PyExc_TypeError,
5061 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
5062 name, type->tp_name, Py_TYPE(obj)->tp_name);
45665063 return 0;
45675064 }
45685065
45695066 /* GetVTable */
4570 static void* __Pyx_GetVtable(PyObject *dict) {
5067 static void* __Pyx_GetVtable(PyObject *dict) {
45715068 void* ptr;
45725069 PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
45735070 if (!ob)
45875084 }
45885085
45895086 /* Import */
4590 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
5087 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
45915088 PyObject *empty_list = 0;
45925089 PyObject *module = 0;
45935090 PyObject *global_dict = 0;
45945091 PyObject *empty_dict = 0;
45955092 PyObject *list;
4596 #if PY_VERSION_HEX < 0x03030000
5093 #if PY_MAJOR_VERSION < 3
45975094 PyObject *py_import;
45985095 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
45995096 if (!py_import)
46175114 #if PY_MAJOR_VERSION >= 3
46185115 if (level == -1) {
46195116 if (strchr(__Pyx_MODULE_NAME, '.')) {
4620 #if PY_VERSION_HEX < 0x03030000
4621 PyObject *py_level = PyInt_FromLong(1);
4622 if (!py_level)
4623 goto bad;
4624 module = PyObject_CallFunctionObjArgs(py_import,
4625 name, global_dict, empty_dict, list, py_level, NULL);
4626 Py_DECREF(py_level);
4627 #else
46285117 module = PyImport_ImportModuleLevelObject(
46295118 name, global_dict, empty_dict, list, 1);
4630 #endif
46315119 if (!module) {
46325120 if (!PyErr_ExceptionMatches(PyExc_ImportError))
46335121 goto bad;
46385126 }
46395127 #endif
46405128 if (!module) {
4641 #if PY_VERSION_HEX < 0x03030000
5129 #if PY_MAJOR_VERSION < 3
46425130 PyObject *py_level = PyInt_FromLong(level);
46435131 if (!py_level)
46445132 goto bad;
46525140 }
46535141 }
46545142 bad:
4655 #if PY_VERSION_HEX < 0x03030000
5143 #if PY_MAJOR_VERSION < 3
46565144 Py_XDECREF(py_import);
46575145 #endif
46585146 Py_XDECREF(empty_list);
46615149 }
46625150
46635151 /* ImportFrom */
4664 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
5152 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
46655153 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
46665154 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
46675155 PyErr_Format(PyExc_ImportError,
46745162 return value;
46755163 }
46765164
5165 /* CLineInTraceback */
5166 #ifndef CYTHON_CLINE_IN_TRACEBACK
5167 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
5168 PyObject *use_cline;
5169 PyObject *ptype, *pvalue, *ptraceback;
5170 #if CYTHON_COMPILING_IN_CPYTHON
5171 PyObject **cython_runtime_dict;
5172 #endif
5173 if (unlikely(!__pyx_cython_runtime)) {
5174 return c_line;
5175 }
5176 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
5177 #if CYTHON_COMPILING_IN_CPYTHON
5178 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
5179 if (likely(cython_runtime_dict)) {
5180 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
5181 } else
5182 #endif
5183 {
5184 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
5185 if (use_cline_obj) {
5186 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
5187 Py_DECREF(use_cline_obj);
5188 } else {
5189 PyErr_Clear();
5190 use_cline = NULL;
5191 }
5192 }
5193 if (!use_cline) {
5194 c_line = 0;
5195 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
5196 }
5197 else if (PyObject_Not(use_cline) != 0) {
5198 c_line = 0;
5199 }
5200 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
5201 return c_line;
5202 }
5203 #endif
5204
46775205 /* CodeObjectCache */
4678 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
5206 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
46795207 int start = 0, mid = 0, end = count - 1;
46805208 if (end >= 0 && code_line > entries[end].code_line) {
46815209 return count;
47555283 }
47565284
47575285 /* AddTraceback */
4758 #include "compile.h"
5286 #include "compile.h"
47595287 #include "frameobject.h"
47605288 #include "traceback.h"
47615289 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
48145342 int py_line, const char *filename) {
48155343 PyCodeObject *py_code = 0;
48165344 PyFrameObject *py_frame = 0;
4817 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
5345 PyThreadState *tstate = __Pyx_PyThreadState_Current;
5346 if (c_line) {
5347 c_line = __Pyx_CLineForTraceback(tstate, c_line);
5348 }
5349 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
48185350 if (!py_code) {
48195351 py_code = __Pyx_CreateCodeObjectForTraceback(
48205352 funcname, c_line, py_line, filename);
48215353 if (!py_code) goto bad;
4822 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
5354 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
48235355 }
48245356 py_frame = PyFrame_New(
4825 PyThreadState_GET(), /*PyThreadState *tstate,*/
4826 py_code, /*PyCodeObject *code,*/
4827 __pyx_d, /*PyObject *globals,*/
4828 0 /*PyObject *locals*/
5357 tstate, /*PyThreadState *tstate,*/
5358 py_code, /*PyCodeObject *code,*/
5359 __pyx_d, /*PyObject *globals,*/
5360 0 /*PyObject *locals*/
48295361 );
48305362 if (!py_frame) goto bad;
48315363 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
48365368 }
48375369
48385370 /* CIntToPy */
4839 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
5371 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
48405372 const long neg_one = (long) -1, const_zero = (long) 0;
48415373 const int is_unsigned = neg_one > const_zero;
48425374 if (is_unsigned) {
48675399 }
48685400
48695401 /* CIntFromPyVerify */
4870 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
5402 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
48715403 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
48725404 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
48735405 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
48895421 }
48905422
48915423 /* CIntFromPy */
4892 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
5424 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
48935425 const int neg_one = (int) -1, const_zero = (int) 0;
48945426 const int is_unsigned = neg_one > const_zero;
48955427 #if PY_MAJOR_VERSION < 3
50785610 }
50795611
50805612 /* CIntFromPy */
5081 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
5613 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
50825614 const long neg_one = (long) -1, const_zero = (long) 0;
50835615 const int is_unsigned = neg_one > const_zero;
50845616 #if PY_MAJOR_VERSION < 3
52675799 }
52685800
52695801 /* CheckBinaryVersion */
5270 static int __Pyx_check_binary_version(void) {
5802 static int __Pyx_check_binary_version(void) {
52715803 char ctversion[4], rtversion[4];
52725804 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
52735805 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
52835815 }
52845816
52855817 /* ModuleImport */
5286 #ifndef __PYX_HAVE_RT_ImportModule
5818 #ifndef __PYX_HAVE_RT_ImportModule
52875819 #define __PYX_HAVE_RT_ImportModule
52885820 static PyObject *__Pyx_ImportModule(const char *name) {
52895821 PyObject *py_name = 0;
53015833 #endif
53025834
53035835 /* TypeImport */
5304 #ifndef __PYX_HAVE_RT_ImportType
5836 #ifndef __PYX_HAVE_RT_ImportType
53055837 #define __PYX_HAVE_RT_ImportType
53065838 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
53075839 size_t size, int strict)
53665898 #endif
53675899
53685900 /* FunctionImport */
5369 #ifndef __PYX_HAVE_RT_ImportFunction
5901 #ifndef __PYX_HAVE_RT_ImportFunction
53705902 #define __PYX_HAVE_RT_ImportFunction
53715903 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
53725904 PyObject *d = 0;
54205952 #endif
54215953
54225954 /* InitStrings */
5423 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
5955 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
54245956 while (t->p) {
54255957 #if PY_MAJOR_VERSION < 3
54265958 if (t->is_unicode) {
54455977 #endif
54465978 if (!*t->p)
54475979 return -1;
5980 if (PyObject_Hash(*t->p) == -1)
5981 return -1;
54485982 ++t;
54495983 }
54505984 return 0;
54535987 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
54545988 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
54555989 }
5456 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
5990 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
54575991 Py_ssize_t ignore;
54585992 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
54595993 }
5460 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5461 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
5994 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
5995 #if !CYTHON_PEP393_ENABLED
5996 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5997 char* defenc_c;
5998 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
5999 if (!defenc) return NULL;
6000 defenc_c = PyBytes_AS_STRING(defenc);
6001 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6002 {
6003 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
6004 char* c;
6005 for (c = defenc_c; c < end; c++) {
6006 if ((unsigned char) (*c) >= 128) {
6007 PyUnicode_AsASCIIString(o);
6008 return NULL;
6009 }
6010 }
6011 }
6012 #endif
6013 *length = PyBytes_GET_SIZE(defenc);
6014 return defenc_c;
6015 }
6016 #else
6017 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6018 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
6019 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6020 if (likely(PyUnicode_IS_ASCII(o))) {
6021 *length = PyUnicode_GET_LENGTH(o);
6022 return PyUnicode_AsUTF8(o);
6023 } else {
6024 PyUnicode_AsASCIIString(o);
6025 return NULL;
6026 }
6027 #else
6028 return PyUnicode_AsUTF8AndSize(o, length);
6029 #endif
6030 }
6031 #endif
6032 #endif
6033 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6034 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
54626035 if (
54636036 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
54646037 __Pyx_sys_getdefaultencoding_not_ascii &&
54656038 #endif
54666039 PyUnicode_Check(o)) {
5467 #if PY_VERSION_HEX < 0x03030000
5468 char* defenc_c;
5469 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
5470 if (!defenc) return NULL;
5471 defenc_c = PyBytes_AS_STRING(defenc);
5472 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5473 {
5474 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
5475 char* c;
5476 for (c = defenc_c; c < end; c++) {
5477 if ((unsigned char) (*c) >= 128) {
5478 PyUnicode_AsASCIIString(o);
5479 return NULL;
5480 }
5481 }
5482 }
5483 #endif
5484 *length = PyBytes_GET_SIZE(defenc);
5485 return defenc_c;
5486 #else
5487 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
5488 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5489 if (PyUnicode_IS_ASCII(o)) {
5490 *length = PyUnicode_GET_LENGTH(o);
5491 return PyUnicode_AsUTF8(o);
5492 } else {
5493 PyUnicode_AsASCIIString(o);
5494 return NULL;
5495 }
5496 #else
5497 return PyUnicode_AsUTF8AndSize(o, length);
5498 #endif
5499 #endif
6040 return __Pyx_PyUnicode_AsStringAndSize(o, length);
55006041 } else
55016042 #endif
55026043 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
55206061 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
55216062 else return PyObject_IsTrue(x);
55226063 }
6064 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
6065 #if PY_MAJOR_VERSION >= 3
6066 if (PyLong_Check(result)) {
6067 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
6068 "__int__ returned non-int (type %.200s). "
6069 "The ability to return an instance of a strict subclass of int "
6070 "is deprecated, and may be removed in a future version of Python.",
6071 Py_TYPE(result)->tp_name)) {
6072 Py_DECREF(result);
6073 return NULL;
6074 }
6075 return result;
6076 }
6077 #endif
6078 PyErr_Format(PyExc_TypeError,
6079 "__%.4s__ returned non-%.4s (type %.200s)",
6080 type_name, type_name, Py_TYPE(result)->tp_name);
6081 Py_DECREF(result);
6082 return NULL;
6083 }
55236084 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
55246085 #if CYTHON_USE_TYPE_SLOTS
55256086 PyNumberMethods *m;
55276088 const char *name = NULL;
55286089 PyObject *res = NULL;
55296090 #if PY_MAJOR_VERSION < 3
5530 if (PyInt_Check(x) || PyLong_Check(x))
5531 #else
5532 if (PyLong_Check(x))
6091 if (likely(PyInt_Check(x) || PyLong_Check(x)))
6092 #else
6093 if (likely(PyLong_Check(x)))
55336094 #endif
55346095 return __Pyx_NewRef(x);
55356096 #if CYTHON_USE_TYPE_SLOTS
55376098 #if PY_MAJOR_VERSION < 3
55386099 if (m && m->nb_int) {
55396100 name = "int";
5540 res = PyNumber_Int(x);
6101 res = m->nb_int(x);
55416102 }
55426103 else if (m && m->nb_long) {
55436104 name = "long";
5544 res = PyNumber_Long(x);
6105 res = m->nb_long(x);
55456106 }
55466107 #else
5547 if (m && m->nb_int) {
6108 if (likely(m && m->nb_int)) {
55486109 name = "int";
5549 res = PyNumber_Long(x);
6110 res = m->nb_int(x);
55506111 }
55516112 #endif
55526113 #else
5553 res = PyNumber_Int(x);
5554 #endif
5555 if (res) {
6114 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
6115 res = PyNumber_Int(x);
6116 }
6117 #endif
6118 if (likely(res)) {
55566119 #if PY_MAJOR_VERSION < 3
5557 if (!PyInt_Check(res) && !PyLong_Check(res)) {
5558 #else
5559 if (!PyLong_Check(res)) {
5560 #endif
5561 PyErr_Format(PyExc_TypeError,
5562 "__%.4s__ returned non-%.4s (type %.200s)",
5563 name, name, Py_TYPE(res)->tp_name);
5564 Py_DECREF(res);
5565 return NULL;
6120 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
6121 #else
6122 if (unlikely(!PyLong_CheckExact(res))) {
6123 #endif
6124 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
55666125 }
55676126 }
55686127 else if (!PyErr_Occurred()) {
56336192 Py_DECREF(x);
56346193 return ival;
56356194 }
6195 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
6196 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
6197 }
56366198 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
56376199 return PyInt_FromSize_t(ival);
56386200 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
8 #else
9 #define CYTHON_ABI "0_25_2"
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
8 #else
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
102120 #define CYTHON_COMPILING_IN_CPYTHON 1
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
105129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
409549 { \
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420552
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
428560
429561 #define __PYX_HAVE__pygame_sdl2__joystick
430562 #define __PYX_HAVE_API__pygame_sdl2__joystick
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
437570 #include <omp.h>
438571 #endif /* _OPENMP */
439572
440 #ifdef PYREX_WITHOUT_ASSERTIONS
573 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
441574 #define CYTHON_WITHOUT_ASSERTIONS
442575 #endif
443576
468601 #define __Pyx_sst_abs(value) abs(value)
469602 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
470603 #define __Pyx_sst_abs(value) labs(value)
471 #elif defined (_MSC_VER) && defined (_M_X64)
472 #define __Pyx_sst_abs(value) _abs64(value)
604 #elif defined (_MSC_VER)
605 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
473606 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
474607 #define __Pyx_sst_abs(value) llabs(value)
475608 #elif defined (__GNUC__)
477610 #else
478611 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
479612 #endif
480 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
481 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
613 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
614 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
482615 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
483616 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
484617 #define __Pyx_PyBytes_FromString PyBytes_FromString
491624 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
492625 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
493626 #endif
494 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
495 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
627 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
628 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
629 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
634 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
635 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
496638 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
497639 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
498640 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
499641 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
500642 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
501 #if PY_MAJOR_VERSION < 3
502 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
503 {
643 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
504644 const Py_UNICODE *u_end = u;
505645 while (*u_end++) ;
506646 return (size_t)(u_end - u - 1);
507647 }
508 #else
509 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
510 #endif
511648 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
512649 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
513650 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
514651 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
515652 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
516 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
653 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
517654 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
518655 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
656 #define __Pyx_PySequence_Tuple(obj)\
657 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
519658 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
520659 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
521660 #if CYTHON_ASSUME_SAFE_MACROS
614753 #define likely(x) (x)
615754 #define unlikely(x) (x)
616755 #endif /* __GNUC__ */
617
618 static PyObject *__pyx_m;
756 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
757
758 static PyObject *__pyx_m = NULL;
619759 static PyObject *__pyx_d;
620760 static PyObject *__pyx_b;
761 static PyObject *__pyx_cython_runtime = NULL;
621762 static PyObject *__pyx_empty_tuple;
622763 static PyObject *__pyx_empty_bytes;
623764 static PyObject *__pyx_empty_unicode;
628769
629770
630771 static const char *__pyx_f[] = {
772 "stringsource",
631773 "src/pygame_sdl2/joystick.pyx",
632774 };
633775
715857
716858 /* PyObjectGetAttrStr.proto */
717859 #if CYTHON_USE_TYPE_SLOTS
718 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
719 PyTypeObject* tp = Py_TYPE(obj);
720 if (likely(tp->tp_getattro))
721 return tp->tp_getattro(obj, attr_name);
722 #if PY_MAJOR_VERSION < 3
723 if (likely(tp->tp_getattr))
724 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
725 #endif
726 return PyObject_GetAttr(obj, attr_name);
727 }
860 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
728861 #else
729862 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
730863 #endif
778911 /* PyThreadStateGet.proto */
779912 #if CYTHON_FAST_THREAD_STATE
780913 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
781 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
914 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
915 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
782916 #else
783917 #define __Pyx_PyThreadState_declare
784918 #define __Pyx_PyThreadState_assign
919 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
785920 #endif
786921
787922 /* PyErrFetchRestore.proto */
788923 #if CYTHON_FAST_THREAD_STATE
924 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
789925 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
790926 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
791927 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
792928 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
793929 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
794930 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
795 #else
931 #if CYTHON_COMPILING_IN_CPYTHON
932 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
933 #else
934 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
935 #endif
936 #else
937 #define __Pyx_PyErr_Clear() PyErr_Clear()
938 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
796939 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
797940 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
941 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
942 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
798943 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
799944 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
800945 #endif
807952 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
808953
809954 /* KeywordStringCheck.proto */
810 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
955 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
811956
812957 /* RaiseDoubleKeywords.proto */
813958 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
817962 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
818963 const char* function_name);
819964
965 /* PyObject_GenericGetAttrNoDict.proto */
966 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
967 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
968 #else
969 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
970 #endif
971
972 /* PyObject_GenericGetAttr.proto */
973 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
974 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
975 #else
976 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
977 #endif
978
979 /* SetupReduce.proto */
980 static int __Pyx_setup_reduce(PyObject* type_obj);
981
820982 /* Import.proto */
821983 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
822984
823985 /* ImportFrom.proto */
824986 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
987
988 /* CLineInTraceback.proto */
989 #ifdef CYTHON_CLINE_IN_TRACEBACK
990 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
991 #else
992 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
993 #endif
825994
826995 /* CodeObjectCache.proto */
827996 typedef struct {
8571026 /* CIntFromPy.proto */
8581027 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
8591028
1029 /* FastTypeChecks.proto */
1030 #if CYTHON_COMPILING_IN_CPYTHON
1031 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1032 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1033 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1034 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1035 #else
1036 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1037 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1038 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1039 #endif
1040 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1041
8601042 /* CheckBinaryVersion.proto */
8611043 static int __Pyx_check_binary_version(void);
8621044
8771059 /* Module declarations from 'pygame_sdl2.joystick' */
8781060 static PyTypeObject *__pyx_ptype_11pygame_sdl2_8joystick_Joystick = 0;
8791061 #define __Pyx_MODULE_NAME "pygame_sdl2.joystick"
1062 extern int __pyx_module_is_main_pygame_sdl2__joystick;
8801063 int __pyx_module_is_main_pygame_sdl2__joystick = 0;
8811064
8821065 /* Implementation of 'pygame_sdl2.joystick' */
1066 static PyObject *__pyx_builtin_TypeError;
8831067 static const char __pyx_k_id[] = "id";
8841068 static const char __pyx_k_init[] = "init";
8851069 static const char __pyx_k_main[] = "__main__";
1070 static const char __pyx_k_name[] = "__name__";
8861071 static const char __pyx_k_quit[] = "quit";
8871072 static const char __pyx_k_test[] = "__test__";
8881073 static const char __pyx_k_error[] = "error";
8891074 static const char __pyx_k_import[] = "__import__";
1075 static const char __pyx_k_reduce[] = "__reduce__";
8901076 static const char __pyx_k_display[] = "display";
8911077 static const char __pyx_k_get_init[] = "get_init";
1078 static const char __pyx_k_getstate[] = "__getstate__";
1079 static const char __pyx_k_setstate[] = "__setstate__";
1080 static const char __pyx_k_TypeError[] = "TypeError";
8921081 static const char __pyx_k_get_count[] = "get_count";
1082 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
8931083 static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2";
1084 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
8941085 static const char __pyx_k_register_init[] = "register_init";
8951086 static const char __pyx_k_register_quit[] = "register_quit";
8961087 static const char __pyx_k_sdl_main_init[] = "sdl_main_init";
1088 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
8971089 static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error";
1090 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
8981091 static const char __pyx_k_pygame_sdl2_joystick[] = "pygame_sdl2.joystick";
8991092 static const char __pyx_k_joystick_not_initialized[] = "joystick not initialized";
9001093 static const char __pyx_k_src_pygame_sdl2_joystick_pyx[] = "src/pygame_sdl2/joystick.pyx";
1094 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
1095 static PyObject *__pyx_n_s_TypeError;
1096 static PyObject *__pyx_n_s_cline_in_traceback;
9011097 static PyObject *__pyx_n_s_display;
9021098 static PyObject *__pyx_n_s_error;
9031099 static PyObject *__pyx_n_s_get_count;
9041100 static PyObject *__pyx_n_s_get_init;
1101 static PyObject *__pyx_n_s_getstate;
9051102 static PyObject *__pyx_n_s_id;
9061103 static PyObject *__pyx_n_s_import;
9071104 static PyObject *__pyx_n_s_init;
9081105 static PyObject *__pyx_kp_u_joystick_not_initialized;
9091106 static PyObject *__pyx_n_s_main;
1107 static PyObject *__pyx_n_s_name;
1108 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
9101109 static PyObject *__pyx_n_s_pygame_sdl2;
9111110 static PyObject *__pyx_n_s_pygame_sdl2_error;
9121111 static PyObject *__pyx_n_s_pygame_sdl2_joystick;
9131112 static PyObject *__pyx_n_s_quit;
1113 static PyObject *__pyx_n_s_reduce;
1114 static PyObject *__pyx_n_s_reduce_cython;
1115 static PyObject *__pyx_n_s_reduce_ex;
9141116 static PyObject *__pyx_n_s_register_init;
9151117 static PyObject *__pyx_n_s_register_quit;
9161118 static PyObject *__pyx_n_s_sdl_main_init;
1119 static PyObject *__pyx_n_s_setstate;
1120 static PyObject *__pyx_n_s_setstate_cython;
9171121 static PyObject *__pyx_kp_s_src_pygame_sdl2_joystick_pyx;
9181122 static PyObject *__pyx_n_s_test;
9191123 static PyObject *__pyx_pf_11pygame_sdl2_8joystick_init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
9351139 static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_24get_ball(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_ball_number); /* proto */
9361140 static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_26get_button(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_button); /* proto */
9371141 static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_28get_hat(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, PyObject *__pyx_v_hat_number); /* proto */
1142 static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self); /* proto */
1143 static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_32__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
9381144 static PyObject *__pyx_tp_new_11pygame_sdl2_8joystick_Joystick(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
9391145 static PyObject *__pyx_tuple_;
9401146 static PyObject *__pyx_tuple__2;
9461152 static PyObject *__pyx_tuple__8;
9471153 static PyObject *__pyx_tuple__9;
9481154 static PyObject *__pyx_tuple__10;
949 static PyObject *__pyx_codeobj__11;
950 static PyObject *__pyx_codeobj__12;
1155 static PyObject *__pyx_tuple__11;
1156 static PyObject *__pyx_tuple__12;
9511157 static PyObject *__pyx_codeobj__13;
9521158 static PyObject *__pyx_codeobj__14;
1159 static PyObject *__pyx_codeobj__15;
1160 static PyObject *__pyx_codeobj__16;
1161 /* Late includes */
9531162
9541163 /* "pygame_sdl2/joystick.pyx":24
9551164 *
9891198 *
9901199 * if SDL_InitSubSystem(SDL_INIT_JOYSTICK):
9911200 */
992 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
1201 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error)
9931202 __Pyx_GOTREF(__pyx_t_2);
994 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
1203 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 25, __pyx_L1_error)
9951204 __Pyx_GOTREF(__pyx_t_3);
9961205 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
997 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
1206 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sdl_main_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 25, __pyx_L1_error)
9981207 __Pyx_GOTREF(__pyx_t_2);
9991208 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10001209 __pyx_t_3 = NULL;
10081217 }
10091218 }
10101219 if (__pyx_t_3) {
1011 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
1220 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error)
10121221 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10131222 } else {
1014 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
1223 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error)
10151224 }
10161225 __Pyx_GOTREF(__pyx_t_1);
10171226 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10251234 *
10261235 */
10271236 __pyx_t_4 = (SDL_InitSubSystem(SDL_INIT_JOYSTICK) != 0);
1028 if (__pyx_t_4) {
1237 if (unlikely(__pyx_t_4)) {
10291238
10301239 /* "pygame_sdl2/joystick.pyx":28
10311240 *
10341243 *
10351244 * @pygame_sdl2.register_quit
10361245 */
1037 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
1246 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 28, __pyx_L1_error)
10381247 __Pyx_GOTREF(__pyx_t_2);
10391248 __pyx_t_3 = NULL;
10401249 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
10471256 }
10481257 }
10491258 if (__pyx_t_3) {
1050 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
1259 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error)
10511260 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10521261 } else {
1053 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
1262 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error)
10541263 }
10551264 __Pyx_GOTREF(__pyx_t_1);
10561265 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10571266 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10581267 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1059 __PYX_ERR(0, 28, __pyx_L1_error)
1268 __PYX_ERR(1, 28, __pyx_L1_error)
10601269
10611270 /* "pygame_sdl2/joystick.pyx":27
10621271 * pygame_sdl2.display.sdl_main_init()
11771386 * def get_count():
11781387 */
11791388 __Pyx_XDECREF(__pyx_r);
1180 __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_WasInit(SDL_INIT_JOYSTICK) != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
1389 __pyx_t_1 = __Pyx_PyBool_FromLong((SDL_WasInit(SDL_INIT_JOYSTICK) != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error)
11811390 __Pyx_GOTREF(__pyx_t_1);
11821391 __pyx_r = __pyx_t_1;
11831392 __pyx_t_1 = 0;
12381447 *
12391448 */
12401449 __Pyx_XDECREF(__pyx_r);
1241 __pyx_t_1 = __Pyx_PyInt_From_int(SDL_NumJoysticks()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
1450 __pyx_t_1 = __Pyx_PyInt_From_int(SDL_NumJoysticks()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error)
12421451 __Pyx_GOTREF(__pyx_t_1);
12431452 __pyx_r = __pyx_t_1;
12441453 __pyx_t_1 = 0;
13381547 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13391548 switch (pos_args) {
13401549 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1550 CYTHON_FALLTHROUGH;
13411551 case 0: break;
13421552 default: goto __pyx_L5_argtuple_error;
13431553 }
13441554 kw_args = PyDict_Size(__pyx_kwds);
13451555 switch (pos_args) {
13461556 case 0:
1347 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_id)) != 0)) kw_args--;
1557 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_id)) != 0)) kw_args--;
13481558 else goto __pyx_L5_argtuple_error;
13491559 }
13501560 if (unlikely(kw_args > 0)) {
1351 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 51, __pyx_L3_error)
1561 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 51, __pyx_L3_error)
13521562 }
13531563 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
13541564 goto __pyx_L5_argtuple_error;
13591569 }
13601570 goto __pyx_L4_argument_unpacking_done;
13611571 __pyx_L5_argtuple_error:;
1362 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 51, __pyx_L3_error)
1572 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 51, __pyx_L3_error)
13631573 __pyx_L3_error:;
13641574 __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13651575 __Pyx_RefNannyFinishContext();
13851595 *
13861596 * def init(self):
13871597 */
1388 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_id); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error)
1598 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_id); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 52, __pyx_L1_error)
13891599 __pyx_v_self->joyid = __pyx_t_1;
13901600
13911601 /* "pygame_sdl2/joystick.pyx":51
14641674 *
14651675 */
14661676 __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0);
1467 if (__pyx_t_1) {
1677 if (unlikely(__pyx_t_1)) {
14681678
14691679 /* "pygame_sdl2/joystick.pyx":58
14701680 * self.joystick = SDL_JoystickOpen(self.joyid)
14731683 *
14741684 * def quit(self): # @ReservedAssignment
14751685 */
1476 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error)
1686 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 58, __pyx_L1_error)
14771687 __Pyx_GOTREF(__pyx_t_3);
14781688 __pyx_t_4 = NULL;
14791689 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
14861696 }
14871697 }
14881698 if (__pyx_t_4) {
1489 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
1699 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 58, __pyx_L1_error)
14901700 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14911701 } else {
1492 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
1702 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 58, __pyx_L1_error)
14931703 }
14941704 __Pyx_GOTREF(__pyx_t_2);
14951705 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14961706 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
14971707 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1498 __PYX_ERR(0, 58, __pyx_L1_error)
1708 __PYX_ERR(1, 58, __pyx_L1_error)
14991709
15001710 /* "pygame_sdl2/joystick.pyx":57
15011711 * if self.joystick == NULL:
17411951 *
17421952 */
17431953 __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0);
1744 if (__pyx_t_1) {
1954 if (unlikely(__pyx_t_1)) {
17451955
17461956 /* "pygame_sdl2/joystick.pyx":73
17471957 * def get_id(self):
17501960 *
17511961 * return SDL_JoystickInstanceID(self.joystick)
17521962 */
1753 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error)
1963 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 73, __pyx_L1_error)
17541964 __Pyx_GOTREF(__pyx_t_2);
1755 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error)
1965 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 73, __pyx_L1_error)
17561966 __Pyx_GOTREF(__pyx_t_3);
17571967 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17581968 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
17591969 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1760 __PYX_ERR(0, 73, __pyx_L1_error)
1970 __PYX_ERR(1, 73, __pyx_L1_error)
17611971
17621972 /* "pygame_sdl2/joystick.pyx":72
17631973 *
17761986 * def get_name(self):
17771987 */
17781988 __Pyx_XDECREF(__pyx_r);
1779 __pyx_t_3 = __Pyx_PyInt_From_int32_t(SDL_JoystickInstanceID(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error)
1989 __pyx_t_3 = __Pyx_PyInt_From_int32_t(SDL_JoystickInstanceID(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 75, __pyx_L1_error)
17801990 __Pyx_GOTREF(__pyx_t_3);
17811991 __pyx_r = __pyx_t_3;
17821992 __pyx_t_3 = 0;
18402050 *
18412051 */
18422052 __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0);
1843 if (__pyx_t_1) {
2053 if (unlikely(__pyx_t_1)) {
18442054
18452055 /* "pygame_sdl2/joystick.pyx":81
18462056 *
18492059 *
18502060 * rv = SDL_JoystickName(self.joystick)
18512061 */
1852 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
2062 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 81, __pyx_L1_error)
18532063 __Pyx_GOTREF(__pyx_t_2);
1854 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error)
2064 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 81, __pyx_L1_error)
18552065 __Pyx_GOTREF(__pyx_t_3);
18562066 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18572067 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
18582068 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1859 __PYX_ERR(0, 81, __pyx_L1_error)
2069 __PYX_ERR(1, 81, __pyx_L1_error)
18602070
18612071 /* "pygame_sdl2/joystick.pyx":80
18622072 * cdef char *rv
18942104 * return None
18952105 */
18962106 __Pyx_XDECREF(__pyx_r);
1897 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
2107 __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_rv); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 86, __pyx_L1_error)
18982108 __Pyx_GOTREF(__pyx_t_3);
18992109 __pyx_r = __pyx_t_3;
19002110 __pyx_t_3 = 0;
19182128 */
19192129 /*else*/ {
19202130 __Pyx_XDECREF(__pyx_r);
1921 __Pyx_INCREF(Py_None);
1922 __pyx_r = Py_None;
2131 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19232132 goto __pyx_L0;
19242133 }
19252134
19802189 *
19812190 */
19822191 __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0);
1983 if (__pyx_t_1) {
2192 if (unlikely(__pyx_t_1)) {
19842193
19852194 /* "pygame_sdl2/joystick.pyx":92
19862195 * def get_numaxes(self):
19892198 *
19902199 * return SDL_JoystickNumAxes(self.joystick)
19912200 */
1992 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error)
2201 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 92, __pyx_L1_error)
19932202 __Pyx_GOTREF(__pyx_t_2);
1994 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error)
2203 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 92, __pyx_L1_error)
19952204 __Pyx_GOTREF(__pyx_t_3);
19962205 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19972206 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
19982207 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1999 __PYX_ERR(0, 92, __pyx_L1_error)
2208 __PYX_ERR(1, 92, __pyx_L1_error)
20002209
20012210 /* "pygame_sdl2/joystick.pyx":91
20022211 *
20152224 * def get_numballs(self):
20162225 */
20172226 __Pyx_XDECREF(__pyx_r);
2018 __pyx_t_3 = __Pyx_PyInt_From_int(SDL_JoystickNumAxes(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
2227 __pyx_t_3 = __Pyx_PyInt_From_int(SDL_JoystickNumAxes(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 94, __pyx_L1_error)
20192228 __Pyx_GOTREF(__pyx_t_3);
20202229 __pyx_r = __pyx_t_3;
20212230 __pyx_t_3 = 0;
20782287 *
20792288 */
20802289 __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0);
2081 if (__pyx_t_1) {
2290 if (unlikely(__pyx_t_1)) {
20822291
20832292 /* "pygame_sdl2/joystick.pyx":98
20842293 * def get_numballs(self):
20872296 *
20882297 * return SDL_JoystickNumBalls(self.joystick)
20892298 */
2090 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
2299 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 98, __pyx_L1_error)
20912300 __Pyx_GOTREF(__pyx_t_2);
2092 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error)
2301 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 98, __pyx_L1_error)
20932302 __Pyx_GOTREF(__pyx_t_3);
20942303 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20952304 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20962305 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2097 __PYX_ERR(0, 98, __pyx_L1_error)
2306 __PYX_ERR(1, 98, __pyx_L1_error)
20982307
20992308 /* "pygame_sdl2/joystick.pyx":97
21002309 *
21132322 * def get_numbuttons(self):
21142323 */
21152324 __Pyx_XDECREF(__pyx_r);
2116 __pyx_t_3 = __Pyx_PyInt_From_int(SDL_JoystickNumBalls(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
2325 __pyx_t_3 = __Pyx_PyInt_From_int(SDL_JoystickNumBalls(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 100, __pyx_L1_error)
21172326 __Pyx_GOTREF(__pyx_t_3);
21182327 __pyx_r = __pyx_t_3;
21192328 __pyx_t_3 = 0;
21762385 *
21772386 */
21782387 __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0);
2179 if (__pyx_t_1) {
2388 if (unlikely(__pyx_t_1)) {
21802389
21812390 /* "pygame_sdl2/joystick.pyx":104
21822391 * def get_numbuttons(self):
21852394 *
21862395 * return SDL_JoystickNumButtons(self.joystick)
21872396 */
2188 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
2397 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 104, __pyx_L1_error)
21892398 __Pyx_GOTREF(__pyx_t_2);
2190 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error)
2399 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 104, __pyx_L1_error)
21912400 __Pyx_GOTREF(__pyx_t_3);
21922401 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21932402 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21942403 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2195 __PYX_ERR(0, 104, __pyx_L1_error)
2404 __PYX_ERR(1, 104, __pyx_L1_error)
21962405
21972406 /* "pygame_sdl2/joystick.pyx":103
21982407 *
22112420 * def get_numhats(self):
22122421 */
22132422 __Pyx_XDECREF(__pyx_r);
2214 __pyx_t_3 = __Pyx_PyInt_From_int(SDL_JoystickNumButtons(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error)
2423 __pyx_t_3 = __Pyx_PyInt_From_int(SDL_JoystickNumButtons(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 106, __pyx_L1_error)
22152424 __Pyx_GOTREF(__pyx_t_3);
22162425 __pyx_r = __pyx_t_3;
22172426 __pyx_t_3 = 0;
22742483 *
22752484 */
22762485 __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0);
2277 if (__pyx_t_1) {
2486 if (unlikely(__pyx_t_1)) {
22782487
22792488 /* "pygame_sdl2/joystick.pyx":110
22802489 * def get_numhats(self):
22832492 *
22842493 * return SDL_JoystickNumHats(self.joystick)
22852494 */
2286 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
2495 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 110, __pyx_L1_error)
22872496 __Pyx_GOTREF(__pyx_t_2);
2288 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 110, __pyx_L1_error)
2497 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 110, __pyx_L1_error)
22892498 __Pyx_GOTREF(__pyx_t_3);
22902499 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22912500 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
22922501 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2293 __PYX_ERR(0, 110, __pyx_L1_error)
2502 __PYX_ERR(1, 110, __pyx_L1_error)
22942503
22952504 /* "pygame_sdl2/joystick.pyx":109
22962505 *
23092518 * def get_axis(self, axis_number):
23102519 */
23112520 __Pyx_XDECREF(__pyx_r);
2312 __pyx_t_3 = __Pyx_PyInt_From_int(SDL_JoystickNumHats(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 112, __pyx_L1_error)
2521 __pyx_t_3 = __Pyx_PyInt_From_int(SDL_JoystickNumHats(__pyx_v_self->joystick)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 112, __pyx_L1_error)
23132522 __Pyx_GOTREF(__pyx_t_3);
23142523 __pyx_r = __pyx_t_3;
23152524 __pyx_t_3 = 0;
23732582 *
23742583 */
23752584 __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0);
2376 if (__pyx_t_1) {
2585 if (unlikely(__pyx_t_1)) {
23772586
23782587 /* "pygame_sdl2/joystick.pyx":116
23792588 * def get_axis(self, axis_number):
23822591 *
23832592 * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0
23842593 */
2385 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error)
2594 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 116, __pyx_L1_error)
23862595 __Pyx_GOTREF(__pyx_t_2);
2387 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error)
2596 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 116, __pyx_L1_error)
23882597 __Pyx_GOTREF(__pyx_t_3);
23892598 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23902599 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
23912600 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2392 __PYX_ERR(0, 116, __pyx_L1_error)
2601 __PYX_ERR(1, 116, __pyx_L1_error)
23932602
23942603 /* "pygame_sdl2/joystick.pyx":115
23952604 *
24082617 * def get_ball(self, ball_number):
24092618 */
24102619 __Pyx_XDECREF(__pyx_r);
2411 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_axis_number); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L1_error)
2412 __pyx_t_3 = PyFloat_FromDouble((((double)SDL_JoystickGetAxis(__pyx_v_self->joystick, __pyx_t_4)) / 32768.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error)
2620 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_axis_number); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 118, __pyx_L1_error)
2621 __pyx_t_3 = PyFloat_FromDouble((((double)SDL_JoystickGetAxis(__pyx_v_self->joystick, __pyx_t_4)) / 32768.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 118, __pyx_L1_error)
24132622 __Pyx_GOTREF(__pyx_t_3);
24142623 __pyx_r = __pyx_t_3;
24152624 __pyx_t_3 = 0;
24762685 *
24772686 */
24782687 __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0);
2479 if (__pyx_t_1) {
2688 if (unlikely(__pyx_t_1)) {
24802689
24812690 /* "pygame_sdl2/joystick.pyx":124
24822691 *
24852694 *
24862695 * if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0:
24872696 */
2488 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
2697 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 124, __pyx_L1_error)
24892698 __Pyx_GOTREF(__pyx_t_2);
2490 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error)
2699 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 124, __pyx_L1_error)
24912700 __Pyx_GOTREF(__pyx_t_3);
24922701 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24932702 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
24942703 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2495 __PYX_ERR(0, 124, __pyx_L1_error)
2704 __PYX_ERR(1, 124, __pyx_L1_error)
24962705
24972706 /* "pygame_sdl2/joystick.pyx":123
24982707 * cdef int dx, dy
25102719 * return (dx, dy)
25112720 * else:
25122721 */
2513 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_ball_number); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 126, __pyx_L1_error)
2722 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_ball_number); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 126, __pyx_L1_error)
25142723 __pyx_t_1 = ((SDL_JoystickGetBall(__pyx_v_self->joystick, __pyx_t_4, (&__pyx_v_dx), (&__pyx_v_dy)) == 0) != 0);
2515 if (__pyx_t_1) {
2724 if (likely(__pyx_t_1)) {
25162725
25172726 /* "pygame_sdl2/joystick.pyx":127
25182727 *
25222731 * raise error()
25232732 */
25242733 __Pyx_XDECREF(__pyx_r);
2525 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error)
2734 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 127, __pyx_L1_error)
25262735 __Pyx_GOTREF(__pyx_t_3);
2527 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_dy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error)
2736 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_dy); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 127, __pyx_L1_error)
25282737 __Pyx_GOTREF(__pyx_t_2);
2529 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 127, __pyx_L1_error)
2738 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 127, __pyx_L1_error)
25302739 __Pyx_GOTREF(__pyx_t_5);
25312740 __Pyx_GIVEREF(__pyx_t_3);
25322741 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
25552764 * def get_button(self, button):
25562765 */
25572766 /*else*/ {
2558 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
2767 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 129, __pyx_L1_error)
25592768 __Pyx_GOTREF(__pyx_t_2);
25602769 __pyx_t_3 = NULL;
25612770 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
25682777 }
25692778 }
25702779 if (__pyx_t_3) {
2571 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 129, __pyx_L1_error)
2780 __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 129, __pyx_L1_error)
25722781 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25732782 } else {
2574 __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 129, __pyx_L1_error)
2783 __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 129, __pyx_L1_error)
25752784 }
25762785 __Pyx_GOTREF(__pyx_t_5);
25772786 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25782787 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
25792788 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2580 __PYX_ERR(0, 129, __pyx_L1_error)
2789 __PYX_ERR(1, 129, __pyx_L1_error)
25812790 }
25822791
25832792 /* "pygame_sdl2/joystick.pyx":120
26392848 *
26402849 */
26412850 __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0);
2642 if (__pyx_t_1) {
2851 if (unlikely(__pyx_t_1)) {
26432852
26442853 /* "pygame_sdl2/joystick.pyx":133
26452854 * def get_button(self, button):
26482857 *
26492858 * return SDL_JoystickGetButton(self.joystick, button) == 1
26502859 */
2651 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
2860 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 133, __pyx_L1_error)
26522861 __Pyx_GOTREF(__pyx_t_2);
2653 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error)
2862 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
26542863 __Pyx_GOTREF(__pyx_t_3);
26552864 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26562865 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
26572866 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2658 __PYX_ERR(0, 133, __pyx_L1_error)
2867 __PYX_ERR(1, 133, __pyx_L1_error)
26592868
26602869 /* "pygame_sdl2/joystick.pyx":132
26612870 *
26742883 * def get_hat(self, hat_number):
26752884 */
26762885 __Pyx_XDECREF(__pyx_r);
2677 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_button); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error)
2678 __pyx_t_3 = __Pyx_PyBool_FromLong((SDL_JoystickGetButton(__pyx_v_self->joystick, __pyx_t_4) == 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
2886 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_button); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 135, __pyx_L1_error)
2887 __pyx_t_3 = __Pyx_PyBool_FromLong((SDL_JoystickGetButton(__pyx_v_self->joystick, __pyx_t_4) == 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 135, __pyx_L1_error)
26792888 __Pyx_GOTREF(__pyx_t_3);
26802889 __pyx_r = __pyx_t_3;
26812890 __pyx_t_3 = 0;
27432952 *
27442953 */
27452954 __pyx_t_1 = ((__pyx_v_self->joystick == NULL) != 0);
2746 if (__pyx_t_1) {
2955 if (unlikely(__pyx_t_1)) {
27472956
27482957 /* "pygame_sdl2/joystick.pyx":139
27492958 * def get_hat(self, hat_number):
27522961 *
27532962 * state = SDL_JoystickGetHat(self.joystick, hat_number)
27542963 */
2755 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
2964 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 139, __pyx_L1_error)
27562965 __Pyx_GOTREF(__pyx_t_2);
2757 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
2966 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
27582967 __Pyx_GOTREF(__pyx_t_3);
27592968 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27602969 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
27612970 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2762 __PYX_ERR(0, 139, __pyx_L1_error)
2971 __PYX_ERR(1, 139, __pyx_L1_error)
27632972
27642973 /* "pygame_sdl2/joystick.pyx":138
27652974 *
27772986 * hx = hy = 0
27782987 * if state & SDL_HAT_LEFT:
27792988 */
2780 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_hat_number); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L1_error)
2989 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_hat_number); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
27812990 __pyx_v_state = SDL_JoystickGetHat(__pyx_v_self->joystick, __pyx_t_4);
27822991
27832992 /* "pygame_sdl2/joystick.pyx":142
29123121 * return (hx, hy) # <<<<<<<<<<<<<<
29133122 */
29143123 __Pyx_XDECREF(__pyx_r);
2915 __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_hx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
3124 __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_hx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 153, __pyx_L1_error)
29163125 __Pyx_GOTREF(__pyx_t_3);
2917 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_hy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
3126 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_hy); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 153, __pyx_L1_error)
29183127 __Pyx_GOTREF(__pyx_t_2);
2919 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error)
3128 __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
29203129 __Pyx_GOTREF(__pyx_t_5);
29213130 __Pyx_GIVEREF(__pyx_t_3);
29223131 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
29443153 __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.get_hat", __pyx_clineno, __pyx_lineno, __pyx_filename);
29453154 __pyx_r = NULL;
29463155 __pyx_L0:;
3156 __Pyx_XGIVEREF(__pyx_r);
3157 __Pyx_RefNannyFinishContext();
3158 return __pyx_r;
3159 }
3160
3161 /* "(tree fragment)":1
3162 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3163 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3164 * def __setstate_cython__(self, __pyx_state):
3165 */
3166
3167 /* Python wrapper */
3168 static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_31__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3169 static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_31__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3170 PyObject *__pyx_r = 0;
3171 __Pyx_RefNannyDeclarations
3172 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3173 __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_30__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self));
3174
3175 /* function exit code */
3176 __Pyx_RefNannyFinishContext();
3177 return __pyx_r;
3178 }
3179
3180 static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self) {
3181 PyObject *__pyx_r = NULL;
3182 __Pyx_RefNannyDeclarations
3183 PyObject *__pyx_t_1 = NULL;
3184 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3185
3186 /* "(tree fragment)":2
3187 * def __reduce_cython__(self):
3188 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3189 * def __setstate_cython__(self, __pyx_state):
3190 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3191 */
3192 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
3193 __Pyx_GOTREF(__pyx_t_1);
3194 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3195 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3196 __PYX_ERR(0, 2, __pyx_L1_error)
3197
3198 /* "(tree fragment)":1
3199 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3200 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3201 * def __setstate_cython__(self, __pyx_state):
3202 */
3203
3204 /* function exit code */
3205 __pyx_L1_error:;
3206 __Pyx_XDECREF(__pyx_t_1);
3207 __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3208 __pyx_r = NULL;
3209 __Pyx_XGIVEREF(__pyx_r);
3210 __Pyx_RefNannyFinishContext();
3211 return __pyx_r;
3212 }
3213
3214 /* "(tree fragment)":3
3215 * def __reduce_cython__(self):
3216 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3217 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3218 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3219 */
3220
3221 /* Python wrapper */
3222 static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_33__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
3223 static PyObject *__pyx_pw_11pygame_sdl2_8joystick_8Joystick_33__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3224 PyObject *__pyx_r = 0;
3225 __Pyx_RefNannyDeclarations
3226 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3227 __pyx_r = __pyx_pf_11pygame_sdl2_8joystick_8Joystick_32__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3228
3229 /* function exit code */
3230 __Pyx_RefNannyFinishContext();
3231 return __pyx_r;
3232 }
3233
3234 static PyObject *__pyx_pf_11pygame_sdl2_8joystick_8Joystick_32__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
3235 PyObject *__pyx_r = NULL;
3236 __Pyx_RefNannyDeclarations
3237 PyObject *__pyx_t_1 = NULL;
3238 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3239
3240 /* "(tree fragment)":4
3241 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3242 * def __setstate_cython__(self, __pyx_state):
3243 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3244 */
3245 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
3246 __Pyx_GOTREF(__pyx_t_1);
3247 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3248 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3249 __PYX_ERR(0, 4, __pyx_L1_error)
3250
3251 /* "(tree fragment)":3
3252 * def __reduce_cython__(self):
3253 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3254 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3255 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3256 */
3257
3258 /* function exit code */
3259 __pyx_L1_error:;
3260 __Pyx_XDECREF(__pyx_t_1);
3261 __Pyx_AddTraceback("pygame_sdl2.joystick.Joystick.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3262 __pyx_r = NULL;
29473263 __Pyx_XGIVEREF(__pyx_r);
29483264 __Pyx_RefNannyFinishContext();
29493265 return __pyx_r;
29663282
29673283 static void __pyx_tp_dealloc_11pygame_sdl2_8joystick_Joystick(PyObject *o) {
29683284 struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *p = (struct __pyx_obj_11pygame_sdl2_8joystick_Joystick *)o;
2969 #if PY_VERSION_HEX >= 0x030400a1
2970 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
3285 #if CYTHON_USE_TP_FINALIZE
3286 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
29713287 if (PyObject_CallFinalizerFromDealloc(o)) return;
29723288 }
29733289 #endif
29893305 {"get_ball", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_25get_ball, METH_O, 0},
29903306 {"get_button", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_27get_button, METH_O, 0},
29913307 {"get_hat", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_29get_hat, METH_O, 0},
3308 {"__reduce_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_31__reduce_cython__, METH_NOARGS, 0},
3309 {"__setstate_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_8joystick_8Joystick_33__setstate_cython__, METH_O, 0},
29923310 {0, 0, 0, 0}
29933311 };
29943312
30553373 };
30563374
30573375 #if PY_MAJOR_VERSION >= 3
3376 #if CYTHON_PEP489_MULTI_PHASE_INIT
3377 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
3378 static int __pyx_pymod_exec_joystick(PyObject* module); /*proto*/
3379 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
3380 {Py_mod_create, (void*)__pyx_pymod_create},
3381 {Py_mod_exec, (void*)__pyx_pymod_exec_joystick},
3382 {0, NULL}
3383 };
3384 #endif
3385
30583386 static struct PyModuleDef __pyx_moduledef = {
3059 #if PY_VERSION_HEX < 0x03020000
3060 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
3061 #else
30623387 PyModuleDef_HEAD_INIT,
3063 #endif
30643388 "joystick",
30653389 0, /* m_doc */
3390 #if CYTHON_PEP489_MULTI_PHASE_INIT
3391 0, /* m_size */
3392 #else
30663393 -1, /* m_size */
3394 #endif
30673395 __pyx_methods /* m_methods */,
3396 #if CYTHON_PEP489_MULTI_PHASE_INIT
3397 __pyx_moduledef_slots, /* m_slots */
3398 #else
30683399 NULL, /* m_reload */
3400 #endif
30693401 NULL, /* m_traverse */
30703402 NULL, /* m_clear */
30713403 NULL /* m_free */
30733405 #endif
30743406
30753407 static __Pyx_StringTabEntry __pyx_string_tab[] = {
3408 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
3409 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
30763410 {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1},
30773411 {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
30783412 {&__pyx_n_s_get_count, __pyx_k_get_count, sizeof(__pyx_k_get_count), 0, 0, 1, 1},
30793413 {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1},
3414 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
30803415 {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
30813416 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
30823417 {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
30833418 {&__pyx_kp_u_joystick_not_initialized, __pyx_k_joystick_not_initialized, sizeof(__pyx_k_joystick_not_initialized), 0, 1, 0, 0},
30843419 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
3420 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
3421 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
30853422 {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1},
30863423 {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1},
30873424 {&__pyx_n_s_pygame_sdl2_joystick, __pyx_k_pygame_sdl2_joystick, sizeof(__pyx_k_pygame_sdl2_joystick), 0, 0, 1, 1},
30883425 {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1},
3426 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
3427 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
3428 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
30893429 {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1},
30903430 {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1},
30913431 {&__pyx_n_s_sdl_main_init, __pyx_k_sdl_main_init, sizeof(__pyx_k_sdl_main_init), 0, 0, 1, 1},
3432 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
3433 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
30923434 {&__pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_k_src_pygame_sdl2_joystick_pyx, sizeof(__pyx_k_src_pygame_sdl2_joystick_pyx), 0, 0, 1, 0},
30933435 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
30943436 {0, 0, 0, 0, 0, 0, 0}
30953437 };
30963438 static int __Pyx_InitCachedBuiltins(void) {
3439 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error)
30973440 return 0;
3441 __pyx_L1_error:;
3442 return -1;
30983443 }
30993444
31003445 static int __Pyx_InitCachedConstants(void) {
31083453 *
31093454 * return SDL_JoystickInstanceID(self.joystick)
31103455 */
3111 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 73, __pyx_L1_error)
3456 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 73, __pyx_L1_error)
31123457 __Pyx_GOTREF(__pyx_tuple_);
31133458 __Pyx_GIVEREF(__pyx_tuple_);
31143459
31193464 *
31203465 * rv = SDL_JoystickName(self.joystick)
31213466 */
3122 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 81, __pyx_L1_error)
3467 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 81, __pyx_L1_error)
31233468 __Pyx_GOTREF(__pyx_tuple__2);
31243469 __Pyx_GIVEREF(__pyx_tuple__2);
31253470
31303475 *
31313476 * return SDL_JoystickNumAxes(self.joystick)
31323477 */
3133 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 92, __pyx_L1_error)
3478 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 92, __pyx_L1_error)
31343479 __Pyx_GOTREF(__pyx_tuple__3);
31353480 __Pyx_GIVEREF(__pyx_tuple__3);
31363481
31413486 *
31423487 * return SDL_JoystickNumBalls(self.joystick)
31433488 */
3144 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 98, __pyx_L1_error)
3489 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 98, __pyx_L1_error)
31453490 __Pyx_GOTREF(__pyx_tuple__4);
31463491 __Pyx_GIVEREF(__pyx_tuple__4);
31473492
31523497 *
31533498 * return SDL_JoystickNumButtons(self.joystick)
31543499 */
3155 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 104, __pyx_L1_error)
3500 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 104, __pyx_L1_error)
31563501 __Pyx_GOTREF(__pyx_tuple__5);
31573502 __Pyx_GIVEREF(__pyx_tuple__5);
31583503
31633508 *
31643509 * return SDL_JoystickNumHats(self.joystick)
31653510 */
3166 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 110, __pyx_L1_error)
3511 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 110, __pyx_L1_error)
31673512 __Pyx_GOTREF(__pyx_tuple__6);
31683513 __Pyx_GIVEREF(__pyx_tuple__6);
31693514
31743519 *
31753520 * return SDL_JoystickGetAxis(self.joystick, axis_number) / 32768.0
31763521 */
3177 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 116, __pyx_L1_error)
3522 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 116, __pyx_L1_error)
31783523 __Pyx_GOTREF(__pyx_tuple__7);
31793524 __Pyx_GIVEREF(__pyx_tuple__7);
31803525
31853530 *
31863531 * if SDL_JoystickGetBall(self.joystick, ball_number, &dx, &dy) == 0:
31873532 */
3188 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 124, __pyx_L1_error)
3533 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 124, __pyx_L1_error)
31893534 __Pyx_GOTREF(__pyx_tuple__8);
31903535 __Pyx_GIVEREF(__pyx_tuple__8);
31913536
31963541 *
31973542 * return SDL_JoystickGetButton(self.joystick, button) == 1
31983543 */
3199 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 133, __pyx_L1_error)
3544 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 133, __pyx_L1_error)
32003545 __Pyx_GOTREF(__pyx_tuple__9);
32013546 __Pyx_GIVEREF(__pyx_tuple__9);
32023547
32073552 *
32083553 * state = SDL_JoystickGetHat(self.joystick, hat_number)
32093554 */
3210 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 139, __pyx_L1_error)
3555 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_joystick_not_initialized); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 139, __pyx_L1_error)
32113556 __Pyx_GOTREF(__pyx_tuple__10);
32123557 __Pyx_GIVEREF(__pyx_tuple__10);
3558
3559 /* "(tree fragment)":2
3560 * def __reduce_cython__(self):
3561 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3562 * def __setstate_cython__(self, __pyx_state):
3563 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3564 */
3565 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 2, __pyx_L1_error)
3566 __Pyx_GOTREF(__pyx_tuple__11);
3567 __Pyx_GIVEREF(__pyx_tuple__11);
3568
3569 /* "(tree fragment)":4
3570 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3571 * def __setstate_cython__(self, __pyx_state):
3572 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3573 */
3574 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 4, __pyx_L1_error)
3575 __Pyx_GOTREF(__pyx_tuple__12);
3576 __Pyx_GIVEREF(__pyx_tuple__12);
32133577
32143578 /* "pygame_sdl2/joystick.pyx":24
32153579 *
32183582 * pygame_sdl2.display.sdl_main_init()
32193583 *
32203584 */
3221 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_init, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 24, __pyx_L1_error)
3585 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_init, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(1, 24, __pyx_L1_error)
32223586
32233587 /* "pygame_sdl2/joystick.pyx":31
32243588 *
32273591 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK)
32283592 *
32293593 */
3230 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_quit, 31, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 31, __pyx_L1_error)
3594 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_quit, 31, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 31, __pyx_L1_error)
32313595
32323596 /* "pygame_sdl2/joystick.pyx":34
32333597 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK)
32363600 * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0
32373601 *
32383602 */
3239 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_init, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 34, __pyx_L1_error)
3603 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_init, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(1, 34, __pyx_L1_error)
32403604
32413605 /* "pygame_sdl2/joystick.pyx":37
32423606 * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0
32453609 * return SDL_NumJoysticks()
32463610 *
32473611 */
3248 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_count, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 37, __pyx_L1_error)
3612 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_joystick_pyx, __pyx_n_s_get_count, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 37, __pyx_L1_error)
32493613 __Pyx_RefNannyFinishContext();
32503614 return 0;
32513615 __pyx_L1_error:;
32543618 }
32553619
32563620 static int __Pyx_InitGlobals(void) {
3257 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
3621 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
32583622 return 0;
32593623 __pyx_L1_error:;
32603624 return -1;
32613625 }
32623626
3627 static int __Pyx_modinit_global_init_code(void); /*proto*/
3628 static int __Pyx_modinit_variable_export_code(void); /*proto*/
3629 static int __Pyx_modinit_function_export_code(void); /*proto*/
3630 static int __Pyx_modinit_type_init_code(void); /*proto*/
3631 static int __Pyx_modinit_type_import_code(void); /*proto*/
3632 static int __Pyx_modinit_variable_import_code(void); /*proto*/
3633 static int __Pyx_modinit_function_import_code(void); /*proto*/
3634
3635 static int __Pyx_modinit_global_init_code(void) {
3636 __Pyx_RefNannyDeclarations
3637 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
3638 /*--- Global init code ---*/
3639 __Pyx_RefNannyFinishContext();
3640 return 0;
3641 }
3642
3643 static int __Pyx_modinit_variable_export_code(void) {
3644 __Pyx_RefNannyDeclarations
3645 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
3646 /*--- Variable export code ---*/
3647 __Pyx_RefNannyFinishContext();
3648 return 0;
3649 }
3650
3651 static int __Pyx_modinit_function_export_code(void) {
3652 __Pyx_RefNannyDeclarations
3653 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
3654 /*--- Function export code ---*/
3655 __Pyx_RefNannyFinishContext();
3656 return 0;
3657 }
3658
3659 static int __Pyx_modinit_type_init_code(void) {
3660 __Pyx_RefNannyDeclarations
3661 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
3662 /*--- Type init code ---*/
3663 if (PyType_Ready(&__pyx_type_11pygame_sdl2_8joystick_Joystick) < 0) __PYX_ERR(1, 41, __pyx_L1_error)
3664 __pyx_type_11pygame_sdl2_8joystick_Joystick.tp_print = 0;
3665 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11pygame_sdl2_8joystick_Joystick.tp_dictoffset && __pyx_type_11pygame_sdl2_8joystick_Joystick.tp_getattro == PyObject_GenericGetAttr)) {
3666 __pyx_type_11pygame_sdl2_8joystick_Joystick.tp_getattro = __Pyx_PyObject_GenericGetAttr;
3667 }
3668 if (PyObject_SetAttrString(__pyx_m, "Joystick", (PyObject *)&__pyx_type_11pygame_sdl2_8joystick_Joystick) < 0) __PYX_ERR(1, 41, __pyx_L1_error)
3669 if (__pyx_type_11pygame_sdl2_8joystick_Joystick.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_8joystick_Joystick.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick, __weakref__);
3670 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11pygame_sdl2_8joystick_Joystick) < 0) __PYX_ERR(1, 41, __pyx_L1_error)
3671 __pyx_ptype_11pygame_sdl2_8joystick_Joystick = &__pyx_type_11pygame_sdl2_8joystick_Joystick;
3672 __Pyx_RefNannyFinishContext();
3673 return 0;
3674 __pyx_L1_error:;
3675 __Pyx_RefNannyFinishContext();
3676 return -1;
3677 }
3678
3679 static int __Pyx_modinit_type_import_code(void) {
3680 __Pyx_RefNannyDeclarations
3681 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
3682 /*--- Type import code ---*/
3683 __Pyx_RefNannyFinishContext();
3684 return 0;
3685 }
3686
3687 static int __Pyx_modinit_variable_import_code(void) {
3688 __Pyx_RefNannyDeclarations
3689 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
3690 /*--- Variable import code ---*/
3691 __Pyx_RefNannyFinishContext();
3692 return 0;
3693 }
3694
3695 static int __Pyx_modinit_function_import_code(void) {
3696 __Pyx_RefNannyDeclarations
3697 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
3698 /*--- Function import code ---*/
3699 __Pyx_RefNannyFinishContext();
3700 return 0;
3701 }
3702
3703
32633704 #if PY_MAJOR_VERSION < 3
3264 PyMODINIT_FUNC initjoystick(void); /*proto*/
3265 PyMODINIT_FUNC initjoystick(void)
3266 #else
3267 PyMODINIT_FUNC PyInit_joystick(void); /*proto*/
3268 PyMODINIT_FUNC PyInit_joystick(void)
3705 #ifdef CYTHON_NO_PYINIT_EXPORT
3706 #define __Pyx_PyMODINIT_FUNC void
3707 #else
3708 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
3709 #endif
3710 #else
3711 #ifdef CYTHON_NO_PYINIT_EXPORT
3712 #define __Pyx_PyMODINIT_FUNC PyObject *
3713 #else
3714 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
3715 #endif
3716 #endif
3717 #ifndef CYTHON_SMALL_CODE
3718 #if defined(__clang__)
3719 #define CYTHON_SMALL_CODE
3720 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
3721 #define CYTHON_SMALL_CODE __attribute__((cold))
3722 #else
3723 #define CYTHON_SMALL_CODE
3724 #endif
3725 #endif
3726
3727
3728 #if PY_MAJOR_VERSION < 3
3729 __Pyx_PyMODINIT_FUNC initjoystick(void) CYTHON_SMALL_CODE; /*proto*/
3730 __Pyx_PyMODINIT_FUNC initjoystick(void)
3731 #else
3732 __Pyx_PyMODINIT_FUNC PyInit_joystick(void) CYTHON_SMALL_CODE; /*proto*/
3733 __Pyx_PyMODINIT_FUNC PyInit_joystick(void)
3734 #if CYTHON_PEP489_MULTI_PHASE_INIT
3735 {
3736 return PyModuleDef_Init(&__pyx_moduledef);
3737 }
3738 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
3739 PyObject *value = PyObject_GetAttrString(spec, from_name);
3740 int result = 0;
3741 if (likely(value)) {
3742 result = PyDict_SetItemString(moddict, to_name, value);
3743 Py_DECREF(value);
3744 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
3745 PyErr_Clear();
3746 } else {
3747 result = -1;
3748 }
3749 return result;
3750 }
3751 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
3752 PyObject *module = NULL, *moddict, *modname;
3753 if (__pyx_m)
3754 return __Pyx_NewRef(__pyx_m);
3755 modname = PyObject_GetAttrString(spec, "name");
3756 if (unlikely(!modname)) goto bad;
3757 module = PyModule_NewObject(modname);
3758 Py_DECREF(modname);
3759 if (unlikely(!module)) goto bad;
3760 moddict = PyModule_GetDict(module);
3761 if (unlikely(!moddict)) goto bad;
3762 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
3763 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
3764 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
3765 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
3766 return module;
3767 bad:
3768 Py_XDECREF(module);
3769 return NULL;
3770 }
3771
3772
3773 static int __pyx_pymod_exec_joystick(PyObject *__pyx_pyinit_module)
3774 #endif
32693775 #endif
32703776 {
32713777 PyObject *__pyx_t_1 = NULL;
32723778 PyObject *__pyx_t_2 = NULL;
32733779 PyObject *__pyx_t_3 = NULL;
3274 PyObject *__pyx_t_4 = NULL;
3275 PyObject *__pyx_t_5 = NULL;
32763780 __Pyx_RefNannyDeclarations
3781 #if CYTHON_PEP489_MULTI_PHASE_INIT
3782 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
3783 #elif PY_MAJOR_VERSION >= 3
3784 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
3785 #endif
32773786 #if CYTHON_REFNANNY
3278 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
3279 if (!__Pyx_RefNanny) {
3280 PyErr_Clear();
3281 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
3282 if (!__Pyx_RefNanny)
3283 Py_FatalError("failed to import 'refnanny' module");
3284 }
3285 #endif
3286 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_joystick(void)", 0);
3287 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3288 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
3289 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
3290 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
3787 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
3788 if (!__Pyx_RefNanny) {
3789 PyErr_Clear();
3790 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
3791 if (!__Pyx_RefNanny)
3792 Py_FatalError("failed to import 'refnanny' module");
3793 }
3794 #endif
3795 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_joystick(void)", 0);
3796 if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3797 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error)
3798 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error)
3799 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error)
32913800 #ifdef __Pyx_CyFunction_USED
3292 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3801 if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
32933802 #endif
32943803 #ifdef __Pyx_FusedFunction_USED
3295 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3804 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
32963805 #endif
32973806 #ifdef __Pyx_Coroutine_USED
3298 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3807 if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
32993808 #endif
33003809 #ifdef __Pyx_Generator_USED
3301 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3810 if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3811 #endif
3812 #ifdef __Pyx_AsyncGen_USED
3813 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
33023814 #endif
33033815 #ifdef __Pyx_StopAsyncIteration_USED
3304 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3816 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
33053817 #endif
33063818 /*--- Library function declarations ---*/
33073819 /*--- Threads initialization code ---*/
33113823 #endif
33123824 #endif
33133825 /*--- Module creation code ---*/
3826 #if CYTHON_PEP489_MULTI_PHASE_INIT
3827 __pyx_m = __pyx_pyinit_module;
3828 Py_INCREF(__pyx_m);
3829 #else
33143830 #if PY_MAJOR_VERSION < 3
33153831 __pyx_m = Py_InitModule4("joystick", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
33163832 #else
33173833 __pyx_m = PyModule_Create(&__pyx_moduledef);
33183834 #endif
3319 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
3320 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
3835 if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
3836 #endif
3837 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error)
33213838 Py_INCREF(__pyx_d);
3322 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
3839 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error)
3840 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error)
33233841 #if CYTHON_COMPILING_IN_PYPY
33243842 Py_INCREF(__pyx_b);
33253843 #endif
3326 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
3844 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
33273845 /*--- Initialize various global constants etc. ---*/
3328 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3846 if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
33293847 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
3330 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3848 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
33313849 #endif
33323850 if (__pyx_module_is_main_pygame_sdl2__joystick) {
3333 if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3851 if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
33343852 }
33353853 #if PY_MAJOR_VERSION >= 3
33363854 {
3337 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
3855 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error)
33383856 if (!PyDict_GetItemString(modules, "pygame_sdl2.joystick")) {
3339 if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.joystick", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
3857 if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.joystick", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
33403858 }
33413859 }
33423860 #endif
33433861 /*--- Builtin init code ---*/
3344 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3862 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
33453863 /*--- Constants init code ---*/
3346 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3347 /*--- Global init code ---*/
3348 /*--- Variable export code ---*/
3349 /*--- Function export code ---*/
3350 /*--- Type init code ---*/
3351 if (PyType_Ready(&__pyx_type_11pygame_sdl2_8joystick_Joystick) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
3352 __pyx_type_11pygame_sdl2_8joystick_Joystick.tp_print = 0;
3353 if (PyObject_SetAttrString(__pyx_m, "Joystick", (PyObject *)&__pyx_type_11pygame_sdl2_8joystick_Joystick) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
3354 if (__pyx_type_11pygame_sdl2_8joystick_Joystick.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_8joystick_Joystick.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_8joystick_Joystick, __weakref__);
3355 __pyx_ptype_11pygame_sdl2_8joystick_Joystick = &__pyx_type_11pygame_sdl2_8joystick_Joystick;
3356 /*--- Type import code ---*/
3357 /*--- Variable import code ---*/
3358 /*--- Function import code ---*/
3864 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
3865 /*--- Global type/function init code ---*/
3866 (void)__Pyx_modinit_global_init_code();
3867 (void)__Pyx_modinit_variable_export_code();
3868 (void)__Pyx_modinit_function_export_code();
3869 if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
3870 (void)__Pyx_modinit_type_import_code();
3871 (void)__Pyx_modinit_variable_import_code();
3872 (void)__Pyx_modinit_function_import_code();
33593873 /*--- Execution code ---*/
33603874 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
3361 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3875 if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
33623876 #endif
33633877
33643878 /* "pygame_sdl2/joystick.pyx":20
33683882 * import pygame_sdl2
33693883 *
33703884 */
3371 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
3885 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 20, __pyx_L1_error)
33723886 __Pyx_GOTREF(__pyx_t_1);
33733887 __Pyx_INCREF(__pyx_n_s_error);
33743888 __Pyx_GIVEREF(__pyx_n_s_error);
33753889 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_error);
3376 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
3890 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 20, __pyx_L1_error)
33773891 __Pyx_GOTREF(__pyx_t_2);
33783892 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3379 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
3893 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 20, __pyx_L1_error)
33803894 __Pyx_GOTREF(__pyx_t_1);
3381 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_1) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
3895 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_1) < 0) __PYX_ERR(1, 20, __pyx_L1_error)
33823896 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33833897 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33843898
33893903 *
33903904 * @pygame_sdl2.register_init
33913905 */
3392 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
3906 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 21, __pyx_L1_error)
33933907 __Pyx_GOTREF(__pyx_t_2);
3394 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
3908 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) __PYX_ERR(1, 21, __pyx_L1_error)
33953909 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33963910
33973911 /* "pygame_sdl2/joystick.pyx":23
34013915 * def init():
34023916 * pygame_sdl2.display.sdl_main_init()
34033917 */
3404 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
3918 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 23, __pyx_L1_error)
3919 __Pyx_GOTREF(__pyx_t_2);
3920 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_register_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error)
34053921 __Pyx_GOTREF(__pyx_t_1);
3406 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_register_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error)
3407 __Pyx_GOTREF(__pyx_t_3);
3408 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3922 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34093923
34103924 /* "pygame_sdl2/joystick.pyx":24
34113925 *
34143928 * pygame_sdl2.display.sdl_main_init()
34153929 *
34163930 */
3417 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_8joystick_1init, NULL, __pyx_n_s_pygame_sdl2_joystick); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
3418 __Pyx_GOTREF(__pyx_t_1);
3419 __pyx_t_4 = NULL;
3420 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3421 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
3422 if (likely(__pyx_t_4)) {
3423 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3424 __Pyx_INCREF(__pyx_t_4);
3425 __Pyx_INCREF(function);
3426 __Pyx_DECREF_SET(__pyx_t_3, function);
3427 }
3428 }
3429 if (!__pyx_t_4) {
3430 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
3431 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3432 __Pyx_GOTREF(__pyx_t_2);
3433 } else {
3434 #if CYTHON_FAST_PYCALL
3435 if (PyFunction_Check(__pyx_t_3)) {
3436 PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
3437 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
3438 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3439 __Pyx_GOTREF(__pyx_t_2);
3440 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3441 } else
3442 #endif
3443 #if CYTHON_FAST_PYCCALL
3444 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3445 PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
3446 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
3447 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3448 __Pyx_GOTREF(__pyx_t_2);
3449 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3450 } else
3451 #endif
3452 {
3453 __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 23, __pyx_L1_error)
3454 __Pyx_GOTREF(__pyx_t_5);
3455 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
3456 __Pyx_GIVEREF(__pyx_t_1);
3457 PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_1);
3458 __pyx_t_1 = 0;
3459 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
3460 __Pyx_GOTREF(__pyx_t_2);
3461 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3462 }
3463 }
3931 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_8joystick_1init, NULL, __pyx_n_s_pygame_sdl2_joystick); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 24, __pyx_L1_error)
3932 __Pyx_GOTREF(__pyx_t_2);
3933
3934 /* "pygame_sdl2/joystick.pyx":23
3935 * import pygame_sdl2
3936 *
3937 * @pygame_sdl2.register_init # <<<<<<<<<<<<<<
3938 * def init():
3939 * pygame_sdl2.display.sdl_main_init()
3940 */
3941 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 23, __pyx_L1_error)
3942 __Pyx_GOTREF(__pyx_t_3);
3943 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3944 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3945 if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(1, 24, __pyx_L1_error)
34643946 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3465 if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
3466 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34673947
34683948 /* "pygame_sdl2/joystick.pyx":30
34693949 * raise error()
34723952 * def quit(): # @ReservedAssignment
34733953 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK)
34743954 */
3475 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
3955 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 30, __pyx_L1_error)
34763956 __Pyx_GOTREF(__pyx_t_3);
3477 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 30, __pyx_L1_error)
3478 __Pyx_GOTREF(__pyx_t_5);
3957 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 30, __pyx_L1_error)
3958 __Pyx_GOTREF(__pyx_t_2);
34793959 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34803960
34813961 /* "pygame_sdl2/joystick.pyx":31
34853965 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK)
34863966 *
34873967 */
3488 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_8joystick_3quit, NULL, __pyx_n_s_pygame_sdl2_joystick); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)
3968 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_8joystick_3quit, NULL, __pyx_n_s_pygame_sdl2_joystick); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 31, __pyx_L1_error)
34893969 __Pyx_GOTREF(__pyx_t_3);
3490 __pyx_t_1 = NULL;
3491 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3492 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
3493 if (likely(__pyx_t_1)) {
3494 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
3495 __Pyx_INCREF(__pyx_t_1);
3496 __Pyx_INCREF(function);
3497 __Pyx_DECREF_SET(__pyx_t_5, function);
3498 }
3499 }
3500 if (!__pyx_t_1) {
3501 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
3502 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3503 __Pyx_GOTREF(__pyx_t_2);
3504 } else {
3505 #if CYTHON_FAST_PYCALL
3506 if (PyFunction_Check(__pyx_t_5)) {
3507 PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
3508 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
3509 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3510 __Pyx_GOTREF(__pyx_t_2);
3511 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3512 } else
3513 #endif
3514 #if CYTHON_FAST_PYCCALL
3515 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
3516 PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
3517 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
3518 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3519 __Pyx_GOTREF(__pyx_t_2);
3520 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3521 } else
3522 #endif
3523 {
3524 __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error)
3525 __Pyx_GOTREF(__pyx_t_4);
3526 __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL;
3527 __Pyx_GIVEREF(__pyx_t_3);
3528 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
3529 __pyx_t_3 = 0;
3530 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
3531 __Pyx_GOTREF(__pyx_t_2);
3532 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3533 }
3534 }
3535 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3536 if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
3970
3971 /* "pygame_sdl2/joystick.pyx":30
3972 * raise error()
3973 *
3974 * @pygame_sdl2.register_quit # <<<<<<<<<<<<<<
3975 * def quit(): # @ReservedAssignment
3976 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK)
3977 */
3978 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 30, __pyx_L1_error)
3979 __Pyx_GOTREF(__pyx_t_1);
35373980 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3981 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3982 if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_1) < 0) __PYX_ERR(1, 31, __pyx_L1_error)
3983 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35383984
35393985 /* "pygame_sdl2/joystick.pyx":34
35403986 * SDL_QuitSubSystem(SDL_INIT_JOYSTICK)
35433989 * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0
35443990 *
35453991 */
3546 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_8joystick_5get_init, NULL, __pyx_n_s_pygame_sdl2_joystick); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
3547 __Pyx_GOTREF(__pyx_t_2);
3548 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_2) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
3549 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3992 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_8joystick_5get_init, NULL, __pyx_n_s_pygame_sdl2_joystick); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 34, __pyx_L1_error)
3993 __Pyx_GOTREF(__pyx_t_1);
3994 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_1) < 0) __PYX_ERR(1, 34, __pyx_L1_error)
3995 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35503996
35513997 /* "pygame_sdl2/joystick.pyx":37
35523998 * return SDL_WasInit(SDL_INIT_JOYSTICK) != 0
35554001 * return SDL_NumJoysticks()
35564002 *
35574003 */
3558 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_8joystick_7get_count, NULL, __pyx_n_s_pygame_sdl2_joystick); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
3559 __Pyx_GOTREF(__pyx_t_2);
3560 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_count, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
3561 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4004 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_8joystick_7get_count, NULL, __pyx_n_s_pygame_sdl2_joystick); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 37, __pyx_L1_error)
4005 __Pyx_GOTREF(__pyx_t_1);
4006 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_count, __pyx_t_1) < 0) __PYX_ERR(1, 37, __pyx_L1_error)
4007 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35624008
35634009 /* "pygame_sdl2/joystick.pyx":1
35644010 * # Copyright 2014 Patrick Dawson <pat@dw.is> # <<<<<<<<<<<<<<
35654011 * #
35664012 * # This software is provided 'as-is', without any express or implied
35674013 */
3568 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
3569 __Pyx_GOTREF(__pyx_t_2);
3570 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3571 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4014 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
4015 __Pyx_GOTREF(__pyx_t_1);
4016 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
4017 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35724018
35734019 /*--- Wrapped vars code ---*/
35744020
35774023 __Pyx_XDECREF(__pyx_t_1);
35784024 __Pyx_XDECREF(__pyx_t_2);
35794025 __Pyx_XDECREF(__pyx_t_3);
3580 __Pyx_XDECREF(__pyx_t_4);
3581 __Pyx_XDECREF(__pyx_t_5);
35824026 if (__pyx_m) {
35834027 if (__pyx_d) {
3584 __Pyx_AddTraceback("init pygame_sdl2.joystick", __pyx_clineno, __pyx_lineno, __pyx_filename);
4028 __Pyx_AddTraceback("init pygame_sdl2.joystick", 0, __pyx_lineno, __pyx_filename);
35854029 }
35864030 Py_DECREF(__pyx_m); __pyx_m = 0;
35874031 } else if (!PyErr_Occurred()) {
35894033 }
35904034 __pyx_L0:;
35914035 __Pyx_RefNannyFinishContext();
3592 #if PY_MAJOR_VERSION < 3
4036 #if CYTHON_PEP489_MULTI_PHASE_INIT
4037 return (__pyx_m != NULL) ? 0 : -1;
4038 #elif PY_MAJOR_VERSION >= 3
4039 return __pyx_m;
4040 #else
35934041 return;
3594 #else
3595 return __pyx_m;
35964042 #endif
35974043 }
35984044
36144060 }
36154061 #endif
36164062
4063 /* PyObjectGetAttrStr */
4064 #if CYTHON_USE_TYPE_SLOTS
4065 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
4066 PyTypeObject* tp = Py_TYPE(obj);
4067 if (likely(tp->tp_getattro))
4068 return tp->tp_getattro(obj, attr_name);
4069 #if PY_MAJOR_VERSION < 3
4070 if (likely(tp->tp_getattr))
4071 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
4072 #endif
4073 return PyObject_GetAttr(obj, attr_name);
4074 }
4075 #endif
4076
36174077 /* GetBuiltinName */
36184078 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
36194079 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
36324092 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
36334093 PyObject *result;
36344094 #if !CYTHON_AVOID_BORROWED_REFS
4095 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
4096 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
4097 if (likely(result)) {
4098 Py_INCREF(result);
4099 } else if (unlikely(PyErr_Occurred())) {
4100 result = NULL;
4101 } else {
4102 #else
36354103 result = PyDict_GetItem(__pyx_d, name);
36364104 if (likely(result)) {
36374105 Py_INCREF(result);
36384106 } else {
4107 #endif
36394108 #else
36404109 result = PyObject_GetItem(__pyx_d, name);
36414110 if (!result) {
36474116 }
36484117
36494118 /* PyCFunctionFastCall */
3650 #if CYTHON_FAST_PYCCALL
4119 #if CYTHON_FAST_PYCCALL
36514120 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
36524121 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
36534122 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
36544123 PyObject *self = PyCFunction_GET_SELF(func);
4124 int flags = PyCFunction_GET_FLAGS(func);
36554125 assert(PyCFunction_Check(func));
3656 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
4126 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
36574127 assert(nargs >= 0);
36584128 assert(nargs == 0 || args != NULL);
36594129 /* _PyCFunction_FastCallDict() must not be called with an exception set,
36604130 because it may clear it (directly or indirectly) and so the
36614131 caller loses its exception */
36624132 assert(!PyErr_Occurred());
3663 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
3664 }
3665 #endif // CYTHON_FAST_PYCCALL
4133 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
4134 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
4135 } else {
4136 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
4137 }
4138 }
4139 #endif
36664140
36674141 /* PyFunctionFastCall */
3668 #if CYTHON_FAST_PYCALL
4142 #if CYTHON_FAST_PYCALL
36694143 #include "frameobject.h"
36704144 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
36714145 PyObject *globals) {
36724146 PyFrameObject *f;
3673 PyThreadState *tstate = PyThreadState_GET();
4147 PyThreadState *tstate = __Pyx_PyThreadState_Current;
36744148 PyObject **fastlocals;
36754149 Py_ssize_t i;
36764150 PyObject *result;
37814255 Py_LeaveRecursiveCall();
37824256 return result;
37834257 }
3784 #endif // CPython < 3.6
3785 #endif // CYTHON_FAST_PYCALL
4258 #endif
4259 #endif
37864260
37874261 /* PyObjectCall */
3788 #if CYTHON_COMPILING_IN_CPYTHON
4262 #if CYTHON_COMPILING_IN_CPYTHON
37894263 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
37904264 PyObject *result;
37914265 ternaryfunc call = func->ob_type->tp_call;
38054279 #endif
38064280
38074281 /* PyObjectCallMethO */
3808 #if CYTHON_COMPILING_IN_CPYTHON
4282 #if CYTHON_COMPILING_IN_CPYTHON
38094283 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
38104284 PyObject *self, *result;
38114285 PyCFunction cfunc;
38254299 #endif
38264300
38274301 /* PyObjectCallOneArg */
3828 #if CYTHON_COMPILING_IN_CPYTHON
4302 #if CYTHON_COMPILING_IN_CPYTHON
38294303 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
38304304 PyObject *result;
38314305 PyObject *args = PyTuple_New(1);
38424316 return __Pyx_PyFunction_FastCall(func, &arg, 1);
38434317 }
38444318 #endif
3845 #ifdef __Pyx_CyFunction_USED
3846 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
3847 #else
38484319 if (likely(PyCFunction_Check(func))) {
3849 #endif
38504320 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
38514321 return __Pyx_PyObject_CallMethO(func, arg);
38524322 #if CYTHON_FAST_PYCCALL
38774347 }
38784348 #endif
38794349 #ifdef __Pyx_CyFunction_USED
3880 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
4350 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
38814351 #else
38824352 if (likely(PyCFunction_Check(func))) {
38834353 #endif
40294499 "raise: exception class must be a subclass of BaseException");
40304500 goto bad;
40314501 }
4032 #if PY_VERSION_HEX >= 0x03030000
40334502 if (cause) {
4034 #else
4035 if (cause && cause != Py_None) {
4036 #endif
40374503 PyObject *fixed_cause;
40384504 if (cause == Py_None) {
40394505 fixed_cause = NULL;
40614527 PyErr_Restore(tmp_type, tmp_value, tb);
40624528 Py_XDECREF(tmp_tb);
40634529 #else
4064 PyThreadState *tstate = PyThreadState_GET();
4530 PyThreadState *tstate = __Pyx_PyThreadState_Current;
40654531 PyObject* tmp_tb = tstate->curexc_traceback;
40664532 if (tb != tmp_tb) {
40674533 Py_INCREF(tb);
40774543 #endif
40784544
40794545 /* RaiseArgTupleInvalid */
4080 static void __Pyx_RaiseArgtupleInvalid(
4546 static void __Pyx_RaiseArgtupleInvalid(
40814547 const char* func_name,
40824548 int exact,
40834549 Py_ssize_t num_min,
41034569 }
41044570
41054571 /* KeywordStringCheck */
4106 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
4572 static int __Pyx_CheckKeywordStrings(
41074573 PyObject *kwdict,
41084574 const char* function_name,
41094575 int kw_allowed)
41174583 #else
41184584 while (PyDict_Next(kwdict, &pos, &key, 0)) {
41194585 #if PY_MAJOR_VERSION < 3
4120 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
4586 if (unlikely(!PyString_Check(key)))
41214587 #endif
41224588 if (unlikely(!PyUnicode_Check(key)))
41234589 goto invalid_keyword_type;
41434609 }
41444610
41454611 /* RaiseDoubleKeywords */
4146 static void __Pyx_RaiseDoubleKeywordsError(
4612 static void __Pyx_RaiseDoubleKeywordsError(
41474613 const char* func_name,
41484614 PyObject* kw_name)
41494615 {
41574623 }
41584624
41594625 /* ParseKeywords */
4160 static int __Pyx_ParseOptionalKeywords(
4626 static int __Pyx_ParseOptionalKeywords(
41614627 PyObject *kwds,
41624628 PyObject **argnames[],
41634629 PyObject *kwds2,
42584724 return -1;
42594725 }
42604726
4727 /* PyObject_GenericGetAttrNoDict */
4728 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
4729 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
4730 PyErr_Format(PyExc_AttributeError,
4731 #if PY_MAJOR_VERSION >= 3
4732 "'%.50s' object has no attribute '%U'",
4733 tp->tp_name, attr_name);
4734 #else
4735 "'%.50s' object has no attribute '%.400s'",
4736 tp->tp_name, PyString_AS_STRING(attr_name));
4737 #endif
4738 return NULL;
4739 }
4740 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
4741 PyObject *descr;
4742 PyTypeObject *tp = Py_TYPE(obj);
4743 if (unlikely(!PyString_Check(attr_name))) {
4744 return PyObject_GenericGetAttr(obj, attr_name);
4745 }
4746 assert(!tp->tp_dictoffset);
4747 descr = _PyType_Lookup(tp, attr_name);
4748 if (unlikely(!descr)) {
4749 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
4750 }
4751 Py_INCREF(descr);
4752 #if PY_MAJOR_VERSION < 3
4753 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
4754 #endif
4755 {
4756 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
4757 if (unlikely(f)) {
4758 PyObject *res = f(descr, obj, (PyObject *)tp);
4759 Py_DECREF(descr);
4760 return res;
4761 }
4762 }
4763 return descr;
4764 }
4765 #endif
4766
4767 /* PyObject_GenericGetAttr */
4768 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
4769 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
4770 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
4771 return PyObject_GenericGetAttr(obj, attr_name);
4772 }
4773 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
4774 }
4775 #endif
4776
4777 /* SetupReduce */
4778 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
4779 int ret;
4780 PyObject *name_attr;
4781 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
4782 if (likely(name_attr)) {
4783 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
4784 } else {
4785 ret = -1;
4786 }
4787 if (unlikely(ret < 0)) {
4788 PyErr_Clear();
4789 ret = 0;
4790 }
4791 Py_XDECREF(name_attr);
4792 return ret;
4793 }
4794 static int __Pyx_setup_reduce(PyObject* type_obj) {
4795 int ret = 0;
4796 PyObject *object_reduce = NULL;
4797 PyObject *object_reduce_ex = NULL;
4798 PyObject *reduce = NULL;
4799 PyObject *reduce_ex = NULL;
4800 PyObject *reduce_cython = NULL;
4801 PyObject *setstate = NULL;
4802 PyObject *setstate_cython = NULL;
4803 #if CYTHON_USE_PYTYPE_LOOKUP
4804 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
4805 #else
4806 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
4807 #endif
4808 #if CYTHON_USE_PYTYPE_LOOKUP
4809 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
4810 #else
4811 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
4812 #endif
4813 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
4814 if (reduce_ex == object_reduce_ex) {
4815 #if CYTHON_USE_PYTYPE_LOOKUP
4816 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
4817 #else
4818 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
4819 #endif
4820 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
4821 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
4822 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
4823 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
4824 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
4825 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
4826 if (!setstate) PyErr_Clear();
4827 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
4828 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
4829 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
4830 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
4831 }
4832 PyType_Modified((PyTypeObject*)type_obj);
4833 }
4834 }
4835 goto GOOD;
4836 BAD:
4837 if (!PyErr_Occurred())
4838 PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
4839 ret = -1;
4840 GOOD:
4841 #if !CYTHON_USE_PYTYPE_LOOKUP
4842 Py_XDECREF(object_reduce);
4843 Py_XDECREF(object_reduce_ex);
4844 #endif
4845 Py_XDECREF(reduce);
4846 Py_XDECREF(reduce_ex);
4847 Py_XDECREF(reduce_cython);
4848 Py_XDECREF(setstate);
4849 Py_XDECREF(setstate_cython);
4850 return ret;
4851 }
4852
42614853 /* Import */
4262 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
4854 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
42634855 PyObject *empty_list = 0;
42644856 PyObject *module = 0;
42654857 PyObject *global_dict = 0;
42664858 PyObject *empty_dict = 0;
42674859 PyObject *list;
4268 #if PY_VERSION_HEX < 0x03030000
4860 #if PY_MAJOR_VERSION < 3
42694861 PyObject *py_import;
42704862 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
42714863 if (!py_import)
42894881 #if PY_MAJOR_VERSION >= 3
42904882 if (level == -1) {
42914883 if (strchr(__Pyx_MODULE_NAME, '.')) {
4292 #if PY_VERSION_HEX < 0x03030000
4293 PyObject *py_level = PyInt_FromLong(1);
4294 if (!py_level)
4295 goto bad;
4296 module = PyObject_CallFunctionObjArgs(py_import,
4297 name, global_dict, empty_dict, list, py_level, NULL);
4298 Py_DECREF(py_level);
4299 #else
43004884 module = PyImport_ImportModuleLevelObject(
43014885 name, global_dict, empty_dict, list, 1);
4302 #endif
43034886 if (!module) {
43044887 if (!PyErr_ExceptionMatches(PyExc_ImportError))
43054888 goto bad;
43104893 }
43114894 #endif
43124895 if (!module) {
4313 #if PY_VERSION_HEX < 0x03030000
4896 #if PY_MAJOR_VERSION < 3
43144897 PyObject *py_level = PyInt_FromLong(level);
43154898 if (!py_level)
43164899 goto bad;
43244907 }
43254908 }
43264909 bad:
4327 #if PY_VERSION_HEX < 0x03030000
4910 #if PY_MAJOR_VERSION < 3
43284911 Py_XDECREF(py_import);
43294912 #endif
43304913 Py_XDECREF(empty_list);
43334916 }
43344917
43354918 /* ImportFrom */
4336 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
4919 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
43374920 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
43384921 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
43394922 PyErr_Format(PyExc_ImportError,
43464929 return value;
43474930 }
43484931
4932 /* CLineInTraceback */
4933 #ifndef CYTHON_CLINE_IN_TRACEBACK
4934 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
4935 PyObject *use_cline;
4936 PyObject *ptype, *pvalue, *ptraceback;
4937 #if CYTHON_COMPILING_IN_CPYTHON
4938 PyObject **cython_runtime_dict;
4939 #endif
4940 if (unlikely(!__pyx_cython_runtime)) {
4941 return c_line;
4942 }
4943 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
4944 #if CYTHON_COMPILING_IN_CPYTHON
4945 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
4946 if (likely(cython_runtime_dict)) {
4947 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
4948 } else
4949 #endif
4950 {
4951 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
4952 if (use_cline_obj) {
4953 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
4954 Py_DECREF(use_cline_obj);
4955 } else {
4956 PyErr_Clear();
4957 use_cline = NULL;
4958 }
4959 }
4960 if (!use_cline) {
4961 c_line = 0;
4962 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
4963 }
4964 else if (PyObject_Not(use_cline) != 0) {
4965 c_line = 0;
4966 }
4967 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
4968 return c_line;
4969 }
4970 #endif
4971
43494972 /* CodeObjectCache */
4350 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
4973 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
43514974 int start = 0, mid = 0, end = count - 1;
43524975 if (end >= 0 && code_line > entries[end].code_line) {
43534976 return count;
44275050 }
44285051
44295052 /* AddTraceback */
4430 #include "compile.h"
5053 #include "compile.h"
44315054 #include "frameobject.h"
44325055 #include "traceback.h"
44335056 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
44865109 int py_line, const char *filename) {
44875110 PyCodeObject *py_code = 0;
44885111 PyFrameObject *py_frame = 0;
4489 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
5112 PyThreadState *tstate = __Pyx_PyThreadState_Current;
5113 if (c_line) {
5114 c_line = __Pyx_CLineForTraceback(tstate, c_line);
5115 }
5116 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
44905117 if (!py_code) {
44915118 py_code = __Pyx_CreateCodeObjectForTraceback(
44925119 funcname, c_line, py_line, filename);
44935120 if (!py_code) goto bad;
4494 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
5121 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
44955122 }
44965123 py_frame = PyFrame_New(
4497 PyThreadState_GET(), /*PyThreadState *tstate,*/
4498 py_code, /*PyCodeObject *code,*/
4499 __pyx_d, /*PyObject *globals,*/
4500 0 /*PyObject *locals*/
5124 tstate, /*PyThreadState *tstate,*/
5125 py_code, /*PyCodeObject *code,*/
5126 __pyx_d, /*PyObject *globals,*/
5127 0 /*PyObject *locals*/
45015128 );
45025129 if (!py_frame) goto bad;
45035130 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
45085135 }
45095136
45105137 /* CIntToPy */
4511 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
5138 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
45125139 const int neg_one = (int) -1, const_zero = (int) 0;
45135140 const int is_unsigned = neg_one > const_zero;
45145141 if (is_unsigned) {
45395166 }
45405167
45415168 /* CIntFromPyVerify */
4542 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
5169 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
45435170 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
45445171 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
45455172 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
45615188 }
45625189
45635190 /* CIntToPy */
4564 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) {
5191 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int32_t(int32_t value) {
45655192 const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0;
45665193 const int is_unsigned = neg_one > const_zero;
45675194 if (is_unsigned) {
45925219 }
45935220
45945221 /* CIntToPy */
4595 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
5222 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
45965223 const long neg_one = (long) -1, const_zero = (long) 0;
45975224 const int is_unsigned = neg_one > const_zero;
45985225 if (is_unsigned) {
46235250 }
46245251
46255252 /* CIntFromPy */
4626 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
5253 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
46275254 const int neg_one = (int) -1, const_zero = (int) 0;
46285255 const int is_unsigned = neg_one > const_zero;
46295256 #if PY_MAJOR_VERSION < 3
48125439 }
48135440
48145441 /* CIntFromPy */
4815 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
5442 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
48165443 const long neg_one = (long) -1, const_zero = (long) 0;
48175444 const int is_unsigned = neg_one > const_zero;
48185445 #if PY_MAJOR_VERSION < 3
50005627 return (long) -1;
50015628 }
50025629
5630 /* FastTypeChecks */
5631 #if CYTHON_COMPILING_IN_CPYTHON
5632 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
5633 while (a) {
5634 a = a->tp_base;
5635 if (a == b)
5636 return 1;
5637 }
5638 return b == &PyBaseObject_Type;
5639 }
5640 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
5641 PyObject *mro;
5642 if (a == b) return 1;
5643 mro = a->tp_mro;
5644 if (likely(mro)) {
5645 Py_ssize_t i, n;
5646 n = PyTuple_GET_SIZE(mro);
5647 for (i = 0; i < n; i++) {
5648 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
5649 return 1;
5650 }
5651 return 0;
5652 }
5653 return __Pyx_InBases(a, b);
5654 }
5655 #if PY_MAJOR_VERSION == 2
5656 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
5657 PyObject *exception, *value, *tb;
5658 int res;
5659 __Pyx_PyThreadState_declare
5660 __Pyx_PyThreadState_assign
5661 __Pyx_ErrFetch(&exception, &value, &tb);
5662 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
5663 if (unlikely(res == -1)) {
5664 PyErr_WriteUnraisable(err);
5665 res = 0;
5666 }
5667 if (!res) {
5668 res = PyObject_IsSubclass(err, exc_type2);
5669 if (unlikely(res == -1)) {
5670 PyErr_WriteUnraisable(err);
5671 res = 0;
5672 }
5673 }
5674 __Pyx_ErrRestore(exception, value, tb);
5675 return res;
5676 }
5677 #else
5678 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
5679 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
5680 if (!res) {
5681 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
5682 }
5683 return res;
5684 }
5685 #endif
5686 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
5687 Py_ssize_t i, n;
5688 assert(PyExceptionClass_Check(exc_type));
5689 n = PyTuple_GET_SIZE(tuple);
5690 #if PY_MAJOR_VERSION >= 3
5691 for (i=0; i<n; i++) {
5692 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
5693 }
5694 #endif
5695 for (i=0; i<n; i++) {
5696 PyObject *t = PyTuple_GET_ITEM(tuple, i);
5697 #if PY_MAJOR_VERSION < 3
5698 if (likely(exc_type == t)) return 1;
5699 #endif
5700 if (likely(PyExceptionClass_Check(t))) {
5701 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
5702 } else {
5703 }
5704 }
5705 return 0;
5706 }
5707 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
5708 if (likely(err == exc_type)) return 1;
5709 if (likely(PyExceptionClass_Check(err))) {
5710 if (likely(PyExceptionClass_Check(exc_type))) {
5711 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
5712 } else if (likely(PyTuple_Check(exc_type))) {
5713 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
5714 } else {
5715 }
5716 }
5717 return PyErr_GivenExceptionMatches(err, exc_type);
5718 }
5719 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
5720 assert(PyExceptionClass_Check(exc_type1));
5721 assert(PyExceptionClass_Check(exc_type2));
5722 if (likely(err == exc_type1 || err == exc_type2)) return 1;
5723 if (likely(PyExceptionClass_Check(err))) {
5724 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
5725 }
5726 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
5727 }
5728 #endif
5729
50035730 /* CheckBinaryVersion */
5004 static int __Pyx_check_binary_version(void) {
5731 static int __Pyx_check_binary_version(void) {
50055732 char ctversion[4], rtversion[4];
50065733 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
50075734 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
50175744 }
50185745
50195746 /* InitStrings */
5020 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
5747 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
50215748 while (t->p) {
50225749 #if PY_MAJOR_VERSION < 3
50235750 if (t->is_unicode) {
50425769 #endif
50435770 if (!*t->p)
50445771 return -1;
5772 if (PyObject_Hash(*t->p) == -1)
5773 return -1;
50455774 ++t;
50465775 }
50475776 return 0;
50505779 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
50515780 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
50525781 }
5053 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
5782 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
50545783 Py_ssize_t ignore;
50555784 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
50565785 }
5057 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5058 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
5786 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
5787 #if !CYTHON_PEP393_ENABLED
5788 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5789 char* defenc_c;
5790 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
5791 if (!defenc) return NULL;
5792 defenc_c = PyBytes_AS_STRING(defenc);
5793 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5794 {
5795 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
5796 char* c;
5797 for (c = defenc_c; c < end; c++) {
5798 if ((unsigned char) (*c) >= 128) {
5799 PyUnicode_AsASCIIString(o);
5800 return NULL;
5801 }
5802 }
5803 }
5804 #endif
5805 *length = PyBytes_GET_SIZE(defenc);
5806 return defenc_c;
5807 }
5808 #else
5809 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5810 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
5811 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5812 if (likely(PyUnicode_IS_ASCII(o))) {
5813 *length = PyUnicode_GET_LENGTH(o);
5814 return PyUnicode_AsUTF8(o);
5815 } else {
5816 PyUnicode_AsASCIIString(o);
5817 return NULL;
5818 }
5819 #else
5820 return PyUnicode_AsUTF8AndSize(o, length);
5821 #endif
5822 }
5823 #endif
5824 #endif
5825 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5826 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
50595827 if (
50605828 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
50615829 __Pyx_sys_getdefaultencoding_not_ascii &&
50625830 #endif
50635831 PyUnicode_Check(o)) {
5064 #if PY_VERSION_HEX < 0x03030000
5065 char* defenc_c;
5066 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
5067 if (!defenc) return NULL;
5068 defenc_c = PyBytes_AS_STRING(defenc);
5069 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5070 {
5071 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
5072 char* c;
5073 for (c = defenc_c; c < end; c++) {
5074 if ((unsigned char) (*c) >= 128) {
5075 PyUnicode_AsASCIIString(o);
5076 return NULL;
5077 }
5078 }
5079 }
5080 #endif
5081 *length = PyBytes_GET_SIZE(defenc);
5082 return defenc_c;
5083 #else
5084 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
5085 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5086 if (PyUnicode_IS_ASCII(o)) {
5087 *length = PyUnicode_GET_LENGTH(o);
5088 return PyUnicode_AsUTF8(o);
5089 } else {
5090 PyUnicode_AsASCIIString(o);
5091 return NULL;
5092 }
5093 #else
5094 return PyUnicode_AsUTF8AndSize(o, length);
5095 #endif
5096 #endif
5832 return __Pyx_PyUnicode_AsStringAndSize(o, length);
50975833 } else
50985834 #endif
50995835 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
51175853 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
51185854 else return PyObject_IsTrue(x);
51195855 }
5856 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
5857 #if PY_MAJOR_VERSION >= 3
5858 if (PyLong_Check(result)) {
5859 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
5860 "__int__ returned non-int (type %.200s). "
5861 "The ability to return an instance of a strict subclass of int "
5862 "is deprecated, and may be removed in a future version of Python.",
5863 Py_TYPE(result)->tp_name)) {
5864 Py_DECREF(result);
5865 return NULL;
5866 }
5867 return result;
5868 }
5869 #endif
5870 PyErr_Format(PyExc_TypeError,
5871 "__%.4s__ returned non-%.4s (type %.200s)",
5872 type_name, type_name, Py_TYPE(result)->tp_name);
5873 Py_DECREF(result);
5874 return NULL;
5875 }
51205876 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
51215877 #if CYTHON_USE_TYPE_SLOTS
51225878 PyNumberMethods *m;
51245880 const char *name = NULL;
51255881 PyObject *res = NULL;
51265882 #if PY_MAJOR_VERSION < 3
5127 if (PyInt_Check(x) || PyLong_Check(x))
5128 #else
5129 if (PyLong_Check(x))
5883 if (likely(PyInt_Check(x) || PyLong_Check(x)))
5884 #else
5885 if (likely(PyLong_Check(x)))
51305886 #endif
51315887 return __Pyx_NewRef(x);
51325888 #if CYTHON_USE_TYPE_SLOTS
51345890 #if PY_MAJOR_VERSION < 3
51355891 if (m && m->nb_int) {
51365892 name = "int";
5137 res = PyNumber_Int(x);
5893 res = m->nb_int(x);
51385894 }
51395895 else if (m && m->nb_long) {
51405896 name = "long";
5141 res = PyNumber_Long(x);
5897 res = m->nb_long(x);
51425898 }
51435899 #else
5144 if (m && m->nb_int) {
5900 if (likely(m && m->nb_int)) {
51455901 name = "int";
5146 res = PyNumber_Long(x);
5902 res = m->nb_int(x);
51475903 }
51485904 #endif
51495905 #else
5150 res = PyNumber_Int(x);
5151 #endif
5152 if (res) {
5906 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
5907 res = PyNumber_Int(x);
5908 }
5909 #endif
5910 if (likely(res)) {
51535911 #if PY_MAJOR_VERSION < 3
5154 if (!PyInt_Check(res) && !PyLong_Check(res)) {
5155 #else
5156 if (!PyLong_Check(res)) {
5157 #endif
5158 PyErr_Format(PyExc_TypeError,
5159 "__%.4s__ returned non-%.4s (type %.200s)",
5160 name, name, Py_TYPE(res)->tp_name);
5161 Py_DECREF(res);
5162 return NULL;
5912 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
5913 #else
5914 if (unlikely(!PyLong_CheckExact(res))) {
5915 #endif
5916 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
51635917 }
51645918 }
51655919 else if (!PyErr_Occurred()) {
52305984 Py_DECREF(x);
52315985 return ival;
52325986 }
5987 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
5988 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
5989 }
52335990 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
52345991 return PyInt_FromSize_t(ival);
52355992 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
8 #else
9 #define CYTHON_ABI "0_25_2"
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
8 #else
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
102120 #define CYTHON_COMPILING_IN_CPYTHON 1
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
105129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
409549 { \
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420552
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
428560
429561 #define __PYX_HAVE__pygame_sdl2__key
430562 #define __PYX_HAVE_API__pygame_sdl2__key
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
438571 #include <omp.h>
439572 #endif /* _OPENMP */
440573
441 #ifdef PYREX_WITHOUT_ASSERTIONS
574 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
442575 #define CYTHON_WITHOUT_ASSERTIONS
443576 #endif
444577
469602 #define __Pyx_sst_abs(value) abs(value)
470603 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
471604 #define __Pyx_sst_abs(value) labs(value)
472 #elif defined (_MSC_VER) && defined (_M_X64)
473 #define __Pyx_sst_abs(value) _abs64(value)
605 #elif defined (_MSC_VER)
606 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
474607 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
475608 #define __Pyx_sst_abs(value) llabs(value)
476609 #elif defined (__GNUC__)
478611 #else
479612 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
480613 #endif
481 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
482 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
614 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
615 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
483616 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
484617 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
485618 #define __Pyx_PyBytes_FromString PyBytes_FromString
492625 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
493626 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
494627 #endif
495 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
496 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
628 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
629 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
634 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
635 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
638 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
497639 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
498640 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
499641 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
500642 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
501643 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
502 #if PY_MAJOR_VERSION < 3
503 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
504 {
644 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
505645 const Py_UNICODE *u_end = u;
506646 while (*u_end++) ;
507647 return (size_t)(u_end - u - 1);
508648 }
509 #else
510 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
511 #endif
512649 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
513650 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
514651 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
515652 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
516653 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
517 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
654 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
518655 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
519656 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
657 #define __Pyx_PySequence_Tuple(obj)\
658 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
520659 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
521660 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
522661 #if CYTHON_ASSUME_SAFE_MACROS
615754 #define likely(x) (x)
616755 #define unlikely(x) (x)
617756 #endif /* __GNUC__ */
618
619 static PyObject *__pyx_m;
757 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
758
759 static PyObject *__pyx_m = NULL;
620760 static PyObject *__pyx_d;
621761 static PyObject *__pyx_b;
762 static PyObject *__pyx_cython_runtime = NULL;
622763 static PyObject *__pyx_empty_tuple;
623764 static PyObject *__pyx_empty_bytes;
624765 static PyObject *__pyx_empty_unicode;
630771
631772 static const char *__pyx_f[] = {
632773 "src/pygame_sdl2/key.pyx",
774 "stringsource",
633775 "src/pygame_sdl2/surface.pxd",
634776 "src/pygame_sdl2/display.pxd",
635777 "src/pygame_sdl2/rect.pxd",
806948
807949 /* PyObjectGetAttrStr.proto */
808950 #if CYTHON_USE_TYPE_SLOTS
809 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
810 PyTypeObject* tp = Py_TYPE(obj);
811 if (likely(tp->tp_getattro))
812 return tp->tp_getattro(obj, attr_name);
813 #if PY_MAJOR_VERSION < 3
814 if (likely(tp->tp_getattr))
815 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
816 #endif
817 return PyObject_GetAttr(obj, attr_name);
818 }
951 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
819952 #else
820953 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
821954 #endif
828961 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
829962
830963 /* KeywordStringCheck.proto */
831 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
964 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
832965
833966 /* GetModuleGlobalName.proto */
834967 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
8761009 /* PyThreadStateGet.proto */
8771010 #if CYTHON_FAST_THREAD_STATE
8781011 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
879 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
1012 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1013 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
8801014 #else
8811015 #define __Pyx_PyThreadState_declare
8821016 #define __Pyx_PyThreadState_assign
1017 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
8831018 #endif
8841019
8851020 /* PyErrFetchRestore.proto */
8861021 #if CYTHON_FAST_THREAD_STATE
1022 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
8871023 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
8881024 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
8891025 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
8901026 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
8911027 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
8921028 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
893 #else
1029 #if CYTHON_COMPILING_IN_CPYTHON
1030 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1031 #else
1032 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1033 #endif
1034 #else
1035 #define __Pyx_PyErr_Clear() PyErr_Clear()
1036 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
8941037 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
8951038 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1039 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1040 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
8961041 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
8971042 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
8981043 #endif
9091054 const char* function_name);
9101055
9111056 /* ArgTypeTest.proto */
912 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
913 const char *name, int exact);
1057 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1058 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1059 __Pyx__ArgTypeTest(obj, type, name, exact))
1060 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1061
1062 /* PyObject_GenericGetAttrNoDict.proto */
1063 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1064 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1065 #else
1066 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1067 #endif
1068
1069 /* PyObject_GenericGetAttr.proto */
1070 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1071 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1072 #else
1073 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1074 #endif
1075
1076 /* SetupReduce.proto */
1077 static int __Pyx_setup_reduce(PyObject* type_obj);
9141078
9151079 /* GetVTable.proto */
9161080 static void* __Pyx_GetVtable(PyObject *dict);
9201084
9211085 /* ImportFrom.proto */
9221086 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1087
1088 /* CLineInTraceback.proto */
1089 #ifdef CYTHON_CLINE_IN_TRACEBACK
1090 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1091 #else
1092 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1093 #endif
9231094
9241095 /* CodeObjectCache.proto */
9251096 typedef struct {
9641135 /* CIntFromPy.proto */
9651136 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
9661137
1138 /* FastTypeChecks.proto */
1139 #if CYTHON_COMPILING_IN_CPYTHON
1140 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1141 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1142 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1143 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1144 #else
1145 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1146 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1147 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1148 #endif
1149 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1150
9671151 /* CheckBinaryVersion.proto */
9681152 static int __Pyx_check_binary_version(void);
9691153
10191203 /* Module declarations from 'pygame_sdl2.key' */
10201204 static PyTypeObject *__pyx_ptype_11pygame_sdl2_3key_KeyboardState = 0;
10211205 #define __Pyx_MODULE_NAME "pygame_sdl2.key"
1206 extern int __pyx_module_is_main_pygame_sdl2__key;
10221207 int __pyx_module_is_main_pygame_sdl2__key = 0;
10231208
10241209 /* Implementation of 'pygame_sdl2.key' */
10251210 static PyObject *__pyx_builtin_IndexError;
1211 static PyObject *__pyx_builtin_TypeError;
10261212 static const char __pyx_k_key[] = "key";
10271213 static const char __pyx_k_main[] = "__main__";
1028 static const char __pyx_k_name[] = "name";
1214 static const char __pyx_k_name[] = "__name__";
10291215 static const char __pyx_k_rect[] = "rect";
10301216 static const char __pyx_k_test[] = "__test__";
10311217 static const char __pyx_k_delay[] = "delay";
10321218 static const char __pyx_k_error[] = "error";
10331219 static const char __pyx_k_state[] = "state";
10341220 static const char __pyx_k_import[] = "__import__";
1221 static const char __pyx_k_name_2[] = "name";
1222 static const char __pyx_k_reduce[] = "__reduce__";
10351223 static const char __pyx_k_window[] = "window";
10361224 static const char __pyx_k_get_mods[] = "get_mods";
1225 static const char __pyx_k_getstate[] = "__getstate__";
10371226 static const char __pyx_k_interval[] = "interval";
10381227 static const char __pyx_k_sdl_rect[] = "sdl_rect";
10391228 static const char __pyx_k_set_mods[] = "set_mods";
1229 static const char __pyx_k_setstate[] = "__setstate__";
1230 static const char __pyx_k_TypeError[] = "TypeError";
1231 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
10401232 static const char __pyx_k_IndexError[] = "IndexError";
10411233 static const char __pyx_k_get_repeat[] = "get_repeat";
10421234 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
10451237 static const char __pyx_k_get_focused[] = "get_focused";
10461238 static const char __pyx_k_get_pressed[] = "get_pressed";
10471239 static const char __pyx_k_Out_of_range[] = "Out of range.";
1240 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
10481241 static const char __pyx_k_pygame_sdl2_key[] = "pygame_sdl2.key";
1242 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
10491243 static const char __pyx_k_stop_text_input[] = "stop_text_input";
10501244 static const char __pyx_k_start_text_input[] = "start_text_input";
10511245 static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error";
1246 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
10521247 static const char __pyx_k_set_text_input_rect[] = "set_text_input_rect";
10531248 static const char __pyx_k_src_pygame_sdl2_key_pyx[] = "src/pygame_sdl2/key.pyx";
10541249 static const char __pyx_k_is_screen_keyboard_shown[] = "is_screen_keyboard_shown";
10551250 static const char __pyx_k_has_screen_keyboard_support[] = "has_screen_keyboard_support";
1251 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
10561252 static PyObject *__pyx_n_s_IndexError;
10571253 static PyObject *__pyx_kp_u_Out_of_range;
1254 static PyObject *__pyx_n_s_TypeError;
1255 static PyObject *__pyx_n_s_cline_in_traceback;
10581256 static PyObject *__pyx_n_s_delay;
10591257 static PyObject *__pyx_n_s_error;
10601258 static PyObject *__pyx_n_s_get_focused;
10611259 static PyObject *__pyx_n_s_get_mods;
10621260 static PyObject *__pyx_n_s_get_pressed;
10631261 static PyObject *__pyx_n_s_get_repeat;
1262 static PyObject *__pyx_n_s_getstate;
10641263 static PyObject *__pyx_n_s_has_screen_keyboard_support;
10651264 static PyObject *__pyx_n_s_import;
10661265 static PyObject *__pyx_n_s_interval;
10681267 static PyObject *__pyx_n_s_key;
10691268 static PyObject *__pyx_n_s_main;
10701269 static PyObject *__pyx_n_s_name;
1270 static PyObject *__pyx_n_s_name_2;
1271 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
10711272 static PyObject *__pyx_n_s_pygame_sdl2_error;
10721273 static PyObject *__pyx_n_s_pygame_sdl2_key;
10731274 static PyObject *__pyx_n_s_pyx_vtable;
10741275 static PyObject *__pyx_n_s_rect;
1276 static PyObject *__pyx_n_s_reduce;
1277 static PyObject *__pyx_n_s_reduce_cython;
1278 static PyObject *__pyx_n_s_reduce_ex;
10751279 static PyObject *__pyx_n_s_sdl_rect;
10761280 static PyObject *__pyx_n_s_set_mods;
10771281 static PyObject *__pyx_n_s_set_repeat;
10781282 static PyObject *__pyx_n_s_set_text_input_rect;
1283 static PyObject *__pyx_n_s_setstate;
1284 static PyObject *__pyx_n_s_setstate_cython;
10791285 static PyObject *__pyx_kp_s_src_pygame_sdl2_key_pyx;
10801286 static PyObject *__pyx_n_s_start_text_input;
10811287 static PyObject *__pyx_n_s_state;
10871293 static void __pyx_pf_11pygame_sdl2_3key_13KeyboardState_2__dealloc__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self); /* proto */
10881294 static int __pyx_pf_11pygame_sdl2_3key_13KeyboardState_4__init__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self); /* proto */
10891295 static PyObject *__pyx_pf_11pygame_sdl2_3key_13KeyboardState_6__getitem__(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self, int __pyx_v_key); /* proto */
1296 static PyObject *__pyx_pf_11pygame_sdl2_3key_13KeyboardState_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self); /* proto */
1297 static PyObject *__pyx_pf_11pygame_sdl2_3key_13KeyboardState_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
10901298 static PyObject *__pyx_pf_11pygame_sdl2_3key_get_focused(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
10911299 static PyObject *__pyx_pf_11pygame_sdl2_3key_2get_pressed(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
10921300 static PyObject *__pyx_pf_11pygame_sdl2_3key_4get_mods(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
11041312 static PyObject *__pyx_tuple_;
11051313 static PyObject *__pyx_tuple__2;
11061314 static PyObject *__pyx_tuple__3;
1107 static PyObject *__pyx_tuple__7;
1315 static PyObject *__pyx_tuple__4;
1316 static PyObject *__pyx_tuple__5;
11081317 static PyObject *__pyx_tuple__9;
1109 static PyObject *__pyx_tuple__12;
1110 static PyObject *__pyx_tuple__16;
1111 static PyObject *__pyx_tuple__19;
1112 static PyObject *__pyx_codeobj__4;
1113 static PyObject *__pyx_codeobj__5;
1318 static PyObject *__pyx_tuple__11;
1319 static PyObject *__pyx_tuple__14;
1320 static PyObject *__pyx_tuple__18;
1321 static PyObject *__pyx_tuple__21;
11141322 static PyObject *__pyx_codeobj__6;
1323 static PyObject *__pyx_codeobj__7;
11151324 static PyObject *__pyx_codeobj__8;
11161325 static PyObject *__pyx_codeobj__10;
1117 static PyObject *__pyx_codeobj__11;
1326 static PyObject *__pyx_codeobj__12;
11181327 static PyObject *__pyx_codeobj__13;
1119 static PyObject *__pyx_codeobj__14;
11201328 static PyObject *__pyx_codeobj__15;
1329 static PyObject *__pyx_codeobj__16;
11211330 static PyObject *__pyx_codeobj__17;
1122 static PyObject *__pyx_codeobj__18;
1331 static PyObject *__pyx_codeobj__19;
11231332 static PyObject *__pyx_codeobj__20;
1333 static PyObject *__pyx_codeobj__22;
1334 /* Late includes */
11241335
11251336 /* "pygame_sdl2/key.pyx":35
11261337 * cdef int numkeys
12891500 *
12901501 */
12911502 __pyx_t_1 = ((__pyx_v_state == NULL) != 0);
1292 if (__pyx_t_1) {
1503 if (unlikely(__pyx_t_1)) {
12931504
12941505 /* "pygame_sdl2/key.pyx":45
12951506 * cdef uint8_t *state = SDL_GetKeyboardState(&self.numkeys)
13471558 *
13481559 * def __getitem__(self, int key):
13491560 */
1350 memcpy(__pyx_v_self->data, __pyx_v_state, __pyx_v_self->numkeys);
1561 (void)(memcpy(__pyx_v_self->data, __pyx_v_state, __pyx_v_self->numkeys));
13511562
13521563 /* "pygame_sdl2/key.pyx":42
13531564 * free(self.data)
14231634 __pyx_t_1 = (__pyx_v_key < SDLK_CAPSLOCK);
14241635 }
14251636 __pyx_t_2 = (__pyx_t_1 != 0);
1426 if (__pyx_t_2) {
1637 if (unlikely(__pyx_t_2)) {
14271638
14281639 /* "pygame_sdl2/key.pyx":53
14291640 * def __getitem__(self, int key):
14641675 *
14651676 */
14661677 __pyx_t_2 = ((__pyx_v_sc > __pyx_v_self->numkeys) != 0);
1467 if (__pyx_t_2) {
1678 if (unlikely(__pyx_t_2)) {
14681679
14691680 /* "pygame_sdl2/key.pyx":57
14701681 * cdef int sc = <int>SDL_GetScancodeFromKey(key)
15211732 return __pyx_r;
15221733 }
15231734
1735 /* "(tree fragment)":1
1736 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
1737 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
1738 * def __setstate_cython__(self, __pyx_state):
1739 */
1740
1741 /* Python wrapper */
1742 static PyObject *__pyx_pw_11pygame_sdl2_3key_13KeyboardState_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
1743 static PyObject *__pyx_pw_11pygame_sdl2_3key_13KeyboardState_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
1744 PyObject *__pyx_r = 0;
1745 __Pyx_RefNannyDeclarations
1746 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
1747 __pyx_r = __pyx_pf_11pygame_sdl2_3key_13KeyboardState_8__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self));
1748
1749 /* function exit code */
1750 __Pyx_RefNannyFinishContext();
1751 return __pyx_r;
1752 }
1753
1754 static PyObject *__pyx_pf_11pygame_sdl2_3key_13KeyboardState_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self) {
1755 PyObject *__pyx_r = NULL;
1756 __Pyx_RefNannyDeclarations
1757 PyObject *__pyx_t_1 = NULL;
1758 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
1759
1760 /* "(tree fragment)":2
1761 * def __reduce_cython__(self):
1762 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
1763 * def __setstate_cython__(self, __pyx_state):
1764 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
1765 */
1766 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
1767 __Pyx_GOTREF(__pyx_t_1);
1768 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
1769 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1770 __PYX_ERR(1, 2, __pyx_L1_error)
1771
1772 /* "(tree fragment)":1
1773 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
1774 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
1775 * def __setstate_cython__(self, __pyx_state):
1776 */
1777
1778 /* function exit code */
1779 __pyx_L1_error:;
1780 __Pyx_XDECREF(__pyx_t_1);
1781 __Pyx_AddTraceback("pygame_sdl2.key.KeyboardState.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1782 __pyx_r = NULL;
1783 __Pyx_XGIVEREF(__pyx_r);
1784 __Pyx_RefNannyFinishContext();
1785 return __pyx_r;
1786 }
1787
1788 /* "(tree fragment)":3
1789 * def __reduce_cython__(self):
1790 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
1791 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
1792 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
1793 */
1794
1795 /* Python wrapper */
1796 static PyObject *__pyx_pw_11pygame_sdl2_3key_13KeyboardState_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
1797 static PyObject *__pyx_pw_11pygame_sdl2_3key_13KeyboardState_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
1798 PyObject *__pyx_r = 0;
1799 __Pyx_RefNannyDeclarations
1800 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
1801 __pyx_r = __pyx_pf_11pygame_sdl2_3key_13KeyboardState_10__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
1802
1803 /* function exit code */
1804 __Pyx_RefNannyFinishContext();
1805 return __pyx_r;
1806 }
1807
1808 static PyObject *__pyx_pf_11pygame_sdl2_3key_13KeyboardState_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
1809 PyObject *__pyx_r = NULL;
1810 __Pyx_RefNannyDeclarations
1811 PyObject *__pyx_t_1 = NULL;
1812 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
1813
1814 /* "(tree fragment)":4
1815 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
1816 * def __setstate_cython__(self, __pyx_state):
1817 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
1818 */
1819 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
1820 __Pyx_GOTREF(__pyx_t_1);
1821 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
1822 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1823 __PYX_ERR(1, 4, __pyx_L1_error)
1824
1825 /* "(tree fragment)":3
1826 * def __reduce_cython__(self):
1827 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
1828 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
1829 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
1830 */
1831
1832 /* function exit code */
1833 __pyx_L1_error:;
1834 __Pyx_XDECREF(__pyx_t_1);
1835 __Pyx_AddTraceback("pygame_sdl2.key.KeyboardState.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1836 __pyx_r = NULL;
1837 __Pyx_XGIVEREF(__pyx_r);
1838 __Pyx_RefNannyFinishContext();
1839 return __pyx_r;
1840 }
1841
15241842 /* "pygame_sdl2/key.pyx":62
15251843 *
15261844 *
16191937 * def get_mods():
16201938 */
16211939 __Pyx_XDECREF(__pyx_r);
1622 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_3key_KeyboardState), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
1940 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_11pygame_sdl2_3key_KeyboardState)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
16231941 __Pyx_GOTREF(__pyx_t_1);
16241942 __pyx_r = __pyx_t_1;
16251943 __pyx_t_1 = 0;
17902108 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17912109 switch (pos_args) {
17922110 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2111 CYTHON_FALLTHROUGH;
17932112 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2113 CYTHON_FALLTHROUGH;
17942114 case 0: break;
17952115 default: goto __pyx_L5_argtuple_error;
17962116 }
17982118 switch (pos_args) {
17992119 case 0:
18002120 if (kw_args > 0) {
1801 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_delay);
2121 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_delay);
18022122 if (value) { values[0] = value; kw_args--; }
18032123 }
2124 CYTHON_FALLTHROUGH;
18042125 case 1:
18052126 if (kw_args > 0) {
1806 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_interval);
2127 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interval);
18072128 if (value) { values[1] = value; kw_args--; }
18082129 }
18092130 }
18132134 } else {
18142135 switch (PyTuple_GET_SIZE(__pyx_args)) {
18152136 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2137 CYTHON_FALLTHROUGH;
18162138 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2139 CYTHON_FALLTHROUGH;
18172140 case 0: break;
18182141 default: goto __pyx_L5_argtuple_error;
18192142 }
18832206 * def name(key):
18842207 */
18852208 __Pyx_XDECREF(__pyx_r);
1886 __Pyx_INCREF(__pyx_tuple__3);
1887 __pyx_r = __pyx_tuple__3;
2209 __Pyx_INCREF(__pyx_tuple__5);
2210 __pyx_r = __pyx_tuple__5;
18882211 goto __pyx_L0;
18892212
18902213 /* "pygame_sdl2/key.pyx":81
21842507 * SDL_SetTextInputRect(&sdl_rect)
21852508 * else:
21862509 */
2187 __pyx_t_3 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 108, __pyx_L1_error)
2510 __pyx_t_3 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 108, __pyx_L1_error)
21882511
21892512 /* "pygame_sdl2/key.pyx":109
21902513 * if rect is not None:
23232646 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
23242647 switch (pos_args) {
23252648 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2649 CYTHON_FALLTHROUGH;
23262650 case 0: break;
23272651 default: goto __pyx_L5_argtuple_error;
23282652 }
23302654 switch (pos_args) {
23312655 case 0:
23322656 if (kw_args > 0) {
2333 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_window);
2657 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_window);
23342658 if (value) { values[0] = value; kw_args--; }
23352659 }
23362660 }
23402664 } else {
23412665 switch (PyTuple_GET_SIZE(__pyx_args)) {
23422666 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2667 CYTHON_FALLTHROUGH;
23432668 case 0: break;
23442669 default: goto __pyx_L5_argtuple_error;
23452670 }
24542779
24552780 static void __pyx_tp_dealloc_11pygame_sdl2_3key_KeyboardState(PyObject *o) {
24562781 struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *p = (struct __pyx_obj_11pygame_sdl2_3key_KeyboardState *)o;
2457 #if PY_VERSION_HEX >= 0x030400a1
2458 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
2782 #if CYTHON_USE_TP_FINALIZE
2783 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
24592784 if (PyObject_CallFinalizerFromDealloc(o)) return;
24602785 }
24612786 #endif
24792804 }
24802805
24812806 static PyMethodDef __pyx_methods_11pygame_sdl2_3key_KeyboardState[] = {
2807 {"__reduce_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_13KeyboardState_9__reduce_cython__, METH_NOARGS, 0},
2808 {"__setstate_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_3key_13KeyboardState_11__setstate_cython__, METH_O, 0},
24822809 {0, 0, 0, 0}
24832810 };
24842811
25642891 };
25652892
25662893 #if PY_MAJOR_VERSION >= 3
2894 #if CYTHON_PEP489_MULTI_PHASE_INIT
2895 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
2896 static int __pyx_pymod_exec_key(PyObject* module); /*proto*/
2897 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
2898 {Py_mod_create, (void*)__pyx_pymod_create},
2899 {Py_mod_exec, (void*)__pyx_pymod_exec_key},
2900 {0, NULL}
2901 };
2902 #endif
2903
25672904 static struct PyModuleDef __pyx_moduledef = {
2568 #if PY_VERSION_HEX < 0x03020000
2569 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
2570 #else
25712905 PyModuleDef_HEAD_INIT,
2572 #endif
25732906 "key",
25742907 0, /* m_doc */
2908 #if CYTHON_PEP489_MULTI_PHASE_INIT
2909 0, /* m_size */
2910 #else
25752911 -1, /* m_size */
2912 #endif
25762913 __pyx_methods /* m_methods */,
2914 #if CYTHON_PEP489_MULTI_PHASE_INIT
2915 __pyx_moduledef_slots, /* m_slots */
2916 #else
25772917 NULL, /* m_reload */
2918 #endif
25782919 NULL, /* m_traverse */
25792920 NULL, /* m_clear */
25802921 NULL /* m_free */
25842925 static __Pyx_StringTabEntry __pyx_string_tab[] = {
25852926 {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
25862927 {&__pyx_kp_u_Out_of_range, __pyx_k_Out_of_range, sizeof(__pyx_k_Out_of_range), 0, 1, 0, 0},
2928 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
2929 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
25872930 {&__pyx_n_s_delay, __pyx_k_delay, sizeof(__pyx_k_delay), 0, 0, 1, 1},
25882931 {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
25892932 {&__pyx_n_s_get_focused, __pyx_k_get_focused, sizeof(__pyx_k_get_focused), 0, 0, 1, 1},
25902933 {&__pyx_n_s_get_mods, __pyx_k_get_mods, sizeof(__pyx_k_get_mods), 0, 0, 1, 1},
25912934 {&__pyx_n_s_get_pressed, __pyx_k_get_pressed, sizeof(__pyx_k_get_pressed), 0, 0, 1, 1},
25922935 {&__pyx_n_s_get_repeat, __pyx_k_get_repeat, sizeof(__pyx_k_get_repeat), 0, 0, 1, 1},
2936 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
25932937 {&__pyx_n_s_has_screen_keyboard_support, __pyx_k_has_screen_keyboard_support, sizeof(__pyx_k_has_screen_keyboard_support), 0, 0, 1, 1},
25942938 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
25952939 {&__pyx_n_s_interval, __pyx_k_interval, sizeof(__pyx_k_interval), 0, 0, 1, 1},
25972941 {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
25982942 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
25992943 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
2944 {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
2945 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
26002946 {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1},
26012947 {&__pyx_n_s_pygame_sdl2_key, __pyx_k_pygame_sdl2_key, sizeof(__pyx_k_pygame_sdl2_key), 0, 0, 1, 1},
26022948 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
26032949 {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1},
2950 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
2951 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
2952 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
26042953 {&__pyx_n_s_sdl_rect, __pyx_k_sdl_rect, sizeof(__pyx_k_sdl_rect), 0, 0, 1, 1},
26052954 {&__pyx_n_s_set_mods, __pyx_k_set_mods, sizeof(__pyx_k_set_mods), 0, 0, 1, 1},
26062955 {&__pyx_n_s_set_repeat, __pyx_k_set_repeat, sizeof(__pyx_k_set_repeat), 0, 0, 1, 1},
26072956 {&__pyx_n_s_set_text_input_rect, __pyx_k_set_text_input_rect, sizeof(__pyx_k_set_text_input_rect), 0, 0, 1, 1},
2957 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
2958 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
26082959 {&__pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_k_src_pygame_sdl2_key_pyx, sizeof(__pyx_k_src_pygame_sdl2_key_pyx), 0, 0, 1, 0},
26092960 {&__pyx_n_s_start_text_input, __pyx_k_start_text_input, sizeof(__pyx_k_start_text_input), 0, 0, 1, 1},
26102961 {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
26162967 };
26172968 static int __Pyx_InitCachedBuiltins(void) {
26182969 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 53, __pyx_L1_error)
2970 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
26192971 return 0;
26202972 __pyx_L1_error:;
26212973 return -1;
26472999 __Pyx_GOTREF(__pyx_tuple__2);
26483000 __Pyx_GIVEREF(__pyx_tuple__2);
26493001
3002 /* "(tree fragment)":2
3003 * def __reduce_cython__(self):
3004 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3005 * def __setstate_cython__(self, __pyx_state):
3006 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3007 */
3008 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error)
3009 __Pyx_GOTREF(__pyx_tuple__3);
3010 __Pyx_GIVEREF(__pyx_tuple__3);
3011
3012 /* "(tree fragment)":4
3013 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
3014 * def __setstate_cython__(self, __pyx_state):
3015 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
3016 */
3017 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error)
3018 __Pyx_GOTREF(__pyx_tuple__4);
3019 __Pyx_GIVEREF(__pyx_tuple__4);
3020
26503021 /* "pygame_sdl2/key.pyx":83
26513022 * def get_repeat():
26523023 * # Not possible with SDL2.
26543025 *
26553026 * def name(key):
26563027 */
2657 __pyx_tuple__3 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 83, __pyx_L1_error)
2658 __Pyx_GOTREF(__pyx_tuple__3);
2659 __Pyx_GIVEREF(__pyx_tuple__3);
3028 __pyx_tuple__5 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 83, __pyx_L1_error)
3029 __Pyx_GOTREF(__pyx_tuple__5);
3030 __Pyx_GIVEREF(__pyx_tuple__5);
26603031
26613032 /* "pygame_sdl2/key.pyx":62
26623033 *
26653036 * return SDL_GetKeyboardFocus() != NULL
26663037 *
26673038 */
2668 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_get_focused, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 62, __pyx_L1_error)
3039 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_get_focused, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 62, __pyx_L1_error)
26693040
26703041 /* "pygame_sdl2/key.pyx":65
26713042 * return SDL_GetKeyboardFocus() != NULL
26743045 * """ No longer returns a tuple. Use the returned object to check for
26753046 * individual keys, but don't loop through it. """
26763047 */
2677 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_get_pressed, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 65, __pyx_L1_error)
3048 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_get_pressed, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 65, __pyx_L1_error)
26783049
26793050 /* "pygame_sdl2/key.pyx":71
26803051 * return KeyboardState()
26833054 * return SDL_GetModState()
26843055 *
26853056 */
2686 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_get_mods, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 71, __pyx_L1_error)
3057 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_get_mods, 71, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 71, __pyx_L1_error)
26873058
26883059 /* "pygame_sdl2/key.pyx":74
26893060 * return SDL_GetModState()
26923063 * SDL_SetModState(state)
26933064 *
26943065 */
2695 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 74, __pyx_L1_error)
2696 __Pyx_GOTREF(__pyx_tuple__7);
2697 __Pyx_GIVEREF(__pyx_tuple__7);
2698 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_set_mods, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 74, __pyx_L1_error)
3066 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 74, __pyx_L1_error)
3067 __Pyx_GOTREF(__pyx_tuple__9);
3068 __Pyx_GIVEREF(__pyx_tuple__9);
3069 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_set_mods, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 74, __pyx_L1_error)
26993070
27003071 /* "pygame_sdl2/key.pyx":77
27013072 * SDL_SetModState(state)
27043075 * # Not possible with SDL2.
27053076 * pass
27063077 */
2707 __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_delay, __pyx_n_s_interval); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 77, __pyx_L1_error)
2708 __Pyx_GOTREF(__pyx_tuple__9);
2709 __Pyx_GIVEREF(__pyx_tuple__9);
2710 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_set_repeat, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 77, __pyx_L1_error)
3078 __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_delay, __pyx_n_s_interval); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 77, __pyx_L1_error)
3079 __Pyx_GOTREF(__pyx_tuple__11);
3080 __Pyx_GIVEREF(__pyx_tuple__11);
3081 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_set_repeat, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 77, __pyx_L1_error)
27113082
27123083 /* "pygame_sdl2/key.pyx":81
27133084 * pass
27163087 * # Not possible with SDL2.
27173088 * return (0,0)
27183089 */
2719 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_get_repeat, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 81, __pyx_L1_error)
3090 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_get_repeat, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 81, __pyx_L1_error)
27203091
27213092 /* "pygame_sdl2/key.pyx":85
27223093 * return (0,0)
27253096 * return SDL_GetKeyName(key)
27263097 *
27273098 */
2728 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_key); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 85, __pyx_L1_error)
2729 __Pyx_GOTREF(__pyx_tuple__12);
2730 __Pyx_GIVEREF(__pyx_tuple__12);
2731 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_name, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 85, __pyx_L1_error)
3099 __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_key); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 85, __pyx_L1_error)
3100 __Pyx_GOTREF(__pyx_tuple__14);
3101 __Pyx_GIVEREF(__pyx_tuple__14);
3102 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_name_2, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 85, __pyx_L1_error)
27323103
27333104 /* "pygame_sdl2/key.pyx":90
27343105 * text_input = False
27373108 * global text_input
27383109 * text_input = True
27393110 */
2740 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_start_text_input, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 90, __pyx_L1_error)
3111 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_start_text_input, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 90, __pyx_L1_error)
27413112
27423113 /* "pygame_sdl2/key.pyx":97
27433114 * SDL_StartTextInput()
27463117 * global text_input
27473118 * text_input = False
27483119 */
2749 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_stop_text_input, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 97, __pyx_L1_error)
3120 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_stop_text_input, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 97, __pyx_L1_error)
27503121
27513122 /* "pygame_sdl2/key.pyx":104
27523123 * SDL_StopTextInput()
27553126 * cdef SDL_Rect sdl_rect;
27563127 *
27573128 */
2758 __pyx_tuple__16 = PyTuple_Pack(2, __pyx_n_s_rect, __pyx_n_s_sdl_rect); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 104, __pyx_L1_error)
2759 __Pyx_GOTREF(__pyx_tuple__16);
2760 __Pyx_GIVEREF(__pyx_tuple__16);
2761 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_set_text_input_rect, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 104, __pyx_L1_error)
3129 __pyx_tuple__18 = PyTuple_Pack(2, __pyx_n_s_rect, __pyx_n_s_sdl_rect); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 104, __pyx_L1_error)
3130 __Pyx_GOTREF(__pyx_tuple__18);
3131 __Pyx_GIVEREF(__pyx_tuple__18);
3132 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_set_text_input_rect, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 104, __pyx_L1_error)
27623133
27633134 /* "pygame_sdl2/key.pyx":113
27643135 * SDL_SetTextInputRect(NULL)
27673138 * return SDL_HasScreenKeyboardSupport()
27683139 *
27693140 */
2770 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_has_screen_keyboard_support, 113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 113, __pyx_L1_error)
3141 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_has_screen_keyboard_support, 113, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 113, __pyx_L1_error)
27713142
27723143 /* "pygame_sdl2/key.pyx":116
27733144 * return SDL_HasScreenKeyboardSupport()
27763147 * if window is None:
27773148 * window = main_window
27783149 */
2779 __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_window); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 116, __pyx_L1_error)
2780 __Pyx_GOTREF(__pyx_tuple__19);
2781 __Pyx_GIVEREF(__pyx_tuple__19);
2782 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_is_screen_keyboard_shown, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 116, __pyx_L1_error)
3150 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_window); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 116, __pyx_L1_error)
3151 __Pyx_GOTREF(__pyx_tuple__21);
3152 __Pyx_GIVEREF(__pyx_tuple__21);
3153 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_key_pyx, __pyx_n_s_is_screen_keyboard_shown, 116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 116, __pyx_L1_error)
27833154 __Pyx_RefNannyFinishContext();
27843155 return 0;
27853156 __pyx_L1_error:;
27953166 return -1;
27963167 }
27973168
3169 static int __Pyx_modinit_global_init_code(void); /*proto*/
3170 static int __Pyx_modinit_variable_export_code(void); /*proto*/
3171 static int __Pyx_modinit_function_export_code(void); /*proto*/
3172 static int __Pyx_modinit_type_init_code(void); /*proto*/
3173 static int __Pyx_modinit_type_import_code(void); /*proto*/
3174 static int __Pyx_modinit_variable_import_code(void); /*proto*/
3175 static int __Pyx_modinit_function_import_code(void); /*proto*/
3176
3177 static int __Pyx_modinit_global_init_code(void) {
3178 __Pyx_RefNannyDeclarations
3179 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
3180 /*--- Global init code ---*/
3181 __Pyx_RefNannyFinishContext();
3182 return 0;
3183 }
3184
3185 static int __Pyx_modinit_variable_export_code(void) {
3186 __Pyx_RefNannyDeclarations
3187 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
3188 /*--- Variable export code ---*/
3189 __Pyx_RefNannyFinishContext();
3190 return 0;
3191 }
3192
3193 static int __Pyx_modinit_function_export_code(void) {
3194 __Pyx_RefNannyDeclarations
3195 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
3196 /*--- Function export code ---*/
3197 __Pyx_RefNannyFinishContext();
3198 return 0;
3199 }
3200
3201 static int __Pyx_modinit_type_init_code(void) {
3202 __Pyx_RefNannyDeclarations
3203 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
3204 /*--- Type init code ---*/
3205 if (PyType_Ready(&__pyx_type_11pygame_sdl2_3key_KeyboardState) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
3206 __pyx_type_11pygame_sdl2_3key_KeyboardState.tp_print = 0;
3207 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11pygame_sdl2_3key_KeyboardState.tp_dictoffset && __pyx_type_11pygame_sdl2_3key_KeyboardState.tp_getattro == PyObject_GenericGetAttr)) {
3208 __pyx_type_11pygame_sdl2_3key_KeyboardState.tp_getattro = __Pyx_PyObject_GenericGetAttr;
3209 }
3210 if (PyObject_SetAttrString(__pyx_m, "KeyboardState", (PyObject *)&__pyx_type_11pygame_sdl2_3key_KeyboardState) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
3211 if (__pyx_type_11pygame_sdl2_3key_KeyboardState.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_3key_KeyboardState.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState, __weakref__);
3212 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11pygame_sdl2_3key_KeyboardState) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
3213 __pyx_ptype_11pygame_sdl2_3key_KeyboardState = &__pyx_type_11pygame_sdl2_3key_KeyboardState;
3214 __Pyx_RefNannyFinishContext();
3215 return 0;
3216 __pyx_L1_error:;
3217 __Pyx_RefNannyFinishContext();
3218 return -1;
3219 }
3220
3221 static int __Pyx_modinit_type_import_code(void) {
3222 __Pyx_RefNannyDeclarations
3223 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
3224 /*--- Type import code ---*/
3225 __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error)
3226 __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error)
3227 __pyx_ptype_11pygame_sdl2_7display_Window = __Pyx_ImportType("pygame_sdl2.display", "Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7display_Window)) __PYX_ERR(3, 23, __pyx_L1_error)
3228 __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType("pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_4rect_Rect)) __PYX_ERR(4, 21, __pyx_L1_error)
3229 __Pyx_RefNannyFinishContext();
3230 return 0;
3231 __pyx_L1_error:;
3232 __Pyx_RefNannyFinishContext();
3233 return -1;
3234 }
3235
3236 static int __Pyx_modinit_variable_import_code(void) {
3237 __Pyx_RefNannyDeclarations
3238 PyObject *__pyx_t_1 = NULL;
3239 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
3240 /*--- Variable import code ---*/
3241 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.display"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
3242 if (__Pyx_ImportVoidPtr(__pyx_t_1, "main_window", (void **)&__pyx_vp_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3243 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3244 __Pyx_RefNannyFinishContext();
3245 return 0;
3246 __pyx_L1_error:;
3247 __Pyx_XDECREF(__pyx_t_1);
3248 __Pyx_RefNannyFinishContext();
3249 return -1;
3250 }
3251
3252 static int __Pyx_modinit_function_import_code(void) {
3253 __Pyx_RefNannyDeclarations
3254 PyObject *__pyx_t_1 = NULL;
3255 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
3256 /*--- Function import code ---*/
3257 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
3258 if (__Pyx_ImportFunction(__pyx_t_1, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3259 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3260 __Pyx_RefNannyFinishContext();
3261 return 0;
3262 __pyx_L1_error:;
3263 __Pyx_XDECREF(__pyx_t_1);
3264 __Pyx_RefNannyFinishContext();
3265 return -1;
3266 }
3267
3268
27983269 #if PY_MAJOR_VERSION < 3
2799 PyMODINIT_FUNC initkey(void); /*proto*/
2800 PyMODINIT_FUNC initkey(void)
2801 #else
2802 PyMODINIT_FUNC PyInit_key(void); /*proto*/
2803 PyMODINIT_FUNC PyInit_key(void)
3270 #ifdef CYTHON_NO_PYINIT_EXPORT
3271 #define __Pyx_PyMODINIT_FUNC void
3272 #else
3273 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
3274 #endif
3275 #else
3276 #ifdef CYTHON_NO_PYINIT_EXPORT
3277 #define __Pyx_PyMODINIT_FUNC PyObject *
3278 #else
3279 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
3280 #endif
3281 #endif
3282 #ifndef CYTHON_SMALL_CODE
3283 #if defined(__clang__)
3284 #define CYTHON_SMALL_CODE
3285 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
3286 #define CYTHON_SMALL_CODE __attribute__((cold))
3287 #else
3288 #define CYTHON_SMALL_CODE
3289 #endif
3290 #endif
3291
3292
3293 #if PY_MAJOR_VERSION < 3
3294 __Pyx_PyMODINIT_FUNC initkey(void) CYTHON_SMALL_CODE; /*proto*/
3295 __Pyx_PyMODINIT_FUNC initkey(void)
3296 #else
3297 __Pyx_PyMODINIT_FUNC PyInit_key(void) CYTHON_SMALL_CODE; /*proto*/
3298 __Pyx_PyMODINIT_FUNC PyInit_key(void)
3299 #if CYTHON_PEP489_MULTI_PHASE_INIT
3300 {
3301 return PyModuleDef_Init(&__pyx_moduledef);
3302 }
3303 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
3304 PyObject *value = PyObject_GetAttrString(spec, from_name);
3305 int result = 0;
3306 if (likely(value)) {
3307 result = PyDict_SetItemString(moddict, to_name, value);
3308 Py_DECREF(value);
3309 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
3310 PyErr_Clear();
3311 } else {
3312 result = -1;
3313 }
3314 return result;
3315 }
3316 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
3317 PyObject *module = NULL, *moddict, *modname;
3318 if (__pyx_m)
3319 return __Pyx_NewRef(__pyx_m);
3320 modname = PyObject_GetAttrString(spec, "name");
3321 if (unlikely(!modname)) goto bad;
3322 module = PyModule_NewObject(modname);
3323 Py_DECREF(modname);
3324 if (unlikely(!module)) goto bad;
3325 moddict = PyModule_GetDict(module);
3326 if (unlikely(!moddict)) goto bad;
3327 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
3328 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
3329 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
3330 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
3331 return module;
3332 bad:
3333 Py_XDECREF(module);
3334 return NULL;
3335 }
3336
3337
3338 static int __pyx_pymod_exec_key(PyObject *__pyx_pyinit_module)
3339 #endif
28043340 #endif
28053341 {
28063342 PyObject *__pyx_t_1 = NULL;
28073343 PyObject *__pyx_t_2 = NULL;
2808 PyObject *__pyx_t_3 = NULL;
2809 PyObject *__pyx_t_4 = NULL;
28103344 __Pyx_RefNannyDeclarations
3345 #if CYTHON_PEP489_MULTI_PHASE_INIT
3346 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
3347 #elif PY_MAJOR_VERSION >= 3
3348 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
3349 #endif
28113350 #if CYTHON_REFNANNY
2812 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
2813 if (!__Pyx_RefNanny) {
2814 PyErr_Clear();
2815 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
2816 if (!__Pyx_RefNanny)
2817 Py_FatalError("failed to import 'refnanny' module");
2818 }
2819 #endif
2820 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_key(void)", 0);
3351 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
3352 if (!__Pyx_RefNanny) {
3353 PyErr_Clear();
3354 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
3355 if (!__Pyx_RefNanny)
3356 Py_FatalError("failed to import 'refnanny' module");
3357 }
3358 #endif
3359 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_key(void)", 0);
28213360 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28223361 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
28233362 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
28343373 #ifdef __Pyx_Generator_USED
28353374 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28363375 #endif
3376 #ifdef __Pyx_AsyncGen_USED
3377 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3378 #endif
28373379 #ifdef __Pyx_StopAsyncIteration_USED
28383380 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28393381 #endif
28453387 #endif
28463388 #endif
28473389 /*--- Module creation code ---*/
3390 #if CYTHON_PEP489_MULTI_PHASE_INIT
3391 __pyx_m = __pyx_pyinit_module;
3392 Py_INCREF(__pyx_m);
3393 #else
28483394 #if PY_MAJOR_VERSION < 3
28493395 __pyx_m = Py_InitModule4("key", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
28503396 #else
28513397 __pyx_m = PyModule_Create(&__pyx_moduledef);
28523398 #endif
28533399 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
3400 #endif
28543401 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
28553402 Py_INCREF(__pyx_d);
28563403 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
3404 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
28573405 #if CYTHON_COMPILING_IN_PYPY
28583406 Py_INCREF(__pyx_b);
28593407 #endif
28783426 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
28793427 /*--- Constants init code ---*/
28803428 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2881 /*--- Global init code ---*/
2882 /*--- Variable export code ---*/
2883 /*--- Function export code ---*/
2884 /*--- Type init code ---*/
2885 if (PyType_Ready(&__pyx_type_11pygame_sdl2_3key_KeyboardState) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
2886 __pyx_type_11pygame_sdl2_3key_KeyboardState.tp_print = 0;
2887 if (PyObject_SetAttrString(__pyx_m, "KeyboardState", (PyObject *)&__pyx_type_11pygame_sdl2_3key_KeyboardState) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
2888 if (__pyx_type_11pygame_sdl2_3key_KeyboardState.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_3key_KeyboardState.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_3key_KeyboardState, __weakref__);
2889 __pyx_ptype_11pygame_sdl2_3key_KeyboardState = &__pyx_type_11pygame_sdl2_3key_KeyboardState;
2890 /*--- Type import code ---*/
2891 __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
2892 __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
2893 __pyx_ptype_11pygame_sdl2_7display_Window = __Pyx_ImportType("pygame_sdl2.display", "Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7display_Window)) __PYX_ERR(2, 23, __pyx_L1_error)
2894 __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType("pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_4rect_Rect)) __PYX_ERR(3, 21, __pyx_L1_error)
2895 /*--- Variable import code ---*/
2896 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.display"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
2897 if (__Pyx_ImportVoidPtr(__pyx_t_1, "main_window", (void **)&__pyx_vp_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2898 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2899 /*--- Function import code ---*/
2900 __pyx_t_2 = __Pyx_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error)
2901 if (__Pyx_ImportFunction(__pyx_t_2, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2902 Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3429 /*--- Global type/function init code ---*/
3430 (void)__Pyx_modinit_global_init_code();
3431 (void)__Pyx_modinit_variable_export_code();
3432 (void)__Pyx_modinit_function_export_code();
3433 if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
3434 if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
3435 if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error;
3436 if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error;
29033437 /*--- Execution code ---*/
29043438 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
29053439 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
29123446 *
29133447 *
29143448 */
2915 __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
2916 __Pyx_GOTREF(__pyx_t_3);
3449 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
3450 __Pyx_GOTREF(__pyx_t_1);
29173451 __Pyx_INCREF(__pyx_n_s_error);
29183452 __Pyx_GIVEREF(__pyx_n_s_error);
2919 PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_error);
2920 __pyx_t_4 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error)
2921 __Pyx_GOTREF(__pyx_t_4);
2922 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2923 __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
2924 __Pyx_GOTREF(__pyx_t_3);
2925 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_3) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
2926 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2927 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3453 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_error);
3454 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
3455 __Pyx_GOTREF(__pyx_t_2);
3456 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3457 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
3458 __Pyx_GOTREF(__pyx_t_1);
3459 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
3460 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3461 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29283462
29293463 /* "pygame_sdl2/key.pyx":62
29303464 *
29333467 * return SDL_GetKeyboardFocus() != NULL
29343468 *
29353469 */
2936 __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_1get_focused, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error)
2937 __Pyx_GOTREF(__pyx_t_4);
2938 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_focused, __pyx_t_4) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
2939 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3470 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_1get_focused, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
3471 __Pyx_GOTREF(__pyx_t_2);
3472 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_focused, __pyx_t_2) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
3473 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29403474
29413475 /* "pygame_sdl2/key.pyx":65
29423476 * return SDL_GetKeyboardFocus() != NULL
29453479 * """ No longer returns a tuple. Use the returned object to check for
29463480 * individual keys, but don't loop through it. """
29473481 */
2948 __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_3get_pressed, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error)
2949 __Pyx_GOTREF(__pyx_t_4);
2950 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_pressed, __pyx_t_4) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
2951 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3482 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_3get_pressed, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error)
3483 __Pyx_GOTREF(__pyx_t_2);
3484 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_pressed, __pyx_t_2) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
3485 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29523486
29533487 /* "pygame_sdl2/key.pyx":71
29543488 * return KeyboardState()
29573491 * return SDL_GetModState()
29583492 *
29593493 */
2960 __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_5get_mods, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error)
2961 __Pyx_GOTREF(__pyx_t_4);
2962 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_mods, __pyx_t_4) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
2963 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3494 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_5get_mods, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
3495 __Pyx_GOTREF(__pyx_t_2);
3496 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_mods, __pyx_t_2) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
3497 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29643498
29653499 /* "pygame_sdl2/key.pyx":74
29663500 * return SDL_GetModState()
29693503 * SDL_SetModState(state)
29703504 *
29713505 */
2972 __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_7set_mods, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error)
2973 __Pyx_GOTREF(__pyx_t_4);
2974 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mods, __pyx_t_4) < 0) __PYX_ERR(0, 74, __pyx_L1_error)
2975 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3506 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_7set_mods, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error)
3507 __Pyx_GOTREF(__pyx_t_2);
3508 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_mods, __pyx_t_2) < 0) __PYX_ERR(0, 74, __pyx_L1_error)
3509 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29763510
29773511 /* "pygame_sdl2/key.pyx":77
29783512 * SDL_SetModState(state)
29813515 * # Not possible with SDL2.
29823516 * pass
29833517 */
2984 __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_9set_repeat, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error)
2985 __Pyx_GOTREF(__pyx_t_4);
2986 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_repeat, __pyx_t_4) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
2987 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3518 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_9set_repeat, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error)
3519 __Pyx_GOTREF(__pyx_t_2);
3520 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_repeat, __pyx_t_2) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
3521 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29883522
29893523 /* "pygame_sdl2/key.pyx":81
29903524 * pass
29933527 * # Not possible with SDL2.
29943528 * return (0,0)
29953529 */
2996 __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_11get_repeat, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error)
2997 __Pyx_GOTREF(__pyx_t_4);
2998 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_repeat, __pyx_t_4) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
2999 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3530 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_11get_repeat, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
3531 __Pyx_GOTREF(__pyx_t_2);
3532 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_repeat, __pyx_t_2) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
3533 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30003534
30013535 /* "pygame_sdl2/key.pyx":85
30023536 * return (0,0)
30053539 * return SDL_GetKeyName(key)
30063540 *
30073541 */
3008 __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_13name, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error)
3009 __Pyx_GOTREF(__pyx_t_4);
3010 if (PyDict_SetItem(__pyx_d, __pyx_n_s_name, __pyx_t_4) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
3011 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3542 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_13name, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
3543 __Pyx_GOTREF(__pyx_t_2);
3544 if (PyDict_SetItem(__pyx_d, __pyx_n_s_name_2, __pyx_t_2) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
3545 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30123546
30133547 /* "pygame_sdl2/key.pyx":88
30143548 * return SDL_GetKeyName(key)
30263560 * global text_input
30273561 * text_input = True
30283562 */
3029 __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_15start_text_input, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 90, __pyx_L1_error)
3030 __Pyx_GOTREF(__pyx_t_4);
3031 if (PyDict_SetItem(__pyx_d, __pyx_n_s_start_text_input, __pyx_t_4) < 0) __PYX_ERR(0, 90, __pyx_L1_error)
3032 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3563 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_15start_text_input, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
3564 __Pyx_GOTREF(__pyx_t_2);
3565 if (PyDict_SetItem(__pyx_d, __pyx_n_s_start_text_input, __pyx_t_2) < 0) __PYX_ERR(0, 90, __pyx_L1_error)
3566 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30333567
30343568 /* "pygame_sdl2/key.pyx":97
30353569 * SDL_StartTextInput()
30383572 * global text_input
30393573 * text_input = False
30403574 */
3041 __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_17stop_text_input, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
3042 __Pyx_GOTREF(__pyx_t_4);
3043 if (PyDict_SetItem(__pyx_d, __pyx_n_s_stop_text_input, __pyx_t_4) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
3044 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3575 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_17stop_text_input, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
3576 __Pyx_GOTREF(__pyx_t_2);
3577 if (PyDict_SetItem(__pyx_d, __pyx_n_s_stop_text_input, __pyx_t_2) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
3578 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30453579
30463580 /* "pygame_sdl2/key.pyx":104
30473581 * SDL_StopTextInput()
30503584 * cdef SDL_Rect sdl_rect;
30513585 *
30523586 */
3053 __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_19set_text_input_rect, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error)
3054 __Pyx_GOTREF(__pyx_t_4);
3055 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_text_input_rect, __pyx_t_4) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
3056 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3587 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_19set_text_input_rect, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
3588 __Pyx_GOTREF(__pyx_t_2);
3589 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_text_input_rect, __pyx_t_2) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
3590 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30573591
30583592 /* "pygame_sdl2/key.pyx":113
30593593 * SDL_SetTextInputRect(NULL)
30623596 * return SDL_HasScreenKeyboardSupport()
30633597 *
30643598 */
3065 __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_21has_screen_keyboard_support, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error)
3066 __Pyx_GOTREF(__pyx_t_4);
3067 if (PyDict_SetItem(__pyx_d, __pyx_n_s_has_screen_keyboard_support, __pyx_t_4) < 0) __PYX_ERR(0, 113, __pyx_L1_error)
3068 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3599 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_21has_screen_keyboard_support, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
3600 __Pyx_GOTREF(__pyx_t_2);
3601 if (PyDict_SetItem(__pyx_d, __pyx_n_s_has_screen_keyboard_support, __pyx_t_2) < 0) __PYX_ERR(0, 113, __pyx_L1_error)
3602 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30693603
30703604 /* "pygame_sdl2/key.pyx":116
30713605 * return SDL_HasScreenKeyboardSupport()
30743608 * if window is None:
30753609 * window = main_window
30763610 */
3077 __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_23is_screen_keyboard_shown, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 116, __pyx_L1_error)
3078 __Pyx_GOTREF(__pyx_t_4);
3079 if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_screen_keyboard_shown, __pyx_t_4) < 0) __PYX_ERR(0, 116, __pyx_L1_error)
3080 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3611 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_3key_23is_screen_keyboard_shown, NULL, __pyx_n_s_pygame_sdl2_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error)
3612 __Pyx_GOTREF(__pyx_t_2);
3613 if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_screen_keyboard_shown, __pyx_t_2) < 0) __PYX_ERR(0, 116, __pyx_L1_error)
3614 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30813615
30823616 /* "pygame_sdl2/key.pyx":1
30833617 * # Copyright 2014 Patrick Dawson <pat@dw.is> # <<<<<<<<<<<<<<
30843618 * #
30853619 * # This software is provided 'as-is', without any express or implied
30863620 */
3087 __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
3088 __Pyx_GOTREF(__pyx_t_4);
3089 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3090 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3621 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
3622 __Pyx_GOTREF(__pyx_t_2);
3623 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3624 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
30913625
30923626 /*--- Wrapped vars code ---*/
30933627
30953629 __pyx_L1_error:;
30963630 __Pyx_XDECREF(__pyx_t_1);
30973631 __Pyx_XDECREF(__pyx_t_2);
3098 __Pyx_XDECREF(__pyx_t_3);
3099 __Pyx_XDECREF(__pyx_t_4);
31003632 if (__pyx_m) {
31013633 if (__pyx_d) {
3102 __Pyx_AddTraceback("init pygame_sdl2.key", __pyx_clineno, __pyx_lineno, __pyx_filename);
3634 __Pyx_AddTraceback("init pygame_sdl2.key", 0, __pyx_lineno, __pyx_filename);
31033635 }
31043636 Py_DECREF(__pyx_m); __pyx_m = 0;
31053637 } else if (!PyErr_Occurred()) {
31073639 }
31083640 __pyx_L0:;
31093641 __Pyx_RefNannyFinishContext();
3110 #if PY_MAJOR_VERSION < 3
3642 #if CYTHON_PEP489_MULTI_PHASE_INIT
3643 return (__pyx_m != NULL) ? 0 : -1;
3644 #elif PY_MAJOR_VERSION >= 3
3645 return __pyx_m;
3646 #else
31113647 return;
3112 #else
3113 return __pyx_m;
31143648 #endif
31153649 }
31163650
31293663 Py_XDECREF(p);
31303664 Py_XDECREF(m);
31313665 return (__Pyx_RefNannyAPIStruct *)r;
3666 }
3667 #endif
3668
3669 /* PyObjectGetAttrStr */
3670 #if CYTHON_USE_TYPE_SLOTS
3671 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
3672 PyTypeObject* tp = Py_TYPE(obj);
3673 if (likely(tp->tp_getattro))
3674 return tp->tp_getattro(obj, attr_name);
3675 #if PY_MAJOR_VERSION < 3
3676 if (likely(tp->tp_getattr))
3677 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
3678 #endif
3679 return PyObject_GetAttr(obj, attr_name);
31323680 }
31333681 #endif
31343682
31733721 }
31743722
31753723 /* KeywordStringCheck */
3176 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
3724 static int __Pyx_CheckKeywordStrings(
31773725 PyObject *kwdict,
31783726 const char* function_name,
31793727 int kw_allowed)
31873735 #else
31883736 while (PyDict_Next(kwdict, &pos, &key, 0)) {
31893737 #if PY_MAJOR_VERSION < 3
3190 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
3738 if (unlikely(!PyString_Check(key)))
31913739 #endif
31923740 if (unlikely(!PyUnicode_Check(key)))
31933741 goto invalid_keyword_type;
32163764 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
32173765 PyObject *result;
32183766 #if !CYTHON_AVOID_BORROWED_REFS
3767 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
3768 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
3769 if (likely(result)) {
3770 Py_INCREF(result);
3771 } else if (unlikely(PyErr_Occurred())) {
3772 result = NULL;
3773 } else {
3774 #else
32193775 result = PyDict_GetItem(__pyx_d, name);
32203776 if (likely(result)) {
32213777 Py_INCREF(result);
32223778 } else {
3779 #endif
32233780 #else
32243781 result = PyObject_GetItem(__pyx_d, name);
32253782 if (!result) {
32313788 }
32323789
32333790 /* PyCFunctionFastCall */
3234 #if CYTHON_FAST_PYCCALL
3791 #if CYTHON_FAST_PYCCALL
32353792 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
32363793 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
32373794 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
32383795 PyObject *self = PyCFunction_GET_SELF(func);
3796 int flags = PyCFunction_GET_FLAGS(func);
32393797 assert(PyCFunction_Check(func));
3240 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
3798 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
32413799 assert(nargs >= 0);
32423800 assert(nargs == 0 || args != NULL);
32433801 /* _PyCFunction_FastCallDict() must not be called with an exception set,
32443802 because it may clear it (directly or indirectly) and so the
32453803 caller loses its exception */
32463804 assert(!PyErr_Occurred());
3247 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
3248 }
3249 #endif // CYTHON_FAST_PYCCALL
3805 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
3806 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
3807 } else {
3808 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
3809 }
3810 }
3811 #endif
32503812
32513813 /* PyFunctionFastCall */
3252 #if CYTHON_FAST_PYCALL
3814 #if CYTHON_FAST_PYCALL
32533815 #include "frameobject.h"
32543816 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
32553817 PyObject *globals) {
32563818 PyFrameObject *f;
3257 PyThreadState *tstate = PyThreadState_GET();
3819 PyThreadState *tstate = __Pyx_PyThreadState_Current;
32583820 PyObject **fastlocals;
32593821 Py_ssize_t i;
32603822 PyObject *result;
33653927 Py_LeaveRecursiveCall();
33663928 return result;
33673929 }
3368 #endif // CPython < 3.6
3369 #endif // CYTHON_FAST_PYCALL
3930 #endif
3931 #endif
33703932
33713933 /* PyObjectCall */
3372 #if CYTHON_COMPILING_IN_CPYTHON
3934 #if CYTHON_COMPILING_IN_CPYTHON
33733935 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
33743936 PyObject *result;
33753937 ternaryfunc call = func->ob_type->tp_call;
33893951 #endif
33903952
33913953 /* PyObjectCallMethO */
3392 #if CYTHON_COMPILING_IN_CPYTHON
3954 #if CYTHON_COMPILING_IN_CPYTHON
33933955 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
33943956 PyObject *self, *result;
33953957 PyCFunction cfunc;
34093971 #endif
34103972
34113973 /* PyObjectCallOneArg */
3412 #if CYTHON_COMPILING_IN_CPYTHON
3974 #if CYTHON_COMPILING_IN_CPYTHON
34133975 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
34143976 PyObject *result;
34153977 PyObject *args = PyTuple_New(1);
34263988 return __Pyx_PyFunction_FastCall(func, &arg, 1);
34273989 }
34283990 #endif
3429 #ifdef __Pyx_CyFunction_USED
3430 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
3431 #else
34323991 if (likely(PyCFunction_Check(func))) {
3433 #endif
34343992 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
34353993 return __Pyx_PyObject_CallMethO(func, arg);
34363994 #if CYTHON_FAST_PYCCALL
34614019 }
34624020 #endif
34634021 #ifdef __Pyx_CyFunction_USED
3464 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
4022 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
34654023 #else
34664024 if (likely(PyCFunction_Check(func))) {
34674025 #endif
36134171 "raise: exception class must be a subclass of BaseException");
36144172 goto bad;
36154173 }
3616 #if PY_VERSION_HEX >= 0x03030000
36174174 if (cause) {
3618 #else
3619 if (cause && cause != Py_None) {
3620 #endif
36214175 PyObject *fixed_cause;
36224176 if (cause == Py_None) {
36234177 fixed_cause = NULL;
36454199 PyErr_Restore(tmp_type, tmp_value, tb);
36464200 Py_XDECREF(tmp_tb);
36474201 #else
3648 PyThreadState *tstate = PyThreadState_GET();
4202 PyThreadState *tstate = __Pyx_PyThreadState_Current;
36494203 PyObject* tmp_tb = tstate->curexc_traceback;
36504204 if (tb != tmp_tb) {
36514205 Py_INCREF(tb);
36614215 #endif
36624216
36634217 /* RaiseDoubleKeywords */
3664 static void __Pyx_RaiseDoubleKeywordsError(
4218 static void __Pyx_RaiseDoubleKeywordsError(
36654219 const char* func_name,
36664220 PyObject* kw_name)
36674221 {
36754229 }
36764230
36774231 /* ParseKeywords */
3678 static int __Pyx_ParseOptionalKeywords(
4232 static int __Pyx_ParseOptionalKeywords(
36794233 PyObject *kwds,
36804234 PyObject **argnames[],
36814235 PyObject *kwds2,
37774331 }
37784332
37794333 /* ArgTypeTest */
3780 static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
3781 PyErr_Format(PyExc_TypeError,
3782 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
3783 name, type->tp_name, Py_TYPE(obj)->tp_name);
3784 }
3785 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
3786 const char *name, int exact)
4334 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
37874335 {
37884336 if (unlikely(!type)) {
37894337 PyErr_SetString(PyExc_SystemError, "Missing type object");
37904338 return 0;
37914339 }
3792 if (none_allowed && obj == Py_None) return 1;
37934340 else if (exact) {
3794 if (likely(Py_TYPE(obj) == type)) return 1;
37954341 #if PY_MAJOR_VERSION == 2
3796 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
4342 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
37974343 #endif
37984344 }
37994345 else {
3800 if (likely(PyObject_TypeCheck(obj, type))) return 1;
3801 }
3802 __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
4346 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
4347 }
4348 PyErr_Format(PyExc_TypeError,
4349 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
4350 name, type->tp_name, Py_TYPE(obj)->tp_name);
38034351 return 0;
38044352 }
38054353
4354 /* PyObject_GenericGetAttrNoDict */
4355 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
4356 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
4357 PyErr_Format(PyExc_AttributeError,
4358 #if PY_MAJOR_VERSION >= 3
4359 "'%.50s' object has no attribute '%U'",
4360 tp->tp_name, attr_name);
4361 #else
4362 "'%.50s' object has no attribute '%.400s'",
4363 tp->tp_name, PyString_AS_STRING(attr_name));
4364 #endif
4365 return NULL;
4366 }
4367 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
4368 PyObject *descr;
4369 PyTypeObject *tp = Py_TYPE(obj);
4370 if (unlikely(!PyString_Check(attr_name))) {
4371 return PyObject_GenericGetAttr(obj, attr_name);
4372 }
4373 assert(!tp->tp_dictoffset);
4374 descr = _PyType_Lookup(tp, attr_name);
4375 if (unlikely(!descr)) {
4376 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
4377 }
4378 Py_INCREF(descr);
4379 #if PY_MAJOR_VERSION < 3
4380 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
4381 #endif
4382 {
4383 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
4384 if (unlikely(f)) {
4385 PyObject *res = f(descr, obj, (PyObject *)tp);
4386 Py_DECREF(descr);
4387 return res;
4388 }
4389 }
4390 return descr;
4391 }
4392 #endif
4393
4394 /* PyObject_GenericGetAttr */
4395 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
4396 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
4397 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
4398 return PyObject_GenericGetAttr(obj, attr_name);
4399 }
4400 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
4401 }
4402 #endif
4403
4404 /* SetupReduce */
4405 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
4406 int ret;
4407 PyObject *name_attr;
4408 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
4409 if (likely(name_attr)) {
4410 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
4411 } else {
4412 ret = -1;
4413 }
4414 if (unlikely(ret < 0)) {
4415 PyErr_Clear();
4416 ret = 0;
4417 }
4418 Py_XDECREF(name_attr);
4419 return ret;
4420 }
4421 static int __Pyx_setup_reduce(PyObject* type_obj) {
4422 int ret = 0;
4423 PyObject *object_reduce = NULL;
4424 PyObject *object_reduce_ex = NULL;
4425 PyObject *reduce = NULL;
4426 PyObject *reduce_ex = NULL;
4427 PyObject *reduce_cython = NULL;
4428 PyObject *setstate = NULL;
4429 PyObject *setstate_cython = NULL;
4430 #if CYTHON_USE_PYTYPE_LOOKUP
4431 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
4432 #else
4433 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
4434 #endif
4435 #if CYTHON_USE_PYTYPE_LOOKUP
4436 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
4437 #else
4438 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
4439 #endif
4440 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
4441 if (reduce_ex == object_reduce_ex) {
4442 #if CYTHON_USE_PYTYPE_LOOKUP
4443 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
4444 #else
4445 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
4446 #endif
4447 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
4448 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
4449 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
4450 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
4451 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
4452 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
4453 if (!setstate) PyErr_Clear();
4454 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
4455 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
4456 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
4457 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
4458 }
4459 PyType_Modified((PyTypeObject*)type_obj);
4460 }
4461 }
4462 goto GOOD;
4463 BAD:
4464 if (!PyErr_Occurred())
4465 PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
4466 ret = -1;
4467 GOOD:
4468 #if !CYTHON_USE_PYTYPE_LOOKUP
4469 Py_XDECREF(object_reduce);
4470 Py_XDECREF(object_reduce_ex);
4471 #endif
4472 Py_XDECREF(reduce);
4473 Py_XDECREF(reduce_ex);
4474 Py_XDECREF(reduce_cython);
4475 Py_XDECREF(setstate);
4476 Py_XDECREF(setstate_cython);
4477 return ret;
4478 }
4479
38064480 /* GetVTable */
3807 static void* __Pyx_GetVtable(PyObject *dict) {
4481 static void* __Pyx_GetVtable(PyObject *dict) {
38084482 void* ptr;
38094483 PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
38104484 if (!ob)
38244498 }
38254499
38264500 /* Import */
3827 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
4501 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
38284502 PyObject *empty_list = 0;
38294503 PyObject *module = 0;
38304504 PyObject *global_dict = 0;
38314505 PyObject *empty_dict = 0;
38324506 PyObject *list;
3833 #if PY_VERSION_HEX < 0x03030000
4507 #if PY_MAJOR_VERSION < 3
38344508 PyObject *py_import;
38354509 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
38364510 if (!py_import)
38544528 #if PY_MAJOR_VERSION >= 3
38554529 if (level == -1) {
38564530 if (strchr(__Pyx_MODULE_NAME, '.')) {
3857 #if PY_VERSION_HEX < 0x03030000
3858 PyObject *py_level = PyInt_FromLong(1);
3859 if (!py_level)
3860 goto bad;
3861 module = PyObject_CallFunctionObjArgs(py_import,
3862 name, global_dict, empty_dict, list, py_level, NULL);
3863 Py_DECREF(py_level);
3864 #else
38654531 module = PyImport_ImportModuleLevelObject(
38664532 name, global_dict, empty_dict, list, 1);
3867 #endif
38684533 if (!module) {
38694534 if (!PyErr_ExceptionMatches(PyExc_ImportError))
38704535 goto bad;
38754540 }
38764541 #endif
38774542 if (!module) {
3878 #if PY_VERSION_HEX < 0x03030000
4543 #if PY_MAJOR_VERSION < 3
38794544 PyObject *py_level = PyInt_FromLong(level);
38804545 if (!py_level)
38814546 goto bad;
38894554 }
38904555 }
38914556 bad:
3892 #if PY_VERSION_HEX < 0x03030000
4557 #if PY_MAJOR_VERSION < 3
38934558 Py_XDECREF(py_import);
38944559 #endif
38954560 Py_XDECREF(empty_list);
38984563 }
38994564
39004565 /* ImportFrom */
3901 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
4566 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
39024567 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
39034568 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
39044569 PyErr_Format(PyExc_ImportError,
39114576 return value;
39124577 }
39134578
4579 /* CLineInTraceback */
4580 #ifndef CYTHON_CLINE_IN_TRACEBACK
4581 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
4582 PyObject *use_cline;
4583 PyObject *ptype, *pvalue, *ptraceback;
4584 #if CYTHON_COMPILING_IN_CPYTHON
4585 PyObject **cython_runtime_dict;
4586 #endif
4587 if (unlikely(!__pyx_cython_runtime)) {
4588 return c_line;
4589 }
4590 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
4591 #if CYTHON_COMPILING_IN_CPYTHON
4592 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
4593 if (likely(cython_runtime_dict)) {
4594 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
4595 } else
4596 #endif
4597 {
4598 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
4599 if (use_cline_obj) {
4600 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
4601 Py_DECREF(use_cline_obj);
4602 } else {
4603 PyErr_Clear();
4604 use_cline = NULL;
4605 }
4606 }
4607 if (!use_cline) {
4608 c_line = 0;
4609 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
4610 }
4611 else if (PyObject_Not(use_cline) != 0) {
4612 c_line = 0;
4613 }
4614 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
4615 return c_line;
4616 }
4617 #endif
4618
39144619 /* CodeObjectCache */
3915 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
4620 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
39164621 int start = 0, mid = 0, end = count - 1;
39174622 if (end >= 0 && code_line > entries[end].code_line) {
39184623 return count;
39924697 }
39934698
39944699 /* AddTraceback */
3995 #include "compile.h"
4700 #include "compile.h"
39964701 #include "frameobject.h"
39974702 #include "traceback.h"
39984703 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
40514756 int py_line, const char *filename) {
40524757 PyCodeObject *py_code = 0;
40534758 PyFrameObject *py_frame = 0;
4054 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
4759 PyThreadState *tstate = __Pyx_PyThreadState_Current;
4760 if (c_line) {
4761 c_line = __Pyx_CLineForTraceback(tstate, c_line);
4762 }
4763 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
40554764 if (!py_code) {
40564765 py_code = __Pyx_CreateCodeObjectForTraceback(
40574766 funcname, c_line, py_line, filename);
40584767 if (!py_code) goto bad;
4059 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
4768 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
40604769 }
40614770 py_frame = PyFrame_New(
4062 PyThreadState_GET(), /*PyThreadState *tstate,*/
4063 py_code, /*PyCodeObject *code,*/
4064 __pyx_d, /*PyObject *globals,*/
4065 0 /*PyObject *locals*/
4771 tstate, /*PyThreadState *tstate,*/
4772 py_code, /*PyCodeObject *code,*/
4773 __pyx_d, /*PyObject *globals,*/
4774 0 /*PyObject *locals*/
40664775 );
40674776 if (!py_frame) goto bad;
40684777 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
40734782 }
40744783
40754784 /* CIntFromPyVerify */
4076 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
4785 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
40774786 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
40784787 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
40794788 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
40954804 }
40964805
40974806 /* CIntToPy */
4098 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
4807 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
40994808 const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0;
41004809 const int is_unsigned = neg_one > const_zero;
41014810 if (is_unsigned) {
41264835 }
41274836
41284837 /* CIntToPy */
4129 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Keymod(SDL_Keymod value) {
4838 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Keymod(SDL_Keymod value) {
41304839 const SDL_Keymod neg_one = (SDL_Keymod) -1, const_zero = (SDL_Keymod) 0;
41314840 const int is_unsigned = neg_one > const_zero;
41324841 if (is_unsigned) {
41574866 }
41584867
41594868 /* CIntToPy */
4160 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value) {
4869 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_bool(SDL_bool value) {
41614870 const SDL_bool neg_one = (SDL_bool) -1, const_zero = (SDL_bool) 0;
41624871 const int is_unsigned = neg_one > const_zero;
41634872 if (is_unsigned) {
41884897 }
41894898
41904899 /* CIntFromPy */
4191 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
4900 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
41924901 const int neg_one = (int) -1, const_zero = (int) 0;
41934902 const int is_unsigned = neg_one > const_zero;
41944903 #if PY_MAJOR_VERSION < 3
43775086 }
43785087
43795088 /* CIntFromPy */
4380 static CYTHON_INLINE SDL_Keymod __Pyx_PyInt_As_SDL_Keymod(PyObject *x) {
5089 static CYTHON_INLINE SDL_Keymod __Pyx_PyInt_As_SDL_Keymod(PyObject *x) {
43815090 const SDL_Keymod neg_one = (SDL_Keymod) -1, const_zero = (SDL_Keymod) 0;
43825091 const int is_unsigned = neg_one > const_zero;
43835092 #if PY_MAJOR_VERSION < 3
45665275 }
45675276
45685277 /* CIntFromPy */
4569 static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) {
5278 static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_t(PyObject *x) {
45705279 const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0;
45715280 const int is_unsigned = neg_one > const_zero;
45725281 #if PY_MAJOR_VERSION < 3
47555464 }
47565465
47575466 /* CIntToPy */
4758 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
5467 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
47595468 const long neg_one = (long) -1, const_zero = (long) 0;
47605469 const int is_unsigned = neg_one > const_zero;
47615470 if (is_unsigned) {
47865495 }
47875496
47885497 /* CIntFromPy */
4789 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
5498 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
47905499 const long neg_one = (long) -1, const_zero = (long) 0;
47915500 const int is_unsigned = neg_one > const_zero;
47925501 #if PY_MAJOR_VERSION < 3
49745683 return (long) -1;
49755684 }
49765685
5686 /* FastTypeChecks */
5687 #if CYTHON_COMPILING_IN_CPYTHON
5688 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
5689 while (a) {
5690 a = a->tp_base;
5691 if (a == b)
5692 return 1;
5693 }
5694 return b == &PyBaseObject_Type;
5695 }
5696 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
5697 PyObject *mro;
5698 if (a == b) return 1;
5699 mro = a->tp_mro;
5700 if (likely(mro)) {
5701 Py_ssize_t i, n;
5702 n = PyTuple_GET_SIZE(mro);
5703 for (i = 0; i < n; i++) {
5704 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
5705 return 1;
5706 }
5707 return 0;
5708 }
5709 return __Pyx_InBases(a, b);
5710 }
5711 #if PY_MAJOR_VERSION == 2
5712 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
5713 PyObject *exception, *value, *tb;
5714 int res;
5715 __Pyx_PyThreadState_declare
5716 __Pyx_PyThreadState_assign
5717 __Pyx_ErrFetch(&exception, &value, &tb);
5718 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
5719 if (unlikely(res == -1)) {
5720 PyErr_WriteUnraisable(err);
5721 res = 0;
5722 }
5723 if (!res) {
5724 res = PyObject_IsSubclass(err, exc_type2);
5725 if (unlikely(res == -1)) {
5726 PyErr_WriteUnraisable(err);
5727 res = 0;
5728 }
5729 }
5730 __Pyx_ErrRestore(exception, value, tb);
5731 return res;
5732 }
5733 #else
5734 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
5735 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
5736 if (!res) {
5737 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
5738 }
5739 return res;
5740 }
5741 #endif
5742 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
5743 Py_ssize_t i, n;
5744 assert(PyExceptionClass_Check(exc_type));
5745 n = PyTuple_GET_SIZE(tuple);
5746 #if PY_MAJOR_VERSION >= 3
5747 for (i=0; i<n; i++) {
5748 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
5749 }
5750 #endif
5751 for (i=0; i<n; i++) {
5752 PyObject *t = PyTuple_GET_ITEM(tuple, i);
5753 #if PY_MAJOR_VERSION < 3
5754 if (likely(exc_type == t)) return 1;
5755 #endif
5756 if (likely(PyExceptionClass_Check(t))) {
5757 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
5758 } else {
5759 }
5760 }
5761 return 0;
5762 }
5763 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
5764 if (likely(err == exc_type)) return 1;
5765 if (likely(PyExceptionClass_Check(err))) {
5766 if (likely(PyExceptionClass_Check(exc_type))) {
5767 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
5768 } else if (likely(PyTuple_Check(exc_type))) {
5769 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
5770 } else {
5771 }
5772 }
5773 return PyErr_GivenExceptionMatches(err, exc_type);
5774 }
5775 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
5776 assert(PyExceptionClass_Check(exc_type1));
5777 assert(PyExceptionClass_Check(exc_type2));
5778 if (likely(err == exc_type1 || err == exc_type2)) return 1;
5779 if (likely(PyExceptionClass_Check(err))) {
5780 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
5781 }
5782 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
5783 }
5784 #endif
5785
49775786 /* CheckBinaryVersion */
4978 static int __Pyx_check_binary_version(void) {
5787 static int __Pyx_check_binary_version(void) {
49795788 char ctversion[4], rtversion[4];
49805789 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
49815790 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
49915800 }
49925801
49935802 /* ModuleImport */
4994 #ifndef __PYX_HAVE_RT_ImportModule
5803 #ifndef __PYX_HAVE_RT_ImportModule
49955804 #define __PYX_HAVE_RT_ImportModule
49965805 static PyObject *__Pyx_ImportModule(const char *name) {
49975806 PyObject *py_name = 0;
50095818 #endif
50105819
50115820 /* TypeImport */
5012 #ifndef __PYX_HAVE_RT_ImportType
5821 #ifndef __PYX_HAVE_RT_ImportType
50135822 #define __PYX_HAVE_RT_ImportType
50145823 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
50155824 size_t size, int strict)
50745883 #endif
50755884
50765885 /* VoidPtrImport */
5077 #ifndef __PYX_HAVE_RT_ImportVoidPtr
5886 #ifndef __PYX_HAVE_RT_ImportVoidPtr
50785887 #define __PYX_HAVE_RT_ImportVoidPtr
50795888 static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) {
50805889 PyObject *d = 0;
51235932 #endif
51245933
51255934 /* FunctionImport */
5126 #ifndef __PYX_HAVE_RT_ImportFunction
5935 #ifndef __PYX_HAVE_RT_ImportFunction
51275936 #define __PYX_HAVE_RT_ImportFunction
51285937 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
51295938 PyObject *d = 0;
51775986 #endif
51785987
51795988 /* InitStrings */
5180 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
5989 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
51815990 while (t->p) {
51825991 #if PY_MAJOR_VERSION < 3
51835992 if (t->is_unicode) {
52026011 #endif
52036012 if (!*t->p)
52046013 return -1;
6014 if (PyObject_Hash(*t->p) == -1)
6015 return -1;
52056016 ++t;
52066017 }
52076018 return 0;
52106021 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
52116022 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
52126023 }
5213 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
6024 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
52146025 Py_ssize_t ignore;
52156026 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
52166027 }
5217 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5218 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
6028 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
6029 #if !CYTHON_PEP393_ENABLED
6030 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6031 char* defenc_c;
6032 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
6033 if (!defenc) return NULL;
6034 defenc_c = PyBytes_AS_STRING(defenc);
6035 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6036 {
6037 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
6038 char* c;
6039 for (c = defenc_c; c < end; c++) {
6040 if ((unsigned char) (*c) >= 128) {
6041 PyUnicode_AsASCIIString(o);
6042 return NULL;
6043 }
6044 }
6045 }
6046 #endif
6047 *length = PyBytes_GET_SIZE(defenc);
6048 return defenc_c;
6049 }
6050 #else
6051 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6052 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
6053 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6054 if (likely(PyUnicode_IS_ASCII(o))) {
6055 *length = PyUnicode_GET_LENGTH(o);
6056 return PyUnicode_AsUTF8(o);
6057 } else {
6058 PyUnicode_AsASCIIString(o);
6059 return NULL;
6060 }
6061 #else
6062 return PyUnicode_AsUTF8AndSize(o, length);
6063 #endif
6064 }
6065 #endif
6066 #endif
6067 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6068 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
52196069 if (
52206070 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
52216071 __Pyx_sys_getdefaultencoding_not_ascii &&
52226072 #endif
52236073 PyUnicode_Check(o)) {
5224 #if PY_VERSION_HEX < 0x03030000
5225 char* defenc_c;
5226 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
5227 if (!defenc) return NULL;
5228 defenc_c = PyBytes_AS_STRING(defenc);
5229 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5230 {
5231 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
5232 char* c;
5233 for (c = defenc_c; c < end; c++) {
5234 if ((unsigned char) (*c) >= 128) {
5235 PyUnicode_AsASCIIString(o);
5236 return NULL;
5237 }
5238 }
5239 }
5240 #endif
5241 *length = PyBytes_GET_SIZE(defenc);
5242 return defenc_c;
5243 #else
5244 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
5245 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5246 if (PyUnicode_IS_ASCII(o)) {
5247 *length = PyUnicode_GET_LENGTH(o);
5248 return PyUnicode_AsUTF8(o);
5249 } else {
5250 PyUnicode_AsASCIIString(o);
5251 return NULL;
5252 }
5253 #else
5254 return PyUnicode_AsUTF8AndSize(o, length);
5255 #endif
5256 #endif
6074 return __Pyx_PyUnicode_AsStringAndSize(o, length);
52576075 } else
52586076 #endif
52596077 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
52776095 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
52786096 else return PyObject_IsTrue(x);
52796097 }
6098 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
6099 #if PY_MAJOR_VERSION >= 3
6100 if (PyLong_Check(result)) {
6101 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
6102 "__int__ returned non-int (type %.200s). "
6103 "The ability to return an instance of a strict subclass of int "
6104 "is deprecated, and may be removed in a future version of Python.",
6105 Py_TYPE(result)->tp_name)) {
6106 Py_DECREF(result);
6107 return NULL;
6108 }
6109 return result;
6110 }
6111 #endif
6112 PyErr_Format(PyExc_TypeError,
6113 "__%.4s__ returned non-%.4s (type %.200s)",
6114 type_name, type_name, Py_TYPE(result)->tp_name);
6115 Py_DECREF(result);
6116 return NULL;
6117 }
52806118 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
52816119 #if CYTHON_USE_TYPE_SLOTS
52826120 PyNumberMethods *m;
52846122 const char *name = NULL;
52856123 PyObject *res = NULL;
52866124 #if PY_MAJOR_VERSION < 3
5287 if (PyInt_Check(x) || PyLong_Check(x))
5288 #else
5289 if (PyLong_Check(x))
6125 if (likely(PyInt_Check(x) || PyLong_Check(x)))
6126 #else
6127 if (likely(PyLong_Check(x)))
52906128 #endif
52916129 return __Pyx_NewRef(x);
52926130 #if CYTHON_USE_TYPE_SLOTS
52946132 #if PY_MAJOR_VERSION < 3
52956133 if (m && m->nb_int) {
52966134 name = "int";
5297 res = PyNumber_Int(x);
6135 res = m->nb_int(x);
52986136 }
52996137 else if (m && m->nb_long) {
53006138 name = "long";
5301 res = PyNumber_Long(x);
6139 res = m->nb_long(x);
53026140 }
53036141 #else
5304 if (m && m->nb_int) {
6142 if (likely(m && m->nb_int)) {
53056143 name = "int";
5306 res = PyNumber_Long(x);
6144 res = m->nb_int(x);
53076145 }
53086146 #endif
53096147 #else
5310 res = PyNumber_Int(x);
5311 #endif
5312 if (res) {
6148 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
6149 res = PyNumber_Int(x);
6150 }
6151 #endif
6152 if (likely(res)) {
53136153 #if PY_MAJOR_VERSION < 3
5314 if (!PyInt_Check(res) && !PyLong_Check(res)) {
5315 #else
5316 if (!PyLong_Check(res)) {
5317 #endif
5318 PyErr_Format(PyExc_TypeError,
5319 "__%.4s__ returned non-%.4s (type %.200s)",
5320 name, name, Py_TYPE(res)->tp_name);
5321 Py_DECREF(res);
5322 return NULL;
6154 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
6155 #else
6156 if (unlikely(!PyLong_CheckExact(res))) {
6157 #endif
6158 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
53236159 }
53246160 }
53256161 else if (!PyErr_Occurred()) {
53906226 Py_DECREF(x);
53916227 return ival;
53926228 }
6229 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
6230 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
6231 }
53936232 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
53946233 return PyInt_FromSize_t(ival);
53956234 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
88 #else
9 #define CYTHON_ABI "0_25_2"
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
102120 #define CYTHON_COMPILING_IN_CPYTHON 1
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
105129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412552
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
423555 #define __PYX_EXTERN_C extern "C"
428560
429561 #define __PYX_HAVE__pygame_sdl2__locals
430562 #define __PYX_HAVE_API__pygame_sdl2__locals
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
437570 #include <omp.h>
438571 #endif /* _OPENMP */
439572
440 #ifdef PYREX_WITHOUT_ASSERTIONS
573 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
441574 #define CYTHON_WITHOUT_ASSERTIONS
442575 #endif
443576
468601 #define __Pyx_sst_abs(value) abs(value)
469602 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
470603 #define __Pyx_sst_abs(value) labs(value)
471 #elif defined (_MSC_VER) && defined (_M_X64)
472 #define __Pyx_sst_abs(value) _abs64(value)
604 #elif defined (_MSC_VER)
605 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
473606 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
474607 #define __Pyx_sst_abs(value) llabs(value)
475608 #elif defined (__GNUC__)
477610 #else
478611 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
479612 #endif
480 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
481 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
613 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
614 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
482615 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
483616 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
484617 #define __Pyx_PyBytes_FromString PyBytes_FromString
491624 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
492625 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
493626 #endif
494 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
495 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
627 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
628 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
629 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
634 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
635 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
496638 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
497639 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
498640 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
499641 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
500642 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
501 #if PY_MAJOR_VERSION < 3
502 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
503 {
643 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
504644 const Py_UNICODE *u_end = u;
505645 while (*u_end++) ;
506646 return (size_t)(u_end - u - 1);
507647 }
508 #else
509 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
510 #endif
511648 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
512649 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
513650 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
514651 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
515652 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
516 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
653 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
517654 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
518655 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
656 #define __Pyx_PySequence_Tuple(obj)\
657 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
519658 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
520659 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
521660 #if CYTHON_ASSUME_SAFE_MACROS
614753 #define likely(x) (x)
615754 #define unlikely(x) (x)
616755 #endif /* __GNUC__ */
617
618 static PyObject *__pyx_m;
756 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
757
758 static PyObject *__pyx_m = NULL;
619759 static PyObject *__pyx_d;
620760 static PyObject *__pyx_b;
761 static PyObject *__pyx_cython_runtime = NULL;
621762 static PyObject *__pyx_empty_tuple;
622763 static PyObject *__pyx_empty_bytes;
623764 static PyObject *__pyx_empty_unicode;
703844
704845 /* PyObjectGetAttrStr.proto */
705846 #if CYTHON_USE_TYPE_SLOTS
706 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
707 PyTypeObject* tp = Py_TYPE(obj);
708 if (likely(tp->tp_getattro))
709 return tp->tp_getattro(obj, attr_name);
710 #if PY_MAJOR_VERSION < 3
711 if (likely(tp->tp_getattr))
712 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
713 #endif
714 return PyObject_GetAttr(obj, attr_name);
715 }
847 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
716848 #else
717849 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
718850 #endif
761893
762894 /* PyObjectCallOneArg.proto */
763895 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
896
897 /* PyThreadStateGet.proto */
898 #if CYTHON_FAST_THREAD_STATE
899 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
900 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
901 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
902 #else
903 #define __Pyx_PyThreadState_declare
904 #define __Pyx_PyThreadState_assign
905 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
906 #endif
907
908 /* PyErrFetchRestore.proto */
909 #if CYTHON_FAST_THREAD_STATE
910 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
911 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
912 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
913 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
914 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
915 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
916 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
917 #if CYTHON_COMPILING_IN_CPYTHON
918 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
919 #else
920 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
921 #endif
922 #else
923 #define __Pyx_PyErr_Clear() PyErr_Clear()
924 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
925 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
926 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
927 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
928 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
929 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
930 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
931 #endif
932
933 /* CLineInTraceback.proto */
934 #ifdef CYTHON_CLINE_IN_TRACEBACK
935 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
936 #else
937 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
938 #endif
764939
765940 /* CodeObjectCache.proto */
766941 typedef struct {
814989 /* CIntFromPy.proto */
815990 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
816991
992 /* FastTypeChecks.proto */
993 #if CYTHON_COMPILING_IN_CPYTHON
994 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
995 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
996 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
997 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
998 #else
999 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1000 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1001 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1002 #endif
1003 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1004
8171005 /* CheckBinaryVersion.proto */
8181006 static int __Pyx_check_binary_version(void);
8191007
8331021
8341022 /* Module declarations from 'pygame_sdl2.locals' */
8351023 #define __Pyx_MODULE_NAME "pygame_sdl2.locals"
1024 extern int __pyx_module_is_main_pygame_sdl2__locals;
8361025 int __pyx_module_is_main_pygame_sdl2__locals = 0;
8371026
8381027 /* Implementation of 'pygame_sdl2.locals' */
12131402 static const char __pyx_k_POWERSTATE_UNKNOWN[] = "POWERSTATE_UNKNOWN";
12141403 static const char __pyx_k_WINDOWPOS_CENTERED[] = "WINDOWPOS_CENTERED";
12151404 static const char __pyx_k_WINDOW_INPUT_FOCUS[] = "WINDOW_INPUT_FOCUS";
1405 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
12161406 static const char __pyx_k_BLEND_PREMULTIPLIED[] = "BLEND_PREMULTIPLIED";
12171407 static const char __pyx_k_CONTROLLER_AXIS_MAX[] = "CONTROLLER_AXIS_MAX";
12181408 static const char __pyx_k_CONTROLLER_BUTTON_A[] = "CONTROLLER_BUTTON_A";
16951885 static PyObject *__pyx_n_s_WINDOW_OPENGL;
16961886 static PyObject *__pyx_n_s_WINDOW_RESIZABLE;
16971887 static PyObject *__pyx_n_s_WINDOW_SHOWN;
1888 static PyObject *__pyx_n_s_cline_in_traceback;
16981889 static PyObject *__pyx_n_s_import;
16991890 static PyObject *__pyx_n_s_main;
17001891 static PyObject *__pyx_n_s_pygame_sdl2_color;
17171908 static PyObject *__pyx_int_1073741824;
17181909 static PyObject *__pyx_int_2147483648;
17191910 static PyObject *__pyx_int_neg_1;
1911 /* Late includes */
17201912
17211913 static PyMethodDef __pyx_methods[] = {
17221914 {0, 0, 0, 0}
17231915 };
17241916
17251917 #if PY_MAJOR_VERSION >= 3
1918 #if CYTHON_PEP489_MULTI_PHASE_INIT
1919 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
1920 static int __pyx_pymod_exec_locals(PyObject* module); /*proto*/
1921 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
1922 {Py_mod_create, (void*)__pyx_pymod_create},
1923 {Py_mod_exec, (void*)__pyx_pymod_exec_locals},
1924 {0, NULL}
1925 };
1926 #endif
1927
17261928 static struct PyModuleDef __pyx_moduledef = {
1727 #if PY_VERSION_HEX < 0x03020000
1728 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
1729 #else
17301929 PyModuleDef_HEAD_INIT,
1731 #endif
17321930 "locals",
17331931 0, /* m_doc */
1932 #if CYTHON_PEP489_MULTI_PHASE_INIT
1933 0, /* m_size */
1934 #else
17341935 -1, /* m_size */
1936 #endif
17351937 __pyx_methods /* m_methods */,
1938 #if CYTHON_PEP489_MULTI_PHASE_INIT
1939 __pyx_moduledef_slots, /* m_slots */
1940 #else
17361941 NULL, /* m_reload */
1942 #endif
17371943 NULL, /* m_traverse */
17381944 NULL, /* m_clear */
17391945 NULL /* m_free */
21672373 {&__pyx_n_s_WINDOW_OPENGL, __pyx_k_WINDOW_OPENGL, sizeof(__pyx_k_WINDOW_OPENGL), 0, 0, 1, 1},
21682374 {&__pyx_n_s_WINDOW_RESIZABLE, __pyx_k_WINDOW_RESIZABLE, sizeof(__pyx_k_WINDOW_RESIZABLE), 0, 0, 1, 1},
21692375 {&__pyx_n_s_WINDOW_SHOWN, __pyx_k_WINDOW_SHOWN, sizeof(__pyx_k_WINDOW_SHOWN), 0, 0, 1, 1},
2376 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
21702377 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
21712378 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
21722379 {&__pyx_n_s_pygame_sdl2_color, __pyx_k_pygame_sdl2_color, sizeof(__pyx_k_pygame_sdl2_color), 0, 0, 1, 1},
22092416 return -1;
22102417 }
22112418
2419 static int __Pyx_modinit_global_init_code(void); /*proto*/
2420 static int __Pyx_modinit_variable_export_code(void); /*proto*/
2421 static int __Pyx_modinit_function_export_code(void); /*proto*/
2422 static int __Pyx_modinit_type_init_code(void); /*proto*/
2423 static int __Pyx_modinit_type_import_code(void); /*proto*/
2424 static int __Pyx_modinit_variable_import_code(void); /*proto*/
2425 static int __Pyx_modinit_function_import_code(void); /*proto*/
2426
2427 static int __Pyx_modinit_global_init_code(void) {
2428 __Pyx_RefNannyDeclarations
2429 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
2430 /*--- Global init code ---*/
2431 __Pyx_RefNannyFinishContext();
2432 return 0;
2433 }
2434
2435 static int __Pyx_modinit_variable_export_code(void) {
2436 __Pyx_RefNannyDeclarations
2437 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
2438 /*--- Variable export code ---*/
2439 __Pyx_RefNannyFinishContext();
2440 return 0;
2441 }
2442
2443 static int __Pyx_modinit_function_export_code(void) {
2444 __Pyx_RefNannyDeclarations
2445 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
2446 /*--- Function export code ---*/
2447 __Pyx_RefNannyFinishContext();
2448 return 0;
2449 }
2450
2451 static int __Pyx_modinit_type_init_code(void) {
2452 __Pyx_RefNannyDeclarations
2453 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
2454 /*--- Type init code ---*/
2455 __Pyx_RefNannyFinishContext();
2456 return 0;
2457 }
2458
2459 static int __Pyx_modinit_type_import_code(void) {
2460 __Pyx_RefNannyDeclarations
2461 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
2462 /*--- Type import code ---*/
2463 __Pyx_RefNannyFinishContext();
2464 return 0;
2465 }
2466
2467 static int __Pyx_modinit_variable_import_code(void) {
2468 __Pyx_RefNannyDeclarations
2469 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
2470 /*--- Variable import code ---*/
2471 __Pyx_RefNannyFinishContext();
2472 return 0;
2473 }
2474
2475 static int __Pyx_modinit_function_import_code(void) {
2476 __Pyx_RefNannyDeclarations
2477 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
2478 /*--- Function import code ---*/
2479 __Pyx_RefNannyFinishContext();
2480 return 0;
2481 }
2482
2483
22122484 #if PY_MAJOR_VERSION < 3
2213 PyMODINIT_FUNC initlocals(void); /*proto*/
2214 PyMODINIT_FUNC initlocals(void)
2485 #ifdef CYTHON_NO_PYINIT_EXPORT
2486 #define __Pyx_PyMODINIT_FUNC void
22152487 #else
2216 PyMODINIT_FUNC PyInit_locals(void); /*proto*/
2217 PyMODINIT_FUNC PyInit_locals(void)
2488 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
2489 #endif
2490 #else
2491 #ifdef CYTHON_NO_PYINIT_EXPORT
2492 #define __Pyx_PyMODINIT_FUNC PyObject *
2493 #else
2494 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
2495 #endif
2496 #endif
2497 #ifndef CYTHON_SMALL_CODE
2498 #if defined(__clang__)
2499 #define CYTHON_SMALL_CODE
2500 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
2501 #define CYTHON_SMALL_CODE __attribute__((cold))
2502 #else
2503 #define CYTHON_SMALL_CODE
2504 #endif
2505 #endif
2506
2507
2508 #if PY_MAJOR_VERSION < 3
2509 __Pyx_PyMODINIT_FUNC initlocals(void) CYTHON_SMALL_CODE; /*proto*/
2510 __Pyx_PyMODINIT_FUNC initlocals(void)
2511 #else
2512 __Pyx_PyMODINIT_FUNC PyInit_locals(void) CYTHON_SMALL_CODE; /*proto*/
2513 __Pyx_PyMODINIT_FUNC PyInit_locals(void)
2514 #if CYTHON_PEP489_MULTI_PHASE_INIT
2515 {
2516 return PyModuleDef_Init(&__pyx_moduledef);
2517 }
2518 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
2519 PyObject *value = PyObject_GetAttrString(spec, from_name);
2520 int result = 0;
2521 if (likely(value)) {
2522 result = PyDict_SetItemString(moddict, to_name, value);
2523 Py_DECREF(value);
2524 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
2525 PyErr_Clear();
2526 } else {
2527 result = -1;
2528 }
2529 return result;
2530 }
2531 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
2532 PyObject *module = NULL, *moddict, *modname;
2533 if (__pyx_m)
2534 return __Pyx_NewRef(__pyx_m);
2535 modname = PyObject_GetAttrString(spec, "name");
2536 if (unlikely(!modname)) goto bad;
2537 module = PyModule_NewObject(modname);
2538 Py_DECREF(modname);
2539 if (unlikely(!module)) goto bad;
2540 moddict = PyModule_GetDict(module);
2541 if (unlikely(!moddict)) goto bad;
2542 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
2543 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
2544 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
2545 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
2546 return module;
2547 bad:
2548 Py_XDECREF(module);
2549 return NULL;
2550 }
2551
2552
2553 static int __pyx_pymod_exec_locals(PyObject *__pyx_pyinit_module)
2554 #endif
22182555 #endif
22192556 {
22202557 PyObject *__pyx_t_1 = NULL;
22212558 PyObject *__pyx_t_2 = NULL;
22222559 PyObject *__pyx_t_3 = NULL;
22232560 PyObject *__pyx_t_4 = NULL;
2224 PyObject *__pyx_t_5 = NULL;
22252561 __Pyx_RefNannyDeclarations
2562 #if CYTHON_PEP489_MULTI_PHASE_INIT
2563 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
2564 #elif PY_MAJOR_VERSION >= 3
2565 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
2566 #endif
22262567 #if CYTHON_REFNANNY
2227 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
2228 if (!__Pyx_RefNanny) {
2229 PyErr_Clear();
2230 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
2231 if (!__Pyx_RefNanny)
2232 Py_FatalError("failed to import 'refnanny' module");
2233 }
2234 #endif
2235 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_locals(void)", 0);
2568 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
2569 if (!__Pyx_RefNanny) {
2570 PyErr_Clear();
2571 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
2572 if (!__Pyx_RefNanny)
2573 Py_FatalError("failed to import 'refnanny' module");
2574 }
2575 #endif
2576 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_locals(void)", 0);
22362577 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22372578 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
22382579 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
22492590 #ifdef __Pyx_Generator_USED
22502591 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22512592 #endif
2593 #ifdef __Pyx_AsyncGen_USED
2594 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2595 #endif
22522596 #ifdef __Pyx_StopAsyncIteration_USED
22532597 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22542598 #endif
22602604 #endif
22612605 #endif
22622606 /*--- Module creation code ---*/
2607 #if CYTHON_PEP489_MULTI_PHASE_INIT
2608 __pyx_m = __pyx_pyinit_module;
2609 Py_INCREF(__pyx_m);
2610 #else
22632611 #if PY_MAJOR_VERSION < 3
22642612 __pyx_m = Py_InitModule4("locals", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
22652613 #else
22662614 __pyx_m = PyModule_Create(&__pyx_moduledef);
22672615 #endif
22682616 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
2617 #endif
22692618 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
22702619 Py_INCREF(__pyx_d);
22712620 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
2621 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
22722622 #if CYTHON_COMPILING_IN_PYPY
22732623 Py_INCREF(__pyx_b);
22742624 #endif
22932643 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22942644 /*--- Constants init code ---*/
22952645 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2296 /*--- Global init code ---*/
2297 /*--- Variable export code ---*/
2298 /*--- Function export code ---*/
2299 /*--- Type init code ---*/
2300 /*--- Type import code ---*/
2301 /*--- Variable import code ---*/
2302 /*--- Function import code ---*/
2646 /*--- Global type/function init code ---*/
2647 (void)__Pyx_modinit_global_init_code();
2648 (void)__Pyx_modinit_variable_export_code();
2649 (void)__Pyx_modinit_function_export_code();
2650 (void)__Pyx_modinit_type_init_code();
2651 (void)__Pyx_modinit_type_import_code();
2652 (void)__Pyx_modinit_variable_import_code();
2653 (void)__Pyx_modinit_function_import_code();
23032654 /*--- Execution code ---*/
23042655 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23052656 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
64846835 * KMOD_NONE = sdl2.KMOD_NONE,
64856836 *
64866837 */
6487 __pyx_t_3 = __Pyx_Globals(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error)
6838 __pyx_t_4 = __Pyx_Globals(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error)
6839 __Pyx_GOTREF(__pyx_t_4);
6840 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error)
64886841 __Pyx_GOTREF(__pyx_t_3);
6489 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_update); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error)
6490 __Pyx_GOTREF(__pyx_t_2);
6491 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6842 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64926843
64936844 /* "pygame_sdl2/locals.pyx":75
64946845 *
64976848 *
64986849 * KMOD_LSHIFT = sdl2.KMOD_LSHIFT,
64996850 */
6500 __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error)
6501 __Pyx_GOTREF(__pyx_t_3);
6502 __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_NONE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
6503 __Pyx_GOTREF(__pyx_t_1);
6504 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_NONE, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6505 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6851 __pyx_t_4 = __Pyx_PyDict_NewPresized(40); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 75, __pyx_L1_error)
6852 __Pyx_GOTREF(__pyx_t_4);
6853 __pyx_t_2 = __Pyx_PyInt_From_SDL_Keymod(KMOD_NONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error)
6854 __Pyx_GOTREF(__pyx_t_2);
6855 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_KMOD_NONE, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6856 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
65066857
65076858 /* "pygame_sdl2/locals.pyx":77
65086859 * KMOD_NONE = sdl2.KMOD_NONE,
65116862 * KMOD_RSHIFT = sdl2.KMOD_RSHIFT,
65126863 * KMOD_SHIFT = sdl2.KMOD_SHIFT,
65136864 */
6514 __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LSHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
6515 __Pyx_GOTREF(__pyx_t_1);
6516 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_LSHIFT, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6517 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6865 __pyx_t_2 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LSHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error)
6866 __Pyx_GOTREF(__pyx_t_2);
6867 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_KMOD_LSHIFT, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6868 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
65186869
65196870 /* "pygame_sdl2/locals.pyx":78
65206871 *
65236874 * KMOD_SHIFT = sdl2.KMOD_SHIFT,
65246875 *
65256876 */
6526 __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RSHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
6527 __Pyx_GOTREF(__pyx_t_1);
6528 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_RSHIFT, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6529 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6877 __pyx_t_2 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RSHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error)
6878 __Pyx_GOTREF(__pyx_t_2);
6879 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_KMOD_RSHIFT, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6880 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
65306881
65316882 /* "pygame_sdl2/locals.pyx":79
65326883 * KMOD_LSHIFT = sdl2.KMOD_LSHIFT,
65356886 *
65366887 * KMOD_LCTRL = sdl2.KMOD_LCTRL,
65376888 */
6538 __pyx_t_1 = __Pyx_PyInt_From_int(KMOD_SHIFT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
6539 __Pyx_GOTREF(__pyx_t_1);
6540 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_SHIFT, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6541 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6889 __pyx_t_2 = __Pyx_PyInt_From_int(KMOD_SHIFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
6890 __Pyx_GOTREF(__pyx_t_2);
6891 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_KMOD_SHIFT, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6892 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
65426893
65436894 /* "pygame_sdl2/locals.pyx":81
65446895 * KMOD_SHIFT = sdl2.KMOD_SHIFT,
65476898 * KMOD_RCTRL = sdl2.KMOD_RCTRL,
65486899 * KMOD_CTRL = sdl2.KMOD_CTRL,
65496900 */
6550 __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LCTRL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
6551 __Pyx_GOTREF(__pyx_t_1);
6552 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_LCTRL, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6553 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6901 __pyx_t_2 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LCTRL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
6902 __Pyx_GOTREF(__pyx_t_2);
6903 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_KMOD_LCTRL, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6904 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
65546905
65556906 /* "pygame_sdl2/locals.pyx":82
65566907 *
65596910 * KMOD_CTRL = sdl2.KMOD_CTRL,
65606911 *
65616912 */
6562 __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RCTRL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
6563 __Pyx_GOTREF(__pyx_t_1);
6564 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_RCTRL, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6565 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6913 __pyx_t_2 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RCTRL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
6914 __Pyx_GOTREF(__pyx_t_2);
6915 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_KMOD_RCTRL, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6916 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
65666917
65676918 /* "pygame_sdl2/locals.pyx":83
65686919 * KMOD_LCTRL = sdl2.KMOD_LCTRL,
65716922 *
65726923 * KMOD_LALT = sdl2.KMOD_LALT,
65736924 */
6574 __pyx_t_1 = __Pyx_PyInt_From_int(KMOD_CTRL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
6575 __Pyx_GOTREF(__pyx_t_1);
6576 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_CTRL, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6577 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6925 __pyx_t_2 = __Pyx_PyInt_From_int(KMOD_CTRL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
6926 __Pyx_GOTREF(__pyx_t_2);
6927 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_KMOD_CTRL, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6928 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
65786929
65796930 /* "pygame_sdl2/locals.pyx":85
65806931 * KMOD_CTRL = sdl2.KMOD_CTRL,
65836934 * KMOD_RALT = sdl2.KMOD_RALT,
65846935 * KMOD_ALT = sdl2.KMOD_ALT,
65856936 */
6586 __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LALT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
6587 __Pyx_GOTREF(__pyx_t_1);
6588 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_LALT, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6589 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6937 __pyx_t_2 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LALT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
6938 __Pyx_GOTREF(__pyx_t_2);
6939 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_KMOD_LALT, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6940 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
65906941
65916942 /* "pygame_sdl2/locals.pyx":86
65926943 *
65956946 * KMOD_ALT = sdl2.KMOD_ALT,
65966947 *
65976948 */
6598 __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RALT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
6599 __Pyx_GOTREF(__pyx_t_1);
6600 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_RALT, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6601 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6949 __pyx_t_2 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RALT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
6950 __Pyx_GOTREF(__pyx_t_2);
6951 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_KMOD_RALT, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6952 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66026953
66036954 /* "pygame_sdl2/locals.pyx":87
66046955 * KMOD_LALT = sdl2.KMOD_LALT,
66076958 *
66086959 * KMOD_LGUI = sdl2.KMOD_LGUI,
66096960 */
6610 __pyx_t_1 = __Pyx_PyInt_From_int(KMOD_ALT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
6611 __Pyx_GOTREF(__pyx_t_1);
6612 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_ALT, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6613 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6961 __pyx_t_2 = __Pyx_PyInt_From_int(KMOD_ALT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
6962 __Pyx_GOTREF(__pyx_t_2);
6963 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_KMOD_ALT, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6964 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66146965
66156966 /* "pygame_sdl2/locals.pyx":89
66166967 * KMOD_ALT = sdl2.KMOD_ALT,
66196970 * KMOD_RGUI = sdl2.KMOD_RGUI,
66206971 * KMOD_GUI = sdl2.KMOD_GUI,
66216972 */
6622 __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LGUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
6623 __Pyx_GOTREF(__pyx_t_1);
6624 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_LGUI, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6625 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6973 __pyx_t_2 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LGUI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error)
6974 __Pyx_GOTREF(__pyx_t_2);
6975 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_KMOD_LGUI, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6976 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66266977
66276978 /* "pygame_sdl2/locals.pyx":90
66286979 *
66316982 * KMOD_GUI = sdl2.KMOD_GUI,
66326983 *
66336984 */
6634 __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RGUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
6635 __Pyx_GOTREF(__pyx_t_1);
6636 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_RGUI, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6637 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6985 __pyx_t_2 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RGUI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
6986 __Pyx_GOTREF(__pyx_t_2);
6987 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_KMOD_RGUI, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6988 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66386989
66396990 /* "pygame_sdl2/locals.pyx":91
66406991 * KMOD_LGUI = sdl2.KMOD_LGUI,
66436994 *
66446995 * KMOD_LMETA = sdl2.KMOD_LGUI,
66456996 */
6646 __pyx_t_1 = __Pyx_PyInt_From_int(KMOD_GUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
6647 __Pyx_GOTREF(__pyx_t_1);
6648 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_GUI, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6649 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6997 __pyx_t_2 = __Pyx_PyInt_From_int(KMOD_GUI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
6998 __Pyx_GOTREF(__pyx_t_2);
6999 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_KMOD_GUI, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7000 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66507001
66517002 /* "pygame_sdl2/locals.pyx":93
66527003 * KMOD_GUI = sdl2.KMOD_GUI,
66557006 * KMOD_RMETA = sdl2.KMOD_RGUI,
66567007 * KMOD_META = sdl2.KMOD_GUI,
66577008 */
6658 __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LGUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
6659 __Pyx_GOTREF(__pyx_t_1);
6660 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_LMETA, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6661 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7009 __pyx_t_2 = __Pyx_PyInt_From_SDL_Keymod(KMOD_LGUI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)
7010 __Pyx_GOTREF(__pyx_t_2);
7011 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_KMOD_LMETA, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7012 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66627013
66637014 /* "pygame_sdl2/locals.pyx":94
66647015 *
66677018 * KMOD_META = sdl2.KMOD_GUI,
66687019 *
66697020 */
6670 __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RGUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
6671 __Pyx_GOTREF(__pyx_t_1);
6672 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_RMETA, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6673 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7021 __pyx_t_2 = __Pyx_PyInt_From_SDL_Keymod(KMOD_RGUI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
7022 __Pyx_GOTREF(__pyx_t_2);
7023 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_KMOD_RMETA, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7024 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66747025
66757026 /* "pygame_sdl2/locals.pyx":95
66767027 * KMOD_LMETA = sdl2.KMOD_LGUI,
66797030 *
66807031 * KMOD_NUM = sdl2.KMOD_NUM,
66817032 */
6682 __pyx_t_1 = __Pyx_PyInt_From_int(KMOD_GUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
6683 __Pyx_GOTREF(__pyx_t_1);
6684 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_META, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6685 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7033 __pyx_t_2 = __Pyx_PyInt_From_int(KMOD_GUI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error)
7034 __Pyx_GOTREF(__pyx_t_2);
7035 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_KMOD_META, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7036 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66867037
66877038 /* "pygame_sdl2/locals.pyx":97
66887039 * KMOD_META = sdl2.KMOD_GUI,
66917042 * KMOD_CAPS = sdl2.KMOD_CAPS,
66927043 *
66937044 */
6694 __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_NUM); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
6695 __Pyx_GOTREF(__pyx_t_1);
6696 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_NUM, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6697 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7045 __pyx_t_2 = __Pyx_PyInt_From_SDL_Keymod(KMOD_NUM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
7046 __Pyx_GOTREF(__pyx_t_2);
7047 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_KMOD_NUM, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7048 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66987049
66997050 /* "pygame_sdl2/locals.pyx":98
67007051 *
67037054 *
67047055 * KMOD_MODE = sdl2.KMOD_MODE,
67057056 */
6706 __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_CAPS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
6707 __Pyx_GOTREF(__pyx_t_1);
6708 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_CAPS, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6709 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7057 __pyx_t_2 = __Pyx_PyInt_From_SDL_Keymod(KMOD_CAPS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
7058 __Pyx_GOTREF(__pyx_t_2);
7059 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_KMOD_CAPS, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7060 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67107061
67117062 /* "pygame_sdl2/locals.pyx":100
67127063 * KMOD_CAPS = sdl2.KMOD_CAPS,
67157066 *
67167067 * K_FIRST = 0,
67177068 */
6718 __pyx_t_1 = __Pyx_PyInt_From_SDL_Keymod(KMOD_MODE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
6719 __Pyx_GOTREF(__pyx_t_1);
6720 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_KMOD_MODE, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6721 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6722 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_FIRST, __pyx_int_0) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7069 __pyx_t_2 = __Pyx_PyInt_From_SDL_Keymod(KMOD_MODE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
7070 __Pyx_GOTREF(__pyx_t_2);
7071 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_KMOD_MODE, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7072 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7073 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_K_FIRST, __pyx_int_0) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
67237074
67247075 /* "pygame_sdl2/locals.pyx":103
67257076 *
67287079 *
67297080 * K_BREAK = sdl2.SDLK_PAUSE,
67307081 */
6731 __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SLEEP); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
6732 __Pyx_GOTREF(__pyx_t_1);
6733 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_LAST, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6734 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7082 __pyx_t_2 = __Pyx_PyInt_From_int(SDLK_SLEEP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
7083 __Pyx_GOTREF(__pyx_t_2);
7084 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_K_LAST, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7085 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67357086
67367087 /* "pygame_sdl2/locals.pyx":105
67377088 * K_LAST = sdl2.SDLK_SLEEP,
67407091 * K_EURO = sdl2.SDLK_CURRENCYUNIT,
67417092 *
67427093 */
6743 __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PAUSE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
6744 __Pyx_GOTREF(__pyx_t_1);
6745 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_BREAK, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6746 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7094 __pyx_t_2 = __Pyx_PyInt_From_int(SDLK_PAUSE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
7095 __Pyx_GOTREF(__pyx_t_2);
7096 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_K_BREAK, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7097 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67477098
67487099 /* "pygame_sdl2/locals.pyx":106
67497100 *
67527103 *
67537104 * K_KP0 = sdl2.SDLK_KP_0,
67547105 */
6755 __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_CURRENCYUNIT); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
6756 __Pyx_GOTREF(__pyx_t_1);
6757 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_EURO, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6758 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7106 __pyx_t_2 = __Pyx_PyInt_From_int(SDLK_CURRENCYUNIT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
7107 __Pyx_GOTREF(__pyx_t_2);
7108 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_K_EURO, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7109 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67597110
67607111 /* "pygame_sdl2/locals.pyx":108
67617112 * K_EURO = sdl2.SDLK_CURRENCYUNIT,
67647115 * K_KP1 = sdl2.SDLK_KP_1,
67657116 * K_KP2 = sdl2.SDLK_KP_2,
67667117 */
6767 __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error)
6768 __Pyx_GOTREF(__pyx_t_1);
6769 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP0, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6770 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7118 __pyx_t_2 = __Pyx_PyInt_From_int(SDLK_KP_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L1_error)
7119 __Pyx_GOTREF(__pyx_t_2);
7120 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_K_KP0, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7121 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67717122
67727123 /* "pygame_sdl2/locals.pyx":109
67737124 *
67767127 * K_KP2 = sdl2.SDLK_KP_2,
67777128 * K_KP3 = sdl2.SDLK_KP_3,
67787129 */
6779 __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
6780 __Pyx_GOTREF(__pyx_t_1);
6781 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP1, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6782 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7130 __pyx_t_2 = __Pyx_PyInt_From_int(SDLK_KP_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
7131 __Pyx_GOTREF(__pyx_t_2);
7132 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_K_KP1, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7133 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67837134
67847135 /* "pygame_sdl2/locals.pyx":110
67857136 * K_KP0 = sdl2.SDLK_KP_0,
67887139 * K_KP3 = sdl2.SDLK_KP_3,
67897140 * K_KP4 = sdl2.SDLK_KP_4,
67907141 */
6791 __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
6792 __Pyx_GOTREF(__pyx_t_1);
6793 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP2, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6794 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7142 __pyx_t_2 = __Pyx_PyInt_From_int(SDLK_KP_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error)
7143 __Pyx_GOTREF(__pyx_t_2);
7144 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_K_KP2, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7145 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67957146
67967147 /* "pygame_sdl2/locals.pyx":111
67977148 * K_KP1 = sdl2.SDLK_KP_1,
68007151 * K_KP4 = sdl2.SDLK_KP_4,
68017152 * K_KP5 = sdl2.SDLK_KP_5,
68027153 */
6803 __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
6804 __Pyx_GOTREF(__pyx_t_1);
6805 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP3, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6806 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7154 __pyx_t_2 = __Pyx_PyInt_From_int(SDLK_KP_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
7155 __Pyx_GOTREF(__pyx_t_2);
7156 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_K_KP3, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7157 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
68077158
68087159 /* "pygame_sdl2/locals.pyx":112
68097160 * K_KP2 = sdl2.SDLK_KP_2,
68127163 * K_KP5 = sdl2.SDLK_KP_5,
68137164 * K_KP6 = sdl2.SDLK_KP_6,
68147165 */
6815 __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
6816 __Pyx_GOTREF(__pyx_t_1);
6817 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP4, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6818 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7166 __pyx_t_2 = __Pyx_PyInt_From_int(SDLK_KP_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
7167 __Pyx_GOTREF(__pyx_t_2);
7168 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_K_KP4, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7169 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
68197170
68207171 /* "pygame_sdl2/locals.pyx":113
68217172 * K_KP3 = sdl2.SDLK_KP_3,
68247175 * K_KP6 = sdl2.SDLK_KP_6,
68257176 * K_KP7 = sdl2.SDLK_KP_7,
68267177 */
6827 __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
6828 __Pyx_GOTREF(__pyx_t_1);
6829 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP5, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6830 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7178 __pyx_t_2 = __Pyx_PyInt_From_int(SDLK_KP_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
7179 __Pyx_GOTREF(__pyx_t_2);
7180 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_K_KP5, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7181 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
68317182
68327183 /* "pygame_sdl2/locals.pyx":114
68337184 * K_KP4 = sdl2.SDLK_KP_4,
68367187 * K_KP7 = sdl2.SDLK_KP_7,
68377188 * K_KP8 = sdl2.SDLK_KP_8,
68387189 */
6839 __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
6840 __Pyx_GOTREF(__pyx_t_1);
6841 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP6, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6842 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7190 __pyx_t_2 = __Pyx_PyInt_From_int(SDLK_KP_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
7191 __Pyx_GOTREF(__pyx_t_2);
7192 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_K_KP6, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7193 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
68437194
68447195 /* "pygame_sdl2/locals.pyx":115
68457196 * K_KP5 = sdl2.SDLK_KP_5,
68487199 * K_KP8 = sdl2.SDLK_KP_8,
68497200 * K_KP9 = sdl2.SDLK_KP_9,
68507201 */
6851 __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
6852 __Pyx_GOTREF(__pyx_t_1);
6853 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP7, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6854 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7202 __pyx_t_2 = __Pyx_PyInt_From_int(SDLK_KP_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error)
7203 __Pyx_GOTREF(__pyx_t_2);
7204 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_K_KP7, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7205 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
68557206
68567207 /* "pygame_sdl2/locals.pyx":116
68577208 * K_KP6 = sdl2.SDLK_KP_6,
68607211 * K_KP9 = sdl2.SDLK_KP_9,
68617212 *
68627213 */
6863 __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
6864 __Pyx_GOTREF(__pyx_t_1);
6865 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP8, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6866 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7214 __pyx_t_2 = __Pyx_PyInt_From_int(SDLK_KP_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error)
7215 __Pyx_GOTREF(__pyx_t_2);
7216 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_K_KP8, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7217 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
68677218
68687219 /* "pygame_sdl2/locals.pyx":117
68697220 * K_KP7 = sdl2.SDLK_KP_7,
68727223 *
68737224 * K_LMETA = sdl2.SDLK_LGUI,
68747225 */
6875 __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_KP_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
6876 __Pyx_GOTREF(__pyx_t_1);
6877 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_KP9, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6878 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7226 __pyx_t_2 = __Pyx_PyInt_From_int(SDLK_KP_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
7227 __Pyx_GOTREF(__pyx_t_2);
7228 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_K_KP9, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7229 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
68797230
68807231 /* "pygame_sdl2/locals.pyx":119
68817232 * K_KP9 = sdl2.SDLK_KP_9,
68847235 * K_LSUPER = sdl2.SDLK_LGUI,
68857236 * K_RMETA = sdl2.SDLK_RGUI,
68867237 */
6887 __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LGUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
6888 __Pyx_GOTREF(__pyx_t_1);
6889 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_LMETA, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6890 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7238 __pyx_t_2 = __Pyx_PyInt_From_int(SDLK_LGUI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
7239 __Pyx_GOTREF(__pyx_t_2);
7240 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_K_LMETA, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7241 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
68917242
68927243 /* "pygame_sdl2/locals.pyx":120
68937244 *
68967247 * K_RMETA = sdl2.SDLK_RGUI,
68977248 * K_RSUPER = sdl2.SDLK_RGUI,
68987249 */
6899 __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_LGUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
6900 __Pyx_GOTREF(__pyx_t_1);
6901 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_LSUPER, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6902 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7250 __pyx_t_2 = __Pyx_PyInt_From_int(SDLK_LGUI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
7251 __Pyx_GOTREF(__pyx_t_2);
7252 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_K_LSUPER, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7253 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
69037254
69047255 /* "pygame_sdl2/locals.pyx":121
69057256 * K_LMETA = sdl2.SDLK_LGUI,
69087259 * K_RSUPER = sdl2.SDLK_RGUI,
69097260 *
69107261 */
6911 __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RGUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
6912 __Pyx_GOTREF(__pyx_t_1);
6913 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_RMETA, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6914 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7262 __pyx_t_2 = __Pyx_PyInt_From_int(SDLK_RGUI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
7263 __Pyx_GOTREF(__pyx_t_2);
7264 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_K_RMETA, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7265 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
69157266
69167267 /* "pygame_sdl2/locals.pyx":122
69177268 * K_LSUPER = sdl2.SDLK_LGUI,
69207271 *
69217272 * K_NUMLOCK = sdl2.SDLK_NUMLOCKCLEAR,
69227273 */
6923 __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_RGUI); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
6924 __Pyx_GOTREF(__pyx_t_1);
6925 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_RSUPER, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6926 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7274 __pyx_t_2 = __Pyx_PyInt_From_int(SDLK_RGUI); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
7275 __Pyx_GOTREF(__pyx_t_2);
7276 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_K_RSUPER, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7277 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
69277278
69287279 /* "pygame_sdl2/locals.pyx":124
69297280 * K_RSUPER = sdl2.SDLK_RGUI,
69327283 * K_SCROLLOCK = sdl2.SDLK_SCROLLLOCK,
69337284 * K_PRINT = sdl2.SDLK_PRINTSCREEN,
69347285 */
6935 __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_NUMLOCKCLEAR); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
6936 __Pyx_GOTREF(__pyx_t_1);
6937 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_NUMLOCK, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6938 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7286 __pyx_t_2 = __Pyx_PyInt_From_int(SDLK_NUMLOCKCLEAR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
7287 __Pyx_GOTREF(__pyx_t_2);
7288 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_K_NUMLOCK, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7289 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
69397290
69407291 /* "pygame_sdl2/locals.pyx":125
69417292 *
69447295 * K_PRINT = sdl2.SDLK_PRINTSCREEN,
69457296 * ))
69467297 */
6947 __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_SCROLLLOCK); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
6948 __Pyx_GOTREF(__pyx_t_1);
6949 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_SCROLLOCK, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6950 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7298 __pyx_t_2 = __Pyx_PyInt_From_int(SDLK_SCROLLLOCK); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
7299 __Pyx_GOTREF(__pyx_t_2);
7300 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_K_SCROLLOCK, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
7301 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
69517302
69527303 /* "pygame_sdl2/locals.pyx":126
69537304 * K_NUMLOCK = sdl2.SDLK_NUMLOCKCLEAR,
69567307 * ))
69577308 *
69587309 */
6959 __pyx_t_1 = __Pyx_PyInt_From_int(SDLK_PRINTSCREEN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
6960 __Pyx_GOTREF(__pyx_t_1);
6961 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_K_PRINT, __pyx_t_1) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
6962 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6963 __pyx_t_1 = NULL;
6964 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6965 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
6966 if (likely(__pyx_t_1)) {
6967 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6968 __Pyx_INCREF(__pyx_t_1);
6969 __Pyx_INCREF(function);
6970 __Pyx_DECREF_SET(__pyx_t_2, function);
6971 }
6972 }
6973 if (!__pyx_t_1) {
6974 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error)
6975 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6976 __Pyx_GOTREF(__pyx_t_4);
6977 } else {
6978 #if CYTHON_FAST_PYCALL
6979 if (PyFunction_Check(__pyx_t_2)) {
6980 PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
6981 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error)
6982 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6983 __Pyx_GOTREF(__pyx_t_4);
6984 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6985 } else
6986 #endif
6987 #if CYTHON_FAST_PYCCALL
6988 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
6989 PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
6990 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error)
6991 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6992 __Pyx_GOTREF(__pyx_t_4);
6993 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6994 } else
6995 #endif
6996 {
6997 __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error)
6998 __Pyx_GOTREF(__pyx_t_5);
6999 __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
7000 __Pyx_GIVEREF(__pyx_t_3);
7001 PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
7002 __pyx_t_3 = 0;
7003 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error)
7004 __Pyx_GOTREF(__pyx_t_4);
7005 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7006 }
7007 }
7310 __pyx_t_2 = __Pyx_PyInt_From_int(SDLK_PRINTSCREEN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
7311 __Pyx_GOTREF(__pyx_t_2);
7312 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_K_PRINT, __pyx_t_2) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
70087313 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7314
7315 /* "pygame_sdl2/locals.pyx":74
7316 * SDL_VERSION_TUPLE = (SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
7317 *
7318 * globals().update(dict( # <<<<<<<<<<<<<<
7319 * KMOD_NONE = sdl2.KMOD_NONE,
7320 *
7321 */
7322 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error)
7323 __Pyx_GOTREF(__pyx_t_2);
7324 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
70097325 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7326 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
70107327
70117328 /* "pygame_sdl2/locals.pyx":129
70127329 * ))
70227339 * CONTROLLER_BUTTON_A = SDL_CONTROLLER_BUTTON_A
70237340 * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B
70247341 */
7025 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_INVALID); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1, __pyx_L1_error)
7026 __Pyx_GOTREF(__pyx_t_4);
7027 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_INVALID, __pyx_t_4) < 0) __PYX_ERR(4, 1, __pyx_L1_error)
7028 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7342 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_INVALID); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1, __pyx_L1_error)
7343 __Pyx_GOTREF(__pyx_t_2);
7344 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_INVALID, __pyx_t_2) < 0) __PYX_ERR(4, 1, __pyx_L1_error)
7345 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
70297346
70307347 /* "include/controller.pxi":2
70317348 * CONTROLLER_BUTTON_INVALID = SDL_CONTROLLER_BUTTON_INVALID
70337350 * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B
70347351 * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X
70357352 */
7036 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_A); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 2, __pyx_L1_error)
7037 __Pyx_GOTREF(__pyx_t_4);
7038 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_A, __pyx_t_4) < 0) __PYX_ERR(4, 2, __pyx_L1_error)
7039 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7353 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_A); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 2, __pyx_L1_error)
7354 __Pyx_GOTREF(__pyx_t_2);
7355 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_A, __pyx_t_2) < 0) __PYX_ERR(4, 2, __pyx_L1_error)
7356 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
70407357
70417358 /* "include/controller.pxi":3
70427359 * CONTROLLER_BUTTON_INVALID = SDL_CONTROLLER_BUTTON_INVALID
70457362 * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X
70467363 * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y
70477364 */
7048 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_B); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 3, __pyx_L1_error)
7049 __Pyx_GOTREF(__pyx_t_4);
7050 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_B, __pyx_t_4) < 0) __PYX_ERR(4, 3, __pyx_L1_error)
7051 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7365 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_B); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 3, __pyx_L1_error)
7366 __Pyx_GOTREF(__pyx_t_2);
7367 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_B, __pyx_t_2) < 0) __PYX_ERR(4, 3, __pyx_L1_error)
7368 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
70527369
70537370 /* "include/controller.pxi":4
70547371 * CONTROLLER_BUTTON_A = SDL_CONTROLLER_BUTTON_A
70577374 * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y
70587375 * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK
70597376 */
7060 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_X); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 4, __pyx_L1_error)
7061 __Pyx_GOTREF(__pyx_t_4);
7062 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_X, __pyx_t_4) < 0) __PYX_ERR(4, 4, __pyx_L1_error)
7063 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7377 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_X); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 4, __pyx_L1_error)
7378 __Pyx_GOTREF(__pyx_t_2);
7379 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_X, __pyx_t_2) < 0) __PYX_ERR(4, 4, __pyx_L1_error)
7380 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
70647381
70657382 /* "include/controller.pxi":5
70667383 * CONTROLLER_BUTTON_B = SDL_CONTROLLER_BUTTON_B
70697386 * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK
70707387 * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE
70717388 */
7072 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_Y); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 5, __pyx_L1_error)
7073 __Pyx_GOTREF(__pyx_t_4);
7074 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_Y, __pyx_t_4) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
7075 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7389 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_Y); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 5, __pyx_L1_error)
7390 __Pyx_GOTREF(__pyx_t_2);
7391 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_Y, __pyx_t_2) < 0) __PYX_ERR(4, 5, __pyx_L1_error)
7392 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
70767393
70777394 /* "include/controller.pxi":6
70787395 * CONTROLLER_BUTTON_X = SDL_CONTROLLER_BUTTON_X
70817398 * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE
70827399 * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START
70837400 */
7084 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_BACK); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 6, __pyx_L1_error)
7085 __Pyx_GOTREF(__pyx_t_4);
7086 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_BACK, __pyx_t_4) < 0) __PYX_ERR(4, 6, __pyx_L1_error)
7087 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7401 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_BACK); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 6, __pyx_L1_error)
7402 __Pyx_GOTREF(__pyx_t_2);
7403 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_BACK, __pyx_t_2) < 0) __PYX_ERR(4, 6, __pyx_L1_error)
7404 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
70887405
70897406 /* "include/controller.pxi":7
70907407 * CONTROLLER_BUTTON_Y = SDL_CONTROLLER_BUTTON_Y
70937410 * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START
70947411 * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK
70957412 */
7096 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_GUIDE); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 7, __pyx_L1_error)
7097 __Pyx_GOTREF(__pyx_t_4);
7098 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_GUIDE, __pyx_t_4) < 0) __PYX_ERR(4, 7, __pyx_L1_error)
7099 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7413 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_GUIDE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 7, __pyx_L1_error)
7414 __Pyx_GOTREF(__pyx_t_2);
7415 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_GUIDE, __pyx_t_2) < 0) __PYX_ERR(4, 7, __pyx_L1_error)
7416 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
71007417
71017418 /* "include/controller.pxi":8
71027419 * CONTROLLER_BUTTON_BACK = SDL_CONTROLLER_BUTTON_BACK
71057422 * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK
71067423 * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK
71077424 */
7108 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_START); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 8, __pyx_L1_error)
7109 __Pyx_GOTREF(__pyx_t_4);
7110 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_START, __pyx_t_4) < 0) __PYX_ERR(4, 8, __pyx_L1_error)
7111 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7425 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_START); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 8, __pyx_L1_error)
7426 __Pyx_GOTREF(__pyx_t_2);
7427 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_START, __pyx_t_2) < 0) __PYX_ERR(4, 8, __pyx_L1_error)
7428 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
71127429
71137430 /* "include/controller.pxi":9
71147431 * CONTROLLER_BUTTON_GUIDE = SDL_CONTROLLER_BUTTON_GUIDE
71177434 * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK
71187435 * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER
71197436 */
7120 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_LEFTSTICK); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 9, __pyx_L1_error)
7121 __Pyx_GOTREF(__pyx_t_4);
7122 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK, __pyx_t_4) < 0) __PYX_ERR(4, 9, __pyx_L1_error)
7123 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7437 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_LEFTSTICK); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 9, __pyx_L1_error)
7438 __Pyx_GOTREF(__pyx_t_2);
7439 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_LEFTSTICK, __pyx_t_2) < 0) __PYX_ERR(4, 9, __pyx_L1_error)
7440 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
71247441
71257442 /* "include/controller.pxi":10
71267443 * CONTROLLER_BUTTON_START = SDL_CONTROLLER_BUTTON_START
71297446 * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER
71307447 * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER
71317448 */
7132 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_RIGHTSTICK); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 10, __pyx_L1_error)
7133 __Pyx_GOTREF(__pyx_t_4);
7134 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK, __pyx_t_4) < 0) __PYX_ERR(4, 10, __pyx_L1_error)
7135 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7449 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_RIGHTSTICK); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 10, __pyx_L1_error)
7450 __Pyx_GOTREF(__pyx_t_2);
7451 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_RIGHTSTICK, __pyx_t_2) < 0) __PYX_ERR(4, 10, __pyx_L1_error)
7452 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
71367453
71377454 /* "include/controller.pxi":11
71387455 * CONTROLLER_BUTTON_LEFTSTICK = SDL_CONTROLLER_BUTTON_LEFTSTICK
71417458 * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER
71427459 * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP
71437460 */
7144 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_LEFTSHOULDER); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 11, __pyx_L1_error)
7145 __Pyx_GOTREF(__pyx_t_4);
7146 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER, __pyx_t_4) < 0) __PYX_ERR(4, 11, __pyx_L1_error)
7147 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7461 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_LEFTSHOULDER); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 11, __pyx_L1_error)
7462 __Pyx_GOTREF(__pyx_t_2);
7463 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_LEFTSHOULDER, __pyx_t_2) < 0) __PYX_ERR(4, 11, __pyx_L1_error)
7464 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
71487465
71497466 /* "include/controller.pxi":12
71507467 * CONTROLLER_BUTTON_RIGHTSTICK = SDL_CONTROLLER_BUTTON_RIGHTSTICK
71537470 * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP
71547471 * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN
71557472 */
7156 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_RIGHTSHOULDER); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 12, __pyx_L1_error)
7157 __Pyx_GOTREF(__pyx_t_4);
7158 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER, __pyx_t_4) < 0) __PYX_ERR(4, 12, __pyx_L1_error)
7159 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7473 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_RIGHTSHOULDER); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 12, __pyx_L1_error)
7474 __Pyx_GOTREF(__pyx_t_2);
7475 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_RIGHTSHOULDER, __pyx_t_2) < 0) __PYX_ERR(4, 12, __pyx_L1_error)
7476 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
71607477
71617478 /* "include/controller.pxi":13
71627479 * CONTROLLER_BUTTON_LEFTSHOULDER = SDL_CONTROLLER_BUTTON_LEFTSHOULDER
71657482 * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN
71667483 * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT
71677484 */
7168 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_UP); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 13, __pyx_L1_error)
7169 __Pyx_GOTREF(__pyx_t_4);
7170 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_UP, __pyx_t_4) < 0) __PYX_ERR(4, 13, __pyx_L1_error)
7171 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7485 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_UP); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 13, __pyx_L1_error)
7486 __Pyx_GOTREF(__pyx_t_2);
7487 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_UP, __pyx_t_2) < 0) __PYX_ERR(4, 13, __pyx_L1_error)
7488 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
71727489
71737490 /* "include/controller.pxi":14
71747491 * CONTROLLER_BUTTON_RIGHTSHOULDER = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER
71777494 * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT
71787495 * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT
71797496 */
7180 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_DOWN); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 14, __pyx_L1_error)
7181 __Pyx_GOTREF(__pyx_t_4);
7182 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN, __pyx_t_4) < 0) __PYX_ERR(4, 14, __pyx_L1_error)
7183 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7497 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_DOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 14, __pyx_L1_error)
7498 __Pyx_GOTREF(__pyx_t_2);
7499 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_DOWN, __pyx_t_2) < 0) __PYX_ERR(4, 14, __pyx_L1_error)
7500 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
71847501
71857502 /* "include/controller.pxi":15
71867503 * CONTROLLER_BUTTON_DPAD_UP = SDL_CONTROLLER_BUTTON_DPAD_UP
71897506 * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT
71907507 * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX
71917508 */
7192 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_LEFT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 15, __pyx_L1_error)
7193 __Pyx_GOTREF(__pyx_t_4);
7194 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT, __pyx_t_4) < 0) __PYX_ERR(4, 15, __pyx_L1_error)
7195 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7509 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_LEFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 15, __pyx_L1_error)
7510 __Pyx_GOTREF(__pyx_t_2);
7511 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_LEFT, __pyx_t_2) < 0) __PYX_ERR(4, 15, __pyx_L1_error)
7512 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
71967513
71977514 /* "include/controller.pxi":16
71987515 * CONTROLLER_BUTTON_DPAD_DOWN = SDL_CONTROLLER_BUTTON_DPAD_DOWN
72017518 * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX
72027519 * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID
72037520 */
7204 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_RIGHT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 16, __pyx_L1_error)
7205 __Pyx_GOTREF(__pyx_t_4);
7206 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT, __pyx_t_4) < 0) __PYX_ERR(4, 16, __pyx_L1_error)
7207 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7521 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_DPAD_RIGHT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 16, __pyx_L1_error)
7522 __Pyx_GOTREF(__pyx_t_2);
7523 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_DPAD_RIGHT, __pyx_t_2) < 0) __PYX_ERR(4, 16, __pyx_L1_error)
7524 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
72087525
72097526 /* "include/controller.pxi":17
72107527 * CONTROLLER_BUTTON_DPAD_LEFT = SDL_CONTROLLER_BUTTON_DPAD_LEFT
72137530 * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID
72147531 * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX
72157532 */
7216 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 17, __pyx_L1_error)
7217 __Pyx_GOTREF(__pyx_t_4);
7218 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_MAX, __pyx_t_4) < 0) __PYX_ERR(4, 17, __pyx_L1_error)
7219 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7533 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerButton(SDL_CONTROLLER_BUTTON_MAX); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 17, __pyx_L1_error)
7534 __Pyx_GOTREF(__pyx_t_2);
7535 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_BUTTON_MAX, __pyx_t_2) < 0) __PYX_ERR(4, 17, __pyx_L1_error)
7536 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
72207537
72217538 /* "include/controller.pxi":18
72227539 * CONTROLLER_BUTTON_DPAD_RIGHT = SDL_CONTROLLER_BUTTON_DPAD_RIGHT
72257542 * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX
72267543 * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY
72277544 */
7228 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_INVALID); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 18, __pyx_L1_error)
7229 __Pyx_GOTREF(__pyx_t_4);
7230 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_INVALID, __pyx_t_4) < 0) __PYX_ERR(4, 18, __pyx_L1_error)
7231 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7545 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_INVALID); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 18, __pyx_L1_error)
7546 __Pyx_GOTREF(__pyx_t_2);
7547 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_INVALID, __pyx_t_2) < 0) __PYX_ERR(4, 18, __pyx_L1_error)
7548 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
72327549
72337550 /* "include/controller.pxi":19
72347551 * CONTROLLER_BUTTON_MAX = SDL_CONTROLLER_BUTTON_MAX
72377554 * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY
72387555 * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX
72397556 */
7240 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_LEFTX); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 19, __pyx_L1_error)
7241 __Pyx_GOTREF(__pyx_t_4);
7242 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_LEFTX, __pyx_t_4) < 0) __PYX_ERR(4, 19, __pyx_L1_error)
7243 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7557 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_LEFTX); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 19, __pyx_L1_error)
7558 __Pyx_GOTREF(__pyx_t_2);
7559 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_LEFTX, __pyx_t_2) < 0) __PYX_ERR(4, 19, __pyx_L1_error)
7560 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
72447561
72457562 /* "include/controller.pxi":20
72467563 * CONTROLLER_AXIS_INVALID = SDL_CONTROLLER_AXIS_INVALID
72497566 * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX
72507567 * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY
72517568 */
7252 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_LEFTY); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 20, __pyx_L1_error)
7253 __Pyx_GOTREF(__pyx_t_4);
7254 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_LEFTY, __pyx_t_4) < 0) __PYX_ERR(4, 20, __pyx_L1_error)
7255 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7569 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_LEFTY); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 20, __pyx_L1_error)
7570 __Pyx_GOTREF(__pyx_t_2);
7571 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_LEFTY, __pyx_t_2) < 0) __PYX_ERR(4, 20, __pyx_L1_error)
7572 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
72567573
72577574 /* "include/controller.pxi":21
72587575 * CONTROLLER_AXIS_LEFTX = SDL_CONTROLLER_AXIS_LEFTX
72617578 * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY
72627579 * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT
72637580 */
7264 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_RIGHTX); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 21, __pyx_L1_error)
7265 __Pyx_GOTREF(__pyx_t_4);
7266 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_RIGHTX, __pyx_t_4) < 0) __PYX_ERR(4, 21, __pyx_L1_error)
7267 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7581 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_RIGHTX); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 21, __pyx_L1_error)
7582 __Pyx_GOTREF(__pyx_t_2);
7583 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_RIGHTX, __pyx_t_2) < 0) __PYX_ERR(4, 21, __pyx_L1_error)
7584 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
72687585
72697586 /* "include/controller.pxi":22
72707587 * CONTROLLER_AXIS_LEFTY = SDL_CONTROLLER_AXIS_LEFTY
72737590 * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT
72747591 * CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT
72757592 */
7276 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_RIGHTY); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 22, __pyx_L1_error)
7277 __Pyx_GOTREF(__pyx_t_4);
7278 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_RIGHTY, __pyx_t_4) < 0) __PYX_ERR(4, 22, __pyx_L1_error)
7279 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7593 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_RIGHTY); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 22, __pyx_L1_error)
7594 __Pyx_GOTREF(__pyx_t_2);
7595 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_RIGHTY, __pyx_t_2) < 0) __PYX_ERR(4, 22, __pyx_L1_error)
7596 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
72807597
72817598 /* "include/controller.pxi":23
72827599 * CONTROLLER_AXIS_RIGHTX = SDL_CONTROLLER_AXIS_RIGHTX
72857602 * CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT
72867603 * CONTROLLER_AXIS_MAX = SDL_CONTROLLER_AXIS_MAX
72877604 */
7288 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_TRIGGERLEFT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 23, __pyx_L1_error)
7289 __Pyx_GOTREF(__pyx_t_4);
7290 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT, __pyx_t_4) < 0) __PYX_ERR(4, 23, __pyx_L1_error)
7291 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7605 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_TRIGGERLEFT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 23, __pyx_L1_error)
7606 __Pyx_GOTREF(__pyx_t_2);
7607 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_TRIGGERLEFT, __pyx_t_2) < 0) __PYX_ERR(4, 23, __pyx_L1_error)
7608 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
72927609
72937610 /* "include/controller.pxi":24
72947611 * CONTROLLER_AXIS_RIGHTY = SDL_CONTROLLER_AXIS_RIGHTY
72967613 * CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT # <<<<<<<<<<<<<<
72977614 * CONTROLLER_AXIS_MAX = SDL_CONTROLLER_AXIS_MAX
72987615 */
7299 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_TRIGGERRIGHT); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 24, __pyx_L1_error)
7300 __Pyx_GOTREF(__pyx_t_4);
7301 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT, __pyx_t_4) < 0) __PYX_ERR(4, 24, __pyx_L1_error)
7302 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7616 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_TRIGGERRIGHT); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 24, __pyx_L1_error)
7617 __Pyx_GOTREF(__pyx_t_2);
7618 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_TRIGGERRIGHT, __pyx_t_2) < 0) __PYX_ERR(4, 24, __pyx_L1_error)
7619 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
73037620
73047621 /* "include/controller.pxi":25
73057622 * CONTROLLER_AXIS_TRIGGERLEFT = SDL_CONTROLLER_AXIS_TRIGGERLEFT
73067623 * CONTROLLER_AXIS_TRIGGERRIGHT = SDL_CONTROLLER_AXIS_TRIGGERRIGHT
73077624 * CONTROLLER_AXIS_MAX = SDL_CONTROLLER_AXIS_MAX # <<<<<<<<<<<<<<
73087625 */
7309 __pyx_t_4 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 25, __pyx_L1_error)
7310 __Pyx_GOTREF(__pyx_t_4);
7311 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_MAX, __pyx_t_4) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
7312 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7626 __pyx_t_2 = __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_CONTROLLER_AXIS_MAX); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 25, __pyx_L1_error)
7627 __Pyx_GOTREF(__pyx_t_2);
7628 if (PyDict_SetItem(__pyx_d, __pyx_n_s_CONTROLLER_AXIS_MAX, __pyx_t_2) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
7629 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
73137630
73147631 /* "pygame_sdl2/locals.pyx":133
73157632 * include "controller.pxi"
73187635 * POWERSTATE_ON_BATTERY = SDL_POWERSTATE_ON_BATTERY
73197636 * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY
73207637 */
7321 __pyx_t_4 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_UNKNOWN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error)
7322 __Pyx_GOTREF(__pyx_t_4);
7323 if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_UNKNOWN, __pyx_t_4) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
7324 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7638 __pyx_t_2 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_UNKNOWN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
7639 __Pyx_GOTREF(__pyx_t_2);
7640 if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_UNKNOWN, __pyx_t_2) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
7641 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
73257642
73267643 /* "pygame_sdl2/locals.pyx":134
73277644 *
73307647 * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY
73317648 * POWERSTATE_CHARGING = SDL_POWERSTATE_CHARGING
73327649 */
7333 __pyx_t_4 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_ON_BATTERY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error)
7334 __Pyx_GOTREF(__pyx_t_4);
7335 if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_ON_BATTERY, __pyx_t_4) < 0) __PYX_ERR(0, 134, __pyx_L1_error)
7336 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7650 __pyx_t_2 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_ON_BATTERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error)
7651 __Pyx_GOTREF(__pyx_t_2);
7652 if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_ON_BATTERY, __pyx_t_2) < 0) __PYX_ERR(0, 134, __pyx_L1_error)
7653 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
73377654
73387655 /* "pygame_sdl2/locals.pyx":135
73397656 * POWERSTATE_UNKNOWN = SDL_POWERSTATE_UNKNOWN
73427659 * POWERSTATE_CHARGING = SDL_POWERSTATE_CHARGING
73437660 * POWERSTATE_CHARGED = SDL_POWERSTATE_CHARGED
73447661 */
7345 __pyx_t_4 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_NO_BATTERY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error)
7346 __Pyx_GOTREF(__pyx_t_4);
7347 if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_NO_BATTERY, __pyx_t_4) < 0) __PYX_ERR(0, 135, __pyx_L1_error)
7348 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7662 __pyx_t_2 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_NO_BATTERY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
7663 __Pyx_GOTREF(__pyx_t_2);
7664 if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_NO_BATTERY, __pyx_t_2) < 0) __PYX_ERR(0, 135, __pyx_L1_error)
7665 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
73497666
73507667 /* "pygame_sdl2/locals.pyx":136
73517668 * POWERSTATE_ON_BATTERY = SDL_POWERSTATE_ON_BATTERY
73547671 * POWERSTATE_CHARGED = SDL_POWERSTATE_CHARGED
73557672 *
73567673 */
7357 __pyx_t_4 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_CHARGING); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error)
7358 __Pyx_GOTREF(__pyx_t_4);
7359 if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_CHARGING, __pyx_t_4) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
7360 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7674 __pyx_t_2 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_CHARGING); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error)
7675 __Pyx_GOTREF(__pyx_t_2);
7676 if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_CHARGING, __pyx_t_2) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
7677 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
73617678
73627679 /* "pygame_sdl2/locals.pyx":137
73637680 * POWERSTATE_NO_BATTERY = SDL_POWERSTATE_NO_BATTERY
73657682 * POWERSTATE_CHARGED = SDL_POWERSTATE_CHARGED # <<<<<<<<<<<<<<
73667683 *
73677684 */
7368 __pyx_t_4 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_CHARGED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error)
7369 __Pyx_GOTREF(__pyx_t_4);
7370 if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_CHARGED, __pyx_t_4) < 0) __PYX_ERR(0, 137, __pyx_L1_error)
7371 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7685 __pyx_t_2 = __Pyx_PyInt_From_SDL_PowerState(SDL_POWERSTATE_CHARGED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
7686 __Pyx_GOTREF(__pyx_t_2);
7687 if (PyDict_SetItem(__pyx_d, __pyx_n_s_POWERSTATE_CHARGED, __pyx_t_2) < 0) __PYX_ERR(0, 137, __pyx_L1_error)
7688 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
73727689
73737690 /* "pygame_sdl2/locals.pyx":1
73747691 * from sdl2 cimport * # <<<<<<<<<<<<<<
73757692 * cimport sdl2
73767693 *
73777694 */
7378 __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
7379 __Pyx_GOTREF(__pyx_t_4);
7380 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7381 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7695 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
7696 __Pyx_GOTREF(__pyx_t_2);
7697 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7698 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
73827699
73837700 /*--- Wrapped vars code ---*/
73847701
73887705 __Pyx_XDECREF(__pyx_t_2);
73897706 __Pyx_XDECREF(__pyx_t_3);
73907707 __Pyx_XDECREF(__pyx_t_4);
7391 __Pyx_XDECREF(__pyx_t_5);
73927708 if (__pyx_m) {
73937709 if (__pyx_d) {
7394 __Pyx_AddTraceback("init pygame_sdl2.locals", __pyx_clineno, __pyx_lineno, __pyx_filename);
7710 __Pyx_AddTraceback("init pygame_sdl2.locals", 0, __pyx_lineno, __pyx_filename);
73957711 }
73967712 Py_DECREF(__pyx_m); __pyx_m = 0;
73977713 } else if (!PyErr_Occurred()) {
73997715 }
74007716 __pyx_L0:;
74017717 __Pyx_RefNannyFinishContext();
7402 #if PY_MAJOR_VERSION < 3
7718 #if CYTHON_PEP489_MULTI_PHASE_INIT
7719 return (__pyx_m != NULL) ? 0 : -1;
7720 #elif PY_MAJOR_VERSION >= 3
7721 return __pyx_m;
7722 #else
74037723 return;
7404 #else
7405 return __pyx_m;
74067724 #endif
74077725 }
74087726
74247742 }
74257743 #endif
74267744
7745 /* PyObjectGetAttrStr */
7746 #if CYTHON_USE_TYPE_SLOTS
7747 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
7748 PyTypeObject* tp = Py_TYPE(obj);
7749 if (likely(tp->tp_getattro))
7750 return tp->tp_getattro(obj, attr_name);
7751 #if PY_MAJOR_VERSION < 3
7752 if (likely(tp->tp_getattr))
7753 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
7754 #endif
7755 return PyObject_GetAttr(obj, attr_name);
7756 }
7757 #endif
7758
74277759 /* Import */
74287760 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
74297761 PyObject *empty_list = 0;
74317763 PyObject *global_dict = 0;
74327764 PyObject *empty_dict = 0;
74337765 PyObject *list;
7434 #if PY_VERSION_HEX < 0x03030000
7766 #if PY_MAJOR_VERSION < 3
74357767 PyObject *py_import;
74367768 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
74377769 if (!py_import)
74557787 #if PY_MAJOR_VERSION >= 3
74567788 if (level == -1) {
74577789 if (strchr(__Pyx_MODULE_NAME, '.')) {
7458 #if PY_VERSION_HEX < 0x03030000
7459 PyObject *py_level = PyInt_FromLong(1);
7460 if (!py_level)
7461 goto bad;
7462 module = PyObject_CallFunctionObjArgs(py_import,
7463 name, global_dict, empty_dict, list, py_level, NULL);
7464 Py_DECREF(py_level);
7465 #else
74667790 module = PyImport_ImportModuleLevelObject(
74677791 name, global_dict, empty_dict, list, 1);
7468 #endif
74697792 if (!module) {
74707793 if (!PyErr_ExceptionMatches(PyExc_ImportError))
74717794 goto bad;
74767799 }
74777800 #endif
74787801 if (!module) {
7479 #if PY_VERSION_HEX < 0x03030000
7802 #if PY_MAJOR_VERSION < 3
74807803 PyObject *py_level = PyInt_FromLong(level);
74817804 if (!py_level)
74827805 goto bad;
74907813 }
74917814 }
74927815 bad:
7493 #if PY_VERSION_HEX < 0x03030000
7816 #if PY_MAJOR_VERSION < 3
74947817 Py_XDECREF(py_import);
74957818 #endif
74967819 Py_XDECREF(empty_list);
75147837
75157838 /* GetAttr */
75167839 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
7517 #if CYTHON_COMPILING_IN_CPYTHON
7840 #if CYTHON_USE_TYPE_SLOTS
75187841 #if PY_MAJOR_VERSION >= 3
75197842 if (likely(PyUnicode_Check(n)))
75207843 #else
75767899 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
75777900 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
75787901 PyObject *self = PyCFunction_GET_SELF(func);
7902 int flags = PyCFunction_GET_FLAGS(func);
75797903 assert(PyCFunction_Check(func));
7580 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
7904 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
75817905 assert(nargs >= 0);
75827906 assert(nargs == 0 || args != NULL);
75837907 /* _PyCFunction_FastCallDict() must not be called with an exception set,
75847908 because it may clear it (directly or indirectly) and so the
75857909 caller loses its exception */
75867910 assert(!PyErr_Occurred());
7587 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
7911 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
7912 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
7913 } else {
7914 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
7915 }
75887916 }
7589 #endif // CYTHON_FAST_PYCCALL
7917 #endif
75907918
75917919 /* PyFunctionFastCall */
75927920 #if CYTHON_FAST_PYCALL
75947922 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
75957923 PyObject *globals) {
75967924 PyFrameObject *f;
7597 PyThreadState *tstate = PyThreadState_GET();
7925 PyThreadState *tstate = __Pyx_PyThreadState_Current;
75987926 PyObject **fastlocals;
75997927 Py_ssize_t i;
76007928 PyObject *result;
77058033 Py_LeaveRecursiveCall();
77068034 return result;
77078035 }
7708 #endif // CPython < 3.6
7709 #endif // CYTHON_FAST_PYCALL
8036 #endif
8037 #endif
77108038
77118039 /* PyObjectCall */
77128040 #if CYTHON_COMPILING_IN_CPYTHON
77668094 return __Pyx_PyFunction_FastCall(func, &arg, 1);
77678095 }
77688096 #endif
7769 #ifdef __Pyx_CyFunction_USED
7770 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
7771 #else
77728097 if (likely(PyCFunction_Check(func))) {
7773 #endif
77748098 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
77758099 return __Pyx_PyObject_CallMethO(func, arg);
77768100 #if CYTHON_FAST_PYCCALL
77928116 }
77938117 #endif
77948118
8119 /* PyErrFetchRestore */
8120 #if CYTHON_FAST_THREAD_STATE
8121 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
8122 PyObject *tmp_type, *tmp_value, *tmp_tb;
8123 tmp_type = tstate->curexc_type;
8124 tmp_value = tstate->curexc_value;
8125 tmp_tb = tstate->curexc_traceback;
8126 tstate->curexc_type = type;
8127 tstate->curexc_value = value;
8128 tstate->curexc_traceback = tb;
8129 Py_XDECREF(tmp_type);
8130 Py_XDECREF(tmp_value);
8131 Py_XDECREF(tmp_tb);
8132 }
8133 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
8134 *type = tstate->curexc_type;
8135 *value = tstate->curexc_value;
8136 *tb = tstate->curexc_traceback;
8137 tstate->curexc_type = 0;
8138 tstate->curexc_value = 0;
8139 tstate->curexc_traceback = 0;
8140 }
8141 #endif
8142
8143 /* CLineInTraceback */
8144 #ifndef CYTHON_CLINE_IN_TRACEBACK
8145 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
8146 PyObject *use_cline;
8147 PyObject *ptype, *pvalue, *ptraceback;
8148 #if CYTHON_COMPILING_IN_CPYTHON
8149 PyObject **cython_runtime_dict;
8150 #endif
8151 if (unlikely(!__pyx_cython_runtime)) {
8152 return c_line;
8153 }
8154 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
8155 #if CYTHON_COMPILING_IN_CPYTHON
8156 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
8157 if (likely(cython_runtime_dict)) {
8158 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
8159 } else
8160 #endif
8161 {
8162 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
8163 if (use_cline_obj) {
8164 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
8165 Py_DECREF(use_cline_obj);
8166 } else {
8167 PyErr_Clear();
8168 use_cline = NULL;
8169 }
8170 }
8171 if (!use_cline) {
8172 c_line = 0;
8173 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
8174 }
8175 else if (PyObject_Not(use_cline) != 0) {
8176 c_line = 0;
8177 }
8178 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
8179 return c_line;
8180 }
8181 #endif
8182
77958183 /* CodeObjectCache */
7796 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
8184 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
77978185 int start = 0, mid = 0, end = count - 1;
77988186 if (end >= 0 && code_line > entries[end].code_line) {
77998187 return count;
78738261 }
78748262
78758263 /* AddTraceback */
7876 #include "compile.h"
8264 #include "compile.h"
78778265 #include "frameobject.h"
78788266 #include "traceback.h"
78798267 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
79328320 int py_line, const char *filename) {
79338321 PyCodeObject *py_code = 0;
79348322 PyFrameObject *py_frame = 0;
7935 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
8323 PyThreadState *tstate = __Pyx_PyThreadState_Current;
8324 if (c_line) {
8325 c_line = __Pyx_CLineForTraceback(tstate, c_line);
8326 }
8327 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
79368328 if (!py_code) {
79378329 py_code = __Pyx_CreateCodeObjectForTraceback(
79388330 funcname, c_line, py_line, filename);
79398331 if (!py_code) goto bad;
7940 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
8332 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
79418333 }
79428334 py_frame = PyFrame_New(
7943 PyThreadState_GET(), /*PyThreadState *tstate,*/
7944 py_code, /*PyCodeObject *code,*/
7945 __pyx_d, /*PyObject *globals,*/
7946 0 /*PyObject *locals*/
8335 tstate, /*PyThreadState *tstate,*/
8336 py_code, /*PyCodeObject *code,*/
8337 __pyx_d, /*PyObject *globals,*/
8338 0 /*PyObject *locals*/
79478339 );
79488340 if (!py_frame) goto bad;
79498341 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
79548346 }
79558347
79568348 /* CIntToPy */
7957 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_EventType(SDL_EventType value) {
8349 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_EventType(SDL_EventType value) {
79588350 const SDL_EventType neg_one = (SDL_EventType) -1, const_zero = (SDL_EventType) 0;
79598351 const int is_unsigned = neg_one > const_zero;
79608352 if (is_unsigned) {
79858377 }
79868378
79878379 /* CIntToPy */
7988 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
8380 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
79898381 const long neg_one = (long) -1, const_zero = (long) 0;
79908382 const int is_unsigned = neg_one > const_zero;
79918383 if (is_unsigned) {
80168408 }
80178409
80188410 /* CIntToPy */
8019 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
8411 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
80208412 const int neg_one = (int) -1, const_zero = (int) 0;
80218413 const int is_unsigned = neg_one > const_zero;
80228414 if (is_unsigned) {
80478439 }
80488440
80498441 /* CIntToPy */
8050 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GLattr(SDL_GLattr value) {
8442 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GLattr(SDL_GLattr value) {
80518443 const SDL_GLattr neg_one = (SDL_GLattr) -1, const_zero = (SDL_GLattr) 0;
80528444 const int is_unsigned = neg_one > const_zero;
80538445 if (is_unsigned) {
80788470 }
80798471
80808472 /* CIntToPy */
8081 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_WindowFlags(SDL_WindowFlags value) {
8473 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_WindowFlags(SDL_WindowFlags value) {
80828474 const SDL_WindowFlags neg_one = (SDL_WindowFlags) -1, const_zero = (SDL_WindowFlags) 0;
80838475 const int is_unsigned = neg_one > const_zero;
80848476 if (is_unsigned) {
81098501 }
81108502
81118503 /* CIntToPy */
8112 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Keymod(SDL_Keymod value) {
8504 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_Keymod(SDL_Keymod value) {
81138505 const SDL_Keymod neg_one = (SDL_Keymod) -1, const_zero = (SDL_Keymod) 0;
81148506 const int is_unsigned = neg_one > const_zero;
81158507 if (is_unsigned) {
81408532 }
81418533
81428534 /* CIntToPy */
8143 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerButton value) {
8535 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerButton(SDL_GameControllerButton value) {
81448536 const SDL_GameControllerButton neg_one = (SDL_GameControllerButton) -1, const_zero = (SDL_GameControllerButton) 0;
81458537 const int is_unsigned = neg_one > const_zero;
81468538 if (is_unsigned) {
81718563 }
81728564
81738565 /* CIntToPy */
8174 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerAxis value) {
8566 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_GameControllerAxis(SDL_GameControllerAxis value) {
81758567 const SDL_GameControllerAxis neg_one = (SDL_GameControllerAxis) -1, const_zero = (SDL_GameControllerAxis) 0;
81768568 const int is_unsigned = neg_one > const_zero;
81778569 if (is_unsigned) {
82028594 }
82038595
82048596 /* CIntToPy */
8205 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_PowerState(SDL_PowerState value) {
8597 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_PowerState(SDL_PowerState value) {
82068598 const SDL_PowerState neg_one = (SDL_PowerState) -1, const_zero = (SDL_PowerState) 0;
82078599 const int is_unsigned = neg_one > const_zero;
82088600 if (is_unsigned) {
82338625 }
82348626
82358627 /* CIntFromPyVerify */
8236 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
8628 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
82378629 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
82388630 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
82398631 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
82558647 }
82568648
82578649 /* CIntFromPy */
8258 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
8650 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
82598651 const long neg_one = (long) -1, const_zero = (long) 0;
82608652 const int is_unsigned = neg_one > const_zero;
82618653 #if PY_MAJOR_VERSION < 3
84448836 }
84458837
84468838 /* CIntFromPy */
8447 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
8839 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
84488840 const int neg_one = (int) -1, const_zero = (int) 0;
84498841 const int is_unsigned = neg_one > const_zero;
84508842 #if PY_MAJOR_VERSION < 3
86329024 return (int) -1;
86339025 }
86349026
9027 /* FastTypeChecks */
9028 #if CYTHON_COMPILING_IN_CPYTHON
9029 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
9030 while (a) {
9031 a = a->tp_base;
9032 if (a == b)
9033 return 1;
9034 }
9035 return b == &PyBaseObject_Type;
9036 }
9037 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
9038 PyObject *mro;
9039 if (a == b) return 1;
9040 mro = a->tp_mro;
9041 if (likely(mro)) {
9042 Py_ssize_t i, n;
9043 n = PyTuple_GET_SIZE(mro);
9044 for (i = 0; i < n; i++) {
9045 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
9046 return 1;
9047 }
9048 return 0;
9049 }
9050 return __Pyx_InBases(a, b);
9051 }
9052 #if PY_MAJOR_VERSION == 2
9053 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
9054 PyObject *exception, *value, *tb;
9055 int res;
9056 __Pyx_PyThreadState_declare
9057 __Pyx_PyThreadState_assign
9058 __Pyx_ErrFetch(&exception, &value, &tb);
9059 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
9060 if (unlikely(res == -1)) {
9061 PyErr_WriteUnraisable(err);
9062 res = 0;
9063 }
9064 if (!res) {
9065 res = PyObject_IsSubclass(err, exc_type2);
9066 if (unlikely(res == -1)) {
9067 PyErr_WriteUnraisable(err);
9068 res = 0;
9069 }
9070 }
9071 __Pyx_ErrRestore(exception, value, tb);
9072 return res;
9073 }
9074 #else
9075 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
9076 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
9077 if (!res) {
9078 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
9079 }
9080 return res;
9081 }
9082 #endif
9083 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
9084 Py_ssize_t i, n;
9085 assert(PyExceptionClass_Check(exc_type));
9086 n = PyTuple_GET_SIZE(tuple);
9087 #if PY_MAJOR_VERSION >= 3
9088 for (i=0; i<n; i++) {
9089 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
9090 }
9091 #endif
9092 for (i=0; i<n; i++) {
9093 PyObject *t = PyTuple_GET_ITEM(tuple, i);
9094 #if PY_MAJOR_VERSION < 3
9095 if (likely(exc_type == t)) return 1;
9096 #endif
9097 if (likely(PyExceptionClass_Check(t))) {
9098 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
9099 } else {
9100 }
9101 }
9102 return 0;
9103 }
9104 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
9105 if (likely(err == exc_type)) return 1;
9106 if (likely(PyExceptionClass_Check(err))) {
9107 if (likely(PyExceptionClass_Check(exc_type))) {
9108 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
9109 } else if (likely(PyTuple_Check(exc_type))) {
9110 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
9111 } else {
9112 }
9113 }
9114 return PyErr_GivenExceptionMatches(err, exc_type);
9115 }
9116 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
9117 assert(PyExceptionClass_Check(exc_type1));
9118 assert(PyExceptionClass_Check(exc_type2));
9119 if (likely(err == exc_type1 || err == exc_type2)) return 1;
9120 if (likely(PyExceptionClass_Check(err))) {
9121 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
9122 }
9123 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
9124 }
9125 #endif
9126
86359127 /* CheckBinaryVersion */
8636 static int __Pyx_check_binary_version(void) {
9128 static int __Pyx_check_binary_version(void) {
86379129 char ctversion[4], rtversion[4];
86389130 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
86399131 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
86499141 }
86509142
86519143 /* InitStrings */
8652 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
9144 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
86539145 while (t->p) {
86549146 #if PY_MAJOR_VERSION < 3
86559147 if (t->is_unicode) {
86749166 #endif
86759167 if (!*t->p)
86769168 return -1;
9169 if (PyObject_Hash(*t->p) == -1)
9170 return -1;
86779171 ++t;
86789172 }
86799173 return 0;
86829176 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
86839177 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
86849178 }
8685 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
9179 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
86869180 Py_ssize_t ignore;
86879181 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
86889182 }
8689 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
8690 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
9183 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
9184 #if !CYTHON_PEP393_ENABLED
9185 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
9186 char* defenc_c;
9187 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
9188 if (!defenc) return NULL;
9189 defenc_c = PyBytes_AS_STRING(defenc);
9190 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
9191 {
9192 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
9193 char* c;
9194 for (c = defenc_c; c < end; c++) {
9195 if ((unsigned char) (*c) >= 128) {
9196 PyUnicode_AsASCIIString(o);
9197 return NULL;
9198 }
9199 }
9200 }
9201 #endif
9202 *length = PyBytes_GET_SIZE(defenc);
9203 return defenc_c;
9204 }
9205 #else
9206 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
9207 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
9208 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
9209 if (likely(PyUnicode_IS_ASCII(o))) {
9210 *length = PyUnicode_GET_LENGTH(o);
9211 return PyUnicode_AsUTF8(o);
9212 } else {
9213 PyUnicode_AsASCIIString(o);
9214 return NULL;
9215 }
9216 #else
9217 return PyUnicode_AsUTF8AndSize(o, length);
9218 #endif
9219 }
9220 #endif
9221 #endif
9222 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
9223 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
86919224 if (
86929225 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
86939226 __Pyx_sys_getdefaultencoding_not_ascii &&
86949227 #endif
86959228 PyUnicode_Check(o)) {
8696 #if PY_VERSION_HEX < 0x03030000
8697 char* defenc_c;
8698 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
8699 if (!defenc) return NULL;
8700 defenc_c = PyBytes_AS_STRING(defenc);
8701 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
8702 {
8703 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
8704 char* c;
8705 for (c = defenc_c; c < end; c++) {
8706 if ((unsigned char) (*c) >= 128) {
8707 PyUnicode_AsASCIIString(o);
8708 return NULL;
8709 }
8710 }
8711 }
8712 #endif
8713 *length = PyBytes_GET_SIZE(defenc);
8714 return defenc_c;
8715 #else
8716 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
8717 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
8718 if (PyUnicode_IS_ASCII(o)) {
8719 *length = PyUnicode_GET_LENGTH(o);
8720 return PyUnicode_AsUTF8(o);
8721 } else {
8722 PyUnicode_AsASCIIString(o);
8723 return NULL;
8724 }
8725 #else
8726 return PyUnicode_AsUTF8AndSize(o, length);
8727 #endif
8728 #endif
9229 return __Pyx_PyUnicode_AsStringAndSize(o, length);
87299230 } else
87309231 #endif
87319232 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
87499250 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
87509251 else return PyObject_IsTrue(x);
87519252 }
9253 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
9254 #if PY_MAJOR_VERSION >= 3
9255 if (PyLong_Check(result)) {
9256 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
9257 "__int__ returned non-int (type %.200s). "
9258 "The ability to return an instance of a strict subclass of int "
9259 "is deprecated, and may be removed in a future version of Python.",
9260 Py_TYPE(result)->tp_name)) {
9261 Py_DECREF(result);
9262 return NULL;
9263 }
9264 return result;
9265 }
9266 #endif
9267 PyErr_Format(PyExc_TypeError,
9268 "__%.4s__ returned non-%.4s (type %.200s)",
9269 type_name, type_name, Py_TYPE(result)->tp_name);
9270 Py_DECREF(result);
9271 return NULL;
9272 }
87529273 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
87539274 #if CYTHON_USE_TYPE_SLOTS
87549275 PyNumberMethods *m;
87569277 const char *name = NULL;
87579278 PyObject *res = NULL;
87589279 #if PY_MAJOR_VERSION < 3
8759 if (PyInt_Check(x) || PyLong_Check(x))
9280 if (likely(PyInt_Check(x) || PyLong_Check(x)))
87609281 #else
8761 if (PyLong_Check(x))
9282 if (likely(PyLong_Check(x)))
87629283 #endif
87639284 return __Pyx_NewRef(x);
87649285 #if CYTHON_USE_TYPE_SLOTS
87669287 #if PY_MAJOR_VERSION < 3
87679288 if (m && m->nb_int) {
87689289 name = "int";
8769 res = PyNumber_Int(x);
9290 res = m->nb_int(x);
87709291 }
87719292 else if (m && m->nb_long) {
87729293 name = "long";
8773 res = PyNumber_Long(x);
9294 res = m->nb_long(x);
87749295 }
87759296 #else
8776 if (m && m->nb_int) {
9297 if (likely(m && m->nb_int)) {
87779298 name = "int";
8778 res = PyNumber_Long(x);
9299 res = m->nb_int(x);
87799300 }
87809301 #endif
87819302 #else
8782 res = PyNumber_Int(x);
8783 #endif
8784 if (res) {
9303 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
9304 res = PyNumber_Int(x);
9305 }
9306 #endif
9307 if (likely(res)) {
87859308 #if PY_MAJOR_VERSION < 3
8786 if (!PyInt_Check(res) && !PyLong_Check(res)) {
9309 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
87879310 #else
8788 if (!PyLong_Check(res)) {
8789 #endif
8790 PyErr_Format(PyExc_TypeError,
8791 "__%.4s__ returned non-%.4s (type %.200s)",
8792 name, name, Py_TYPE(res)->tp_name);
8793 Py_DECREF(res);
8794 return NULL;
9311 if (unlikely(!PyLong_CheckExact(res))) {
9312 #endif
9313 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
87959314 }
87969315 }
87979316 else if (!PyErr_Occurred()) {
88629381 Py_DECREF(x);
88639382 return ival;
88649383 }
9384 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
9385 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
9386 }
88659387 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
88669388 return PyInt_FromSize_t(ival);
88679389 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
88 #else
9 #define CYTHON_ABI "0_25_2"
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
102120 #define CYTHON_COMPILING_IN_CPYTHON 1
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
105129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412552
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
423555 #define __PYX_EXTERN_C extern "C"
428560
429561 #define __PYX_HAVE__pygame_sdl2__mixer
430562 #define __PYX_HAVE_API__pygame_sdl2__mixer
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
438571 #include <omp.h>
439572 #endif /* _OPENMP */
440573
441 #ifdef PYREX_WITHOUT_ASSERTIONS
574 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
442575 #define CYTHON_WITHOUT_ASSERTIONS
443576 #endif
444577
469602 #define __Pyx_sst_abs(value) abs(value)
470603 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
471604 #define __Pyx_sst_abs(value) labs(value)
472 #elif defined (_MSC_VER) && defined (_M_X64)
473 #define __Pyx_sst_abs(value) _abs64(value)
605 #elif defined (_MSC_VER)
606 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
474607 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
475608 #define __Pyx_sst_abs(value) llabs(value)
476609 #elif defined (__GNUC__)
478611 #else
479612 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
480613 #endif
481 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
482 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
614 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
615 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
483616 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
484617 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
485618 #define __Pyx_PyBytes_FromString PyBytes_FromString
492625 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
493626 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
494627 #endif
495 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
496 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
628 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
629 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
634 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
635 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
638 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
497639 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
498640 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
499641 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
500642 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
501643 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
502 #if PY_MAJOR_VERSION < 3
503 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
504 {
644 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
505645 const Py_UNICODE *u_end = u;
506646 while (*u_end++) ;
507647 return (size_t)(u_end - u - 1);
508648 }
509 #else
510 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
511 #endif
512649 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
513650 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
514651 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
515652 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
516653 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
517 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
654 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
518655 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
519656 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
657 #define __Pyx_PySequence_Tuple(obj)\
658 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
520659 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
521660 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
522661 #if CYTHON_ASSUME_SAFE_MACROS
615754 #define likely(x) (x)
616755 #define unlikely(x) (x)
617756 #endif /* __GNUC__ */
618
619 static PyObject *__pyx_m;
757 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
758
759 static PyObject *__pyx_m = NULL;
620760 static PyObject *__pyx_d;
621761 static PyObject *__pyx_b;
762 static PyObject *__pyx_cython_runtime = NULL;
622763 static PyObject *__pyx_empty_tuple;
623764 static PyObject *__pyx_empty_bytes;
624765 static PyObject *__pyx_empty_unicode;
629770
630771
631772 static const char *__pyx_f[] = {
773 "stringsource",
632774 "src/pygame_sdl2/mixer.pyx",
633775 };
776 /* NoFastGil.proto */
777 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
778 #define __Pyx_PyGILState_Release PyGILState_Release
779 #define __Pyx_FastGIL_Remember()
780 #define __Pyx_FastGIL_Forget()
781 #define __Pyx_FastGilFuncInit()
782
783 /* ForceInitThreads.proto */
784 #ifndef __PYX_FORCE_INIT_THREADS
785 #define __PYX_FORCE_INIT_THREADS 0
786 #endif
787
634788
635789 /*--- Type declarations ---*/
636790 struct __pyx_obj_11pygame_sdl2_5mixer_Sound;
740894
741895 /* PyObjectGetAttrStr.proto */
742896 #if CYTHON_USE_TYPE_SLOTS
743 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
744 PyTypeObject* tp = Py_TYPE(obj);
745 if (likely(tp->tp_getattro))
746 return tp->tp_getattro(obj, attr_name);
747 #if PY_MAJOR_VERSION < 3
748 if (likely(tp->tp_getattr))
749 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
750 #endif
751 return PyObject_GetAttr(obj, attr_name);
752 }
897 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
753898 #else
754899 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
755900 #endif
761906 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
762907
763908 /* PyObjectLookupSpecial.proto */
764 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
909 #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
765910 static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
766911 PyObject *res;
767912 PyTypeObject *tp = Py_TYPE(obj);
828973
829974 /* DictGetItem.proto */
830975 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
831 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
832 PyObject *value;
833 value = PyDict_GetItemWithError(d, key);
834 if (unlikely(!value)) {
835 if (!PyErr_Occurred()) {
836 PyObject* args = PyTuple_Pack(1, key);
837 if (likely(args))
838 PyErr_SetObject(PyExc_KeyError, args);
839 Py_XDECREF(args);
840 }
841 return NULL;
842 }
843 Py_INCREF(value);
844 return value;
845 }
976 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
977 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
978 (likely(PyDict_CheckExact(obj)) ?\
979 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
846980 #else
847 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
981 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
982 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
848983 #endif
849984
850985 /* ExtTypeTest.proto */
853988 /* PyThreadStateGet.proto */
854989 #if CYTHON_FAST_THREAD_STATE
855990 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
856 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
991 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
992 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
857993 #else
858994 #define __Pyx_PyThreadState_declare
859995 #define __Pyx_PyThreadState_assign
996 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
860997 #endif
861998
862999 /* SaveResetException.proto */
8801017
8811018 /* PyErrFetchRestore.proto */
8821019 #if CYTHON_FAST_THREAD_STATE
1020 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
8831021 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
8841022 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
8851023 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
8861024 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
8871025 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
8881026 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1027 #if CYTHON_COMPILING_IN_CPYTHON
1028 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
8891029 #else
1030 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1031 #endif
1032 #else
1033 #define __Pyx_PyErr_Clear() PyErr_Clear()
1034 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
8901035 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
8911036 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1037 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1038 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
8921039 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
8931040 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
8941041 #endif
8961043 /* None.proto */
8971044 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
8981045
899 /* ForceInitThreads.proto */
900 #ifndef __PYX_FORCE_INIT_THREADS
901 #define __PYX_FORCE_INIT_THREADS 0
902 #endif
903
9041046 /* dict_getitem_default.proto */
9051047 static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);
1048
1049 /* UnpackUnboundCMethod.proto */
1050 typedef struct {
1051 PyObject *type;
1052 PyObject **method_name;
1053 PyCFunction func;
1054 PyObject *method;
1055 int flag;
1056 } __Pyx_CachedCFunction;
1057
1058 /* CallUnboundCMethod1.proto */
1059 static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
1060 #if CYTHON_COMPILING_IN_CPYTHON
1061 static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
1062 #else
1063 #define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg)
1064 #endif
1065
1066 /* CallUnboundCMethod2.proto */
1067 static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
1068 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
1069 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
1070 #else
1071 #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
1072 #endif
9061073
9071074 /* WriteUnraisableException.proto */
9081075 static void __Pyx_WriteUnraisable(const char *name, int clineno,
9401107
9411108 /* PyObjectCallMethod1.proto */
9421109 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
1110 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg);
9431111
9441112 /* append.proto */
9451113 static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);
9601128 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
9611129
9621130 /* KeywordStringCheck.proto */
963 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
1131 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
9641132
9651133 /* PyIntBinop.proto */
9661134 #if !CYTHON_COMPILING_IN_PYPY
9881156 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
9891157 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
9901158 int wraparound, int boundscheck);
991 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1159 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
9921160 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
9931161 int is_list, int wraparound, int boundscheck);
9941162
9951163 /* ArgTypeTest.proto */
996 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
997 const char *name, int exact);
1164 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1165 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1166 __Pyx__ArgTypeTest(obj, type, name, exact))
1167 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1168
1169 /* PyErrExceptionMatches.proto */
1170 #if CYTHON_FAST_THREAD_STATE
1171 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1172 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1173 #else
1174 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1175 #endif
1176
1177 /* GetAttr.proto */
1178 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1179
1180 /* GetAttr3.proto */
1181 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
9981182
9991183 /* Import.proto */
10001184 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
10011185
10021186 /* ImportFrom.proto */
10031187 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1188
1189 /* HasAttr.proto */
1190 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1191
1192 /* PyObject_GenericGetAttrNoDict.proto */
1193 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1194 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1195 #else
1196 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1197 #endif
1198
1199 /* PyObject_GenericGetAttr.proto */
1200 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1201 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1202 #else
1203 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1204 #endif
1205
1206 /* SetupReduce.proto */
1207 static int __Pyx_setup_reduce(PyObject* type_obj);
1208
1209 /* CLineInTraceback.proto */
1210 #ifdef CYTHON_CLINE_IN_TRACEBACK
1211 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1212 #else
1213 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1214 #endif
10041215
10051216 /* CodeObjectCache.proto */
10061217 typedef struct {
10371248 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
10381249
10391250 /* CIntFromPy.proto */
1251 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1252
1253 /* CIntFromPy.proto */
10401254 static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *);
10411255
1042 /* CIntFromPy.proto */
1043 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1256 /* FastTypeChecks.proto */
1257 #if CYTHON_COMPILING_IN_CPYTHON
1258 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1259 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1260 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1261 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1262 #else
1263 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1264 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1265 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1266 #endif
1267 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
10441268
10451269 /* CheckBinaryVersion.proto */
10461270 static int __Pyx_check_binary_version(void);
10881312 static PyObject *__pyx_v_11pygame_sdl2_5mixer_channel_queued = 0;
10891313 static PyObject *__pyx_v_11pygame_sdl2_5mixer_current_sounds = 0;
10901314 static void __pyx_f_11pygame_sdl2_5mixer_channel_callback(int); /*proto*/
1315 static PyObject *__pyx_f_11pygame_sdl2_5mixer___pyx_unpickle_Channel__set_state(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *, PyObject *); /*proto*/
10911316 #define __Pyx_MODULE_NAME "pygame_sdl2.mixer"
1317 extern int __pyx_module_is_main_pygame_sdl2__mixer;
10921318 int __pyx_module_is_main_pygame_sdl2__mixer = 0;
10931319
10941320 /* Implementation of 'pygame_sdl2.mixer' */
1321 static PyObject *__pyx_builtin_TypeError;
10951322 static const char __pyx_k__4[] = "{}\n";
10961323 static const char __pyx_k_fi[] = "fi";
10971324 static const char __pyx_k_ms[] = "ms";
1098 static const char __pyx_k__13[] = "*";
1325 static const char __pyx_k__15[] = "*";
10991326 static const char __pyx_k_cid[] = "cid";
11001327 static const char __pyx_k_get[] = "get";
1328 static const char __pyx_k_new[] = "__new__";
11011329 static const char __pyx_k_sys[] = "sys";
11021330 static const char __pyx_k_Lock[] = "Lock";
11031331 static const char __pyx_k_args[] = "args";
11041332 static const char __pyx_k_chan[] = "chan";
1333 static const char __pyx_k_dict[] = "__dict__";
11051334 static const char __pyx_k_exit[] = "__exit__";
11061335 static const char __pyx_k_flag[] = "flag";
11071336 static const char __pyx_k_init[] = "init";
11081337 static const char __pyx_k_lock[] = "_lock";
11091338 static const char __pyx_k_main[] = "__main__";
1339 static const char __pyx_k_name[] = "__name__";
11101340 static const char __pyx_k_play[] = "play";
11111341 static const char __pyx_k_quit[] = "quit";
11121342 static const char __pyx_k_size[] = "size";
11291359 static const char __pyx_k_errors[] = "errors";
11301360 static const char __pyx_k_format[] = "format";
11311361 static const char __pyx_k_import[] = "__import__";
1362 static const char __pyx_k_pickle[] = "pickle";
1363 static const char __pyx_k_reduce[] = "__reduce__";
11321364 static const char __pyx_k_target[] = "target";
1365 static const char __pyx_k_update[] = "update";
11331366 static const char __pyx_k_channel[] = "channel";
11341367 static const char __pyx_k_fade_ms[] = "fade_ms";
11351368 static const char __pyx_k_fadeout[] = "fadeout";
11381371 static const char __pyx_k_channels[] = "channels";
11391372 static const char __pyx_k_get_busy[] = "get_busy";
11401373 static const char __pyx_k_get_init[] = "get_init";
1374 static const char __pyx_k_getstate[] = "__getstate__";
11411375 static const char __pyx_k_pre_init[] = "pre_init";
1376 static const char __pyx_k_pyx_type[] = "__pyx_type";
1377 static const char __pyx_k_setstate[] = "__setstate__";
1378 static const char __pyx_k_TypeError[] = "TypeError";
11421379 static const char __pyx_k_frequency[] = "frequency";
1380 static const char __pyx_k_pyx_state[] = "__pyx_state";
1381 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
11431382 static const char __pyx_k_threading[] = "threading";
11441383 static const char __pyx_k_buffersize[] = "buffersize";
11451384 static const char __pyx_k_next_sound[] = "next_sound";
1385 static const char __pyx_k_pyx_result[] = "__pyx_result";
1386 static const char __pyx_k_PickleError[] = "PickleError";
11461387 static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2";
11471388 static const char __pyx_k_find_channel[] = "find_channel";
11481389 static const char __pyx_k_play_current[] = "_play_current";
1390 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
11491391 static const char __pyx_k_set_reserved[] = "set_reserved";
1392 static const char __pyx_k_stringsource[] = "stringsource";
1393 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
11501394 static const char __pyx_k_register_init[] = "register_init";
11511395 static const char __pyx_k_register_quit[] = "register_quit";
11521396 static const char __pyx_k_Not_implemented[] = "Not implemented.";
1397 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
1398 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
11531399 static const char __pyx_k_get_num_channels[] = "get_num_channels";
11541400 static const char __pyx_k_set_num_channels[] = "set_num_channels";
11551401 static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error";
11561402 static const char __pyx_k_pygame_sdl2_mixer[] = "pygame_sdl2.mixer";
1403 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1404 static const char __pyx_k_pyx_unpickle_Channel[] = "__pyx_unpickle_Channel";
11571405 static const char __pyx_k_pygame_sdl2_mixer_music[] = "pygame_sdl2.mixer_music";
11581406 static const char __pyx_k_src_pygame_sdl2_mixer_pyx[] = "src/pygame_sdl2/mixer.pyx";
1407 static const char __pyx_k_Incompatible_checksums_s_vs_0x4b[] = "Incompatible checksums (%s vs 0x4b7cc56 = (cid))";
1408 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
1409 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x4b;
11591410 static PyObject *__pyx_n_s_Lock;
11601411 static PyObject *__pyx_kp_u_Not_implemented;
1412 static PyObject *__pyx_n_s_PickleError;
11611413 static PyObject *__pyx_n_s_Thread;
1162 static PyObject *__pyx_n_s__13;
1414 static PyObject *__pyx_n_s_TypeError;
1415 static PyObject *__pyx_n_s__15;
11631416 static PyObject *__pyx_kp_u__4;
11641417 static PyObject *__pyx_n_s_append;
11651418 static PyObject *__pyx_n_s_args;
11691422 static PyObject *__pyx_n_s_channel;
11701423 static PyObject *__pyx_n_s_channels;
11711424 static PyObject *__pyx_n_s_cid;
1425 static PyObject *__pyx_n_s_cline_in_traceback;
11721426 static PyObject *__pyx_n_s_count;
1427 static PyObject *__pyx_n_s_dict;
11731428 static PyObject *__pyx_n_s_enter;
11741429 static PyObject *__pyx_n_s_error;
11751430 static PyObject *__pyx_n_s_errors;
11861441 static PyObject *__pyx_n_s_get_busy;
11871442 static PyObject *__pyx_n_s_get_init;
11881443 static PyObject *__pyx_n_s_get_num_channels;
1444 static PyObject *__pyx_n_s_getstate;
11891445 static PyObject *__pyx_n_s_import;
11901446 static PyObject *__pyx_n_s_init;
11911447 static PyObject *__pyx_n_s_lock;
11941450 static PyObject *__pyx_n_s_maxtime;
11951451 static PyObject *__pyx_n_s_ms;
11961452 static PyObject *__pyx_n_s_music;
1453 static PyObject *__pyx_n_s_name;
1454 static PyObject *__pyx_n_s_new;
11971455 static PyObject *__pyx_n_s_next_sound;
1456 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
11981457 static PyObject *__pyx_n_s_pause;
1458 static PyObject *__pyx_n_s_pickle;
11991459 static PyObject *__pyx_n_s_play;
12001460 static PyObject *__pyx_n_s_play_current;
12011461 static PyObject *__pyx_n_s_pre_init;
12031463 static PyObject *__pyx_n_s_pygame_sdl2_error;
12041464 static PyObject *__pyx_n_s_pygame_sdl2_mixer;
12051465 static PyObject *__pyx_n_s_pygame_sdl2_mixer_music;
1466 static PyObject *__pyx_n_s_pyx_PickleError;
1467 static PyObject *__pyx_n_s_pyx_checksum;
1468 static PyObject *__pyx_n_s_pyx_result;
1469 static PyObject *__pyx_n_s_pyx_state;
1470 static PyObject *__pyx_n_s_pyx_type;
1471 static PyObject *__pyx_n_s_pyx_unpickle_Channel;
12061472 static PyObject *__pyx_n_s_quit;
1473 static PyObject *__pyx_n_s_reduce;
1474 static PyObject *__pyx_n_s_reduce_cython;
1475 static PyObject *__pyx_n_s_reduce_ex;
12071476 static PyObject *__pyx_n_s_register_init;
12081477 static PyObject *__pyx_n_s_register_quit;
12091478 static PyObject *__pyx_n_s_set_num_channels;
12101479 static PyObject *__pyx_n_s_set_reserved;
1480 static PyObject *__pyx_n_s_setstate;
1481 static PyObject *__pyx_n_s_setstate_cython;
12111482 static PyObject *__pyx_n_s_size;
12121483 static PyObject *__pyx_n_s_sound;
12131484 static PyObject *__pyx_kp_s_src_pygame_sdl2_mixer_pyx;
12141485 static PyObject *__pyx_n_s_start;
12151486 static PyObject *__pyx_n_s_stop;
1487 static PyObject *__pyx_kp_s_stringsource;
12161488 static PyObject *__pyx_n_s_sys;
12171489 static PyObject *__pyx_n_s_target;
12181490 static PyObject *__pyx_n_s_test;
12201492 static PyObject *__pyx_n_s_time;
12211493 static PyObject *__pyx_n_s_type;
12221494 static PyObject *__pyx_n_s_unpause;
1495 static PyObject *__pyx_n_s_update;
12231496 static PyObject *__pyx_pf_11pygame_sdl2_5mixer__play_current(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_channel); /* proto */
12241497 static PyObject *__pyx_pf_11pygame_sdl2_5mixer_2init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_size, PyObject *__pyx_v_channels, PyObject *__pyx_v_buffer); /* proto */
12251498 static PyObject *__pyx_pf_11pygame_sdl2_5mixer_4pre_init(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_frequency, PyObject *__pyx_v_size, PyObject *__pyx_v_channels, PyObject *__pyx_v_buffersize); /* proto */
12471520 static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_20get_num_channels(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */
12481521 static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_22get_length(struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */
12491522 static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_24get_raw(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */
1523 static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_26__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self); /* proto */
1524 static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_28__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
12501525 static int __pyx_pf_11pygame_sdl2_5mixer_7Channel___init__(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_cid); /* proto */
12511526 static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_2play(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_sound, PyObject *__pyx_v_loops, PyObject *__pyx_v_maxtime, PyObject *__pyx_v_fade_ms); /* proto */
12521527 static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_4stop(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */
12611536 static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_22get_queue(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */
12621537 static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_24set_endevent(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v_type); /* proto */
12631538 static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_26get_endevent(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */
1539 static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_28__reduce_cython__(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self); /* proto */
1540 static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_30__setstate_cython__(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
1541 static PyObject *__pyx_pf_11pygame_sdl2_5mixer_28__pyx_unpickle_Channel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
12641542 static PyObject *__pyx_tp_new_11pygame_sdl2_5mixer_Sound(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
12651543 static PyObject *__pyx_tp_new_11pygame_sdl2_5mixer_Channel(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1544 static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, &__pyx_n_s_get, 0, 0, 0};
12661545 static PyObject *__pyx_int_0;
12671546 static PyObject *__pyx_int_2;
12681547 static PyObject *__pyx_int_4096;
12691548 static PyObject *__pyx_int_22050;
1549 static PyObject *__pyx_int_79154262;
12701550 static PyObject *__pyx_int_neg_1;
12711551 static PyObject *__pyx_k__3;
12721552 static PyObject *__pyx_k__5;
12791559 static PyObject *__pyx_tuple__10;
12801560 static PyObject *__pyx_tuple__11;
12811561 static PyObject *__pyx_tuple__12;
1562 static PyObject *__pyx_tuple__13;
12821563 static PyObject *__pyx_tuple__14;
12831564 static PyObject *__pyx_tuple__16;
12841565 static PyObject *__pyx_tuple__18;
1285 static PyObject *__pyx_tuple__21;
1286 static PyObject *__pyx_tuple__26;
1566 static PyObject *__pyx_tuple__20;
1567 static PyObject *__pyx_tuple__23;
12871568 static PyObject *__pyx_tuple__28;
1288 static PyObject *__pyx_tuple__31;
1569 static PyObject *__pyx_tuple__30;
12891570 static PyObject *__pyx_tuple__33;
1290 static PyObject *__pyx_codeobj__15;
1571 static PyObject *__pyx_tuple__35;
1572 static PyObject *__pyx_tuple__38;
12911573 static PyObject *__pyx_codeobj__17;
12921574 static PyObject *__pyx_codeobj__19;
1293 static PyObject *__pyx_codeobj__20;
1575 static PyObject *__pyx_codeobj__21;
12941576 static PyObject *__pyx_codeobj__22;
1295 static PyObject *__pyx_codeobj__23;
12961577 static PyObject *__pyx_codeobj__24;
12971578 static PyObject *__pyx_codeobj__25;
1579 static PyObject *__pyx_codeobj__26;
12981580 static PyObject *__pyx_codeobj__27;
12991581 static PyObject *__pyx_codeobj__29;
1300 static PyObject *__pyx_codeobj__30;
1582 static PyObject *__pyx_codeobj__31;
13011583 static PyObject *__pyx_codeobj__32;
13021584 static PyObject *__pyx_codeobj__34;
1303 static PyObject *__pyx_codeobj__35;
1585 static PyObject *__pyx_codeobj__36;
1586 static PyObject *__pyx_codeobj__37;
1587 static PyObject *__pyx_codeobj__39;
1588 /* Late includes */
13041589
13051590 /* "pygame_sdl2/mixer.pyx":41
13061591 * _lock = threading.Lock()
13201605 __Pyx_RefNannyDeclarations
13211606 __Pyx_RefNannySetupContext("_play_current (wrapper)", 0);
13221607 assert(__pyx_arg_channel); {
1323 __pyx_v_channel = __Pyx_PyInt_As_int(__pyx_arg_channel); if (unlikely((__pyx_v_channel == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L3_error)
1608 __pyx_v_channel = __Pyx_PyInt_As_int(__pyx_arg_channel); if (unlikely((__pyx_v_channel == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 41, __pyx_L3_error)
13241609 }
13251610 goto __pyx_L4_argument_unpacking_done;
13261611 __pyx_L3_error:;
13601645 * current_sounds[channel] = next_sound
13611646 */
13621647 /*with:*/ {
1363 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
1648 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error)
13641649 __Pyx_GOTREF(__pyx_t_1);
1365 __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)
1650 __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 50, __pyx_L1_error)
13661651 __Pyx_GOTREF(__pyx_t_2);
1367 __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L3_error)
1652 __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 50, __pyx_L3_error)
13681653 __Pyx_GOTREF(__pyx_t_4);
13691654 __pyx_t_5 = NULL;
13701655 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
13771662 }
13781663 }
13791664 if (__pyx_t_5) {
1380 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L3_error)
1665 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 50, __pyx_L3_error)
13811666 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13821667 } else {
1383 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L3_error)
1668 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 50, __pyx_L3_error)
13841669 }
13851670 __Pyx_GOTREF(__pyx_t_3);
13861671 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14051690 */
14061691 if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) {
14071692 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
1408 __PYX_ERR(0, 51, __pyx_L7_error)
1693 __PYX_ERR(1, 51, __pyx_L7_error)
14091694 }
1410 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L7_error)
1695 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 51, __pyx_L7_error)
14111696 __Pyx_GOTREF(__pyx_t_1);
1412 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L7_error)
1697 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 51, __pyx_L7_error)
14131698 __Pyx_GOTREF(__pyx_t_3);
14141699 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1415 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11pygame_sdl2_5mixer_Sound))))) __PYX_ERR(0, 51, __pyx_L7_error)
1700 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_11pygame_sdl2_5mixer_Sound))))) __PYX_ERR(1, 51, __pyx_L7_error)
14161701 __pyx_v_next_sound = ((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_t_3);
14171702 __pyx_t_3 = 0;
14181703
14251710 */
14261711 if (unlikely(__pyx_v_11pygame_sdl2_5mixer_current_sounds == Py_None)) {
14271712 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
1428 __PYX_ERR(0, 52, __pyx_L7_error)
1713 __PYX_ERR(1, 52, __pyx_L7_error)
14291714 }
1430 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L7_error)
1715 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 52, __pyx_L7_error)
14311716 __Pyx_GOTREF(__pyx_t_3);
1432 if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_current_sounds, __pyx_t_3, ((PyObject *)__pyx_v_next_sound)) < 0)) __PYX_ERR(0, 52, __pyx_L7_error)
1717 if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_current_sounds, __pyx_t_3, ((PyObject *)__pyx_v_next_sound)) < 0)) __PYX_ERR(1, 52, __pyx_L7_error)
14331718 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14341719
14351720 /* "pygame_sdl2/mixer.pyx":53
14411726 */
14421727 if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) {
14431728 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
1444 __PYX_ERR(0, 53, __pyx_L7_error)
1729 __PYX_ERR(1, 53, __pyx_L7_error)
14451730 }
1446 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 53, __pyx_L7_error)
1731 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 53, __pyx_L7_error)
14471732 __Pyx_GOTREF(__pyx_t_3);
1448 if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_3, Py_None) < 0)) __PYX_ERR(0, 53, __pyx_L7_error)
1733 if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_3, Py_None) < 0)) __PYX_ERR(1, 53, __pyx_L7_error)
14491734 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14501735
14511736 /* "pygame_sdl2/mixer.pyx":50
14591744 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
14601745 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
14611746 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
1462 goto __pyx_L14_try_end;
1747 goto __pyx_L12_try_end;
14631748 __pyx_L7_error:;
1464 __Pyx_PyThreadState_assign
14651749 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14661750 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
14671751 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
14681752 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
14691753 /*except:*/ {
14701754 __Pyx_AddTraceback("pygame_sdl2.mixer._play_current", __pyx_clineno, __pyx_lineno, __pyx_filename);
1471 if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(0, 50, __pyx_L9_except_error)
1755 if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(1, 50, __pyx_L9_except_error)
14721756 __Pyx_GOTREF(__pyx_t_3);
14731757 __Pyx_GOTREF(__pyx_t_1);
14741758 __Pyx_GOTREF(__pyx_t_4);
1475 __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 50, __pyx_L9_except_error)
1759 __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 50, __pyx_L9_except_error)
14761760 __Pyx_GOTREF(__pyx_t_5);
14771761 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL);
14781762 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14791763 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1480 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 50, __pyx_L9_except_error)
1764 if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 50, __pyx_L9_except_error)
14811765 __Pyx_GOTREF(__pyx_t_9);
14821766 __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9);
14831767 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
1484 if (__pyx_t_10 < 0) __PYX_ERR(0, 50, __pyx_L9_except_error)
1768 if (__pyx_t_10 < 0) __PYX_ERR(1, 50, __pyx_L9_except_error)
14851769 __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0);
14861770 if (__pyx_t_11) {
14871771 __Pyx_GIVEREF(__pyx_t_3);
14891773 __Pyx_XGIVEREF(__pyx_t_4);
14901774 __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_4);
14911775 __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0;
1492 __PYX_ERR(0, 50, __pyx_L9_except_error)
1776 __PYX_ERR(1, 50, __pyx_L9_except_error)
14931777 }
14941778 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14951779 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14971781 goto __pyx_L8_exception_handled;
14981782 }
14991783 __pyx_L9_except_error:;
1500 __Pyx_PyThreadState_assign
15011784 __Pyx_XGIVEREF(__pyx_t_6);
15021785 __Pyx_XGIVEREF(__pyx_t_7);
15031786 __Pyx_XGIVEREF(__pyx_t_8);
15041787 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
15051788 goto __pyx_L1_error;
15061789 __pyx_L8_exception_handled:;
1507 __Pyx_PyThreadState_assign
15081790 __Pyx_XGIVEREF(__pyx_t_6);
15091791 __Pyx_XGIVEREF(__pyx_t_7);
15101792 __Pyx_XGIVEREF(__pyx_t_8);
15111793 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
1512 __pyx_L14_try_end:;
1794 __pyx_L12_try_end:;
15131795 }
15141796 }
15151797 /*finally:*/ {
15171799 if (__pyx_t_2) {
15181800 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL);
15191801 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1520 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 50, __pyx_L1_error)
1802 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 50, __pyx_L1_error)
15211803 __Pyx_GOTREF(__pyx_t_8);
15221804 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
15231805 }
15251807 }
15261808 __pyx_L6:;
15271809 }
1528 goto __pyx_L18;
1810 goto __pyx_L16;
15291811 __pyx_L3_error:;
15301812 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15311813 goto __pyx_L1_error;
1532 __pyx_L18:;
1814 __pyx_L16:;
15331815 }
15341816
15351817 /* "pygame_sdl2/mixer.pyx":55
15391821 * with nogil:
15401822 * Mix_PlayChannelTimed(channel, next_sound.chunk, 0, -1)
15411823 */
1542 if (unlikely(!__pyx_v_next_sound)) { __Pyx_RaiseUnboundLocalError("next_sound"); __PYX_ERR(0, 55, __pyx_L1_error) }
1543 __pyx_t_11 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_next_sound)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 55, __pyx_L1_error)
1824 if (unlikely(!__pyx_v_next_sound)) { __Pyx_RaiseUnboundLocalError("next_sound"); __PYX_ERR(1, 55, __pyx_L1_error) }
1825 __pyx_t_11 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_next_sound)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(1, 55, __pyx_L1_error)
15441826 if (__pyx_t_11) {
15451827
15461828 /* "pygame_sdl2/mixer.pyx":56
15541836 #ifdef WITH_THREAD
15551837 PyThreadState *_save;
15561838 Py_UNBLOCK_THREADS
1839 __Pyx_FastGIL_Remember();
15571840 #endif
15581841 /*try:*/ {
15591842
15641847 *
15651848 *
15661849 */
1567 if (unlikely(!__pyx_v_next_sound)) { __Pyx_RaiseUnboundLocalError("next_sound"); __PYX_ERR(0, 57, __pyx_L21_error) }
1568 Mix_PlayChannelTimed(__pyx_v_channel, __pyx_v_next_sound->chunk, 0, -1);
1850 if (unlikely(!__pyx_v_next_sound)) { __Pyx_RaiseUnboundLocalError("next_sound"); __PYX_ERR(1, 57, __pyx_L19_error) }
1851 (void)(Mix_PlayChannelTimed(__pyx_v_channel, __pyx_v_next_sound->chunk, 0, -1));
15691852 }
15701853
15711854 /* "pygame_sdl2/mixer.pyx":56
15781861 /*finally:*/ {
15791862 /*normal exit:*/{
15801863 #ifdef WITH_THREAD
1864 __Pyx_FastGIL_Forget();
15811865 Py_BLOCK_THREADS
15821866 #endif
1583 goto __pyx_L22;
1867 goto __pyx_L20;
15841868 }
1585 __pyx_L21_error: {
1869 __pyx_L19_error: {
15861870 #ifdef WITH_THREAD
1871 __Pyx_FastGIL_Forget();
15871872 Py_BLOCK_THREADS
15881873 #endif
15891874 goto __pyx_L1_error;
15901875 }
1591 __pyx_L22:;
1876 __pyx_L20:;
15921877 }
15931878 }
15941879
16531938 PyObject *__pyx_t_12 = NULL;
16541939 int __pyx_t_13;
16551940 #ifdef WITH_THREAD
1656 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
1941 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16571942 #endif
16581943 __Pyx_RefNannySetupContext("channel_callback", 0);
16591944
16741959 * memset(&e, 0, sizeof(SDL_Event))
16751960 */
16761961 if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_events == Py_None)) {
1677 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
1678 __PYX_ERR(0, 65, __pyx_L1_error)
1962 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
1963 __PYX_ERR(1, 65, __pyx_L1_error)
16791964 }
1680 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
1965 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 65, __pyx_L1_error)
16811966 __Pyx_GOTREF(__pyx_t_1);
1682 __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_events, __pyx_t_1, __pyx_int_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error)
1967 __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_events, __pyx_t_1, __pyx_int_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 65, __pyx_L1_error)
16831968 __Pyx_GOTREF(__pyx_t_2);
16841969 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1685 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L1_error)
1970 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 65, __pyx_L1_error)
16861971 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16871972 __pyx_v_etype = __pyx_t_3;
16881973
17031988 * e.type = etype
17041989 * SDL_PushEvent(&e)
17051990 */
1706 memset((&__pyx_v_e), 0, (sizeof(SDL_Event)));
1991 (void)(memset((&__pyx_v_e), 0, (sizeof(SDL_Event))));
17071992
17081993 /* "pygame_sdl2/mixer.pyx":68
17091994 * if etype != 0:
17212006 *
17222007 * with _lock:
17232008 */
1724 SDL_PushEvent((&__pyx_v_e));
2009 (void)(SDL_PushEvent((&__pyx_v_e)));
17252010
17262011 /* "pygame_sdl2/mixer.pyx":66
17272012 *
17402025 * if next_sound:
17412026 */
17422027 /*with:*/ {
1743 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
2028 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 71, __pyx_L1_error)
17442029 __Pyx_GOTREF(__pyx_t_2);
1745 __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 71, __pyx_L1_error)
2030 __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 71, __pyx_L1_error)
17462031 __Pyx_GOTREF(__pyx_t_5);
1747 __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 71, __pyx_L4_error)
2032 __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 71, __pyx_L4_error)
17482033 __Pyx_GOTREF(__pyx_t_6);
17492034 __pyx_t_7 = NULL;
17502035 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
17572042 }
17582043 }
17592044 if (__pyx_t_7) {
1760 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L4_error)
2045 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 71, __pyx_L4_error)
17612046 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17622047 } else {
1763 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L4_error)
2048 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 71, __pyx_L4_error)
17642049 }
17652050 __Pyx_GOTREF(__pyx_t_1);
17662051 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17842069 * threading.Thread(target=_play_current, args=(channel,)).start()
17852070 */
17862071 if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) {
1787 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
1788 __PYX_ERR(0, 72, __pyx_L8_error)
2072 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
2073 __PYX_ERR(1, 72, __pyx_L8_error)
17892074 }
1790 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L8_error)
2075 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 72, __pyx_L8_error)
17912076 __Pyx_GOTREF(__pyx_t_2);
1792 __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L8_error)
2077 __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 72, __pyx_L8_error)
17932078 __Pyx_GOTREF(__pyx_t_1);
17942079 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17952080 __pyx_v_next_sound = __pyx_t_1;
18022087 * threading.Thread(target=_play_current, args=(channel,)).start()
18032088 *
18042089 */
1805 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_next_sound); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 73, __pyx_L8_error)
2090 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_next_sound); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 73, __pyx_L8_error)
18062091 if (__pyx_t_4) {
18072092
18082093 /* "pygame_sdl2/mixer.pyx":74
18122097 *
18132098 * # A list of errors that occured during mixer initialization.
18142099 */
1815 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L8_error)
2100 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 74, __pyx_L8_error)
18162101 __Pyx_GOTREF(__pyx_t_2);
1817 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Thread); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 74, __pyx_L8_error)
2102 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Thread); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 74, __pyx_L8_error)
18182103 __Pyx_GOTREF(__pyx_t_6);
18192104 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1820 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L8_error)
2105 __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 74, __pyx_L8_error)
18212106 __Pyx_GOTREF(__pyx_t_2);
1822 __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_play_current); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 74, __pyx_L8_error)
2107 __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_play_current); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 74, __pyx_L8_error)
18232108 __Pyx_GOTREF(__pyx_t_7);
1824 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_target, __pyx_t_7) < 0) __PYX_ERR(0, 74, __pyx_L8_error)
2109 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_target, __pyx_t_7) < 0) __PYX_ERR(1, 74, __pyx_L8_error)
18252110 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1826 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 74, __pyx_L8_error)
2111 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_channel); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 74, __pyx_L8_error)
18272112 __Pyx_GOTREF(__pyx_t_7);
1828 __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 74, __pyx_L8_error)
2113 __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 74, __pyx_L8_error)
18292114 __Pyx_GOTREF(__pyx_t_11);
18302115 __Pyx_GIVEREF(__pyx_t_7);
18312116 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
18322117 __pyx_t_7 = 0;
1833 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_args, __pyx_t_11) < 0) __PYX_ERR(0, 74, __pyx_L8_error)
2118 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_args, __pyx_t_11) < 0) __PYX_ERR(1, 74, __pyx_L8_error)
18342119 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
1835 __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 74, __pyx_L8_error)
2120 __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 74, __pyx_L8_error)
18362121 __Pyx_GOTREF(__pyx_t_11);
18372122 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18382123 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1839 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L8_error)
2124 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 74, __pyx_L8_error)
18402125 __Pyx_GOTREF(__pyx_t_2);
18412126 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
18422127 __pyx_t_11 = NULL;
18502135 }
18512136 }
18522137 if (__pyx_t_11) {
1853 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L8_error)
2138 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 74, __pyx_L8_error)
18542139 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
18552140 } else {
1856 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L8_error)
2141 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 74, __pyx_L8_error)
18572142 }
18582143 __Pyx_GOTREF(__pyx_t_1);
18592144 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18792164 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
18802165 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
18812166 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
1882 goto __pyx_L15_try_end;
2167 goto __pyx_L13_try_end;
18832168 __pyx_L8_error:;
1884 __Pyx_PyThreadState_assign
18852169 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
18862170 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
18872171 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
18892173 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
18902174 /*except:*/ {
18912175 __Pyx_AddTraceback("pygame_sdl2.mixer.channel_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
1892 if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_11) < 0) __PYX_ERR(0, 71, __pyx_L10_except_error)
2176 if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_11) < 0) __PYX_ERR(1, 71, __pyx_L10_except_error)
18932177 __Pyx_GOTREF(__pyx_t_1);
18942178 __Pyx_GOTREF(__pyx_t_2);
18952179 __Pyx_GOTREF(__pyx_t_11);
1896 __pyx_t_6 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 71, __pyx_L10_except_error)
2180 __pyx_t_6 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 71, __pyx_L10_except_error)
18972181 __Pyx_GOTREF(__pyx_t_6);
18982182 __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL);
18992183 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19002184 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1901 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 71, __pyx_L10_except_error)
2185 if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 71, __pyx_L10_except_error)
19022186 __Pyx_GOTREF(__pyx_t_12);
19032187 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_12);
19042188 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
1905 if (__pyx_t_4 < 0) __PYX_ERR(0, 71, __pyx_L10_except_error)
2189 if (__pyx_t_4 < 0) __PYX_ERR(1, 71, __pyx_L10_except_error)
19062190 __pyx_t_13 = ((!(__pyx_t_4 != 0)) != 0);
19072191 if (__pyx_t_13) {
19082192 __Pyx_GIVEREF(__pyx_t_1);
19102194 __Pyx_XGIVEREF(__pyx_t_11);
19112195 __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_2, __pyx_t_11);
19122196 __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_11 = 0;
1913 __PYX_ERR(0, 71, __pyx_L10_except_error)
2197 __PYX_ERR(1, 71, __pyx_L10_except_error)
19142198 }
19152199 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19162200 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19182202 goto __pyx_L9_exception_handled;
19192203 }
19202204 __pyx_L10_except_error:;
1921 __Pyx_PyThreadState_assign
19222205 __Pyx_XGIVEREF(__pyx_t_8);
19232206 __Pyx_XGIVEREF(__pyx_t_9);
19242207 __Pyx_XGIVEREF(__pyx_t_10);
19252208 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
19262209 goto __pyx_L1_error;
19272210 __pyx_L9_exception_handled:;
1928 __Pyx_PyThreadState_assign
19292211 __Pyx_XGIVEREF(__pyx_t_8);
19302212 __Pyx_XGIVEREF(__pyx_t_9);
19312213 __Pyx_XGIVEREF(__pyx_t_10);
19322214 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
1933 __pyx_L15_try_end:;
2215 __pyx_L13_try_end:;
19342216 }
19352217 }
19362218 /*finally:*/ {
19382220 if (__pyx_t_5) {
19392221 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__2, NULL);
19402222 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1941 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 71, __pyx_L1_error)
2223 if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 71, __pyx_L1_error)
19422224 __Pyx_GOTREF(__pyx_t_10);
19432225 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
19442226 }
19462228 }
19472229 __pyx_L7:;
19482230 }
1949 goto __pyx_L20;
2231 goto __pyx_L18;
19502232 __pyx_L4_error:;
19512233 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19522234 goto __pyx_L1_error;
1953 __pyx_L20:;
2235 __pyx_L18:;
19542236 }
19552237
19562238 /* "pygame_sdl2/mixer.pyx":60
19692251 __Pyx_XDECREF(__pyx_t_6);
19702252 __Pyx_XDECREF(__pyx_t_7);
19712253 __Pyx_XDECREF(__pyx_t_11);
1972 __Pyx_WriteUnraisable("pygame_sdl2.mixer.channel_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
2254 __Pyx_WriteUnraisable("pygame_sdl2.mixer.channel_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
19732255 __pyx_L0:;
19742256 __Pyx_XDECREF(__pyx_v_next_sound);
19752257 __Pyx_RefNannyFinishContext();
19762258 #ifdef WITH_THREAD
1977 PyGILState_Release(__pyx_gilstate_save);
2259 __Pyx_PyGILState_Release(__pyx_gilstate_save);
19782260 #endif
19792261 }
19802262
20092291 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20102292 switch (pos_args) {
20112293 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2294 CYTHON_FALLTHROUGH;
20122295 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2296 CYTHON_FALLTHROUGH;
20132297 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2298 CYTHON_FALLTHROUGH;
20142299 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2300 CYTHON_FALLTHROUGH;
20152301 case 0: break;
20162302 default: goto __pyx_L5_argtuple_error;
20172303 }
20192305 switch (pos_args) {
20202306 case 0:
20212307 if (kw_args > 0) {
2022 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_frequency);
2308 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_frequency);
20232309 if (value) { values[0] = value; kw_args--; }
20242310 }
2311 CYTHON_FALLTHROUGH;
20252312 case 1:
20262313 if (kw_args > 0) {
2027 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size);
2314 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
20282315 if (value) { values[1] = value; kw_args--; }
20292316 }
2317 CYTHON_FALLTHROUGH;
20302318 case 2:
20312319 if (kw_args > 0) {
2032 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_channels);
2320 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_channels);
20332321 if (value) { values[2] = value; kw_args--; }
20342322 }
2323 CYTHON_FALLTHROUGH;
20352324 case 3:
20362325 if (kw_args > 0) {
2037 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffer);
2326 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffer);
20382327 if (value) { values[3] = value; kw_args--; }
20392328 }
20402329 }
20412330 if (unlikely(kw_args > 0)) {
2042 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 80, __pyx_L3_error)
2331 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(1, 80, __pyx_L3_error)
20432332 }
20442333 } else {
20452334 switch (PyTuple_GET_SIZE(__pyx_args)) {
20462335 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2336 CYTHON_FALLTHROUGH;
20472337 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2338 CYTHON_FALLTHROUGH;
20482339 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2340 CYTHON_FALLTHROUGH;
20492341 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2342 CYTHON_FALLTHROUGH;
20502343 case 0: break;
20512344 default: goto __pyx_L5_argtuple_error;
20522345 }
20582351 }
20592352 goto __pyx_L4_argument_unpacking_done;
20602353 __pyx_L5_argtuple_error:;
2061 __Pyx_RaiseArgtupleInvalid("init", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 80, __pyx_L3_error)
2354 __Pyx_RaiseArgtupleInvalid("init", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 80, __pyx_L3_error)
20622355 __pyx_L3_error:;
20632356 __Pyx_AddTraceback("pygame_sdl2.mixer.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
20642357 __Pyx_RefNannyFinishContext();
21042397 * return
21052398 *
21062399 */
2107 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
2400 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 81, __pyx_L1_error)
21082401 __Pyx_GOTREF(__pyx_t_2);
21092402 __pyx_t_3 = NULL;
21102403 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
21172410 }
21182411 }
21192412 if (__pyx_t_3) {
2120 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
2413 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 81, __pyx_L1_error)
21212414 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21222415 } else {
2123 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
2416 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 81, __pyx_L1_error)
21242417 }
21252418 __Pyx_GOTREF(__pyx_t_1);
21262419 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21562449 *
21572450 * if Mix_Init(flag) != flag:
21582451 */
2159 __pyx_t_1 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_FLAC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
2452 __pyx_t_1 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_FLAC); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 84, __pyx_L1_error)
21602453 __Pyx_GOTREF(__pyx_t_1);
2161 __pyx_t_2 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_MP3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
2454 __pyx_t_2 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_MP3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 84, __pyx_L1_error)
21622455 __Pyx_GOTREF(__pyx_t_2);
2163 __pyx_t_3 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_OGG); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error)
2456 __pyx_t_3 = __Pyx_PyInt_From_MIX_InitFlags(MIX_INIT_OGG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 84, __pyx_L1_error)
21642457 __Pyx_GOTREF(__pyx_t_3);
2165 __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error)
2458 __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 84, __pyx_L1_error)
21662459 __Pyx_GOTREF(__pyx_t_6);
21672460 __Pyx_GIVEREF(__pyx_t_1);
21682461 PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
21782471 for (;;) {
21792472 if (__pyx_t_7 >= 3) break;
21802473 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2181 __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 84, __pyx_L1_error)
2474 __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 84, __pyx_L1_error)
21822475 #else
2183 __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error)
2476 __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 84, __pyx_L1_error)
21842477 __Pyx_GOTREF(__pyx_t_6);
21852478 #endif
21862479 __Pyx_XDECREF_SET(__pyx_v_flag, __pyx_t_6);
21932486 * errors.append("{}\n".format(SDL_GetError()))
21942487 *
21952488 */
2196 __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_flag); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L1_error)
2197 __pyx_t_6 = __Pyx_PyInt_From_int(Mix_Init(__pyx_t_8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 86, __pyx_L1_error)
2489 __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_flag); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 86, __pyx_L1_error)
2490 __pyx_t_6 = __Pyx_PyInt_From_int(Mix_Init(__pyx_t_8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 86, __pyx_L1_error)
21982491 __Pyx_GOTREF(__pyx_t_6);
2199 __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_flag, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
2492 __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_flag, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 86, __pyx_L1_error)
22002493 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2201 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 86, __pyx_L1_error)
2494 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 86, __pyx_L1_error)
22022495 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22032496 if (__pyx_t_5) {
22042497
22092502 *
22102503 * if preinit_args:
22112504 */
2212 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_errors); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
2505 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_errors); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 87, __pyx_L1_error)
22132506 __Pyx_GOTREF(__pyx_t_2);
2214 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__4, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
2507 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u__4, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 87, __pyx_L1_error)
22152508 __Pyx_GOTREF(__pyx_t_1);
2216 __pyx_t_9 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 87, __pyx_L1_error)
2509 __pyx_t_9 = __Pyx_PyBytes_FromString(SDL_GetError()); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 87, __pyx_L1_error)
22172510 __Pyx_GOTREF(__pyx_t_9);
22182511 __pyx_t_10 = NULL;
22192512 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
22262519 }
22272520 }
22282521 if (!__pyx_t_10) {
2229 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 87, __pyx_L1_error)
2522 __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 87, __pyx_L1_error)
22302523 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
22312524 __Pyx_GOTREF(__pyx_t_6);
22322525 } else {
22332526 #if CYTHON_FAST_PYCALL
22342527 if (PyFunction_Check(__pyx_t_1)) {
22352528 PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_9};
2236 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 87, __pyx_L1_error)
2529 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 87, __pyx_L1_error)
22372530 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
22382531 __Pyx_GOTREF(__pyx_t_6);
22392532 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
22422535 #if CYTHON_FAST_PYCCALL
22432536 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
22442537 PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_9};
2245 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 87, __pyx_L1_error)
2538 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 87, __pyx_L1_error)
22462539 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
22472540 __Pyx_GOTREF(__pyx_t_6);
22482541 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
22492542 } else
22502543 #endif
22512544 {
2252 __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 87, __pyx_L1_error)
2545 __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 87, __pyx_L1_error)
22532546 __Pyx_GOTREF(__pyx_t_11);
22542547 __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
22552548 __Pyx_GIVEREF(__pyx_t_9);
22562549 PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_9);
22572550 __pyx_t_9 = 0;
2258 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 87, __pyx_L1_error)
2551 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 87, __pyx_L1_error)
22592552 __Pyx_GOTREF(__pyx_t_6);
22602553 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22612554 }
22622555 }
22632556 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2264 __pyx_t_12 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_6); if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 87, __pyx_L1_error)
2557 __pyx_t_12 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_6); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(1, 87, __pyx_L1_error)
22652558 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22662559 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22672560
22912584 * frequency, size, channels, buffer = preinit_args
22922585 *
22932586 */
2294 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_11pygame_sdl2_5mixer_preinit_args); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 89, __pyx_L1_error)
2587 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_11pygame_sdl2_5mixer_preinit_args); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(1, 89, __pyx_L1_error)
22952588 if (__pyx_t_5) {
22962589
22972590 /* "pygame_sdl2/mixer.pyx":90
23032596 */
23042597 if ((likely(PyTuple_CheckExact(__pyx_v_11pygame_sdl2_5mixer_preinit_args))) || (PyList_CheckExact(__pyx_v_11pygame_sdl2_5mixer_preinit_args))) {
23052598 PyObject* sequence = __pyx_v_11pygame_sdl2_5mixer_preinit_args;
2306 #if !CYTHON_COMPILING_IN_PYPY
2307 Py_ssize_t size = Py_SIZE(sequence);
2308 #else
2309 Py_ssize_t size = PySequence_Size(sequence);
2310 #endif
2599 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
23112600 if (unlikely(size != 4)) {
23122601 if (size > 4) __Pyx_RaiseTooManyValuesError(4);
23132602 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
2314 __PYX_ERR(0, 90, __pyx_L1_error)
2603 __PYX_ERR(1, 90, __pyx_L1_error)
23152604 }
23162605 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23172606 if (likely(PyTuple_CheckExact(sequence))) {
23342623 Py_ssize_t i;
23352624 PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_6,&__pyx_t_2,&__pyx_t_1};
23362625 for (i=0; i < 4; i++) {
2337 PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 90, __pyx_L1_error)
2626 PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(1, 90, __pyx_L1_error)
23382627 __Pyx_GOTREF(item);
23392628 *(temps[i]) = item;
23402629 }
23432632 } else {
23442633 Py_ssize_t index = -1;
23452634 PyObject** temps[4] = {&__pyx_t_3,&__pyx_t_6,&__pyx_t_2,&__pyx_t_1};
2346 __pyx_t_11 = PyObject_GetIter(__pyx_v_11pygame_sdl2_5mixer_preinit_args); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 90, __pyx_L1_error)
2635 __pyx_t_11 = PyObject_GetIter(__pyx_v_11pygame_sdl2_5mixer_preinit_args); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 90, __pyx_L1_error)
23472636 __Pyx_GOTREF(__pyx_t_11);
23482637 __pyx_t_13 = Py_TYPE(__pyx_t_11)->tp_iternext;
23492638 for (index=0; index < 4; index++) {
23512640 __Pyx_GOTREF(item);
23522641 *(temps[index]) = item;
23532642 }
2354 if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_11), 4) < 0) __PYX_ERR(0, 90, __pyx_L1_error)
2643 if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_11), 4) < 0) __PYX_ERR(1, 90, __pyx_L1_error)
23552644 __pyx_t_13 = NULL;
23562645 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23572646 goto __pyx_L9_unpacking_done;
23592648 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23602649 __pyx_t_13 = NULL;
23612650 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
2362 __PYX_ERR(0, 90, __pyx_L1_error)
2651 __PYX_ERR(1, 90, __pyx_L1_error)
23632652 __pyx_L9_unpacking_done:;
23642653 }
23652654 __Pyx_DECREF_SET(__pyx_v_frequency, __pyx_t_3);
23872676 * raise error()
23882677 *
23892678 */
2390 __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_frequency); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error)
2391 __pyx_t_14 = __Pyx_PyInt_As_uint16_t(__pyx_v_size); if (unlikely((__pyx_t_14 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error)
2392 __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_channels); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error)
2393 __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_buffer); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error)
2679 __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_frequency); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L1_error)
2680 __pyx_t_14 = __Pyx_PyInt_As_uint16_t(__pyx_v_size); if (unlikely((__pyx_t_14 == ((Uint16)-1)) && PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L1_error)
2681 __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_channels); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L1_error)
2682 __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_buffer); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 92, __pyx_L1_error)
23942683 __pyx_t_5 = ((Mix_OpenAudio(__pyx_t_8, __pyx_t_14, __pyx_t_15, __pyx_t_16) != 0) != 0);
2395 if (__pyx_t_5) {
2684 if (unlikely(__pyx_t_5)) {
23962685
23972686 /* "pygame_sdl2/mixer.pyx":93
23982687 *
24012690 *
24022691 * global output_spec
24032692 */
2404 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)
2693 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 93, __pyx_L1_error)
24052694 __Pyx_GOTREF(__pyx_t_2);
24062695 __pyx_t_6 = NULL;
24072696 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
24142703 }
24152704 }
24162705 if (__pyx_t_6) {
2417 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
2706 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 93, __pyx_L1_error)
24182707 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24192708 } else {
2420 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
2709 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 93, __pyx_L1_error)
24212710 }
24222711 __Pyx_GOTREF(__pyx_t_1);
24232712 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24242713 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
24252714 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2426 __PYX_ERR(0, 93, __pyx_L1_error)
2715 __PYX_ERR(1, 93, __pyx_L1_error)
24272716
24282717 /* "pygame_sdl2/mixer.pyx":92
24292718 * frequency, size, channels, buffer = preinit_args
24412730 *
24422731 * Mix_ChannelFinished(channel_callback)
24432732 */
2444 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error)
2733 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_get_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 96, __pyx_L1_error)
24452734 __Pyx_GOTREF(__pyx_t_2);
24462735 __pyx_t_6 = NULL;
24472736 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
24542743 }
24552744 }
24562745 if (__pyx_t_6) {
2457 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
2746 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 96, __pyx_L1_error)
24582747 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24592748 } else {
2460 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
2749 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 96, __pyx_L1_error)
24612750 }
24622751 __Pyx_GOTREF(__pyx_t_1);
24632752 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25382827 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
25392828 switch (pos_args) {
25402829 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2830 CYTHON_FALLTHROUGH;
25412831 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2832 CYTHON_FALLTHROUGH;
25422833 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2834 CYTHON_FALLTHROUGH;
25432835 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2836 CYTHON_FALLTHROUGH;
25442837 case 0: break;
25452838 default: goto __pyx_L5_argtuple_error;
25462839 }
25482841 switch (pos_args) {
25492842 case 0:
25502843 if (kw_args > 0) {
2551 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_frequency);
2844 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_frequency);
25522845 if (value) { values[0] = value; kw_args--; }
25532846 }
2847 CYTHON_FALLTHROUGH;
25542848 case 1:
25552849 if (kw_args > 0) {
2556 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size);
2850 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size);
25572851 if (value) { values[1] = value; kw_args--; }
25582852 }
2853 CYTHON_FALLTHROUGH;
25592854 case 2:
25602855 if (kw_args > 0) {
2561 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_channels);
2856 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_channels);
25622857 if (value) { values[2] = value; kw_args--; }
25632858 }
2859 CYTHON_FALLTHROUGH;
25642860 case 3:
25652861 if (kw_args > 0) {
2566 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_buffersize);
2862 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffersize);
25672863 if (value) { values[3] = value; kw_args--; }
25682864 }
25692865 }
25702866 if (unlikely(kw_args > 0)) {
2571 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pre_init") < 0)) __PYX_ERR(0, 100, __pyx_L3_error)
2867 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pre_init") < 0)) __PYX_ERR(1, 100, __pyx_L3_error)
25722868 }
25732869 } else {
25742870 switch (PyTuple_GET_SIZE(__pyx_args)) {
25752871 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2872 CYTHON_FALLTHROUGH;
25762873 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2874 CYTHON_FALLTHROUGH;
25772875 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2876 CYTHON_FALLTHROUGH;
25782877 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2878 CYTHON_FALLTHROUGH;
25792879 case 0: break;
25802880 default: goto __pyx_L5_argtuple_error;
25812881 }
25872887 }
25882888 goto __pyx_L4_argument_unpacking_done;
25892889 __pyx_L5_argtuple_error:;
2590 __Pyx_RaiseArgtupleInvalid("pre_init", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error)
2890 __Pyx_RaiseArgtupleInvalid("pre_init", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 100, __pyx_L3_error)
25912891 __pyx_L3_error:;
25922892 __Pyx_AddTraceback("pygame_sdl2.mixer.pre_init", __pyx_clineno, __pyx_lineno, __pyx_filename);
25932893 __Pyx_RefNannyFinishContext();
26132913 *
26142914 * @pygame_sdl2.register_quit
26152915 */
2616 __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
2916 __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 102, __pyx_L1_error)
26172917 __Pyx_GOTREF(__pyx_t_1);
26182918 __Pyx_INCREF(__pyx_v_frequency);
26192919 __Pyx_GIVEREF(__pyx_v_frequency);
27663066 * return frequency, format, channels
27673067 */
27683068 __Pyx_XDECREF(__pyx_r);
2769 __Pyx_INCREF(Py_None);
2770 __pyx_r = Py_None;
3069 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
27713070 goto __pyx_L0;
27723071
27733072 /* "pygame_sdl2/mixer.pyx":114
27883087 */
27893088 /*else*/ {
27903089 __Pyx_XDECREF(__pyx_r);
2791 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_frequency); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
3090 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_frequency); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 117, __pyx_L1_error)
27923091 __Pyx_GOTREF(__pyx_t_2);
2793 __pyx_t_3 = __Pyx_PyInt_From_uint16_t(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error)
3092 __pyx_t_3 = __Pyx_PyInt_From_uint16_t(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 117, __pyx_L1_error)
27943093 __Pyx_GOTREF(__pyx_t_3);
2795 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_channels); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L1_error)
3094 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_channels); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 117, __pyx_L1_error)
27963095 __Pyx_GOTREF(__pyx_t_4);
2797 __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 117, __pyx_L1_error)
3096 __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 117, __pyx_L1_error)
27983097 __Pyx_GOTREF(__pyx_t_5);
27993098 __Pyx_GIVEREF(__pyx_t_2);
28003099 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
28703169 #ifdef WITH_THREAD
28713170 PyThreadState *_save;
28723171 Py_UNBLOCK_THREADS
3172 __Pyx_FastGIL_Remember();
28733173 #endif
28743174 /*try:*/ {
28753175
28803180 *
28813181 * def pause():
28823182 */
2883 Mix_HaltChannel(-1);
3183 (void)(Mix_HaltChannel(-1));
28843184 }
28853185
28863186 /* "pygame_sdl2/mixer.pyx":120
28933193 /*finally:*/ {
28943194 /*normal exit:*/{
28953195 #ifdef WITH_THREAD
3196 __Pyx_FastGIL_Forget();
28963197 Py_BLOCK_THREADS
28973198 #endif
28983199 goto __pyx_L5;
29543255 #ifdef WITH_THREAD
29553256 PyThreadState *_save;
29563257 Py_UNBLOCK_THREADS
3258 __Pyx_FastGIL_Remember();
29573259 #endif
29583260 /*try:*/ {
29593261
29773279 /*finally:*/ {
29783280 /*normal exit:*/{
29793281 #ifdef WITH_THREAD
3282 __Pyx_FastGIL_Forget();
29803283 Py_BLOCK_THREADS
29813284 #endif
29823285 goto __pyx_L5;
30383341 #ifdef WITH_THREAD
30393342 PyThreadState *_save;
30403343 Py_UNBLOCK_THREADS
3344 __Pyx_FastGIL_Remember();
30413345 #endif
30423346 /*try:*/ {
30433347
30613365 /*finally:*/ {
30623366 /*normal exit:*/{
30633367 #ifdef WITH_THREAD
3368 __Pyx_FastGIL_Forget();
30643369 Py_BLOCK_THREADS
30653370 #endif
30663371 goto __pyx_L5;
31203425 * with nogil:
31213426 * Mix_FadeOutChannel(-1, ms)
31223427 */
3123 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
3428 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 132, __pyx_L1_error)
31243429 __pyx_v_ms = __pyx_t_1;
31253430
31263431 /* "pygame_sdl2/mixer.pyx":133
31343439 #ifdef WITH_THREAD
31353440 PyThreadState *_save;
31363441 Py_UNBLOCK_THREADS
3442 __Pyx_FastGIL_Remember();
31373443 #endif
31383444 /*try:*/ {
31393445
31443450 *
31453451 * def set_num_channels(count):
31463452 */
3147 Mix_FadeOutChannel(-1, __pyx_v_ms);
3453 (void)(Mix_FadeOutChannel(-1, __pyx_v_ms));
31483454 }
31493455
31503456 /* "pygame_sdl2/mixer.pyx":133
31573463 /*finally:*/ {
31583464 /*normal exit:*/{
31593465 #ifdef WITH_THREAD
3466 __Pyx_FastGIL_Forget();
31603467 Py_BLOCK_THREADS
31613468 #endif
31623469 goto __pyx_L5;
32203527 *
32213528 * def get_num_channels():
32223529 */
3223 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_count); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L1_error)
3224 Mix_AllocateChannels(__pyx_t_1);
3530 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_count); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 137, __pyx_L1_error)
3531 (void)(Mix_AllocateChannels(__pyx_t_1));
32253532
32263533 /* "pygame_sdl2/mixer.pyx":136
32273534 * Mix_FadeOutChannel(-1, ms)
32793586 * def set_reserved(count):
32803587 */
32813588 __Pyx_XDECREF(__pyx_r);
3282 __pyx_t_1 = __Pyx_PyInt_From_int(Mix_AllocateChannels(-1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
3589 __pyx_t_1 = __Pyx_PyInt_From_int(Mix_AllocateChannels(-1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 140, __pyx_L1_error)
32833590 __Pyx_GOTREF(__pyx_t_1);
32843591 __pyx_r = __pyx_t_1;
32853592 __pyx_t_1 = 0;
33393646 *
33403647 * def find_channel(force=False):
33413648 */
3342 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_count); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 143, __pyx_L1_error)
3343 Mix_ReserveChannels(__pyx_t_1);
3649 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_count); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 143, __pyx_L1_error)
3650 (void)(Mix_ReserveChannels(__pyx_t_1));
33443651
33453652 /* "pygame_sdl2/mixer.pyx":142
33463653 * return Mix_AllocateChannels(-1)
33873694 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
33883695 switch (pos_args) {
33893696 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3697 CYTHON_FALLTHROUGH;
33903698 case 0: break;
33913699 default: goto __pyx_L5_argtuple_error;
33923700 }
33943702 switch (pos_args) {
33953703 case 0:
33963704 if (kw_args > 0) {
3397 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_force);
3705 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_force);
33983706 if (value) { values[0] = value; kw_args--; }
33993707 }
34003708 }
34013709 if (unlikely(kw_args > 0)) {
3402 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_channel") < 0)) __PYX_ERR(0, 145, __pyx_L3_error)
3710 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "find_channel") < 0)) __PYX_ERR(1, 145, __pyx_L3_error)
34033711 }
34043712 } else {
34053713 switch (PyTuple_GET_SIZE(__pyx_args)) {
34063714 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3715 CYTHON_FALLTHROUGH;
34073716 case 0: break;
34083717 default: goto __pyx_L5_argtuple_error;
34093718 }
34123721 }
34133722 goto __pyx_L4_argument_unpacking_done;
34143723 __pyx_L5_argtuple_error:;
3415 __Pyx_RaiseArgtupleInvalid("find_channel", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 145, __pyx_L3_error)
3724 __Pyx_RaiseArgtupleInvalid("find_channel", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 145, __pyx_L3_error)
34163725 __pyx_L3_error:;
34173726 __Pyx_AddTraceback("pygame_sdl2.mixer.find_channel", __pyx_clineno, __pyx_lineno, __pyx_filename);
34183727 __Pyx_RefNannyFinishContext();
34623771 * return None
34633772 * chan = Mix_GroupOldest(-1)
34643773 */
3465 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_force); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
3774 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_force); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 149, __pyx_L1_error)
34663775 __pyx_t_2 = ((!__pyx_t_1) != 0);
34673776 if (__pyx_t_2) {
34683777
34743783 * if chan == -1:
34753784 */
34763785 __Pyx_XDECREF(__pyx_r);
3477 __Pyx_INCREF(Py_None);
3478 __pyx_r = Py_None;
3786 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
34793787 goto __pyx_L0;
34803788
34813789 /* "pygame_sdl2/mixer.pyx":149
35043812 * return Channel(chan)
35053813 */
35063814 __pyx_t_2 = ((__pyx_v_chan == -1L) != 0);
3507 if (__pyx_t_2) {
3815 if (unlikely(__pyx_t_2)) {
35083816
35093817 /* "pygame_sdl2/mixer.pyx":153
35103818 * chan = Mix_GroupOldest(-1)
35133821 * return Channel(chan)
35143822 *
35153823 */
3516 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
3824 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 153, __pyx_L1_error)
35173825 __Pyx_GOTREF(__pyx_t_4);
35183826 __pyx_t_5 = NULL;
35193827 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
35263834 }
35273835 }
35283836 if (__pyx_t_5) {
3529 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
3837 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 153, __pyx_L1_error)
35303838 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
35313839 } else {
3532 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
3840 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 153, __pyx_L1_error)
35333841 }
35343842 __Pyx_GOTREF(__pyx_t_3);
35353843 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35363844 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
35373845 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3538 __PYX_ERR(0, 153, __pyx_L1_error)
3846 __PYX_ERR(1, 153, __pyx_L1_error)
35393847
35403848 /* "pygame_sdl2/mixer.pyx":152
35413849 * return None
35633871 * def get_busy():
35643872 */
35653873 __Pyx_XDECREF(__pyx_r);
3566 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_chan); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error)
3874 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_chan); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 154, __pyx_L1_error)
35673875 __Pyx_GOTREF(__pyx_t_3);
3568 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error)
3876 __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 154, __pyx_L1_error)
35693877 __Pyx_GOTREF(__pyx_t_4);
3570 __Pyx_GIVEREF(__pyx_t_3);
3571 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
3572 __pyx_t_3 = 0;
3573 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error)
3574 __Pyx_GOTREF(__pyx_t_3);
3575 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3576 __pyx_r = __pyx_t_3;
3577 __pyx_t_3 = 0;
3878 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3879 __pyx_r = __pyx_t_4;
3880 __pyx_t_4 = 0;
35783881 goto __pyx_L0;
35793882
35803883 /* "pygame_sdl2/mixer.pyx":145
36343937 *
36353938 */
36363939 __Pyx_XDECREF(__pyx_r);
3637 __pyx_t_1 = __Pyx_PyBool_FromLong((Mix_GroupNewer(-1) != -1L)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
3940 __pyx_t_1 = __Pyx_PyBool_FromLong((Mix_GroupNewer(-1) != -1L)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 157, __pyx_L1_error)
36383941 __Pyx_GOTREF(__pyx_t_1);
36393942 __pyx_r = __pyx_t_1;
36403943 __pyx_t_1 = 0;
37984101 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
37994102 switch (pos_args) {
38004103 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4104 CYTHON_FALLTHROUGH;
38014105 case 0: break;
38024106 default: goto __pyx_L5_argtuple_error;
38034107 }
38044108 kw_args = PyDict_Size(__pyx_kwds);
38054109 switch (pos_args) {
38064110 case 0:
3807 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fi)) != 0)) kw_args--;
4111 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fi)) != 0)) kw_args--;
38084112 else goto __pyx_L5_argtuple_error;
38094113 }
38104114 if (unlikely(kw_args > 0)) {
3811 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 170, __pyx_L3_error)
4115 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 170, __pyx_L3_error)
38124116 }
38134117 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
38144118 goto __pyx_L5_argtuple_error;
38194123 }
38204124 goto __pyx_L4_argument_unpacking_done;
38214125 __pyx_L5_argtuple_error:;
3822 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 170, __pyx_L3_error)
4126 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 170, __pyx_L3_error)
38234127 __pyx_L3_error:;
38244128 __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
38254129 __Pyx_RefNannyFinishContext();
38494153 * if self.chunk == NULL:
38504154 * raise error()
38514155 */
3852 __pyx_t_1 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(0, 171, __pyx_L1_error)
4156 __pyx_t_1 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_1 == ((SDL_RWops *)NULL))) __PYX_ERR(1, 171, __pyx_L1_error)
38534157 __pyx_v_self->chunk = Mix_LoadWAV_RW(__pyx_t_1, 1);
38544158
38554159 /* "pygame_sdl2/mixer.pyx":172
38604164 *
38614165 */
38624166 __pyx_t_2 = ((__pyx_v_self->chunk == NULL) != 0);
3863 if (__pyx_t_2) {
4167 if (unlikely(__pyx_t_2)) {
38644168
38654169 /* "pygame_sdl2/mixer.pyx":173
38664170 * self.chunk = Mix_LoadWAV_RW(to_rwops(fi), 1)
38694173 *
38704174 * def play(self, loops=0, maxtime=-1, fade_ms=0):
38714175 */
3872 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
4176 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 173, __pyx_L1_error)
38734177 __Pyx_GOTREF(__pyx_t_4);
38744178 __pyx_t_5 = NULL;
38754179 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
38824186 }
38834187 }
38844188 if (__pyx_t_5) {
3885 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
4189 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 173, __pyx_L1_error)
38864190 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
38874191 } else {
3888 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
4192 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 173, __pyx_L1_error)
38894193 }
38904194 __Pyx_GOTREF(__pyx_t_3);
38914195 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
38924196 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
38934197 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3894 __PYX_ERR(0, 173, __pyx_L1_error)
4198 __PYX_ERR(1, 173, __pyx_L1_error)
38954199
38964200 /* "pygame_sdl2/mixer.pyx":172
38974201 * def __init__(self, fi):
39524256 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
39534257 switch (pos_args) {
39544258 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4259 CYTHON_FALLTHROUGH;
39554260 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4261 CYTHON_FALLTHROUGH;
39564262 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4263 CYTHON_FALLTHROUGH;
39574264 case 0: break;
39584265 default: goto __pyx_L5_argtuple_error;
39594266 }
39614268 switch (pos_args) {
39624269 case 0:
39634270 if (kw_args > 0) {
3964 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loops);
4271 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loops);
39654272 if (value) { values[0] = value; kw_args--; }
39664273 }
4274 CYTHON_FALLTHROUGH;
39674275 case 1:
39684276 if (kw_args > 0) {
3969 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_maxtime);
4277 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxtime);
39704278 if (value) { values[1] = value; kw_args--; }
39714279 }
4280 CYTHON_FALLTHROUGH;
39724281 case 2:
39734282 if (kw_args > 0) {
3974 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fade_ms);
4283 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fade_ms);
39754284 if (value) { values[2] = value; kw_args--; }
39764285 }
39774286 }
39784287 if (unlikely(kw_args > 0)) {
3979 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "play") < 0)) __PYX_ERR(0, 175, __pyx_L3_error)
4288 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "play") < 0)) __PYX_ERR(1, 175, __pyx_L3_error)
39804289 }
39814290 } else {
39824291 switch (PyTuple_GET_SIZE(__pyx_args)) {
39834292 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4293 CYTHON_FALLTHROUGH;
39844294 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4295 CYTHON_FALLTHROUGH;
39854296 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4297 CYTHON_FALLTHROUGH;
39864298 case 0: break;
39874299 default: goto __pyx_L5_argtuple_error;
39884300 }
39934305 }
39944306 goto __pyx_L4_argument_unpacking_done;
39954307 __pyx_L5_argtuple_error:;
3996 __Pyx_RaiseArgtupleInvalid("play", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 175, __pyx_L3_error)
4308 __Pyx_RaiseArgtupleInvalid("play", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 175, __pyx_L3_error)
39974309 __pyx_L3_error:;
39984310 __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.play", __pyx_clineno, __pyx_lineno, __pyx_filename);
39994311 __Pyx_RefNannyFinishContext();
40274339 * cdef int _maxtime = maxtime
40284340 * cdef int _fade_ms = fade_ms
40294341 */
4030 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_loops); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L1_error)
4342 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_loops); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 177, __pyx_L1_error)
40314343 __pyx_v__loops = __pyx_t_1;
40324344
40334345 /* "pygame_sdl2/mixer.pyx":178
40374349 * cdef int _fade_ms = fade_ms
40384350 *
40394351 */
4040 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_maxtime); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L1_error)
4352 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_maxtime); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 178, __pyx_L1_error)
40414353 __pyx_v__maxtime = __pyx_t_1;
40424354
40434355 /* "pygame_sdl2/mixer.pyx":179
40474359 *
40484360 * with nogil:
40494361 */
4050 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_fade_ms); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error)
4362 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_fade_ms); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 179, __pyx_L1_error)
40514363 __pyx_v__fade_ms = __pyx_t_1;
40524364
40534365 /* "pygame_sdl2/mixer.pyx":181
40614373 #ifdef WITH_THREAD
40624374 PyThreadState *_save;
40634375 Py_UNBLOCK_THREADS
4376 __Pyx_FastGIL_Remember();
40644377 #endif
40654378 /*try:*/ {
40664379
41164429 /*finally:*/ {
41174430 /*normal exit:*/{
41184431 #ifdef WITH_THREAD
4432 __Pyx_FastGIL_Forget();
41194433 Py_BLOCK_THREADS
41204434 #endif
41214435 goto __pyx_L5;
41324446 * return Channel(cid)
41334447 */
41344448 __pyx_t_2 = ((__pyx_v_cid == -1L) != 0);
4135 if (__pyx_t_2) {
4449 if (unlikely(__pyx_t_2)) {
41364450
41374451 /* "pygame_sdl2/mixer.pyx":188
41384452 *
41414455 * return Channel(cid)
41424456 *
41434457 */
4144 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
4458 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 188, __pyx_L1_error)
41454459 __Pyx_GOTREF(__pyx_t_4);
41464460 __pyx_t_5 = NULL;
41474461 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
41544468 }
41554469 }
41564470 if (__pyx_t_5) {
4157 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
4471 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 188, __pyx_L1_error)
41584472 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
41594473 } else {
4160 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
4474 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 188, __pyx_L1_error)
41614475 }
41624476 __Pyx_GOTREF(__pyx_t_3);
41634477 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
41644478 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
41654479 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4166 __PYX_ERR(0, 188, __pyx_L1_error)
4480 __PYX_ERR(1, 188, __pyx_L1_error)
41674481
41684482 /* "pygame_sdl2/mixer.pyx":187
41694483 * cid = Mix_PlayChannelTimed(-1, self.chunk, _loops, _maxtime)
41824496 * def stop(self):
41834497 */
41844498 __Pyx_XDECREF(__pyx_r);
4185 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_cid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error)
4499 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_cid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 189, __pyx_L1_error)
41864500 __Pyx_GOTREF(__pyx_t_3);
4187 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error)
4501 __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 189, __pyx_L1_error)
41884502 __Pyx_GOTREF(__pyx_t_4);
4189 __Pyx_GIVEREF(__pyx_t_3);
4190 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
4191 __pyx_t_3 = 0;
4192 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error)
4193 __Pyx_GOTREF(__pyx_t_3);
4194 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4195 __pyx_r = __pyx_t_3;
4196 __pyx_t_3 = 0;
4503 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4504 __pyx_r = __pyx_t_4;
4505 __pyx_t_4 = 0;
41974506 goto __pyx_L0;
41984507
41994508 /* "pygame_sdl2/mixer.pyx":175
42864595 #ifdef WITH_THREAD
42874596 PyThreadState *_save;
42884597 Py_UNBLOCK_THREADS
4598 __Pyx_FastGIL_Remember();
42894599 #endif
42904600 /*try:*/ {
42914601
42964606 * i += 1
42974607 *
42984608 */
4299 Mix_HaltChannel(__pyx_v_i);
4609 (void)(Mix_HaltChannel(__pyx_v_i));
43004610 }
43014611
43024612 /* "pygame_sdl2/mixer.pyx":195
43094619 /*finally:*/ {
43104620 /*normal exit:*/{
43114621 #ifdef WITH_THREAD
4622 __Pyx_FastGIL_Forget();
43124623 Py_BLOCK_THREADS
43134624 #endif
43144625 goto __pyx_L10;
44204731 #ifdef WITH_THREAD
44214732 PyThreadState *_save;
44224733 Py_UNBLOCK_THREADS
4734 __Pyx_FastGIL_Remember();
44234735 #endif
44244736 /*try:*/ {
44254737
44434755 /*finally:*/ {
44444756 /*normal exit:*/{
44454757 #ifdef WITH_THREAD
4758 __Pyx_FastGIL_Forget();
44464759 Py_BLOCK_THREADS
44474760 #endif
44484761 goto __pyx_L10;
45544867 #ifdef WITH_THREAD
45554868 PyThreadState *_save;
45564869 Py_UNBLOCK_THREADS
4870 __Pyx_FastGIL_Remember();
45574871 #endif
45584872 /*try:*/ {
45594873
45774891 /*finally:*/ {
45784892 /*normal exit:*/{
45794893 #ifdef WITH_THREAD
4894 __Pyx_FastGIL_Forget();
45804895 Py_BLOCK_THREADS
45814896 #endif
45824897 goto __pyx_L10;
46654980 * while i < Mix_AllocateChannels(-1):
46664981 * if Mix_GetChunk(i) == self.chunk:
46674982 */
4668 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 217, __pyx_L1_error)
4983 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 217, __pyx_L1_error)
46694984 __pyx_v_ms = __pyx_t_1;
46704985
46714986 /* "pygame_sdl2/mixer.pyx":218
47005015 #ifdef WITH_THREAD
47015016 PyThreadState *_save;
47025017 Py_UNBLOCK_THREADS
5018 __Pyx_FastGIL_Remember();
47035019 #endif
47045020 /*try:*/ {
47055021
47105026 * i += 1
47115027 *
47125028 */
4713 Mix_FadeOutChannel(__pyx_v_i, __pyx_v_ms);
5029 (void)(Mix_FadeOutChannel(__pyx_v_i, __pyx_v_ms));
47145030 }
47155031
47165032 /* "pygame_sdl2/mixer.pyx":220
47235039 /*finally:*/ {
47245040 /*normal exit:*/{
47255041 #ifdef WITH_THREAD
5042 __Pyx_FastGIL_Forget();
47265043 Py_BLOCK_THREADS
47275044 #endif
47285045 goto __pyx_L10;
48065123 *
48075124 * def get_volume(self):
48085125 */
4809 __pyx_t_1 = __Pyx_PyInt_From_int(MIX_MAX_VOLUME); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error)
5126 __pyx_t_1 = __Pyx_PyInt_From_int(MIX_MAX_VOLUME); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 225, __pyx_L1_error)
48105127 __Pyx_GOTREF(__pyx_t_1);
4811 __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error)
5128 __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 225, __pyx_L1_error)
48125129 __Pyx_GOTREF(__pyx_t_2);
48135130 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4814 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error)
5131 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 225, __pyx_L1_error)
48155132 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4816 Mix_VolumeChunk(__pyx_v_self->chunk, __pyx_t_3);
5133 (void)(Mix_VolumeChunk(__pyx_v_self->chunk, __pyx_t_3));
48175134
48185135 /* "pygame_sdl2/mixer.pyx":224
48195136 * i += 1
48725189 * def get_num_channels(self):
48735190 */
48745191 __Pyx_XDECREF(__pyx_r);
4875 __pyx_t_1 = __Pyx_PyInt_From_int(Mix_VolumeChunk(__pyx_v_self->chunk, -1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
5192 __pyx_t_1 = __Pyx_PyInt_From_int(Mix_VolumeChunk(__pyx_v_self->chunk, -1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
48765193 __Pyx_GOTREF(__pyx_t_1);
48775194 __pyx_r = __pyx_t_1;
48785195 __pyx_t_1 = 0;
50025319 * def get_length(self):
50035320 */
50045321 __Pyx_XDECREF(__pyx_r);
5005 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
5322 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
50065323 __Pyx_GOTREF(__pyx_t_2);
50075324 __pyx_r = __pyx_t_2;
50085325 __pyx_t_2 = 0;
50645381 * def get_raw(self):
50655382 */
50665383 __Pyx_XDECREF(__pyx_r);
5067 __pyx_t_1 = PyFloat_FromDouble(((double)__pyx_v_self->chunk->alen)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
5384 __pyx_t_1 = PyFloat_FromDouble(((double)__pyx_v_self->chunk->alen)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
50685385 __Pyx_GOTREF(__pyx_t_1);
5069 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_11pygame_sdl2_5mixer_output_spec, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
5386 __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_11pygame_sdl2_5mixer_output_spec, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 241, __pyx_L1_error)
50705387 __Pyx_GOTREF(__pyx_t_2);
5071 __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error)
5388 __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 241, __pyx_L1_error)
50725389 __Pyx_GOTREF(__pyx_t_3);
50735390 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
50745391 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5075 __pyx_t_2 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_3, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
5392 __pyx_t_2 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_3, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 241, __pyx_L1_error)
50765393 __Pyx_GOTREF(__pyx_t_2);
50775394 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5078 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_11pygame_sdl2_5mixer_output_spec, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error)
5395 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_11pygame_sdl2_5mixer_output_spec, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 241, __pyx_L1_error)
50795396 __Pyx_GOTREF(__pyx_t_3);
5080 __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
5397 __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 241, __pyx_L1_error)
50815398 __Pyx_GOTREF(__pyx_t_1);
50825399 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
50835400 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
51415458 *
51425459 *
51435460 */
5144 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error)
5461 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 245, __pyx_L1_error)
51455462 __Pyx_GOTREF(__pyx_t_1);
5146 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error)
5463 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __pyx_L1_error)
51475464 __Pyx_GOTREF(__pyx_t_2);
51485465 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51495466 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
51505467 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5151 __PYX_ERR(0, 245, __pyx_L1_error)
5468 __PYX_ERR(1, 245, __pyx_L1_error)
51525469
51535470 /* "pygame_sdl2/mixer.pyx":243
51545471 * return <double>self.chunk.alen / output_spec[0] / 2 / output_spec[2]
51635480 __Pyx_XDECREF(__pyx_t_1);
51645481 __Pyx_XDECREF(__pyx_t_2);
51655482 __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.get_raw", __pyx_clineno, __pyx_lineno, __pyx_filename);
5483 __pyx_r = NULL;
5484 __Pyx_XGIVEREF(__pyx_r);
5485 __Pyx_RefNannyFinishContext();
5486 return __pyx_r;
5487 }
5488
5489 /* "(tree fragment)":1
5490 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5491 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5492 * def __setstate_cython__(self, __pyx_state):
5493 */
5494
5495 /* Python wrapper */
5496 static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_27__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
5497 static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_27__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5498 PyObject *__pyx_r = 0;
5499 __Pyx_RefNannyDeclarations
5500 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5501 __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_26__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self));
5502
5503 /* function exit code */
5504 __Pyx_RefNannyFinishContext();
5505 return __pyx_r;
5506 }
5507
5508 static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_26__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self) {
5509 PyObject *__pyx_r = NULL;
5510 __Pyx_RefNannyDeclarations
5511 PyObject *__pyx_t_1 = NULL;
5512 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
5513
5514 /* "(tree fragment)":2
5515 * def __reduce_cython__(self):
5516 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
5517 * def __setstate_cython__(self, __pyx_state):
5518 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5519 */
5520 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
5521 __Pyx_GOTREF(__pyx_t_1);
5522 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5523 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5524 __PYX_ERR(0, 2, __pyx_L1_error)
5525
5526 /* "(tree fragment)":1
5527 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5528 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5529 * def __setstate_cython__(self, __pyx_state):
5530 */
5531
5532 /* function exit code */
5533 __pyx_L1_error:;
5534 __Pyx_XDECREF(__pyx_t_1);
5535 __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5536 __pyx_r = NULL;
5537 __Pyx_XGIVEREF(__pyx_r);
5538 __Pyx_RefNannyFinishContext();
5539 return __pyx_r;
5540 }
5541
5542 /* "(tree fragment)":3
5543 * def __reduce_cython__(self):
5544 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5545 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5546 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5547 */
5548
5549 /* Python wrapper */
5550 static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_29__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
5551 static PyObject *__pyx_pw_11pygame_sdl2_5mixer_5Sound_29__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5552 PyObject *__pyx_r = 0;
5553 __Pyx_RefNannyDeclarations
5554 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
5555 __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_5Sound_28__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5556
5557 /* function exit code */
5558 __Pyx_RefNannyFinishContext();
5559 return __pyx_r;
5560 }
5561
5562 static PyObject *__pyx_pf_11pygame_sdl2_5mixer_5Sound_28__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_5mixer_Sound *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
5563 PyObject *__pyx_r = NULL;
5564 __Pyx_RefNannyDeclarations
5565 PyObject *__pyx_t_1 = NULL;
5566 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
5567
5568 /* "(tree fragment)":4
5569 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5570 * def __setstate_cython__(self, __pyx_state):
5571 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
5572 */
5573 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
5574 __Pyx_GOTREF(__pyx_t_1);
5575 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5576 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5577 __PYX_ERR(0, 4, __pyx_L1_error)
5578
5579 /* "(tree fragment)":3
5580 * def __reduce_cython__(self):
5581 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5582 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5583 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
5584 */
5585
5586 /* function exit code */
5587 __pyx_L1_error:;
5588 __Pyx_XDECREF(__pyx_t_1);
5589 __Pyx_AddTraceback("pygame_sdl2.mixer.Sound.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
51665590 __pyx_r = NULL;
51675591 __Pyx_XGIVEREF(__pyx_r);
51685592 __Pyx_RefNannyFinishContext();
51925616 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
51935617 switch (pos_args) {
51945618 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5619 CYTHON_FALLTHROUGH;
51955620 case 0: break;
51965621 default: goto __pyx_L5_argtuple_error;
51975622 }
51985623 kw_args = PyDict_Size(__pyx_kwds);
51995624 switch (pos_args) {
52005625 case 0:
5201 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cid)) != 0)) kw_args--;
5626 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cid)) != 0)) kw_args--;
52025627 else goto __pyx_L5_argtuple_error;
52035628 }
52045629 if (unlikely(kw_args > 0)) {
5205 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 251, __pyx_L3_error)
5630 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 251, __pyx_L3_error)
52065631 }
52075632 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
52085633 goto __pyx_L5_argtuple_error;
52135638 }
52145639 goto __pyx_L4_argument_unpacking_done;
52155640 __pyx_L5_argtuple_error:;
5216 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 251, __pyx_L3_error)
5641 __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 251, __pyx_L3_error)
52175642 __pyx_L3_error:;
52185643 __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
52195644 __Pyx_RefNannyFinishContext();
52395664 *
52405665 * def play(self, Sound sound not None, loops=0, maxtime=-1, fade_ms=0):
52415666 */
5242 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_cid); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 252, __pyx_L1_error)
5667 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_cid); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 252, __pyx_L1_error)
52435668 __pyx_v_self->cid = __pyx_t_1;
52445669
52455670 /* "pygame_sdl2/mixer.pyx":251
52905715 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
52915716 switch (pos_args) {
52925717 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5718 CYTHON_FALLTHROUGH;
52935719 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5720 CYTHON_FALLTHROUGH;
52945721 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5722 CYTHON_FALLTHROUGH;
52955723 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5724 CYTHON_FALLTHROUGH;
52965725 case 0: break;
52975726 default: goto __pyx_L5_argtuple_error;
52985727 }
52995728 kw_args = PyDict_Size(__pyx_kwds);
53005729 switch (pos_args) {
53015730 case 0:
5302 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sound)) != 0)) kw_args--;
5731 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sound)) != 0)) kw_args--;
53035732 else goto __pyx_L5_argtuple_error;
5733 CYTHON_FALLTHROUGH;
53045734 case 1:
53055735 if (kw_args > 0) {
5306 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loops);
5736 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loops);
53075737 if (value) { values[1] = value; kw_args--; }
53085738 }
5739 CYTHON_FALLTHROUGH;
53095740 case 2:
53105741 if (kw_args > 0) {
5311 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_maxtime);
5742 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_maxtime);
53125743 if (value) { values[2] = value; kw_args--; }
53135744 }
5745 CYTHON_FALLTHROUGH;
53145746 case 3:
53155747 if (kw_args > 0) {
5316 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fade_ms);
5748 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fade_ms);
53175749 if (value) { values[3] = value; kw_args--; }
53185750 }
53195751 }
53205752 if (unlikely(kw_args > 0)) {
5321 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "play") < 0)) __PYX_ERR(0, 254, __pyx_L3_error)
5753 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "play") < 0)) __PYX_ERR(1, 254, __pyx_L3_error)
53225754 }
53235755 } else {
53245756 switch (PyTuple_GET_SIZE(__pyx_args)) {
53255757 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5758 CYTHON_FALLTHROUGH;
53265759 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5760 CYTHON_FALLTHROUGH;
53275761 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5762 CYTHON_FALLTHROUGH;
53285763 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
53295764 break;
53305765 default: goto __pyx_L5_argtuple_error;
53375772 }
53385773 goto __pyx_L4_argument_unpacking_done;
53395774 __pyx_L5_argtuple_error:;
5340 __Pyx_RaiseArgtupleInvalid("play", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 254, __pyx_L3_error)
5775 __Pyx_RaiseArgtupleInvalid("play", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 254, __pyx_L3_error)
53415776 __pyx_L3_error:;
53425777 __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.play", __pyx_clineno, __pyx_lineno, __pyx_filename);
53435778 __Pyx_RefNannyFinishContext();
53445779 return NULL;
53455780 __pyx_L4_argument_unpacking_done:;
5346 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sound), __pyx_ptype_11pygame_sdl2_5mixer_Sound, 0, "sound", 0))) __PYX_ERR(0, 254, __pyx_L1_error)
5781 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sound), __pyx_ptype_11pygame_sdl2_5mixer_Sound, 0, "sound", 0))) __PYX_ERR(1, 254, __pyx_L1_error)
53475782 __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_2play(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), __pyx_v_sound, __pyx_v_loops, __pyx_v_maxtime, __pyx_v_fade_ms);
53485783
53495784 /* function exit code */
53835818 * cdef int _maxtime = maxtime
53845819 * cdef int _fade_ms = fade_ms
53855820 */
5386 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_loops); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 255, __pyx_L1_error)
5821 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_loops); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 255, __pyx_L1_error)
53875822 __pyx_v__loops = __pyx_t_1;
53885823
53895824 /* "pygame_sdl2/mixer.pyx":256
53935828 * cdef int _fade_ms = fade_ms
53945829 *
53955830 */
5396 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_maxtime); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 256, __pyx_L1_error)
5831 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_maxtime); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 256, __pyx_L1_error)
53975832 __pyx_v__maxtime = __pyx_t_1;
53985833
53995834 /* "pygame_sdl2/mixer.pyx":257
54035838 *
54045839 * with nogil:
54055840 */
5406 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_fade_ms); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 257, __pyx_L1_error)
5841 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_fade_ms); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 257, __pyx_L1_error)
54075842 __pyx_v__fade_ms = __pyx_t_1;
54085843
54095844 /* "pygame_sdl2/mixer.pyx":259
54175852 #ifdef WITH_THREAD
54185853 PyThreadState *_save;
54195854 Py_UNBLOCK_THREADS
5855 __Pyx_FastGIL_Remember();
54205856 #endif
54215857 /*try:*/ {
54225858
54725908 /*finally:*/ {
54735909 /*normal exit:*/{
54745910 #ifdef WITH_THREAD
5911 __Pyx_FastGIL_Forget();
54755912 Py_BLOCK_THREADS
54765913 #endif
54775914 goto __pyx_L5;
54885925 *
54895926 */
54905927 __pyx_t_2 = ((__pyx_v_cid == -1L) != 0);
5491 if (__pyx_t_2) {
5928 if (unlikely(__pyx_t_2)) {
54925929
54935930 /* "pygame_sdl2/mixer.pyx":266
54945931 *
54975934 *
54985935 * with _lock:
54995936 */
5500 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
5937 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 266, __pyx_L1_error)
55015938 __Pyx_GOTREF(__pyx_t_4);
55025939 __pyx_t_5 = NULL;
55035940 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
55105947 }
55115948 }
55125949 if (__pyx_t_5) {
5513 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error)
5950 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 266, __pyx_L1_error)
55145951 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
55155952 } else {
5516 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error)
5953 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 266, __pyx_L1_error)
55175954 }
55185955 __Pyx_GOTREF(__pyx_t_3);
55195956 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
55205957 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
55215958 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5522 __PYX_ERR(0, 266, __pyx_L1_error)
5959 __PYX_ERR(1, 266, __pyx_L1_error)
55235960
55245961 /* "pygame_sdl2/mixer.pyx":265
55255962 * cid = Mix_PlayChannelTimed(self.cid, sound.chunk, _loops, _maxtime)
55385975 *
55395976 */
55405977 /*with:*/ {
5541 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error)
5978 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 268, __pyx_L1_error)
55425979 __Pyx_GOTREF(__pyx_t_3);
5543 __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error)
5980 __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 268, __pyx_L1_error)
55445981 __Pyx_GOTREF(__pyx_t_6);
5545 __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L8_error)
5982 __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 268, __pyx_L8_error)
55465983 __Pyx_GOTREF(__pyx_t_5);
55475984 __pyx_t_7 = NULL;
55485985 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
55555992 }
55565993 }
55575994 if (__pyx_t_7) {
5558 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L8_error)
5995 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 268, __pyx_L8_error)
55595996 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
55605997 } else {
5561 __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L8_error)
5998 __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 268, __pyx_L8_error)
55625999 }
55636000 __Pyx_GOTREF(__pyx_t_4);
55646001 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
55836020 */
55846021 if (unlikely(__pyx_v_11pygame_sdl2_5mixer_current_sounds == Py_None)) {
55856022 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5586 __PYX_ERR(0, 269, __pyx_L12_error)
6023 __PYX_ERR(1, 269, __pyx_L12_error)
55876024 }
5588 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L12_error)
6025 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 269, __pyx_L12_error)
55896026 __Pyx_GOTREF(__pyx_t_3);
5590 if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_current_sounds, __pyx_t_3, ((PyObject *)__pyx_v_sound)) < 0)) __PYX_ERR(0, 269, __pyx_L12_error)
6027 if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_current_sounds, __pyx_t_3, ((PyObject *)__pyx_v_sound)) < 0)) __PYX_ERR(1, 269, __pyx_L12_error)
55916028 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
55926029
55936030 /* "pygame_sdl2/mixer.pyx":268
56016038 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
56026039 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
56036040 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
5604 goto __pyx_L19_try_end;
6041 goto __pyx_L17_try_end;
56056042 __pyx_L12_error:;
5606 __Pyx_PyThreadState_assign
56076043 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
56086044 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
56096045 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
56106046 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
56116047 /*except:*/ {
56126048 __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.play", __pyx_clineno, __pyx_lineno, __pyx_filename);
5613 if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(0, 268, __pyx_L14_except_error)
6049 if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) __PYX_ERR(1, 268, __pyx_L14_except_error)
56146050 __Pyx_GOTREF(__pyx_t_3);
56156051 __Pyx_GOTREF(__pyx_t_4);
56166052 __Pyx_GOTREF(__pyx_t_5);
5617 __pyx_t_7 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 268, __pyx_L14_except_error)
6053 __pyx_t_7 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 268, __pyx_L14_except_error)
56186054 __Pyx_GOTREF(__pyx_t_7);
56196055 __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL);
56206056 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
56216057 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5622 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 268, __pyx_L14_except_error)
6058 if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 268, __pyx_L14_except_error)
56236059 __Pyx_GOTREF(__pyx_t_11);
56246060 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11);
56256061 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5626 if (__pyx_t_2 < 0) __PYX_ERR(0, 268, __pyx_L14_except_error)
6062 if (__pyx_t_2 < 0) __PYX_ERR(1, 268, __pyx_L14_except_error)
56276063 __pyx_t_12 = ((!(__pyx_t_2 != 0)) != 0);
56286064 if (__pyx_t_12) {
56296065 __Pyx_GIVEREF(__pyx_t_3);
56316067 __Pyx_XGIVEREF(__pyx_t_5);
56326068 __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_4, __pyx_t_5);
56336069 __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0;
5634 __PYX_ERR(0, 268, __pyx_L14_except_error)
6070 __PYX_ERR(1, 268, __pyx_L14_except_error)
56356071 }
56366072 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
56376073 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
56396075 goto __pyx_L13_exception_handled;
56406076 }
56416077 __pyx_L14_except_error:;
5642 __Pyx_PyThreadState_assign
56436078 __Pyx_XGIVEREF(__pyx_t_8);
56446079 __Pyx_XGIVEREF(__pyx_t_9);
56456080 __Pyx_XGIVEREF(__pyx_t_10);
56466081 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
56476082 goto __pyx_L1_error;
56486083 __pyx_L13_exception_handled:;
5649 __Pyx_PyThreadState_assign
56506084 __Pyx_XGIVEREF(__pyx_t_8);
56516085 __Pyx_XGIVEREF(__pyx_t_9);
56526086 __Pyx_XGIVEREF(__pyx_t_10);
56536087 __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
5654 __pyx_L19_try_end:;
6088 __pyx_L17_try_end:;
56556089 }
56566090 }
56576091 /*finally:*/ {
56586092 /*normal exit:*/{
56596093 if (__pyx_t_6) {
5660 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__7, NULL);
6094 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__9, NULL);
56616095 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5662 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 268, __pyx_L1_error)
6096 if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 268, __pyx_L1_error)
56636097 __Pyx_GOTREF(__pyx_t_10);
56646098 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
56656099 }
56676101 }
56686102 __pyx_L11:;
56696103 }
5670 goto __pyx_L23;
6104 goto __pyx_L21;
56716105 __pyx_L8_error:;
56726106 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
56736107 goto __pyx_L1_error;
5674 __pyx_L23:;
6108 __pyx_L21:;
56756109 }
56766110
56776111 /* "pygame_sdl2/mixer.pyx":254
57356169 #ifdef WITH_THREAD
57366170 PyThreadState *_save;
57376171 Py_UNBLOCK_THREADS
6172 __Pyx_FastGIL_Remember();
57386173 #endif
57396174 /*try:*/ {
57406175
57456180 *
57466181 * def pause(self):
57476182 */
5748 Mix_HaltChannel(__pyx_v_self->cid);
6183 (void)(Mix_HaltChannel(__pyx_v_self->cid));
57496184 }
57506185
57516186 /* "pygame_sdl2/mixer.pyx":272
57586193 /*finally:*/ {
57596194 /*normal exit:*/{
57606195 #ifdef WITH_THREAD
6196 __Pyx_FastGIL_Forget();
57616197 Py_BLOCK_THREADS
57626198 #endif
57636199 goto __pyx_L5;
58186254 #ifdef WITH_THREAD
58196255 PyThreadState *_save;
58206256 Py_UNBLOCK_THREADS
6257 __Pyx_FastGIL_Remember();
58216258 #endif
58226259 /*try:*/ {
58236260
58416278 /*finally:*/ {
58426279 /*normal exit:*/{
58436280 #ifdef WITH_THREAD
6281 __Pyx_FastGIL_Forget();
58446282 Py_BLOCK_THREADS
58456283 #endif
58466284 goto __pyx_L5;
59016339 #ifdef WITH_THREAD
59026340 PyThreadState *_save;
59036341 Py_UNBLOCK_THREADS
6342 __Pyx_FastGIL_Remember();
59046343 #endif
59056344 /*try:*/ {
59066345
59246363 /*finally:*/ {
59256364 /*normal exit:*/{
59266365 #ifdef WITH_THREAD
6366 __Pyx_FastGIL_Forget();
59276367 Py_BLOCK_THREADS
59286368 #endif
59296369 goto __pyx_L5;
59826422 * with nogil:
59836423 * Mix_FadeOutChannel(self.cid, ms)
59846424 */
5985 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 284, __pyx_L1_error)
6425 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 284, __pyx_L1_error)
59866426 __pyx_v_ms = __pyx_t_1;
59876427
59886428 /* "pygame_sdl2/mixer.pyx":285
59966436 #ifdef WITH_THREAD
59976437 PyThreadState *_save;
59986438 Py_UNBLOCK_THREADS
6439 __Pyx_FastGIL_Remember();
59996440 #endif
60006441 /*try:*/ {
60016442
60066447 *
60076448 * def set_volume(self, volume):
60086449 */
6009 Mix_FadeOutChannel(__pyx_v_self->cid, __pyx_v_ms);
6450 (void)(Mix_FadeOutChannel(__pyx_v_self->cid, __pyx_v_ms));
60106451 }
60116452
60126453 /* "pygame_sdl2/mixer.pyx":285
60196460 /*finally:*/ {
60206461 /*normal exit:*/{
60216462 #ifdef WITH_THREAD
6463 __Pyx_FastGIL_Forget();
60226464 Py_BLOCK_THREADS
60236465 #endif
60246466 goto __pyx_L5;
60836525 *
60846526 * def get_volume(self):
60856527 */
6086 __pyx_t_1 = __Pyx_PyInt_From_int(MIX_MAX_VOLUME); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
6528 __pyx_t_1 = __Pyx_PyInt_From_int(MIX_MAX_VOLUME); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 289, __pyx_L1_error)
60876529 __Pyx_GOTREF(__pyx_t_1);
6088 __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_volume); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
6530 __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_volume); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 289, __pyx_L1_error)
60896531 __Pyx_GOTREF(__pyx_t_2);
60906532 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6091 __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
6533 __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 289, __pyx_L1_error)
60926534 __Pyx_GOTREF(__pyx_t_1);
60936535 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6094 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 289, __pyx_L1_error)
6536 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 289, __pyx_L1_error)
60956537 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6096 Mix_Volume(__pyx_v_self->cid, __pyx_t_3);
6538 (void)(Mix_Volume(__pyx_v_self->cid, __pyx_t_3));
60976539
60986540 /* "pygame_sdl2/mixer.pyx":288
60996541 * Mix_FadeOutChannel(self.cid, ms)
61646606 __Pyx_XDECREF(__pyx_r);
61656607 if (unlikely(((double)MIX_MAX_VOLUME) == 0)) {
61666608 PyErr_SetString(PyExc_ZeroDivisionError, "float division");
6167 __PYX_ERR(0, 293, __pyx_L1_error)
6609 __PYX_ERR(1, 293, __pyx_L1_error)
61686610 }
6169 __pyx_t_1 = PyFloat_FromDouble((((double)__pyx_v_vol) / ((double)MIX_MAX_VOLUME))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
6611 __pyx_t_1 = PyFloat_FromDouble((((double)__pyx_v_vol) / ((double)MIX_MAX_VOLUME))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 293, __pyx_L1_error)
61706612 __Pyx_GOTREF(__pyx_t_1);
61716613 __pyx_r = __pyx_t_1;
61726614 __pyx_t_1 = 0;
62266668 * def get_sound(self):
62276669 */
62286670 __Pyx_XDECREF(__pyx_r);
6229 __pyx_t_1 = __Pyx_PyBool_FromLong((Mix_Playing(__pyx_v_self->cid) != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
6671 __pyx_t_1 = __Pyx_PyBool_FromLong((Mix_Playing(__pyx_v_self->cid) != 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 296, __pyx_L1_error)
62306672 __Pyx_GOTREF(__pyx_t_1);
62316673 __pyx_r = __pyx_t_1;
62326674 __pyx_t_1 = 0;
62966738 *
62976739 */
62986740 /*with:*/ {
6299 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error)
6741 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 299, __pyx_L1_error)
63006742 __Pyx_GOTREF(__pyx_t_1);
6301 __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error)
6743 __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 299, __pyx_L1_error)
63026744 __Pyx_GOTREF(__pyx_t_2);
6303 __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L3_error)
6745 __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 299, __pyx_L3_error)
63046746 __Pyx_GOTREF(__pyx_t_4);
63056747 __pyx_t_5 = NULL;
63066748 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
63136755 }
63146756 }
63156757 if (__pyx_t_5) {
6316 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L3_error)
6758 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 299, __pyx_L3_error)
63176759 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
63186760 } else {
6319 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L3_error)
6761 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 299, __pyx_L3_error)
63206762 }
63216763 __Pyx_GOTREF(__pyx_t_3);
63226764 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
63416783 */
63426784 __Pyx_XDECREF(__pyx_r);
63436785 if (unlikely(__pyx_v_11pygame_sdl2_5mixer_current_sounds == Py_None)) {
6344 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
6345 __PYX_ERR(0, 300, __pyx_L7_error)
6786 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
6787 __PYX_ERR(1, 300, __pyx_L7_error)
63466788 }
6347 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L7_error)
6789 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 300, __pyx_L7_error)
63486790 __Pyx_GOTREF(__pyx_t_1);
6349 __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_current_sounds, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L7_error)
6791 __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_current_sounds, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 300, __pyx_L7_error)
63506792 __Pyx_GOTREF(__pyx_t_3);
63516793 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
63526794 __pyx_r = __pyx_t_3;
63626804 */
63636805 }
63646806 __pyx_L7_error:;
6365 __Pyx_PyThreadState_assign
63666807 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
63676808 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
63686809 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
63696810 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
63706811 /*except:*/ {
63716812 __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_sound", __pyx_clineno, __pyx_lineno, __pyx_filename);
6372 if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(0, 299, __pyx_L9_except_error)
6813 if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(1, 299, __pyx_L9_except_error)
63736814 __Pyx_GOTREF(__pyx_t_3);
63746815 __Pyx_GOTREF(__pyx_t_1);
63756816 __Pyx_GOTREF(__pyx_t_4);
6376 __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 299, __pyx_L9_except_error)
6817 __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 299, __pyx_L9_except_error)
63776818 __Pyx_GOTREF(__pyx_t_5);
63786819 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL);
63796820 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
63806821 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6381 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 299, __pyx_L9_except_error)
6822 if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 299, __pyx_L9_except_error)
63826823 __Pyx_GOTREF(__pyx_t_9);
63836824 __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9);
63846825 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6385 if (__pyx_t_10 < 0) __PYX_ERR(0, 299, __pyx_L9_except_error)
6826 if (__pyx_t_10 < 0) __PYX_ERR(1, 299, __pyx_L9_except_error)
63866827 __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0);
63876828 if (__pyx_t_11) {
63886829 __Pyx_GIVEREF(__pyx_t_3);
63906831 __Pyx_XGIVEREF(__pyx_t_4);
63916832 __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_4);
63926833 __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0;
6393 __PYX_ERR(0, 299, __pyx_L9_except_error)
6834 __PYX_ERR(1, 299, __pyx_L9_except_error)
63946835 }
63956836 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
63966837 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
63986839 goto __pyx_L8_exception_handled;
63996840 }
64006841 __pyx_L9_except_error:;
6401 __Pyx_PyThreadState_assign
64026842 __Pyx_XGIVEREF(__pyx_t_6);
64036843 __Pyx_XGIVEREF(__pyx_t_7);
64046844 __Pyx_XGIVEREF(__pyx_t_8);
64056845 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
64066846 goto __pyx_L1_error;
64076847 __pyx_L11_try_return:;
6408 __Pyx_PyThreadState_assign
64096848 __Pyx_XGIVEREF(__pyx_t_6);
64106849 __Pyx_XGIVEREF(__pyx_t_7);
64116850 __Pyx_XGIVEREF(__pyx_t_8);
64126851 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
64136852 goto __pyx_L4_return;
64146853 __pyx_L8_exception_handled:;
6415 __Pyx_PyThreadState_assign
64166854 __Pyx_XGIVEREF(__pyx_t_6);
64176855 __Pyx_XGIVEREF(__pyx_t_7);
64186856 __Pyx_XGIVEREF(__pyx_t_8);
64226860 /*finally:*/ {
64236861 /*normal exit:*/{
64246862 if (__pyx_t_2) {
6425 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL);
6863 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, NULL);
64266864 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6427 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 299, __pyx_L1_error)
6865 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 299, __pyx_L1_error)
64286866 __Pyx_GOTREF(__pyx_t_8);
64296867 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
64306868 }
64346872 __pyx_t_8 = __pyx_r;
64356873 __pyx_r = 0;
64366874 if (__pyx_t_2) {
6437 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, NULL);
6875 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__11, NULL);
64386876 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6439 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 299, __pyx_L1_error)
6877 if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 299, __pyx_L1_error)
64406878 __Pyx_GOTREF(__pyx_t_7);
64416879 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64426880 }
64466884 }
64476885 __pyx_L6:;
64486886 }
6449 goto __pyx_L18;
6887 goto __pyx_L16;
64506888 __pyx_L3_error:;
64516889 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
64526890 goto __pyx_L1_error;
6453 __pyx_L18:;
6891 __pyx_L16:;
64546892 }
64556893
64566894 /* "pygame_sdl2/mixer.pyx":298
64916929 PyObject *__pyx_r = 0;
64926930 __Pyx_RefNannyDeclarations
64936931 __Pyx_RefNannySetupContext("queue (wrapper)", 0);
6494 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sound), __pyx_ptype_11pygame_sdl2_5mixer_Sound, 1, "sound", 0))) __PYX_ERR(0, 302, __pyx_L1_error)
6932 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sound), __pyx_ptype_11pygame_sdl2_5mixer_Sound, 1, "sound", 0))) __PYX_ERR(1, 302, __pyx_L1_error)
64956933 __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_20queue(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), ((struct __pyx_obj_11pygame_sdl2_5mixer_Sound *)__pyx_v_sound));
64966934
64976935 /* function exit code */
65266964 * with _lock:
65276965 * channel_queued[self.cid] = sound
65286966 */
6529 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_busy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error)
6967 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_busy); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 303, __pyx_L1_error)
65306968 __Pyx_GOTREF(__pyx_t_2);
65316969 __pyx_t_3 = NULL;
65326970 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
65396977 }
65406978 }
65416979 if (__pyx_t_3) {
6542 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
6980 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 303, __pyx_L1_error)
65436981 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
65446982 } else {
6545 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
6983 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 303, __pyx_L1_error)
65466984 }
65476985 __Pyx_GOTREF(__pyx_t_1);
65486986 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6549 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 303, __pyx_L1_error)
6987 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 303, __pyx_L1_error)
65506988 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
65516989 if (__pyx_t_4) {
65526990
65586996 * else:
65596997 */
65606998 /*with:*/ {
6561 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
6999 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 304, __pyx_L1_error)
65627000 __Pyx_GOTREF(__pyx_t_1);
6563 __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 304, __pyx_L1_error)
7001 __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 304, __pyx_L1_error)
65647002 __Pyx_GOTREF(__pyx_t_5);
6565 __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L4_error)
7003 __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 304, __pyx_L4_error)
65667004 __Pyx_GOTREF(__pyx_t_3);
65677005 __pyx_t_6 = NULL;
65687006 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
65757013 }
65767014 }
65777015 if (__pyx_t_6) {
6578 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L4_error)
7016 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 304, __pyx_L4_error)
65797017 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
65807018 } else {
6581 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L4_error)
7019 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 304, __pyx_L4_error)
65827020 }
65837021 __Pyx_GOTREF(__pyx_t_2);
65847022 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
66037041 */
66047042 if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) {
66057043 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6606 __PYX_ERR(0, 305, __pyx_L8_error)
7044 __PYX_ERR(1, 305, __pyx_L8_error)
66077045 }
6608 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L8_error)
7046 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 305, __pyx_L8_error)
66097047 __Pyx_GOTREF(__pyx_t_1);
6610 if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_1, ((PyObject *)__pyx_v_sound)) < 0)) __PYX_ERR(0, 305, __pyx_L8_error)
7048 if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_1, ((PyObject *)__pyx_v_sound)) < 0)) __PYX_ERR(1, 305, __pyx_L8_error)
66117049 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66127050
66137051 /* "pygame_sdl2/mixer.pyx":304
66217059 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
66227060 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
66237061 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
6624 goto __pyx_L15_try_end;
7062 goto __pyx_L13_try_end;
66257063 __pyx_L8_error:;
6626 __Pyx_PyThreadState_assign
66277064 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
66287065 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
66297066 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
66307067 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
66317068 /*except:*/ {
66327069 __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.queue", __pyx_clineno, __pyx_lineno, __pyx_filename);
6633 if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 304, __pyx_L10_except_error)
7070 if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(1, 304, __pyx_L10_except_error)
66347071 __Pyx_GOTREF(__pyx_t_1);
66357072 __Pyx_GOTREF(__pyx_t_2);
66367073 __Pyx_GOTREF(__pyx_t_3);
6637 __pyx_t_6 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L10_except_error)
7074 __pyx_t_6 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 304, __pyx_L10_except_error)
66387075 __Pyx_GOTREF(__pyx_t_6);
66397076 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL);
66407077 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
66417078 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6642 if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 304, __pyx_L10_except_error)
7079 if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 304, __pyx_L10_except_error)
66437080 __Pyx_GOTREF(__pyx_t_10);
66447081 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10);
66457082 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6646 if (__pyx_t_4 < 0) __PYX_ERR(0, 304, __pyx_L10_except_error)
7083 if (__pyx_t_4 < 0) __PYX_ERR(1, 304, __pyx_L10_except_error)
66477084 __pyx_t_11 = ((!(__pyx_t_4 != 0)) != 0);
66487085 if (__pyx_t_11) {
66497086 __Pyx_GIVEREF(__pyx_t_1);
66517088 __Pyx_XGIVEREF(__pyx_t_3);
66527089 __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_2, __pyx_t_3);
66537090 __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0;
6654 __PYX_ERR(0, 304, __pyx_L10_except_error)
7091 __PYX_ERR(1, 304, __pyx_L10_except_error)
66557092 }
66567093 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66577094 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66597096 goto __pyx_L9_exception_handled;
66607097 }
66617098 __pyx_L10_except_error:;
6662 __Pyx_PyThreadState_assign
66637099 __Pyx_XGIVEREF(__pyx_t_7);
66647100 __Pyx_XGIVEREF(__pyx_t_8);
66657101 __Pyx_XGIVEREF(__pyx_t_9);
66667102 __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
66677103 goto __pyx_L1_error;
66687104 __pyx_L9_exception_handled:;
6669 __Pyx_PyThreadState_assign
66707105 __Pyx_XGIVEREF(__pyx_t_7);
66717106 __Pyx_XGIVEREF(__pyx_t_8);
66727107 __Pyx_XGIVEREF(__pyx_t_9);
66737108 __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
6674 __pyx_L15_try_end:;
7109 __pyx_L13_try_end:;
66757110 }
66767111 }
66777112 /*finally:*/ {
66787113 /*normal exit:*/{
66797114 if (__pyx_t_5) {
6680 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__10, NULL);
7115 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__12, NULL);
66817116 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6682 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 304, __pyx_L1_error)
7117 if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 304, __pyx_L1_error)
66837118 __Pyx_GOTREF(__pyx_t_9);
66847119 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
66857120 }
66877122 }
66887123 __pyx_L7:;
66897124 }
6690 goto __pyx_L19;
7125 goto __pyx_L17;
66917126 __pyx_L4_error:;
66927127 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
66937128 goto __pyx_L1_error;
6694 __pyx_L19:;
7129 __pyx_L17:;
66957130 }
66967131
66977132 /* "pygame_sdl2/mixer.pyx":303
67127147 * def get_queue(self):
67137148 */
67147149 /*else*/ {
6715 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_play); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error)
7150 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_play); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 307, __pyx_L1_error)
67167151 __Pyx_GOTREF(__pyx_t_2);
67177152 __pyx_t_1 = NULL;
67187153 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
67257160 }
67267161 }
67277162 if (!__pyx_t_1) {
6728 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_sound)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
7163 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_sound)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 307, __pyx_L1_error)
67297164 __Pyx_GOTREF(__pyx_t_3);
67307165 } else {
67317166 #if CYTHON_FAST_PYCALL
67327167 if (PyFunction_Check(__pyx_t_2)) {
67337168 PyObject *__pyx_temp[2] = {__pyx_t_1, ((PyObject *)__pyx_v_sound)};
6734 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
7169 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 307, __pyx_L1_error)
67357170 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
67367171 __Pyx_GOTREF(__pyx_t_3);
67377172 } else
67397174 #if CYTHON_FAST_PYCCALL
67407175 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
67417176 PyObject *__pyx_temp[2] = {__pyx_t_1, ((PyObject *)__pyx_v_sound)};
6742 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
7177 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 307, __pyx_L1_error)
67437178 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
67447179 __Pyx_GOTREF(__pyx_t_3);
67457180 } else
67467181 #endif
67477182 {
6748 __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 307, __pyx_L1_error)
7183 __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 307, __pyx_L1_error)
67497184 __Pyx_GOTREF(__pyx_t_6);
67507185 __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL;
67517186 __Pyx_INCREF(((PyObject *)__pyx_v_sound));
67527187 __Pyx_GIVEREF(((PyObject *)__pyx_v_sound));
67537188 PyTuple_SET_ITEM(__pyx_t_6, 0+1, ((PyObject *)__pyx_v_sound));
6754 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
7189 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 307, __pyx_L1_error)
67557190 __Pyx_GOTREF(__pyx_t_3);
67567191 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
67577192 }
68307265 *
68317266 */
68327267 /*with:*/ {
6833 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
7268 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 310, __pyx_L1_error)
68347269 __Pyx_GOTREF(__pyx_t_1);
6835 __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
7270 __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 310, __pyx_L1_error)
68367271 __Pyx_GOTREF(__pyx_t_2);
6837 __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L3_error)
7272 __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 310, __pyx_L3_error)
68387273 __Pyx_GOTREF(__pyx_t_4);
68397274 __pyx_t_5 = NULL;
68407275 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
68477282 }
68487283 }
68497284 if (__pyx_t_5) {
6850 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L3_error)
7285 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 310, __pyx_L3_error)
68517286 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
68527287 } else {
6853 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L3_error)
7288 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 310, __pyx_L3_error)
68547289 }
68557290 __Pyx_GOTREF(__pyx_t_3);
68567291 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
68757310 */
68767311 __Pyx_XDECREF(__pyx_r);
68777312 if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_queued == Py_None)) {
6878 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
6879 __PYX_ERR(0, 311, __pyx_L7_error)
7313 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
7314 __PYX_ERR(1, 311, __pyx_L7_error)
68807315 }
6881 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L7_error)
7316 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 311, __pyx_L7_error)
68827317 __Pyx_GOTREF(__pyx_t_1);
6883 __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L7_error)
7318 __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_queued, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 311, __pyx_L7_error)
68847319 __Pyx_GOTREF(__pyx_t_3);
68857320 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
68867321 __pyx_r = __pyx_t_3;
68967331 */
68977332 }
68987333 __pyx_L7_error:;
6899 __Pyx_PyThreadState_assign
69007334 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
69017335 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
69027336 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
69037337 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
69047338 /*except:*/ {
69057339 __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_queue", __pyx_clineno, __pyx_lineno, __pyx_filename);
6906 if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(0, 310, __pyx_L9_except_error)
7340 if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(1, 310, __pyx_L9_except_error)
69077341 __Pyx_GOTREF(__pyx_t_3);
69087342 __Pyx_GOTREF(__pyx_t_1);
69097343 __Pyx_GOTREF(__pyx_t_4);
6910 __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L9_except_error)
7344 __pyx_t_5 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 310, __pyx_L9_except_error)
69117345 __Pyx_GOTREF(__pyx_t_5);
69127346 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL);
69137347 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
69147348 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6915 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 310, __pyx_L9_except_error)
7349 if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 310, __pyx_L9_except_error)
69167350 __Pyx_GOTREF(__pyx_t_9);
69177351 __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9);
69187352 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6919 if (__pyx_t_10 < 0) __PYX_ERR(0, 310, __pyx_L9_except_error)
7353 if (__pyx_t_10 < 0) __PYX_ERR(1, 310, __pyx_L9_except_error)
69207354 __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0);
69217355 if (__pyx_t_11) {
69227356 __Pyx_GIVEREF(__pyx_t_3);
69247358 __Pyx_XGIVEREF(__pyx_t_4);
69257359 __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_4);
69267360 __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0;
6927 __PYX_ERR(0, 310, __pyx_L9_except_error)
7361 __PYX_ERR(1, 310, __pyx_L9_except_error)
69287362 }
69297363 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
69307364 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
69327366 goto __pyx_L8_exception_handled;
69337367 }
69347368 __pyx_L9_except_error:;
6935 __Pyx_PyThreadState_assign
69367369 __Pyx_XGIVEREF(__pyx_t_6);
69377370 __Pyx_XGIVEREF(__pyx_t_7);
69387371 __Pyx_XGIVEREF(__pyx_t_8);
69397372 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
69407373 goto __pyx_L1_error;
69417374 __pyx_L11_try_return:;
6942 __Pyx_PyThreadState_assign
69437375 __Pyx_XGIVEREF(__pyx_t_6);
69447376 __Pyx_XGIVEREF(__pyx_t_7);
69457377 __Pyx_XGIVEREF(__pyx_t_8);
69467378 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
69477379 goto __pyx_L4_return;
69487380 __pyx_L8_exception_handled:;
6949 __Pyx_PyThreadState_assign
69507381 __Pyx_XGIVEREF(__pyx_t_6);
69517382 __Pyx_XGIVEREF(__pyx_t_7);
69527383 __Pyx_XGIVEREF(__pyx_t_8);
69567387 /*finally:*/ {
69577388 /*normal exit:*/{
69587389 if (__pyx_t_2) {
6959 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__11, NULL);
7390 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__13, NULL);
69607391 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6961 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 310, __pyx_L1_error)
7392 if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 310, __pyx_L1_error)
69627393 __Pyx_GOTREF(__pyx_t_8);
69637394 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
69647395 }
69687399 __pyx_t_8 = __pyx_r;
69697400 __pyx_r = 0;
69707401 if (__pyx_t_2) {
6971 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__12, NULL);
7402 __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__14, NULL);
69727403 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6973 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 310, __pyx_L1_error)
7404 if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 310, __pyx_L1_error)
69747405 __Pyx_GOTREF(__pyx_t_7);
69757406 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
69767407 }
69807411 }
69817412 __pyx_L6:;
69827413 }
6983 goto __pyx_L18;
7414 goto __pyx_L16;
69847415 __pyx_L3_error:;
69857416 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
69867417 goto __pyx_L1_error;
6987 __pyx_L18:;
7418 __pyx_L16:;
69887419 }
69897420
69907421 /* "pygame_sdl2/mixer.pyx":309
70357466 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
70367467 switch (pos_args) {
70377468 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7469 CYTHON_FALLTHROUGH;
70387470 case 0: break;
70397471 default: goto __pyx_L5_argtuple_error;
70407472 }
70427474 switch (pos_args) {
70437475 case 0:
70447476 if (kw_args > 0) {
7045 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type);
7477 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type);
70467478 if (value) { values[0] = value; kw_args--; }
70477479 }
70487480 }
70497481 if (unlikely(kw_args > 0)) {
7050 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_endevent") < 0)) __PYX_ERR(0, 313, __pyx_L3_error)
7482 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_endevent") < 0)) __PYX_ERR(1, 313, __pyx_L3_error)
70517483 }
70527484 } else {
70537485 switch (PyTuple_GET_SIZE(__pyx_args)) {
70547486 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7487 CYTHON_FALLTHROUGH;
70557488 case 0: break;
70567489 default: goto __pyx_L5_argtuple_error;
70577490 }
70607493 }
70617494 goto __pyx_L4_argument_unpacking_done;
70627495 __pyx_L5_argtuple_error:;
7063 __Pyx_RaiseArgtupleInvalid("set_endevent", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 313, __pyx_L3_error)
7496 __Pyx_RaiseArgtupleInvalid("set_endevent", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 313, __pyx_L3_error)
70647497 __pyx_L3_error:;
70657498 __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.set_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename);
70667499 __Pyx_RefNannyFinishContext();
70887521 *
70897522 * def get_endevent(self):
70907523 */
7091 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_type); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 314, __pyx_L1_error)
7524 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_type); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 314, __pyx_L1_error)
70927525 if (!__pyx_t_2) {
70937526 } else {
70947527 __Pyx_INCREF(__pyx_v_type);
70957528 __pyx_t_1 = __pyx_v_type;
70967529 goto __pyx_L3_bool_binop_done;
70977530 }
7098 __pyx_t_3 = __Pyx_PyInt_From_long(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error)
7531 __pyx_t_3 = __Pyx_PyInt_From_long(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 314, __pyx_L1_error)
70997532 __Pyx_GOTREF(__pyx_t_3);
71007533 __pyx_t_1 = __pyx_t_3;
71017534 __pyx_t_3 = 0;
71027535 __pyx_L3_bool_binop_done:;
71037536 if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_events == Py_None)) {
71047537 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7105 __PYX_ERR(0, 314, __pyx_L1_error)
7538 __PYX_ERR(1, 314, __pyx_L1_error)
71067539 }
7107 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error)
7540 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 314, __pyx_L1_error)
71087541 __Pyx_GOTREF(__pyx_t_3);
7109 if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_channel_events, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(0, 314, __pyx_L1_error)
7542 if (unlikely(PyDict_SetItem(__pyx_v_11pygame_sdl2_5mixer_channel_events, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(1, 314, __pyx_L1_error)
71107543 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
71117544 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
71127545
71667599 */
71677600 __Pyx_XDECREF(__pyx_r);
71687601 if (unlikely(__pyx_v_11pygame_sdl2_5mixer_channel_events == Py_None)) {
7169 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
7170 __PYX_ERR(0, 317, __pyx_L1_error)
7602 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
7603 __PYX_ERR(1, 317, __pyx_L1_error)
71717604 }
7172 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error)
7605 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 317, __pyx_L1_error)
71737606 __Pyx_GOTREF(__pyx_t_1);
7174 __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_events, __pyx_t_1, __pyx_int_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error)
7607 __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_5mixer_channel_events, __pyx_t_1, __pyx_int_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 317, __pyx_L1_error)
71757608 __Pyx_GOTREF(__pyx_t_2);
71767609 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
71777610 __pyx_r = __pyx_t_2;
71917624 __Pyx_XDECREF(__pyx_t_2);
71927625 __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.get_endevent", __pyx_clineno, __pyx_lineno, __pyx_filename);
71937626 __pyx_r = NULL;
7627 __pyx_L0:;
7628 __Pyx_XGIVEREF(__pyx_r);
7629 __Pyx_RefNannyFinishContext();
7630 return __pyx_r;
7631 }
7632
7633 /* "(tree fragment)":1
7634 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7635 * cdef bint use_setstate
7636 * state = (self.cid,)
7637 */
7638
7639 /* Python wrapper */
7640 static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_29__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7641 static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_29__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7642 PyObject *__pyx_r = 0;
7643 __Pyx_RefNannyDeclarations
7644 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7645 __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_28__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self));
7646
7647 /* function exit code */
7648 __Pyx_RefNannyFinishContext();
7649 return __pyx_r;
7650 }
7651
7652 static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_28__reduce_cython__(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self) {
7653 int __pyx_v_use_setstate;
7654 PyObject *__pyx_v_state = NULL;
7655 PyObject *__pyx_v__dict = NULL;
7656 PyObject *__pyx_r = NULL;
7657 __Pyx_RefNannyDeclarations
7658 PyObject *__pyx_t_1 = NULL;
7659 PyObject *__pyx_t_2 = NULL;
7660 int __pyx_t_3;
7661 int __pyx_t_4;
7662 PyObject *__pyx_t_5 = NULL;
7663 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
7664
7665 /* "(tree fragment)":3
7666 * def __reduce_cython__(self):
7667 * cdef bint use_setstate
7668 * state = (self.cid,) # <<<<<<<<<<<<<<
7669 * _dict = getattr(self, '__dict__', None)
7670 * if _dict is not None:
7671 */
7672 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->cid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
7673 __Pyx_GOTREF(__pyx_t_1);
7674 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
7675 __Pyx_GOTREF(__pyx_t_2);
7676 __Pyx_GIVEREF(__pyx_t_1);
7677 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
7678 __pyx_t_1 = 0;
7679 __pyx_v_state = __pyx_t_2;
7680 __pyx_t_2 = 0;
7681
7682 /* "(tree fragment)":4
7683 * cdef bint use_setstate
7684 * state = (self.cid,)
7685 * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
7686 * if _dict is not None:
7687 * state += (_dict,)
7688 */
7689 __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
7690 __Pyx_GOTREF(__pyx_t_2);
7691 __pyx_v__dict = __pyx_t_2;
7692 __pyx_t_2 = 0;
7693
7694 /* "(tree fragment)":5
7695 * state = (self.cid,)
7696 * _dict = getattr(self, '__dict__', None)
7697 * if _dict is not None: # <<<<<<<<<<<<<<
7698 * state += (_dict,)
7699 * use_setstate = True
7700 */
7701 __pyx_t_3 = (__pyx_v__dict != Py_None);
7702 __pyx_t_4 = (__pyx_t_3 != 0);
7703 if (__pyx_t_4) {
7704
7705 /* "(tree fragment)":6
7706 * _dict = getattr(self, '__dict__', None)
7707 * if _dict is not None:
7708 * state += (_dict,) # <<<<<<<<<<<<<<
7709 * use_setstate = True
7710 * else:
7711 */
7712 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error)
7713 __Pyx_GOTREF(__pyx_t_2);
7714 __Pyx_INCREF(__pyx_v__dict);
7715 __Pyx_GIVEREF(__pyx_v__dict);
7716 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__dict);
7717 __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
7718 __Pyx_GOTREF(__pyx_t_1);
7719 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7720 __Pyx_DECREF_SET(__pyx_v_state, __pyx_t_1);
7721 __pyx_t_1 = 0;
7722
7723 /* "(tree fragment)":7
7724 * if _dict is not None:
7725 * state += (_dict,)
7726 * use_setstate = True # <<<<<<<<<<<<<<
7727 * else:
7728 * use_setstate = False
7729 */
7730 __pyx_v_use_setstate = 1;
7731
7732 /* "(tree fragment)":5
7733 * state = (self.cid,)
7734 * _dict = getattr(self, '__dict__', None)
7735 * if _dict is not None: # <<<<<<<<<<<<<<
7736 * state += (_dict,)
7737 * use_setstate = True
7738 */
7739 goto __pyx_L3;
7740 }
7741
7742 /* "(tree fragment)":9
7743 * use_setstate = True
7744 * else:
7745 * use_setstate = False # <<<<<<<<<<<<<<
7746 * if use_setstate:
7747 * return __pyx_unpickle_Channel, (type(self), 0x4b7cc56, None), state
7748 */
7749 /*else*/ {
7750 __pyx_v_use_setstate = 0;
7751 }
7752 __pyx_L3:;
7753
7754 /* "(tree fragment)":10
7755 * else:
7756 * use_setstate = False
7757 * if use_setstate: # <<<<<<<<<<<<<<
7758 * return __pyx_unpickle_Channel, (type(self), 0x4b7cc56, None), state
7759 * else:
7760 */
7761 __pyx_t_4 = (__pyx_v_use_setstate != 0);
7762 if (__pyx_t_4) {
7763
7764 /* "(tree fragment)":11
7765 * use_setstate = False
7766 * if use_setstate:
7767 * return __pyx_unpickle_Channel, (type(self), 0x4b7cc56, None), state # <<<<<<<<<<<<<<
7768 * else:
7769 * return __pyx_unpickle_Channel, (type(self), 0x4b7cc56, state)
7770 */
7771 __Pyx_XDECREF(__pyx_r);
7772 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Channel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
7773 __Pyx_GOTREF(__pyx_t_1);
7774 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
7775 __Pyx_GOTREF(__pyx_t_2);
7776 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7777 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7778 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7779 __Pyx_INCREF(__pyx_int_79154262);
7780 __Pyx_GIVEREF(__pyx_int_79154262);
7781 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_79154262);
7782 __Pyx_INCREF(Py_None);
7783 __Pyx_GIVEREF(Py_None);
7784 PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None);
7785 __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 11, __pyx_L1_error)
7786 __Pyx_GOTREF(__pyx_t_5);
7787 __Pyx_GIVEREF(__pyx_t_1);
7788 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
7789 __Pyx_GIVEREF(__pyx_t_2);
7790 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
7791 __Pyx_INCREF(__pyx_v_state);
7792 __Pyx_GIVEREF(__pyx_v_state);
7793 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
7794 __pyx_t_1 = 0;
7795 __pyx_t_2 = 0;
7796 __pyx_r = __pyx_t_5;
7797 __pyx_t_5 = 0;
7798 goto __pyx_L0;
7799
7800 /* "(tree fragment)":10
7801 * else:
7802 * use_setstate = False
7803 * if use_setstate: # <<<<<<<<<<<<<<
7804 * return __pyx_unpickle_Channel, (type(self), 0x4b7cc56, None), state
7805 * else:
7806 */
7807 }
7808
7809 /* "(tree fragment)":13
7810 * return __pyx_unpickle_Channel, (type(self), 0x4b7cc56, None), state
7811 * else:
7812 * return __pyx_unpickle_Channel, (type(self), 0x4b7cc56, state) # <<<<<<<<<<<<<<
7813 * def __setstate_cython__(self, __pyx_state):
7814 * __pyx_unpickle_Channel__set_state(self, __pyx_state)
7815 */
7816 /*else*/ {
7817 __Pyx_XDECREF(__pyx_r);
7818 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Channel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 13, __pyx_L1_error)
7819 __Pyx_GOTREF(__pyx_t_5);
7820 __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
7821 __Pyx_GOTREF(__pyx_t_2);
7822 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7823 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7824 PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7825 __Pyx_INCREF(__pyx_int_79154262);
7826 __Pyx_GIVEREF(__pyx_int_79154262);
7827 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_79154262);
7828 __Pyx_INCREF(__pyx_v_state);
7829 __Pyx_GIVEREF(__pyx_v_state);
7830 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state);
7831 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
7832 __Pyx_GOTREF(__pyx_t_1);
7833 __Pyx_GIVEREF(__pyx_t_5);
7834 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
7835 __Pyx_GIVEREF(__pyx_t_2);
7836 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
7837 __pyx_t_5 = 0;
7838 __pyx_t_2 = 0;
7839 __pyx_r = __pyx_t_1;
7840 __pyx_t_1 = 0;
7841 goto __pyx_L0;
7842 }
7843
7844 /* "(tree fragment)":1
7845 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7846 * cdef bint use_setstate
7847 * state = (self.cid,)
7848 */
7849
7850 /* function exit code */
7851 __pyx_L1_error:;
7852 __Pyx_XDECREF(__pyx_t_1);
7853 __Pyx_XDECREF(__pyx_t_2);
7854 __Pyx_XDECREF(__pyx_t_5);
7855 __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7856 __pyx_r = NULL;
7857 __pyx_L0:;
7858 __Pyx_XDECREF(__pyx_v_state);
7859 __Pyx_XDECREF(__pyx_v__dict);
7860 __Pyx_XGIVEREF(__pyx_r);
7861 __Pyx_RefNannyFinishContext();
7862 return __pyx_r;
7863 }
7864
7865 /* "(tree fragment)":14
7866 * else:
7867 * return __pyx_unpickle_Channel, (type(self), 0x4b7cc56, state)
7868 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7869 * __pyx_unpickle_Channel__set_state(self, __pyx_state)
7870 */
7871
7872 /* Python wrapper */
7873 static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_31__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
7874 static PyObject *__pyx_pw_11pygame_sdl2_5mixer_7Channel_31__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7875 PyObject *__pyx_r = 0;
7876 __Pyx_RefNannyDeclarations
7877 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7878 __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_7Channel_30__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
7879
7880 /* function exit code */
7881 __Pyx_RefNannyFinishContext();
7882 return __pyx_r;
7883 }
7884
7885 static PyObject *__pyx_pf_11pygame_sdl2_5mixer_7Channel_30__setstate_cython__(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7886 PyObject *__pyx_r = NULL;
7887 __Pyx_RefNannyDeclarations
7888 PyObject *__pyx_t_1 = NULL;
7889 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
7890
7891 /* "(tree fragment)":15
7892 * return __pyx_unpickle_Channel, (type(self), 0x4b7cc56, state)
7893 * def __setstate_cython__(self, __pyx_state):
7894 * __pyx_unpickle_Channel__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
7895 */
7896 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(0, 15, __pyx_L1_error)
7897 __pyx_t_1 = __pyx_f_11pygame_sdl2_5mixer___pyx_unpickle_Channel__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
7898 __Pyx_GOTREF(__pyx_t_1);
7899 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7900
7901 /* "(tree fragment)":14
7902 * else:
7903 * return __pyx_unpickle_Channel, (type(self), 0x4b7cc56, state)
7904 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7905 * __pyx_unpickle_Channel__set_state(self, __pyx_state)
7906 */
7907
7908 /* function exit code */
7909 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7910 goto __pyx_L0;
7911 __pyx_L1_error:;
7912 __Pyx_XDECREF(__pyx_t_1);
7913 __Pyx_AddTraceback("pygame_sdl2.mixer.Channel.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7914 __pyx_r = NULL;
7915 __pyx_L0:;
7916 __Pyx_XGIVEREF(__pyx_r);
7917 __Pyx_RefNannyFinishContext();
7918 return __pyx_r;
7919 }
7920
7921 /* "(tree fragment)":1
7922 * def __pyx_unpickle_Channel(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
7923 * if __pyx_checksum != 0x4b7cc56:
7924 * from pickle import PickleError as __pyx_PickleError
7925 */
7926
7927 /* Python wrapper */
7928 static PyObject *__pyx_pw_11pygame_sdl2_5mixer_29__pyx_unpickle_Channel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7929 static PyMethodDef __pyx_mdef_11pygame_sdl2_5mixer_29__pyx_unpickle_Channel = {"__pyx_unpickle_Channel", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_29__pyx_unpickle_Channel, METH_VARARGS|METH_KEYWORDS, 0};
7930 static PyObject *__pyx_pw_11pygame_sdl2_5mixer_29__pyx_unpickle_Channel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7931 PyObject *__pyx_v___pyx_type = 0;
7932 long __pyx_v___pyx_checksum;
7933 PyObject *__pyx_v___pyx_state = 0;
7934 PyObject *__pyx_r = 0;
7935 __Pyx_RefNannyDeclarations
7936 __Pyx_RefNannySetupContext("__pyx_unpickle_Channel (wrapper)", 0);
7937 {
7938 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
7939 PyObject* values[3] = {0,0,0};
7940 if (unlikely(__pyx_kwds)) {
7941 Py_ssize_t kw_args;
7942 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7943 switch (pos_args) {
7944 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7945 CYTHON_FALLTHROUGH;
7946 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7947 CYTHON_FALLTHROUGH;
7948 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7949 CYTHON_FALLTHROUGH;
7950 case 0: break;
7951 default: goto __pyx_L5_argtuple_error;
7952 }
7953 kw_args = PyDict_Size(__pyx_kwds);
7954 switch (pos_args) {
7955 case 0:
7956 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
7957 else goto __pyx_L5_argtuple_error;
7958 CYTHON_FALLTHROUGH;
7959 case 1:
7960 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
7961 else {
7962 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Channel", 1, 3, 3, 1); __PYX_ERR(0, 1, __pyx_L3_error)
7963 }
7964 CYTHON_FALLTHROUGH;
7965 case 2:
7966 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
7967 else {
7968 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Channel", 1, 3, 3, 2); __PYX_ERR(0, 1, __pyx_L3_error)
7969 }
7970 }
7971 if (unlikely(kw_args > 0)) {
7972 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Channel") < 0)) __PYX_ERR(0, 1, __pyx_L3_error)
7973 }
7974 } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
7975 goto __pyx_L5_argtuple_error;
7976 } else {
7977 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7978 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7979 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7980 }
7981 __pyx_v___pyx_type = values[0];
7982 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L3_error)
7983 __pyx_v___pyx_state = values[2];
7984 }
7985 goto __pyx_L4_argument_unpacking_done;
7986 __pyx_L5_argtuple_error:;
7987 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Channel", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1, __pyx_L3_error)
7988 __pyx_L3_error:;
7989 __Pyx_AddTraceback("pygame_sdl2.mixer.__pyx_unpickle_Channel", __pyx_clineno, __pyx_lineno, __pyx_filename);
7990 __Pyx_RefNannyFinishContext();
7991 return NULL;
7992 __pyx_L4_argument_unpacking_done:;
7993 __pyx_r = __pyx_pf_11pygame_sdl2_5mixer_28__pyx_unpickle_Channel(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
7994
7995 /* function exit code */
7996 __Pyx_RefNannyFinishContext();
7997 return __pyx_r;
7998 }
7999
8000 static PyObject *__pyx_pf_11pygame_sdl2_5mixer_28__pyx_unpickle_Channel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
8001 PyObject *__pyx_v___pyx_PickleError = NULL;
8002 PyObject *__pyx_v___pyx_result = NULL;
8003 PyObject *__pyx_r = NULL;
8004 __Pyx_RefNannyDeclarations
8005 int __pyx_t_1;
8006 PyObject *__pyx_t_2 = NULL;
8007 PyObject *__pyx_t_3 = NULL;
8008 PyObject *__pyx_t_4 = NULL;
8009 PyObject *__pyx_t_5 = NULL;
8010 PyObject *__pyx_t_6 = NULL;
8011 int __pyx_t_7;
8012 __Pyx_RefNannySetupContext("__pyx_unpickle_Channel", 0);
8013
8014 /* "(tree fragment)":2
8015 * def __pyx_unpickle_Channel(__pyx_type, long __pyx_checksum, __pyx_state):
8016 * if __pyx_checksum != 0x4b7cc56: # <<<<<<<<<<<<<<
8017 * from pickle import PickleError as __pyx_PickleError
8018 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x4b7cc56 = (cid))" % __pyx_checksum)
8019 */
8020 __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x4b7cc56) != 0);
8021 if (__pyx_t_1) {
8022
8023 /* "(tree fragment)":3
8024 * def __pyx_unpickle_Channel(__pyx_type, long __pyx_checksum, __pyx_state):
8025 * if __pyx_checksum != 0x4b7cc56:
8026 * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
8027 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x4b7cc56 = (cid))" % __pyx_checksum)
8028 * __pyx_result = Channel.__new__(__pyx_type)
8029 */
8030 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
8031 __Pyx_GOTREF(__pyx_t_2);
8032 __Pyx_INCREF(__pyx_n_s_PickleError);
8033 __Pyx_GIVEREF(__pyx_n_s_PickleError);
8034 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
8035 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error)
8036 __Pyx_GOTREF(__pyx_t_3);
8037 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8038 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
8039 __Pyx_GOTREF(__pyx_t_2);
8040 __Pyx_INCREF(__pyx_t_2);
8041 __pyx_v___pyx_PickleError = __pyx_t_2;
8042 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8043 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8044
8045 /* "(tree fragment)":4
8046 * if __pyx_checksum != 0x4b7cc56:
8047 * from pickle import PickleError as __pyx_PickleError
8048 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x4b7cc56 = (cid))" % __pyx_checksum) # <<<<<<<<<<<<<<
8049 * __pyx_result = Channel.__new__(__pyx_type)
8050 * if __pyx_state is not None:
8051 */
8052 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
8053 __Pyx_GOTREF(__pyx_t_2);
8054 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x4b, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4, __pyx_L1_error)
8055 __Pyx_GOTREF(__pyx_t_4);
8056 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8057 __Pyx_INCREF(__pyx_v___pyx_PickleError);
8058 __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
8059 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
8060 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
8061 if (likely(__pyx_t_5)) {
8062 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
8063 __Pyx_INCREF(__pyx_t_5);
8064 __Pyx_INCREF(function);
8065 __Pyx_DECREF_SET(__pyx_t_2, function);
8066 }
8067 }
8068 if (!__pyx_t_5) {
8069 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
8070 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8071 __Pyx_GOTREF(__pyx_t_3);
8072 } else {
8073 #if CYTHON_FAST_PYCALL
8074 if (PyFunction_Check(__pyx_t_2)) {
8075 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
8076 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
8077 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8078 __Pyx_GOTREF(__pyx_t_3);
8079 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8080 } else
8081 #endif
8082 #if CYTHON_FAST_PYCCALL
8083 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
8084 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
8085 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
8086 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8087 __Pyx_GOTREF(__pyx_t_3);
8088 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8089 } else
8090 #endif
8091 {
8092 __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4, __pyx_L1_error)
8093 __Pyx_GOTREF(__pyx_t_6);
8094 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
8095 __Pyx_GIVEREF(__pyx_t_4);
8096 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
8097 __pyx_t_4 = 0;
8098 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
8099 __Pyx_GOTREF(__pyx_t_3);
8100 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8101 }
8102 }
8103 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8104 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8105 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8106 __PYX_ERR(0, 4, __pyx_L1_error)
8107
8108 /* "(tree fragment)":2
8109 * def __pyx_unpickle_Channel(__pyx_type, long __pyx_checksum, __pyx_state):
8110 * if __pyx_checksum != 0x4b7cc56: # <<<<<<<<<<<<<<
8111 * from pickle import PickleError as __pyx_PickleError
8112 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x4b7cc56 = (cid))" % __pyx_checksum)
8113 */
8114 }
8115
8116 /* "(tree fragment)":5
8117 * from pickle import PickleError as __pyx_PickleError
8118 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x4b7cc56 = (cid))" % __pyx_checksum)
8119 * __pyx_result = Channel.__new__(__pyx_type) # <<<<<<<<<<<<<<
8120 * if __pyx_state is not None:
8121 * __pyx_unpickle_Channel__set_state(<Channel> __pyx_result, __pyx_state)
8122 */
8123 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_11pygame_sdl2_5mixer_Channel), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
8124 __Pyx_GOTREF(__pyx_t_2);
8125 __pyx_t_6 = NULL;
8126 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
8127 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
8128 if (likely(__pyx_t_6)) {
8129 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
8130 __Pyx_INCREF(__pyx_t_6);
8131 __Pyx_INCREF(function);
8132 __Pyx_DECREF_SET(__pyx_t_2, function);
8133 }
8134 }
8135 if (!__pyx_t_6) {
8136 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
8137 __Pyx_GOTREF(__pyx_t_3);
8138 } else {
8139 #if CYTHON_FAST_PYCALL
8140 if (PyFunction_Check(__pyx_t_2)) {
8141 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
8142 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
8143 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8144 __Pyx_GOTREF(__pyx_t_3);
8145 } else
8146 #endif
8147 #if CYTHON_FAST_PYCCALL
8148 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
8149 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
8150 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
8151 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8152 __Pyx_GOTREF(__pyx_t_3);
8153 } else
8154 #endif
8155 {
8156 __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5, __pyx_L1_error)
8157 __Pyx_GOTREF(__pyx_t_4);
8158 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
8159 __Pyx_INCREF(__pyx_v___pyx_type);
8160 __Pyx_GIVEREF(__pyx_v___pyx_type);
8161 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type);
8162 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
8163 __Pyx_GOTREF(__pyx_t_3);
8164 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8165 }
8166 }
8167 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8168 __pyx_v___pyx_result = __pyx_t_3;
8169 __pyx_t_3 = 0;
8170
8171 /* "(tree fragment)":6
8172 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x4b7cc56 = (cid))" % __pyx_checksum)
8173 * __pyx_result = Channel.__new__(__pyx_type)
8174 * if __pyx_state is not None: # <<<<<<<<<<<<<<
8175 * __pyx_unpickle_Channel__set_state(<Channel> __pyx_result, __pyx_state)
8176 * return __pyx_result
8177 */
8178 __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
8179 __pyx_t_7 = (__pyx_t_1 != 0);
8180 if (__pyx_t_7) {
8181
8182 /* "(tree fragment)":7
8183 * __pyx_result = Channel.__new__(__pyx_type)
8184 * if __pyx_state is not None:
8185 * __pyx_unpickle_Channel__set_state(<Channel> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
8186 * return __pyx_result
8187 * cdef __pyx_unpickle_Channel__set_state(Channel __pyx_result, tuple __pyx_state):
8188 */
8189 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(0, 7, __pyx_L1_error)
8190 __pyx_t_3 = __pyx_f_11pygame_sdl2_5mixer___pyx_unpickle_Channel__set_state(((struct __pyx_obj_11pygame_sdl2_5mixer_Channel *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error)
8191 __Pyx_GOTREF(__pyx_t_3);
8192 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8193
8194 /* "(tree fragment)":6
8195 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x4b7cc56 = (cid))" % __pyx_checksum)
8196 * __pyx_result = Channel.__new__(__pyx_type)
8197 * if __pyx_state is not None: # <<<<<<<<<<<<<<
8198 * __pyx_unpickle_Channel__set_state(<Channel> __pyx_result, __pyx_state)
8199 * return __pyx_result
8200 */
8201 }
8202
8203 /* "(tree fragment)":8
8204 * if __pyx_state is not None:
8205 * __pyx_unpickle_Channel__set_state(<Channel> __pyx_result, __pyx_state)
8206 * return __pyx_result # <<<<<<<<<<<<<<
8207 * cdef __pyx_unpickle_Channel__set_state(Channel __pyx_result, tuple __pyx_state):
8208 * __pyx_result.cid = __pyx_state[0]
8209 */
8210 __Pyx_XDECREF(__pyx_r);
8211 __Pyx_INCREF(__pyx_v___pyx_result);
8212 __pyx_r = __pyx_v___pyx_result;
8213 goto __pyx_L0;
8214
8215 /* "(tree fragment)":1
8216 * def __pyx_unpickle_Channel(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
8217 * if __pyx_checksum != 0x4b7cc56:
8218 * from pickle import PickleError as __pyx_PickleError
8219 */
8220
8221 /* function exit code */
8222 __pyx_L1_error:;
8223 __Pyx_XDECREF(__pyx_t_2);
8224 __Pyx_XDECREF(__pyx_t_3);
8225 __Pyx_XDECREF(__pyx_t_4);
8226 __Pyx_XDECREF(__pyx_t_5);
8227 __Pyx_XDECREF(__pyx_t_6);
8228 __Pyx_AddTraceback("pygame_sdl2.mixer.__pyx_unpickle_Channel", __pyx_clineno, __pyx_lineno, __pyx_filename);
8229 __pyx_r = NULL;
8230 __pyx_L0:;
8231 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
8232 __Pyx_XDECREF(__pyx_v___pyx_result);
8233 __Pyx_XGIVEREF(__pyx_r);
8234 __Pyx_RefNannyFinishContext();
8235 return __pyx_r;
8236 }
8237
8238 /* "(tree fragment)":9
8239 * __pyx_unpickle_Channel__set_state(<Channel> __pyx_result, __pyx_state)
8240 * return __pyx_result
8241 * cdef __pyx_unpickle_Channel__set_state(Channel __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
8242 * __pyx_result.cid = __pyx_state[0]
8243 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
8244 */
8245
8246 static PyObject *__pyx_f_11pygame_sdl2_5mixer___pyx_unpickle_Channel__set_state(struct __pyx_obj_11pygame_sdl2_5mixer_Channel *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
8247 PyObject *__pyx_r = NULL;
8248 __Pyx_RefNannyDeclarations
8249 PyObject *__pyx_t_1 = NULL;
8250 int __pyx_t_2;
8251 int __pyx_t_3;
8252 Py_ssize_t __pyx_t_4;
8253 int __pyx_t_5;
8254 int __pyx_t_6;
8255 PyObject *__pyx_t_7 = NULL;
8256 PyObject *__pyx_t_8 = NULL;
8257 PyObject *__pyx_t_9 = NULL;
8258 PyObject *__pyx_t_10 = NULL;
8259 __Pyx_RefNannySetupContext("__pyx_unpickle_Channel__set_state", 0);
8260
8261 /* "(tree fragment)":10
8262 * return __pyx_result
8263 * cdef __pyx_unpickle_Channel__set_state(Channel __pyx_result, tuple __pyx_state):
8264 * __pyx_result.cid = __pyx_state[0] # <<<<<<<<<<<<<<
8265 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
8266 * __pyx_result.__dict__.update(__pyx_state[1])
8267 */
8268 if (unlikely(__pyx_v___pyx_state == Py_None)) {
8269 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
8270 __PYX_ERR(0, 10, __pyx_L1_error)
8271 }
8272 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
8273 __Pyx_GOTREF(__pyx_t_1);
8274 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10, __pyx_L1_error)
8275 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8276 __pyx_v___pyx_result->cid = __pyx_t_2;
8277
8278 /* "(tree fragment)":11
8279 * cdef __pyx_unpickle_Channel__set_state(Channel __pyx_result, tuple __pyx_state):
8280 * __pyx_result.cid = __pyx_state[0]
8281 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
8282 * __pyx_result.__dict__.update(__pyx_state[1])
8283 */
8284 if (unlikely(__pyx_v___pyx_state == Py_None)) {
8285 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
8286 __PYX_ERR(0, 11, __pyx_L1_error)
8287 }
8288 __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 11, __pyx_L1_error)
8289 __pyx_t_5 = ((__pyx_t_4 > 1) != 0);
8290 if (__pyx_t_5) {
8291 } else {
8292 __pyx_t_3 = __pyx_t_5;
8293 goto __pyx_L4_bool_binop_done;
8294 }
8295 __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 11, __pyx_L1_error)
8296 __pyx_t_6 = (__pyx_t_5 != 0);
8297 __pyx_t_3 = __pyx_t_6;
8298 __pyx_L4_bool_binop_done:;
8299 if (__pyx_t_3) {
8300
8301 /* "(tree fragment)":12
8302 * __pyx_result.cid = __pyx_state[0]
8303 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
8304 * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
8305 */
8306 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 12, __pyx_L1_error)
8307 __Pyx_GOTREF(__pyx_t_7);
8308 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 12, __pyx_L1_error)
8309 __Pyx_GOTREF(__pyx_t_8);
8310 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8311 if (unlikely(__pyx_v___pyx_state == Py_None)) {
8312 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
8313 __PYX_ERR(0, 12, __pyx_L1_error)
8314 }
8315 __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 12, __pyx_L1_error)
8316 __Pyx_GOTREF(__pyx_t_7);
8317 __pyx_t_9 = NULL;
8318 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
8319 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
8320 if (likely(__pyx_t_9)) {
8321 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
8322 __Pyx_INCREF(__pyx_t_9);
8323 __Pyx_INCREF(function);
8324 __Pyx_DECREF_SET(__pyx_t_8, function);
8325 }
8326 }
8327 if (!__pyx_t_9) {
8328 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
8329 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8330 __Pyx_GOTREF(__pyx_t_1);
8331 } else {
8332 #if CYTHON_FAST_PYCALL
8333 if (PyFunction_Check(__pyx_t_8)) {
8334 PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_7};
8335 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
8336 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
8337 __Pyx_GOTREF(__pyx_t_1);
8338 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8339 } else
8340 #endif
8341 #if CYTHON_FAST_PYCCALL
8342 if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
8343 PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_7};
8344 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
8345 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
8346 __Pyx_GOTREF(__pyx_t_1);
8347 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8348 } else
8349 #endif
8350 {
8351 __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 12, __pyx_L1_error)
8352 __Pyx_GOTREF(__pyx_t_10);
8353 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
8354 __Pyx_GIVEREF(__pyx_t_7);
8355 PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_7);
8356 __pyx_t_7 = 0;
8357 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
8358 __Pyx_GOTREF(__pyx_t_1);
8359 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8360 }
8361 }
8362 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8363 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8364
8365 /* "(tree fragment)":11
8366 * cdef __pyx_unpickle_Channel__set_state(Channel __pyx_result, tuple __pyx_state):
8367 * __pyx_result.cid = __pyx_state[0]
8368 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
8369 * __pyx_result.__dict__.update(__pyx_state[1])
8370 */
8371 }
8372
8373 /* "(tree fragment)":9
8374 * __pyx_unpickle_Channel__set_state(<Channel> __pyx_result, __pyx_state)
8375 * return __pyx_result
8376 * cdef __pyx_unpickle_Channel__set_state(Channel __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
8377 * __pyx_result.cid = __pyx_state[0]
8378 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
8379 */
8380
8381 /* function exit code */
8382 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8383 goto __pyx_L0;
8384 __pyx_L1_error:;
8385 __Pyx_XDECREF(__pyx_t_1);
8386 __Pyx_XDECREF(__pyx_t_7);
8387 __Pyx_XDECREF(__pyx_t_8);
8388 __Pyx_XDECREF(__pyx_t_9);
8389 __Pyx_XDECREF(__pyx_t_10);
8390 __Pyx_AddTraceback("pygame_sdl2.mixer.__pyx_unpickle_Channel__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
8391 __pyx_r = 0;
71948392 __pyx_L0:;
71958393 __Pyx_XGIVEREF(__pyx_r);
71968394 __Pyx_RefNannyFinishContext();
72138411 }
72148412
72158413 static void __pyx_tp_dealloc_11pygame_sdl2_5mixer_Sound(PyObject *o) {
7216 #if PY_VERSION_HEX >= 0x030400a1
7217 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
8414 #if CYTHON_USE_TP_FINALIZE
8415 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
72188416 if (PyObject_CallFinalizerFromDealloc(o)) return;
72198417 }
72208418 #endif
72408438 {"get_num_channels", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_21get_num_channels, METH_NOARGS, 0},
72418439 {"get_length", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_23get_length, METH_NOARGS, 0},
72428440 {"get_raw", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_25get_raw, METH_NOARGS, 0},
8441 {"__reduce_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_27__reduce_cython__, METH_NOARGS, 0},
8442 {"__setstate_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_5Sound_29__setstate_cython__, METH_O, 0},
72438443 {0, 0, 0, 0}
72448444 };
72458445
73138513 }
73148514
73158515 static void __pyx_tp_dealloc_11pygame_sdl2_5mixer_Channel(PyObject *o) {
7316 #if PY_VERSION_HEX >= 0x030400a1
7317 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
8516 #if CYTHON_USE_TP_FINALIZE
8517 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
73188518 if (PyObject_CallFinalizerFromDealloc(o)) return;
73198519 }
73208520 #endif
73358535 {"get_queue", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_23get_queue, METH_NOARGS, 0},
73368536 {"set_endevent", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_25set_endevent, METH_VARARGS|METH_KEYWORDS, 0},
73378537 {"get_endevent", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_27get_endevent, METH_NOARGS, 0},
8538 {"__reduce_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_29__reduce_cython__, METH_NOARGS, 0},
8539 {"__setstate_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_5mixer_7Channel_31__setstate_cython__, METH_O, 0},
73388540 {0, 0, 0, 0}
73398541 };
73408542
74018603 };
74028604
74038605 #if PY_MAJOR_VERSION >= 3
8606 #if CYTHON_PEP489_MULTI_PHASE_INIT
8607 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
8608 static int __pyx_pymod_exec_mixer(PyObject* module); /*proto*/
8609 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
8610 {Py_mod_create, (void*)__pyx_pymod_create},
8611 {Py_mod_exec, (void*)__pyx_pymod_exec_mixer},
8612 {0, NULL}
8613 };
8614 #endif
8615
74048616 static struct PyModuleDef __pyx_moduledef = {
7405 #if PY_VERSION_HEX < 0x03020000
7406 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
7407 #else
74088617 PyModuleDef_HEAD_INIT,
7409 #endif
74108618 "mixer",
74118619 0, /* m_doc */
8620 #if CYTHON_PEP489_MULTI_PHASE_INIT
8621 0, /* m_size */
8622 #else
74128623 -1, /* m_size */
8624 #endif
74138625 __pyx_methods /* m_methods */,
8626 #if CYTHON_PEP489_MULTI_PHASE_INIT
8627 __pyx_moduledef_slots, /* m_slots */
8628 #else
74148629 NULL, /* m_reload */
8630 #endif
74158631 NULL, /* m_traverse */
74168632 NULL, /* m_clear */
74178633 NULL /* m_free */
74198635 #endif
74208636
74218637 static __Pyx_StringTabEntry __pyx_string_tab[] = {
8638 {&__pyx_kp_s_Incompatible_checksums_s_vs_0x4b, __pyx_k_Incompatible_checksums_s_vs_0x4b, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x4b), 0, 0, 1, 0},
74228639 {&__pyx_n_s_Lock, __pyx_k_Lock, sizeof(__pyx_k_Lock), 0, 0, 1, 1},
74238640 {&__pyx_kp_u_Not_implemented, __pyx_k_Not_implemented, sizeof(__pyx_k_Not_implemented), 0, 1, 0, 0},
8641 {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
74248642 {&__pyx_n_s_Thread, __pyx_k_Thread, sizeof(__pyx_k_Thread), 0, 0, 1, 1},
7425 {&__pyx_n_s__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 0, 1, 1},
8643 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
8644 {&__pyx_n_s__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 0, 1, 1},
74268645 {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0},
74278646 {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
74288647 {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
74328651 {&__pyx_n_s_channel, __pyx_k_channel, sizeof(__pyx_k_channel), 0, 0, 1, 1},
74338652 {&__pyx_n_s_channels, __pyx_k_channels, sizeof(__pyx_k_channels), 0, 0, 1, 1},
74348653 {&__pyx_n_s_cid, __pyx_k_cid, sizeof(__pyx_k_cid), 0, 0, 1, 1},
8654 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
74358655 {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
8656 {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
74368657 {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
74378658 {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
74388659 {&__pyx_n_s_errors, __pyx_k_errors, sizeof(__pyx_k_errors), 0, 0, 1, 1},
74498670 {&__pyx_n_s_get_busy, __pyx_k_get_busy, sizeof(__pyx_k_get_busy), 0, 0, 1, 1},
74508671 {&__pyx_n_s_get_init, __pyx_k_get_init, sizeof(__pyx_k_get_init), 0, 0, 1, 1},
74518672 {&__pyx_n_s_get_num_channels, __pyx_k_get_num_channels, sizeof(__pyx_k_get_num_channels), 0, 0, 1, 1},
8673 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
74528674 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
74538675 {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
74548676 {&__pyx_n_s_lock, __pyx_k_lock, sizeof(__pyx_k_lock), 0, 0, 1, 1},
74578679 {&__pyx_n_s_maxtime, __pyx_k_maxtime, sizeof(__pyx_k_maxtime), 0, 0, 1, 1},
74588680 {&__pyx_n_s_ms, __pyx_k_ms, sizeof(__pyx_k_ms), 0, 0, 1, 1},
74598681 {&__pyx_n_s_music, __pyx_k_music, sizeof(__pyx_k_music), 0, 0, 1, 1},
8682 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
8683 {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
74608684 {&__pyx_n_s_next_sound, __pyx_k_next_sound, sizeof(__pyx_k_next_sound), 0, 0, 1, 1},
8685 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
74618686 {&__pyx_n_s_pause, __pyx_k_pause, sizeof(__pyx_k_pause), 0, 0, 1, 1},
8687 {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
74628688 {&__pyx_n_s_play, __pyx_k_play, sizeof(__pyx_k_play), 0, 0, 1, 1},
74638689 {&__pyx_n_s_play_current, __pyx_k_play_current, sizeof(__pyx_k_play_current), 0, 0, 1, 1},
74648690 {&__pyx_n_s_pre_init, __pyx_k_pre_init, sizeof(__pyx_k_pre_init), 0, 0, 1, 1},
74668692 {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1},
74678693 {&__pyx_n_s_pygame_sdl2_mixer, __pyx_k_pygame_sdl2_mixer, sizeof(__pyx_k_pygame_sdl2_mixer), 0, 0, 1, 1},
74688694 {&__pyx_n_s_pygame_sdl2_mixer_music, __pyx_k_pygame_sdl2_mixer_music, sizeof(__pyx_k_pygame_sdl2_mixer_music), 0, 0, 1, 1},
8695 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
8696 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
8697 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
8698 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
8699 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
8700 {&__pyx_n_s_pyx_unpickle_Channel, __pyx_k_pyx_unpickle_Channel, sizeof(__pyx_k_pyx_unpickle_Channel), 0, 0, 1, 1},
74698701 {&__pyx_n_s_quit, __pyx_k_quit, sizeof(__pyx_k_quit), 0, 0, 1, 1},
8702 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
8703 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
8704 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
74708705 {&__pyx_n_s_register_init, __pyx_k_register_init, sizeof(__pyx_k_register_init), 0, 0, 1, 1},
74718706 {&__pyx_n_s_register_quit, __pyx_k_register_quit, sizeof(__pyx_k_register_quit), 0, 0, 1, 1},
74728707 {&__pyx_n_s_set_num_channels, __pyx_k_set_num_channels, sizeof(__pyx_k_set_num_channels), 0, 0, 1, 1},
74738708 {&__pyx_n_s_set_reserved, __pyx_k_set_reserved, sizeof(__pyx_k_set_reserved), 0, 0, 1, 1},
8709 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
8710 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
74748711 {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
74758712 {&__pyx_n_s_sound, __pyx_k_sound, sizeof(__pyx_k_sound), 0, 0, 1, 1},
74768713 {&__pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_k_src_pygame_sdl2_mixer_pyx, sizeof(__pyx_k_src_pygame_sdl2_mixer_pyx), 0, 0, 1, 0},
74778714 {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
74788715 {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
8716 {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
74798717 {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
74808718 {&__pyx_n_s_target, __pyx_k_target, sizeof(__pyx_k_target), 0, 0, 1, 1},
74818719 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
74838721 {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
74848722 {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
74858723 {&__pyx_n_s_unpause, __pyx_k_unpause, sizeof(__pyx_k_unpause), 0, 0, 1, 1},
8724 {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
74868725 {0, 0, 0, 0, 0, 0, 0}
74878726 };
74888727 static int __Pyx_InitCachedBuiltins(void) {
8728 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error)
74898729 return 0;
8730 __pyx_L1_error:;
8731 return -1;
74908732 }
74918733
74928734 static int __Pyx_InitCachedConstants(void) {
75008742 * next_sound = channel_queued[channel]
75018743 * current_sounds[channel] = next_sound
75028744 */
7503 __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 50, __pyx_L1_error)
8745 __pyx_tuple_ = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 50, __pyx_L1_error)
75048746 __Pyx_GOTREF(__pyx_tuple_);
75058747 __Pyx_GIVEREF(__pyx_tuple_);
75068748
75118753 * next_sound = channel_queued.get(channel)
75128754 * if next_sound:
75138755 */
7514 __pyx_tuple__2 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 71, __pyx_L1_error)
8756 __pyx_tuple__2 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 71, __pyx_L1_error)
75158757 __Pyx_GOTREF(__pyx_tuple__2);
75168758 __Pyx_GIVEREF(__pyx_tuple__2);
75178759
75228764 *
75238765 *
75248766 */
7525 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Not_implemented); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 245, __pyx_L1_error)
8767 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Not_implemented); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 245, __pyx_L1_error)
75268768 __Pyx_GOTREF(__pyx_tuple__6);
75278769 __Pyx_GIVEREF(__pyx_tuple__6);
75288770
8771 /* "(tree fragment)":2
8772 * def __reduce_cython__(self):
8773 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8774 * def __setstate_cython__(self, __pyx_state):
8775 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8776 */
8777 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 2, __pyx_L1_error)
8778 __Pyx_GOTREF(__pyx_tuple__7);
8779 __Pyx_GIVEREF(__pyx_tuple__7);
8780
8781 /* "(tree fragment)":4
8782 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8783 * def __setstate_cython__(self, __pyx_state):
8784 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8785 */
8786 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 4, __pyx_L1_error)
8787 __Pyx_GOTREF(__pyx_tuple__8);
8788 __Pyx_GIVEREF(__pyx_tuple__8);
8789
75298790 /* "pygame_sdl2/mixer.pyx":268
75308791 * raise error()
75318792 *
75338794 * current_sounds[self.cid] = sound
75348795 *
75358796 */
7536 __pyx_tuple__7 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 268, __pyx_L1_error)
7537 __Pyx_GOTREF(__pyx_tuple__7);
7538 __Pyx_GIVEREF(__pyx_tuple__7);
8797 __pyx_tuple__9 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 268, __pyx_L1_error)
8798 __Pyx_GOTREF(__pyx_tuple__9);
8799 __Pyx_GIVEREF(__pyx_tuple__9);
75398800
75408801 /* "pygame_sdl2/mixer.pyx":299
75418802 *
75448805 * return current_sounds.get(self.cid)
75458806 *
75468807 */
7547 __pyx_tuple__8 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 299, __pyx_L1_error)
7548 __Pyx_GOTREF(__pyx_tuple__8);
7549 __Pyx_GIVEREF(__pyx_tuple__8);
7550 __pyx_tuple__9 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 299, __pyx_L1_error)
7551 __Pyx_GOTREF(__pyx_tuple__9);
7552 __Pyx_GIVEREF(__pyx_tuple__9);
8808 __pyx_tuple__10 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 299, __pyx_L1_error)
8809 __Pyx_GOTREF(__pyx_tuple__10);
8810 __Pyx_GIVEREF(__pyx_tuple__10);
8811 __pyx_tuple__11 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 299, __pyx_L1_error)
8812 __Pyx_GOTREF(__pyx_tuple__11);
8813 __Pyx_GIVEREF(__pyx_tuple__11);
75538814
75548815 /* "pygame_sdl2/mixer.pyx":304
75558816 * def queue(self, Sound sound):
75588819 * channel_queued[self.cid] = sound
75598820 * else:
75608821 */
7561 __pyx_tuple__10 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 304, __pyx_L1_error)
7562 __Pyx_GOTREF(__pyx_tuple__10);
7563 __Pyx_GIVEREF(__pyx_tuple__10);
8822 __pyx_tuple__12 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 304, __pyx_L1_error)
8823 __Pyx_GOTREF(__pyx_tuple__12);
8824 __Pyx_GIVEREF(__pyx_tuple__12);
75648825
75658826 /* "pygame_sdl2/mixer.pyx":310
75668827 *
75698830 * return channel_queued.get(self.cid)
75708831 *
75718832 */
7572 __pyx_tuple__11 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 310, __pyx_L1_error)
7573 __Pyx_GOTREF(__pyx_tuple__11);
7574 __Pyx_GIVEREF(__pyx_tuple__11);
7575 __pyx_tuple__12 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 310, __pyx_L1_error)
7576 __Pyx_GOTREF(__pyx_tuple__12);
7577 __Pyx_GIVEREF(__pyx_tuple__12);
8833 __pyx_tuple__13 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 310, __pyx_L1_error)
8834 __Pyx_GOTREF(__pyx_tuple__13);
8835 __Pyx_GIVEREF(__pyx_tuple__13);
8836 __pyx_tuple__14 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 310, __pyx_L1_error)
8837 __Pyx_GOTREF(__pyx_tuple__14);
8838 __Pyx_GIVEREF(__pyx_tuple__14);
75788839
75798840 /* "pygame_sdl2/mixer.pyx":41
75808841 * _lock = threading.Lock()
75838844 * """
75848845 * Caled by channel_callback to play the next sound. This has to be called
75858846 */
7586 __pyx_tuple__14 = PyTuple_Pack(3, __pyx_n_s_channel, __pyx_n_s_channel, __pyx_n_s_next_sound); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 41, __pyx_L1_error)
7587 __Pyx_GOTREF(__pyx_tuple__14);
7588 __Pyx_GIVEREF(__pyx_tuple__14);
7589 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_play_current, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 41, __pyx_L1_error)
8847 __pyx_tuple__16 = PyTuple_Pack(3, __pyx_n_s_channel, __pyx_n_s_channel, __pyx_n_s_next_sound); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 41, __pyx_L1_error)
8848 __Pyx_GOTREF(__pyx_tuple__16);
8849 __Pyx_GIVEREF(__pyx_tuple__16);
8850 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_play_current, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(1, 41, __pyx_L1_error)
75908851
75918852 /* "pygame_sdl2/mixer.pyx":80
75928853 *
75958856 * if get_init() is not None:
75968857 * return
75978858 */
7598 __pyx_tuple__16 = PyTuple_Pack(5, __pyx_n_s_frequency, __pyx_n_s_size, __pyx_n_s_channels, __pyx_n_s_buffer, __pyx_n_s_flag); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 80, __pyx_L1_error)
7599 __Pyx_GOTREF(__pyx_tuple__16);
7600 __Pyx_GIVEREF(__pyx_tuple__16);
7601 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_init, 80, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 80, __pyx_L1_error)
8859 __pyx_tuple__18 = PyTuple_Pack(5, __pyx_n_s_frequency, __pyx_n_s_size, __pyx_n_s_channels, __pyx_n_s_buffer, __pyx_n_s_flag); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 80, __pyx_L1_error)
8860 __Pyx_GOTREF(__pyx_tuple__18);
8861 __Pyx_GIVEREF(__pyx_tuple__18);
8862 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_init, 80, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(1, 80, __pyx_L1_error)
76028863
76038864 /* "pygame_sdl2/mixer.pyx":100
76048865 * Mix_ChannelFinished(channel_callback)
76078868 * global preinit_args
76088869 * preinit_args = (frequency, size, channels, buffersize)
76098870 */
7610 __pyx_tuple__18 = PyTuple_Pack(4, __pyx_n_s_frequency, __pyx_n_s_size, __pyx_n_s_channels, __pyx_n_s_buffersize); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 100, __pyx_L1_error)
7611 __Pyx_GOTREF(__pyx_tuple__18);
7612 __Pyx_GIVEREF(__pyx_tuple__18);
7613 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_pre_init, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 100, __pyx_L1_error)
8871 __pyx_tuple__20 = PyTuple_Pack(4, __pyx_n_s_frequency, __pyx_n_s_size, __pyx_n_s_channels, __pyx_n_s_buffersize); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 100, __pyx_L1_error)
8872 __Pyx_GOTREF(__pyx_tuple__20);
8873 __Pyx_GIVEREF(__pyx_tuple__20);
8874 __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_pre_init, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(1, 100, __pyx_L1_error)
76148875
76158876 /* "pygame_sdl2/mixer.pyx":105
76168877 *
76198880 * Mix_CloseAudio()
76208881 * Mix_Quit()
76218882 */
7622 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_quit, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 105, __pyx_L1_error)
8883 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_quit, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(1, 105, __pyx_L1_error)
76238884
76248885 /* "pygame_sdl2/mixer.pyx":109
76258886 * Mix_Quit()
76288889 * cdef int frequency
76298890 * cdef Uint16 format
76308891 */
7631 __pyx_tuple__21 = PyTuple_Pack(3, __pyx_n_s_frequency, __pyx_n_s_format, __pyx_n_s_channels); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 109, __pyx_L1_error)
7632 __Pyx_GOTREF(__pyx_tuple__21);
7633 __Pyx_GIVEREF(__pyx_tuple__21);
7634 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_init, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 109, __pyx_L1_error)
8892 __pyx_tuple__23 = PyTuple_Pack(3, __pyx_n_s_frequency, __pyx_n_s_format, __pyx_n_s_channels); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 109, __pyx_L1_error)
8893 __Pyx_GOTREF(__pyx_tuple__23);
8894 __Pyx_GIVEREF(__pyx_tuple__23);
8895 __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_init, 109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(1, 109, __pyx_L1_error)
76358896
76368897 /* "pygame_sdl2/mixer.pyx":119
76378898 * return frequency, format, channels
76408901 * with nogil:
76418902 * Mix_HaltChannel(-1)
76428903 */
7643 __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_stop, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 119, __pyx_L1_error)
8904 __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_stop, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(1, 119, __pyx_L1_error)
76448905
76458906 /* "pygame_sdl2/mixer.pyx":123
76468907 * Mix_HaltChannel(-1)
76498910 * with nogil:
76508911 * Mix_Pause(-1)
76518912 */
7652 __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_pause, 123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 123, __pyx_L1_error)
8913 __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_pause, 123, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(1, 123, __pyx_L1_error)
76538914
76548915 /* "pygame_sdl2/mixer.pyx":127
76558916 * Mix_Pause(-1)
76588919 * with nogil:
76598920 * Mix_Resume(-1)
76608921 */
7661 __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_unpause, 127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 127, __pyx_L1_error)
8922 __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_unpause, 127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(1, 127, __pyx_L1_error)
76628923
76638924 /* "pygame_sdl2/mixer.pyx":131
76648925 * Mix_Resume(-1)
76678928 * cdef int ms = time
76688929 * with nogil:
76698930 */
7670 __pyx_tuple__26 = PyTuple_Pack(2, __pyx_n_s_time, __pyx_n_s_ms); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 131, __pyx_L1_error)
7671 __Pyx_GOTREF(__pyx_tuple__26);
7672 __Pyx_GIVEREF(__pyx_tuple__26);
7673 __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_fadeout, 131, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 131, __pyx_L1_error)
8931 __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_time, __pyx_n_s_ms); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 131, __pyx_L1_error)
8932 __Pyx_GOTREF(__pyx_tuple__28);
8933 __Pyx_GIVEREF(__pyx_tuple__28);
8934 __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_fadeout, 131, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(1, 131, __pyx_L1_error)
76748935
76758936 /* "pygame_sdl2/mixer.pyx":136
76768937 * Mix_FadeOutChannel(-1, ms)
76798940 * Mix_AllocateChannels(count)
76808941 *
76818942 */
7682 __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_count); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 136, __pyx_L1_error)
7683 __Pyx_GOTREF(__pyx_tuple__28);
7684 __Pyx_GIVEREF(__pyx_tuple__28);
7685 __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_set_num_channels, 136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 136, __pyx_L1_error)
8943 __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_count); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 136, __pyx_L1_error)
8944 __Pyx_GOTREF(__pyx_tuple__30);
8945 __Pyx_GIVEREF(__pyx_tuple__30);
8946 __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_set_num_channels, 136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(1, 136, __pyx_L1_error)
76868947
76878948 /* "pygame_sdl2/mixer.pyx":139
76888949 * Mix_AllocateChannels(count)
76918952 * return Mix_AllocateChannels(-1)
76928953 *
76938954 */
7694 __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_num_channels, 139, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 139, __pyx_L1_error)
8955 __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_num_channels, 139, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(1, 139, __pyx_L1_error)
76958956
76968957 /* "pygame_sdl2/mixer.pyx":142
76978958 * return Mix_AllocateChannels(-1)
77008961 * Mix_ReserveChannels(count)
77018962 *
77028963 */
7703 __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_count); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 142, __pyx_L1_error)
7704 __Pyx_GOTREF(__pyx_tuple__31);
7705 __Pyx_GIVEREF(__pyx_tuple__31);
7706 __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_set_reserved, 142, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 142, __pyx_L1_error)
8964 __pyx_tuple__33 = PyTuple_Pack(1, __pyx_n_s_count); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 142, __pyx_L1_error)
8965 __Pyx_GOTREF(__pyx_tuple__33);
8966 __Pyx_GIVEREF(__pyx_tuple__33);
8967 __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_set_reserved, 142, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(1, 142, __pyx_L1_error)
77078968
77088969 /* "pygame_sdl2/mixer.pyx":145
77098970 * Mix_ReserveChannels(count)
77128973 * cdef int chan
77138974 * chan = Mix_GroupAvailable(-1)
77148975 */
7715 __pyx_tuple__33 = PyTuple_Pack(2, __pyx_n_s_force, __pyx_n_s_chan); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 145, __pyx_L1_error)
7716 __Pyx_GOTREF(__pyx_tuple__33);
7717 __Pyx_GIVEREF(__pyx_tuple__33);
7718 __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_find_channel, 145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 145, __pyx_L1_error)
8976 __pyx_tuple__35 = PyTuple_Pack(2, __pyx_n_s_force, __pyx_n_s_chan); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 145, __pyx_L1_error)
8977 __Pyx_GOTREF(__pyx_tuple__35);
8978 __Pyx_GIVEREF(__pyx_tuple__35);
8979 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_find_channel, 145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(1, 145, __pyx_L1_error)
77198980
77208981 /* "pygame_sdl2/mixer.pyx":156
77218982 * return Channel(chan)
77248985 * return Mix_GroupNewer(-1) != -1
77258986 *
77268987 */
7727 __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_busy, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 156, __pyx_L1_error)
8988 __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_pyx, __pyx_n_s_get_busy, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(1, 156, __pyx_L1_error)
8989
8990 /* "(tree fragment)":1
8991 * def __pyx_unpickle_Channel(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
8992 * if __pyx_checksum != 0x4b7cc56:
8993 * from pickle import PickleError as __pyx_PickleError
8994 */
8995 __pyx_tuple__38 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 1, __pyx_L1_error)
8996 __Pyx_GOTREF(__pyx_tuple__38);
8997 __Pyx_GIVEREF(__pyx_tuple__38);
8998 __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Channel, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 1, __pyx_L1_error)
77288999 __Pyx_RefNannyFinishContext();
77299000 return 0;
77309001 __pyx_L1_error:;
77339004 }
77349005
77359006 static int __Pyx_InitGlobals(void) {
7736 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
7737 __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
7738 __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
7739 __pyx_int_4096 = PyInt_FromLong(4096); if (unlikely(!__pyx_int_4096)) __PYX_ERR(0, 1, __pyx_L1_error)
7740 __pyx_int_22050 = PyInt_FromLong(22050L); if (unlikely(!__pyx_int_22050)) __PYX_ERR(0, 1, __pyx_L1_error)
7741 __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
9007 __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
9008 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
9009 __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error)
9010 __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(1, 1, __pyx_L1_error)
9011 __pyx_int_4096 = PyInt_FromLong(4096); if (unlikely(!__pyx_int_4096)) __PYX_ERR(1, 1, __pyx_L1_error)
9012 __pyx_int_22050 = PyInt_FromLong(22050L); if (unlikely(!__pyx_int_22050)) __PYX_ERR(1, 1, __pyx_L1_error)
9013 __pyx_int_79154262 = PyInt_FromLong(79154262L); if (unlikely(!__pyx_int_79154262)) __PYX_ERR(1, 1, __pyx_L1_error)
9014 __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(1, 1, __pyx_L1_error)
77429015 return 0;
77439016 __pyx_L1_error:;
77449017 return -1;
77459018 }
77469019
9020 static int __Pyx_modinit_global_init_code(void); /*proto*/
9021 static int __Pyx_modinit_variable_export_code(void); /*proto*/
9022 static int __Pyx_modinit_function_export_code(void); /*proto*/
9023 static int __Pyx_modinit_type_init_code(void); /*proto*/
9024 static int __Pyx_modinit_type_import_code(void); /*proto*/
9025 static int __Pyx_modinit_variable_import_code(void); /*proto*/
9026 static int __Pyx_modinit_function_import_code(void); /*proto*/
9027
9028 static int __Pyx_modinit_global_init_code(void) {
9029 __Pyx_RefNannyDeclarations
9030 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
9031 /*--- Global init code ---*/
9032 __pyx_v_11pygame_sdl2_5mixer_preinit_args = Py_None; Py_INCREF(Py_None);
9033 __pyx_v_11pygame_sdl2_5mixer_output_spec = Py_None; Py_INCREF(Py_None);
9034 __pyx_v_11pygame_sdl2_5mixer_channel_events = ((PyObject*)Py_None); Py_INCREF(Py_None);
9035 __pyx_v_11pygame_sdl2_5mixer_channel_queued = ((PyObject*)Py_None); Py_INCREF(Py_None);
9036 __pyx_v_11pygame_sdl2_5mixer_current_sounds = ((PyObject*)Py_None); Py_INCREF(Py_None);
9037 __Pyx_RefNannyFinishContext();
9038 return 0;
9039 }
9040
9041 static int __Pyx_modinit_variable_export_code(void) {
9042 __Pyx_RefNannyDeclarations
9043 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
9044 /*--- Variable export code ---*/
9045 __Pyx_RefNannyFinishContext();
9046 return 0;
9047 }
9048
9049 static int __Pyx_modinit_function_export_code(void) {
9050 __Pyx_RefNannyDeclarations
9051 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
9052 /*--- Function export code ---*/
9053 __Pyx_RefNannyFinishContext();
9054 return 0;
9055 }
9056
9057 static int __Pyx_modinit_type_init_code(void) {
9058 __Pyx_RefNannyDeclarations
9059 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
9060 /*--- Type init code ---*/
9061 if (PyType_Ready(&__pyx_type_11pygame_sdl2_5mixer_Sound) < 0) __PYX_ERR(1, 160, __pyx_L1_error)
9062 __pyx_type_11pygame_sdl2_5mixer_Sound.tp_print = 0;
9063 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11pygame_sdl2_5mixer_Sound.tp_dictoffset && __pyx_type_11pygame_sdl2_5mixer_Sound.tp_getattro == PyObject_GenericGetAttr)) {
9064 __pyx_type_11pygame_sdl2_5mixer_Sound.tp_getattro = __Pyx_PyObject_GenericGetAttr;
9065 }
9066 if (PyObject_SetAttrString(__pyx_m, "Sound", (PyObject *)&__pyx_type_11pygame_sdl2_5mixer_Sound) < 0) __PYX_ERR(1, 160, __pyx_L1_error)
9067 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11pygame_sdl2_5mixer_Sound) < 0) __PYX_ERR(1, 160, __pyx_L1_error)
9068 __pyx_ptype_11pygame_sdl2_5mixer_Sound = &__pyx_type_11pygame_sdl2_5mixer_Sound;
9069 if (PyType_Ready(&__pyx_type_11pygame_sdl2_5mixer_Channel) < 0) __PYX_ERR(1, 248, __pyx_L1_error)
9070 __pyx_type_11pygame_sdl2_5mixer_Channel.tp_print = 0;
9071 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11pygame_sdl2_5mixer_Channel.tp_dictoffset && __pyx_type_11pygame_sdl2_5mixer_Channel.tp_getattro == PyObject_GenericGetAttr)) {
9072 __pyx_type_11pygame_sdl2_5mixer_Channel.tp_getattro = __Pyx_PyObject_GenericGetAttr;
9073 }
9074 if (PyObject_SetAttrString(__pyx_m, "Channel", (PyObject *)&__pyx_type_11pygame_sdl2_5mixer_Channel) < 0) __PYX_ERR(1, 248, __pyx_L1_error)
9075 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11pygame_sdl2_5mixer_Channel) < 0) __PYX_ERR(1, 248, __pyx_L1_error)
9076 __pyx_ptype_11pygame_sdl2_5mixer_Channel = &__pyx_type_11pygame_sdl2_5mixer_Channel;
9077 __Pyx_RefNannyFinishContext();
9078 return 0;
9079 __pyx_L1_error:;
9080 __Pyx_RefNannyFinishContext();
9081 return -1;
9082 }
9083
9084 static int __Pyx_modinit_type_import_code(void) {
9085 __Pyx_RefNannyDeclarations
9086 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
9087 /*--- Type import code ---*/
9088 __Pyx_RefNannyFinishContext();
9089 return 0;
9090 }
9091
9092 static int __Pyx_modinit_variable_import_code(void) {
9093 __Pyx_RefNannyDeclarations
9094 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
9095 /*--- Variable import code ---*/
9096 __Pyx_RefNannyFinishContext();
9097 return 0;
9098 }
9099
9100 static int __Pyx_modinit_function_import_code(void) {
9101 __Pyx_RefNannyDeclarations
9102 PyObject *__pyx_t_1 = NULL;
9103 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
9104 /*--- Function import code ---*/
9105 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error)
9106 if (__Pyx_ImportFunction(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9107 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9108 __Pyx_RefNannyFinishContext();
9109 return 0;
9110 __pyx_L1_error:;
9111 __Pyx_XDECREF(__pyx_t_1);
9112 __Pyx_RefNannyFinishContext();
9113 return -1;
9114 }
9115
9116
77479117 #if PY_MAJOR_VERSION < 3
7748 PyMODINIT_FUNC initmixer(void); /*proto*/
7749 PyMODINIT_FUNC initmixer(void)
9118 #ifdef CYTHON_NO_PYINIT_EXPORT
9119 #define __Pyx_PyMODINIT_FUNC void
77509120 #else
7751 PyMODINIT_FUNC PyInit_mixer(void); /*proto*/
7752 PyMODINIT_FUNC PyInit_mixer(void)
9121 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
9122 #endif
9123 #else
9124 #ifdef CYTHON_NO_PYINIT_EXPORT
9125 #define __Pyx_PyMODINIT_FUNC PyObject *
9126 #else
9127 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
9128 #endif
9129 #endif
9130 #ifndef CYTHON_SMALL_CODE
9131 #if defined(__clang__)
9132 #define CYTHON_SMALL_CODE
9133 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
9134 #define CYTHON_SMALL_CODE __attribute__((cold))
9135 #else
9136 #define CYTHON_SMALL_CODE
9137 #endif
9138 #endif
9139
9140
9141 #if PY_MAJOR_VERSION < 3
9142 __Pyx_PyMODINIT_FUNC initmixer(void) CYTHON_SMALL_CODE; /*proto*/
9143 __Pyx_PyMODINIT_FUNC initmixer(void)
9144 #else
9145 __Pyx_PyMODINIT_FUNC PyInit_mixer(void) CYTHON_SMALL_CODE; /*proto*/
9146 __Pyx_PyMODINIT_FUNC PyInit_mixer(void)
9147 #if CYTHON_PEP489_MULTI_PHASE_INIT
9148 {
9149 return PyModuleDef_Init(&__pyx_moduledef);
9150 }
9151 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
9152 PyObject *value = PyObject_GetAttrString(spec, from_name);
9153 int result = 0;
9154 if (likely(value)) {
9155 result = PyDict_SetItemString(moddict, to_name, value);
9156 Py_DECREF(value);
9157 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
9158 PyErr_Clear();
9159 } else {
9160 result = -1;
9161 }
9162 return result;
9163 }
9164 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
9165 PyObject *module = NULL, *moddict, *modname;
9166 if (__pyx_m)
9167 return __Pyx_NewRef(__pyx_m);
9168 modname = PyObject_GetAttrString(spec, "name");
9169 if (unlikely(!modname)) goto bad;
9170 module = PyModule_NewObject(modname);
9171 Py_DECREF(modname);
9172 if (unlikely(!module)) goto bad;
9173 moddict = PyModule_GetDict(module);
9174 if (unlikely(!moddict)) goto bad;
9175 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
9176 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
9177 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
9178 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
9179 return module;
9180 bad:
9181 Py_XDECREF(module);
9182 return NULL;
9183 }
9184
9185
9186 static int __pyx_pymod_exec_mixer(PyObject *__pyx_pyinit_module)
9187 #endif
77539188 #endif
77549189 {
77559190 PyObject *__pyx_t_1 = NULL;
77569191 PyObject *__pyx_t_2 = NULL;
77579192 PyObject *__pyx_t_3 = NULL;
7758 PyObject *__pyx_t_4 = NULL;
7759 PyObject *__pyx_t_5 = NULL;
7760 PyObject *__pyx_t_6 = NULL;
77619193 __Pyx_RefNannyDeclarations
9194 #if CYTHON_PEP489_MULTI_PHASE_INIT
9195 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
9196 #elif PY_MAJOR_VERSION >= 3
9197 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
9198 #endif
77629199 #if CYTHON_REFNANNY
7763 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
7764 if (!__Pyx_RefNanny) {
7765 PyErr_Clear();
7766 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
7767 if (!__Pyx_RefNanny)
7768 Py_FatalError("failed to import 'refnanny' module");
7769 }
7770 #endif
7771 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_mixer(void)", 0);
7772 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7773 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
7774 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
7775 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
9200 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
9201 if (!__Pyx_RefNanny) {
9202 PyErr_Clear();
9203 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
9204 if (!__Pyx_RefNanny)
9205 Py_FatalError("failed to import 'refnanny' module");
9206 }
9207 #endif
9208 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_mixer(void)", 0);
9209 if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9210 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error)
9211 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error)
9212 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error)
77769213 #ifdef __Pyx_CyFunction_USED
7777 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9214 if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
77789215 #endif
77799216 #ifdef __Pyx_FusedFunction_USED
7780 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9217 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
77819218 #endif
77829219 #ifdef __Pyx_Coroutine_USED
7783 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9220 if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
77849221 #endif
77859222 #ifdef __Pyx_Generator_USED
7786 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9223 if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9224 #endif
9225 #ifdef __Pyx_AsyncGen_USED
9226 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
77879227 #endif
77889228 #ifdef __Pyx_StopAsyncIteration_USED
7789 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9229 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
77909230 #endif
77919231 /*--- Library function declarations ---*/
77929232 /*--- Threads initialization code ---*/
77969236 #endif
77979237 #endif
77989238 /*--- Module creation code ---*/
9239 #if CYTHON_PEP489_MULTI_PHASE_INIT
9240 __pyx_m = __pyx_pyinit_module;
9241 Py_INCREF(__pyx_m);
9242 #else
77999243 #if PY_MAJOR_VERSION < 3
78009244 __pyx_m = Py_InitModule4("mixer", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
78019245 #else
78029246 __pyx_m = PyModule_Create(&__pyx_moduledef);
78039247 #endif
7804 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
7805 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
9248 if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
9249 #endif
9250 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error)
78069251 Py_INCREF(__pyx_d);
7807 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
9252 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error)
9253 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error)
78089254 #if CYTHON_COMPILING_IN_PYPY
78099255 Py_INCREF(__pyx_b);
78109256 #endif
7811 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9257 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
78129258 /*--- Initialize various global constants etc. ---*/
7813 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9259 if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
78149260 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
7815 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9261 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
78169262 #endif
78179263 if (__pyx_module_is_main_pygame_sdl2__mixer) {
7818 if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9264 if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
78199265 }
78209266 #if PY_MAJOR_VERSION >= 3
78219267 {
7822 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
9268 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error)
78239269 if (!PyDict_GetItemString(modules, "pygame_sdl2.mixer")) {
7824 if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.mixer", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
9270 if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.mixer", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
78259271 }
78269272 }
78279273 #endif
78289274 /*--- Builtin init code ---*/
7829 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9275 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
78309276 /*--- Constants init code ---*/
7831 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7832 /*--- Global init code ---*/
7833 __pyx_v_11pygame_sdl2_5mixer_preinit_args = Py_None; Py_INCREF(Py_None);
7834 __pyx_v_11pygame_sdl2_5mixer_output_spec = Py_None; Py_INCREF(Py_None);
7835 __pyx_v_11pygame_sdl2_5mixer_channel_events = ((PyObject*)Py_None); Py_INCREF(Py_None);
7836 __pyx_v_11pygame_sdl2_5mixer_channel_queued = ((PyObject*)Py_None); Py_INCREF(Py_None);
7837 __pyx_v_11pygame_sdl2_5mixer_current_sounds = ((PyObject*)Py_None); Py_INCREF(Py_None);
7838 /*--- Variable export code ---*/
7839 /*--- Function export code ---*/
7840 /*--- Type init code ---*/
7841 if (PyType_Ready(&__pyx_type_11pygame_sdl2_5mixer_Sound) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
7842 __pyx_type_11pygame_sdl2_5mixer_Sound.tp_print = 0;
7843 if (PyObject_SetAttrString(__pyx_m, "Sound", (PyObject *)&__pyx_type_11pygame_sdl2_5mixer_Sound) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
7844 __pyx_ptype_11pygame_sdl2_5mixer_Sound = &__pyx_type_11pygame_sdl2_5mixer_Sound;
7845 if (PyType_Ready(&__pyx_type_11pygame_sdl2_5mixer_Channel) < 0) __PYX_ERR(0, 248, __pyx_L1_error)
7846 __pyx_type_11pygame_sdl2_5mixer_Channel.tp_print = 0;
7847 if (PyObject_SetAttrString(__pyx_m, "Channel", (PyObject *)&__pyx_type_11pygame_sdl2_5mixer_Channel) < 0) __PYX_ERR(0, 248, __pyx_L1_error)
7848 __pyx_ptype_11pygame_sdl2_5mixer_Channel = &__pyx_type_11pygame_sdl2_5mixer_Channel;
7849 /*--- Type import code ---*/
7850 /*--- Variable import code ---*/
7851 /*--- Function import code ---*/
7852 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
7853 if (__Pyx_ImportFunction(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
7854 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9277 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
9278 /*--- Global type/function init code ---*/
9279 (void)__Pyx_modinit_global_init_code();
9280 (void)__Pyx_modinit_variable_export_code();
9281 (void)__Pyx_modinit_function_export_code();
9282 if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
9283 (void)__Pyx_modinit_type_import_code();
9284 (void)__Pyx_modinit_variable_import_code();
9285 if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error;
78559286 /*--- Execution code ---*/
78569287 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
7857 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9288 if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
78589289 #endif
78599290
78609291 /* "pygame_sdl2/mixer.pyx":24
78649295 * import threading
78659296 * from pygame_sdl2.error import error
78669297 */
7867 __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
7868 __Pyx_GOTREF(__pyx_t_2);
7869 if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
7870 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9298 __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error)
9299 __Pyx_GOTREF(__pyx_t_1);
9300 if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(1, 24, __pyx_L1_error)
9301 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
78719302
78729303 /* "pygame_sdl2/mixer.pyx":25
78739304 *
78769307 * from pygame_sdl2.error import error
78779308 *
78789309 */
7879 __pyx_t_2 = __Pyx_Import(__pyx_n_s_threading, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
7880 __Pyx_GOTREF(__pyx_t_2);
7881 if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
7882 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9310 __pyx_t_1 = __Pyx_Import(__pyx_n_s_threading, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error)
9311 __Pyx_GOTREF(__pyx_t_1);
9312 if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_1) < 0) __PYX_ERR(1, 25, __pyx_L1_error)
9313 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
78839314
78849315 /* "pygame_sdl2/mixer.pyx":26
78859316 * import sys
78889319 *
78899320 * import pygame_sdl2.mixer_music as music
78909321 */
7891 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
7892 __Pyx_GOTREF(__pyx_t_2);
9322 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 26, __pyx_L1_error)
9323 __Pyx_GOTREF(__pyx_t_1);
78939324 __Pyx_INCREF(__pyx_n_s_error);
78949325 __Pyx_GIVEREF(__pyx_n_s_error);
7895 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error);
7896 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
7897 __Pyx_GOTREF(__pyx_t_3);
9326 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_error);
9327 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 26, __pyx_L1_error)
9328 __Pyx_GOTREF(__pyx_t_2);
9329 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9330 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 26, __pyx_L1_error)
9331 __Pyx_GOTREF(__pyx_t_1);
9332 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_1) < 0) __PYX_ERR(1, 26, __pyx_L1_error)
9333 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
78989334 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7899 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
7900 __Pyx_GOTREF(__pyx_t_2);
7901 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
7902 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7903 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
79049335
79059336 /* "pygame_sdl2/mixer.pyx":28
79069337 * from pygame_sdl2.error import error
79099340 * import pygame_sdl2
79109341 *
79119342 */
7912 __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
7913 __Pyx_GOTREF(__pyx_t_3);
7914 __Pyx_INCREF(__pyx_n_s__13);
7915 __Pyx_GIVEREF(__pyx_n_s__13);
7916 PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s__13);
7917 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_mixer_music, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
9343 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 28, __pyx_L1_error)
79189344 __Pyx_GOTREF(__pyx_t_2);
7919 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7920 if (PyDict_SetItem(__pyx_d, __pyx_n_s_music, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
9345 __Pyx_INCREF(__pyx_n_s__15);
9346 __Pyx_GIVEREF(__pyx_n_s__15);
9347 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s__15);
9348 __pyx_t_1 = __Pyx_Import(__pyx_n_s_pygame_sdl2_mixer_music, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error)
9349 __Pyx_GOTREF(__pyx_t_1);
79219350 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9351 if (PyDict_SetItem(__pyx_d, __pyx_n_s_music, __pyx_t_1) < 0) __PYX_ERR(1, 28, __pyx_L1_error)
9352 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
79229353
79239354 /* "pygame_sdl2/mixer.pyx":29
79249355 *
79279358 *
79289359 * cdef object preinit_args = None
79299360 */
7930 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
7931 __Pyx_GOTREF(__pyx_t_2);
7932 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
7933 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9361 __pyx_t_1 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 29, __pyx_L1_error)
9362 __Pyx_GOTREF(__pyx_t_1);
9363 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_1) < 0) __PYX_ERR(1, 29, __pyx_L1_error)
9364 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
79349365
79359366 /* "pygame_sdl2/mixer.pyx":31
79369367 * import pygame_sdl2
79639394 * cdef dict channel_queued = {}
79649395 * cdef dict current_sounds = {}
79659396 */
7966 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
7967 __Pyx_GOTREF(__pyx_t_2);
9397 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 34, __pyx_L1_error)
9398 __Pyx_GOTREF(__pyx_t_1);
79689399 __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_channel_events);
7969 __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_channel_events, ((PyObject*)__pyx_t_2));
7970 __Pyx_GIVEREF(__pyx_t_2);
7971 __pyx_t_2 = 0;
9400 __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_channel_events, ((PyObject*)__pyx_t_1));
9401 __Pyx_GIVEREF(__pyx_t_1);
9402 __pyx_t_1 = 0;
79729403
79739404 /* "pygame_sdl2/mixer.pyx":35
79749405 *
79779408 * cdef dict current_sounds = {}
79789409 *
79799410 */
7980 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
7981 __Pyx_GOTREF(__pyx_t_2);
9411 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error)
9412 __Pyx_GOTREF(__pyx_t_1);
79829413 __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_channel_queued);
7983 __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_channel_queued, ((PyObject*)__pyx_t_2));
7984 __Pyx_GIVEREF(__pyx_t_2);
7985 __pyx_t_2 = 0;
9414 __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_channel_queued, ((PyObject*)__pyx_t_1));
9415 __Pyx_GIVEREF(__pyx_t_1);
9416 __pyx_t_1 = 0;
79869417
79879418 /* "pygame_sdl2/mixer.pyx":36
79889419 * cdef dict channel_events = {}
79919422 *
79929423 * # The lock protects channel_queued and current_sounds.
79939424 */
7994 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
7995 __Pyx_GOTREF(__pyx_t_2);
9425 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 36, __pyx_L1_error)
9426 __Pyx_GOTREF(__pyx_t_1);
79969427 __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_5mixer_current_sounds);
7997 __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_current_sounds, ((PyObject*)__pyx_t_2));
7998 __Pyx_GIVEREF(__pyx_t_2);
7999 __pyx_t_2 = 0;
9428 __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_5mixer_current_sounds, ((PyObject*)__pyx_t_1));
9429 __Pyx_GIVEREF(__pyx_t_1);
9430 __pyx_t_1 = 0;
80009431
80019432 /* "pygame_sdl2/mixer.pyx":39
80029433 *
80059436 *
80069437 * def _play_current(int channel):
80079438 */
8008 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error)
8009 __Pyx_GOTREF(__pyx_t_3);
8010 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Lock); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error)
8011 __Pyx_GOTREF(__pyx_t_4);
8012 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8013 __pyx_t_3 = NULL;
8014 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
8015 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
8016 if (likely(__pyx_t_3)) {
8017 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
8018 __Pyx_INCREF(__pyx_t_3);
8019 __Pyx_INCREF(function);
8020 __Pyx_DECREF_SET(__pyx_t_4, function);
8021 }
8022 }
8023 if (__pyx_t_3) {
8024 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
8025 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8026 } else {
8027 __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
8028 }
9439 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 39, __pyx_L1_error)
9440 __Pyx_GOTREF(__pyx_t_1);
9441 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 39, __pyx_L1_error)
80299442 __Pyx_GOTREF(__pyx_t_2);
8030 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8031 if (PyDict_SetItem(__pyx_d, __pyx_n_s_lock, __pyx_t_2) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
9443 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9444 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 39, __pyx_L1_error)
9445 __Pyx_GOTREF(__pyx_t_1);
80329446 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9447 if (PyDict_SetItem(__pyx_d, __pyx_n_s_lock, __pyx_t_1) < 0) __PYX_ERR(1, 39, __pyx_L1_error)
9448 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
80339449
80349450 /* "pygame_sdl2/mixer.pyx":41
80359451 * _lock = threading.Lock()
80389454 * """
80399455 * Caled by channel_callback to play the next sound. This has to be called
80409456 */
8041 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_1_play_current, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
8042 __Pyx_GOTREF(__pyx_t_2);
8043 if (PyDict_SetItem(__pyx_d, __pyx_n_s_play_current, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
8044 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9457 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_1_play_current, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 41, __pyx_L1_error)
9458 __Pyx_GOTREF(__pyx_t_1);
9459 if (PyDict_SetItem(__pyx_d, __pyx_n_s_play_current, __pyx_t_1) < 0) __PYX_ERR(1, 41, __pyx_L1_error)
9460 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
80459461
80469462 /* "pygame_sdl2/mixer.pyx":77
80479463 *
80509466 *
80519467 * @pygame_sdl2.register_init
80529468 */
8053 __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error)
8054 __Pyx_GOTREF(__pyx_t_2);
8055 if (PyDict_SetItem(__pyx_d, __pyx_n_s_errors, __pyx_t_2) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
8056 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9469 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 77, __pyx_L1_error)
9470 __Pyx_GOTREF(__pyx_t_1);
9471 if (PyDict_SetItem(__pyx_d, __pyx_n_s_errors, __pyx_t_1) < 0) __PYX_ERR(1, 77, __pyx_L1_error)
9472 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
80579473
80589474 /* "pygame_sdl2/mixer.pyx":80
80599475 *
80629478 * if get_init() is not None:
80639479 * return
80649480 */
8065 __pyx_t_2 = __Pyx_PyInt_From_int(MIX_DEFAULT_FORMAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error)
8066 __Pyx_GOTREF(__pyx_t_2);
8067 __pyx_k__3 = __pyx_t_2;
8068 __Pyx_GIVEREF(__pyx_t_2);
8069 __pyx_t_2 = 0;
9481 __pyx_t_1 = __Pyx_PyInt_From_int(MIX_DEFAULT_FORMAT); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 80, __pyx_L1_error)
9482 __Pyx_GOTREF(__pyx_t_1);
9483 __pyx_k__3 = __pyx_t_1;
9484 __Pyx_GIVEREF(__pyx_t_1);
9485 __pyx_t_1 = 0;
80709486
80719487 /* "pygame_sdl2/mixer.pyx":79
80729488 * errors = [ ]
80759491 * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096):
80769492 * if get_init() is not None:
80779493 */
8078 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error)
8079 __Pyx_GOTREF(__pyx_t_4);
8080 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_register_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
8081 __Pyx_GOTREF(__pyx_t_3);
8082 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9494 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 79, __pyx_L1_error)
9495 __Pyx_GOTREF(__pyx_t_1);
9496 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_register_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 79, __pyx_L1_error)
9497 __Pyx_GOTREF(__pyx_t_2);
9498 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
80839499
80849500 /* "pygame_sdl2/mixer.pyx":80
80859501 *
80889504 * if get_init() is not None:
80899505 * return
80909506 */
8091 __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_3init, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error)
8092 __Pyx_GOTREF(__pyx_t_4);
8093 __pyx_t_5 = NULL;
8094 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
8095 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
8096 if (likely(__pyx_t_5)) {
8097 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8098 __Pyx_INCREF(__pyx_t_5);
8099 __Pyx_INCREF(function);
8100 __Pyx_DECREF_SET(__pyx_t_3, function);
8101 }
8102 }
8103 if (!__pyx_t_5) {
8104 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
8105 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8106 __Pyx_GOTREF(__pyx_t_2);
8107 } else {
8108 #if CYTHON_FAST_PYCALL
8109 if (PyFunction_Check(__pyx_t_3)) {
8110 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
8111 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
8112 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8113 __Pyx_GOTREF(__pyx_t_2);
8114 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8115 } else
8116 #endif
8117 #if CYTHON_FAST_PYCCALL
8118 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
8119 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
8120 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
8121 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8122 __Pyx_GOTREF(__pyx_t_2);
8123 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8124 } else
8125 #endif
8126 {
8127 __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 79, __pyx_L1_error)
8128 __Pyx_GOTREF(__pyx_t_6);
8129 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
8130 __Pyx_GIVEREF(__pyx_t_4);
8131 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
8132 __pyx_t_4 = 0;
8133 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
8134 __Pyx_GOTREF(__pyx_t_2);
8135 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8136 }
8137 }
9507 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_3init, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 80, __pyx_L1_error)
9508 __Pyx_GOTREF(__pyx_t_1);
9509
9510 /* "pygame_sdl2/mixer.pyx":79
9511 * errors = [ ]
9512 *
9513 * @pygame_sdl2.register_init # <<<<<<<<<<<<<<
9514 * def init(frequency=22050, size=MIX_DEFAULT_FORMAT, channels=2, buffer=4096):
9515 * if get_init() is not None:
9516 */
9517 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 79, __pyx_L1_error)
9518 __Pyx_GOTREF(__pyx_t_3);
9519 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9520 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9521 if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(1, 80, __pyx_L1_error)
81389522 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8139 if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
8140 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
81419523
81429524 /* "pygame_sdl2/mixer.pyx":100
81439525 * Mix_ChannelFinished(channel_callback)
81469528 * global preinit_args
81479529 * preinit_args = (frequency, size, channels, buffersize)
81489530 */
8149 __pyx_t_2 = __Pyx_PyInt_From_int(MIX_DEFAULT_FORMAT); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
8150 __Pyx_GOTREF(__pyx_t_2);
8151 __pyx_k__5 = __pyx_t_2;
8152 __Pyx_GIVEREF(__pyx_t_2);
8153 __pyx_t_2 = 0;
8154 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_5pre_init, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
8155 __Pyx_GOTREF(__pyx_t_2);
8156 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pre_init, __pyx_t_2) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
8157 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9531 __pyx_t_3 = __Pyx_PyInt_From_int(MIX_DEFAULT_FORMAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 100, __pyx_L1_error)
9532 __Pyx_GOTREF(__pyx_t_3);
9533 __pyx_k__5 = __pyx_t_3;
9534 __Pyx_GIVEREF(__pyx_t_3);
9535 __pyx_t_3 = 0;
9536 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_5pre_init, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 100, __pyx_L1_error)
9537 __Pyx_GOTREF(__pyx_t_3);
9538 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pre_init, __pyx_t_3) < 0) __PYX_ERR(1, 100, __pyx_L1_error)
9539 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
81589540
81599541 /* "pygame_sdl2/mixer.pyx":104
81609542 * preinit_args = (frequency, size, channels, buffersize)
81639545 * def quit(): # @ReservedAssignment
81649546 * Mix_CloseAudio()
81659547 */
8166 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error)
9548 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 104, __pyx_L1_error)
81679549 __Pyx_GOTREF(__pyx_t_3);
8168 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 104, __pyx_L1_error)
8169 __Pyx_GOTREF(__pyx_t_6);
9550 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 104, __pyx_L1_error)
9551 __Pyx_GOTREF(__pyx_t_1);
81709552 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
81719553
81729554 /* "pygame_sdl2/mixer.pyx":105
81769558 * Mix_CloseAudio()
81779559 * Mix_Quit()
81789560 */
8179 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_7quit, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error)
9561 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_7quit, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 105, __pyx_L1_error)
81809562 __Pyx_GOTREF(__pyx_t_3);
8181 __pyx_t_4 = NULL;
8182 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
8183 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
8184 if (likely(__pyx_t_4)) {
8185 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
8186 __Pyx_INCREF(__pyx_t_4);
8187 __Pyx_INCREF(function);
8188 __Pyx_DECREF_SET(__pyx_t_6, function);
8189 }
8190 }
8191 if (!__pyx_t_4) {
8192 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
8193 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8194 __Pyx_GOTREF(__pyx_t_2);
8195 } else {
8196 #if CYTHON_FAST_PYCALL
8197 if (PyFunction_Check(__pyx_t_6)) {
8198 PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
8199 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
8200 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8201 __Pyx_GOTREF(__pyx_t_2);
8202 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8203 } else
8204 #endif
8205 #if CYTHON_FAST_PYCCALL
8206 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
8207 PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
8208 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
8209 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8210 __Pyx_GOTREF(__pyx_t_2);
8211 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8212 } else
8213 #endif
8214 {
8215 __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error)
8216 __Pyx_GOTREF(__pyx_t_5);
8217 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
8218 __Pyx_GIVEREF(__pyx_t_3);
8219 PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
8220 __pyx_t_3 = 0;
8221 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 104, __pyx_L1_error)
8222 __Pyx_GOTREF(__pyx_t_2);
8223 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8224 }
8225 }
8226 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8227 if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
9563
9564 /* "pygame_sdl2/mixer.pyx":104
9565 * preinit_args = (frequency, size, channels, buffersize)
9566 *
9567 * @pygame_sdl2.register_quit # <<<<<<<<<<<<<<
9568 * def quit(): # @ReservedAssignment
9569 * Mix_CloseAudio()
9570 */
9571 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 104, __pyx_L1_error)
9572 __Pyx_GOTREF(__pyx_t_2);
9573 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9574 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9575 if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
82289576 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
82299577
82309578 /* "pygame_sdl2/mixer.pyx":109
82349582 * cdef int frequency
82359583 * cdef Uint16 format
82369584 */
8237 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_9get_init, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
9585 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_9get_init, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 109, __pyx_L1_error)
82389586 __Pyx_GOTREF(__pyx_t_2);
8239 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_2) < 0) __PYX_ERR(0, 109, __pyx_L1_error)
9587 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init, __pyx_t_2) < 0) __PYX_ERR(1, 109, __pyx_L1_error)
82409588 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
82419589
82429590 /* "pygame_sdl2/mixer.pyx":119
82469594 * with nogil:
82479595 * Mix_HaltChannel(-1)
82489596 */
8249 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_11stop, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
9597 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_11stop, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 119, __pyx_L1_error)
82509598 __Pyx_GOTREF(__pyx_t_2);
8251 if (PyDict_SetItem(__pyx_d, __pyx_n_s_stop, __pyx_t_2) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
9599 if (PyDict_SetItem(__pyx_d, __pyx_n_s_stop, __pyx_t_2) < 0) __PYX_ERR(1, 119, __pyx_L1_error)
82529600 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
82539601
82549602 /* "pygame_sdl2/mixer.pyx":123
82589606 * with nogil:
82599607 * Mix_Pause(-1)
82609608 */
8261 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_13pause, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
9609 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_13pause, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 123, __pyx_L1_error)
82629610 __Pyx_GOTREF(__pyx_t_2);
8263 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pause, __pyx_t_2) < 0) __PYX_ERR(0, 123, __pyx_L1_error)
9611 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pause, __pyx_t_2) < 0) __PYX_ERR(1, 123, __pyx_L1_error)
82649612 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
82659613
82669614 /* "pygame_sdl2/mixer.pyx":127
82709618 * with nogil:
82719619 * Mix_Resume(-1)
82729620 */
8273 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_15unpause, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error)
9621 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_15unpause, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 127, __pyx_L1_error)
82749622 __Pyx_GOTREF(__pyx_t_2);
8275 if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpause, __pyx_t_2) < 0) __PYX_ERR(0, 127, __pyx_L1_error)
9623 if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpause, __pyx_t_2) < 0) __PYX_ERR(1, 127, __pyx_L1_error)
82769624 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
82779625
82789626 /* "pygame_sdl2/mixer.pyx":131
82829630 * cdef int ms = time
82839631 * with nogil:
82849632 */
8285 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_17fadeout, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error)
9633 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_17fadeout, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 131, __pyx_L1_error)
82869634 __Pyx_GOTREF(__pyx_t_2);
8287 if (PyDict_SetItem(__pyx_d, __pyx_n_s_fadeout, __pyx_t_2) < 0) __PYX_ERR(0, 131, __pyx_L1_error)
9635 if (PyDict_SetItem(__pyx_d, __pyx_n_s_fadeout, __pyx_t_2) < 0) __PYX_ERR(1, 131, __pyx_L1_error)
82889636 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
82899637
82909638 /* "pygame_sdl2/mixer.pyx":136
82949642 * Mix_AllocateChannels(count)
82959643 *
82969644 */
8297 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_19set_num_channels, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error)
9645 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_19set_num_channels, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 136, __pyx_L1_error)
82989646 __Pyx_GOTREF(__pyx_t_2);
8299 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_num_channels, __pyx_t_2) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
9647 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_num_channels, __pyx_t_2) < 0) __PYX_ERR(1, 136, __pyx_L1_error)
83009648 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
83019649
83029650 /* "pygame_sdl2/mixer.pyx":139
83069654 * return Mix_AllocateChannels(-1)
83079655 *
83089656 */
8309 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_21get_num_channels, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
9657 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_21get_num_channels, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 139, __pyx_L1_error)
83109658 __Pyx_GOTREF(__pyx_t_2);
8311 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_channels, __pyx_t_2) < 0) __PYX_ERR(0, 139, __pyx_L1_error)
9659 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_num_channels, __pyx_t_2) < 0) __PYX_ERR(1, 139, __pyx_L1_error)
83129660 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
83139661
83149662 /* "pygame_sdl2/mixer.pyx":142
83189666 * Mix_ReserveChannels(count)
83199667 *
83209668 */
8321 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_23set_reserved, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error)
9669 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_23set_reserved, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 142, __pyx_L1_error)
83229670 __Pyx_GOTREF(__pyx_t_2);
8323 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_reserved, __pyx_t_2) < 0) __PYX_ERR(0, 142, __pyx_L1_error)
9671 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_reserved, __pyx_t_2) < 0) __PYX_ERR(1, 142, __pyx_L1_error)
83249672 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
83259673
83269674 /* "pygame_sdl2/mixer.pyx":145
83309678 * cdef int chan
83319679 * chan = Mix_GroupAvailable(-1)
83329680 */
8333 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_25find_channel, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
9681 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_25find_channel, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 145, __pyx_L1_error)
83349682 __Pyx_GOTREF(__pyx_t_2);
8335 if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_channel, __pyx_t_2) < 0) __PYX_ERR(0, 145, __pyx_L1_error)
9683 if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_channel, __pyx_t_2) < 0) __PYX_ERR(1, 145, __pyx_L1_error)
83369684 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
83379685
83389686 /* "pygame_sdl2/mixer.pyx":156
83429690 * return Mix_GroupNewer(-1) != -1
83439691 *
83449692 */
8345 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_27get_busy, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
9693 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_27get_busy, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 156, __pyx_L1_error)
83469694 __Pyx_GOTREF(__pyx_t_2);
8347 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_busy, __pyx_t_2) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
9695 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_busy, __pyx_t_2) < 0) __PYX_ERR(1, 156, __pyx_L1_error)
9696 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9697
9698 /* "(tree fragment)":1
9699 * def __pyx_unpickle_Channel(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
9700 * if __pyx_checksum != 0x4b7cc56:
9701 * from pickle import PickleError as __pyx_PickleError
9702 */
9703 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5mixer_29__pyx_unpickle_Channel, NULL, __pyx_n_s_pygame_sdl2_mixer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
9704 __Pyx_GOTREF(__pyx_t_2);
9705 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Channel, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
83489706 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
83499707
83509708 /* "pygame_sdl2/mixer.pyx":1
83529710 * #
83539711 * # This software is provided 'as-is', without any express or implied
83549712 */
8355 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
9713 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
83569714 __Pyx_GOTREF(__pyx_t_2);
8357 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9715 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
83589716 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
83599717
83609718 /*--- Wrapped vars code ---*/
83649722 __Pyx_XDECREF(__pyx_t_1);
83659723 __Pyx_XDECREF(__pyx_t_2);
83669724 __Pyx_XDECREF(__pyx_t_3);
8367 __Pyx_XDECREF(__pyx_t_4);
8368 __Pyx_XDECREF(__pyx_t_5);
8369 __Pyx_XDECREF(__pyx_t_6);
83709725 if (__pyx_m) {
83719726 if (__pyx_d) {
8372 __Pyx_AddTraceback("init pygame_sdl2.mixer", __pyx_clineno, __pyx_lineno, __pyx_filename);
9727 __Pyx_AddTraceback("init pygame_sdl2.mixer", 0, __pyx_lineno, __pyx_filename);
83739728 }
83749729 Py_DECREF(__pyx_m); __pyx_m = 0;
83759730 } else if (!PyErr_Occurred()) {
83779732 }
83789733 __pyx_L0:;
83799734 __Pyx_RefNannyFinishContext();
8380 #if PY_MAJOR_VERSION < 3
9735 #if CYTHON_PEP489_MULTI_PHASE_INIT
9736 return (__pyx_m != NULL) ? 0 : -1;
9737 #elif PY_MAJOR_VERSION >= 3
9738 return __pyx_m;
9739 #else
83819740 return;
8382 #else
8383 return __pyx_m;
83849741 #endif
83859742 }
83869743
84029759 }
84039760 #endif
84049761
9762 /* PyObjectGetAttrStr */
9763 #if CYTHON_USE_TYPE_SLOTS
9764 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
9765 PyTypeObject* tp = Py_TYPE(obj);
9766 if (likely(tp->tp_getattro))
9767 return tp->tp_getattro(obj, attr_name);
9768 #if PY_MAJOR_VERSION < 3
9769 if (likely(tp->tp_getattr))
9770 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
9771 #endif
9772 return PyObject_GetAttr(obj, attr_name);
9773 }
9774 #endif
9775
84059776 /* GetBuiltinName */
84069777 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
84079778 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
84209791 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
84219792 PyObject *result;
84229793 #if !CYTHON_AVOID_BORROWED_REFS
9794 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
9795 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
9796 if (likely(result)) {
9797 Py_INCREF(result);
9798 } else if (unlikely(PyErr_Occurred())) {
9799 result = NULL;
9800 } else {
9801 #else
84239802 result = PyDict_GetItem(__pyx_d, name);
84249803 if (likely(result)) {
84259804 Py_INCREF(result);
84269805 } else {
9806 #endif
84279807 #else
84289808 result = PyObject_GetItem(__pyx_d, name);
84299809 if (!result) {
84359815 }
84369816
84379817 /* PyCFunctionFastCall */
8438 #if CYTHON_FAST_PYCCALL
9818 #if CYTHON_FAST_PYCCALL
84399819 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
84409820 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
84419821 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
84429822 PyObject *self = PyCFunction_GET_SELF(func);
9823 int flags = PyCFunction_GET_FLAGS(func);
84439824 assert(PyCFunction_Check(func));
8444 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
9825 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
84459826 assert(nargs >= 0);
84469827 assert(nargs == 0 || args != NULL);
84479828 /* _PyCFunction_FastCallDict() must not be called with an exception set,
84489829 because it may clear it (directly or indirectly) and so the
84499830 caller loses its exception */
84509831 assert(!PyErr_Occurred());
8451 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
8452 }
8453 #endif // CYTHON_FAST_PYCCALL
9832 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
9833 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
9834 } else {
9835 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
9836 }
9837 }
9838 #endif
84549839
84559840 /* PyFunctionFastCall */
8456 #if CYTHON_FAST_PYCALL
9841 #if CYTHON_FAST_PYCALL
84579842 #include "frameobject.h"
84589843 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
84599844 PyObject *globals) {
84609845 PyFrameObject *f;
8461 PyThreadState *tstate = PyThreadState_GET();
9846 PyThreadState *tstate = __Pyx_PyThreadState_Current;
84629847 PyObject **fastlocals;
84639848 Py_ssize_t i;
84649849 PyObject *result;
85699954 Py_LeaveRecursiveCall();
85709955 return result;
85719956 }
8572 #endif // CPython < 3.6
8573 #endif // CYTHON_FAST_PYCALL
9957 #endif
9958 #endif
85749959
85759960 /* PyObjectCall */
8576 #if CYTHON_COMPILING_IN_CPYTHON
9961 #if CYTHON_COMPILING_IN_CPYTHON
85779962 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
85789963 PyObject *result;
85799964 ternaryfunc call = func->ob_type->tp_call;
85939978 #endif
85949979
85959980 /* PyObjectCallMethO */
8596 #if CYTHON_COMPILING_IN_CPYTHON
9981 #if CYTHON_COMPILING_IN_CPYTHON
85979982 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
85989983 PyObject *self, *result;
85999984 PyCFunction cfunc;
86139998 #endif
86149999
861510000 /* PyObjectCallOneArg */
8616 #if CYTHON_COMPILING_IN_CPYTHON
10001 #if CYTHON_COMPILING_IN_CPYTHON
861710002 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
861810003 PyObject *result;
861910004 PyObject *args = PyTuple_New(1);
863010015 return __Pyx_PyFunction_FastCall(func, &arg, 1);
863110016 }
863210017 #endif
8633 #ifdef __Pyx_CyFunction_USED
8634 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
8635 #else
863610018 if (likely(PyCFunction_Check(func))) {
8637 #endif
863810019 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
863910020 return __Pyx_PyObject_CallMethO(func, arg);
864010021 #if CYTHON_FAST_PYCCALL
866510046 }
866610047 #endif
866710048 #ifdef __Pyx_CyFunction_USED
8668 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
10049 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
866910050 #else
867010051 if (likely(PyCFunction_Check(func))) {
867110052 #endif
867410055 }
867510056 }
867610057 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
10058 }
10059 #endif
10060
10061 /* DictGetItem */
10062 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
10063 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
10064 PyObject *value;
10065 value = PyDict_GetItemWithError(d, key);
10066 if (unlikely(!value)) {
10067 if (!PyErr_Occurred()) {
10068 PyObject* args = PyTuple_Pack(1, key);
10069 if (likely(args))
10070 PyErr_SetObject(PyExc_KeyError, args);
10071 Py_XDECREF(args);
10072 }
10073 return NULL;
10074 }
10075 Py_INCREF(value);
10076 return value;
867710077 }
867810078 #endif
867910079
868310083 PyErr_SetString(PyExc_SystemError, "Missing type object");
868410084 return 0;
868510085 }
8686 if (likely(PyObject_TypeCheck(obj, type)))
10086 if (likely(__Pyx_TypeCheck(obj, type)))
868710087 return 1;
868810088 PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
868910089 Py_TYPE(obj)->tp_name, type->tp_name);
869310093 /* SaveResetException */
869410094 #if CYTHON_FAST_THREAD_STATE
869510095 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
10096 #if PY_VERSION_HEX >= 0x030700A3
10097 *type = tstate->exc_state.exc_type;
10098 *value = tstate->exc_state.exc_value;
10099 *tb = tstate->exc_state.exc_traceback;
10100 #else
869610101 *type = tstate->exc_type;
869710102 *value = tstate->exc_value;
869810103 *tb = tstate->exc_traceback;
10104 #endif
869910105 Py_XINCREF(*type);
870010106 Py_XINCREF(*value);
870110107 Py_XINCREF(*tb);
870210108 }
870310109 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
870410110 PyObject *tmp_type, *tmp_value, *tmp_tb;
10111 #if PY_VERSION_HEX >= 0x030700A3
10112 tmp_type = tstate->exc_state.exc_type;
10113 tmp_value = tstate->exc_state.exc_value;
10114 tmp_tb = tstate->exc_state.exc_traceback;
10115 tstate->exc_state.exc_type = type;
10116 tstate->exc_state.exc_value = value;
10117 tstate->exc_state.exc_traceback = tb;
10118 #else
870510119 tmp_type = tstate->exc_type;
870610120 tmp_value = tstate->exc_value;
870710121 tmp_tb = tstate->exc_traceback;
870810122 tstate->exc_type = type;
870910123 tstate->exc_value = value;
871010124 tstate->exc_traceback = tb;
10125 #endif
871110126 Py_XDECREF(tmp_type);
871210127 Py_XDECREF(tmp_value);
871310128 Py_XDECREF(tmp_tb);
875210167 *value = local_value;
875310168 *tb = local_tb;
875410169 #if CYTHON_FAST_THREAD_STATE
10170 #if PY_VERSION_HEX >= 0x030700A3
10171 tmp_type = tstate->exc_state.exc_type;
10172 tmp_value = tstate->exc_state.exc_value;
10173 tmp_tb = tstate->exc_state.exc_traceback;
10174 tstate->exc_state.exc_type = local_type;
10175 tstate->exc_state.exc_value = local_value;
10176 tstate->exc_state.exc_traceback = local_tb;
10177 #else
875510178 tmp_type = tstate->exc_type;
875610179 tmp_value = tstate->exc_value;
875710180 tmp_tb = tstate->exc_traceback;
875810181 tstate->exc_type = local_type;
875910182 tstate->exc_value = local_value;
876010183 tstate->exc_traceback = local_tb;
10184 #endif
876110185 Py_XDECREF(tmp_type);
876210186 Py_XDECREF(tmp_value);
876310187 Py_XDECREF(tmp_tb);
880410228 PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
880510229 }
880610230
10231 /* UnpackUnboundCMethod */
10232 static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
10233 PyObject *method;
10234 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
10235 if (unlikely(!method))
10236 return -1;
10237 target->method = method;
10238 #if CYTHON_COMPILING_IN_CPYTHON
10239 #if PY_MAJOR_VERSION >= 3
10240 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
10241 #endif
10242 {
10243 PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
10244 target->func = descr->d_method->ml_meth;
10245 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
10246 }
10247 #endif
10248 return 0;
10249 }
10250
10251 /* CallUnboundCMethod1 */
10252 #if CYTHON_COMPILING_IN_CPYTHON
10253 static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
10254 if (likely(cfunc->func)) {
10255 int flag = cfunc->flag;
10256 if (flag == METH_O) {
10257 return (*(cfunc->func))(self, arg);
10258 } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) {
10259 if (PY_VERSION_HEX >= 0x030700A0) {
10260 return (*(__Pyx_PyCFunctionFast)cfunc->func)(self, &arg, 1);
10261 } else {
10262 return (*(__Pyx_PyCFunctionFastWithKeywords)cfunc->func)(self, &arg, 1, NULL);
10263 }
10264 } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) {
10265 return (*(__Pyx_PyCFunctionFastWithKeywords)cfunc->func)(self, &arg, 1, NULL);
10266 }
10267 }
10268 return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
10269 }
10270 #endif
10271 static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
10272 PyObject *args, *result = NULL;
10273 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
10274 #if CYTHON_COMPILING_IN_CPYTHON
10275 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
10276 args = PyTuple_New(1);
10277 if (unlikely(!args)) goto bad;
10278 Py_INCREF(arg);
10279 PyTuple_SET_ITEM(args, 0, arg);
10280 if (cfunc->flag & METH_KEYWORDS)
10281 result = (*(PyCFunctionWithKeywords)cfunc->func)(self, args, NULL);
10282 else
10283 result = (*cfunc->func)(self, args);
10284 } else {
10285 args = PyTuple_New(2);
10286 if (unlikely(!args)) goto bad;
10287 Py_INCREF(self);
10288 PyTuple_SET_ITEM(args, 0, self);
10289 Py_INCREF(arg);
10290 PyTuple_SET_ITEM(args, 1, arg);
10291 result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
10292 }
10293 #else
10294 args = PyTuple_Pack(2, self, arg);
10295 if (unlikely(!args)) goto bad;
10296 result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
10297 #endif
10298 bad:
10299 Py_XDECREF(args);
10300 return result;
10301 }
10302
10303 /* CallUnboundCMethod2 */
10304 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
10305 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
10306 if (likely(cfunc->func)) {
10307 PyObject *args[2] = {arg1, arg2};
10308 if (cfunc->flag == METH_FASTCALL) {
10309 #if PY_VERSION_HEX >= 0x030700A0
10310 return (*(__Pyx_PyCFunctionFast)cfunc->func)(self, args, 2);
10311 #else
10312 return (*(__Pyx_PyCFunctionFastWithKeywords)cfunc->func)(self, args, 2, NULL);
10313 #endif
10314 }
10315 #if PY_VERSION_HEX >= 0x030700A0
10316 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
10317 return (*(__Pyx_PyCFunctionFastWithKeywords)cfunc->func)(self, args, 2, NULL);
10318 #endif
10319 }
10320 return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
10321 }
10322 #endif
10323 static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
10324 PyObject *args, *result = NULL;
10325 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
10326 #if CYTHON_COMPILING_IN_CPYTHON
10327 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
10328 args = PyTuple_New(2);
10329 if (unlikely(!args)) goto bad;
10330 Py_INCREF(arg1);
10331 PyTuple_SET_ITEM(args, 0, arg1);
10332 Py_INCREF(arg2);
10333 PyTuple_SET_ITEM(args, 1, arg2);
10334 if (cfunc->flag & METH_KEYWORDS)
10335 result = (*(PyCFunctionWithKeywords)cfunc->func)(self, args, NULL);
10336 else
10337 result = (*cfunc->func)(self, args);
10338 } else {
10339 args = PyTuple_New(3);
10340 if (unlikely(!args)) goto bad;
10341 Py_INCREF(self);
10342 PyTuple_SET_ITEM(args, 0, self);
10343 Py_INCREF(arg1);
10344 PyTuple_SET_ITEM(args, 1, arg1);
10345 Py_INCREF(arg2);
10346 PyTuple_SET_ITEM(args, 2, arg2);
10347 result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
10348 }
10349 #else
10350 args = PyTuple_Pack(3, self, arg1, arg2);
10351 if (unlikely(!args)) goto bad;
10352 result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
10353 #endif
10354 bad:
10355 Py_XDECREF(args);
10356 return result;
10357 }
10358
880710359 /* dict_getitem_default */
880810360 static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
880910361 PyObject* value;
881510367 value = default_value;
881610368 }
881710369 Py_INCREF(value);
10370 if ((1));
881810371 #else
881910372 if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
882010373 value = PyDict_GetItem(d, key);
882210375 value = default_value;
882310376 }
882410377 Py_INCREF(value);
8825 } else {
10378 }
10379 #endif
10380 else {
882610381 if (default_value == Py_None)
8827 default_value = NULL;
8828 value = PyObject_CallMethodObjArgs(
8829 d, __pyx_n_s_get, key, default_value, NULL);
8830 }
8831 #endif
10382 value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key);
10383 else
10384 value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value);
10385 }
883210386 return value;
883310387 }
883410388
901710571 }
901810572
901910573 /* PyObjectCallMethod1 */
9020 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
9021 PyObject *method, *result = NULL;
9022 method = __Pyx_PyObject_GetAttrStr(obj, method_name);
9023 if (unlikely(!method)) goto done;
10574 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
10575 PyObject *result = NULL;
902410576 #if CYTHON_UNPACK_METHODS
902510577 if (likely(PyMethod_Check(method))) {
902610578 PyObject *self = PyMethod_GET_SELF(method);
904810600 Py_INCREF(arg);
904910601 PyTuple_SET_ITEM(args, 1, arg);
905010602 Py_INCREF(function);
9051 Py_DECREF(method); method = NULL;
905210603 result = __Pyx_PyObject_Call(function, args, NULL);
905310604 Py_DECREF(args);
905410605 Py_DECREF(function);
905710608 }
905810609 #endif
905910610 result = __Pyx_PyObject_CallOneArg(method, arg);
10611 goto done;
906010612 done:
9061 Py_XDECREF(method);
10613 return result;
10614 }
10615 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
10616 PyObject *method, *result;
10617 method = __Pyx_PyObject_GetAttrStr(obj, method_name);
10618 if (unlikely(!method)) return NULL;
10619 result = __Pyx__PyObject_CallMethod1(method, arg);
10620 Py_DECREF(method);
906210621 return result;
906310622 }
906410623
909110650 /* IterFinish */
909210651 static CYTHON_INLINE int __Pyx_IterFinish(void) {
909310652 #if CYTHON_FAST_THREAD_STATE
9094 PyThreadState *tstate = PyThreadState_GET();
10653 PyThreadState *tstate = __Pyx_PyThreadState_Current;
909510654 PyObject* exc_type = tstate->curexc_type;
909610655 if (unlikely(exc_type)) {
9097 if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
10656 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
909810657 PyObject *exc_value, *exc_tb;
909910658 exc_value = tstate->curexc_value;
910010659 exc_tb = tstate->curexc_traceback;
925110810 "raise: exception class must be a subclass of BaseException");
925210811 goto bad;
925310812 }
9254 #if PY_VERSION_HEX >= 0x03030000
925510813 if (cause) {
9256 #else
9257 if (cause && cause != Py_None) {
9258 #endif
925910814 PyObject *fixed_cause;
926010815 if (cause == Py_None) {
926110816 fixed_cause = NULL;
928310838 PyErr_Restore(tmp_type, tmp_value, tb);
928410839 Py_XDECREF(tmp_tb);
928510840 #else
9286 PyThreadState *tstate = PyThreadState_GET();
10841 PyThreadState *tstate = __Pyx_PyThreadState_Current;
928710842 PyObject* tmp_tb = tstate->curexc_traceback;
928810843 if (tb != tmp_tb) {
928910844 Py_INCREF(tb);
929910854 #endif
930010855
930110856 /* KeywordStringCheck */
9302 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
10857 static int __Pyx_CheckKeywordStrings(
930310858 PyObject *kwdict,
930410859 const char* function_name,
930510860 int kw_allowed)
931310868 #else
931410869 while (PyDict_Next(kwdict, &pos, &key, 0)) {
931510870 #if PY_MAJOR_VERSION < 3
9316 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
10871 if (unlikely(!PyString_Check(key)))
931710872 #endif
931810873 if (unlikely(!PyUnicode_Check(key)))
931910874 goto invalid_keyword_type;
933910894 }
934010895
934110896 /* PyIntBinop */
9342 #if !CYTHON_COMPILING_IN_PYPY
10897 #if !CYTHON_COMPILING_IN_PYPY
934310898 static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
934410899 #if PY_MAJOR_VERSION < 3
934510900 if (likely(PyInt_CheckExact(op1))) {
934610901 const long b = intval;
934710902 long a = PyInt_AS_LONG(op1);
9348 if (8 * sizeof(long) <= 53 || likely(labs(a) <= (1L << 53))) {
10903 if (8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53))) {
934910904 return PyFloat_FromDouble((double)a / (double)b);
935010905 }
935110906 return PyInt_Type.tp_as_number->nb_true_divide(op1, op2);
936710922 a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
936810923 break;
936910924 }
10925 CYTHON_FALLTHROUGH;
937010926 case 2:
937110927 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) {
937210928 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
937310929 break;
937410930 }
10931 CYTHON_FALLTHROUGH;
937510932 case -3:
937610933 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) {
937710934 a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
937810935 break;
937910936 }
10937 CYTHON_FALLTHROUGH;
938010938 case 3:
938110939 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) {
938210940 a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
938310941 break;
938410942 }
10943 CYTHON_FALLTHROUGH;
938510944 case -4:
938610945 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) {
938710946 a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
938810947 break;
938910948 }
10949 CYTHON_FALLTHROUGH;
939010950 case 4:
939110951 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) {
939210952 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
939310953 break;
939410954 }
10955 CYTHON_FALLTHROUGH;
939510956 default: return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
939610957 }
939710958 }
9398 if ((8 * sizeof(long) <= 53 || likely(labs(a) <= (1L << 53)))
10959 if ((8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53)))
939910960 || __Pyx_sst_abs(size) <= 52 / PyLong_SHIFT) {
940010961 return PyFloat_FromDouble((double)a / (double)b);
940110962 }
941810979 #endif
941910980
942010981 /* GetItemInt */
9421 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
10982 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
942210983 PyObject *r;
942310984 if (!j) return NULL;
942410985 r = PyObject_GetItem(o, j);
942910990 CYTHON_NCP_UNUSED int wraparound,
943010991 CYTHON_NCP_UNUSED int boundscheck) {
943110992 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9432 if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
9433 if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
9434 PyObject *r = PyList_GET_ITEM(o, i);
10993 Py_ssize_t wrapped_i = i;
10994 if (wraparound & unlikely(i < 0)) {
10995 wrapped_i += PyList_GET_SIZE(o);
10996 }
10997 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
10998 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
943510999 Py_INCREF(r);
943611000 return r;
943711001 }
944411008 CYTHON_NCP_UNUSED int wraparound,
944511009 CYTHON_NCP_UNUSED int boundscheck) {
944611010 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9447 if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
9448 if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
9449 PyObject *r = PyTuple_GET_ITEM(o, i);
11011 Py_ssize_t wrapped_i = i;
11012 if (wraparound & unlikely(i < 0)) {
11013 wrapped_i += PyTuple_GET_SIZE(o);
11014 }
11015 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
11016 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
945011017 Py_INCREF(r);
945111018 return r;
945211019 }
949911066 }
950011067
950111068 /* ArgTypeTest */
9502 static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
9503 PyErr_Format(PyExc_TypeError,
9504 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
9505 name, type->tp_name, Py_TYPE(obj)->tp_name);
9506 }
9507 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
9508 const char *name, int exact)
11069 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
950911070 {
951011071 if (unlikely(!type)) {
951111072 PyErr_SetString(PyExc_SystemError, "Missing type object");
951211073 return 0;
951311074 }
9514 if (none_allowed && obj == Py_None) return 1;
951511075 else if (exact) {
9516 if (likely(Py_TYPE(obj) == type)) return 1;
951711076 #if PY_MAJOR_VERSION == 2
9518 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
11077 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
951911078 #endif
952011079 }
952111080 else {
9522 if (likely(PyObject_TypeCheck(obj, type))) return 1;
9523 }
9524 __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
11081 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
11082 }
11083 PyErr_Format(PyExc_TypeError,
11084 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
11085 name, type->tp_name, Py_TYPE(obj)->tp_name);
952511086 return 0;
952611087 }
952711088
11089 /* PyErrExceptionMatches */
11090 #if CYTHON_FAST_THREAD_STATE
11091 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
11092 Py_ssize_t i, n;
11093 n = PyTuple_GET_SIZE(tuple);
11094 #if PY_MAJOR_VERSION >= 3
11095 for (i=0; i<n; i++) {
11096 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
11097 }
11098 #endif
11099 for (i=0; i<n; i++) {
11100 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
11101 }
11102 return 0;
11103 }
11104 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
11105 PyObject *exc_type = tstate->curexc_type;
11106 if (exc_type == err) return 1;
11107 if (unlikely(!exc_type)) return 0;
11108 if (unlikely(PyTuple_Check(err)))
11109 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
11110 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
11111 }
11112 #endif
11113
11114 /* GetAttr */
11115 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
11116 #if CYTHON_USE_TYPE_SLOTS
11117 #if PY_MAJOR_VERSION >= 3
11118 if (likely(PyUnicode_Check(n)))
11119 #else
11120 if (likely(PyString_Check(n)))
11121 #endif
11122 return __Pyx_PyObject_GetAttrStr(o, n);
11123 #endif
11124 return PyObject_GetAttr(o, n);
11125 }
11126
11127 /* GetAttr3 */
11128 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
11129 __Pyx_PyThreadState_declare
11130 __Pyx_PyThreadState_assign
11131 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
11132 return NULL;
11133 __Pyx_PyErr_Clear();
11134 Py_INCREF(d);
11135 return d;
11136 }
11137 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
11138 PyObject *r = __Pyx_GetAttr(o, n);
11139 return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
11140 }
11141
952811142 /* Import */
9529 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
11143 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
953011144 PyObject *empty_list = 0;
953111145 PyObject *module = 0;
953211146 PyObject *global_dict = 0;
953311147 PyObject *empty_dict = 0;
953411148 PyObject *list;
9535 #if PY_VERSION_HEX < 0x03030000
11149 #if PY_MAJOR_VERSION < 3
953611150 PyObject *py_import;
953711151 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
953811152 if (!py_import)
955611170 #if PY_MAJOR_VERSION >= 3
955711171 if (level == -1) {
955811172 if (strchr(__Pyx_MODULE_NAME, '.')) {
9559 #if PY_VERSION_HEX < 0x03030000
9560 PyObject *py_level = PyInt_FromLong(1);
9561 if (!py_level)
9562 goto bad;
9563 module = PyObject_CallFunctionObjArgs(py_import,
9564 name, global_dict, empty_dict, list, py_level, NULL);
9565 Py_DECREF(py_level);
9566 #else
956711173 module = PyImport_ImportModuleLevelObject(
956811174 name, global_dict, empty_dict, list, 1);
9569 #endif
957011175 if (!module) {
957111176 if (!PyErr_ExceptionMatches(PyExc_ImportError))
957211177 goto bad;
957711182 }
957811183 #endif
957911184 if (!module) {
9580 #if PY_VERSION_HEX < 0x03030000
11185 #if PY_MAJOR_VERSION < 3
958111186 PyObject *py_level = PyInt_FromLong(level);
958211187 if (!py_level)
958311188 goto bad;
959111196 }
959211197 }
959311198 bad:
9594 #if PY_VERSION_HEX < 0x03030000
11199 #if PY_MAJOR_VERSION < 3
959511200 Py_XDECREF(py_import);
959611201 #endif
959711202 Py_XDECREF(empty_list);
960011205 }
960111206
960211207 /* ImportFrom */
9603 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
11208 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
960411209 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
960511210 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
960611211 PyErr_Format(PyExc_ImportError,
961311218 return value;
961411219 }
961511220
11221 /* HasAttr */
11222 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
11223 PyObject *r;
11224 if (unlikely(!__Pyx_PyBaseString_Check(n))) {
11225 PyErr_SetString(PyExc_TypeError,
11226 "hasattr(): attribute name must be string");
11227 return -1;
11228 }
11229 r = __Pyx_GetAttr(o, n);
11230 if (unlikely(!r)) {
11231 PyErr_Clear();
11232 return 0;
11233 } else {
11234 Py_DECREF(r);
11235 return 1;
11236 }
11237 }
11238
11239 /* PyObject_GenericGetAttrNoDict */
11240 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
11241 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
11242 PyErr_Format(PyExc_AttributeError,
11243 #if PY_MAJOR_VERSION >= 3
11244 "'%.50s' object has no attribute '%U'",
11245 tp->tp_name, attr_name);
11246 #else
11247 "'%.50s' object has no attribute '%.400s'",
11248 tp->tp_name, PyString_AS_STRING(attr_name));
11249 #endif
11250 return NULL;
11251 }
11252 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
11253 PyObject *descr;
11254 PyTypeObject *tp = Py_TYPE(obj);
11255 if (unlikely(!PyString_Check(attr_name))) {
11256 return PyObject_GenericGetAttr(obj, attr_name);
11257 }
11258 assert(!tp->tp_dictoffset);
11259 descr = _PyType_Lookup(tp, attr_name);
11260 if (unlikely(!descr)) {
11261 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
11262 }
11263 Py_INCREF(descr);
11264 #if PY_MAJOR_VERSION < 3
11265 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
11266 #endif
11267 {
11268 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
11269 if (unlikely(f)) {
11270 PyObject *res = f(descr, obj, (PyObject *)tp);
11271 Py_DECREF(descr);
11272 return res;
11273 }
11274 }
11275 return descr;
11276 }
11277 #endif
11278
11279 /* PyObject_GenericGetAttr */
11280 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
11281 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
11282 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
11283 return PyObject_GenericGetAttr(obj, attr_name);
11284 }
11285 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
11286 }
11287 #endif
11288
11289 /* SetupReduce */
11290 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
11291 int ret;
11292 PyObject *name_attr;
11293 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
11294 if (likely(name_attr)) {
11295 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
11296 } else {
11297 ret = -1;
11298 }
11299 if (unlikely(ret < 0)) {
11300 PyErr_Clear();
11301 ret = 0;
11302 }
11303 Py_XDECREF(name_attr);
11304 return ret;
11305 }
11306 static int __Pyx_setup_reduce(PyObject* type_obj) {
11307 int ret = 0;
11308 PyObject *object_reduce = NULL;
11309 PyObject *object_reduce_ex = NULL;
11310 PyObject *reduce = NULL;
11311 PyObject *reduce_ex = NULL;
11312 PyObject *reduce_cython = NULL;
11313 PyObject *setstate = NULL;
11314 PyObject *setstate_cython = NULL;
11315 #if CYTHON_USE_PYTYPE_LOOKUP
11316 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
11317 #else
11318 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
11319 #endif
11320 #if CYTHON_USE_PYTYPE_LOOKUP
11321 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
11322 #else
11323 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
11324 #endif
11325 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
11326 if (reduce_ex == object_reduce_ex) {
11327 #if CYTHON_USE_PYTYPE_LOOKUP
11328 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
11329 #else
11330 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
11331 #endif
11332 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
11333 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
11334 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
11335 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
11336 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
11337 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
11338 if (!setstate) PyErr_Clear();
11339 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
11340 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
11341 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
11342 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
11343 }
11344 PyType_Modified((PyTypeObject*)type_obj);
11345 }
11346 }
11347 goto GOOD;
11348 BAD:
11349 if (!PyErr_Occurred())
11350 PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
11351 ret = -1;
11352 GOOD:
11353 #if !CYTHON_USE_PYTYPE_LOOKUP
11354 Py_XDECREF(object_reduce);
11355 Py_XDECREF(object_reduce_ex);
11356 #endif
11357 Py_XDECREF(reduce);
11358 Py_XDECREF(reduce_ex);
11359 Py_XDECREF(reduce_cython);
11360 Py_XDECREF(setstate);
11361 Py_XDECREF(setstate_cython);
11362 return ret;
11363 }
11364
11365 /* CLineInTraceback */
11366 #ifndef CYTHON_CLINE_IN_TRACEBACK
11367 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
11368 PyObject *use_cline;
11369 PyObject *ptype, *pvalue, *ptraceback;
11370 #if CYTHON_COMPILING_IN_CPYTHON
11371 PyObject **cython_runtime_dict;
11372 #endif
11373 if (unlikely(!__pyx_cython_runtime)) {
11374 return c_line;
11375 }
11376 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
11377 #if CYTHON_COMPILING_IN_CPYTHON
11378 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
11379 if (likely(cython_runtime_dict)) {
11380 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
11381 } else
11382 #endif
11383 {
11384 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
11385 if (use_cline_obj) {
11386 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
11387 Py_DECREF(use_cline_obj);
11388 } else {
11389 PyErr_Clear();
11390 use_cline = NULL;
11391 }
11392 }
11393 if (!use_cline) {
11394 c_line = 0;
11395 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
11396 }
11397 else if (PyObject_Not(use_cline) != 0) {
11398 c_line = 0;
11399 }
11400 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
11401 return c_line;
11402 }
11403 #endif
11404
961611405 /* CodeObjectCache */
9617 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
11406 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
961811407 int start = 0, mid = 0, end = count - 1;
961911408 if (end >= 0 && code_line > entries[end].code_line) {
962011409 return count;
969411483 }
969511484
969611485 /* AddTraceback */
9697 #include "compile.h"
11486 #include "compile.h"
969811487 #include "frameobject.h"
969911488 #include "traceback.h"
970011489 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
975311542 int py_line, const char *filename) {
975411543 PyCodeObject *py_code = 0;
975511544 PyFrameObject *py_frame = 0;
9756 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
11545 PyThreadState *tstate = __Pyx_PyThreadState_Current;
11546 if (c_line) {
11547 c_line = __Pyx_CLineForTraceback(tstate, c_line);
11548 }
11549 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
975711550 if (!py_code) {
975811551 py_code = __Pyx_CreateCodeObjectForTraceback(
975911552 funcname, c_line, py_line, filename);
976011553 if (!py_code) goto bad;
9761 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
11554 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
976211555 }
976311556 py_frame = PyFrame_New(
9764 PyThreadState_GET(), /*PyThreadState *tstate,*/
9765 py_code, /*PyCodeObject *code,*/
9766 __pyx_d, /*PyObject *globals,*/
9767 0 /*PyObject *locals*/
11557 tstate, /*PyThreadState *tstate,*/
11558 py_code, /*PyCodeObject *code,*/
11559 __pyx_d, /*PyObject *globals,*/
11560 0 /*PyObject *locals*/
976811561 );
976911562 if (!py_frame) goto bad;
977011563 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
977411567 Py_XDECREF(py_frame);
977511568 }
977611569
11570 /* CIntToPy */
11571 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
11572 const int neg_one = (int) -1, const_zero = (int) 0;
11573 const int is_unsigned = neg_one > const_zero;
11574 if (is_unsigned) {
11575 if (sizeof(int) < sizeof(long)) {
11576 return PyInt_FromLong((long) value);
11577 } else if (sizeof(int) <= sizeof(unsigned long)) {
11578 return PyLong_FromUnsignedLong((unsigned long) value);
11579 #ifdef HAVE_LONG_LONG
11580 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
11581 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
11582 #endif
11583 }
11584 } else {
11585 if (sizeof(int) <= sizeof(long)) {
11586 return PyInt_FromLong((long) value);
11587 #ifdef HAVE_LONG_LONG
11588 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
11589 return PyLong_FromLongLong((PY_LONG_LONG) value);
11590 #endif
11591 }
11592 }
11593 {
11594 int one = 1; int little = (int)*(unsigned char *)&one;
11595 unsigned char *bytes = (unsigned char *)&value;
11596 return _PyLong_FromByteArray(bytes, sizeof(int),
11597 little, !is_unsigned);
11598 }
11599 }
11600
977711601 /* CIntFromPyVerify */
9778 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
11602 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
977911603 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
978011604 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
978111605 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
979711621 }
979811622
979911623 /* CIntToPy */
9800 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
9801 const int neg_one = (int) -1, const_zero = (int) 0;
9802 const int is_unsigned = neg_one > const_zero;
9803 if (is_unsigned) {
9804 if (sizeof(int) < sizeof(long)) {
9805 return PyInt_FromLong((long) value);
9806 } else if (sizeof(int) <= sizeof(unsigned long)) {
9807 return PyLong_FromUnsignedLong((unsigned long) value);
9808 #ifdef HAVE_LONG_LONG
9809 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
9810 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
9811 #endif
9812 }
9813 } else {
9814 if (sizeof(int) <= sizeof(long)) {
9815 return PyInt_FromLong((long) value);
9816 #ifdef HAVE_LONG_LONG
9817 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
9818 return PyLong_FromLongLong((PY_LONG_LONG) value);
9819 #endif
9820 }
9821 }
9822 {
9823 int one = 1; int little = (int)*(unsigned char *)&one;
9824 unsigned char *bytes = (unsigned char *)&value;
9825 return _PyLong_FromByteArray(bytes, sizeof(int),
9826 little, !is_unsigned);
9827 }
9828 }
9829
9830 /* CIntToPy */
9831 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MIX_InitFlags(MIX_InitFlags value) {
11624 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_MIX_InitFlags(MIX_InitFlags value) {
983211625 const MIX_InitFlags neg_one = (MIX_InitFlags) -1, const_zero = (MIX_InitFlags) 0;
983311626 const int is_unsigned = neg_one > const_zero;
983411627 if (is_unsigned) {
985911652 }
986011653
986111654 /* CIntToPy */
9862 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) {
11655 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint16_t(uint16_t value) {
986311656 const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0;
986411657 const int is_unsigned = neg_one > const_zero;
986511658 if (is_unsigned) {
989011683 }
989111684
989211685 /* CIntToPy */
9893 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
11686 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
989411687 const long neg_one = (long) -1, const_zero = (long) 0;
989511688 const int is_unsigned = neg_one > const_zero;
989611689 if (is_unsigned) {
992111714 }
992211715
992311716 /* CIntFromPy */
9924 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
11717 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
992511718 const int neg_one = (int) -1, const_zero = (int) 0;
992611719 const int is_unsigned = neg_one > const_zero;
992711720 #if PY_MAJOR_VERSION < 3
1011011903 }
1011111904
1011211905 /* CIntFromPy */
10113 static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *x) {
11906 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
11907 const long neg_one = (long) -1, const_zero = (long) 0;
11908 const int is_unsigned = neg_one > const_zero;
11909 #if PY_MAJOR_VERSION < 3
11910 if (likely(PyInt_Check(x))) {
11911 if (sizeof(long) < sizeof(long)) {
11912 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
11913 } else {
11914 long val = PyInt_AS_LONG(x);
11915 if (is_unsigned && unlikely(val < 0)) {
11916 goto raise_neg_overflow;
11917 }
11918 return (long) val;
11919 }
11920 } else
11921 #endif
11922 if (likely(PyLong_Check(x))) {
11923 if (is_unsigned) {
11924 #if CYTHON_USE_PYLONG_INTERNALS
11925 const digit* digits = ((PyLongObject*)x)->ob_digit;
11926 switch (Py_SIZE(x)) {
11927 case 0: return (long) 0;
11928 case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
11929 case 2:
11930 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
11931 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11932 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11933 } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
11934 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
11935 }
11936 }
11937 break;
11938 case 3:
11939 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
11940 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
11941 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11942 } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
11943 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
11944 }
11945 }
11946 break;
11947 case 4:
11948 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
11949 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
11950 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11951 } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
11952 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
11953 }
11954 }
11955 break;
11956 }
11957 #endif
11958 #if CYTHON_COMPILING_IN_CPYTHON
11959 if (unlikely(Py_SIZE(x) < 0)) {
11960 goto raise_neg_overflow;
11961 }
11962 #else
11963 {
11964 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
11965 if (unlikely(result < 0))
11966 return (long) -1;
11967 if (unlikely(result == 1))
11968 goto raise_neg_overflow;
11969 }
11970 #endif
11971 if (sizeof(long) <= sizeof(unsigned long)) {
11972 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
11973 #ifdef HAVE_LONG_LONG
11974 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
11975 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
11976 #endif
11977 }
11978 } else {
11979 #if CYTHON_USE_PYLONG_INTERNALS
11980 const digit* digits = ((PyLongObject*)x)->ob_digit;
11981 switch (Py_SIZE(x)) {
11982 case 0: return (long) 0;
11983 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
11984 case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
11985 case -2:
11986 if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
11987 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11988 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11989 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
11990 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11991 }
11992 }
11993 break;
11994 case 2:
11995 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
11996 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11997 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11998 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
11999 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12000 }
12001 }
12002 break;
12003 case -3:
12004 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
12005 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12006 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12007 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
12008 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12009 }
12010 }
12011 break;
12012 case 3:
12013 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
12014 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
12015 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12016 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
12017 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12018 }
12019 }
12020 break;
12021 case -4:
12022 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
12023 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12024 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12025 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
12026 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12027 }
12028 }
12029 break;
12030 case 4:
12031 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
12032 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
12033 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
12034 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
12035 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
12036 }
12037 }
12038 break;
12039 }
12040 #endif
12041 if (sizeof(long) <= sizeof(long)) {
12042 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
12043 #ifdef HAVE_LONG_LONG
12044 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
12045 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
12046 #endif
12047 }
12048 }
12049 {
12050 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
12051 PyErr_SetString(PyExc_RuntimeError,
12052 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
12053 #else
12054 long val;
12055 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
12056 #if PY_MAJOR_VERSION < 3
12057 if (likely(v) && !PyLong_Check(v)) {
12058 PyObject *tmp = v;
12059 v = PyNumber_Long(tmp);
12060 Py_DECREF(tmp);
12061 }
12062 #endif
12063 if (likely(v)) {
12064 int one = 1; int is_little = (int)*(unsigned char *)&one;
12065 unsigned char *bytes = (unsigned char *)&val;
12066 int ret = _PyLong_AsByteArray((PyLongObject *)v,
12067 bytes, sizeof(val),
12068 is_little, !is_unsigned);
12069 Py_DECREF(v);
12070 if (likely(!ret))
12071 return val;
12072 }
12073 #endif
12074 return (long) -1;
12075 }
12076 } else {
12077 long val;
12078 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
12079 if (!tmp) return (long) -1;
12080 val = __Pyx_PyInt_As_long(tmp);
12081 Py_DECREF(tmp);
12082 return val;
12083 }
12084 raise_overflow:
12085 PyErr_SetString(PyExc_OverflowError,
12086 "value too large to convert to long");
12087 return (long) -1;
12088 raise_neg_overflow:
12089 PyErr_SetString(PyExc_OverflowError,
12090 "can't convert negative value to long");
12091 return (long) -1;
12092 }
12093
12094 /* CIntFromPy */
12095 static CYTHON_INLINE uint16_t __Pyx_PyInt_As_uint16_t(PyObject *x) {
1011412096 const uint16_t neg_one = (uint16_t) -1, const_zero = (uint16_t) 0;
1011512097 const int is_unsigned = neg_one > const_zero;
1011612098 #if PY_MAJOR_VERSION < 3
1029812280 return (uint16_t) -1;
1029912281 }
1030012282
10301 /* CIntFromPy */
10302 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
10303 const long neg_one = (long) -1, const_zero = (long) 0;
10304 const int is_unsigned = neg_one > const_zero;
10305 #if PY_MAJOR_VERSION < 3
10306 if (likely(PyInt_Check(x))) {
10307 if (sizeof(long) < sizeof(long)) {
10308 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
12283 /* FastTypeChecks */
12284 #if CYTHON_COMPILING_IN_CPYTHON
12285 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
12286 while (a) {
12287 a = a->tp_base;
12288 if (a == b)
12289 return 1;
12290 }
12291 return b == &PyBaseObject_Type;
12292 }
12293 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
12294 PyObject *mro;
12295 if (a == b) return 1;
12296 mro = a->tp_mro;
12297 if (likely(mro)) {
12298 Py_ssize_t i, n;
12299 n = PyTuple_GET_SIZE(mro);
12300 for (i = 0; i < n; i++) {
12301 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
12302 return 1;
12303 }
12304 return 0;
12305 }
12306 return __Pyx_InBases(a, b);
12307 }
12308 #if PY_MAJOR_VERSION == 2
12309 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
12310 PyObject *exception, *value, *tb;
12311 int res;
12312 __Pyx_PyThreadState_declare
12313 __Pyx_PyThreadState_assign
12314 __Pyx_ErrFetch(&exception, &value, &tb);
12315 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
12316 if (unlikely(res == -1)) {
12317 PyErr_WriteUnraisable(err);
12318 res = 0;
12319 }
12320 if (!res) {
12321 res = PyObject_IsSubclass(err, exc_type2);
12322 if (unlikely(res == -1)) {
12323 PyErr_WriteUnraisable(err);
12324 res = 0;
12325 }
12326 }
12327 __Pyx_ErrRestore(exception, value, tb);
12328 return res;
12329 }
12330 #else
12331 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
12332 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
12333 if (!res) {
12334 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
12335 }
12336 return res;
12337 }
12338 #endif
12339 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
12340 Py_ssize_t i, n;
12341 assert(PyExceptionClass_Check(exc_type));
12342 n = PyTuple_GET_SIZE(tuple);
12343 #if PY_MAJOR_VERSION >= 3
12344 for (i=0; i<n; i++) {
12345 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
12346 }
12347 #endif
12348 for (i=0; i<n; i++) {
12349 PyObject *t = PyTuple_GET_ITEM(tuple, i);
12350 #if PY_MAJOR_VERSION < 3
12351 if (likely(exc_type == t)) return 1;
12352 #endif
12353 if (likely(PyExceptionClass_Check(t))) {
12354 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
1030912355 } else {
10310 long val = PyInt_AS_LONG(x);
10311 if (is_unsigned && unlikely(val < 0)) {
10312 goto raise_neg_overflow;
10313 }
10314 return (long) val;
1031512356 }
10316 } else
10317 #endif
10318 if (likely(PyLong_Check(x))) {
10319 if (is_unsigned) {
10320 #if CYTHON_USE_PYLONG_INTERNALS
10321 const digit* digits = ((PyLongObject*)x)->ob_digit;
10322 switch (Py_SIZE(x)) {
10323 case 0: return (long) 0;
10324 case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
10325 case 2:
10326 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
10327 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10328 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10329 } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
10330 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
10331 }
10332 }
10333 break;
10334 case 3:
10335 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
10336 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10337 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10338 } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
10339 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
10340 }
10341 }
10342 break;
10343 case 4:
10344 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
10345 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10346 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10347 } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
10348 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
10349 }
10350 }
10351 break;
10352 }
10353 #endif
10354 #if CYTHON_COMPILING_IN_CPYTHON
10355 if (unlikely(Py_SIZE(x) < 0)) {
10356 goto raise_neg_overflow;
10357 }
10358 #else
10359 {
10360 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
10361 if (unlikely(result < 0))
10362 return (long) -1;
10363 if (unlikely(result == 1))
10364 goto raise_neg_overflow;
10365 }
10366 #endif
10367 if (sizeof(long) <= sizeof(unsigned long)) {
10368 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
10369 #ifdef HAVE_LONG_LONG
10370 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
10371 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
10372 #endif
10373 }
12357 }
12358 return 0;
12359 }
12360 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
12361 if (likely(err == exc_type)) return 1;
12362 if (likely(PyExceptionClass_Check(err))) {
12363 if (likely(PyExceptionClass_Check(exc_type))) {
12364 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
12365 } else if (likely(PyTuple_Check(exc_type))) {
12366 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
1037412367 } else {
10375 #if CYTHON_USE_PYLONG_INTERNALS
10376 const digit* digits = ((PyLongObject*)x)->ob_digit;
10377 switch (Py_SIZE(x)) {
10378 case 0: return (long) 0;
10379 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
10380 case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
10381 case -2:
10382 if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
10383 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10384 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10385 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
10386 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10387 }
10388 }
10389 break;
10390 case 2:
10391 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
10392 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
10393 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10394 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
10395 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10396 }
10397 }
10398 break;
10399 case -3:
10400 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
10401 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10402 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10403 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
10404 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10405 }
10406 }
10407 break;
10408 case 3:
10409 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
10410 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
10411 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10412 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
10413 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10414 }
10415 }
10416 break;
10417 case -4:
10418 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
10419 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10420 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10421 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
10422 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10423 }
10424 }
10425 break;
10426 case 4:
10427 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
10428 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
10429 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
10430 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
10431 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
10432 }
10433 }
10434 break;
10435 }
10436 #endif
10437 if (sizeof(long) <= sizeof(long)) {
10438 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
10439 #ifdef HAVE_LONG_LONG
10440 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
10441 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
10442 #endif
10443 }
1044412368 }
10445 {
10446 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
10447 PyErr_SetString(PyExc_RuntimeError,
10448 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
10449 #else
10450 long val;
10451 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
10452 #if PY_MAJOR_VERSION < 3
10453 if (likely(v) && !PyLong_Check(v)) {
10454 PyObject *tmp = v;
10455 v = PyNumber_Long(tmp);
10456 Py_DECREF(tmp);
10457 }
10458 #endif
10459 if (likely(v)) {
10460 int one = 1; int is_little = (int)*(unsigned char *)&one;
10461 unsigned char *bytes = (unsigned char *)&val;
10462 int ret = _PyLong_AsByteArray((PyLongObject *)v,
10463 bytes, sizeof(val),
10464 is_little, !is_unsigned);
10465 Py_DECREF(v);
10466 if (likely(!ret))
10467 return val;
10468 }
10469 #endif
10470 return (long) -1;
10471 }
10472 } else {
10473 long val;
10474 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
10475 if (!tmp) return (long) -1;
10476 val = __Pyx_PyInt_As_long(tmp);
10477 Py_DECREF(tmp);
10478 return val;
10479 }
10480 raise_overflow:
10481 PyErr_SetString(PyExc_OverflowError,
10482 "value too large to convert to long");
10483 return (long) -1;
10484 raise_neg_overflow:
10485 PyErr_SetString(PyExc_OverflowError,
10486 "can't convert negative value to long");
10487 return (long) -1;
10488 }
12369 }
12370 return PyErr_GivenExceptionMatches(err, exc_type);
12371 }
12372 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
12373 assert(PyExceptionClass_Check(exc_type1));
12374 assert(PyExceptionClass_Check(exc_type2));
12375 if (likely(err == exc_type1 || err == exc_type2)) return 1;
12376 if (likely(PyExceptionClass_Check(err))) {
12377 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
12378 }
12379 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
12380 }
12381 #endif
1048912382
1049012383 /* CheckBinaryVersion */
10491 static int __Pyx_check_binary_version(void) {
12384 static int __Pyx_check_binary_version(void) {
1049212385 char ctversion[4], rtversion[4];
1049312386 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
1049412387 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
1050412397 }
1050512398
1050612399 /* ModuleImport */
10507 #ifndef __PYX_HAVE_RT_ImportModule
12400 #ifndef __PYX_HAVE_RT_ImportModule
1050812401 #define __PYX_HAVE_RT_ImportModule
1050912402 static PyObject *__Pyx_ImportModule(const char *name) {
1051012403 PyObject *py_name = 0;
1052212415 #endif
1052312416
1052412417 /* FunctionImport */
10525 #ifndef __PYX_HAVE_RT_ImportFunction
12418 #ifndef __PYX_HAVE_RT_ImportFunction
1052612419 #define __PYX_HAVE_RT_ImportFunction
1052712420 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
1052812421 PyObject *d = 0;
1057612469 #endif
1057712470
1057812471 /* InitStrings */
10579 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
12472 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
1058012473 while (t->p) {
1058112474 #if PY_MAJOR_VERSION < 3
1058212475 if (t->is_unicode) {
1060112494 #endif
1060212495 if (!*t->p)
1060312496 return -1;
12497 if (PyObject_Hash(*t->p) == -1)
12498 return -1;
1060412499 ++t;
1060512500 }
1060612501 return 0;
1060912504 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
1061012505 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
1061112506 }
10612 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
12507 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
1061312508 Py_ssize_t ignore;
1061412509 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
1061512510 }
10616 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
10617 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
12511 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
12512 #if !CYTHON_PEP393_ENABLED
12513 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
12514 char* defenc_c;
12515 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
12516 if (!defenc) return NULL;
12517 defenc_c = PyBytes_AS_STRING(defenc);
12518 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
12519 {
12520 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
12521 char* c;
12522 for (c = defenc_c; c < end; c++) {
12523 if ((unsigned char) (*c) >= 128) {
12524 PyUnicode_AsASCIIString(o);
12525 return NULL;
12526 }
12527 }
12528 }
12529 #endif
12530 *length = PyBytes_GET_SIZE(defenc);
12531 return defenc_c;
12532 }
12533 #else
12534 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
12535 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
12536 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
12537 if (likely(PyUnicode_IS_ASCII(o))) {
12538 *length = PyUnicode_GET_LENGTH(o);
12539 return PyUnicode_AsUTF8(o);
12540 } else {
12541 PyUnicode_AsASCIIString(o);
12542 return NULL;
12543 }
12544 #else
12545 return PyUnicode_AsUTF8AndSize(o, length);
12546 #endif
12547 }
12548 #endif
12549 #endif
12550 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
12551 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1061812552 if (
1061912553 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1062012554 __Pyx_sys_getdefaultencoding_not_ascii &&
1062112555 #endif
1062212556 PyUnicode_Check(o)) {
10623 #if PY_VERSION_HEX < 0x03030000
10624 char* defenc_c;
10625 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
10626 if (!defenc) return NULL;
10627 defenc_c = PyBytes_AS_STRING(defenc);
10628 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
10629 {
10630 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
10631 char* c;
10632 for (c = defenc_c; c < end; c++) {
10633 if ((unsigned char) (*c) >= 128) {
10634 PyUnicode_AsASCIIString(o);
10635 return NULL;
10636 }
10637 }
10638 }
10639 #endif
10640 *length = PyBytes_GET_SIZE(defenc);
10641 return defenc_c;
10642 #else
10643 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
10644 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
10645 if (PyUnicode_IS_ASCII(o)) {
10646 *length = PyUnicode_GET_LENGTH(o);
10647 return PyUnicode_AsUTF8(o);
10648 } else {
10649 PyUnicode_AsASCIIString(o);
10650 return NULL;
10651 }
10652 #else
10653 return PyUnicode_AsUTF8AndSize(o, length);
10654 #endif
10655 #endif
12557 return __Pyx_PyUnicode_AsStringAndSize(o, length);
1065612558 } else
1065712559 #endif
1065812560 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
1067612578 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
1067712579 else return PyObject_IsTrue(x);
1067812580 }
12581 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
12582 #if PY_MAJOR_VERSION >= 3
12583 if (PyLong_Check(result)) {
12584 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
12585 "__int__ returned non-int (type %.200s). "
12586 "The ability to return an instance of a strict subclass of int "
12587 "is deprecated, and may be removed in a future version of Python.",
12588 Py_TYPE(result)->tp_name)) {
12589 Py_DECREF(result);
12590 return NULL;
12591 }
12592 return result;
12593 }
12594 #endif
12595 PyErr_Format(PyExc_TypeError,
12596 "__%.4s__ returned non-%.4s (type %.200s)",
12597 type_name, type_name, Py_TYPE(result)->tp_name);
12598 Py_DECREF(result);
12599 return NULL;
12600 }
1067912601 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
1068012602 #if CYTHON_USE_TYPE_SLOTS
1068112603 PyNumberMethods *m;
1068312605 const char *name = NULL;
1068412606 PyObject *res = NULL;
1068512607 #if PY_MAJOR_VERSION < 3
10686 if (PyInt_Check(x) || PyLong_Check(x))
12608 if (likely(PyInt_Check(x) || PyLong_Check(x)))
1068712609 #else
10688 if (PyLong_Check(x))
12610 if (likely(PyLong_Check(x)))
1068912611 #endif
1069012612 return __Pyx_NewRef(x);
1069112613 #if CYTHON_USE_TYPE_SLOTS
1069312615 #if PY_MAJOR_VERSION < 3
1069412616 if (m && m->nb_int) {
1069512617 name = "int";
10696 res = PyNumber_Int(x);
12618 res = m->nb_int(x);
1069712619 }
1069812620 else if (m && m->nb_long) {
1069912621 name = "long";
10700 res = PyNumber_Long(x);
12622 res = m->nb_long(x);
1070112623 }
1070212624 #else
10703 if (m && m->nb_int) {
12625 if (likely(m && m->nb_int)) {
1070412626 name = "int";
10705 res = PyNumber_Long(x);
12627 res = m->nb_int(x);
1070612628 }
1070712629 #endif
1070812630 #else
10709 res = PyNumber_Int(x);
10710 #endif
10711 if (res) {
12631 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
12632 res = PyNumber_Int(x);
12633 }
12634 #endif
12635 if (likely(res)) {
1071212636 #if PY_MAJOR_VERSION < 3
10713 if (!PyInt_Check(res) && !PyLong_Check(res)) {
12637 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
1071412638 #else
10715 if (!PyLong_Check(res)) {
10716 #endif
10717 PyErr_Format(PyExc_TypeError,
10718 "__%.4s__ returned non-%.4s (type %.200s)",
10719 name, name, Py_TYPE(res)->tp_name);
10720 Py_DECREF(res);
10721 return NULL;
12639 if (unlikely(!PyLong_CheckExact(res))) {
12640 #endif
12641 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
1072212642 }
1072312643 }
1072412644 else if (!PyErr_Occurred()) {
1078912709 Py_DECREF(x);
1079012710 return ival;
1079112711 }
12712 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
12713 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
12714 }
1079212715 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
1079312716 return PyInt_FromSize_t(ival);
1079412717 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
8 #else
9 #define CYTHON_ABI "0_25_2"
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
8 #else
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
102120 #define CYTHON_COMPILING_IN_CPYTHON 1
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
105129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
409549 { \
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420552
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
428560
429561 #define __PYX_HAVE__pygame_sdl2__mixer_music
430562 #define __PYX_HAVE_API__pygame_sdl2__mixer_music
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
438571 #include <omp.h>
439572 #endif /* _OPENMP */
440573
441 #ifdef PYREX_WITHOUT_ASSERTIONS
574 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
442575 #define CYTHON_WITHOUT_ASSERTIONS
443576 #endif
444577
469602 #define __Pyx_sst_abs(value) abs(value)
470603 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
471604 #define __Pyx_sst_abs(value) labs(value)
472 #elif defined (_MSC_VER) && defined (_M_X64)
473 #define __Pyx_sst_abs(value) _abs64(value)
605 #elif defined (_MSC_VER)
606 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
474607 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
475608 #define __Pyx_sst_abs(value) llabs(value)
476609 #elif defined (__GNUC__)
478611 #else
479612 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
480613 #endif
481 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
482 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
614 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
615 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
483616 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
484617 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
485618 #define __Pyx_PyBytes_FromString PyBytes_FromString
492625 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
493626 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
494627 #endif
495 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
496 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
628 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
629 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
634 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
635 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
638 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
497639 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
498640 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
499641 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
500642 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
501643 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
502 #if PY_MAJOR_VERSION < 3
503 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
504 {
644 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
505645 const Py_UNICODE *u_end = u;
506646 while (*u_end++) ;
507647 return (size_t)(u_end - u - 1);
508648 }
509 #else
510 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
511 #endif
512649 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
513650 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
514651 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
515652 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
516653 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
517 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
654 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
518655 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
519656 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
657 #define __Pyx_PySequence_Tuple(obj)\
658 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
520659 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
521660 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
522661 #if CYTHON_ASSUME_SAFE_MACROS
615754 #define likely(x) (x)
616755 #define unlikely(x) (x)
617756 #endif /* __GNUC__ */
618
619 static PyObject *__pyx_m;
757 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
758
759 static PyObject *__pyx_m = NULL;
620760 static PyObject *__pyx_d;
621761 static PyObject *__pyx_b;
762 static PyObject *__pyx_cython_runtime = NULL;
622763 static PyObject *__pyx_empty_tuple;
623764 static PyObject *__pyx_empty_bytes;
624765 static PyObject *__pyx_empty_unicode;
712853
713854 /* PyObjectGetAttrStr.proto */
714855 #if CYTHON_USE_TYPE_SLOTS
715 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
716 PyTypeObject* tp = Py_TYPE(obj);
717 if (likely(tp->tp_getattro))
718 return tp->tp_getattro(obj, attr_name);
719 #if PY_MAJOR_VERSION < 3
720 if (likely(tp->tp_getattr))
721 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
722 #endif
723 return PyObject_GetAttr(obj, attr_name);
724 }
856 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
725857 #else
726858 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
727859 #endif
775907 /* PyThreadStateGet.proto */
776908 #if CYTHON_FAST_THREAD_STATE
777909 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
778 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
910 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
911 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
779912 #else
780913 #define __Pyx_PyThreadState_declare
781914 #define __Pyx_PyThreadState_assign
915 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
782916 #endif
783917
784918 /* PyErrFetchRestore.proto */
785919 #if CYTHON_FAST_THREAD_STATE
920 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
786921 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
787922 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
788923 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
789924 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
790925 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
791926 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
792 #else
927 #if CYTHON_COMPILING_IN_CPYTHON
928 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
929 #else
930 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
931 #endif
932 #else
933 #define __Pyx_PyErr_Clear() PyErr_Clear()
934 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
793935 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
794936 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
937 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
938 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
795939 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
796940 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
797941 #endif
821965
822966 /* ImportFrom.proto */
823967 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
968
969 /* CLineInTraceback.proto */
970 #ifdef CYTHON_CLINE_IN_TRACEBACK
971 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
972 #else
973 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
974 #endif
824975
825976 /* CodeObjectCache.proto */
826977 typedef struct {
8531004 /* CIntFromPy.proto */
8541005 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
8551006
1007 /* FastTypeChecks.proto */
1008 #if CYTHON_COMPILING_IN_CPYTHON
1009 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1010 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1011 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1012 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1013 #else
1014 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1015 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1016 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1017 #endif
1018 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1019
8561020 /* CheckBinaryVersion.proto */
8571021 static int __Pyx_check_binary_version(void);
8581022
8961060 static int __pyx_v_11pygame_sdl2_11mixer_music_endevent;
8971061 static void __pyx_f_11pygame_sdl2_11mixer_music_music_finished(void); /*proto*/
8981062 #define __Pyx_MODULE_NAME "pygame_sdl2.mixer_music"
1063 extern int __pyx_module_is_main_pygame_sdl2__mixer_music;
8991064 int __pyx_module_is_main_pygame_sdl2__mixer_music = 0;
9001065
9011066 /* Implementation of 'pygame_sdl2.mixer_music' */
9261091 static const char __pyx_k_set_endevent[] = "set_endevent";
9271092 static const char __pyx_k_Not_implemented[] = "Not implemented.";
9281093 static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error";
1094 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
9291095 static const char __pyx_k_pygame_sdl2_mixer_music[] = "pygame_sdl2.mixer_music";
9301096 static const char __pyx_k_src_pygame_sdl2_mixer_music_pyx[] = "src/pygame_sdl2/mixer_music.pyx";
9311097 static PyObject *__pyx_kp_u_Not_implemented;
1098 static PyObject *__pyx_n_s_cline_in_traceback;
9321099 static PyObject *__pyx_n_s_error;
9331100 static PyObject *__pyx_n_s_fadeout;
9341101 static PyObject *__pyx_n_s_fi;
9951162 static PyObject *__pyx_codeobj__19;
9961163 static PyObject *__pyx_codeobj__21;
9971164 static PyObject *__pyx_codeobj__22;
1165 /* Late includes */
9981166
9991167 /* "pygame_sdl2/mixer_music.pyx":30
10001168 * cdef int endevent = 0
11451313 * e.type = endevent
11461314 * SDL_PushEvent(&e)
11471315 */
1148 memset((&__pyx_v_e), 0, (sizeof(SDL_Event)));
1316 (void)(memset((&__pyx_v_e), 0, (sizeof(SDL_Event))));
11491317
11501318 /* "pygame_sdl2/mixer_music.pyx":40
11511319 * if endevent != 0:
11631331 *
11641332 *
11651333 */
1166 SDL_PushEvent((&__pyx_v_e));
1334 (void)(SDL_PushEvent((&__pyx_v_e)));
11671335
11681336 /* "pygame_sdl2/mixer_music.pyx":38
11691337 *
11891357 __Pyx_XDECREF(__pyx_t_3);
11901358 __Pyx_XDECREF(__pyx_t_4);
11911359 __Pyx_XDECREF(__pyx_t_5);
1192 __Pyx_WriteUnraisable("pygame_sdl2.mixer_music.music_finished", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
1360 __Pyx_WriteUnraisable("pygame_sdl2.mixer_music.music_finished", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
11931361 __pyx_L0:;
11941362 __Pyx_RefNannyFinishContext();
11951363 }
12611429 * if current_music == NULL:
12621430 * raise error()
12631431 */
1264 __pyx_t_2 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_2 == NULL)) __PYX_ERR(0, 51, __pyx_L1_error)
1432 __pyx_t_2 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_2 == ((SDL_RWops *)NULL))) __PYX_ERR(0, 51, __pyx_L1_error)
12651433 __pyx_v_11pygame_sdl2_11mixer_music_current_music = Mix_LoadMUS_RW(__pyx_t_2, 1);
12661434
12671435 /* "pygame_sdl2/mixer_music.pyx":52
12721440 *
12731441 */
12741442 __pyx_t_1 = ((__pyx_v_11pygame_sdl2_11mixer_music_current_music == NULL) != 0);
1275 if (__pyx_t_1) {
1443 if (unlikely(__pyx_t_1)) {
12761444
12771445 /* "pygame_sdl2/mixer_music.pyx":53
12781446 * current_music = Mix_LoadMUS_RW(to_rwops(fi), 1)
13631531 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13641532 switch (pos_args) {
13651533 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1534 CYTHON_FALLTHROUGH;
13661535 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1536 CYTHON_FALLTHROUGH;
13671537 case 0: break;
13681538 default: goto __pyx_L5_argtuple_error;
13691539 }
13711541 switch (pos_args) {
13721542 case 0:
13731543 if (kw_args > 0) {
1374 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loops);
1544 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loops);
13751545 if (value) { values[0] = value; kw_args--; }
13761546 }
1547 CYTHON_FALLTHROUGH;
13771548 case 1:
13781549 if (kw_args > 0) {
1379 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start);
1550 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start);
13801551 if (value) { values[1] = value; kw_args--; }
13811552 }
13821553 }
13861557 } else {
13871558 switch (PyTuple_GET_SIZE(__pyx_args)) {
13881559 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1560 CYTHON_FALLTHROUGH;
13891561 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1562 CYTHON_FALLTHROUGH;
13901563 case 0: break;
13911564 default: goto __pyx_L5_argtuple_error;
13921565 }
14271600 * def rewind():
14281601 */
14291602 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_loops); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L1_error)
1430 Mix_FadeInMusicPos(__pyx_v_11pygame_sdl2_11mixer_music_current_music, __pyx_t_1, 0, __pyx_v_start);
1603 (void)(Mix_FadeInMusicPos(__pyx_v_11pygame_sdl2_11mixer_music_current_music, __pyx_t_1, 0, __pyx_v_start));
14311604
14321605 /* "pygame_sdl2/mixer_music.pyx":55
14331606 * raise error()
15331706 *
15341707 * def pause():
15351708 */
1536 Mix_HaltMusic();
1709 (void)(Mix_HaltMusic());
15371710
15381711 /* "pygame_sdl2/mixer_music.pyx":61
15391712 * Mix_RewindMusic()
16881861 * def set_volume(double value):
16891862 */
16901863 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_time); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L1_error)
1691 Mix_FadeOutMusic(__pyx_t_1);
1864 (void)(Mix_FadeOutMusic(__pyx_t_1));
16921865
16931866 /* "pygame_sdl2/mixer_music.pyx":70
16941867 * Mix_ResumeMusic()
17541927 *
17551928 * def get_volume():
17561929 */
1757 Mix_VolumeMusic(((int)(MIX_MAX_VOLUME * __pyx_v_value)));
1930 (void)(Mix_VolumeMusic(((int)(MIX_MAX_VOLUME * __pyx_v_value))));
17581931
17591932 /* "pygame_sdl2/mixer_music.pyx":73
17601933 * Mix_FadeOutMusic(time)
19432116 *
19442117 * def get_pos():
19452118 */
1946 Mix_SetMusicPosition(__pyx_v_pos);
2119 (void)(Mix_SetMusicPosition(__pyx_v_pos));
19472120
19482121 /* "pygame_sdl2/mixer_music.pyx":82
19492122 * return Mix_PlayingMusic()
22532426 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
22542427 switch (pos_args) {
22552428 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2429 CYTHON_FALLTHROUGH;
22562430 case 0: break;
22572431 default: goto __pyx_L5_argtuple_error;
22582432 }
22602434 switch (pos_args) {
22612435 case 0:
22622436 if (kw_args > 0) {
2263 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type);
2437 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type);
22642438 if (value) { values[0] = value; kw_args--; }
22652439 }
22662440 }
22702444 } else {
22712445 switch (PyTuple_GET_SIZE(__pyx_args)) {
22722446 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2447 CYTHON_FALLTHROUGH;
22732448 case 0: break;
22742449 default: goto __pyx_L5_argtuple_error;
22752450 }
24092584 };
24102585
24112586 #if PY_MAJOR_VERSION >= 3
2587 #if CYTHON_PEP489_MULTI_PHASE_INIT
2588 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
2589 static int __pyx_pymod_exec_mixer_music(PyObject* module); /*proto*/
2590 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
2591 {Py_mod_create, (void*)__pyx_pymod_create},
2592 {Py_mod_exec, (void*)__pyx_pymod_exec_mixer_music},
2593 {0, NULL}
2594 };
2595 #endif
2596
24122597 static struct PyModuleDef __pyx_moduledef = {
2413 #if PY_VERSION_HEX < 0x03020000
2414 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
2415 #else
24162598 PyModuleDef_HEAD_INIT,
2417 #endif
24182599 "mixer_music",
24192600 0, /* m_doc */
2601 #if CYTHON_PEP489_MULTI_PHASE_INIT
2602 0, /* m_size */
2603 #else
24202604 -1, /* m_size */
2605 #endif
24212606 __pyx_methods /* m_methods */,
2607 #if CYTHON_PEP489_MULTI_PHASE_INIT
2608 __pyx_moduledef_slots, /* m_slots */
2609 #else
24222610 NULL, /* m_reload */
2611 #endif
24232612 NULL, /* m_traverse */
24242613 NULL, /* m_clear */
24252614 NULL /* m_free */
24282617
24292618 static __Pyx_StringTabEntry __pyx_string_tab[] = {
24302619 {&__pyx_kp_u_Not_implemented, __pyx_k_Not_implemented, sizeof(__pyx_k_Not_implemented), 0, 1, 0, 0},
2620 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
24312621 {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
24322622 {&__pyx_n_s_fadeout, __pyx_k_fadeout, sizeof(__pyx_k_fadeout), 0, 0, 1, 1},
24332623 {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1},
24872677 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_fi); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 44, __pyx_L1_error)
24882678 __Pyx_GOTREF(__pyx_tuple__2);
24892679 __Pyx_GIVEREF(__pyx_tuple__2);
2490 __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_load, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 44, __pyx_L1_error)
2680 __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_load, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 44, __pyx_L1_error)
24912681
24922682 /* "pygame_sdl2/mixer_music.pyx":55
24932683 * raise error()
24992689 __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_loops, __pyx_n_s_start); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 55, __pyx_L1_error)
25002690 __Pyx_GOTREF(__pyx_tuple__4);
25012691 __Pyx_GIVEREF(__pyx_tuple__4);
2502 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_play, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 55, __pyx_L1_error)
2692 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_play, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 55, __pyx_L1_error)
25032693
25042694 /* "pygame_sdl2/mixer_music.pyx":61
25052695 * Mix_RewindMusic()
25082698 * Mix_HaltMusic()
25092699 *
25102700 */
2511 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_stop, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 61, __pyx_L1_error)
2701 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_stop, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 61, __pyx_L1_error)
25122702
25132703 /* "pygame_sdl2/mixer_music.pyx":64
25142704 * Mix_HaltMusic()
25172707 * Mix_PauseMusic()
25182708 *
25192709 */
2520 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_pause, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 64, __pyx_L1_error)
2710 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_pause, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 64, __pyx_L1_error)
25212711
25222712 /* "pygame_sdl2/mixer_music.pyx":67
25232713 * Mix_PauseMusic()
25262716 * Mix_ResumeMusic()
25272717 *
25282718 */
2529 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_unpause, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 67, __pyx_L1_error)
2719 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_unpause, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 67, __pyx_L1_error)
25302720
25312721 /* "pygame_sdl2/mixer_music.pyx":70
25322722 * Mix_ResumeMusic()
25382728 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_time); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 70, __pyx_L1_error)
25392729 __Pyx_GOTREF(__pyx_tuple__9);
25402730 __Pyx_GIVEREF(__pyx_tuple__9);
2541 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_fadeout, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 70, __pyx_L1_error)
2731 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_fadeout, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 70, __pyx_L1_error)
25422732
25432733 /* "pygame_sdl2/mixer_music.pyx":73
25442734 * Mix_FadeOutMusic(time)
25502740 __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_value, __pyx_n_s_value); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 73, __pyx_L1_error)
25512741 __Pyx_GOTREF(__pyx_tuple__11);
25522742 __Pyx_GIVEREF(__pyx_tuple__11);
2553 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_set_volume, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 73, __pyx_L1_error)
2743 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_set_volume, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 73, __pyx_L1_error)
25542744
25552745 /* "pygame_sdl2/mixer_music.pyx":76
25562746 * Mix_VolumeMusic(<int>(MIX_MAX_VOLUME * value))
25592749 * return Mix_VolumeMusic(-1) / <double>MIX_MAX_VOLUME
25602750 *
25612751 */
2562 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_get_volume, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 76, __pyx_L1_error)
2752 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_get_volume, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 76, __pyx_L1_error)
25632753
25642754 /* "pygame_sdl2/mixer_music.pyx":79
25652755 * return Mix_VolumeMusic(-1) / <double>MIX_MAX_VOLUME
25682758 * return Mix_PlayingMusic()
25692759 *
25702760 */
2571 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_get_busy, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 79, __pyx_L1_error)
2761 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_get_busy, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 79, __pyx_L1_error)
25722762
25732763 /* "pygame_sdl2/mixer_music.pyx":82
25742764 * return Mix_PlayingMusic()
25802770 __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_pos, __pyx_n_s_pos); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 82, __pyx_L1_error)
25812771 __Pyx_GOTREF(__pyx_tuple__15);
25822772 __Pyx_GIVEREF(__pyx_tuple__15);
2583 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_set_pos, 82, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 82, __pyx_L1_error)
2773 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_set_pos, 82, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 82, __pyx_L1_error)
25842774
25852775 /* "pygame_sdl2/mixer_music.pyx":85
25862776 * Mix_SetMusicPosition(pos)
25892779 * # TODO: Use a Mix_SetPostMix callback to track position.
25902780 * raise error("Not implemented.")
25912781 */
2592 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_get_pos, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 85, __pyx_L1_error)
2782 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_get_pos, 85, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 85, __pyx_L1_error)
25932783
25942784 /* "pygame_sdl2/mixer_music.pyx":89
25952785 * raise error("Not implemented.")
26012791 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_fi); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 89, __pyx_L1_error)
26022792 __Pyx_GOTREF(__pyx_tuple__18);
26032793 __Pyx_GIVEREF(__pyx_tuple__18);
2604 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_queue, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 89, __pyx_L1_error)
2794 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_queue, 89, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 89, __pyx_L1_error)
26052795
26062796 /* "pygame_sdl2/mixer_music.pyx":98
26072797 * play()
26132803 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_type); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 98, __pyx_L1_error)
26142804 __Pyx_GOTREF(__pyx_tuple__20);
26152805 __Pyx_GIVEREF(__pyx_tuple__20);
2616 __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_set_endevent, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 98, __pyx_L1_error)
2806 __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_set_endevent, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 98, __pyx_L1_error)
26172807
26182808 /* "pygame_sdl2/mixer_music.pyx":103
26192809 * endevent = type or 0
26212811 * def get_endevent(): # <<<<<<<<<<<<<<
26222812 * return endevent
26232813 */
2624 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_get_endevent, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 103, __pyx_L1_error)
2814 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mixer_music_pyx, __pyx_n_s_get_endevent, 103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 103, __pyx_L1_error)
26252815 __Pyx_RefNannyFinishContext();
26262816 return 0;
26272817 __pyx_L1_error:;
26372827 return -1;
26382828 }
26392829
2830 static int __Pyx_modinit_global_init_code(void); /*proto*/
2831 static int __Pyx_modinit_variable_export_code(void); /*proto*/
2832 static int __Pyx_modinit_function_export_code(void); /*proto*/
2833 static int __Pyx_modinit_type_init_code(void); /*proto*/
2834 static int __Pyx_modinit_type_import_code(void); /*proto*/
2835 static int __Pyx_modinit_variable_import_code(void); /*proto*/
2836 static int __Pyx_modinit_function_import_code(void); /*proto*/
2837
2838 static int __Pyx_modinit_global_init_code(void) {
2839 __Pyx_RefNannyDeclarations
2840 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
2841 /*--- Global init code ---*/
2842 __pyx_v_11pygame_sdl2_11mixer_music_queued_music = Py_None; Py_INCREF(Py_None);
2843 __Pyx_RefNannyFinishContext();
2844 return 0;
2845 }
2846
2847 static int __Pyx_modinit_variable_export_code(void) {
2848 __Pyx_RefNannyDeclarations
2849 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
2850 /*--- Variable export code ---*/
2851 __Pyx_RefNannyFinishContext();
2852 return 0;
2853 }
2854
2855 static int __Pyx_modinit_function_export_code(void) {
2856 __Pyx_RefNannyDeclarations
2857 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
2858 /*--- Function export code ---*/
2859 __Pyx_RefNannyFinishContext();
2860 return 0;
2861 }
2862
2863 static int __Pyx_modinit_type_init_code(void) {
2864 __Pyx_RefNannyDeclarations
2865 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
2866 /*--- Type init code ---*/
2867 __Pyx_RefNannyFinishContext();
2868 return 0;
2869 }
2870
2871 static int __Pyx_modinit_type_import_code(void) {
2872 __Pyx_RefNannyDeclarations
2873 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
2874 /*--- Type import code ---*/
2875 __Pyx_RefNannyFinishContext();
2876 return 0;
2877 }
2878
2879 static int __Pyx_modinit_variable_import_code(void) {
2880 __Pyx_RefNannyDeclarations
2881 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
2882 /*--- Variable import code ---*/
2883 __Pyx_RefNannyFinishContext();
2884 return 0;
2885 }
2886
2887 static int __Pyx_modinit_function_import_code(void) {
2888 __Pyx_RefNannyDeclarations
2889 PyObject *__pyx_t_1 = NULL;
2890 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
2891 /*--- Function import code ---*/
2892 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
2893 if (__Pyx_ImportFunction(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2894 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2895 __Pyx_RefNannyFinishContext();
2896 return 0;
2897 __pyx_L1_error:;
2898 __Pyx_XDECREF(__pyx_t_1);
2899 __Pyx_RefNannyFinishContext();
2900 return -1;
2901 }
2902
2903
26402904 #if PY_MAJOR_VERSION < 3
2641 PyMODINIT_FUNC initmixer_music(void); /*proto*/
2642 PyMODINIT_FUNC initmixer_music(void)
2643 #else
2644 PyMODINIT_FUNC PyInit_mixer_music(void); /*proto*/
2645 PyMODINIT_FUNC PyInit_mixer_music(void)
2905 #ifdef CYTHON_NO_PYINIT_EXPORT
2906 #define __Pyx_PyMODINIT_FUNC void
2907 #else
2908 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
2909 #endif
2910 #else
2911 #ifdef CYTHON_NO_PYINIT_EXPORT
2912 #define __Pyx_PyMODINIT_FUNC PyObject *
2913 #else
2914 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
2915 #endif
2916 #endif
2917 #ifndef CYTHON_SMALL_CODE
2918 #if defined(__clang__)
2919 #define CYTHON_SMALL_CODE
2920 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
2921 #define CYTHON_SMALL_CODE __attribute__((cold))
2922 #else
2923 #define CYTHON_SMALL_CODE
2924 #endif
2925 #endif
2926
2927
2928 #if PY_MAJOR_VERSION < 3
2929 __Pyx_PyMODINIT_FUNC initmixer_music(void) CYTHON_SMALL_CODE; /*proto*/
2930 __Pyx_PyMODINIT_FUNC initmixer_music(void)
2931 #else
2932 __Pyx_PyMODINIT_FUNC PyInit_mixer_music(void) CYTHON_SMALL_CODE; /*proto*/
2933 __Pyx_PyMODINIT_FUNC PyInit_mixer_music(void)
2934 #if CYTHON_PEP489_MULTI_PHASE_INIT
2935 {
2936 return PyModuleDef_Init(&__pyx_moduledef);
2937 }
2938 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
2939 PyObject *value = PyObject_GetAttrString(spec, from_name);
2940 int result = 0;
2941 if (likely(value)) {
2942 result = PyDict_SetItemString(moddict, to_name, value);
2943 Py_DECREF(value);
2944 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
2945 PyErr_Clear();
2946 } else {
2947 result = -1;
2948 }
2949 return result;
2950 }
2951 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
2952 PyObject *module = NULL, *moddict, *modname;
2953 if (__pyx_m)
2954 return __Pyx_NewRef(__pyx_m);
2955 modname = PyObject_GetAttrString(spec, "name");
2956 if (unlikely(!modname)) goto bad;
2957 module = PyModule_NewObject(modname);
2958 Py_DECREF(modname);
2959 if (unlikely(!module)) goto bad;
2960 moddict = PyModule_GetDict(module);
2961 if (unlikely(!moddict)) goto bad;
2962 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
2963 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
2964 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
2965 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
2966 return module;
2967 bad:
2968 Py_XDECREF(module);
2969 return NULL;
2970 }
2971
2972
2973 static int __pyx_pymod_exec_mixer_music(PyObject *__pyx_pyinit_module)
2974 #endif
26462975 #endif
26472976 {
26482977 PyObject *__pyx_t_1 = NULL;
26492978 PyObject *__pyx_t_2 = NULL;
2650 PyObject *__pyx_t_3 = NULL;
26512979 __Pyx_RefNannyDeclarations
2980 #if CYTHON_PEP489_MULTI_PHASE_INIT
2981 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
2982 #elif PY_MAJOR_VERSION >= 3
2983 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
2984 #endif
26522985 #if CYTHON_REFNANNY
2653 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
2654 if (!__Pyx_RefNanny) {
2655 PyErr_Clear();
2656 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
2657 if (!__Pyx_RefNanny)
2658 Py_FatalError("failed to import 'refnanny' module");
2659 }
2660 #endif
2661 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_mixer_music(void)", 0);
2986 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
2987 if (!__Pyx_RefNanny) {
2988 PyErr_Clear();
2989 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
2990 if (!__Pyx_RefNanny)
2991 Py_FatalError("failed to import 'refnanny' module");
2992 }
2993 #endif
2994 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_mixer_music(void)", 0);
26622995 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
26632996 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
26642997 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
26753008 #ifdef __Pyx_Generator_USED
26763009 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
26773010 #endif
3011 #ifdef __Pyx_AsyncGen_USED
3012 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3013 #endif
26783014 #ifdef __Pyx_StopAsyncIteration_USED
26793015 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
26803016 #endif
26863022 #endif
26873023 #endif
26883024 /*--- Module creation code ---*/
3025 #if CYTHON_PEP489_MULTI_PHASE_INIT
3026 __pyx_m = __pyx_pyinit_module;
3027 Py_INCREF(__pyx_m);
3028 #else
26893029 #if PY_MAJOR_VERSION < 3
26903030 __pyx_m = Py_InitModule4("mixer_music", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
26913031 #else
26923032 __pyx_m = PyModule_Create(&__pyx_moduledef);
26933033 #endif
26943034 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
3035 #endif
26953036 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
26963037 Py_INCREF(__pyx_d);
26973038 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
3039 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
26983040 #if CYTHON_COMPILING_IN_PYPY
26993041 Py_INCREF(__pyx_b);
27003042 #endif
27193061 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27203062 /*--- Constants init code ---*/
27213063 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2722 /*--- Global init code ---*/
2723 __pyx_v_11pygame_sdl2_11mixer_music_queued_music = Py_None; Py_INCREF(Py_None);
2724 /*--- Variable export code ---*/
2725 /*--- Function export code ---*/
2726 /*--- Type init code ---*/
2727 /*--- Type import code ---*/
2728 /*--- Variable import code ---*/
2729 /*--- Function import code ---*/
2730 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
2731 if (__Pyx_ImportFunction(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2732 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3064 /*--- Global type/function init code ---*/
3065 (void)__Pyx_modinit_global_init_code();
3066 (void)__Pyx_modinit_variable_export_code();
3067 (void)__Pyx_modinit_function_export_code();
3068 (void)__Pyx_modinit_type_init_code();
3069 (void)__Pyx_modinit_type_import_code();
3070 (void)__Pyx_modinit_variable_import_code();
3071 if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error;
27333072 /*--- Execution code ---*/
27343073 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
27353074 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
27423081 *
27433082 * cdef Mix_Music *current_music = NULL
27443083 */
2745 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
2746 __Pyx_GOTREF(__pyx_t_2);
3084 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
3085 __Pyx_GOTREF(__pyx_t_1);
27473086 __Pyx_INCREF(__pyx_n_s_error);
27483087 __Pyx_GIVEREF(__pyx_n_s_error);
2749 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error);
2750 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error)
2751 __Pyx_GOTREF(__pyx_t_3);
3088 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_error);
3089 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
3090 __Pyx_GOTREF(__pyx_t_2);
3091 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3092 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
3093 __Pyx_GOTREF(__pyx_t_1);
3094 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_1) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
3095 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27523096 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2753 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
2754 __Pyx_GOTREF(__pyx_t_2);
2755 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
2756 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2757 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27583097
27593098 /* "pygame_sdl2/mixer_music.pyx":26
27603099 * from pygame_sdl2.error import error
27933132 * global current_music
27943133 *
27953134 */
2796 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_1load, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)
2797 __Pyx_GOTREF(__pyx_t_3);
2798 if (PyDict_SetItem(__pyx_d, __pyx_n_s_load, __pyx_t_3) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
2799 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3135 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_1load, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 44, __pyx_L1_error)
3136 __Pyx_GOTREF(__pyx_t_2);
3137 if (PyDict_SetItem(__pyx_d, __pyx_n_s_load, __pyx_t_2) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
3138 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28003139
28013140 /* "pygame_sdl2/mixer_music.pyx":55
28023141 * raise error()
28053144 * Mix_FadeInMusicPos(current_music, loops, 0, start)
28063145 *
28073146 */
2808 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_3play, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error)
2809 __Pyx_GOTREF(__pyx_t_3);
2810 if (PyDict_SetItem(__pyx_d, __pyx_n_s_play, __pyx_t_3) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
2811 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3147 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_3play, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
3148 __Pyx_GOTREF(__pyx_t_2);
3149 if (PyDict_SetItem(__pyx_d, __pyx_n_s_play, __pyx_t_2) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
3150 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28123151
28133152 /* "pygame_sdl2/mixer_music.pyx":61
28143153 * Mix_RewindMusic()
28173156 * Mix_HaltMusic()
28183157 *
28193158 */
2820 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_7stop, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __pyx_L1_error)
2821 __Pyx_GOTREF(__pyx_t_3);
2822 if (PyDict_SetItem(__pyx_d, __pyx_n_s_stop, __pyx_t_3) < 0) __PYX_ERR(0, 61, __pyx_L1_error)
2823 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3159 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_7stop, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error)
3160 __Pyx_GOTREF(__pyx_t_2);
3161 if (PyDict_SetItem(__pyx_d, __pyx_n_s_stop, __pyx_t_2) < 0) __PYX_ERR(0, 61, __pyx_L1_error)
3162 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28243163
28253164 /* "pygame_sdl2/mixer_music.pyx":64
28263165 * Mix_HaltMusic()
28293168 * Mix_PauseMusic()
28303169 *
28313170 */
2832 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_9pause, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 64, __pyx_L1_error)
2833 __Pyx_GOTREF(__pyx_t_3);
2834 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pause, __pyx_t_3) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
2835 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3171 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_9pause, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 64, __pyx_L1_error)
3172 __Pyx_GOTREF(__pyx_t_2);
3173 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pause, __pyx_t_2) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
3174 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28363175
28373176 /* "pygame_sdl2/mixer_music.pyx":67
28383177 * Mix_PauseMusic()
28413180 * Mix_ResumeMusic()
28423181 *
28433182 */
2844 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_11unpause, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error)
2845 __Pyx_GOTREF(__pyx_t_3);
2846 if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpause, __pyx_t_3) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
2847 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3183 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_11unpause, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
3184 __Pyx_GOTREF(__pyx_t_2);
3185 if (PyDict_SetItem(__pyx_d, __pyx_n_s_unpause, __pyx_t_2) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
3186 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28483187
28493188 /* "pygame_sdl2/mixer_music.pyx":70
28503189 * Mix_ResumeMusic()
28533192 * Mix_FadeOutMusic(time)
28543193 *
28553194 */
2856 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_13fadeout, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error)
2857 __Pyx_GOTREF(__pyx_t_3);
2858 if (PyDict_SetItem(__pyx_d, __pyx_n_s_fadeout, __pyx_t_3) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
2859 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3195 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_13fadeout, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
3196 __Pyx_GOTREF(__pyx_t_2);
3197 if (PyDict_SetItem(__pyx_d, __pyx_n_s_fadeout, __pyx_t_2) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
3198 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28603199
28613200 /* "pygame_sdl2/mixer_music.pyx":73
28623201 * Mix_FadeOutMusic(time)
28653204 * Mix_VolumeMusic(<int>(MIX_MAX_VOLUME * value))
28663205 *
28673206 */
2868 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_15set_volume, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error)
2869 __Pyx_GOTREF(__pyx_t_3);
2870 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_volume, __pyx_t_3) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
2871 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3207 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_15set_volume, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error)
3208 __Pyx_GOTREF(__pyx_t_2);
3209 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_volume, __pyx_t_2) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
3210 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28723211
28733212 /* "pygame_sdl2/mixer_music.pyx":76
28743213 * Mix_VolumeMusic(<int>(MIX_MAX_VOLUME * value))
28773216 * return Mix_VolumeMusic(-1) / <double>MIX_MAX_VOLUME
28783217 *
28793218 */
2880 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_17get_volume, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
2881 __Pyx_GOTREF(__pyx_t_3);
2882 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_volume, __pyx_t_3) < 0) __PYX_ERR(0, 76, __pyx_L1_error)
2883 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3219 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_17get_volume, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
3220 __Pyx_GOTREF(__pyx_t_2);
3221 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_volume, __pyx_t_2) < 0) __PYX_ERR(0, 76, __pyx_L1_error)
3222 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28843223
28853224 /* "pygame_sdl2/mixer_music.pyx":79
28863225 * return Mix_VolumeMusic(-1) / <double>MIX_MAX_VOLUME
28893228 * return Mix_PlayingMusic()
28903229 *
28913230 */
2892 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_19get_busy, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
2893 __Pyx_GOTREF(__pyx_t_3);
2894 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_busy, __pyx_t_3) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
2895 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3231 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_19get_busy, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
3232 __Pyx_GOTREF(__pyx_t_2);
3233 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_busy, __pyx_t_2) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
3234 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28963235
28973236 /* "pygame_sdl2/mixer_music.pyx":82
28983237 * return Mix_PlayingMusic()
29013240 * Mix_SetMusicPosition(pos)
29023241 *
29033242 */
2904 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_21set_pos, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error)
2905 __Pyx_GOTREF(__pyx_t_3);
2906 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_pos, __pyx_t_3) < 0) __PYX_ERR(0, 82, __pyx_L1_error)
2907 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3243 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_21set_pos, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
3244 __Pyx_GOTREF(__pyx_t_2);
3245 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_pos, __pyx_t_2) < 0) __PYX_ERR(0, 82, __pyx_L1_error)
3246 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29083247
29093248 /* "pygame_sdl2/mixer_music.pyx":85
29103249 * Mix_SetMusicPosition(pos)
29133252 * # TODO: Use a Mix_SetPostMix callback to track position.
29143253 * raise error("Not implemented.")
29153254 */
2916 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_23get_pos, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
2917 __Pyx_GOTREF(__pyx_t_3);
2918 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_pos, __pyx_t_3) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
2919 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3255 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_23get_pos, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
3256 __Pyx_GOTREF(__pyx_t_2);
3257 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_pos, __pyx_t_2) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
3258 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29203259
29213260 /* "pygame_sdl2/mixer_music.pyx":89
29223261 * raise error("Not implemented.")
29253264 * Mix_HookMusicFinished(music_finished)
29263265 * if get_busy():
29273266 */
2928 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_25queue, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
2929 __Pyx_GOTREF(__pyx_t_3);
2930 if (PyDict_SetItem(__pyx_d, __pyx_n_s_queue, __pyx_t_3) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
2931 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3267 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_25queue, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error)
3268 __Pyx_GOTREF(__pyx_t_2);
3269 if (PyDict_SetItem(__pyx_d, __pyx_n_s_queue, __pyx_t_2) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
3270 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29323271
29333272 /* "pygame_sdl2/mixer_music.pyx":98
29343273 * play()
29373276 * Mix_HookMusicFinished(music_finished)
29383277 * global endevent
29393278 */
2940 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_27set_endevent, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error)
2941 __Pyx_GOTREF(__pyx_t_3);
2942 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_endevent, __pyx_t_3) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
2943 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3279 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_27set_endevent, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
3280 __Pyx_GOTREF(__pyx_t_2);
3281 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_endevent, __pyx_t_2) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
3282 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29443283
29453284 /* "pygame_sdl2/mixer_music.pyx":103
29463285 * endevent = type or 0
29483287 * def get_endevent(): # <<<<<<<<<<<<<<
29493288 * return endevent
29503289 */
2951 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_29get_endevent, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error)
2952 __Pyx_GOTREF(__pyx_t_3);
2953 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_endevent, __pyx_t_3) < 0) __PYX_ERR(0, 103, __pyx_L1_error)
2954 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3290 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11mixer_music_29get_endevent, NULL, __pyx_n_s_pygame_sdl2_mixer_music); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
3291 __Pyx_GOTREF(__pyx_t_2);
3292 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_endevent, __pyx_t_2) < 0) __PYX_ERR(0, 103, __pyx_L1_error)
3293 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29553294
29563295 /* "pygame_sdl2/mixer_music.pyx":1
29573296 * # Copyright 2014 Patrick Dawson <pat@dw.is> # <<<<<<<<<<<<<<
29583297 * #
29593298 * # This software is provided 'as-is', without any express or implied
29603299 */
2961 __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error)
2962 __Pyx_GOTREF(__pyx_t_3);
2963 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2964 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3300 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
3301 __Pyx_GOTREF(__pyx_t_2);
3302 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3303 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29653304
29663305 /*--- Wrapped vars code ---*/
29673306
29693308 __pyx_L1_error:;
29703309 __Pyx_XDECREF(__pyx_t_1);
29713310 __Pyx_XDECREF(__pyx_t_2);
2972 __Pyx_XDECREF(__pyx_t_3);
29733311 if (__pyx_m) {
29743312 if (__pyx_d) {
2975 __Pyx_AddTraceback("init pygame_sdl2.mixer_music", __pyx_clineno, __pyx_lineno, __pyx_filename);
3313 __Pyx_AddTraceback("init pygame_sdl2.mixer_music", 0, __pyx_lineno, __pyx_filename);
29763314 }
29773315 Py_DECREF(__pyx_m); __pyx_m = 0;
29783316 } else if (!PyErr_Occurred()) {
29803318 }
29813319 __pyx_L0:;
29823320 __Pyx_RefNannyFinishContext();
2983 #if PY_MAJOR_VERSION < 3
3321 #if CYTHON_PEP489_MULTI_PHASE_INIT
3322 return (__pyx_m != NULL) ? 0 : -1;
3323 #elif PY_MAJOR_VERSION >= 3
3324 return __pyx_m;
3325 #else
29843326 return;
2985 #else
2986 return __pyx_m;
29873327 #endif
29883328 }
29893329
30053345 }
30063346 #endif
30073347
3348 /* PyObjectGetAttrStr */
3349 #if CYTHON_USE_TYPE_SLOTS
3350 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
3351 PyTypeObject* tp = Py_TYPE(obj);
3352 if (likely(tp->tp_getattro))
3353 return tp->tp_getattro(obj, attr_name);
3354 #if PY_MAJOR_VERSION < 3
3355 if (likely(tp->tp_getattr))
3356 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
3357 #endif
3358 return PyObject_GetAttr(obj, attr_name);
3359 }
3360 #endif
3361
30083362 /* GetBuiltinName */
30093363 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
30103364 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
30233377 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
30243378 PyObject *result;
30253379 #if !CYTHON_AVOID_BORROWED_REFS
3380 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
3381 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
3382 if (likely(result)) {
3383 Py_INCREF(result);
3384 } else if (unlikely(PyErr_Occurred())) {
3385 result = NULL;
3386 } else {
3387 #else
30263388 result = PyDict_GetItem(__pyx_d, name);
30273389 if (likely(result)) {
30283390 Py_INCREF(result);
30293391 } else {
3392 #endif
30303393 #else
30313394 result = PyObject_GetItem(__pyx_d, name);
30323395 if (!result) {
30383401 }
30393402
30403403 /* PyCFunctionFastCall */
3041 #if CYTHON_FAST_PYCCALL
3404 #if CYTHON_FAST_PYCCALL
30423405 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
30433406 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
30443407 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
30453408 PyObject *self = PyCFunction_GET_SELF(func);
3409 int flags = PyCFunction_GET_FLAGS(func);
30463410 assert(PyCFunction_Check(func));
3047 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
3411 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
30483412 assert(nargs >= 0);
30493413 assert(nargs == 0 || args != NULL);
30503414 /* _PyCFunction_FastCallDict() must not be called with an exception set,
30513415 because it may clear it (directly or indirectly) and so the
30523416 caller loses its exception */
30533417 assert(!PyErr_Occurred());
3054 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
3055 }
3056 #endif // CYTHON_FAST_PYCCALL
3418 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
3419 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
3420 } else {
3421 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
3422 }
3423 }
3424 #endif
30573425
30583426 /* PyFunctionFastCall */
3059 #if CYTHON_FAST_PYCALL
3427 #if CYTHON_FAST_PYCALL
30603428 #include "frameobject.h"
30613429 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
30623430 PyObject *globals) {
30633431 PyFrameObject *f;
3064 PyThreadState *tstate = PyThreadState_GET();
3432 PyThreadState *tstate = __Pyx_PyThreadState_Current;
30653433 PyObject **fastlocals;
30663434 Py_ssize_t i;
30673435 PyObject *result;
31723540 Py_LeaveRecursiveCall();
31733541 return result;
31743542 }
3175 #endif // CPython < 3.6
3176 #endif // CYTHON_FAST_PYCALL
3543 #endif
3544 #endif
31773545
31783546 /* PyObjectCall */
3179 #if CYTHON_COMPILING_IN_CPYTHON
3547 #if CYTHON_COMPILING_IN_CPYTHON
31803548 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
31813549 PyObject *result;
31823550 ternaryfunc call = func->ob_type->tp_call;
31963564 #endif
31973565
31983566 /* PyObjectCallMethO */
3199 #if CYTHON_COMPILING_IN_CPYTHON
3567 #if CYTHON_COMPILING_IN_CPYTHON
32003568 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
32013569 PyObject *self, *result;
32023570 PyCFunction cfunc;
32163584 #endif
32173585
32183586 /* PyObjectCallOneArg */
3219 #if CYTHON_COMPILING_IN_CPYTHON
3587 #if CYTHON_COMPILING_IN_CPYTHON
32203588 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
32213589 PyObject *result;
32223590 PyObject *args = PyTuple_New(1);
32333601 return __Pyx_PyFunction_FastCall(func, &arg, 1);
32343602 }
32353603 #endif
3236 #ifdef __Pyx_CyFunction_USED
3237 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
3238 #else
32393604 if (likely(PyCFunction_Check(func))) {
3240 #endif
32413605 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
32423606 return __Pyx_PyObject_CallMethO(func, arg);
32433607 #if CYTHON_FAST_PYCCALL
32683632 }
32693633 #endif
32703634 #ifdef __Pyx_CyFunction_USED
3271 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
3635 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
32723636 #else
32733637 if (likely(PyCFunction_Check(func))) {
32743638 #endif
34623826 "raise: exception class must be a subclass of BaseException");
34633827 goto bad;
34643828 }
3465 #if PY_VERSION_HEX >= 0x03030000
34663829 if (cause) {
3467 #else
3468 if (cause && cause != Py_None) {
3469 #endif
34703830 PyObject *fixed_cause;
34713831 if (cause == Py_None) {
34723832 fixed_cause = NULL;
34943854 PyErr_Restore(tmp_type, tmp_value, tb);
34953855 Py_XDECREF(tmp_tb);
34963856 #else
3497 PyThreadState *tstate = PyThreadState_GET();
3857 PyThreadState *tstate = __Pyx_PyThreadState_Current;
34983858 PyObject* tmp_tb = tstate->curexc_traceback;
34993859 if (tb != tmp_tb) {
35003860 Py_INCREF(tb);
35103870 #endif
35113871
35123872 /* RaiseDoubleKeywords */
3513 static void __Pyx_RaiseDoubleKeywordsError(
3873 static void __Pyx_RaiseDoubleKeywordsError(
35143874 const char* func_name,
35153875 PyObject* kw_name)
35163876 {
35243884 }
35253885
35263886 /* ParseKeywords */
3527 static int __Pyx_ParseOptionalKeywords(
3887 static int __Pyx_ParseOptionalKeywords(
35283888 PyObject *kwds,
35293889 PyObject **argnames[],
35303890 PyObject *kwds2,
36263986 }
36273987
36283988 /* RaiseArgTupleInvalid */
3629 static void __Pyx_RaiseArgtupleInvalid(
3989 static void __Pyx_RaiseArgtupleInvalid(
36303990 const char* func_name,
36313991 int exact,
36323992 Py_ssize_t num_min,
36524012 }
36534013
36544014 /* Import */
3655 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
4015 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
36564016 PyObject *empty_list = 0;
36574017 PyObject *module = 0;
36584018 PyObject *global_dict = 0;
36594019 PyObject *empty_dict = 0;
36604020 PyObject *list;
3661 #if PY_VERSION_HEX < 0x03030000
4021 #if PY_MAJOR_VERSION < 3
36624022 PyObject *py_import;
36634023 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
36644024 if (!py_import)
36824042 #if PY_MAJOR_VERSION >= 3
36834043 if (level == -1) {
36844044 if (strchr(__Pyx_MODULE_NAME, '.')) {
3685 #if PY_VERSION_HEX < 0x03030000
3686 PyObject *py_level = PyInt_FromLong(1);
3687 if (!py_level)
3688 goto bad;
3689 module = PyObject_CallFunctionObjArgs(py_import,
3690 name, global_dict, empty_dict, list, py_level, NULL);
3691 Py_DECREF(py_level);
3692 #else
36934045 module = PyImport_ImportModuleLevelObject(
36944046 name, global_dict, empty_dict, list, 1);
3695 #endif
36964047 if (!module) {
36974048 if (!PyErr_ExceptionMatches(PyExc_ImportError))
36984049 goto bad;
37034054 }
37044055 #endif
37054056 if (!module) {
3706 #if PY_VERSION_HEX < 0x03030000
4057 #if PY_MAJOR_VERSION < 3
37074058 PyObject *py_level = PyInt_FromLong(level);
37084059 if (!py_level)
37094060 goto bad;
37174068 }
37184069 }
37194070 bad:
3720 #if PY_VERSION_HEX < 0x03030000
4071 #if PY_MAJOR_VERSION < 3
37214072 Py_XDECREF(py_import);
37224073 #endif
37234074 Py_XDECREF(empty_list);
37264077 }
37274078
37284079 /* ImportFrom */
3729 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
4080 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
37304081 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
37314082 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
37324083 PyErr_Format(PyExc_ImportError,
37394090 return value;
37404091 }
37414092
4093 /* CLineInTraceback */
4094 #ifndef CYTHON_CLINE_IN_TRACEBACK
4095 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
4096 PyObject *use_cline;
4097 PyObject *ptype, *pvalue, *ptraceback;
4098 #if CYTHON_COMPILING_IN_CPYTHON
4099 PyObject **cython_runtime_dict;
4100 #endif
4101 if (unlikely(!__pyx_cython_runtime)) {
4102 return c_line;
4103 }
4104 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
4105 #if CYTHON_COMPILING_IN_CPYTHON
4106 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
4107 if (likely(cython_runtime_dict)) {
4108 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
4109 } else
4110 #endif
4111 {
4112 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
4113 if (use_cline_obj) {
4114 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
4115 Py_DECREF(use_cline_obj);
4116 } else {
4117 PyErr_Clear();
4118 use_cline = NULL;
4119 }
4120 }
4121 if (!use_cline) {
4122 c_line = 0;
4123 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
4124 }
4125 else if (PyObject_Not(use_cline) != 0) {
4126 c_line = 0;
4127 }
4128 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
4129 return c_line;
4130 }
4131 #endif
4132
37424133 /* CodeObjectCache */
3743 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
4134 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
37444135 int start = 0, mid = 0, end = count - 1;
37454136 if (end >= 0 && code_line > entries[end].code_line) {
37464137 return count;
38204211 }
38214212
38224213 /* AddTraceback */
3823 #include "compile.h"
4214 #include "compile.h"
38244215 #include "frameobject.h"
38254216 #include "traceback.h"
38264217 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
38794270 int py_line, const char *filename) {
38804271 PyCodeObject *py_code = 0;
38814272 PyFrameObject *py_frame = 0;
3882 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
4273 PyThreadState *tstate = __Pyx_PyThreadState_Current;
4274 if (c_line) {
4275 c_line = __Pyx_CLineForTraceback(tstate, c_line);
4276 }
4277 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
38834278 if (!py_code) {
38844279 py_code = __Pyx_CreateCodeObjectForTraceback(
38854280 funcname, c_line, py_line, filename);
38864281 if (!py_code) goto bad;
3887 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
4282 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
38884283 }
38894284 py_frame = PyFrame_New(
3890 PyThreadState_GET(), /*PyThreadState *tstate,*/
3891 py_code, /*PyCodeObject *code,*/
3892 __pyx_d, /*PyObject *globals,*/
3893 0 /*PyObject *locals*/
4285 tstate, /*PyThreadState *tstate,*/
4286 py_code, /*PyCodeObject *code,*/
4287 __pyx_d, /*PyObject *globals,*/
4288 0 /*PyObject *locals*/
38944289 );
38954290 if (!py_frame) goto bad;
38964291 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
39014296 }
39024297
39034298 /* CIntFromPyVerify */
3904 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
4299 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
39054300 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
39064301 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
39074302 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
39234318 }
39244319
39254320 /* CIntToPy */
3926 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
4321 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
39274322 const int neg_one = (int) -1, const_zero = (int) 0;
39284323 const int is_unsigned = neg_one > const_zero;
39294324 if (is_unsigned) {
39544349 }
39554350
39564351 /* CIntToPy */
3957 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
4352 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
39584353 const long neg_one = (long) -1, const_zero = (long) 0;
39594354 const int is_unsigned = neg_one > const_zero;
39604355 if (is_unsigned) {
39854380 }
39864381
39874382 /* CIntFromPy */
3988 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
4383 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
39894384 const int neg_one = (int) -1, const_zero = (int) 0;
39904385 const int is_unsigned = neg_one > const_zero;
39914386 #if PY_MAJOR_VERSION < 3
41744569 }
41754570
41764571 /* CIntFromPy */
4177 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
4572 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
41784573 const long neg_one = (long) -1, const_zero = (long) 0;
41794574 const int is_unsigned = neg_one > const_zero;
41804575 #if PY_MAJOR_VERSION < 3
43624757 return (long) -1;
43634758 }
43644759
4760 /* FastTypeChecks */
4761 #if CYTHON_COMPILING_IN_CPYTHON
4762 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
4763 while (a) {
4764 a = a->tp_base;
4765 if (a == b)
4766 return 1;
4767 }
4768 return b == &PyBaseObject_Type;
4769 }
4770 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
4771 PyObject *mro;
4772 if (a == b) return 1;
4773 mro = a->tp_mro;
4774 if (likely(mro)) {
4775 Py_ssize_t i, n;
4776 n = PyTuple_GET_SIZE(mro);
4777 for (i = 0; i < n; i++) {
4778 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
4779 return 1;
4780 }
4781 return 0;
4782 }
4783 return __Pyx_InBases(a, b);
4784 }
4785 #if PY_MAJOR_VERSION == 2
4786 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
4787 PyObject *exception, *value, *tb;
4788 int res;
4789 __Pyx_PyThreadState_declare
4790 __Pyx_PyThreadState_assign
4791 __Pyx_ErrFetch(&exception, &value, &tb);
4792 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
4793 if (unlikely(res == -1)) {
4794 PyErr_WriteUnraisable(err);
4795 res = 0;
4796 }
4797 if (!res) {
4798 res = PyObject_IsSubclass(err, exc_type2);
4799 if (unlikely(res == -1)) {
4800 PyErr_WriteUnraisable(err);
4801 res = 0;
4802 }
4803 }
4804 __Pyx_ErrRestore(exception, value, tb);
4805 return res;
4806 }
4807 #else
4808 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
4809 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
4810 if (!res) {
4811 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
4812 }
4813 return res;
4814 }
4815 #endif
4816 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
4817 Py_ssize_t i, n;
4818 assert(PyExceptionClass_Check(exc_type));
4819 n = PyTuple_GET_SIZE(tuple);
4820 #if PY_MAJOR_VERSION >= 3
4821 for (i=0; i<n; i++) {
4822 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
4823 }
4824 #endif
4825 for (i=0; i<n; i++) {
4826 PyObject *t = PyTuple_GET_ITEM(tuple, i);
4827 #if PY_MAJOR_VERSION < 3
4828 if (likely(exc_type == t)) return 1;
4829 #endif
4830 if (likely(PyExceptionClass_Check(t))) {
4831 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
4832 } else {
4833 }
4834 }
4835 return 0;
4836 }
4837 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
4838 if (likely(err == exc_type)) return 1;
4839 if (likely(PyExceptionClass_Check(err))) {
4840 if (likely(PyExceptionClass_Check(exc_type))) {
4841 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
4842 } else if (likely(PyTuple_Check(exc_type))) {
4843 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
4844 } else {
4845 }
4846 }
4847 return PyErr_GivenExceptionMatches(err, exc_type);
4848 }
4849 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
4850 assert(PyExceptionClass_Check(exc_type1));
4851 assert(PyExceptionClass_Check(exc_type2));
4852 if (likely(err == exc_type1 || err == exc_type2)) return 1;
4853 if (likely(PyExceptionClass_Check(err))) {
4854 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
4855 }
4856 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
4857 }
4858 #endif
4859
43654860 /* CheckBinaryVersion */
4366 static int __Pyx_check_binary_version(void) {
4861 static int __Pyx_check_binary_version(void) {
43674862 char ctversion[4], rtversion[4];
43684863 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
43694864 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
43794874 }
43804875
43814876 /* ModuleImport */
4382 #ifndef __PYX_HAVE_RT_ImportModule
4877 #ifndef __PYX_HAVE_RT_ImportModule
43834878 #define __PYX_HAVE_RT_ImportModule
43844879 static PyObject *__Pyx_ImportModule(const char *name) {
43854880 PyObject *py_name = 0;
43974892 #endif
43984893
43994894 /* FunctionImport */
4400 #ifndef __PYX_HAVE_RT_ImportFunction
4895 #ifndef __PYX_HAVE_RT_ImportFunction
44014896 #define __PYX_HAVE_RT_ImportFunction
44024897 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
44034898 PyObject *d = 0;
44514946 #endif
44524947
44534948 /* InitStrings */
4454 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
4949 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
44554950 while (t->p) {
44564951 #if PY_MAJOR_VERSION < 3
44574952 if (t->is_unicode) {
44764971 #endif
44774972 if (!*t->p)
44784973 return -1;
4974 if (PyObject_Hash(*t->p) == -1)
4975 return -1;
44794976 ++t;
44804977 }
44814978 return 0;
44844981 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
44854982 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
44864983 }
4487 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
4984 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
44884985 Py_ssize_t ignore;
44894986 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
44904987 }
4491 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
4492 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
4988 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
4989 #if !CYTHON_PEP393_ENABLED
4990 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
4991 char* defenc_c;
4992 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
4993 if (!defenc) return NULL;
4994 defenc_c = PyBytes_AS_STRING(defenc);
4995 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
4996 {
4997 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
4998 char* c;
4999 for (c = defenc_c; c < end; c++) {
5000 if ((unsigned char) (*c) >= 128) {
5001 PyUnicode_AsASCIIString(o);
5002 return NULL;
5003 }
5004 }
5005 }
5006 #endif
5007 *length = PyBytes_GET_SIZE(defenc);
5008 return defenc_c;
5009 }
5010 #else
5011 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5012 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
5013 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5014 if (likely(PyUnicode_IS_ASCII(o))) {
5015 *length = PyUnicode_GET_LENGTH(o);
5016 return PyUnicode_AsUTF8(o);
5017 } else {
5018 PyUnicode_AsASCIIString(o);
5019 return NULL;
5020 }
5021 #else
5022 return PyUnicode_AsUTF8AndSize(o, length);
5023 #endif
5024 }
5025 #endif
5026 #endif
5027 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5028 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
44935029 if (
44945030 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
44955031 __Pyx_sys_getdefaultencoding_not_ascii &&
44965032 #endif
44975033 PyUnicode_Check(o)) {
4498 #if PY_VERSION_HEX < 0x03030000
4499 char* defenc_c;
4500 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
4501 if (!defenc) return NULL;
4502 defenc_c = PyBytes_AS_STRING(defenc);
4503 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
4504 {
4505 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
4506 char* c;
4507 for (c = defenc_c; c < end; c++) {
4508 if ((unsigned char) (*c) >= 128) {
4509 PyUnicode_AsASCIIString(o);
4510 return NULL;
4511 }
4512 }
4513 }
4514 #endif
4515 *length = PyBytes_GET_SIZE(defenc);
4516 return defenc_c;
4517 #else
4518 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
4519 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
4520 if (PyUnicode_IS_ASCII(o)) {
4521 *length = PyUnicode_GET_LENGTH(o);
4522 return PyUnicode_AsUTF8(o);
4523 } else {
4524 PyUnicode_AsASCIIString(o);
4525 return NULL;
4526 }
4527 #else
4528 return PyUnicode_AsUTF8AndSize(o, length);
4529 #endif
4530 #endif
5034 return __Pyx_PyUnicode_AsStringAndSize(o, length);
45315035 } else
45325036 #endif
45335037 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
45515055 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
45525056 else return PyObject_IsTrue(x);
45535057 }
5058 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
5059 #if PY_MAJOR_VERSION >= 3
5060 if (PyLong_Check(result)) {
5061 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
5062 "__int__ returned non-int (type %.200s). "
5063 "The ability to return an instance of a strict subclass of int "
5064 "is deprecated, and may be removed in a future version of Python.",
5065 Py_TYPE(result)->tp_name)) {
5066 Py_DECREF(result);
5067 return NULL;
5068 }
5069 return result;
5070 }
5071 #endif
5072 PyErr_Format(PyExc_TypeError,
5073 "__%.4s__ returned non-%.4s (type %.200s)",
5074 type_name, type_name, Py_TYPE(result)->tp_name);
5075 Py_DECREF(result);
5076 return NULL;
5077 }
45545078 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
45555079 #if CYTHON_USE_TYPE_SLOTS
45565080 PyNumberMethods *m;
45585082 const char *name = NULL;
45595083 PyObject *res = NULL;
45605084 #if PY_MAJOR_VERSION < 3
4561 if (PyInt_Check(x) || PyLong_Check(x))
4562 #else
4563 if (PyLong_Check(x))
5085 if (likely(PyInt_Check(x) || PyLong_Check(x)))
5086 #else
5087 if (likely(PyLong_Check(x)))
45645088 #endif
45655089 return __Pyx_NewRef(x);
45665090 #if CYTHON_USE_TYPE_SLOTS
45685092 #if PY_MAJOR_VERSION < 3
45695093 if (m && m->nb_int) {
45705094 name = "int";
4571 res = PyNumber_Int(x);
5095 res = m->nb_int(x);
45725096 }
45735097 else if (m && m->nb_long) {
45745098 name = "long";
4575 res = PyNumber_Long(x);
5099 res = m->nb_long(x);
45765100 }
45775101 #else
4578 if (m && m->nb_int) {
5102 if (likely(m && m->nb_int)) {
45795103 name = "int";
4580 res = PyNumber_Long(x);
5104 res = m->nb_int(x);
45815105 }
45825106 #endif
45835107 #else
4584 res = PyNumber_Int(x);
4585 #endif
4586 if (res) {
5108 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
5109 res = PyNumber_Int(x);
5110 }
5111 #endif
5112 if (likely(res)) {
45875113 #if PY_MAJOR_VERSION < 3
4588 if (!PyInt_Check(res) && !PyLong_Check(res)) {
4589 #else
4590 if (!PyLong_Check(res)) {
4591 #endif
4592 PyErr_Format(PyExc_TypeError,
4593 "__%.4s__ returned non-%.4s (type %.200s)",
4594 name, name, Py_TYPE(res)->tp_name);
4595 Py_DECREF(res);
4596 return NULL;
5114 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
5115 #else
5116 if (unlikely(!PyLong_CheckExact(res))) {
5117 #endif
5118 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
45975119 }
45985120 }
45995121 else if (!PyErr_Occurred()) {
46645186 Py_DECREF(x);
46655187 return ival;
46665188 }
5189 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
5190 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
5191 }
46675192 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
46685193 return PyInt_FromSize_t(ival);
46695194 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
8 #else
9 #define CYTHON_ABI "0_25_2"
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
8 #else
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
105123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
108132 #define CYTHON_USE_ASYNC_SLOTS 0
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
409549 { \
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420552
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
428560
429561 #define __PYX_HAVE__pygame_sdl2__mouse
430562 #define __PYX_HAVE_API__pygame_sdl2__mouse
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
437570 #include <omp.h>
438571 #endif /* _OPENMP */
439572
440 #ifdef PYREX_WITHOUT_ASSERTIONS
573 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
441574 #define CYTHON_WITHOUT_ASSERTIONS
442575 #endif
443576
468601 #define __Pyx_sst_abs(value) abs(value)
469602 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
470603 #define __Pyx_sst_abs(value) labs(value)
471 #elif defined (_MSC_VER) && defined (_M_X64)
472 #define __Pyx_sst_abs(value) _abs64(value)
604 #elif defined (_MSC_VER)
605 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
473606 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
474607 #define __Pyx_sst_abs(value) llabs(value)
475608 #elif defined (__GNUC__)
477610 #else
478611 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
479612 #endif
480 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
481 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
613 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
614 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
482615 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
483616 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
484617 #define __Pyx_PyBytes_FromString PyBytes_FromString
491624 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
492625 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
493626 #endif
494 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
495 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
627 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
628 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
629 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
634 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
635 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
496638 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
497639 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
498640 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
499641 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
500642 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
501 #if PY_MAJOR_VERSION < 3
502 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
503 {
643 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
504644 const Py_UNICODE *u_end = u;
505645 while (*u_end++) ;
506646 return (size_t)(u_end - u - 1);
507647 }
508 #else
509 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
510 #endif
511648 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
512649 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
513650 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
514651 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
515652 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
516 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
653 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
517654 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
518655 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
656 #define __Pyx_PySequence_Tuple(obj)\
657 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
519658 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
520659 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
521660 #if CYTHON_ASSUME_SAFE_MACROS
614753 #define likely(x) (x)
615754 #define unlikely(x) (x)
616755 #endif /* __GNUC__ */
617
618 static PyObject *__pyx_m;
756 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
757
758 static PyObject *__pyx_m = NULL;
619759 static PyObject *__pyx_d;
620760 static PyObject *__pyx_b;
761 static PyObject *__pyx_cython_runtime = NULL;
621762 static PyObject *__pyx_empty_tuple;
622763 static PyObject *__pyx_empty_bytes;
623764 static PyObject *__pyx_empty_unicode;
721862 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
722863 const char* function_name);
723864
865 /* PyObjectGetAttrStr.proto */
866 #if CYTHON_USE_TYPE_SLOTS
867 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
868 #else
869 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
870 #endif
871
872 /* PyThreadStateGet.proto */
873 #if CYTHON_FAST_THREAD_STATE
874 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
875 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
876 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
877 #else
878 #define __Pyx_PyThreadState_declare
879 #define __Pyx_PyThreadState_assign
880 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
881 #endif
882
883 /* PyErrFetchRestore.proto */
884 #if CYTHON_FAST_THREAD_STATE
885 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
886 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
887 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
888 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
889 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
890 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
891 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
892 #if CYTHON_COMPILING_IN_CPYTHON
893 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
894 #else
895 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
896 #endif
897 #else
898 #define __Pyx_PyErr_Clear() PyErr_Clear()
899 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
900 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
901 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
902 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
903 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
904 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
905 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
906 #endif
907
908 /* CLineInTraceback.proto */
909 #ifdef CYTHON_CLINE_IN_TRACEBACK
910 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
911 #else
912 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
913 #endif
914
724915 /* CodeObjectCache.proto */
725916 typedef struct {
726917 PyCodeObject* code_object;
752943 /* CIntFromPy.proto */
753944 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
754945
946 /* FastTypeChecks.proto */
947 #if CYTHON_COMPILING_IN_CPYTHON
948 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
949 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
950 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
951 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
952 #else
953 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
954 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
955 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
956 #endif
957 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
958
755959 /* CheckBinaryVersion.proto */
756960 static int __Pyx_check_binary_version(void);
757961
771975
772976 /* Module declarations from 'pygame_sdl2.mouse' */
773977 #define __Pyx_MODULE_NAME "pygame_sdl2.mouse"
978 extern int __pyx_module_is_main_pygame_sdl2__mouse;
774979 int __pyx_module_is_main_pygame_sdl2__mouse = 0;
775980
776981 /* Implementation of 'pygame_sdl2.mouse' */
7961001 static const char __pyx_k_get_pressed[] = "get_pressed";
7971002 static const char __pyx_k_set_visible[] = "set_visible";
7981003 static const char __pyx_k_pygame_sdl2_mouse[] = "pygame_sdl2.mouse";
1004 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
7991005 static const char __pyx_k_src_pygame_sdl2_mouse_pyx[] = "src/pygame_sdl2/mouse.pyx";
8001006 static PyObject *__pyx_n_s_andmasks;
1007 static PyObject *__pyx_n_s_cline_in_traceback;
8011008 static PyObject *__pyx_n_s_get_cursor;
8021009 static PyObject *__pyx_n_s_get_focused;
8031010 static PyObject *__pyx_n_s_get_pos;
8481055 static PyObject *__pyx_codeobj__13;
8491056 static PyObject *__pyx_codeobj__15;
8501057 static PyObject *__pyx_codeobj__16;
1058 /* Late includes */
8511059
8521060 /* "pygame_sdl2/mouse.pyx":21
8531061 * from sdl2 cimport *
10871295 * return (x, y)
10881296 *
10891297 */
1090 SDL_GetMouseState((&__pyx_v_x), (&__pyx_v_y));
1298 (void)(SDL_GetMouseState((&__pyx_v_x), (&__pyx_v_y)));
10911299
10921300 /* "pygame_sdl2/mouse.pyx":36
10931301 * cdef int x, y
11731381 * return (x, y)
11741382 *
11751383 */
1176 SDL_GetRelativeMouseState((&__pyx_v_x), (&__pyx_v_y));
1384 (void)(SDL_GetRelativeMouseState((&__pyx_v_x), (&__pyx_v_y)));
11771385
11781386 /* "pygame_sdl2/mouse.pyx":41
11791387 * cdef int x,y
12641472 */
12651473 if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) {
12661474 PyObject* sequence = __pyx_v_pos;
1267 #if !CYTHON_COMPILING_IN_PYPY
1268 Py_ssize_t size = Py_SIZE(sequence);
1269 #else
1270 Py_ssize_t size = PySequence_Size(sequence);
1271 #endif
1475 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
12721476 if (unlikely(size != 2)) {
12731477 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
12741478 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
13931597 } else {
13941598 __pyx_t_1 = 0;
13951599 }
1396 SDL_ShowCursor(__pyx_t_1);
1600 (void)(SDL_ShowCursor(__pyx_t_1));
13971601
13981602 /* "pygame_sdl2/mouse.pyx":47
13991603 * SDL_WarpMouseInWindow(NULL, x, y)
15031707 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15041708 switch (pos_args) {
15051709 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1710 CYTHON_FALLTHROUGH;
15061711 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1712 CYTHON_FALLTHROUGH;
15071713 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1714 CYTHON_FALLTHROUGH;
15081715 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1716 CYTHON_FALLTHROUGH;
15091717 case 0: break;
15101718 default: goto __pyx_L5_argtuple_error;
15111719 }
15121720 kw_args = PyDict_Size(__pyx_kwds);
15131721 switch (pos_args) {
15141722 case 0:
1515 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
1723 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
15161724 else goto __pyx_L5_argtuple_error;
1725 CYTHON_FALLTHROUGH;
15171726 case 1:
1518 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hotspot)) != 0)) kw_args--;
1727 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hotspot)) != 0)) kw_args--;
15191728 else {
15201729 __Pyx_RaiseArgtupleInvalid("set_cursor", 1, 4, 4, 1); __PYX_ERR(0, 53, __pyx_L3_error)
15211730 }
1731 CYTHON_FALLTHROUGH;
15221732 case 2:
1523 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xormasks)) != 0)) kw_args--;
1733 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xormasks)) != 0)) kw_args--;
15241734 else {
15251735 __Pyx_RaiseArgtupleInvalid("set_cursor", 1, 4, 4, 2); __PYX_ERR(0, 53, __pyx_L3_error)
15261736 }
1737 CYTHON_FALLTHROUGH;
15271738 case 3:
1528 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_andmasks)) != 0)) kw_args--;
1739 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_andmasks)) != 0)) kw_args--;
15291740 else {
15301741 __Pyx_RaiseArgtupleInvalid("set_cursor", 1, 4, 4, 3); __PYX_ERR(0, 53, __pyx_L3_error)
15311742 }
16051816 * return None # <<<<<<<<<<<<<<
16061817 */
16071818 __Pyx_XDECREF(__pyx_r);
1608 __Pyx_INCREF(Py_None);
1609 __pyx_r = Py_None;
1819 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16101820 goto __pyx_L0;
16111821
16121822 /* "pygame_sdl2/mouse.pyx":57
16281838 };
16291839
16301840 #if PY_MAJOR_VERSION >= 3
1841 #if CYTHON_PEP489_MULTI_PHASE_INIT
1842 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
1843 static int __pyx_pymod_exec_mouse(PyObject* module); /*proto*/
1844 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
1845 {Py_mod_create, (void*)__pyx_pymod_create},
1846 {Py_mod_exec, (void*)__pyx_pymod_exec_mouse},
1847 {0, NULL}
1848 };
1849 #endif
1850
16311851 static struct PyModuleDef __pyx_moduledef = {
1632 #if PY_VERSION_HEX < 0x03020000
1633 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
1634 #else
16351852 PyModuleDef_HEAD_INIT,
1636 #endif
16371853 "mouse",
16381854 0, /* m_doc */
1855 #if CYTHON_PEP489_MULTI_PHASE_INIT
1856 0, /* m_size */
1857 #else
16391858 -1, /* m_size */
1859 #endif
16401860 __pyx_methods /* m_methods */,
1861 #if CYTHON_PEP489_MULTI_PHASE_INIT
1862 __pyx_moduledef_slots, /* m_slots */
1863 #else
16411864 NULL, /* m_reload */
1865 #endif
16421866 NULL, /* m_traverse */
16431867 NULL, /* m_clear */
16441868 NULL /* m_free */
16471871
16481872 static __Pyx_StringTabEntry __pyx_string_tab[] = {
16491873 {&__pyx_n_s_andmasks, __pyx_k_andmasks, sizeof(__pyx_k_andmasks), 0, 0, 1, 1},
1874 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
16501875 {&__pyx_n_s_get_cursor, __pyx_k_get_cursor, sizeof(__pyx_k_get_cursor), 0, 0, 1, 1},
16511876 {&__pyx_n_s_get_focused, __pyx_k_get_focused, sizeof(__pyx_k_get_focused), 0, 0, 1, 1},
16521877 {&__pyx_n_s_get_pos, __pyx_k_get_pos, sizeof(__pyx_k_get_pos), 0, 0, 1, 1},
16861911 * pass
16871912 *
16881913 */
1689 __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_init, 21, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 21, __pyx_L1_error)
1914 __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_init, 21, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 21, __pyx_L1_error)
16901915
16911916 /* "pygame_sdl2/mouse.pyx":24
16921917 * pass
16951920 * pass
16961921 *
16971922 */
1698 __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_quit, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 24, __pyx_L1_error)
1923 __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_quit, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 24, __pyx_L1_error)
16991924
17001925 /* "pygame_sdl2/mouse.pyx":27
17011926 * pass
17071932 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_state); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 27, __pyx_L1_error)
17081933 __Pyx_GOTREF(__pyx_tuple__3);
17091934 __Pyx_GIVEREF(__pyx_tuple__3);
1710 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_get_pressed, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 27, __pyx_L1_error)
1935 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_get_pressed, 27, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 27, __pyx_L1_error)
17111936
17121937 /* "pygame_sdl2/mouse.pyx":33
17131938 * 1 if state & SDL_BUTTON_RMASK else 0)
17191944 __pyx_tuple__5 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 33, __pyx_L1_error)
17201945 __Pyx_GOTREF(__pyx_tuple__5);
17211946 __Pyx_GIVEREF(__pyx_tuple__5);
1722 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_get_pos, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 33, __pyx_L1_error)
1947 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_get_pos, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 33, __pyx_L1_error)
17231948
17241949 /* "pygame_sdl2/mouse.pyx":38
17251950 * return (x, y)
17311956 __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 38, __pyx_L1_error)
17321957 __Pyx_GOTREF(__pyx_tuple__7);
17331958 __Pyx_GIVEREF(__pyx_tuple__7);
1734 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_get_rel, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 38, __pyx_L1_error)
1959 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_get_rel, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 38, __pyx_L1_error)
17351960
17361961 /* "pygame_sdl2/mouse.pyx":43
17371962 * return (x, y)
17431968 __pyx_tuple__9 = PyTuple_Pack(3, __pyx_n_s_pos, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 43, __pyx_L1_error)
17441969 __Pyx_GOTREF(__pyx_tuple__9);
17451970 __Pyx_GIVEREF(__pyx_tuple__9);
1746 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_set_pos, 43, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 43, __pyx_L1_error)
1971 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_set_pos, 43, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 43, __pyx_L1_error)
17471972
17481973 /* "pygame_sdl2/mouse.pyx":47
17491974 * SDL_WarpMouseInWindow(NULL, x, y)
17551980 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_visible); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 47, __pyx_L1_error)
17561981 __Pyx_GOTREF(__pyx_tuple__11);
17571982 __Pyx_GIVEREF(__pyx_tuple__11);
1758 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_set_visible, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 47, __pyx_L1_error)
1983 __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_set_visible, 47, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 47, __pyx_L1_error)
17591984
17601985 /* "pygame_sdl2/mouse.pyx":50
17611986 * SDL_ShowCursor(1 if visible else 0)
17641989 * return SDL_GetMouseFocus() != NULL
17651990 *
17661991 */
1767 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_get_focused, 50, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 50, __pyx_L1_error)
1992 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_get_focused, 50, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 50, __pyx_L1_error)
17681993
17691994 /* "pygame_sdl2/mouse.pyx":53
17701995 * return SDL_GetMouseFocus() != NULL
17762001 __pyx_tuple__14 = PyTuple_Pack(4, __pyx_n_s_size, __pyx_n_s_hotspot, __pyx_n_s_xormasks, __pyx_n_s_andmasks); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 53, __pyx_L1_error)
17772002 __Pyx_GOTREF(__pyx_tuple__14);
17782003 __Pyx_GIVEREF(__pyx_tuple__14);
1779 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_set_cursor, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 53, __pyx_L1_error)
2004 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_set_cursor, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 53, __pyx_L1_error)
17802005
17812006 /* "pygame_sdl2/mouse.pyx":57
17822007 * pass
17842009 * def get_cursor(): # <<<<<<<<<<<<<<
17852010 * return None
17862011 */
1787 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_get_cursor, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 57, __pyx_L1_error)
2012 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_mouse_pyx, __pyx_n_s_get_cursor, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 57, __pyx_L1_error)
17882013 __Pyx_RefNannyFinishContext();
17892014 return 0;
17902015 __pyx_L1_error:;
18012026 return -1;
18022027 }
18032028
2029 static int __Pyx_modinit_global_init_code(void); /*proto*/
2030 static int __Pyx_modinit_variable_export_code(void); /*proto*/
2031 static int __Pyx_modinit_function_export_code(void); /*proto*/
2032 static int __Pyx_modinit_type_init_code(void); /*proto*/
2033 static int __Pyx_modinit_type_import_code(void); /*proto*/
2034 static int __Pyx_modinit_variable_import_code(void); /*proto*/
2035 static int __Pyx_modinit_function_import_code(void); /*proto*/
2036
2037 static int __Pyx_modinit_global_init_code(void) {
2038 __Pyx_RefNannyDeclarations
2039 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
2040 /*--- Global init code ---*/
2041 __Pyx_RefNannyFinishContext();
2042 return 0;
2043 }
2044
2045 static int __Pyx_modinit_variable_export_code(void) {
2046 __Pyx_RefNannyDeclarations
2047 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
2048 /*--- Variable export code ---*/
2049 __Pyx_RefNannyFinishContext();
2050 return 0;
2051 }
2052
2053 static int __Pyx_modinit_function_export_code(void) {
2054 __Pyx_RefNannyDeclarations
2055 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
2056 /*--- Function export code ---*/
2057 __Pyx_RefNannyFinishContext();
2058 return 0;
2059 }
2060
2061 static int __Pyx_modinit_type_init_code(void) {
2062 __Pyx_RefNannyDeclarations
2063 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
2064 /*--- Type init code ---*/
2065 __Pyx_RefNannyFinishContext();
2066 return 0;
2067 }
2068
2069 static int __Pyx_modinit_type_import_code(void) {
2070 __Pyx_RefNannyDeclarations
2071 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
2072 /*--- Type import code ---*/
2073 __Pyx_RefNannyFinishContext();
2074 return 0;
2075 }
2076
2077 static int __Pyx_modinit_variable_import_code(void) {
2078 __Pyx_RefNannyDeclarations
2079 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
2080 /*--- Variable import code ---*/
2081 __Pyx_RefNannyFinishContext();
2082 return 0;
2083 }
2084
2085 static int __Pyx_modinit_function_import_code(void) {
2086 __Pyx_RefNannyDeclarations
2087 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
2088 /*--- Function import code ---*/
2089 __Pyx_RefNannyFinishContext();
2090 return 0;
2091 }
2092
2093
18042094 #if PY_MAJOR_VERSION < 3
1805 PyMODINIT_FUNC initmouse(void); /*proto*/
1806 PyMODINIT_FUNC initmouse(void)
1807 #else
1808 PyMODINIT_FUNC PyInit_mouse(void); /*proto*/
1809 PyMODINIT_FUNC PyInit_mouse(void)
2095 #ifdef CYTHON_NO_PYINIT_EXPORT
2096 #define __Pyx_PyMODINIT_FUNC void
2097 #else
2098 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
2099 #endif
2100 #else
2101 #ifdef CYTHON_NO_PYINIT_EXPORT
2102 #define __Pyx_PyMODINIT_FUNC PyObject *
2103 #else
2104 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
2105 #endif
2106 #endif
2107 #ifndef CYTHON_SMALL_CODE
2108 #if defined(__clang__)
2109 #define CYTHON_SMALL_CODE
2110 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
2111 #define CYTHON_SMALL_CODE __attribute__((cold))
2112 #else
2113 #define CYTHON_SMALL_CODE
2114 #endif
2115 #endif
2116
2117
2118 #if PY_MAJOR_VERSION < 3
2119 __Pyx_PyMODINIT_FUNC initmouse(void) CYTHON_SMALL_CODE; /*proto*/
2120 __Pyx_PyMODINIT_FUNC initmouse(void)
2121 #else
2122 __Pyx_PyMODINIT_FUNC PyInit_mouse(void) CYTHON_SMALL_CODE; /*proto*/
2123 __Pyx_PyMODINIT_FUNC PyInit_mouse(void)
2124 #if CYTHON_PEP489_MULTI_PHASE_INIT
2125 {
2126 return PyModuleDef_Init(&__pyx_moduledef);
2127 }
2128 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
2129 PyObject *value = PyObject_GetAttrString(spec, from_name);
2130 int result = 0;
2131 if (likely(value)) {
2132 result = PyDict_SetItemString(moddict, to_name, value);
2133 Py_DECREF(value);
2134 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
2135 PyErr_Clear();
2136 } else {
2137 result = -1;
2138 }
2139 return result;
2140 }
2141 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
2142 PyObject *module = NULL, *moddict, *modname;
2143 if (__pyx_m)
2144 return __Pyx_NewRef(__pyx_m);
2145 modname = PyObject_GetAttrString(spec, "name");
2146 if (unlikely(!modname)) goto bad;
2147 module = PyModule_NewObject(modname);
2148 Py_DECREF(modname);
2149 if (unlikely(!module)) goto bad;
2150 moddict = PyModule_GetDict(module);
2151 if (unlikely(!moddict)) goto bad;
2152 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
2153 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
2154 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
2155 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
2156 return module;
2157 bad:
2158 Py_XDECREF(module);
2159 return NULL;
2160 }
2161
2162
2163 static int __pyx_pymod_exec_mouse(PyObject *__pyx_pyinit_module)
2164 #endif
18102165 #endif
18112166 {
18122167 PyObject *__pyx_t_1 = NULL;
18132168 __Pyx_RefNannyDeclarations
2169 #if CYTHON_PEP489_MULTI_PHASE_INIT
2170 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
2171 #elif PY_MAJOR_VERSION >= 3
2172 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
2173 #endif
18142174 #if CYTHON_REFNANNY
1815 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
1816 if (!__Pyx_RefNanny) {
1817 PyErr_Clear();
1818 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
1819 if (!__Pyx_RefNanny)
1820 Py_FatalError("failed to import 'refnanny' module");
1821 }
1822 #endif
1823 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_mouse(void)", 0);
2175 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
2176 if (!__Pyx_RefNanny) {
2177 PyErr_Clear();
2178 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
2179 if (!__Pyx_RefNanny)
2180 Py_FatalError("failed to import 'refnanny' module");
2181 }
2182 #endif
2183 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_mouse(void)", 0);
18242184 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
18252185 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
18262186 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
18372197 #ifdef __Pyx_Generator_USED
18382198 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
18392199 #endif
2200 #ifdef __Pyx_AsyncGen_USED
2201 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2202 #endif
18402203 #ifdef __Pyx_StopAsyncIteration_USED
18412204 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
18422205 #endif
18482211 #endif
18492212 #endif
18502213 /*--- Module creation code ---*/
2214 #if CYTHON_PEP489_MULTI_PHASE_INIT
2215 __pyx_m = __pyx_pyinit_module;
2216 Py_INCREF(__pyx_m);
2217 #else
18512218 #if PY_MAJOR_VERSION < 3
18522219 __pyx_m = Py_InitModule4("mouse", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
18532220 #else
18542221 __pyx_m = PyModule_Create(&__pyx_moduledef);
18552222 #endif
18562223 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
2224 #endif
18572225 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
18582226 Py_INCREF(__pyx_d);
18592227 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
2228 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
18602229 #if CYTHON_COMPILING_IN_PYPY
18612230 Py_INCREF(__pyx_b);
18622231 #endif
18812250 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
18822251 /*--- Constants init code ---*/
18832252 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1884 /*--- Global init code ---*/
1885 /*--- Variable export code ---*/
1886 /*--- Function export code ---*/
1887 /*--- Type init code ---*/
1888 /*--- Type import code ---*/
1889 /*--- Variable import code ---*/
1890 /*--- Function import code ---*/
2253 /*--- Global type/function init code ---*/
2254 (void)__Pyx_modinit_global_init_code();
2255 (void)__Pyx_modinit_variable_export_code();
2256 (void)__Pyx_modinit_function_export_code();
2257 (void)__Pyx_modinit_type_init_code();
2258 (void)__Pyx_modinit_type_import_code();
2259 (void)__Pyx_modinit_variable_import_code();
2260 (void)__Pyx_modinit_function_import_code();
18912261 /*--- Execution code ---*/
18922262 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
18932263 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20172387 * #
20182388 * # This software is provided 'as-is', without any express or implied
20192389 */
2020 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
2390 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
20212391 __Pyx_GOTREF(__pyx_t_1);
20222392 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
20232393 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20292399 __Pyx_XDECREF(__pyx_t_1);
20302400 if (__pyx_m) {
20312401 if (__pyx_d) {
2032 __Pyx_AddTraceback("init pygame_sdl2.mouse", __pyx_clineno, __pyx_lineno, __pyx_filename);
2402 __Pyx_AddTraceback("init pygame_sdl2.mouse", 0, __pyx_lineno, __pyx_filename);
20332403 }
20342404 Py_DECREF(__pyx_m); __pyx_m = 0;
20352405 } else if (!PyErr_Occurred()) {
20372407 }
20382408 __pyx_L0:;
20392409 __Pyx_RefNannyFinishContext();
2040 #if PY_MAJOR_VERSION < 3
2410 #if CYTHON_PEP489_MULTI_PHASE_INIT
2411 return (__pyx_m != NULL) ? 0 : -1;
2412 #elif PY_MAJOR_VERSION >= 3
2413 return __pyx_m;
2414 #else
20412415 return;
2042 #else
2043 return __pyx_m;
20442416 #endif
20452417 }
20462418
20782450 /* IterFinish */
20792451 static CYTHON_INLINE int __Pyx_IterFinish(void) {
20802452 #if CYTHON_FAST_THREAD_STATE
2081 PyThreadState *tstate = PyThreadState_GET();
2453 PyThreadState *tstate = __Pyx_PyThreadState_Current;
20822454 PyObject* exc_type = tstate->curexc_type;
20832455 if (unlikely(exc_type)) {
2084 if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
2456 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
20852457 PyObject *exc_value, *exc_tb;
20862458 exc_value = tstate->curexc_value;
20872459 exc_tb = tstate->curexc_traceback;
22642636 return -1;
22652637 }
22662638
2639 /* PyObjectGetAttrStr */
2640 #if CYTHON_USE_TYPE_SLOTS
2641 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
2642 PyTypeObject* tp = Py_TYPE(obj);
2643 if (likely(tp->tp_getattro))
2644 return tp->tp_getattro(obj, attr_name);
2645 #if PY_MAJOR_VERSION < 3
2646 if (likely(tp->tp_getattr))
2647 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
2648 #endif
2649 return PyObject_GetAttr(obj, attr_name);
2650 }
2651 #endif
2652
2653 /* PyErrFetchRestore */
2654 #if CYTHON_FAST_THREAD_STATE
2655 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
2656 PyObject *tmp_type, *tmp_value, *tmp_tb;
2657 tmp_type = tstate->curexc_type;
2658 tmp_value = tstate->curexc_value;
2659 tmp_tb = tstate->curexc_traceback;
2660 tstate->curexc_type = type;
2661 tstate->curexc_value = value;
2662 tstate->curexc_traceback = tb;
2663 Py_XDECREF(tmp_type);
2664 Py_XDECREF(tmp_value);
2665 Py_XDECREF(tmp_tb);
2666 }
2667 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
2668 *type = tstate->curexc_type;
2669 *value = tstate->curexc_value;
2670 *tb = tstate->curexc_traceback;
2671 tstate->curexc_type = 0;
2672 tstate->curexc_value = 0;
2673 tstate->curexc_traceback = 0;
2674 }
2675 #endif
2676
2677 /* CLineInTraceback */
2678 #ifndef CYTHON_CLINE_IN_TRACEBACK
2679 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
2680 PyObject *use_cline;
2681 PyObject *ptype, *pvalue, *ptraceback;
2682 #if CYTHON_COMPILING_IN_CPYTHON
2683 PyObject **cython_runtime_dict;
2684 #endif
2685 if (unlikely(!__pyx_cython_runtime)) {
2686 return c_line;
2687 }
2688 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
2689 #if CYTHON_COMPILING_IN_CPYTHON
2690 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
2691 if (likely(cython_runtime_dict)) {
2692 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
2693 } else
2694 #endif
2695 {
2696 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
2697 if (use_cline_obj) {
2698 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
2699 Py_DECREF(use_cline_obj);
2700 } else {
2701 PyErr_Clear();
2702 use_cline = NULL;
2703 }
2704 }
2705 if (!use_cline) {
2706 c_line = 0;
2707 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
2708 }
2709 else if (PyObject_Not(use_cline) != 0) {
2710 c_line = 0;
2711 }
2712 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
2713 return c_line;
2714 }
2715 #endif
2716
22672717 /* CodeObjectCache */
22682718 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
22692719 int start = 0, mid = 0, end = count - 1;
24042854 int py_line, const char *filename) {
24052855 PyCodeObject *py_code = 0;
24062856 PyFrameObject *py_frame = 0;
2407 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
2857 PyThreadState *tstate = __Pyx_PyThreadState_Current;
2858 if (c_line) {
2859 c_line = __Pyx_CLineForTraceback(tstate, c_line);
2860 }
2861 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
24082862 if (!py_code) {
24092863 py_code = __Pyx_CreateCodeObjectForTraceback(
24102864 funcname, c_line, py_line, filename);
24112865 if (!py_code) goto bad;
2412 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
2866 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
24132867 }
24142868 py_frame = PyFrame_New(
2415 PyThreadState_GET(), /*PyThreadState *tstate,*/
2416 py_code, /*PyCodeObject *code,*/
2417 __pyx_d, /*PyObject *globals,*/
2418 0 /*PyObject *locals*/
2869 tstate, /*PyThreadState *tstate,*/
2870 py_code, /*PyCodeObject *code,*/
2871 __pyx_d, /*PyObject *globals,*/
2872 0 /*PyObject *locals*/
24192873 );
24202874 if (!py_frame) goto bad;
24212875 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
28873341 return (long) -1;
28883342 }
28893343
3344 /* FastTypeChecks */
3345 #if CYTHON_COMPILING_IN_CPYTHON
3346 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
3347 while (a) {
3348 a = a->tp_base;
3349 if (a == b)
3350 return 1;
3351 }
3352 return b == &PyBaseObject_Type;
3353 }
3354 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
3355 PyObject *mro;
3356 if (a == b) return 1;
3357 mro = a->tp_mro;
3358 if (likely(mro)) {
3359 Py_ssize_t i, n;
3360 n = PyTuple_GET_SIZE(mro);
3361 for (i = 0; i < n; i++) {
3362 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
3363 return 1;
3364 }
3365 return 0;
3366 }
3367 return __Pyx_InBases(a, b);
3368 }
3369 #if PY_MAJOR_VERSION == 2
3370 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
3371 PyObject *exception, *value, *tb;
3372 int res;
3373 __Pyx_PyThreadState_declare
3374 __Pyx_PyThreadState_assign
3375 __Pyx_ErrFetch(&exception, &value, &tb);
3376 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
3377 if (unlikely(res == -1)) {
3378 PyErr_WriteUnraisable(err);
3379 res = 0;
3380 }
3381 if (!res) {
3382 res = PyObject_IsSubclass(err, exc_type2);
3383 if (unlikely(res == -1)) {
3384 PyErr_WriteUnraisable(err);
3385 res = 0;
3386 }
3387 }
3388 __Pyx_ErrRestore(exception, value, tb);
3389 return res;
3390 }
3391 #else
3392 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
3393 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
3394 if (!res) {
3395 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
3396 }
3397 return res;
3398 }
3399 #endif
3400 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
3401 Py_ssize_t i, n;
3402 assert(PyExceptionClass_Check(exc_type));
3403 n = PyTuple_GET_SIZE(tuple);
3404 #if PY_MAJOR_VERSION >= 3
3405 for (i=0; i<n; i++) {
3406 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
3407 }
3408 #endif
3409 for (i=0; i<n; i++) {
3410 PyObject *t = PyTuple_GET_ITEM(tuple, i);
3411 #if PY_MAJOR_VERSION < 3
3412 if (likely(exc_type == t)) return 1;
3413 #endif
3414 if (likely(PyExceptionClass_Check(t))) {
3415 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
3416 } else {
3417 }
3418 }
3419 return 0;
3420 }
3421 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
3422 if (likely(err == exc_type)) return 1;
3423 if (likely(PyExceptionClass_Check(err))) {
3424 if (likely(PyExceptionClass_Check(exc_type))) {
3425 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
3426 } else if (likely(PyTuple_Check(exc_type))) {
3427 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
3428 } else {
3429 }
3430 }
3431 return PyErr_GivenExceptionMatches(err, exc_type);
3432 }
3433 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
3434 assert(PyExceptionClass_Check(exc_type1));
3435 assert(PyExceptionClass_Check(exc_type2));
3436 if (likely(err == exc_type1 || err == exc_type2)) return 1;
3437 if (likely(PyExceptionClass_Check(err))) {
3438 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
3439 }
3440 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
3441 }
3442 #endif
3443
28903444 /* CheckBinaryVersion */
28913445 static int __Pyx_check_binary_version(void) {
28923446 char ctversion[4], rtversion[4];
29293483 #endif
29303484 if (!*t->p)
29313485 return -1;
3486 if (PyObject_Hash(*t->p) == -1)
3487 return -1;
29323488 ++t;
29333489 }
29343490 return 0;
29373493 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
29383494 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
29393495 }
2940 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
3496 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
29413497 Py_ssize_t ignore;
29423498 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
29433499 }
2944 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
2945 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
3500 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
3501 #if !CYTHON_PEP393_ENABLED
3502 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
3503 char* defenc_c;
3504 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
3505 if (!defenc) return NULL;
3506 defenc_c = PyBytes_AS_STRING(defenc);
3507 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
3508 {
3509 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
3510 char* c;
3511 for (c = defenc_c; c < end; c++) {
3512 if ((unsigned char) (*c) >= 128) {
3513 PyUnicode_AsASCIIString(o);
3514 return NULL;
3515 }
3516 }
3517 }
3518 #endif
3519 *length = PyBytes_GET_SIZE(defenc);
3520 return defenc_c;
3521 }
3522 #else
3523 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
3524 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
3525 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
3526 if (likely(PyUnicode_IS_ASCII(o))) {
3527 *length = PyUnicode_GET_LENGTH(o);
3528 return PyUnicode_AsUTF8(o);
3529 } else {
3530 PyUnicode_AsASCIIString(o);
3531 return NULL;
3532 }
3533 #else
3534 return PyUnicode_AsUTF8AndSize(o, length);
3535 #endif
3536 }
3537 #endif
3538 #endif
3539 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
3540 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
29463541 if (
29473542 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
29483543 __Pyx_sys_getdefaultencoding_not_ascii &&
29493544 #endif
29503545 PyUnicode_Check(o)) {
2951 #if PY_VERSION_HEX < 0x03030000
2952 char* defenc_c;
2953 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
2954 if (!defenc) return NULL;
2955 defenc_c = PyBytes_AS_STRING(defenc);
2956 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
2957 {
2958 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
2959 char* c;
2960 for (c = defenc_c; c < end; c++) {
2961 if ((unsigned char) (*c) >= 128) {
2962 PyUnicode_AsASCIIString(o);
2963 return NULL;
2964 }
2965 }
2966 }
2967 #endif
2968 *length = PyBytes_GET_SIZE(defenc);
2969 return defenc_c;
2970 #else
2971 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
2972 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
2973 if (PyUnicode_IS_ASCII(o)) {
2974 *length = PyUnicode_GET_LENGTH(o);
2975 return PyUnicode_AsUTF8(o);
2976 } else {
2977 PyUnicode_AsASCIIString(o);
2978 return NULL;
2979 }
2980 #else
2981 return PyUnicode_AsUTF8AndSize(o, length);
2982 #endif
2983 #endif
3546 return __Pyx_PyUnicode_AsStringAndSize(o, length);
29843547 } else
29853548 #endif
29863549 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
30043567 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
30053568 else return PyObject_IsTrue(x);
30063569 }
3570 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
3571 #if PY_MAJOR_VERSION >= 3
3572 if (PyLong_Check(result)) {
3573 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
3574 "__int__ returned non-int (type %.200s). "
3575 "The ability to return an instance of a strict subclass of int "
3576 "is deprecated, and may be removed in a future version of Python.",
3577 Py_TYPE(result)->tp_name)) {
3578 Py_DECREF(result);
3579 return NULL;
3580 }
3581 return result;
3582 }
3583 #endif
3584 PyErr_Format(PyExc_TypeError,
3585 "__%.4s__ returned non-%.4s (type %.200s)",
3586 type_name, type_name, Py_TYPE(result)->tp_name);
3587 Py_DECREF(result);
3588 return NULL;
3589 }
30073590 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
30083591 #if CYTHON_USE_TYPE_SLOTS
30093592 PyNumberMethods *m;
30113594 const char *name = NULL;
30123595 PyObject *res = NULL;
30133596 #if PY_MAJOR_VERSION < 3
3014 if (PyInt_Check(x) || PyLong_Check(x))
3015 #else
3016 if (PyLong_Check(x))
3597 if (likely(PyInt_Check(x) || PyLong_Check(x)))
3598 #else
3599 if (likely(PyLong_Check(x)))
30173600 #endif
30183601 return __Pyx_NewRef(x);
30193602 #if CYTHON_USE_TYPE_SLOTS
30213604 #if PY_MAJOR_VERSION < 3
30223605 if (m && m->nb_int) {
30233606 name = "int";
3024 res = PyNumber_Int(x);
3607 res = m->nb_int(x);
30253608 }
30263609 else if (m && m->nb_long) {
30273610 name = "long";
3028 res = PyNumber_Long(x);
3611 res = m->nb_long(x);
30293612 }
30303613 #else
3031 if (m && m->nb_int) {
3614 if (likely(m && m->nb_int)) {
30323615 name = "int";
3033 res = PyNumber_Long(x);
3616 res = m->nb_int(x);
30343617 }
30353618 #endif
30363619 #else
3037 res = PyNumber_Int(x);
3038 #endif
3039 if (res) {
3620 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
3621 res = PyNumber_Int(x);
3622 }
3623 #endif
3624 if (likely(res)) {
30403625 #if PY_MAJOR_VERSION < 3
3041 if (!PyInt_Check(res) && !PyLong_Check(res)) {
3042 #else
3043 if (!PyLong_Check(res)) {
3044 #endif
3045 PyErr_Format(PyExc_TypeError,
3046 "__%.4s__ returned non-%.4s (type %.200s)",
3047 name, name, Py_TYPE(res)->tp_name);
3048 Py_DECREF(res);
3049 return NULL;
3626 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
3627 #else
3628 if (unlikely(!PyLong_CheckExact(res))) {
3629 #endif
3630 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
30503631 }
30513632 }
30523633 else if (!PyErr_Occurred()) {
31173698 Py_DECREF(x);
31183699 return ival;
31193700 }
3701 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
3702 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
3703 }
31203704 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
31213705 return PyInt_FromSize_t(ival);
31223706 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
8 #else
9 #define CYTHON_ABI "0_25_2"
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
8 #else
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
105123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
108132 #define CYTHON_USE_ASYNC_SLOTS 0
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
409549 { \
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420552
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
428560
429561 #define __PYX_HAVE__pygame_sdl2__power
430562 #define __PYX_HAVE_API__pygame_sdl2__power
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
437570 #include <omp.h>
438571 #endif /* _OPENMP */
439572
440 #ifdef PYREX_WITHOUT_ASSERTIONS
573 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
441574 #define CYTHON_WITHOUT_ASSERTIONS
442575 #endif
443576
468601 #define __Pyx_sst_abs(value) abs(value)
469602 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
470603 #define __Pyx_sst_abs(value) labs(value)
471 #elif defined (_MSC_VER) && defined (_M_X64)
472 #define __Pyx_sst_abs(value) _abs64(value)
604 #elif defined (_MSC_VER)
605 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
473606 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
474607 #define __Pyx_sst_abs(value) llabs(value)
475608 #elif defined (__GNUC__)
477610 #else
478611 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
479612 #endif
480 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
481 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
613 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
614 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
482615 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
483616 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
484617 #define __Pyx_PyBytes_FromString PyBytes_FromString
491624 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
492625 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
493626 #endif
494 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
495 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
627 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
628 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
629 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
634 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
635 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
496638 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
497639 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
498640 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
499641 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
500642 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
501 #if PY_MAJOR_VERSION < 3
502 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
503 {
643 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
504644 const Py_UNICODE *u_end = u;
505645 while (*u_end++) ;
506646 return (size_t)(u_end - u - 1);
507647 }
508 #else
509 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
510 #endif
511648 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
512649 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
513650 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
514651 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
515652 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
516 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
653 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
517654 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
518655 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
656 #define __Pyx_PySequence_Tuple(obj)\
657 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
519658 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
520659 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
521660 #if CYTHON_ASSUME_SAFE_MACROS
614753 #define likely(x) (x)
615754 #define unlikely(x) (x)
616755 #endif /* __GNUC__ */
617
618 static PyObject *__pyx_m;
756 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
757
758 static PyObject *__pyx_m = NULL;
619759 static PyObject *__pyx_d;
620760 static PyObject *__pyx_b;
761 static PyObject *__pyx_cython_runtime = NULL;
621762 static PyObject *__pyx_empty_tuple;
622763 static PyObject *__pyx_empty_bytes;
623764 static PyObject *__pyx_empty_unicode;
699840
700841 /* PyObjectGetAttrStr.proto */
701842 #if CYTHON_USE_TYPE_SLOTS
702 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
703 PyTypeObject* tp = Py_TYPE(obj);
704 if (likely(tp->tp_getattro))
705 return tp->tp_getattro(obj, attr_name);
706 #if PY_MAJOR_VERSION < 3
707 if (likely(tp->tp_getattr))
708 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
709 #endif
710 return PyObject_GetAttr(obj, attr_name);
711 }
843 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
712844 #else
713845 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
714846 #endif
761893
762894 /* PyObjectSetAttrStr.proto */
763895 #if CYTHON_USE_TYPE_SLOTS
764 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
765 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
766 PyTypeObject* tp = Py_TYPE(obj);
767 if (likely(tp->tp_setattro))
768 return tp->tp_setattro(obj, attr_name, value);
769 #if PY_MAJOR_VERSION < 3
770 if (likely(tp->tp_setattr))
771 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
772 #endif
773 return PyObject_SetAttr(obj, attr_name, value);
774 }
896 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
897 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
775898 #else
776899 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
777900 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
791914
792915 /* CythonFunction.proto */
793916 #define __Pyx_CyFunction_USED 1
794 #include <structmember.h>
795917 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
796918 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
797919 #define __Pyx_CYFUNCTION_CCLASS 0x04
843965 PyObject *dict);
844966 static int __pyx_CyFunction_init(void);
845967
968 /* SetNameInClass.proto */
969 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
970 #define __Pyx_SetNameInClass(ns, name, value)\
971 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
972 #elif CYTHON_COMPILING_IN_CPYTHON
973 #define __Pyx_SetNameInClass(ns, name, value)\
974 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
975 #else
976 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
977 #endif
978
846979 /* Py3ClassCreate.proto */
847980 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
848981 PyObject *mkw, PyObject *modname, PyObject *doc);
849982 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
850983 PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
984
985 /* PyThreadStateGet.proto */
986 #if CYTHON_FAST_THREAD_STATE
987 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
988 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
989 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
990 #else
991 #define __Pyx_PyThreadState_declare
992 #define __Pyx_PyThreadState_assign
993 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
994 #endif
995
996 /* PyErrFetchRestore.proto */
997 #if CYTHON_FAST_THREAD_STATE
998 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
999 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1000 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1001 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1002 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1003 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1004 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1005 #if CYTHON_COMPILING_IN_CPYTHON
1006 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1007 #else
1008 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1009 #endif
1010 #else
1011 #define __Pyx_PyErr_Clear() PyErr_Clear()
1012 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1013 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1014 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1015 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1016 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1017 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1018 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1019 #endif
1020
1021 /* CLineInTraceback.proto */
1022 #ifdef CYTHON_CLINE_IN_TRACEBACK
1023 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1024 #else
1025 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1026 #endif
8511027
8521028 /* CodeObjectCache.proto */
8531029 typedef struct {
8831059 /* CIntFromPy.proto */
8841060 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
8851061
1062 /* FastTypeChecks.proto */
1063 #if CYTHON_COMPILING_IN_CPYTHON
1064 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1065 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1066 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1067 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1068 #else
1069 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1070 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1071 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1072 #endif
1073 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1074
8861075 /* CheckBinaryVersion.proto */
8871076 static int __Pyx_check_binary_version(void);
8881077
9021091
9031092 /* Module declarations from 'pygame_sdl2.power' */
9041093 #define __Pyx_MODULE_NAME "pygame_sdl2.power"
1094 extern int __pyx_module_is_main_pygame_sdl2__power;
9051095 int __pyx_module_is_main_pygame_sdl2__power = 0;
9061096
9071097 /* Implementation of 'pygame_sdl2.power' */
9301120 static const char __pyx_k_pygame_sdl2_power[] = "pygame_sdl2.power";
9311121 static const char __pyx_k_POWERSTATE_CHARGED[] = "POWERSTATE_CHARGED";
9321122 static const char __pyx_k_POWERSTATE_UNKNOWN[] = "POWERSTATE_UNKNOWN";
1123 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
9331124 static const char __pyx_k_powerstate_to_name[] = "powerstate_to_name";
9341125 static const char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals";
9351126 static const char __pyx_k_POWERSTATE_CHARGING[] = "POWERSTATE_CHARGING";
9511142 static PyObject *__pyx_n_s_PowerInfo;
9521143 static PyObject *__pyx_n_s_PowerInfo___repr;
9531144 static PyObject *__pyx_kp_u_PowerInfo_state_seconds_percent;
1145 static PyObject *__pyx_n_s_cline_in_traceback;
9541146 static PyObject *__pyx_n_s_doc;
9551147 static PyObject *__pyx_n_s_format;
9561148 static PyObject *__pyx_n_s_get;
9761168 static PyObject *__pyx_pf_11pygame_sdl2_5power_9PowerInfo___repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
9771169 static PyObject *__pyx_pf_11pygame_sdl2_5power_get_power_info(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
9781170 static PyObject *__pyx_tuple_;
979 static PyObject *__pyx_tuple__3;
980 static PyObject *__pyx_codeobj__2;
981 static PyObject *__pyx_codeobj__4;
1171 static PyObject *__pyx_tuple__2;
1172 static PyObject *__pyx_tuple__4;
1173 static PyObject *__pyx_codeobj__3;
1174 static PyObject *__pyx_codeobj__5;
1175 /* Late includes */
9821176
9831177 /* "pygame_sdl2/power.pyx":33
9841178 *
13381532 };
13391533
13401534 #if PY_MAJOR_VERSION >= 3
1535 #if CYTHON_PEP489_MULTI_PHASE_INIT
1536 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
1537 static int __pyx_pymod_exec_power(PyObject* module); /*proto*/
1538 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
1539 {Py_mod_create, (void*)__pyx_pymod_create},
1540 {Py_mod_exec, (void*)__pyx_pymod_exec_power},
1541 {0, NULL}
1542 };
1543 #endif
1544
13411545 static struct PyModuleDef __pyx_moduledef = {
1342 #if PY_VERSION_HEX < 0x03020000
1343 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
1344 #else
13451546 PyModuleDef_HEAD_INIT,
1346 #endif
13471547 "power",
13481548 0, /* m_doc */
1549 #if CYTHON_PEP489_MULTI_PHASE_INIT
1550 0, /* m_size */
1551 #else
13491552 -1, /* m_size */
1553 #endif
13501554 __pyx_methods /* m_methods */,
1555 #if CYTHON_PEP489_MULTI_PHASE_INIT
1556 __pyx_moduledef_slots, /* m_slots */
1557 #else
13511558 NULL, /* m_reload */
1559 #endif
13521560 NULL, /* m_traverse */
13531561 NULL, /* m_clear */
13541562 NULL /* m_free */
13701578 {&__pyx_n_s_PowerInfo, __pyx_k_PowerInfo, sizeof(__pyx_k_PowerInfo), 0, 0, 1, 1},
13711579 {&__pyx_n_s_PowerInfo___repr, __pyx_k_PowerInfo___repr, sizeof(__pyx_k_PowerInfo___repr), 0, 0, 1, 1},
13721580 {&__pyx_kp_u_PowerInfo_state_seconds_percent, __pyx_k_PowerInfo_state_seconds_percent, sizeof(__pyx_k_PowerInfo_state_seconds_percent), 0, 1, 0, 0},
1581 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
13731582 {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
13741583 {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
13751584 {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
14051614 __Pyx_RefNannyDeclarations
14061615 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
14071616
1617 /* "pygame_sdl2/power.pyx":32
1618 *
1619 *
1620 * class PowerInfo(object): # <<<<<<<<<<<<<<
1621 * def __repr__(self):
1622 * return "<PowerInfo state={} seconds={} percent={}>".format(
1623 */
1624 __pyx_tuple_ = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 32, __pyx_L1_error)
1625 __Pyx_GOTREF(__pyx_tuple_);
1626 __Pyx_GIVEREF(__pyx_tuple_);
1627
14081628 /* "pygame_sdl2/power.pyx":33
14091629 *
14101630 * class PowerInfo(object):
14121632 * return "<PowerInfo state={} seconds={} percent={}>".format(
14131633 * powerstate_to_name.get(self.state, "INVALID"),
14141634 */
1415 __pyx_tuple_ = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 33, __pyx_L1_error)
1416 __Pyx_GOTREF(__pyx_tuple_);
1417 __Pyx_GIVEREF(__pyx_tuple_);
1418 __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_power_pyx, __pyx_n_s_repr, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 33, __pyx_L1_error)
1635 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 33, __pyx_L1_error)
1636 __Pyx_GOTREF(__pyx_tuple__2);
1637 __Pyx_GIVEREF(__pyx_tuple__2);
1638 __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_power_pyx, __pyx_n_s_repr, 33, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 33, __pyx_L1_error)
14191639
14201640 /* "pygame_sdl2/power.pyx":39
14211641 * self.percent)
14241644 *
14251645 * cdef int seconds
14261646 */
1427 __pyx_tuple__3 = PyTuple_Pack(4, __pyx_n_s_seconds, __pyx_n_s_percent, __pyx_n_s_state, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 39, __pyx_L1_error)
1428 __Pyx_GOTREF(__pyx_tuple__3);
1429 __Pyx_GIVEREF(__pyx_tuple__3);
1430 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_power_pyx, __pyx_n_s_get_power_info, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 39, __pyx_L1_error)
1647 __pyx_tuple__4 = PyTuple_Pack(4, __pyx_n_s_seconds, __pyx_n_s_percent, __pyx_n_s_state, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 39, __pyx_L1_error)
1648 __Pyx_GOTREF(__pyx_tuple__4);
1649 __Pyx_GIVEREF(__pyx_tuple__4);
1650 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_power_pyx, __pyx_n_s_get_power_info, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 39, __pyx_L1_error)
14311651 __Pyx_RefNannyFinishContext();
14321652 return 0;
14331653 __pyx_L1_error:;
14421662 return -1;
14431663 }
14441664
1665 static int __Pyx_modinit_global_init_code(void); /*proto*/
1666 static int __Pyx_modinit_variable_export_code(void); /*proto*/
1667 static int __Pyx_modinit_function_export_code(void); /*proto*/
1668 static int __Pyx_modinit_type_init_code(void); /*proto*/
1669 static int __Pyx_modinit_type_import_code(void); /*proto*/
1670 static int __Pyx_modinit_variable_import_code(void); /*proto*/
1671 static int __Pyx_modinit_function_import_code(void); /*proto*/
1672
1673 static int __Pyx_modinit_global_init_code(void) {
1674 __Pyx_RefNannyDeclarations
1675 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
1676 /*--- Global init code ---*/
1677 __Pyx_RefNannyFinishContext();
1678 return 0;
1679 }
1680
1681 static int __Pyx_modinit_variable_export_code(void) {
1682 __Pyx_RefNannyDeclarations
1683 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
1684 /*--- Variable export code ---*/
1685 __Pyx_RefNannyFinishContext();
1686 return 0;
1687 }
1688
1689 static int __Pyx_modinit_function_export_code(void) {
1690 __Pyx_RefNannyDeclarations
1691 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
1692 /*--- Function export code ---*/
1693 __Pyx_RefNannyFinishContext();
1694 return 0;
1695 }
1696
1697 static int __Pyx_modinit_type_init_code(void) {
1698 __Pyx_RefNannyDeclarations
1699 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
1700 /*--- Type init code ---*/
1701 __Pyx_RefNannyFinishContext();
1702 return 0;
1703 }
1704
1705 static int __Pyx_modinit_type_import_code(void) {
1706 __Pyx_RefNannyDeclarations
1707 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
1708 /*--- Type import code ---*/
1709 __Pyx_RefNannyFinishContext();
1710 return 0;
1711 }
1712
1713 static int __Pyx_modinit_variable_import_code(void) {
1714 __Pyx_RefNannyDeclarations
1715 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
1716 /*--- Variable import code ---*/
1717 __Pyx_RefNannyFinishContext();
1718 return 0;
1719 }
1720
1721 static int __Pyx_modinit_function_import_code(void) {
1722 __Pyx_RefNannyDeclarations
1723 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
1724 /*--- Function import code ---*/
1725 __Pyx_RefNannyFinishContext();
1726 return 0;
1727 }
1728
1729
14451730 #if PY_MAJOR_VERSION < 3
1446 PyMODINIT_FUNC initpower(void); /*proto*/
1447 PyMODINIT_FUNC initpower(void)
1448 #else
1449 PyMODINIT_FUNC PyInit_power(void); /*proto*/
1450 PyMODINIT_FUNC PyInit_power(void)
1731 #ifdef CYTHON_NO_PYINIT_EXPORT
1732 #define __Pyx_PyMODINIT_FUNC void
1733 #else
1734 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
1735 #endif
1736 #else
1737 #ifdef CYTHON_NO_PYINIT_EXPORT
1738 #define __Pyx_PyMODINIT_FUNC PyObject *
1739 #else
1740 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
1741 #endif
1742 #endif
1743 #ifndef CYTHON_SMALL_CODE
1744 #if defined(__clang__)
1745 #define CYTHON_SMALL_CODE
1746 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
1747 #define CYTHON_SMALL_CODE __attribute__((cold))
1748 #else
1749 #define CYTHON_SMALL_CODE
1750 #endif
1751 #endif
1752
1753
1754 #if PY_MAJOR_VERSION < 3
1755 __Pyx_PyMODINIT_FUNC initpower(void) CYTHON_SMALL_CODE; /*proto*/
1756 __Pyx_PyMODINIT_FUNC initpower(void)
1757 #else
1758 __Pyx_PyMODINIT_FUNC PyInit_power(void) CYTHON_SMALL_CODE; /*proto*/
1759 __Pyx_PyMODINIT_FUNC PyInit_power(void)
1760 #if CYTHON_PEP489_MULTI_PHASE_INIT
1761 {
1762 return PyModuleDef_Init(&__pyx_moduledef);
1763 }
1764 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
1765 PyObject *value = PyObject_GetAttrString(spec, from_name);
1766 int result = 0;
1767 if (likely(value)) {
1768 result = PyDict_SetItemString(moddict, to_name, value);
1769 Py_DECREF(value);
1770 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
1771 PyErr_Clear();
1772 } else {
1773 result = -1;
1774 }
1775 return result;
1776 }
1777 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
1778 PyObject *module = NULL, *moddict, *modname;
1779 if (__pyx_m)
1780 return __Pyx_NewRef(__pyx_m);
1781 modname = PyObject_GetAttrString(spec, "name");
1782 if (unlikely(!modname)) goto bad;
1783 module = PyModule_NewObject(modname);
1784 Py_DECREF(modname);
1785 if (unlikely(!module)) goto bad;
1786 moddict = PyModule_GetDict(module);
1787 if (unlikely(!moddict)) goto bad;
1788 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
1789 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
1790 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
1791 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
1792 return module;
1793 bad:
1794 Py_XDECREF(module);
1795 return NULL;
1796 }
1797
1798
1799 static int __pyx_pymod_exec_power(PyObject *__pyx_pyinit_module)
1800 #endif
14511801 #endif
14521802 {
14531803 PyObject *__pyx_t_1 = NULL;
14541804 PyObject *__pyx_t_2 = NULL;
14551805 PyObject *__pyx_t_3 = NULL;
1456 PyObject *__pyx_t_4 = NULL;
14571806 __Pyx_RefNannyDeclarations
1807 #if CYTHON_PEP489_MULTI_PHASE_INIT
1808 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
1809 #elif PY_MAJOR_VERSION >= 3
1810 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
1811 #endif
14581812 #if CYTHON_REFNANNY
1459 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
1460 if (!__Pyx_RefNanny) {
1461 PyErr_Clear();
1462 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
1463 if (!__Pyx_RefNanny)
1464 Py_FatalError("failed to import 'refnanny' module");
1465 }
1466 #endif
1467 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_power(void)", 0);
1813 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
1814 if (!__Pyx_RefNanny) {
1815 PyErr_Clear();
1816 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
1817 if (!__Pyx_RefNanny)
1818 Py_FatalError("failed to import 'refnanny' module");
1819 }
1820 #endif
1821 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_power(void)", 0);
14681822 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
14691823 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
14701824 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
14811835 #ifdef __Pyx_Generator_USED
14821836 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
14831837 #endif
1838 #ifdef __Pyx_AsyncGen_USED
1839 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1840 #endif
14841841 #ifdef __Pyx_StopAsyncIteration_USED
14851842 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
14861843 #endif
14921849 #endif
14931850 #endif
14941851 /*--- Module creation code ---*/
1852 #if CYTHON_PEP489_MULTI_PHASE_INIT
1853 __pyx_m = __pyx_pyinit_module;
1854 Py_INCREF(__pyx_m);
1855 #else
14951856 #if PY_MAJOR_VERSION < 3
14961857 __pyx_m = Py_InitModule4("power", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
14971858 #else
14981859 __pyx_m = PyModule_Create(&__pyx_moduledef);
14991860 #endif
15001861 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
1862 #endif
15011863 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
15021864 Py_INCREF(__pyx_d);
15031865 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
1866 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
15041867 #if CYTHON_COMPILING_IN_PYPY
15051868 Py_INCREF(__pyx_b);
15061869 #endif
15251888 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15261889 /*--- Constants init code ---*/
15271890 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1528 /*--- Global init code ---*/
1529 /*--- Variable export code ---*/
1530 /*--- Function export code ---*/
1531 /*--- Type init code ---*/
1532 /*--- Type import code ---*/
1533 /*--- Variable import code ---*/
1534 /*--- Function import code ---*/
1891 /*--- Global type/function init code ---*/
1892 (void)__Pyx_modinit_global_init_code();
1893 (void)__Pyx_modinit_variable_export_code();
1894 (void)__Pyx_modinit_function_export_code();
1895 (void)__Pyx_modinit_type_init_code();
1896 (void)__Pyx_modinit_type_import_code();
1897 (void)__Pyx_modinit_variable_import_code();
1898 (void)__Pyx_modinit_function_import_code();
15351899 /*--- Execution code ---*/
15361900 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
15371901 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15931957 * POWERSTATE_ON_BATTERY : "POWERSTATE_ON_BATTERY",
15941958 * POWERSTATE_NO_BATTERY : "POWERSTATE_NO_BATTERY",
15951959 */
1596 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
1960 __pyx_t_2 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
15971961 __Pyx_GOTREF(__pyx_t_2);
15981962 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_POWERSTATE_UNKNOWN); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
15991963 __Pyx_GOTREF(__pyx_t_1);
16572021 * def __repr__(self):
16582022 * return "<PowerInfo state={} seconds={} percent={}>".format(
16592023 */
1660 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
2024 __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple_); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
16612025 __Pyx_GOTREF(__pyx_t_2);
1662 __Pyx_INCREF(__pyx_builtin_object);
1663 __Pyx_GIVEREF(__pyx_builtin_object);
1664 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object);
1665 __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
2026 __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_tuple_, __pyx_n_s_PowerInfo, __pyx_n_s_PowerInfo, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_power, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
16662027 __Pyx_GOTREF(__pyx_t_1);
1667 __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_PowerInfo, __pyx_n_s_PowerInfo, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_power, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error)
1668 __Pyx_GOTREF(__pyx_t_3);
16692028
16702029 /* "pygame_sdl2/power.pyx":33
16712030 *
16742033 * return "<PowerInfo state={} seconds={} percent={}>".format(
16752034 * powerstate_to_name.get(self.state, "INVALID"),
16762035 */
1677 __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5power_9PowerInfo_1__repr__, 0, __pyx_n_s_PowerInfo___repr, NULL, __pyx_n_s_pygame_sdl2_power, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error)
1678 __Pyx_GOTREF(__pyx_t_4);
1679 if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_repr, __pyx_t_4) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
1680 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2036 __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_5power_9PowerInfo_1__repr__, 0, __pyx_n_s_PowerInfo___repr, NULL, __pyx_n_s_pygame_sdl2_power, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error)
2037 __Pyx_GOTREF(__pyx_t_3);
2038 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_repr, __pyx_t_3) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
2039 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16812040
16822041 /* "pygame_sdl2/power.pyx":32
16832042 *
16862045 * def __repr__(self):
16872046 * return "<PowerInfo state={} seconds={} percent={}>".format(
16882047 */
1689 __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_PowerInfo, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error)
1690 __Pyx_GOTREF(__pyx_t_4);
1691 if (PyDict_SetItem(__pyx_d, __pyx_n_s_PowerInfo, __pyx_t_4) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
1692 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2048 __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_PowerInfo, __pyx_tuple_, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error)
2049 __Pyx_GOTREF(__pyx_t_3);
2050 if (PyDict_SetItem(__pyx_d, __pyx_n_s_PowerInfo, __pyx_t_3) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
16932051 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16942052 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16952053 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17112069 * #
17122070 * # This software is provided 'as-is', without any express or implied
17132071 */
1714 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
2072 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
17152073 __Pyx_GOTREF(__pyx_t_2);
17162074 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
17172075 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17232081 __Pyx_XDECREF(__pyx_t_1);
17242082 __Pyx_XDECREF(__pyx_t_2);
17252083 __Pyx_XDECREF(__pyx_t_3);
1726 __Pyx_XDECREF(__pyx_t_4);
17272084 if (__pyx_m) {
17282085 if (__pyx_d) {
1729 __Pyx_AddTraceback("init pygame_sdl2.power", __pyx_clineno, __pyx_lineno, __pyx_filename);
2086 __Pyx_AddTraceback("init pygame_sdl2.power", 0, __pyx_lineno, __pyx_filename);
17302087 }
17312088 Py_DECREF(__pyx_m); __pyx_m = 0;
17322089 } else if (!PyErr_Occurred()) {
17342091 }
17352092 __pyx_L0:;
17362093 __Pyx_RefNannyFinishContext();
1737 #if PY_MAJOR_VERSION < 3
2094 #if CYTHON_PEP489_MULTI_PHASE_INIT
2095 return (__pyx_m != NULL) ? 0 : -1;
2096 #elif PY_MAJOR_VERSION >= 3
2097 return __pyx_m;
2098 #else
17382099 return;
1739 #else
1740 return __pyx_m;
17412100 #endif
17422101 }
17432102
17592118 }
17602119 #endif
17612120
2121 /* PyObjectGetAttrStr */
2122 #if CYTHON_USE_TYPE_SLOTS
2123 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
2124 PyTypeObject* tp = Py_TYPE(obj);
2125 if (likely(tp->tp_getattro))
2126 return tp->tp_getattro(obj, attr_name);
2127 #if PY_MAJOR_VERSION < 3
2128 if (likely(tp->tp_getattr))
2129 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
2130 #endif
2131 return PyObject_GetAttr(obj, attr_name);
2132 }
2133 #endif
2134
17622135 /* GetBuiltinName */
17632136 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
17642137 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
17772150 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
17782151 PyObject *result;
17792152 #if !CYTHON_AVOID_BORROWED_REFS
2153 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
2154 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
2155 if (likely(result)) {
2156 Py_INCREF(result);
2157 } else if (unlikely(PyErr_Occurred())) {
2158 result = NULL;
2159 } else {
2160 #else
17802161 result = PyDict_GetItem(__pyx_d, name);
17812162 if (likely(result)) {
17822163 Py_INCREF(result);
17832164 } else {
2165 #endif
17842166 #else
17852167 result = PyObject_GetItem(__pyx_d, name);
17862168 if (!result) {
17922174 }
17932175
17942176 /* PyFunctionFastCall */
1795 #if CYTHON_FAST_PYCALL
2177 #if CYTHON_FAST_PYCALL
17962178 #include "frameobject.h"
17972179 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
17982180 PyObject *globals) {
17992181 PyFrameObject *f;
1800 PyThreadState *tstate = PyThreadState_GET();
2182 PyThreadState *tstate = __Pyx_PyThreadState_Current;
18012183 PyObject **fastlocals;
18022184 Py_ssize_t i;
18032185 PyObject *result;
19082290 Py_LeaveRecursiveCall();
19092291 return result;
19102292 }
1911 #endif // CPython < 3.6
1912 #endif // CYTHON_FAST_PYCALL
2293 #endif
2294 #endif
19132295
19142296 /* PyCFunctionFastCall */
1915 #if CYTHON_FAST_PYCCALL
2297 #if CYTHON_FAST_PYCCALL
19162298 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
19172299 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
19182300 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
19192301 PyObject *self = PyCFunction_GET_SELF(func);
2302 int flags = PyCFunction_GET_FLAGS(func);
19202303 assert(PyCFunction_Check(func));
1921 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
2304 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
19222305 assert(nargs >= 0);
19232306 assert(nargs == 0 || args != NULL);
19242307 /* _PyCFunction_FastCallDict() must not be called with an exception set,
19252308 because it may clear it (directly or indirectly) and so the
19262309 caller loses its exception */
19272310 assert(!PyErr_Occurred());
1928 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
1929 }
1930 #endif // CYTHON_FAST_PYCCALL
2311 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
2312 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
2313 } else {
2314 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
2315 }
2316 }
2317 #endif
19312318
19322319 /* PyObjectCall */
1933 #if CYTHON_COMPILING_IN_CPYTHON
2320 #if CYTHON_COMPILING_IN_CPYTHON
19342321 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
19352322 PyObject *result;
19362323 ternaryfunc call = func->ob_type->tp_call;
19502337 #endif
19512338
19522339 /* PyObjectCallMethO */
1953 #if CYTHON_COMPILING_IN_CPYTHON
2340 #if CYTHON_COMPILING_IN_CPYTHON
19542341 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
19552342 PyObject *self, *result;
19562343 PyCFunction cfunc;
19702357 #endif
19712358
19722359 /* PyObjectCallOneArg */
1973 #if CYTHON_COMPILING_IN_CPYTHON
2360 #if CYTHON_COMPILING_IN_CPYTHON
19742361 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
19752362 PyObject *result;
19762363 PyObject *args = PyTuple_New(1);
19872374 return __Pyx_PyFunction_FastCall(func, &arg, 1);
19882375 }
19892376 #endif
1990 #ifdef __Pyx_CyFunction_USED
1991 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
1992 #else
19932377 if (likely(PyCFunction_Check(func))) {
1994 #endif
19952378 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
19962379 return __Pyx_PyObject_CallMethO(func, arg);
19972380 #if CYTHON_FAST_PYCCALL
20222405 }
20232406 #endif
20242407 #ifdef __Pyx_CyFunction_USED
2025 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
2408 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
20262409 #else
20272410 if (likely(PyCFunction_Check(func))) {
20282411 #endif
20312414 }
20322415 }
20332416 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
2417 }
2418 #endif
2419
2420 /* PyObjectSetAttrStr */
2421 #if CYTHON_USE_TYPE_SLOTS
2422 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
2423 PyTypeObject* tp = Py_TYPE(obj);
2424 if (likely(tp->tp_setattro))
2425 return tp->tp_setattro(obj, attr_name, value);
2426 #if PY_MAJOR_VERSION < 3
2427 if (likely(tp->tp_setattr))
2428 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
2429 #endif
2430 return PyObject_SetAttr(obj, attr_name, value);
20342431 }
20352432 #endif
20362433
20412438 PyObject *global_dict = 0;
20422439 PyObject *empty_dict = 0;
20432440 PyObject *list;
2044 #if PY_VERSION_HEX < 0x03030000
2441 #if PY_MAJOR_VERSION < 3
20452442 PyObject *py_import;
20462443 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
20472444 if (!py_import)
20652462 #if PY_MAJOR_VERSION >= 3
20662463 if (level == -1) {
20672464 if (strchr(__Pyx_MODULE_NAME, '.')) {
2068 #if PY_VERSION_HEX < 0x03030000
2069 PyObject *py_level = PyInt_FromLong(1);
2070 if (!py_level)
2071 goto bad;
2072 module = PyObject_CallFunctionObjArgs(py_import,
2073 name, global_dict, empty_dict, list, py_level, NULL);
2074 Py_DECREF(py_level);
2075 #else
20762465 module = PyImport_ImportModuleLevelObject(
20772466 name, global_dict, empty_dict, list, 1);
2078 #endif
20792467 if (!module) {
20802468 if (!PyErr_ExceptionMatches(PyExc_ImportError))
20812469 goto bad;
20862474 }
20872475 #endif
20882476 if (!module) {
2089 #if PY_VERSION_HEX < 0x03030000
2477 #if PY_MAJOR_VERSION < 3
20902478 PyObject *py_level = PyInt_FromLong(level);
20912479 if (!py_level)
20922480 goto bad;
21002488 }
21012489 }
21022490 bad:
2103 #if PY_VERSION_HEX < 0x03030000
2491 #if PY_MAJOR_VERSION < 3
21042492 Py_XDECREF(py_import);
21052493 #endif
21062494 Py_XDECREF(empty_list);
22012589 }
22022590
22032591 /* CythonFunction */
2204 static PyObject *
2592 #include <structmember.h>
2593 static PyObject *
22052594 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
22062595 {
22072596 if (unlikely(op->func_doc == NULL)) {
24832872 {0, 0, 0, 0, 0}
24842873 };
24852874 static PyMemberDef __pyx_CyFunction_members[] = {
2486 {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
2875 {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
24872876 {0, 0, 0, 0, 0}
24882877 };
24892878 static PyObject *
25612950 }
25622951 return 0;
25632952 }
2564 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
2953 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
25652954 {
2566 PyObject_GC_UnTrack(m);
25672955 if (__Pyx_CyFunction_weakreflist(m) != NULL)
25682956 PyObject_ClearWeakRefs((PyObject *) m);
25692957 __Pyx_CyFunction_clear(m);
25702958 PyObject_GC_Del(m);
2959 }
2960 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
2961 {
2962 PyObject_GC_UnTrack(m);
2963 __Pyx__CyFunction_dealloc(m);
25712964 }
25722965 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
25732966 {
26433036 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26443037 size = PyTuple_GET_SIZE(arg);
26453038 if (likely(size == 1)) {
2646 PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
2647 if (unlikely(!arg0)) return NULL;
3039 PyObject *result, *arg0;
3040 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3041 arg0 = PyTuple_GET_ITEM(arg, 0);
3042 #else
3043 arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
3044 #endif
26483045 result = (*meth)(self, arg0);
3046 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
26493047 Py_DECREF(arg0);
3048 #endif
26503049 return result;
26513050 }
26523051 PyErr_Format(PyExc_TypeError,
27533152 };
27543153 static int __pyx_CyFunction_init(void) {
27553154 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
2756 if (__pyx_CyFunctionType == NULL) {
3155 if (unlikely(__pyx_CyFunctionType == NULL)) {
27573156 return -1;
27583157 }
27593158 return 0;
27613160 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
27623161 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
27633162 m->defaults = PyObject_Malloc(size);
2764 if (!m->defaults)
3163 if (unlikely(!m->defaults))
27653164 return PyErr_NoMemory();
27663165 memset(m->defaults, 0, size);
27673166 m->defaults_pyobjects = pyobjects;
28493248 Py_XDECREF(owned_metaclass);
28503249 return result;
28513250 }
3251
3252 /* PyErrFetchRestore */
3253 #if CYTHON_FAST_THREAD_STATE
3254 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
3255 PyObject *tmp_type, *tmp_value, *tmp_tb;
3256 tmp_type = tstate->curexc_type;
3257 tmp_value = tstate->curexc_value;
3258 tmp_tb = tstate->curexc_traceback;
3259 tstate->curexc_type = type;
3260 tstate->curexc_value = value;
3261 tstate->curexc_traceback = tb;
3262 Py_XDECREF(tmp_type);
3263 Py_XDECREF(tmp_value);
3264 Py_XDECREF(tmp_tb);
3265 }
3266 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
3267 *type = tstate->curexc_type;
3268 *value = tstate->curexc_value;
3269 *tb = tstate->curexc_traceback;
3270 tstate->curexc_type = 0;
3271 tstate->curexc_value = 0;
3272 tstate->curexc_traceback = 0;
3273 }
3274 #endif
3275
3276 /* CLineInTraceback */
3277 #ifndef CYTHON_CLINE_IN_TRACEBACK
3278 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
3279 PyObject *use_cline;
3280 PyObject *ptype, *pvalue, *ptraceback;
3281 #if CYTHON_COMPILING_IN_CPYTHON
3282 PyObject **cython_runtime_dict;
3283 #endif
3284 if (unlikely(!__pyx_cython_runtime)) {
3285 return c_line;
3286 }
3287 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
3288 #if CYTHON_COMPILING_IN_CPYTHON
3289 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
3290 if (likely(cython_runtime_dict)) {
3291 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
3292 } else
3293 #endif
3294 {
3295 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
3296 if (use_cline_obj) {
3297 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
3298 Py_DECREF(use_cline_obj);
3299 } else {
3300 PyErr_Clear();
3301 use_cline = NULL;
3302 }
3303 }
3304 if (!use_cline) {
3305 c_line = 0;
3306 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
3307 }
3308 else if (PyObject_Not(use_cline) != 0) {
3309 c_line = 0;
3310 }
3311 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
3312 return c_line;
3313 }
3314 #endif
28523315
28533316 /* CodeObjectCache */
28543317 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
29903453 int py_line, const char *filename) {
29913454 PyCodeObject *py_code = 0;
29923455 PyFrameObject *py_frame = 0;
2993 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
3456 PyThreadState *tstate = __Pyx_PyThreadState_Current;
3457 if (c_line) {
3458 c_line = __Pyx_CLineForTraceback(tstate, c_line);
3459 }
3460 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
29943461 if (!py_code) {
29953462 py_code = __Pyx_CreateCodeObjectForTraceback(
29963463 funcname, c_line, py_line, filename);
29973464 if (!py_code) goto bad;
2998 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
3465 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
29993466 }
30003467 py_frame = PyFrame_New(
3001 PyThreadState_GET(), /*PyThreadState *tstate,*/
3002 py_code, /*PyCodeObject *code,*/
3003 __pyx_d, /*PyObject *globals,*/
3004 0 /*PyObject *locals*/
3468 tstate, /*PyThreadState *tstate,*/
3469 py_code, /*PyCodeObject *code,*/
3470 __pyx_d, /*PyObject *globals,*/
3471 0 /*PyObject *locals*/
30053472 );
30063473 if (!py_frame) goto bad;
30073474 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
35043971 return (int) -1;
35053972 }
35063973
3974 /* FastTypeChecks */
3975 #if CYTHON_COMPILING_IN_CPYTHON
3976 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
3977 while (a) {
3978 a = a->tp_base;
3979 if (a == b)
3980 return 1;
3981 }
3982 return b == &PyBaseObject_Type;
3983 }
3984 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
3985 PyObject *mro;
3986 if (a == b) return 1;
3987 mro = a->tp_mro;
3988 if (likely(mro)) {
3989 Py_ssize_t i, n;
3990 n = PyTuple_GET_SIZE(mro);
3991 for (i = 0; i < n; i++) {
3992 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
3993 return 1;
3994 }
3995 return 0;
3996 }
3997 return __Pyx_InBases(a, b);
3998 }
3999 #if PY_MAJOR_VERSION == 2
4000 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
4001 PyObject *exception, *value, *tb;
4002 int res;
4003 __Pyx_PyThreadState_declare
4004 __Pyx_PyThreadState_assign
4005 __Pyx_ErrFetch(&exception, &value, &tb);
4006 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
4007 if (unlikely(res == -1)) {
4008 PyErr_WriteUnraisable(err);
4009 res = 0;
4010 }
4011 if (!res) {
4012 res = PyObject_IsSubclass(err, exc_type2);
4013 if (unlikely(res == -1)) {
4014 PyErr_WriteUnraisable(err);
4015 res = 0;
4016 }
4017 }
4018 __Pyx_ErrRestore(exception, value, tb);
4019 return res;
4020 }
4021 #else
4022 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
4023 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
4024 if (!res) {
4025 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
4026 }
4027 return res;
4028 }
4029 #endif
4030 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
4031 Py_ssize_t i, n;
4032 assert(PyExceptionClass_Check(exc_type));
4033 n = PyTuple_GET_SIZE(tuple);
4034 #if PY_MAJOR_VERSION >= 3
4035 for (i=0; i<n; i++) {
4036 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
4037 }
4038 #endif
4039 for (i=0; i<n; i++) {
4040 PyObject *t = PyTuple_GET_ITEM(tuple, i);
4041 #if PY_MAJOR_VERSION < 3
4042 if (likely(exc_type == t)) return 1;
4043 #endif
4044 if (likely(PyExceptionClass_Check(t))) {
4045 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
4046 } else {
4047 }
4048 }
4049 return 0;
4050 }
4051 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
4052 if (likely(err == exc_type)) return 1;
4053 if (likely(PyExceptionClass_Check(err))) {
4054 if (likely(PyExceptionClass_Check(exc_type))) {
4055 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
4056 } else if (likely(PyTuple_Check(exc_type))) {
4057 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
4058 } else {
4059 }
4060 }
4061 return PyErr_GivenExceptionMatches(err, exc_type);
4062 }
4063 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
4064 assert(PyExceptionClass_Check(exc_type1));
4065 assert(PyExceptionClass_Check(exc_type2));
4066 if (likely(err == exc_type1 || err == exc_type2)) return 1;
4067 if (likely(PyExceptionClass_Check(err))) {
4068 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
4069 }
4070 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
4071 }
4072 #endif
4073
35074074 /* CheckBinaryVersion */
35084075 static int __Pyx_check_binary_version(void) {
35094076 char ctversion[4], rtversion[4];
35464113 #endif
35474114 if (!*t->p)
35484115 return -1;
4116 if (PyObject_Hash(*t->p) == -1)
4117 return -1;
35494118 ++t;
35504119 }
35514120 return 0;
35544123 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
35554124 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
35564125 }
3557 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
4126 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
35584127 Py_ssize_t ignore;
35594128 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
35604129 }
3561 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
3562 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
4130 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
4131 #if !CYTHON_PEP393_ENABLED
4132 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
4133 char* defenc_c;
4134 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
4135 if (!defenc) return NULL;
4136 defenc_c = PyBytes_AS_STRING(defenc);
4137 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
4138 {
4139 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
4140 char* c;
4141 for (c = defenc_c; c < end; c++) {
4142 if ((unsigned char) (*c) >= 128) {
4143 PyUnicode_AsASCIIString(o);
4144 return NULL;
4145 }
4146 }
4147 }
4148 #endif
4149 *length = PyBytes_GET_SIZE(defenc);
4150 return defenc_c;
4151 }
4152 #else
4153 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
4154 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
4155 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
4156 if (likely(PyUnicode_IS_ASCII(o))) {
4157 *length = PyUnicode_GET_LENGTH(o);
4158 return PyUnicode_AsUTF8(o);
4159 } else {
4160 PyUnicode_AsASCIIString(o);
4161 return NULL;
4162 }
4163 #else
4164 return PyUnicode_AsUTF8AndSize(o, length);
4165 #endif
4166 }
4167 #endif
4168 #endif
4169 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
4170 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
35634171 if (
35644172 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
35654173 __Pyx_sys_getdefaultencoding_not_ascii &&
35664174 #endif
35674175 PyUnicode_Check(o)) {
3568 #if PY_VERSION_HEX < 0x03030000
3569 char* defenc_c;
3570 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
3571 if (!defenc) return NULL;
3572 defenc_c = PyBytes_AS_STRING(defenc);
3573 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
3574 {
3575 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
3576 char* c;
3577 for (c = defenc_c; c < end; c++) {
3578 if ((unsigned char) (*c) >= 128) {
3579 PyUnicode_AsASCIIString(o);
3580 return NULL;
3581 }
3582 }
3583 }
3584 #endif
3585 *length = PyBytes_GET_SIZE(defenc);
3586 return defenc_c;
3587 #else
3588 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
3589 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
3590 if (PyUnicode_IS_ASCII(o)) {
3591 *length = PyUnicode_GET_LENGTH(o);
3592 return PyUnicode_AsUTF8(o);
3593 } else {
3594 PyUnicode_AsASCIIString(o);
3595 return NULL;
3596 }
3597 #else
3598 return PyUnicode_AsUTF8AndSize(o, length);
3599 #endif
3600 #endif
4176 return __Pyx_PyUnicode_AsStringAndSize(o, length);
36014177 } else
36024178 #endif
36034179 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
36214197 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
36224198 else return PyObject_IsTrue(x);
36234199 }
4200 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
4201 #if PY_MAJOR_VERSION >= 3
4202 if (PyLong_Check(result)) {
4203 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
4204 "__int__ returned non-int (type %.200s). "
4205 "The ability to return an instance of a strict subclass of int "
4206 "is deprecated, and may be removed in a future version of Python.",
4207 Py_TYPE(result)->tp_name)) {
4208 Py_DECREF(result);
4209 return NULL;
4210 }
4211 return result;
4212 }
4213 #endif
4214 PyErr_Format(PyExc_TypeError,
4215 "__%.4s__ returned non-%.4s (type %.200s)",
4216 type_name, type_name, Py_TYPE(result)->tp_name);
4217 Py_DECREF(result);
4218 return NULL;
4219 }
36244220 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
36254221 #if CYTHON_USE_TYPE_SLOTS
36264222 PyNumberMethods *m;
36284224 const char *name = NULL;
36294225 PyObject *res = NULL;
36304226 #if PY_MAJOR_VERSION < 3
3631 if (PyInt_Check(x) || PyLong_Check(x))
3632 #else
3633 if (PyLong_Check(x))
4227 if (likely(PyInt_Check(x) || PyLong_Check(x)))
4228 #else
4229 if (likely(PyLong_Check(x)))
36344230 #endif
36354231 return __Pyx_NewRef(x);
36364232 #if CYTHON_USE_TYPE_SLOTS
36384234 #if PY_MAJOR_VERSION < 3
36394235 if (m && m->nb_int) {
36404236 name = "int";
3641 res = PyNumber_Int(x);
4237 res = m->nb_int(x);
36424238 }
36434239 else if (m && m->nb_long) {
36444240 name = "long";
3645 res = PyNumber_Long(x);
4241 res = m->nb_long(x);
36464242 }
36474243 #else
3648 if (m && m->nb_int) {
4244 if (likely(m && m->nb_int)) {
36494245 name = "int";
3650 res = PyNumber_Long(x);
4246 res = m->nb_int(x);
36514247 }
36524248 #endif
36534249 #else
3654 res = PyNumber_Int(x);
3655 #endif
3656 if (res) {
4250 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
4251 res = PyNumber_Int(x);
4252 }
4253 #endif
4254 if (likely(res)) {
36574255 #if PY_MAJOR_VERSION < 3
3658 if (!PyInt_Check(res) && !PyLong_Check(res)) {
3659 #else
3660 if (!PyLong_Check(res)) {
3661 #endif
3662 PyErr_Format(PyExc_TypeError,
3663 "__%.4s__ returned non-%.4s (type %.200s)",
3664 name, name, Py_TYPE(res)->tp_name);
3665 Py_DECREF(res);
3666 return NULL;
4256 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
4257 #else
4258 if (unlikely(!PyLong_CheckExact(res))) {
4259 #endif
4260 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
36674261 }
36684262 }
36694263 else if (!PyErr_Occurred()) {
37344328 Py_DECREF(x);
37354329 return ival;
37364330 }
4331 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
4332 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
4333 }
37374334 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
37384335 return PyInt_FromSize_t(ival);
37394336 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
8 #else
9 #define CYTHON_ABI "0_25_2"
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
8 #else
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
102120 #define CYTHON_COMPILING_IN_CPYTHON 1
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
105129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
409549 { \
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420552
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
428560
429561 #define __PYX_HAVE__pygame_sdl2__pygame_time
430562 #define __PYX_HAVE_API__pygame_sdl2__pygame_time
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
437570 #include <omp.h>
438571 #endif /* _OPENMP */
439572
440 #ifdef PYREX_WITHOUT_ASSERTIONS
573 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
441574 #define CYTHON_WITHOUT_ASSERTIONS
442575 #endif
443576
468601 #define __Pyx_sst_abs(value) abs(value)
469602 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
470603 #define __Pyx_sst_abs(value) labs(value)
471 #elif defined (_MSC_VER) && defined (_M_X64)
472 #define __Pyx_sst_abs(value) _abs64(value)
604 #elif defined (_MSC_VER)
605 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
473606 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
474607 #define __Pyx_sst_abs(value) llabs(value)
475608 #elif defined (__GNUC__)
477610 #else
478611 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
479612 #endif
480 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
481 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
613 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
614 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
482615 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
483616 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
484617 #define __Pyx_PyBytes_FromString PyBytes_FromString
491624 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
492625 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
493626 #endif
494 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
495 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
627 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
628 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
629 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
634 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
635 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
496638 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
497639 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
498640 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
499641 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
500642 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
501 #if PY_MAJOR_VERSION < 3
502 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
503 {
643 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
504644 const Py_UNICODE *u_end = u;
505645 while (*u_end++) ;
506646 return (size_t)(u_end - u - 1);
507647 }
508 #else
509 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
510 #endif
511648 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
512649 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
513650 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
514651 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
515652 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
516 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
653 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
517654 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
518655 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
656 #define __Pyx_PySequence_Tuple(obj)\
657 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
519658 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
520659 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
521660 #if CYTHON_ASSUME_SAFE_MACROS
614753 #define likely(x) (x)
615754 #define unlikely(x) (x)
616755 #endif /* __GNUC__ */
617
618 static PyObject *__pyx_m;
756 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
757
758 static PyObject *__pyx_m = NULL;
619759 static PyObject *__pyx_d;
620760 static PyObject *__pyx_b;
761 static PyObject *__pyx_cython_runtime = NULL;
621762 static PyObject *__pyx_empty_tuple;
622763 static PyObject *__pyx_empty_bytes;
623764 static PyObject *__pyx_empty_unicode;
630771 static const char *__pyx_f[] = {
631772 "src/pygame_sdl2/pygame_time.pyx",
632773 };
774 /* NoFastGil.proto */
775 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
776 #define __Pyx_PyGILState_Release PyGILState_Release
777 #define __Pyx_FastGIL_Remember()
778 #define __Pyx_FastGIL_Forget()
779 #define __Pyx_FastGilFuncInit()
780
781 /* ForceInitThreads.proto */
782 #ifndef __PYX_FORCE_INIT_THREADS
783 #define __PYX_FORCE_INIT_THREADS 0
784 #endif
785
633786
634787 /*--- Type declarations ---*/
635788
699852
700853 /* PyObjectGetAttrStr.proto */
701854 #if CYTHON_USE_TYPE_SLOTS
702 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
703 PyTypeObject* tp = Py_TYPE(obj);
704 if (likely(tp->tp_getattro))
705 return tp->tp_getattro(obj, attr_name);
706 #if PY_MAJOR_VERSION < 3
707 if (likely(tp->tp_getattr))
708 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
709 #endif
710 return PyObject_GetAttr(obj, attr_name);
711 }
855 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
712856 #else
713857 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
714858 #endif
762906 /* PyThreadStateGet.proto */
763907 #if CYTHON_FAST_THREAD_STATE
764908 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
765 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
909 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
910 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
766911 #else
767912 #define __Pyx_PyThreadState_declare
768913 #define __Pyx_PyThreadState_assign
914 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
769915 #endif
770916
771917 /* PyErrFetchRestore.proto */
772918 #if CYTHON_FAST_THREAD_STATE
919 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
773920 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
774921 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
775922 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
776923 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
777924 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
778925 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
779 #else
926 #if CYTHON_COMPILING_IN_CPYTHON
927 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
928 #else
929 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
930 #endif
931 #else
932 #define __Pyx_PyErr_Clear() PyErr_Clear()
933 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
780934 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
781935 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
936 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
937 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
782938 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
783939 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
784940 #endif
801957 /* dict_getitem_default.proto */
802958 static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);
803959
960 /* UnpackUnboundCMethod.proto */
961 typedef struct {
962 PyObject *type;
963 PyObject **method_name;
964 PyCFunction func;
965 PyObject *method;
966 int flag;
967 } __Pyx_CachedCFunction;
968
969 /* CallUnboundCMethod1.proto */
970 static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
971 #if CYTHON_COMPILING_IN_CPYTHON
972 static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
973 #else
974 #define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg)
975 #endif
976
977 /* CallUnboundCMethod2.proto */
978 static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
979 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
980 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
981 #else
982 #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
983 #endif
984
804985 /* PyObjectSetAttrStr.proto */
805986 #if CYTHON_USE_TYPE_SLOTS
806 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
807 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
808 PyTypeObject* tp = Py_TYPE(obj);
809 if (likely(tp->tp_setattro))
810 return tp->tp_setattro(obj, attr_name, value);
811 #if PY_MAJOR_VERSION < 3
812 if (likely(tp->tp_setattr))
813 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
814 #endif
815 return PyObject_SetAttr(obj, attr_name, value);
816 }
987 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
988 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
817989 #else
818990 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
819991 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
821993
822994 /* PyObjectCallMethod1.proto */
823995 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
996 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg);
824997
825998 /* pop_index.proto */
826999 static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix);
8921065
8931066 /* CythonFunction.proto */
8941067 #define __Pyx_CyFunction_USED 1
895 #include <structmember.h>
8961068 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
8971069 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
8981070 #define __Pyx_CYFUNCTION_CCLASS 0x04
9441116 PyObject *dict);
9451117 static int __pyx_CyFunction_init(void);
9461118
1119 /* SetNameInClass.proto */
1120 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
1121 #define __Pyx_SetNameInClass(ns, name, value)\
1122 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
1123 #elif CYTHON_COMPILING_IN_CPYTHON
1124 #define __Pyx_SetNameInClass(ns, name, value)\
1125 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
1126 #else
1127 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
1128 #endif
1129
9471130 /* CalculateMetaclass.proto */
9481131 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
9491132
9521135 PyObject *mkw, PyObject *modname, PyObject *doc);
9531136 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
9541137 PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
1138
1139 /* CLineInTraceback.proto */
1140 #ifdef CYTHON_CLINE_IN_TRACEBACK
1141 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1142 #else
1143 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1144 #endif
9551145
9561146 /* CodeObjectCache.proto */
9571147 typedef struct {
9751165 /* CIntToPy.proto */
9761166 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);
9771167
978 /* ForceInitThreads.proto */
979 #ifndef __PYX_FORCE_INIT_THREADS
980 #define __PYX_FORCE_INIT_THREADS 0
981 #endif
982
9831168 /* CIntToPy.proto */
9841169 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
9851170
9941179
9951180 /* CIntFromPy.proto */
9961181 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1182
1183 /* FastTypeChecks.proto */
1184 #if CYTHON_COMPILING_IN_CPYTHON
1185 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1186 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1187 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1188 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1189 #else
1190 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1191 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1192 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1193 #endif
1194 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
9971195
9981196 /* CheckBinaryVersion.proto */
9991197 static int __Pyx_check_binary_version(void);
10191217 static PyObject *__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event = 0;
10201218 static Uint32 __pyx_f_11pygame_sdl2_11pygame_time_timer_callback(Uint32, void *); /*proto*/
10211219 #define __Pyx_MODULE_NAME "pygame_sdl2.pygame_time"
1220 extern int __pyx_module_is_main_pygame_sdl2__pygame_time;
10221221 int __pyx_module_is_main_pygame_sdl2__pygame_time = 0;
10231222
10241223 /* Implementation of 'pygame_sdl2.pygame_time' */
10771276 static const char __pyx_k_tick_busy_loop[] = "tick_busy_loop";
10781277 static const char __pyx_k_Clock_get_rawtime[] = "Clock.get_rawtime";
10791278 static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error";
1279 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
10801280 static const char __pyx_k_Clock_tick_busy_loop[] = "Clock.tick_busy_loop";
10811281 static const char __pyx_k_pygame_sdl2_pygame_time[] = "pygame_sdl2.pygame_time";
10821282 static const char __pyx_k_src_pygame_sdl2_pygame_time_pyx[] = "src/pygame_sdl2/pygame_time.pyx";
10901290 static PyObject *__pyx_n_s_append;
10911291 static PyObject *__pyx_n_s_average_fps;
10921292 static PyObject *__pyx_n_s_average_time;
1293 static PyObject *__pyx_n_s_cline_in_traceback;
10931294 static PyObject *__pyx_n_s_delay;
10941295 static PyObject *__pyx_n_s_display;
10951296 static PyObject *__pyx_n_s_doc;
11491350 static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_6get_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
11501351 static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_8get_rawtime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
11511352 static PyObject *__pyx_pf_11pygame_sdl2_11pygame_time_5Clock_10get_fps(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
1353 static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, &__pyx_n_s_get, 0, 0, 0};
11521354 static PyObject *__pyx_float_1_0;
11531355 static PyObject *__pyx_int_0;
11541356 static PyObject *__pyx_int_1000;
11751377 static PyObject *__pyx_codeobj__19;
11761378 static PyObject *__pyx_codeobj__21;
11771379 static PyObject *__pyx_codeobj__23;
1380 /* Late includes */
11781381
11791382 /* "pygame_sdl2/pygame_time.pyx":28
11801383 *
12501453 *
12511454 */
12521455 __pyx_t_4 = (SDL_InitSubSystem(SDL_INIT_TIMER) != 0);
1253 if (__pyx_t_4) {
1456 if (unlikely(__pyx_t_4)) {
12541457
12551458 /* "pygame_sdl2/pygame_time.pyx":32
12561459 *
14861689 #ifdef WITH_THREAD
14871690 PyThreadState *_save;
14881691 Py_UNBLOCK_THREADS
1692 __Pyx_FastGIL_Remember();
14891693 #endif
14901694 /*try:*/ {
14911695
15091713 /*finally:*/ {
15101714 /*normal exit:*/{
15111715 #ifdef WITH_THREAD
1716 __Pyx_FastGIL_Forget();
15121717 Py_BLOCK_THREADS
15131718 #endif
15141719 goto __pyx_L5;
17171922 * return interval
17181923 *
17191924 */
1720 SDL_PushEvent((&__pyx_v_e));
1925 (void)(SDL_PushEvent((&__pyx_v_e)));
17211926
17221927 /* "pygame_sdl2/pygame_time.pyx":60
17231928 * e.user.data2 = NULL
17681973 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17691974 switch (pos_args) {
17701975 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1976 CYTHON_FALLTHROUGH;
17711977 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1978 CYTHON_FALLTHROUGH;
17721979 case 0: break;
17731980 default: goto __pyx_L5_argtuple_error;
17741981 }
17751982 kw_args = PyDict_Size(__pyx_kwds);
17761983 switch (pos_args) {
17771984 case 0:
1778 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_eventid)) != 0)) kw_args--;
1985 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_eventid)) != 0)) kw_args--;
17791986 else goto __pyx_L5_argtuple_error;
1987 CYTHON_FALLTHROUGH;
17801988 case 1:
1781 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_milliseconds)) != 0)) kw_args--;
1989 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_milliseconds)) != 0)) kw_args--;
17821990 else {
17831991 __Pyx_RaiseArgtupleInvalid("set_timer", 1, 2, 2, 1); __PYX_ERR(0, 65, __pyx_L3_error)
17841992 }
18302038 * if timer_id != 0:
18312039 */
18322040 if (unlikely(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event == Py_None)) {
1833 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
2041 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
18342042 __PYX_ERR(0, 67, __pyx_L1_error)
18352043 }
18362044 __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event, __pyx_v_eventid, __pyx_int_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
18562064 * timer_id = 0
18572065 *
18582066 */
1859 SDL_RemoveTimer(__pyx_v_timer_id);
2067 (void)(SDL_RemoveTimer(__pyx_v_timer_id));
18602068
18612069 /* "pygame_sdl2/pygame_time.pyx":71
18622070 * if timer_id != 0:
19072115 *
19082116 */
19092117 __pyx_t_3 = ((__pyx_v_timer_id == 0) != 0);
1910 if (__pyx_t_3) {
2118 if (unlikely(__pyx_t_3)) {
19112119
19122120 /* "pygame_sdl2/pygame_time.pyx":76
19132121 * timer_id = SDL_AddTimer(milliseconds, <SDL_TimerCallback>timer_callback, <void*><int>eventid)
21142322 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
21152323 switch (pos_args) {
21162324 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2325 CYTHON_FALLTHROUGH;
21172326 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2327 CYTHON_FALLTHROUGH;
21182328 case 0: break;
21192329 default: goto __pyx_L5_argtuple_error;
21202330 }
21212331 kw_args = PyDict_Size(__pyx_kwds);
21222332 switch (pos_args) {
21232333 case 0:
2124 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2334 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
21252335 else goto __pyx_L5_argtuple_error;
2336 CYTHON_FALLTHROUGH;
21262337 case 1:
21272338 if (kw_args > 0) {
2128 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_framerate);
2339 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_framerate);
21292340 if (value) { values[1] = value; kw_args--; }
21302341 }
21312342 }
21352346 } else {
21362347 switch (PyTuple_GET_SIZE(__pyx_args)) {
21372348 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2349 CYTHON_FALLTHROUGH;
21382350 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21392351 break;
21402352 default: goto __pyx_L5_argtuple_error;
22112423 while (1) {
22122424 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error)
22132425 __Pyx_GOTREF(__pyx_t_3);
2214 __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 90, __pyx_L1_error)
2426 __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 90, __pyx_L1_error)
22152427 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22162428 __pyx_t_5 = ((__pyx_t_4 > 9) != 0);
22172429 if (!__pyx_t_5) break;
22672479 __Pyx_GOTREF(__pyx_t_2);
22682480 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_raw_frametime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
22692481 __Pyx_GOTREF(__pyx_t_3);
2270 __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_3); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 94, __pyx_L1_error)
2482 __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_3); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 94, __pyx_L1_error)
22712483 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22722484 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22732485
24522664 __Pyx_GOTREF(__pyx_t_2);
24532665 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_frametime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error)
24542666 __Pyx_GOTREF(__pyx_t_3);
2455 __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_3); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 102, __pyx_L1_error)
2667 __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_3); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 102, __pyx_L1_error)
24562668 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24572669 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24582670
25192731 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
25202732 switch (pos_args) {
25212733 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2734 CYTHON_FALLTHROUGH;
25222735 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2736 CYTHON_FALLTHROUGH;
25232737 case 0: break;
25242738 default: goto __pyx_L5_argtuple_error;
25252739 }
25262740 kw_args = PyDict_Size(__pyx_kwds);
25272741 switch (pos_args) {
25282742 case 0:
2529 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
2743 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
25302744 else goto __pyx_L5_argtuple_error;
2745 CYTHON_FALLTHROUGH;
25312746 case 1:
25322747 if (kw_args > 0) {
2533 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_framerate);
2748 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_framerate);
25342749 if (value) { values[1] = value; kw_args--; }
25352750 }
25362751 }
25402755 } else {
25412756 switch (PyTuple_GET_SIZE(__pyx_args)) {
25422757 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2758 CYTHON_FALLTHROUGH;
25432759 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25442760 break;
25452761 default: goto __pyx_L5_argtuple_error;
28213037 */
28223038 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
28233039 __Pyx_GOTREF(__pyx_t_1);
2824 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error)
3040 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error)
28253041 __Pyx_GOTREF(__pyx_t_2);
2826 __Pyx_GIVEREF(__pyx_t_1);
2827 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
2828 __pyx_t_1 = 0;
2829 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
2830 __Pyx_GOTREF(__pyx_t_1);
3042 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3043 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error)
28313044 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2832 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error)
2833 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28343045 __pyx_v_total_time = __pyx_t_3;
28353046
28363047 /* "pygame_sdl2/pygame_time.pyx":117
28403051 * cdef float average_fps = 1.0 / average_time
28413052 * return 0 if math.isnan(average_fps) else average_fps
28423053 */
2843 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
2844 __Pyx_GOTREF(__pyx_t_1);
2845 __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 117, __pyx_L1_error)
2846 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3054 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_last_frames); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
3055 __Pyx_GOTREF(__pyx_t_2);
3056 __pyx_t_4 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 117, __pyx_L1_error)
3057 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28473058 __pyx_v_average_time = ((((double)__pyx_v_total_time) / 1000.0) / ((double)__pyx_t_4));
28483059
28493060 /* "pygame_sdl2/pygame_time.pyx":118
28783089 }
28793090 }
28803091 if (!__pyx_t_7) {
2881 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
3092 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
28823093 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2883 __Pyx_GOTREF(__pyx_t_2);
3094 __Pyx_GOTREF(__pyx_t_1);
28843095 } else {
28853096 #if CYTHON_FAST_PYCALL
28863097 if (PyFunction_Check(__pyx_t_6)) {
28873098 PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
2888 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
3099 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
28893100 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
2890 __Pyx_GOTREF(__pyx_t_2);
3101 __Pyx_GOTREF(__pyx_t_1);
28913102 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28923103 } else
28933104 #endif
28943105 #if CYTHON_FAST_PYCCALL
28953106 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
28963107 PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
2897 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
3108 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
28983109 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
2899 __Pyx_GOTREF(__pyx_t_2);
3110 __Pyx_GOTREF(__pyx_t_1);
29003111 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
29013112 } else
29023113 #endif
29073118 __Pyx_GIVEREF(__pyx_t_5);
29083119 PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
29093120 __pyx_t_5 = 0;
2910 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
2911 __Pyx_GOTREF(__pyx_t_2);
3121 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
3122 __Pyx_GOTREF(__pyx_t_1);
29123123 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
29133124 }
29143125 }
29153126 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2916 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
2917 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3127 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
3128 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29183129 if (__pyx_t_9) {
29193130 __Pyx_INCREF(__pyx_int_0);
2920 __pyx_t_1 = __pyx_int_0;
3131 __pyx_t_2 = __pyx_int_0;
29213132 } else {
2922 __pyx_t_2 = PyFloat_FromDouble(__pyx_v_average_fps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
2923 __Pyx_GOTREF(__pyx_t_2);
2924 __pyx_t_1 = __pyx_t_2;
2925 __pyx_t_2 = 0;
3133 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_average_fps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
3134 __Pyx_GOTREF(__pyx_t_1);
3135 __pyx_t_2 = __pyx_t_1;
3136 __pyx_t_1 = 0;
29263137 }
2927 __pyx_r = __pyx_t_1;
2928 __pyx_t_1 = 0;
3138 __pyx_r = __pyx_t_2;
3139 __pyx_t_2 = 0;
29293140 goto __pyx_L0;
29303141
29313142 /* "pygame_sdl2/pygame_time.pyx":115
29573168 };
29583169
29593170 #if PY_MAJOR_VERSION >= 3
3171 #if CYTHON_PEP489_MULTI_PHASE_INIT
3172 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
3173 static int __pyx_pymod_exec_pygame_time(PyObject* module); /*proto*/
3174 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
3175 {Py_mod_create, (void*)__pyx_pymod_create},
3176 {Py_mod_exec, (void*)__pyx_pymod_exec_pygame_time},
3177 {0, NULL}
3178 };
3179 #endif
3180
29603181 static struct PyModuleDef __pyx_moduledef = {
2961 #if PY_VERSION_HEX < 0x03020000
2962 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
2963 #else
29643182 PyModuleDef_HEAD_INIT,
2965 #endif
29663183 "pygame_time",
29673184 0, /* m_doc */
3185 #if CYTHON_PEP489_MULTI_PHASE_INIT
3186 0, /* m_size */
3187 #else
29683188 -1, /* m_size */
3189 #endif
29693190 __pyx_methods /* m_methods */,
3191 #if CYTHON_PEP489_MULTI_PHASE_INIT
3192 __pyx_moduledef_slots, /* m_slots */
3193 #else
29703194 NULL, /* m_reload */
3195 #endif
29713196 NULL, /* m_traverse */
29723197 NULL, /* m_clear */
29733198 NULL /* m_free */
29853210 {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
29863211 {&__pyx_n_s_average_fps, __pyx_k_average_fps, sizeof(__pyx_k_average_fps), 0, 0, 1, 1},
29873212 {&__pyx_n_s_average_time, __pyx_k_average_time, sizeof(__pyx_k_average_time), 0, 0, 1, 1},
3213 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
29883214 {&__pyx_n_s_delay, __pyx_k_delay, sizeof(__pyx_k_delay), 0, 0, 1, 1},
29893215 {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1},
29903216 {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
30523278 * pygame_sdl2.display.sdl_main_init()
30533279 *
30543280 */
3055 __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_init, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 28, __pyx_L1_error)
3281 __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_init, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 28, __pyx_L1_error)
30563282
30573283 /* "pygame_sdl2/pygame_time.pyx":35
30583284 *
30613287 * SDL_QuitSubSystem(SDL_INIT_TIMER)
30623288 *
30633289 */
3064 __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_quit, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 35, __pyx_L1_error)
3290 __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_quit, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 35, __pyx_L1_error)
30653291
30663292 /* "pygame_sdl2/pygame_time.pyx":38
30673293 * SDL_QuitSubSystem(SDL_INIT_TIMER)
30703296 * return SDL_GetTicks()
30713297 *
30723298 */
3073 __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_get_ticks, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 38, __pyx_L1_error)
3299 __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_get_ticks, 38, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 38, __pyx_L1_error)
30743300
30753301 /* "pygame_sdl2/pygame_time.pyx":41
30763302 * return SDL_GetTicks()
30823308 __pyx_tuple__4 = PyTuple_Pack(3, __pyx_n_s_milliseconds, __pyx_n_s_milliseconds, __pyx_n_s_start); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 41, __pyx_L1_error)
30833309 __Pyx_GOTREF(__pyx_tuple__4);
30843310 __Pyx_GIVEREF(__pyx_tuple__4);
3085 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_wait, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 41, __pyx_L1_error)
3311 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_wait, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 41, __pyx_L1_error)
30863312
30873313 /* "pygame_sdl2/pygame_time.pyx":49
30883314 * return SDL_GetTicks() - start
30943320 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_milliseconds); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 49, __pyx_L1_error)
30953321 __Pyx_GOTREF(__pyx_tuple__6);
30963322 __Pyx_GIVEREF(__pyx_tuple__6);
3097 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_delay, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 49, __pyx_L1_error)
3323 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_delay, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 49, __pyx_L1_error)
30983324
30993325 /* "pygame_sdl2/pygame_time.pyx":65
31003326 * cdef dict timer_by_event = { }
31063332 __pyx_tuple__8 = PyTuple_Pack(3, __pyx_n_s_eventid, __pyx_n_s_milliseconds, __pyx_n_s_timer_id); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 65, __pyx_L1_error)
31073333 __Pyx_GOTREF(__pyx_tuple__8);
31083334 __Pyx_GIVEREF(__pyx_tuple__8);
3109 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_set_timer, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 65, __pyx_L1_error)
3335 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_set_timer, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 65, __pyx_L1_error)
31103336
31113337 /* "pygame_sdl2/pygame_time.pyx":81
31123338 *
31183344 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 81, __pyx_L1_error)
31193345 __Pyx_GOTREF(__pyx_tuple__10);
31203346 __Pyx_GIVEREF(__pyx_tuple__10);
3121 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_init_2, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 81, __pyx_L1_error)
3347 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_init_2, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 81, __pyx_L1_error)
31223348
31233349 /* "pygame_sdl2/pygame_time.pyx":87
31243350 * self.raw_frametime = 0
31303356 __pyx_tuple__12 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_framerate, __pyx_n_s_now, __pyx_n_s_frame_duration); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 87, __pyx_L1_error)
31313357 __Pyx_GOTREF(__pyx_tuple__12);
31323358 __Pyx_GIVEREF(__pyx_tuple__12);
3133 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_tick, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 87, __pyx_L1_error)
3359 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_tick, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 87, __pyx_L1_error)
31343360 __pyx_tuple__14 = PyTuple_Pack(1, ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 87, __pyx_L1_error)
31353361 __Pyx_GOTREF(__pyx_tuple__14);
31363362 __Pyx_GIVEREF(__pyx_tuple__14);
31453371 __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_framerate); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 105, __pyx_L1_error)
31463372 __Pyx_GOTREF(__pyx_tuple__15);
31473373 __Pyx_GIVEREF(__pyx_tuple__15);
3148 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_tick_busy_loop, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 105, __pyx_L1_error)
3374 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_tick_busy_loop, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 105, __pyx_L1_error)
31493375 __pyx_tuple__17 = PyTuple_Pack(1, ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 105, __pyx_L1_error)
31503376 __Pyx_GOTREF(__pyx_tuple__17);
31513377 __Pyx_GIVEREF(__pyx_tuple__17);
31603386 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 108, __pyx_L1_error)
31613387 __Pyx_GOTREF(__pyx_tuple__18);
31623388 __Pyx_GIVEREF(__pyx_tuple__18);
3163 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_get_time, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 108, __pyx_L1_error)
3389 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_get_time, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 108, __pyx_L1_error)
31643390
31653391 /* "pygame_sdl2/pygame_time.pyx":111
31663392 * return self.frametime
31723398 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 111, __pyx_L1_error)
31733399 __Pyx_GOTREF(__pyx_tuple__20);
31743400 __Pyx_GIVEREF(__pyx_tuple__20);
3175 __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_get_rawtime, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 111, __pyx_L1_error)
3401 __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_get_rawtime, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 111, __pyx_L1_error)
31763402
31773403 /* "pygame_sdl2/pygame_time.pyx":115
31783404 *
31843410 __pyx_tuple__22 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_total_time, __pyx_n_s_average_time, __pyx_n_s_average_fps); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 115, __pyx_L1_error)
31853411 __Pyx_GOTREF(__pyx_tuple__22);
31863412 __Pyx_GIVEREF(__pyx_tuple__22);
3187 __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_get_fps, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 115, __pyx_L1_error)
3413 __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_pygame_time_pyx, __pyx_n_s_get_fps, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 115, __pyx_L1_error)
31883414 __Pyx_RefNannyFinishContext();
31893415 return 0;
31903416 __pyx_L1_error:;
31933419 }
31943420
31953421 static int __Pyx_InitGlobals(void) {
3422 __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
31963423 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
31973424 __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
31983425 __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
32023429 return -1;
32033430 }
32043431
3432 static int __Pyx_modinit_global_init_code(void); /*proto*/
3433 static int __Pyx_modinit_variable_export_code(void); /*proto*/
3434 static int __Pyx_modinit_function_export_code(void); /*proto*/
3435 static int __Pyx_modinit_type_init_code(void); /*proto*/
3436 static int __Pyx_modinit_type_import_code(void); /*proto*/
3437 static int __Pyx_modinit_variable_import_code(void); /*proto*/
3438 static int __Pyx_modinit_function_import_code(void); /*proto*/
3439
3440 static int __Pyx_modinit_global_init_code(void) {
3441 __Pyx_RefNannyDeclarations
3442 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
3443 /*--- Global init code ---*/
3444 __pyx_v_11pygame_sdl2_11pygame_time_timer_by_event = ((PyObject*)Py_None); Py_INCREF(Py_None);
3445 __Pyx_RefNannyFinishContext();
3446 return 0;
3447 }
3448
3449 static int __Pyx_modinit_variable_export_code(void) {
3450 __Pyx_RefNannyDeclarations
3451 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
3452 /*--- Variable export code ---*/
3453 __Pyx_RefNannyFinishContext();
3454 return 0;
3455 }
3456
3457 static int __Pyx_modinit_function_export_code(void) {
3458 __Pyx_RefNannyDeclarations
3459 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
3460 /*--- Function export code ---*/
3461 __Pyx_RefNannyFinishContext();
3462 return 0;
3463 }
3464
3465 static int __Pyx_modinit_type_init_code(void) {
3466 __Pyx_RefNannyDeclarations
3467 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
3468 /*--- Type init code ---*/
3469 __Pyx_RefNannyFinishContext();
3470 return 0;
3471 }
3472
3473 static int __Pyx_modinit_type_import_code(void) {
3474 __Pyx_RefNannyDeclarations
3475 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
3476 /*--- Type import code ---*/
3477 __Pyx_RefNannyFinishContext();
3478 return 0;
3479 }
3480
3481 static int __Pyx_modinit_variable_import_code(void) {
3482 __Pyx_RefNannyDeclarations
3483 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
3484 /*--- Variable import code ---*/
3485 __Pyx_RefNannyFinishContext();
3486 return 0;
3487 }
3488
3489 static int __Pyx_modinit_function_import_code(void) {
3490 __Pyx_RefNannyDeclarations
3491 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
3492 /*--- Function import code ---*/
3493 __Pyx_RefNannyFinishContext();
3494 return 0;
3495 }
3496
3497
32053498 #if PY_MAJOR_VERSION < 3
3206 PyMODINIT_FUNC initpygame_time(void); /*proto*/
3207 PyMODINIT_FUNC initpygame_time(void)
3208 #else
3209 PyMODINIT_FUNC PyInit_pygame_time(void); /*proto*/
3210 PyMODINIT_FUNC PyInit_pygame_time(void)
3499 #ifdef CYTHON_NO_PYINIT_EXPORT
3500 #define __Pyx_PyMODINIT_FUNC void
3501 #else
3502 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
3503 #endif
3504 #else
3505 #ifdef CYTHON_NO_PYINIT_EXPORT
3506 #define __Pyx_PyMODINIT_FUNC PyObject *
3507 #else
3508 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
3509 #endif
3510 #endif
3511 #ifndef CYTHON_SMALL_CODE
3512 #if defined(__clang__)
3513 #define CYTHON_SMALL_CODE
3514 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
3515 #define CYTHON_SMALL_CODE __attribute__((cold))
3516 #else
3517 #define CYTHON_SMALL_CODE
3518 #endif
3519 #endif
3520
3521
3522 #if PY_MAJOR_VERSION < 3
3523 __Pyx_PyMODINIT_FUNC initpygame_time(void) CYTHON_SMALL_CODE; /*proto*/
3524 __Pyx_PyMODINIT_FUNC initpygame_time(void)
3525 #else
3526 __Pyx_PyMODINIT_FUNC PyInit_pygame_time(void) CYTHON_SMALL_CODE; /*proto*/
3527 __Pyx_PyMODINIT_FUNC PyInit_pygame_time(void)
3528 #if CYTHON_PEP489_MULTI_PHASE_INIT
3529 {
3530 return PyModuleDef_Init(&__pyx_moduledef);
3531 }
3532 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
3533 PyObject *value = PyObject_GetAttrString(spec, from_name);
3534 int result = 0;
3535 if (likely(value)) {
3536 result = PyDict_SetItemString(moddict, to_name, value);
3537 Py_DECREF(value);
3538 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
3539 PyErr_Clear();
3540 } else {
3541 result = -1;
3542 }
3543 return result;
3544 }
3545 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
3546 PyObject *module = NULL, *moddict, *modname;
3547 if (__pyx_m)
3548 return __Pyx_NewRef(__pyx_m);
3549 modname = PyObject_GetAttrString(spec, "name");
3550 if (unlikely(!modname)) goto bad;
3551 module = PyModule_NewObject(modname);
3552 Py_DECREF(modname);
3553 if (unlikely(!module)) goto bad;
3554 moddict = PyModule_GetDict(module);
3555 if (unlikely(!moddict)) goto bad;
3556 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
3557 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
3558 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
3559 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
3560 return module;
3561 bad:
3562 Py_XDECREF(module);
3563 return NULL;
3564 }
3565
3566
3567 static int __pyx_pymod_exec_pygame_time(PyObject *__pyx_pyinit_module)
3568 #endif
32113569 #endif
32123570 {
32133571 PyObject *__pyx_t_1 = NULL;
32143572 PyObject *__pyx_t_2 = NULL;
32153573 PyObject *__pyx_t_3 = NULL;
3216 PyObject *__pyx_t_4 = NULL;
3217 PyObject *__pyx_t_5 = NULL;
32183574 __Pyx_RefNannyDeclarations
3575 #if CYTHON_PEP489_MULTI_PHASE_INIT
3576 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
3577 #elif PY_MAJOR_VERSION >= 3
3578 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
3579 #endif
32193580 #if CYTHON_REFNANNY
3220 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
3221 if (!__Pyx_RefNanny) {
3222 PyErr_Clear();
3223 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
3224 if (!__Pyx_RefNanny)
3225 Py_FatalError("failed to import 'refnanny' module");
3226 }
3227 #endif
3228 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_pygame_time(void)", 0);
3581 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
3582 if (!__Pyx_RefNanny) {
3583 PyErr_Clear();
3584 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
3585 if (!__Pyx_RefNanny)
3586 Py_FatalError("failed to import 'refnanny' module");
3587 }
3588 #endif
3589 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_pygame_time(void)", 0);
32293590 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32303591 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
32313592 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
32423603 #ifdef __Pyx_Generator_USED
32433604 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32443605 #endif
3606 #ifdef __Pyx_AsyncGen_USED
3607 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3608 #endif
32453609 #ifdef __Pyx_StopAsyncIteration_USED
32463610 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32473611 #endif
32533617 #endif
32543618 #endif
32553619 /*--- Module creation code ---*/
3620 #if CYTHON_PEP489_MULTI_PHASE_INIT
3621 __pyx_m = __pyx_pyinit_module;
3622 Py_INCREF(__pyx_m);
3623 #else
32563624 #if PY_MAJOR_VERSION < 3
32573625 __pyx_m = Py_InitModule4("pygame_time", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
32583626 #else
32593627 __pyx_m = PyModule_Create(&__pyx_moduledef);
32603628 #endif
32613629 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
3630 #endif
32623631 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
32633632 Py_INCREF(__pyx_d);
32643633 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
3634 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
32653635 #if CYTHON_COMPILING_IN_PYPY
32663636 Py_INCREF(__pyx_b);
32673637 #endif
32863656 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32873657 /*--- Constants init code ---*/
32883658 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3289 /*--- Global init code ---*/
3290 __pyx_v_11pygame_sdl2_11pygame_time_timer_by_event = ((PyObject*)Py_None); Py_INCREF(Py_None);
3291 /*--- Variable export code ---*/
3292 /*--- Function export code ---*/
3293 /*--- Type init code ---*/
3294 /*--- Type import code ---*/
3295 /*--- Variable import code ---*/
3296 /*--- Function import code ---*/
3659 /*--- Global type/function init code ---*/
3660 (void)__Pyx_modinit_global_init_code();
3661 (void)__Pyx_modinit_variable_export_code();
3662 (void)__Pyx_modinit_function_export_code();
3663 (void)__Pyx_modinit_type_init_code();
3664 (void)__Pyx_modinit_type_import_code();
3665 (void)__Pyx_modinit_variable_import_code();
3666 (void)__Pyx_modinit_function_import_code();
32973667 /*--- Execution code ---*/
32983668 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
32993669 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
33603730 * def init():
33613731 * pygame_sdl2.display.sdl_main_init()
33623732 */
3363 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
3733 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
3734 __Pyx_GOTREF(__pyx_t_2);
3735 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_register_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
33643736 __Pyx_GOTREF(__pyx_t_1);
3365 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_register_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error)
3366 __Pyx_GOTREF(__pyx_t_3);
3367 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3737 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33683738
33693739 /* "pygame_sdl2/pygame_time.pyx":28
33703740 *
33733743 * pygame_sdl2.display.sdl_main_init()
33743744 *
33753745 */
3376 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_1init, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
3377 __Pyx_GOTREF(__pyx_t_1);
3378 __pyx_t_4 = NULL;
3379 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3380 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
3381 if (likely(__pyx_t_4)) {
3382 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3383 __Pyx_INCREF(__pyx_t_4);
3384 __Pyx_INCREF(function);
3385 __Pyx_DECREF_SET(__pyx_t_3, function);
3386 }
3387 }
3388 if (!__pyx_t_4) {
3389 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
3390 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3391 __Pyx_GOTREF(__pyx_t_2);
3392 } else {
3393 #if CYTHON_FAST_PYCALL
3394 if (PyFunction_Check(__pyx_t_3)) {
3395 PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
3396 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
3397 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3398 __Pyx_GOTREF(__pyx_t_2);
3399 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3400 } else
3401 #endif
3402 #if CYTHON_FAST_PYCCALL
3403 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
3404 PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
3405 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
3406 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3407 __Pyx_GOTREF(__pyx_t_2);
3408 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3409 } else
3410 #endif
3411 {
3412 __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error)
3413 __Pyx_GOTREF(__pyx_t_5);
3414 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
3415 __Pyx_GIVEREF(__pyx_t_1);
3416 PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_1);
3417 __pyx_t_1 = 0;
3418 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
3419 __Pyx_GOTREF(__pyx_t_2);
3420 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3421 }
3422 }
3746 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_1init, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
3747 __Pyx_GOTREF(__pyx_t_2);
3748
3749 /* "pygame_sdl2/pygame_time.pyx":27
3750 * cdef int timer_id = 0
3751 *
3752 * @pygame_sdl2.register_init # <<<<<<<<<<<<<<
3753 * def init():
3754 * pygame_sdl2.display.sdl_main_init()
3755 */
3756 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error)
3757 __Pyx_GOTREF(__pyx_t_3);
3758 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3759 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3760 if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
34233761 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3424 if (PyDict_SetItem(__pyx_d, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
3425 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34263762
34273763 /* "pygame_sdl2/pygame_time.pyx":34
34283764 * raise error()
34333769 */
34343770 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame_sdl2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error)
34353771 __Pyx_GOTREF(__pyx_t_3);
3436 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 34, __pyx_L1_error)
3437 __Pyx_GOTREF(__pyx_t_5);
3772 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_quit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
3773 __Pyx_GOTREF(__pyx_t_2);
34383774 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34393775
34403776 /* "pygame_sdl2/pygame_time.pyx":35
34463782 */
34473783 __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_3quit, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 35, __pyx_L1_error)
34483784 __Pyx_GOTREF(__pyx_t_3);
3449 __pyx_t_1 = NULL;
3450 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3451 __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
3452 if (likely(__pyx_t_1)) {
3453 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
3454 __Pyx_INCREF(__pyx_t_1);
3455 __Pyx_INCREF(function);
3456 __Pyx_DECREF_SET(__pyx_t_5, function);
3457 }
3458 }
3459 if (!__pyx_t_1) {
3460 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
3461 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3462 __Pyx_GOTREF(__pyx_t_2);
3463 } else {
3464 #if CYTHON_FAST_PYCALL
3465 if (PyFunction_Check(__pyx_t_5)) {
3466 PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
3467 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
3468 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3469 __Pyx_GOTREF(__pyx_t_2);
3470 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3471 } else
3472 #endif
3473 #if CYTHON_FAST_PYCCALL
3474 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
3475 PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
3476 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
3477 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3478 __Pyx_GOTREF(__pyx_t_2);
3479 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3480 } else
3481 #endif
3482 {
3483 __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L1_error)
3484 __Pyx_GOTREF(__pyx_t_4);
3485 __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL;
3486 __Pyx_GIVEREF(__pyx_t_3);
3487 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
3488 __pyx_t_3 = 0;
3489 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
3490 __Pyx_GOTREF(__pyx_t_2);
3491 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3492 }
3493 }
3494 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3495 if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
3785
3786 /* "pygame_sdl2/pygame_time.pyx":34
3787 * raise error()
3788 *
3789 * @pygame_sdl2.register_quit # <<<<<<<<<<<<<<
3790 * def quit(): # @ReservedAssignment
3791 * SDL_QuitSubSystem(SDL_INIT_TIMER)
3792 */
3793 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
3794 __Pyx_GOTREF(__pyx_t_1);
34963795 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3796 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3797 if (PyDict_SetItem(__pyx_d, __pyx_n_s_quit, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
3798 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34973799
34983800 /* "pygame_sdl2/pygame_time.pyx":38
34993801 * SDL_QuitSubSystem(SDL_INIT_TIMER)
35023804 * return SDL_GetTicks()
35033805 *
35043806 */
3505 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5get_ticks, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error)
3506 __Pyx_GOTREF(__pyx_t_2);
3507 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_ticks, __pyx_t_2) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
3508 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3807 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5get_ticks, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
3808 __Pyx_GOTREF(__pyx_t_1);
3809 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_ticks, __pyx_t_1) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
3810 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35093811
35103812 /* "pygame_sdl2/pygame_time.pyx":41
35113813 * return SDL_GetTicks()
35143816 * cdef int start
35153817 *
35163818 */
3517 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_7wait, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
3518 __Pyx_GOTREF(__pyx_t_2);
3519 if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
3520 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3819 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_7wait, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
3820 __Pyx_GOTREF(__pyx_t_1);
3821 if (PyDict_SetItem(__pyx_d, __pyx_n_s_wait, __pyx_t_1) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
3822 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35213823
35223824 /* "pygame_sdl2/pygame_time.pyx":49
35233825 * return SDL_GetTicks() - start
35263828 * # SDL_Delay() should be accurate enough.
35273829 * return wait(milliseconds)
35283830 */
3529 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_9delay, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
3530 __Pyx_GOTREF(__pyx_t_2);
3531 if (PyDict_SetItem(__pyx_d, __pyx_n_s_delay, __pyx_t_2) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
3532 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3831 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_9delay, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
3832 __Pyx_GOTREF(__pyx_t_1);
3833 if (PyDict_SetItem(__pyx_d, __pyx_n_s_delay, __pyx_t_1) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
3834 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35333835
35343836 /* "pygame_sdl2/pygame_time.pyx":63
35353837 *
35383840 *
35393841 * def set_timer(eventid, milliseconds):
35403842 */
3541 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
3542 __Pyx_GOTREF(__pyx_t_2);
3843 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
3844 __Pyx_GOTREF(__pyx_t_1);
35433845 __Pyx_XGOTREF(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event);
3544 __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event, ((PyObject*)__pyx_t_2));
3545 __Pyx_GIVEREF(__pyx_t_2);
3546 __pyx_t_2 = 0;
3846 __Pyx_DECREF_SET(__pyx_v_11pygame_sdl2_11pygame_time_timer_by_event, ((PyObject*)__pyx_t_1));
3847 __Pyx_GIVEREF(__pyx_t_1);
3848 __pyx_t_1 = 0;
35473849
35483850 /* "pygame_sdl2/pygame_time.pyx":65
35493851 * cdef dict timer_by_event = { }
35523854 *
35533855 * cdef int timer_id = timer_by_event.get(eventid, 0)
35543856 */
3555 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_11set_timer, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error)
3556 __Pyx_GOTREF(__pyx_t_2);
3557 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_timer, __pyx_t_2) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
3558 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3857 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_11set_timer, NULL, __pyx_n_s_pygame_sdl2_pygame_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
3858 __Pyx_GOTREF(__pyx_t_1);
3859 if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_timer, __pyx_t_1) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
3860 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
35593861
35603862 /* "pygame_sdl2/pygame_time.pyx":80
35613863 * timer_by_event[eventid] = timer_id
35643866 * def __init__(self):
35653867 * self.last = SDL_GetTicks()
35663868 */
3567 __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Clock, __pyx_n_s_Clock, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_pygame_time, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error)
3568 __Pyx_GOTREF(__pyx_t_2);
3869 __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Clock, __pyx_n_s_Clock, (PyObject *) NULL, __pyx_n_s_pygame_sdl2_pygame_time, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
3870 __Pyx_GOTREF(__pyx_t_1);
35693871
35703872 /* "pygame_sdl2/pygame_time.pyx":81
35713873 *
35743876 * self.last = SDL_GetTicks()
35753877 * self.last_frames = []
35763878 */
3577 __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_1__init__, 0, __pyx_n_s_Clock___init, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 81, __pyx_L1_error)
3578 __Pyx_GOTREF(__pyx_t_5);
3579 if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_5) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
3580 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3879 __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_1__init__, 0, __pyx_n_s_Clock___init, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L1_error)
3880 __Pyx_GOTREF(__pyx_t_3);
3881 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init_2, __pyx_t_3) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
3882 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35813883
35823884 /* "pygame_sdl2/pygame_time.pyx":87
35833885 * self.raw_frametime = 0
35863888 * cdef int now = SDL_GetTicks()
35873889 * self.raw_frametime = now - self.last
35883890 */
3589 __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_3tick, 0, __pyx_n_s_Clock_tick, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error)
3590 __Pyx_GOTREF(__pyx_t_5);
3591 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__14);
3592 if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_tick, __pyx_t_5) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
3593 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3891 __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_3tick, 0, __pyx_n_s_Clock_tick, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error)
3892 __Pyx_GOTREF(__pyx_t_3);
3893 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__14);
3894 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_tick, __pyx_t_3) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
3895 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35943896
35953897 /* "pygame_sdl2/pygame_time.pyx":105
35963898 * return self.frametime
35993901 * return self.tick(framerate)
36003902 *
36013903 */
3602 __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop, 0, __pyx_n_s_Clock_tick_busy_loop, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 105, __pyx_L1_error)
3603 __Pyx_GOTREF(__pyx_t_5);
3604 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__17);
3605 if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_tick_busy_loop, __pyx_t_5) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
3606 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3904 __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_5tick_busy_loop, 0, __pyx_n_s_Clock_tick_busy_loop, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error)
3905 __Pyx_GOTREF(__pyx_t_3);
3906 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__17);
3907 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_tick_busy_loop, __pyx_t_3) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
3908 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
36073909
36083910 /* "pygame_sdl2/pygame_time.pyx":108
36093911 * return self.tick(framerate)
36123914 * return self.frametime
36133915 *
36143916 */
3615 __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_7get_time, 0, __pyx_n_s_Clock_get_time, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 108, __pyx_L1_error)
3616 __Pyx_GOTREF(__pyx_t_5);
3617 if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_time, __pyx_t_5) < 0) __PYX_ERR(0, 108, __pyx_L1_error)
3618 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3917 __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_7get_time, 0, __pyx_n_s_Clock_get_time, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 108, __pyx_L1_error)
3918 __Pyx_GOTREF(__pyx_t_3);
3919 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_get_time, __pyx_t_3) < 0) __PYX_ERR(0, 108, __pyx_L1_error)
3920 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
36193921
36203922 /* "pygame_sdl2/pygame_time.pyx":111
36213923 * return self.frametime
36243926 * return self.raw_frametime
36253927 *
36263928 */
3627 __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime, 0, __pyx_n_s_Clock_get_rawtime, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 111, __pyx_L1_error)
3628 __Pyx_GOTREF(__pyx_t_5);
3629 if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_rawtime, __pyx_t_5) < 0) __PYX_ERR(0, 111, __pyx_L1_error)
3630 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3929 __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_9get_rawtime, 0, __pyx_n_s_Clock_get_rawtime, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error)
3930 __Pyx_GOTREF(__pyx_t_3);
3931 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_get_rawtime, __pyx_t_3) < 0) __PYX_ERR(0, 111, __pyx_L1_error)
3932 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
36313933
36323934 /* "pygame_sdl2/pygame_time.pyx":115
36333935 *
36363938 * cdef int total_time = sum(self.last_frames)
36373939 * cdef float average_time = total_time / 1000.0 / len(self.last_frames)
36383940 */
3639 __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_11get_fps, 0, __pyx_n_s_Clock_get_fps, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 115, __pyx_L1_error)
3640 __Pyx_GOTREF(__pyx_t_5);
3641 if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_get_fps, __pyx_t_5) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
3642 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3941 __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11pygame_sdl2_11pygame_time_5Clock_11get_fps, 0, __pyx_n_s_Clock_get_fps, NULL, __pyx_n_s_pygame_sdl2_pygame_time, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error)
3942 __Pyx_GOTREF(__pyx_t_3);
3943 if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_get_fps, __pyx_t_3) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
3944 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
36433945
36443946 /* "pygame_sdl2/pygame_time.pyx":80
36453947 * timer_by_event[eventid] = timer_id
36483950 * def __init__(self):
36493951 * self.last = SDL_GetTicks()
36503952 */
3651 __pyx_t_5 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Clock, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L1_error)
3652 __Pyx_GOTREF(__pyx_t_5);
3653 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Clock, __pyx_t_5) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
3654 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3655 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3953 __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_Clock, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error)
3954 __Pyx_GOTREF(__pyx_t_3);
3955 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Clock, __pyx_t_3) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
3956 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3957 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36563958
36573959 /* "pygame_sdl2/pygame_time.pyx":1
36583960 * # Copyright 2014 Patrick Dawson <pat@dw.is> # <<<<<<<<<<<<<<
36593961 * #
36603962 * # This software is provided 'as-is', without any express or implied
36613963 */
3662 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
3663 __Pyx_GOTREF(__pyx_t_2);
3664 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3665 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3964 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
3965 __Pyx_GOTREF(__pyx_t_1);
3966 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3967 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
36663968
36673969 /*--- Wrapped vars code ---*/
36683970
36713973 __Pyx_XDECREF(__pyx_t_1);
36723974 __Pyx_XDECREF(__pyx_t_2);
36733975 __Pyx_XDECREF(__pyx_t_3);
3674 __Pyx_XDECREF(__pyx_t_4);
3675 __Pyx_XDECREF(__pyx_t_5);
36763976 if (__pyx_m) {
36773977 if (__pyx_d) {
3678 __Pyx_AddTraceback("init pygame_sdl2.pygame_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
3978 __Pyx_AddTraceback("init pygame_sdl2.pygame_time", 0, __pyx_lineno, __pyx_filename);
36793979 }
36803980 Py_DECREF(__pyx_m); __pyx_m = 0;
36813981 } else if (!PyErr_Occurred()) {
36833983 }
36843984 __pyx_L0:;
36853985 __Pyx_RefNannyFinishContext();
3686 #if PY_MAJOR_VERSION < 3
3986 #if CYTHON_PEP489_MULTI_PHASE_INIT
3987 return (__pyx_m != NULL) ? 0 : -1;
3988 #elif PY_MAJOR_VERSION >= 3
3989 return __pyx_m;
3990 #else
36873991 return;
3688 #else
3689 return __pyx_m;
36903992 #endif
36913993 }
36923994
37084010 }
37094011 #endif
37104012
4013 /* PyObjectGetAttrStr */
4014 #if CYTHON_USE_TYPE_SLOTS
4015 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
4016 PyTypeObject* tp = Py_TYPE(obj);
4017 if (likely(tp->tp_getattro))
4018 return tp->tp_getattro(obj, attr_name);
4019 #if PY_MAJOR_VERSION < 3
4020 if (likely(tp->tp_getattr))
4021 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
4022 #endif
4023 return PyObject_GetAttr(obj, attr_name);
4024 }
4025 #endif
4026
37114027 /* GetBuiltinName */
37124028 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
37134029 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
37264042 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
37274043 PyObject *result;
37284044 #if !CYTHON_AVOID_BORROWED_REFS
4045 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
4046 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
4047 if (likely(result)) {
4048 Py_INCREF(result);
4049 } else if (unlikely(PyErr_Occurred())) {
4050 result = NULL;
4051 } else {
4052 #else
37294053 result = PyDict_GetItem(__pyx_d, name);
37304054 if (likely(result)) {
37314055 Py_INCREF(result);
37324056 } else {
4057 #endif
37334058 #else
37344059 result = PyObject_GetItem(__pyx_d, name);
37354060 if (!result) {
37414066 }
37424067
37434068 /* PyCFunctionFastCall */
3744 #if CYTHON_FAST_PYCCALL
4069 #if CYTHON_FAST_PYCCALL
37454070 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
37464071 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
37474072 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
37484073 PyObject *self = PyCFunction_GET_SELF(func);
4074 int flags = PyCFunction_GET_FLAGS(func);
37494075 assert(PyCFunction_Check(func));
3750 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
4076 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
37514077 assert(nargs >= 0);
37524078 assert(nargs == 0 || args != NULL);
37534079 /* _PyCFunction_FastCallDict() must not be called with an exception set,
37544080 because it may clear it (directly or indirectly) and so the
37554081 caller loses its exception */
37564082 assert(!PyErr_Occurred());
3757 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
3758 }
3759 #endif // CYTHON_FAST_PYCCALL
4083 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
4084 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
4085 } else {
4086 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
4087 }
4088 }
4089 #endif
37604090
37614091 /* PyFunctionFastCall */
3762 #if CYTHON_FAST_PYCALL
4092 #if CYTHON_FAST_PYCALL
37634093 #include "frameobject.h"
37644094 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
37654095 PyObject *globals) {
37664096 PyFrameObject *f;
3767 PyThreadState *tstate = PyThreadState_GET();
4097 PyThreadState *tstate = __Pyx_PyThreadState_Current;
37684098 PyObject **fastlocals;
37694099 Py_ssize_t i;
37704100 PyObject *result;
38754205 Py_LeaveRecursiveCall();
38764206 return result;
38774207 }
3878 #endif // CPython < 3.6
3879 #endif // CYTHON_FAST_PYCALL
4208 #endif
4209 #endif
38804210
38814211 /* PyObjectCall */
3882 #if CYTHON_COMPILING_IN_CPYTHON
4212 #if CYTHON_COMPILING_IN_CPYTHON
38834213 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
38844214 PyObject *result;
38854215 ternaryfunc call = func->ob_type->tp_call;
38994229 #endif
39004230
39014231 /* PyObjectCallMethO */
3902 #if CYTHON_COMPILING_IN_CPYTHON
4232 #if CYTHON_COMPILING_IN_CPYTHON
39034233 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
39044234 PyObject *self, *result;
39054235 PyCFunction cfunc;
39194249 #endif
39204250
39214251 /* PyObjectCallOneArg */
3922 #if CYTHON_COMPILING_IN_CPYTHON
4252 #if CYTHON_COMPILING_IN_CPYTHON
39234253 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
39244254 PyObject *result;
39254255 PyObject *args = PyTuple_New(1);
39364266 return __Pyx_PyFunction_FastCall(func, &arg, 1);
39374267 }
39384268 #endif
3939 #ifdef __Pyx_CyFunction_USED
3940 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
3941 #else
39424269 if (likely(PyCFunction_Check(func))) {
3943 #endif
39444270 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
39454271 return __Pyx_PyObject_CallMethO(func, arg);
39464272 #if CYTHON_FAST_PYCCALL
39714297 }
39724298 #endif
39734299 #ifdef __Pyx_CyFunction_USED
3974 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
4300 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
39754301 #else
39764302 if (likely(PyCFunction_Check(func))) {
39774303 #endif
41234449 "raise: exception class must be a subclass of BaseException");
41244450 goto bad;
41254451 }
4126 #if PY_VERSION_HEX >= 0x03030000
41274452 if (cause) {
4128 #else
4129 if (cause && cause != Py_None) {
4130 #endif
41314453 PyObject *fixed_cause;
41324454 if (cause == Py_None) {
41334455 fixed_cause = NULL;
41554477 PyErr_Restore(tmp_type, tmp_value, tb);
41564478 Py_XDECREF(tmp_tb);
41574479 #else
4158 PyThreadState *tstate = PyThreadState_GET();
4480 PyThreadState *tstate = __Pyx_PyThreadState_Current;
41594481 PyObject* tmp_tb = tstate->curexc_traceback;
41604482 if (tb != tmp_tb) {
41614483 Py_INCREF(tb);
41714493 #endif
41724494
41734495 /* RaiseArgTupleInvalid */
4174 static void __Pyx_RaiseArgtupleInvalid(
4496 static void __Pyx_RaiseArgtupleInvalid(
41754497 const char* func_name,
41764498 int exact,
41774499 Py_ssize_t num_min,
41974519 }
41984520
41994521 /* RaiseDoubleKeywords */
4200 static void __Pyx_RaiseDoubleKeywordsError(
4522 static void __Pyx_RaiseDoubleKeywordsError(
42014523 const char* func_name,
42024524 PyObject* kw_name)
42034525 {
42114533 }
42124534
42134535 /* ParseKeywords */
4214 static int __Pyx_ParseOptionalKeywords(
4536 static int __Pyx_ParseOptionalKeywords(
42154537 PyObject *kwds,
42164538 PyObject **argnames[],
42174539 PyObject *kwds2,
43124634 return -1;
43134635 }
43144636
4637 /* UnpackUnboundCMethod */
4638 static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
4639 PyObject *method;
4640 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
4641 if (unlikely(!method))
4642 return -1;
4643 target->method = method;
4644 #if CYTHON_COMPILING_IN_CPYTHON
4645 #if PY_MAJOR_VERSION >= 3
4646 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
4647 #endif
4648 {
4649 PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
4650 target->func = descr->d_method->ml_meth;
4651 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST);
4652 }
4653 #endif
4654 return 0;
4655 }
4656
4657 /* CallUnboundCMethod1 */
4658 #if CYTHON_COMPILING_IN_CPYTHON
4659 static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
4660 if (likely(cfunc->func)) {
4661 int flag = cfunc->flag;
4662 if (flag == METH_O) {
4663 return (*(cfunc->func))(self, arg);
4664 } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) {
4665 if (PY_VERSION_HEX >= 0x030700A0) {
4666 return (*(__Pyx_PyCFunctionFast)cfunc->func)(self, &arg, 1);
4667 } else {
4668 return (*(__Pyx_PyCFunctionFastWithKeywords)cfunc->func)(self, &arg, 1, NULL);
4669 }
4670 } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) {
4671 return (*(__Pyx_PyCFunctionFastWithKeywords)cfunc->func)(self, &arg, 1, NULL);
4672 }
4673 }
4674 return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
4675 }
4676 #endif
4677 static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
4678 PyObject *args, *result = NULL;
4679 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
4680 #if CYTHON_COMPILING_IN_CPYTHON
4681 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
4682 args = PyTuple_New(1);
4683 if (unlikely(!args)) goto bad;
4684 Py_INCREF(arg);
4685 PyTuple_SET_ITEM(args, 0, arg);
4686 if (cfunc->flag & METH_KEYWORDS)
4687 result = (*(PyCFunctionWithKeywords)cfunc->func)(self, args, NULL);
4688 else
4689 result = (*cfunc->func)(self, args);
4690 } else {
4691 args = PyTuple_New(2);
4692 if (unlikely(!args)) goto bad;
4693 Py_INCREF(self);
4694 PyTuple_SET_ITEM(args, 0, self);
4695 Py_INCREF(arg);
4696 PyTuple_SET_ITEM(args, 1, arg);
4697 result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
4698 }
4699 #else
4700 args = PyTuple_Pack(2, self, arg);
4701 if (unlikely(!args)) goto bad;
4702 result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
4703 #endif
4704 bad:
4705 Py_XDECREF(args);
4706 return result;
4707 }
4708
4709 /* CallUnboundCMethod2 */
4710 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
4711 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
4712 if (likely(cfunc->func)) {
4713 PyObject *args[2] = {arg1, arg2};
4714 if (cfunc->flag == METH_FASTCALL) {
4715 #if PY_VERSION_HEX >= 0x030700A0
4716 return (*(__Pyx_PyCFunctionFast)cfunc->func)(self, args, 2);
4717 #else
4718 return (*(__Pyx_PyCFunctionFastWithKeywords)cfunc->func)(self, args, 2, NULL);
4719 #endif
4720 }
4721 #if PY_VERSION_HEX >= 0x030700A0
4722 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
4723 return (*(__Pyx_PyCFunctionFastWithKeywords)cfunc->func)(self, args, 2, NULL);
4724 #endif
4725 }
4726 return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
4727 }
4728 #endif
4729 static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
4730 PyObject *args, *result = NULL;
4731 if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
4732 #if CYTHON_COMPILING_IN_CPYTHON
4733 if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
4734 args = PyTuple_New(2);
4735 if (unlikely(!args)) goto bad;
4736 Py_INCREF(arg1);
4737 PyTuple_SET_ITEM(args, 0, arg1);
4738 Py_INCREF(arg2);
4739 PyTuple_SET_ITEM(args, 1, arg2);
4740 if (cfunc->flag & METH_KEYWORDS)
4741 result = (*(PyCFunctionWithKeywords)cfunc->func)(self, args, NULL);
4742 else
4743 result = (*cfunc->func)(self, args);
4744 } else {
4745 args = PyTuple_New(3);
4746 if (unlikely(!args)) goto bad;
4747 Py_INCREF(self);
4748 PyTuple_SET_ITEM(args, 0, self);
4749 Py_INCREF(arg1);
4750 PyTuple_SET_ITEM(args, 1, arg1);
4751 Py_INCREF(arg2);
4752 PyTuple_SET_ITEM(args, 2, arg2);
4753 result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
4754 }
4755 #else
4756 args = PyTuple_Pack(3, self, arg1, arg2);
4757 if (unlikely(!args)) goto bad;
4758 result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
4759 #endif
4760 bad:
4761 Py_XDECREF(args);
4762 return result;
4763 }
4764
43154765 /* dict_getitem_default */
4316 static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
4766 static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
43174767 PyObject* value;
43184768 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
43194769 value = PyDict_GetItemWithError(d, key);
43234773 value = default_value;
43244774 }
43254775 Py_INCREF(value);
4776 if ((1));
43264777 #else
43274778 if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
43284779 value = PyDict_GetItem(d, key);
43304781 value = default_value;
43314782 }
43324783 Py_INCREF(value);
4333 } else {
4784 }
4785 #endif
4786 else {
43344787 if (default_value == Py_None)
4335 default_value = NULL;
4336 value = PyObject_CallMethodObjArgs(
4337 d, __pyx_n_s_get, key, default_value, NULL);
4338 }
4339 #endif
4788 value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key);
4789 else
4790 value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value);
4791 }
43404792 return value;
43414793 }
43424794
4795 /* PyObjectSetAttrStr */
4796 #if CYTHON_USE_TYPE_SLOTS
4797 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
4798 PyTypeObject* tp = Py_TYPE(obj);
4799 if (likely(tp->tp_setattro))
4800 return tp->tp_setattro(obj, attr_name, value);
4801 #if PY_MAJOR_VERSION < 3
4802 if (likely(tp->tp_setattr))
4803 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
4804 #endif
4805 return PyObject_SetAttr(obj, attr_name, value);
4806 }
4807 #endif
4808
43434809 /* PyObjectCallMethod1 */
4344 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
4345 PyObject *method, *result = NULL;
4346 method = __Pyx_PyObject_GetAttrStr(obj, method_name);
4347 if (unlikely(!method)) goto done;
4810 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
4811 PyObject *result = NULL;
43484812 #if CYTHON_UNPACK_METHODS
43494813 if (likely(PyMethod_Check(method))) {
43504814 PyObject *self = PyMethod_GET_SELF(method);
43724836 Py_INCREF(arg);
43734837 PyTuple_SET_ITEM(args, 1, arg);
43744838 Py_INCREF(function);
4375 Py_DECREF(method); method = NULL;
43764839 result = __Pyx_PyObject_Call(function, args, NULL);
43774840 Py_DECREF(args);
43784841 Py_DECREF(function);
43814844 }
43824845 #endif
43834846 result = __Pyx_PyObject_CallOneArg(method, arg);
4847 goto done;
43844848 done:
4385 Py_XDECREF(method);
43864849 return result;
43874850 }
4851 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
4852 PyObject *method, *result;
4853 method = __Pyx_PyObject_GetAttrStr(obj, method_name);
4854 if (unlikely(!method)) return NULL;
4855 result = __Pyx__PyObject_CallMethod1(method, arg);
4856 Py_DECREF(method);
4857 return result;
4858 }
43884859
43894860 /* pop_index */
4390 static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) {
4861 static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) {
43914862 PyObject *r;
43924863 if (unlikely(!py_ix)) return NULL;
43934864 r = __Pyx__PyObject_PopIndex(L, py_ix);
44224893 #endif
44234894
44244895 /* PyIntBinop */
4425 #if !CYTHON_COMPILING_IN_PYPY
4896 #if !CYTHON_COMPILING_IN_PYPY
44264897 static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
44274898 if (op1 == op2) {
44284899 Py_RETURN_TRUE;
44544925 a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
44554926 break;
44564927 }
4928 CYTHON_FALLTHROUGH;
44574929 case 2:
44584930 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
44594931 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
44604932 break;
44614933 }
4934 CYTHON_FALLTHROUGH;
44624935 case -3:
44634936 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
44644937 a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
44654938 break;
44664939 }
4940 CYTHON_FALLTHROUGH;
44674941 case 3:
44684942 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
44694943 a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
44704944 break;
44714945 }
4946 CYTHON_FALLTHROUGH;
44724947 case -4:
44734948 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
44744949 a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
44754950 break;
44764951 }
4952 CYTHON_FALLTHROUGH;
44774953 case 4:
44784954 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
44794955 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
44804956 break;
44814957 }
4958 CYTHON_FALLTHROUGH;
44824959 #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
44834960 default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
44844961 #else
45074984 #endif
45084985
45094986 /* append */
4510 static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
4987 static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
45114988 if (likely(PyList_CheckExact(L))) {
45124989 if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
45134990 } else {
45204997 }
45214998
45224999 /* PyFloatBinop */
4523 #if !CYTHON_COMPILING_IN_PYPY
5000 #if !CYTHON_COMPILING_IN_PYPY
45245001 static PyObject* __Pyx_PyFloat_TrueDivideCObj(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) {
45255002 const double a = floatval;
45265003 double b, result;
45445021 case 2:
45455022 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
45465023 b = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
4547 if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) {
5024 if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
45485025 if (size == -2)
45495026 b = -b;
45505027 break;
45515028 }
45525029 }
5030 CYTHON_FALLTHROUGH;
45535031 case -3:
45545032 case 3:
45555033 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
45565034 b = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
4557 if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) {
5035 if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
45585036 if (size == -3)
45595037 b = -b;
45605038 break;
45615039 }
45625040 }
5041 CYTHON_FALLTHROUGH;
45635042 case -4:
45645043 case 4:
45655044 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
45665045 b = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
4567 if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) {
5046 if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
45685047 if (size == -4)
45695048 b = -b;
45705049 break;
45715050 }
45725051 }
5052 CYTHON_FALLTHROUGH;
45735053 default:
45745054 #else
45755055 {
45885068 #endif
45895069
45905070 /* Import */
4591 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
5071 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
45925072 PyObject *empty_list = 0;
45935073 PyObject *module = 0;
45945074 PyObject *global_dict = 0;
45955075 PyObject *empty_dict = 0;
45965076 PyObject *list;
4597 #if PY_VERSION_HEX < 0x03030000
5077 #if PY_MAJOR_VERSION < 3
45985078 PyObject *py_import;
45995079 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
46005080 if (!py_import)
46185098 #if PY_MAJOR_VERSION >= 3
46195099 if (level == -1) {
46205100 if (strchr(__Pyx_MODULE_NAME, '.')) {
4621 #if PY_VERSION_HEX < 0x03030000
4622 PyObject *py_level = PyInt_FromLong(1);
4623 if (!py_level)
4624 goto bad;
4625 module = PyObject_CallFunctionObjArgs(py_import,
4626 name, global_dict, empty_dict, list, py_level, NULL);
4627 Py_DECREF(py_level);
4628 #else
46295101 module = PyImport_ImportModuleLevelObject(
46305102 name, global_dict, empty_dict, list, 1);
4631 #endif
46325103 if (!module) {
46335104 if (!PyErr_ExceptionMatches(PyExc_ImportError))
46345105 goto bad;
46395110 }
46405111 #endif
46415112 if (!module) {
4642 #if PY_VERSION_HEX < 0x03030000
5113 #if PY_MAJOR_VERSION < 3
46435114 PyObject *py_level = PyInt_FromLong(level);
46445115 if (!py_level)
46455116 goto bad;
46535124 }
46545125 }
46555126 bad:
4656 #if PY_VERSION_HEX < 0x03030000
5127 #if PY_MAJOR_VERSION < 3
46575128 Py_XDECREF(py_import);
46585129 #endif
46595130 Py_XDECREF(empty_list);
46625133 }
46635134
46645135 /* ImportFrom */
4665 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
5136 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
46665137 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
46675138 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
46685139 PyErr_Format(PyExc_ImportError,
46765147 }
46775148
46785149 /* FetchCommonType */
4679 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
5150 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
46805151 PyObject* fake_module;
46815152 PyTypeObject* cached_type = NULL;
46825153 fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
47155186 }
47165187
47175188 /* CythonFunction */
4718 static PyObject *
5189 #include <structmember.h>
5190 static PyObject *
47195191 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
47205192 {
47215193 if (unlikely(op->func_doc == NULL)) {
49975469 {0, 0, 0, 0, 0}
49985470 };
49995471 static PyMemberDef __pyx_CyFunction_members[] = {
5000 {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
5472 {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
50015473 {0, 0, 0, 0, 0}
50025474 };
50035475 static PyObject *
50755547 }
50765548 return 0;
50775549 }
5078 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
5550 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
50795551 {
5080 PyObject_GC_UnTrack(m);
50815552 if (__Pyx_CyFunction_weakreflist(m) != NULL)
50825553 PyObject_ClearWeakRefs((PyObject *) m);
50835554 __Pyx_CyFunction_clear(m);
50845555 PyObject_GC_Del(m);
5556 }
5557 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
5558 {
5559 PyObject_GC_UnTrack(m);
5560 __Pyx__CyFunction_dealloc(m);
50855561 }
50865562 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
50875563 {
51575633 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
51585634 size = PyTuple_GET_SIZE(arg);
51595635 if (likely(size == 1)) {
5160 PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
5161 if (unlikely(!arg0)) return NULL;
5636 PyObject *result, *arg0;
5637 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5638 arg0 = PyTuple_GET_ITEM(arg, 0);
5639 #else
5640 arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
5641 #endif
51625642 result = (*meth)(self, arg0);
5643 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
51635644 Py_DECREF(arg0);
5645 #endif
51645646 return result;
51655647 }
51665648 PyErr_Format(PyExc_TypeError,
52675749 };
52685750 static int __pyx_CyFunction_init(void) {
52695751 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
5270 if (__pyx_CyFunctionType == NULL) {
5752 if (unlikely(__pyx_CyFunctionType == NULL)) {
52715753 return -1;
52725754 }
52735755 return 0;
52755757 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
52765758 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
52775759 m->defaults = PyObject_Malloc(size);
5278 if (!m->defaults)
5760 if (unlikely(!m->defaults))
52795761 return PyErr_NoMemory();
52805762 memset(m->defaults, 0, size);
52815763 m->defaults_pyobjects = pyobjects;
52985780 }
52995781
53005782 /* CalculateMetaclass */
5301 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
5783 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
53025784 Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
53035785 for (i=0; i < nbases; i++) {
53045786 PyTypeObject *tmptype;
53375819 }
53385820
53395821 /* Py3ClassCreate */
5340 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
5822 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
53415823 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
53425824 PyObject *ns;
53435825 if (metaclass) {
54035885 return result;
54045886 }
54055887
5888 /* CLineInTraceback */
5889 #ifndef CYTHON_CLINE_IN_TRACEBACK
5890 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
5891 PyObject *use_cline;
5892 PyObject *ptype, *pvalue, *ptraceback;
5893 #if CYTHON_COMPILING_IN_CPYTHON
5894 PyObject **cython_runtime_dict;
5895 #endif
5896 if (unlikely(!__pyx_cython_runtime)) {
5897 return c_line;
5898 }
5899 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
5900 #if CYTHON_COMPILING_IN_CPYTHON
5901 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
5902 if (likely(cython_runtime_dict)) {
5903 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
5904 } else
5905 #endif
5906 {
5907 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
5908 if (use_cline_obj) {
5909 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
5910 Py_DECREF(use_cline_obj);
5911 } else {
5912 PyErr_Clear();
5913 use_cline = NULL;
5914 }
5915 }
5916 if (!use_cline) {
5917 c_line = 0;
5918 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
5919 }
5920 else if (PyObject_Not(use_cline) != 0) {
5921 c_line = 0;
5922 }
5923 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
5924 return c_line;
5925 }
5926 #endif
5927
54065928 /* CodeObjectCache */
5407 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
5929 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
54085930 int start = 0, mid = 0, end = count - 1;
54095931 if (end >= 0 && code_line > entries[end].code_line) {
54105932 return count;
54846006 }
54856007
54866008 /* AddTraceback */
5487 #include "compile.h"
6009 #include "compile.h"
54886010 #include "frameobject.h"
54896011 #include "traceback.h"
54906012 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
55436065 int py_line, const char *filename) {
55446066 PyCodeObject *py_code = 0;
55456067 PyFrameObject *py_frame = 0;
5546 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
6068 PyThreadState *tstate = __Pyx_PyThreadState_Current;
6069 if (c_line) {
6070 c_line = __Pyx_CLineForTraceback(tstate, c_line);
6071 }
6072 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
55476073 if (!py_code) {
55486074 py_code = __Pyx_CreateCodeObjectForTraceback(
55496075 funcname, c_line, py_line, filename);
55506076 if (!py_code) goto bad;
5551 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
6077 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
55526078 }
55536079 py_frame = PyFrame_New(
5554 PyThreadState_GET(), /*PyThreadState *tstate,*/
5555 py_code, /*PyCodeObject *code,*/
5556 __pyx_d, /*PyObject *globals,*/
5557 0 /*PyObject *locals*/
6080 tstate, /*PyThreadState *tstate,*/
6081 py_code, /*PyCodeObject *code,*/
6082 __pyx_d, /*PyObject *globals,*/
6083 0 /*PyObject *locals*/
55586084 );
55596085 if (!py_frame) goto bad;
55606086 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
55656091 }
55666092
55676093 /* CIntFromPyVerify */
5568 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
6094 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
55696095 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
55706096 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
55716097 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
55876113 }
55886114
55896115 /* CIntToPy */
5590 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
6116 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
55916117 const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
55926118 const int is_unsigned = neg_one > const_zero;
55936119 if (is_unsigned) {
56186144 }
56196145
56206146 /* CIntToPy */
5621 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
6147 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
56226148 const int neg_one = (int) -1, const_zero = (int) 0;
56236149 const int is_unsigned = neg_one > const_zero;
56246150 if (is_unsigned) {
56496175 }
56506176
56516177 /* CIntFromPy */
5652 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
6178 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
56536179 const int neg_one = (int) -1, const_zero = (int) 0;
56546180 const int is_unsigned = neg_one > const_zero;
56556181 #if PY_MAJOR_VERSION < 3
58386364 }
58396365
58406366 /* CIntFromPy */
5841 static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
6367 static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
58426368 const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
58436369 const int is_unsigned = neg_one > const_zero;
58446370 #if PY_MAJOR_VERSION < 3
60276553 }
60286554
60296555 /* CIntToPy */
6030 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
6556 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
60316557 const long neg_one = (long) -1, const_zero = (long) 0;
60326558 const int is_unsigned = neg_one > const_zero;
60336559 if (is_unsigned) {
60586584 }
60596585
60606586 /* CIntFromPy */
6061 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
6587 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
60626588 const long neg_one = (long) -1, const_zero = (long) 0;
60636589 const int is_unsigned = neg_one > const_zero;
60646590 #if PY_MAJOR_VERSION < 3
62466772 return (long) -1;
62476773 }
62486774
6775 /* FastTypeChecks */
6776 #if CYTHON_COMPILING_IN_CPYTHON
6777 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
6778 while (a) {
6779 a = a->tp_base;
6780 if (a == b)
6781 return 1;
6782 }
6783 return b == &PyBaseObject_Type;
6784 }
6785 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
6786 PyObject *mro;
6787 if (a == b) return 1;
6788 mro = a->tp_mro;
6789 if (likely(mro)) {
6790 Py_ssize_t i, n;
6791 n = PyTuple_GET_SIZE(mro);
6792 for (i = 0; i < n; i++) {
6793 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
6794 return 1;
6795 }
6796 return 0;
6797 }
6798 return __Pyx_InBases(a, b);
6799 }
6800 #if PY_MAJOR_VERSION == 2
6801 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
6802 PyObject *exception, *value, *tb;
6803 int res;
6804 __Pyx_PyThreadState_declare
6805 __Pyx_PyThreadState_assign
6806 __Pyx_ErrFetch(&exception, &value, &tb);
6807 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
6808 if (unlikely(res == -1)) {
6809 PyErr_WriteUnraisable(err);
6810 res = 0;
6811 }
6812 if (!res) {
6813 res = PyObject_IsSubclass(err, exc_type2);
6814 if (unlikely(res == -1)) {
6815 PyErr_WriteUnraisable(err);
6816 res = 0;
6817 }
6818 }
6819 __Pyx_ErrRestore(exception, value, tb);
6820 return res;
6821 }
6822 #else
6823 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
6824 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
6825 if (!res) {
6826 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
6827 }
6828 return res;
6829 }
6830 #endif
6831 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
6832 Py_ssize_t i, n;
6833 assert(PyExceptionClass_Check(exc_type));
6834 n = PyTuple_GET_SIZE(tuple);
6835 #if PY_MAJOR_VERSION >= 3
6836 for (i=0; i<n; i++) {
6837 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
6838 }
6839 #endif
6840 for (i=0; i<n; i++) {
6841 PyObject *t = PyTuple_GET_ITEM(tuple, i);
6842 #if PY_MAJOR_VERSION < 3
6843 if (likely(exc_type == t)) return 1;
6844 #endif
6845 if (likely(PyExceptionClass_Check(t))) {
6846 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
6847 } else {
6848 }
6849 }
6850 return 0;
6851 }
6852 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
6853 if (likely(err == exc_type)) return 1;
6854 if (likely(PyExceptionClass_Check(err))) {
6855 if (likely(PyExceptionClass_Check(exc_type))) {
6856 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
6857 } else if (likely(PyTuple_Check(exc_type))) {
6858 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
6859 } else {
6860 }
6861 }
6862 return PyErr_GivenExceptionMatches(err, exc_type);
6863 }
6864 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
6865 assert(PyExceptionClass_Check(exc_type1));
6866 assert(PyExceptionClass_Check(exc_type2));
6867 if (likely(err == exc_type1 || err == exc_type2)) return 1;
6868 if (likely(PyExceptionClass_Check(err))) {
6869 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
6870 }
6871 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
6872 }
6873 #endif
6874
62496875 /* CheckBinaryVersion */
6250 static int __Pyx_check_binary_version(void) {
6876 static int __Pyx_check_binary_version(void) {
62516877 char ctversion[4], rtversion[4];
62526878 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
62536879 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
62636889 }
62646890
62656891 /* InitStrings */
6266 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
6892 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
62676893 while (t->p) {
62686894 #if PY_MAJOR_VERSION < 3
62696895 if (t->is_unicode) {
62886914 #endif
62896915 if (!*t->p)
62906916 return -1;
6917 if (PyObject_Hash(*t->p) == -1)
6918 return -1;
62916919 ++t;
62926920 }
62936921 return 0;
62966924 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
62976925 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
62986926 }
6299 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
6927 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
63006928 Py_ssize_t ignore;
63016929 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
63026930 }
6303 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6304 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
6931 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
6932 #if !CYTHON_PEP393_ENABLED
6933 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6934 char* defenc_c;
6935 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
6936 if (!defenc) return NULL;
6937 defenc_c = PyBytes_AS_STRING(defenc);
6938 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6939 {
6940 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
6941 char* c;
6942 for (c = defenc_c; c < end; c++) {
6943 if ((unsigned char) (*c) >= 128) {
6944 PyUnicode_AsASCIIString(o);
6945 return NULL;
6946 }
6947 }
6948 }
6949 #endif
6950 *length = PyBytes_GET_SIZE(defenc);
6951 return defenc_c;
6952 }
6953 #else
6954 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6955 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
6956 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6957 if (likely(PyUnicode_IS_ASCII(o))) {
6958 *length = PyUnicode_GET_LENGTH(o);
6959 return PyUnicode_AsUTF8(o);
6960 } else {
6961 PyUnicode_AsASCIIString(o);
6962 return NULL;
6963 }
6964 #else
6965 return PyUnicode_AsUTF8AndSize(o, length);
6966 #endif
6967 }
6968 #endif
6969 #endif
6970 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6971 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
63056972 if (
63066973 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
63076974 __Pyx_sys_getdefaultencoding_not_ascii &&
63086975 #endif
63096976 PyUnicode_Check(o)) {
6310 #if PY_VERSION_HEX < 0x03030000
6311 char* defenc_c;
6312 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
6313 if (!defenc) return NULL;
6314 defenc_c = PyBytes_AS_STRING(defenc);
6315 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6316 {
6317 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
6318 char* c;
6319 for (c = defenc_c; c < end; c++) {
6320 if ((unsigned char) (*c) >= 128) {
6321 PyUnicode_AsASCIIString(o);
6322 return NULL;
6323 }
6324 }
6325 }
6326 #endif
6327 *length = PyBytes_GET_SIZE(defenc);
6328 return defenc_c;
6329 #else
6330 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
6331 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6332 if (PyUnicode_IS_ASCII(o)) {
6333 *length = PyUnicode_GET_LENGTH(o);
6334 return PyUnicode_AsUTF8(o);
6335 } else {
6336 PyUnicode_AsASCIIString(o);
6337 return NULL;
6338 }
6339 #else
6340 return PyUnicode_AsUTF8AndSize(o, length);
6341 #endif
6342 #endif
6977 return __Pyx_PyUnicode_AsStringAndSize(o, length);
63436978 } else
63446979 #endif
63456980 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
63636998 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
63646999 else return PyObject_IsTrue(x);
63657000 }
7001 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
7002 #if PY_MAJOR_VERSION >= 3
7003 if (PyLong_Check(result)) {
7004 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
7005 "__int__ returned non-int (type %.200s). "
7006 "The ability to return an instance of a strict subclass of int "
7007 "is deprecated, and may be removed in a future version of Python.",
7008 Py_TYPE(result)->tp_name)) {
7009 Py_DECREF(result);
7010 return NULL;
7011 }
7012 return result;
7013 }
7014 #endif
7015 PyErr_Format(PyExc_TypeError,
7016 "__%.4s__ returned non-%.4s (type %.200s)",
7017 type_name, type_name, Py_TYPE(result)->tp_name);
7018 Py_DECREF(result);
7019 return NULL;
7020 }
63667021 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
63677022 #if CYTHON_USE_TYPE_SLOTS
63687023 PyNumberMethods *m;
63707025 const char *name = NULL;
63717026 PyObject *res = NULL;
63727027 #if PY_MAJOR_VERSION < 3
6373 if (PyInt_Check(x) || PyLong_Check(x))
6374 #else
6375 if (PyLong_Check(x))
7028 if (likely(PyInt_Check(x) || PyLong_Check(x)))
7029 #else
7030 if (likely(PyLong_Check(x)))
63767031 #endif
63777032 return __Pyx_NewRef(x);
63787033 #if CYTHON_USE_TYPE_SLOTS
63807035 #if PY_MAJOR_VERSION < 3
63817036 if (m && m->nb_int) {
63827037 name = "int";
6383 res = PyNumber_Int(x);
7038 res = m->nb_int(x);
63847039 }
63857040 else if (m && m->nb_long) {
63867041 name = "long";
6387 res = PyNumber_Long(x);
7042 res = m->nb_long(x);
63887043 }
63897044 #else
6390 if (m && m->nb_int) {
7045 if (likely(m && m->nb_int)) {
63917046 name = "int";
6392 res = PyNumber_Long(x);
7047 res = m->nb_int(x);
63937048 }
63947049 #endif
63957050 #else
6396 res = PyNumber_Int(x);
6397 #endif
6398 if (res) {
7051 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
7052 res = PyNumber_Int(x);
7053 }
7054 #endif
7055 if (likely(res)) {
63997056 #if PY_MAJOR_VERSION < 3
6400 if (!PyInt_Check(res) && !PyLong_Check(res)) {
6401 #else
6402 if (!PyLong_Check(res)) {
6403 #endif
6404 PyErr_Format(PyExc_TypeError,
6405 "__%.4s__ returned non-%.4s (type %.200s)",
6406 name, name, Py_TYPE(res)->tp_name);
6407 Py_DECREF(res);
6408 return NULL;
7057 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
7058 #else
7059 if (unlikely(!PyLong_CheckExact(res))) {
7060 #endif
7061 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
64097062 }
64107063 }
64117064 else if (!PyErr_Occurred()) {
64767129 Py_DECREF(x);
64777130 return ival;
64787131 }
7132 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
7133 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
7134 }
64797135 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
64807136 return PyInt_FromSize_t(ival);
64817137 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
88 #else
9 #define CYTHON_ABI "0_25_2"
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
102120 #define CYTHON_COMPILING_IN_CPYTHON 1
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
105129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412552
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
423555 #define __PYX_EXTERN_C extern "C"
428560
429561 #define __PYX_HAVE__pygame_sdl2__rect
430562 #define __PYX_HAVE_API__pygame_sdl2__rect
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
437570 #include <omp.h>
438571 #endif /* _OPENMP */
439572
440 #ifdef PYREX_WITHOUT_ASSERTIONS
573 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
441574 #define CYTHON_WITHOUT_ASSERTIONS
442575 #endif
443576
468601 #define __Pyx_sst_abs(value) abs(value)
469602 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
470603 #define __Pyx_sst_abs(value) labs(value)
471 #elif defined (_MSC_VER) && defined (_M_X64)
472 #define __Pyx_sst_abs(value) _abs64(value)
604 #elif defined (_MSC_VER)
605 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
473606 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
474607 #define __Pyx_sst_abs(value) llabs(value)
475608 #elif defined (__GNUC__)
477610 #else
478611 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
479612 #endif
480 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
481 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
613 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
614 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
482615 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
483616 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
484617 #define __Pyx_PyBytes_FromString PyBytes_FromString
491624 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
492625 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
493626 #endif
494 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
495 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
627 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
628 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
629 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
634 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
635 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
496638 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
497639 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
498640 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
499641 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
500642 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
501 #if PY_MAJOR_VERSION < 3
502 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
503 {
643 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
504644 const Py_UNICODE *u_end = u;
505645 while (*u_end++) ;
506646 return (size_t)(u_end - u - 1);
507647 }
508 #else
509 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
510 #endif
511648 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
512649 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
513650 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
514651 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
515652 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
516 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
653 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
517654 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
518655 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
656 #define __Pyx_PySequence_Tuple(obj)\
657 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
519658 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
520659 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
521660 #if CYTHON_ASSUME_SAFE_MACROS
614753 #define likely(x) (x)
615754 #define unlikely(x) (x)
616755 #endif /* __GNUC__ */
617
618 static PyObject *__pyx_m;
756 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
757
758 static PyObject *__pyx_m = NULL;
619759 static PyObject *__pyx_d;
620760 static PyObject *__pyx_b;
761 static PyObject *__pyx_cython_runtime = NULL;
621762 static PyObject *__pyx_empty_tuple;
622763 static PyObject *__pyx_empty_bytes;
623764 static PyObject *__pyx_empty_unicode;
729870
730871 /* PyObjectGetAttrStr.proto */
731872 #if CYTHON_USE_TYPE_SLOTS
732 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
733 PyTypeObject* tp = Py_TYPE(obj);
734 if (likely(tp->tp_getattro))
735 return tp->tp_getattro(obj, attr_name);
736 #if PY_MAJOR_VERSION < 3
737 if (likely(tp->tp_getattr))
738 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
739 #endif
740 return PyObject_GetAttr(obj, attr_name);
741 }
873 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
742874 #else
743875 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
744876 #endif
747879 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
748880
749881 /* KeywordStringCheck.proto */
750 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
882 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
751883
752884 /* GetItemInt.proto */
753885 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
767899 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
768900 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
769901 int wraparound, int boundscheck);
770 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
902 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
771903 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
772904 int is_list, int wraparound, int boundscheck);
773905
796928 /* PyThreadStateGet.proto */
797929 #if CYTHON_FAST_THREAD_STATE
798930 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
799 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
931 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
932 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
800933 #else
801934 #define __Pyx_PyThreadState_declare
802935 #define __Pyx_PyThreadState_assign
936 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
803937 #endif
804938
805939 /* PyErrFetchRestore.proto */
806940 #if CYTHON_FAST_THREAD_STATE
941 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
807942 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
808943 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
809944 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
810945 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
811946 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
812947 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
948 #if CYTHON_COMPILING_IN_CPYTHON
949 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
813950 #else
951 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
952 #endif
953 #else
954 #define __Pyx_PyErr_Clear() PyErr_Clear()
955 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
814956 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
815957 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
958 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
959 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
816960 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
817961 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
818962 #endif
820964 /* RaiseException.proto */
821965 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
822966
823 /* ArgTypeTest.proto */
824 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
825 const char *name, int exact);
826
827 /* PyIntBinop.proto */
828 #if !CYTHON_COMPILING_IN_PYPY
829 static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
830 #else
831 #define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
832 PyObject_RichCompare(op1, op2, Py_EQ)
833 #endif
834
835 /* PyObjectSetAttrStr.proto */
836 #if CYTHON_USE_TYPE_SLOTS
837 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
838 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
839 PyTypeObject* tp = Py_TYPE(obj);
840 if (likely(tp->tp_setattro))
841 return tp->tp_setattro(obj, attr_name, value);
842 #if PY_MAJOR_VERSION < 3
843 if (likely(tp->tp_setattr))
844 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
845 #endif
846 return PyObject_SetAttr(obj, attr_name, value);
847 }
848 #else
849 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
850 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
851 #endif
967 /* BuildPyUnicode.proto */
968 static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
969 int prepend_sign, char padding_char);
970
971 /* CIntToPyUnicode.proto */
972 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);
973
974 /* IncludeStringH.proto */
975 #include <string.h>
976
977 /* JoinPyUnicode.proto */
978 static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
979 Py_UCS4 max_char);
852980
853981 /* PyCFunctionFastCall.proto */
854982 #if CYTHON_FAST_PYCCALL
8751003
8761004 /* PyObjectCallOneArg.proto */
8771005 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1006
1007 /* ObjectGetItem.proto */
1008 #if CYTHON_USE_TYPE_SLOTS
1009 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1010 #else
1011 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1012 #endif
1013
1014 /* PyIntBinop.proto */
1015 #if !CYTHON_COMPILING_IN_PYPY
1016 static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
1017 #else
1018 #define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
1019 PyObject_RichCompare(op1, op2, Py_EQ)
1020 #endif
1021
1022 /* PyObjectSetAttrStr.proto */
1023 #if CYTHON_USE_TYPE_SLOTS
1024 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1025 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1026 #else
1027 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1028 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1029 #endif
8781030
8791031 /* PyObjectCallNoArg.proto */
8801032 #if CYTHON_COMPILING_IN_CPYTHON
9251077 static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
9261078
9271079 /* UnpackTuple2.proto */
928 static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
929 int is_tuple, int has_known_size, int decref_tuple);
1080 #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
1081 (likely(is_tuple || PyTuple_Check(tuple)) ?\
1082 (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
1083 __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
1084 (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
1085 __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
1086 static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
1087 PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
1088 static int __Pyx_unpack_tuple2_generic(
1089 PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);
9301090
9311091 /* dict_iter.proto */
9321092 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
9451105 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
9461106 #endif
9471107
1108 /* PyObject_GenericGetAttrNoDict.proto */
1109 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1110 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1111 #else
1112 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1113 #endif
1114
1115 /* PyObject_GenericGetAttr.proto */
1116 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1117 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1118 #else
1119 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1120 #endif
1121
9481122 /* Import.proto */
9491123 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1124
1125 /* CLineInTraceback.proto */
1126 #ifdef CYTHON_CLINE_IN_TRACEBACK
1127 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1128 #else
1129 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1130 #endif
9501131
9511132 /* CodeObjectCache.proto */
9521133 typedef struct {
9791160 /* CIntFromPy.proto */
9801161 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
9811162
1163 /* FastTypeChecks.proto */
1164 #if CYTHON_COMPILING_IN_CPYTHON
1165 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1166 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1167 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1168 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1169 #else
1170 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1171 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1172 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1173 #endif
1174 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1175
9821176 /* CheckBinaryVersion.proto */
9831177 static int __Pyx_check_binary_version(void);
9841178
10021196 /* Module declarations from 'pygame_sdl2.rect' */
10031197 static PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect = 0;
10041198 #define __Pyx_MODULE_NAME "pygame_sdl2.rect"
1199 extern int __pyx_module_is_main_pygame_sdl2__rect;
10051200 int __pyx_module_is_main_pygame_sdl2__rect = 0;
10061201
10071202 /* Implementation of 'pygame_sdl2.rect' */
10091204 static PyObject *__pyx_builtin_IndexError;
10101205 static PyObject *__pyx_builtin_zip;
10111206 static PyObject *__pyx_builtin_range;
1207 static const char __pyx_k_d[] = "d";
10121208 static const char __pyx_k_h[] = "h";
10131209 static const char __pyx_k_w[] = "w";
10141210 static const char __pyx_k_x[] = "x";
10151211 static const char __pyx_k_y[] = "y";
1212 static const char __pyx_k__2[] = ", ";
1213 static const char __pyx_k__3[] = ")>";
10161214 static const char __pyx_k_top[] = "top";
10171215 static const char __pyx_k_zip[] = "zip";
10181216 static const char __pyx_k_args[] = "args";
10191217 static const char __pyx_k_copy[] = "copy";
10201218 static const char __pyx_k_left[] = "left";
10211219 static const char __pyx_k_main[] = "__main__";
1220 static const char __pyx_k_rect[] = "<rect(";
10221221 static const char __pyx_k_test[] = "__test__";
10231222 static const char __pyx_k_other[] = "other";
10241223 static const char __pyx_k_range[] = "range";
10441243 static const char __pyx_k_collections[] = "collections";
10451244 static const char __pyx_k_colliderect[] = "colliderect";
10461245 static const char __pyx_k_unionall_ip[] = "unionall_ip";
1047 static const char __pyx_k_rect_d_d_d_d[] = "<rect(%d, %d, %d, %d)>";
10481246 static const char __pyx_k_rects_values[] = "rects_values";
10491247 static const char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect";
1248 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
10501249 static const char __pyx_k_src_pygame_sdl2_rect_pyx[] = "src/pygame_sdl2/rect.pyx";
10511250 static const char __pyx_k_Argument_must_be_a_rect_style_ob[] = "Argument must be a rect style object.";
10521251 static const char __pyx_k_Argument_must_be_a_rect_style_ob_2[] = "Argument {} must be a rect style object.";
10541253 static PyObject *__pyx_kp_u_Argument_must_be_a_rect_style_ob_2;
10551254 static PyObject *__pyx_n_s_IndexError;
10561255 static PyObject *__pyx_n_s_TypeError;
1256 static PyObject *__pyx_kp_u__2;
1257 static PyObject *__pyx_kp_u__3;
10571258 static PyObject *__pyx_n_s_args;
10581259 static PyObject *__pyx_n_s_bottom;
10591260 static PyObject *__pyx_n_s_center;
10601261 static PyObject *__pyx_n_s_centerx;
10611262 static PyObject *__pyx_n_s_centery;
10621263 static PyObject *__pyx_n_s_clamp_ip;
1264 static PyObject *__pyx_n_s_cline_in_traceback;
10631265 static PyObject *__pyx_n_s_collections;
10641266 static PyObject *__pyx_n_s_colliderect;
10651267 static PyObject *__pyx_n_s_copy;
1268 static PyObject *__pyx_n_u_d;
10661269 static PyObject *__pyx_n_s_flatten;
10671270 static PyObject *__pyx_n_s_format;
10681271 static PyObject *__pyx_n_s_h;
10771280 static PyObject *__pyx_n_s_other_dict;
10781281 static PyObject *__pyx_n_s_pygame_sdl2_rect;
10791282 static PyObject *__pyx_n_s_range;
1080 static PyObject *__pyx_kp_u_rect_d_d_d_d;
1283 static PyObject *__pyx_kp_u_rect;
10811284 static PyObject *__pyx_n_s_rects_values;
10821285 static PyObject *__pyx_n_s_right;
10831286 static PyObject *__pyx_kp_s_src_pygame_sdl2_rect_pyx;
11721375 static PyObject *__pyx_int_3;
11731376 static PyObject *__pyx_int_neg_1;
11741377 static PyObject *__pyx_tuple_;
1175 static PyObject *__pyx_tuple__2;
1176 static PyObject *__pyx_tuple__3;
11771378 static PyObject *__pyx_tuple__4;
1178 static PyObject *__pyx_codeobj__5;
1379 static PyObject *__pyx_tuple__5;
1380 static PyObject *__pyx_tuple__6;
1381 static PyObject *__pyx_codeobj__7;
1382 /* Late includes */
11791383
11801384 /* "pygame_sdl2/rect.pyx":22
11811385 * import collections
12191423 * return args[0]
12201424 * else:
12211425 */
1222 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 23, __pyx_L1_error)
1426 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 23, __pyx_L1_error)
12231427 __pyx_t_2 = ((__pyx_t_1 == 1) != 0);
12241428 if (__pyx_t_2) {
12251429
13381542 *
13391543 * if len_args == 1 and isinstance(args[0], Rect):
13401544 */
1341 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 36, __pyx_L1_error)
1545 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 36, __pyx_L1_error)
13421546 __pyx_v_len_args = __pyx_t_1;
13431547
13441548 /* "pygame_sdl2/rect.pyx":38
14411645 }
14421646 __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error)
14431647 __Pyx_GOTREF(__pyx_t_4);
1444 __pyx_t_1 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 45, __pyx_L1_error)
1648 __pyx_t_1 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 45, __pyx_L1_error)
14451649 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14461650 __pyx_t_5 = ((__pyx_t_1 == 4) != 0);
14471651 __pyx_t_2 = __pyx_t_5;
14591663 __Pyx_GOTREF(__pyx_t_4);
14601664 if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
14611665 PyObject* sequence = __pyx_t_4;
1462 #if !CYTHON_COMPILING_IN_PYPY
1463 Py_ssize_t size = Py_SIZE(sequence);
1464 #else
1465 Py_ssize_t size = PySequence_Size(sequence);
1466 #endif
1666 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
14671667 if (unlikely(size != 4)) {
14681668 if (size > 4) __Pyx_RaiseTooManyValuesError(4);
14691669 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
15581758 }
15591759 __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 48, __pyx_L1_error)
15601760 __Pyx_GOTREF(__pyx_t_4);
1561 __pyx_t_1 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 48, __pyx_L1_error)
1761 __pyx_t_1 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 48, __pyx_L1_error)
15621762 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15631763 __pyx_t_5 = ((__pyx_t_1 == 2) != 0);
15641764 __pyx_t_2 = __pyx_t_5;
15761776 __Pyx_GOTREF(__pyx_t_4);
15771777 if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
15781778 PyObject* sequence = __pyx_t_4;
1579 #if !CYTHON_COMPILING_IN_PYPY
1580 Py_ssize_t size = Py_SIZE(sequence);
1581 #else
1582 Py_ssize_t size = PySequence_Size(sequence);
1583 #endif
1779 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
15841780 if (unlikely(size != 2)) {
15851781 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
15861782 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
16801876 __Pyx_GOTREF(__pyx_t_4);
16811877 if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
16821878 PyObject* sequence = __pyx_t_4;
1683 #if !CYTHON_COMPILING_IN_PYPY
1684 Py_ssize_t size = Py_SIZE(sequence);
1685 #else
1686 Py_ssize_t size = PySequence_Size(sequence);
1687 #endif
1879 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
16881880 if (unlikely(size != 2)) {
16891881 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
16901882 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
17461938 __Pyx_GOTREF(__pyx_t_4);
17471939 if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
17481940 PyObject* sequence = __pyx_t_4;
1749 #if !CYTHON_COMPILING_IN_PYPY
1750 Py_ssize_t size = Py_SIZE(sequence);
1751 #else
1752 Py_ssize_t size = PySequence_Size(sequence);
1753 #endif
1941 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
17541942 if (unlikely(size != 2)) {
17551943 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
17561944 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
18192007 *
18202008 */
18212009 __pyx_t_2 = ((__pyx_v_len_args == 4) != 0);
1822 if (__pyx_t_2) {
2010 if (likely(__pyx_t_2)) {
18232011
18242012 /* "pygame_sdl2/rect.pyx":58
18252013 *
18302018 */
18312019 if (1) {
18322020 PyObject* sequence = __pyx_v_args;
1833 #if !CYTHON_COMPILING_IN_PYPY
1834 Py_ssize_t size = Py_SIZE(sequence);
1835 #else
1836 Py_ssize_t size = PySequence_Size(sequence);
1837 #endif
2021 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
18382022 if (unlikely(size != 4)) {
18392023 if (size > 4) __Pyx_RaiseTooManyValuesError(4);
18402024 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
20832267 PyObject *__pyx_r = NULL;
20842268 __Pyx_RefNannyDeclarations
20852269 PyObject *__pyx_t_1 = NULL;
2086 PyObject *__pyx_t_2 = NULL;
2087 PyObject *__pyx_t_3 = NULL;
2270 Py_ssize_t __pyx_t_2;
2271 Py_UCS4 __pyx_t_3;
20882272 PyObject *__pyx_t_4 = NULL;
2089 PyObject *__pyx_t_5 = NULL;
20902273 __Pyx_RefNannySetupContext("__repr__", 0);
20912274
20922275 /* "pygame_sdl2/rect.pyx":72
20972280 * def __len__(self):
20982281 */
20992282 __Pyx_XDECREF(__pyx_r);
2100 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
2283 __pyx_t_1 = PyTuple_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
21012284 __Pyx_GOTREF(__pyx_t_1);
2102 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error)
2103 __Pyx_GOTREF(__pyx_t_2);
2104 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
2105 __Pyx_GOTREF(__pyx_t_3);
2106 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
2285 __pyx_t_2 = 0;
2286 __pyx_t_3 = 127;
2287 __Pyx_INCREF(__pyx_kp_u_rect);
2288 __pyx_t_2 += 6;
2289 __Pyx_GIVEREF(__pyx_kp_u_rect);
2290 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_rect);
2291 __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_self->x, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
21072292 __Pyx_GOTREF(__pyx_t_4);
2108 __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error)
2109 __Pyx_GOTREF(__pyx_t_5);
2110 __Pyx_GIVEREF(__pyx_t_1);
2111 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
2112 __Pyx_GIVEREF(__pyx_t_2);
2113 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
2114 __Pyx_GIVEREF(__pyx_t_3);
2115 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
2293 __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
21162294 __Pyx_GIVEREF(__pyx_t_4);
2117 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
2118 __pyx_t_1 = 0;
2119 __pyx_t_2 = 0;
2120 __pyx_t_3 = 0;
2295 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
21212296 __pyx_t_4 = 0;
2122 __pyx_t_4 = PyUnicode_Format(__pyx_kp_u_rect_d_d_d_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
2297 __Pyx_INCREF(__pyx_kp_u__2);
2298 __pyx_t_2 += 2;
2299 __Pyx_GIVEREF(__pyx_kp_u__2);
2300 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__2);
2301 __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_self->y, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
21232302 __Pyx_GOTREF(__pyx_t_4);
2124 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2303 __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
2304 __Pyx_GIVEREF(__pyx_t_4);
2305 PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
2306 __pyx_t_4 = 0;
2307 __Pyx_INCREF(__pyx_kp_u__2);
2308 __pyx_t_2 += 2;
2309 __Pyx_GIVEREF(__pyx_kp_u__2);
2310 PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__2);
2311 __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_self->w, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
2312 __Pyx_GOTREF(__pyx_t_4);
2313 __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
2314 __Pyx_GIVEREF(__pyx_t_4);
2315 PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4);
2316 __pyx_t_4 = 0;
2317 __Pyx_INCREF(__pyx_kp_u__2);
2318 __pyx_t_2 += 2;
2319 __Pyx_GIVEREF(__pyx_kp_u__2);
2320 PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__2);
2321 __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_self->h, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
2322 __Pyx_GOTREF(__pyx_t_4);
2323 __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
2324 __Pyx_GIVEREF(__pyx_t_4);
2325 PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_4);
2326 __pyx_t_4 = 0;
2327 __Pyx_INCREF(__pyx_kp_u__3);
2328 __pyx_t_2 += 2;
2329 __Pyx_GIVEREF(__pyx_kp_u__3);
2330 PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u__3);
2331 __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 9, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
2332 __Pyx_GOTREF(__pyx_t_4);
2333 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21252334 __pyx_r = __pyx_t_4;
21262335 __pyx_t_4 = 0;
21272336 goto __pyx_L0;
21372346 /* function exit code */
21382347 __pyx_L1_error:;
21392348 __Pyx_XDECREF(__pyx_t_1);
2140 __Pyx_XDECREF(__pyx_t_2);
2141 __Pyx_XDECREF(__pyx_t_3);
21422349 __Pyx_XDECREF(__pyx_t_4);
2143 __Pyx_XDECREF(__pyx_t_5);
21442350 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21452351 __pyx_r = NULL;
21462352 __pyx_L0:;
23042510 PyObject *__pyx_r = 0;
23052511 __Pyx_RefNannyDeclarations
23062512 __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
2307 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_a), __pyx_ptype_11pygame_sdl2_4rect_Rect, 1, "a", 0))) __PYX_ERR(0, 80, __pyx_L1_error)
23082513 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_10__richcmp__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_a), ((PyObject *)__pyx_v_b), ((int)__pyx_v_op));
23092514
23102515 /* function exit code */
2311 goto __pyx_L0;
2312 __pyx_L1_error:;
2313 __pyx_r = NULL;
2314 __pyx_L0:;
23152516 __Pyx_RefNannyFinishContext();
23162517 return __pyx_r;
23172518 }
23462547 * if op == 2:
23472548 * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h
23482549 */
2349 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error)
2550 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_v_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error)
23502551 __Pyx_GOTREF(__pyx_t_3);
2351 __Pyx_INCREF(__pyx_v_b);
2352 __Pyx_GIVEREF(__pyx_v_b);
2353 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_b);
2354 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error)
2355 __Pyx_GOTREF(__pyx_t_4);
2356 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2357 __Pyx_DECREF_SET(__pyx_v_b, __pyx_t_4);
2358 __pyx_t_4 = 0;
2552 __Pyx_DECREF_SET(__pyx_v_b, __pyx_t_3);
2553 __pyx_t_3 = 0;
23592554
23602555 /* "pygame_sdl2/rect.pyx":81
23612556 *
23842579 * def __getitem__(self, key):
23852580 */
23862581 __Pyx_XDECREF(__pyx_r);
2387 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_a->x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error)
2388 __Pyx_GOTREF(__pyx_t_3);
2582 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_a->x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error)
2583 __Pyx_GOTREF(__pyx_t_4);
23892584 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error)
23902585 __Pyx_GOTREF(__pyx_t_5);
2391 __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error)
2392 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2586 __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error)
2587 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23932588 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23942589 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 84, __pyx_L1_error)
23952590 if (__pyx_t_2) {
23962591 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23972592 } else {
23982593 __Pyx_INCREF(__pyx_t_6);
2399 __pyx_t_4 = __pyx_t_6;
2594 __pyx_t_3 = __pyx_t_6;
24002595 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24012596 goto __pyx_L5_bool_binop_done;
24022597 }
24042599 __Pyx_GOTREF(__pyx_t_6);
24052600 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error)
24062601 __Pyx_GOTREF(__pyx_t_5);
2407 __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error)
2602 __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error)
24082603 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24092604 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2410 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 84, __pyx_L1_error)
2605 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 84, __pyx_L1_error)
24112606 if (__pyx_t_2) {
2412 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2607 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24132608 } else {
2414 __Pyx_INCREF(__pyx_t_3);
2415 __pyx_t_4 = __pyx_t_3;
2416 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2609 __Pyx_INCREF(__pyx_t_4);
2610 __pyx_t_3 = __pyx_t_4;
2611 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24172612 goto __pyx_L5_bool_binop_done;
24182613 }
2419 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_a->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error)
2420 __Pyx_GOTREF(__pyx_t_3);
2614 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_a->w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error)
2615 __Pyx_GOTREF(__pyx_t_4);
24212616 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error)
24222617 __Pyx_GOTREF(__pyx_t_5);
2423 __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error)
2424 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2618 __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error)
2619 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24252620 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24262621 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 84, __pyx_L1_error)
24272622 if (__pyx_t_2) {
24282623 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24292624 } else {
24302625 __Pyx_INCREF(__pyx_t_6);
2431 __pyx_t_4 = __pyx_t_6;
2626 __pyx_t_3 = __pyx_t_6;
24322627 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24332628 goto __pyx_L5_bool_binop_done;
24342629 }
24362631 __Pyx_GOTREF(__pyx_t_6);
24372632 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error)
24382633 __Pyx_GOTREF(__pyx_t_5);
2439 __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error)
2634 __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error)
24402635 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24412636 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2442 __Pyx_INCREF(__pyx_t_3);
2443 __pyx_t_4 = __pyx_t_3;
2444 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2637 __Pyx_INCREF(__pyx_t_4);
2638 __pyx_t_3 = __pyx_t_4;
2639 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24452640 __pyx_L5_bool_binop_done:;
2446 __pyx_r = __pyx_t_4;
2447 __pyx_t_4 = 0;
2641 __pyx_r = __pyx_t_3;
2642 __pyx_t_3 = 0;
24482643 goto __pyx_L0;
24492644
24502645 /* "pygame_sdl2/rect.pyx":83
25422737 __pyx_t_2 = 0;
25432738 __pyx_t_3 = 0;
25442739 __pyx_t_4 = 0;
2545 __pyx_t_4 = PyObject_GetItem(__pyx_t_5, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error)
2740 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error)
25462741 __Pyx_GOTREF(__pyx_t_4);
25472742 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25482743 __pyx_r = __pyx_t_4;
25992794 PyObject *__pyx_t_1 = NULL;
26002795 int __pyx_t_2;
26012796 int __pyx_t_3;
2602 PyObject *__pyx_t_4 = NULL;
26032797 __Pyx_RefNannySetupContext("__setitem__", 0);
26042798
26052799 /* "pygame_sdl2/rect.pyx":90
27122906 __Pyx_GOTREF(__pyx_t_1);
27132907 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 96, __pyx_L1_error)
27142908 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2715 if (__pyx_t_2) {
2909 if (likely(__pyx_t_2)) {
27162910
27172911 /* "pygame_sdl2/rect.pyx":97
27182912 * self.w = val
27422936 * property left:
27432937 */
27442938 /*else*/ {
2745 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
2939 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
27462940 __Pyx_GOTREF(__pyx_t_1);
2747 __Pyx_INCREF(__pyx_v_key);
2748 __Pyx_GIVEREF(__pyx_v_key);
2749 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key);
2750 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error)
2751 __Pyx_GOTREF(__pyx_t_4);
2941 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
27522942 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2753 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
2754 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27552943 __PYX_ERR(0, 99, __pyx_L1_error)
27562944 }
27572945 __pyx_L3:;
27692957 goto __pyx_L0;
27702958 __pyx_L1_error:;
27712959 __Pyx_XDECREF(__pyx_t_1);
2772 __Pyx_XDECREF(__pyx_t_4);
27732960 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
27742961 __pyx_r = -1;
27752962 __pyx_L0:;
36443831 */
36453832 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
36463833 PyObject* sequence = __pyx_v_val;
3647 #if !CYTHON_COMPILING_IN_PYPY
3648 Py_ssize_t size = Py_SIZE(sequence);
3649 #else
3650 Py_ssize_t size = PySequence_Size(sequence);
3651 #endif
3834 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
36523835 if (unlikely(size != 2)) {
36533836 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
36543837 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
38324015 */
38334016 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
38344017 PyObject* sequence = __pyx_v_val;
3835 #if !CYTHON_COMPILING_IN_PYPY
3836 Py_ssize_t size = Py_SIZE(sequence);
3837 #else
3838 Py_ssize_t size = PySequence_Size(sequence);
3839 #endif
4018 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
38404019 if (unlikely(size != 2)) {
38414020 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
38424021 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
40184197 */
40194198 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
40204199 PyObject* sequence = __pyx_v_val;
4021 #if !CYTHON_COMPILING_IN_PYPY
4022 Py_ssize_t size = Py_SIZE(sequence);
4023 #else
4024 Py_ssize_t size = PySequence_Size(sequence);
4025 #endif
4200 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
40264201 if (unlikely(size != 2)) {
40274202 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
40284203 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
42044379 */
42054380 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
42064381 PyObject* sequence = __pyx_v_val;
4207 #if !CYTHON_COMPILING_IN_PYPY
4208 Py_ssize_t size = Py_SIZE(sequence);
4209 #else
4210 Py_ssize_t size = PySequence_Size(sequence);
4211 #endif
4382 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
42124383 if (unlikely(size != 2)) {
42134384 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
42144385 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
43904561 */
43914562 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
43924563 PyObject* sequence = __pyx_v_val;
4393 #if !CYTHON_COMPILING_IN_PYPY
4394 Py_ssize_t size = Py_SIZE(sequence);
4395 #else
4396 Py_ssize_t size = PySequence_Size(sequence);
4397 #endif
4564 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
43984565 if (unlikely(size != 2)) {
43994566 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
44004567 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
48445011 */
48455012 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
48465013 PyObject* sequence = __pyx_v_val;
4847 #if !CYTHON_COMPILING_IN_PYPY
4848 Py_ssize_t size = Py_SIZE(sequence);
4849 #else
4850 Py_ssize_t size = PySequence_Size(sequence);
4851 #endif
5014 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
48525015 if (unlikely(size != 2)) {
48535016 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
48545017 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
50305193 */
50315194 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
50325195 PyObject* sequence = __pyx_v_val;
5033 #if !CYTHON_COMPILING_IN_PYPY
5034 Py_ssize_t size = Py_SIZE(sequence);
5035 #else
5036 Py_ssize_t size = PySequence_Size(sequence);
5037 #endif
5196 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
50385197 if (unlikely(size != 2)) {
50395198 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
50405199 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
52165375 */
52175376 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
52185377 PyObject* sequence = __pyx_v_val;
5219 #if !CYTHON_COMPILING_IN_PYPY
5220 Py_ssize_t size = Py_SIZE(sequence);
5221 #else
5222 Py_ssize_t size = PySequence_Size(sequence);
5223 #endif
5378 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
52245379 if (unlikely(size != 2)) {
52255380 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
52265381 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
54025557 */
54035558 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
54045559 PyObject* sequence = __pyx_v_val;
5405 #if !CYTHON_COMPILING_IN_PYPY
5406 Py_ssize_t size = Py_SIZE(sequence);
5407 #else
5408 Py_ssize_t size = PySequence_Size(sequence);
5409 #endif
5560 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
54105561 if (unlikely(size != 2)) {
54115562 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
54125563 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
55885739 */
55895740 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
55905741 PyObject* sequence = __pyx_v_val;
5591 #if !CYTHON_COMPILING_IN_PYPY
5592 Py_ssize_t size = Py_SIZE(sequence);
5593 #else
5594 Py_ssize_t size = PySequence_Size(sequence);
5595 #endif
5742 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
55965743 if (unlikely(size != 2)) {
55975744 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
55985745 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
56865833 PyObject *__pyx_r = NULL;
56875834 __Pyx_RefNannyDeclarations
56885835 PyObject *__pyx_t_1 = NULL;
5689 PyObject *__pyx_t_2 = NULL;
56905836 __Pyx_RefNannySetupContext("copy", 0);
56915837
56925838 /* "pygame_sdl2/rect.pyx":210
56975843 * def move(self, *args):
56985844 */
56995845 __Pyx_XDECREF(__pyx_r);
5700 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
5846 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
57015847 __Pyx_GOTREF(__pyx_t_1);
5702 __Pyx_INCREF(((PyObject *)__pyx_v_self));
5703 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
5704 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
5705 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error)
5706 __Pyx_GOTREF(__pyx_t_2);
5707 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5708 __pyx_r = __pyx_t_2;
5709 __pyx_t_2 = 0;
5848 __pyx_r = __pyx_t_1;
5849 __pyx_t_1 = 0;
57105850 goto __pyx_L0;
57115851
57125852 /* "pygame_sdl2/rect.pyx":209
57205860 /* function exit code */
57215861 __pyx_L1_error:;
57225862 __Pyx_XDECREF(__pyx_t_1);
5723 __Pyx_XDECREF(__pyx_t_2);
57245863 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
57255864 __pyx_r = NULL;
57265865 __pyx_L0:;
59356074 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
59366075 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
59376076 PyObject* sequence = __pyx_t_1;
5938 #if !CYTHON_COMPILING_IN_PYPY
5939 Py_ssize_t size = Py_SIZE(sequence);
5940 #else
5941 Py_ssize_t size = PySequence_Size(sequence);
5942 #endif
6077 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
59436078 if (unlikely(size != 2)) {
59446079 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
59456080 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
62536388 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
62546389 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
62556390 PyObject* sequence = __pyx_t_1;
6256 #if !CYTHON_COMPILING_IN_PYPY
6257 Py_ssize_t size = Py_SIZE(sequence);
6258 #else
6259 Py_ssize_t size = PySequence_Size(sequence);
6260 #endif
6391 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
62616392 if (unlikely(size != 2)) {
62626393 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
62636394 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
65866717 *
65876718 * if self.w > other.w or self.h > other.h:
65886719 */
6589 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error)
6720 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_v_other); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error)
65906721 __Pyx_GOTREF(__pyx_t_3);
6591 __Pyx_INCREF(__pyx_v_other);
6592 __Pyx_GIVEREF(__pyx_v_other);
6593 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other);
6594 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error)
6595 __Pyx_GOTREF(__pyx_t_4);
6596 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6597 __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_4);
6598 __pyx_t_4 = 0;
6722 __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3);
6723 __pyx_t_3 = 0;
65996724
66006725 /* "pygame_sdl2/rect.pyx":240
66016726 *
66136738 * self.center = other.center
66146739 * else:
66156740 */
6616 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error)
6741 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error)
6742 __Pyx_GOTREF(__pyx_t_3);
6743 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error)
66176744 __Pyx_GOTREF(__pyx_t_4);
6618 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error)
6619 __Pyx_GOTREF(__pyx_t_3);
6620 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 243, __pyx_L1_error)
6745 __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 243, __pyx_L1_error)
6746 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
66216747 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6622 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
66236748 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 243, __pyx_L1_error)
66246749 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
66256750 if (!__pyx_t_1) {
66296754 }
66306755 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 243, __pyx_L1_error)
66316756 __Pyx_GOTREF(__pyx_t_5);
6632 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error)
6633 __Pyx_GOTREF(__pyx_t_3);
6634 __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error)
6757 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error)
6758 __Pyx_GOTREF(__pyx_t_4);
6759 __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error)
66356760 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6761 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6762 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 243, __pyx_L1_error)
66366763 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6637 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 243, __pyx_L1_error)
6638 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
66396764 __pyx_t_2 = __pyx_t_1;
66406765 __pyx_L5_bool_binop_done:;
66416766 if (__pyx_t_2) {
66476772 * else:
66486773 * if self.left < other.left:
66496774 */
6650 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_center); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error)
6651 __Pyx_GOTREF(__pyx_t_4);
6652 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_center, __pyx_t_4) < 0) __PYX_ERR(0, 244, __pyx_L1_error)
6653 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6775 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_center); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error)
6776 __Pyx_GOTREF(__pyx_t_3);
6777 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_center, __pyx_t_3) < 0) __PYX_ERR(0, 244, __pyx_L1_error)
6778 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
66546779
66556780 /* "pygame_sdl2/rect.pyx":243
66566781 * other = Rect(other)
66706795 * elif self.right > other.right:
66716796 */
66726797 /*else*/ {
6673 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 246, __pyx_L1_error)
6798 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error)
6799 __Pyx_GOTREF(__pyx_t_3);
6800 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 246, __pyx_L1_error)
66746801 __Pyx_GOTREF(__pyx_t_4);
6675 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error)
6676 __Pyx_GOTREF(__pyx_t_3);
6677 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 246, __pyx_L1_error)
6802 __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 246, __pyx_L1_error)
6803 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
66786804 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6679 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
66806805 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 246, __pyx_L1_error)
66816806 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
66826807 if (__pyx_t_2) {
67126837 */
67136838 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 248, __pyx_L1_error)
67146839 __Pyx_GOTREF(__pyx_t_5);
6715 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
6716 __Pyx_GOTREF(__pyx_t_3);
6717 __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
6840 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
6841 __Pyx_GOTREF(__pyx_t_4);
6842 __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
67186843 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6844 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6845 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 248, __pyx_L1_error)
67196846 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6720 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 248, __pyx_L1_error)
6721 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
67226847 if (__pyx_t_2) {
67236848
67246849 /* "pygame_sdl2/rect.pyx":249
67286853 * if self.top < other.top:
67296854 * self.top = other.top
67306855 */
6731 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error)
6732 __Pyx_GOTREF(__pyx_t_4);
6733 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_4) < 0) __PYX_ERR(0, 249, __pyx_L1_error)
6734 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6856 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
6857 __Pyx_GOTREF(__pyx_t_3);
6858 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_3) < 0) __PYX_ERR(0, 249, __pyx_L1_error)
6859 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
67356860
67366861 /* "pygame_sdl2/rect.pyx":248
67376862 * if self.left < other.left:
67506875 * self.top = other.top
67516876 * elif self.bottom > other.bottom:
67526877 */
6753 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
6878 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
6879 __Pyx_GOTREF(__pyx_t_3);
6880 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
67546881 __Pyx_GOTREF(__pyx_t_4);
6755 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
6756 __Pyx_GOTREF(__pyx_t_3);
6757 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __pyx_L1_error)
6882 __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __pyx_L1_error)
6883 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
67586884 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6759 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
67606885 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 250, __pyx_L1_error)
67616886 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
67626887 if (__pyx_t_2) {
67926917 */
67936918 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error)
67946919 __Pyx_GOTREF(__pyx_t_5);
6795 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
6796 __Pyx_GOTREF(__pyx_t_3);
6797 __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
6920 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
6921 __Pyx_GOTREF(__pyx_t_4);
6922 __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
67986923 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6924 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6925 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 252, __pyx_L1_error)
67996926 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6800 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 252, __pyx_L1_error)
6801 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
68026927 if (__pyx_t_2) {
68036928
68046929 /* "pygame_sdl2/rect.pyx":253
68086933 *
68096934 * def clip(self, other, y=None, w=None, h=None):
68106935 */
6811 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error)
6812 __Pyx_GOTREF(__pyx_t_4);
6813 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_4) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
6814 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6936 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error)
6937 __Pyx_GOTREF(__pyx_t_3);
6938 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_3) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
6939 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
68156940
68166941 /* "pygame_sdl2/rect.pyx":252
68176942 * if self.top < other.top:
68787003 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
68797004 switch (pos_args) {
68807005 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7006 CYTHON_FALLTHROUGH;
68817007 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7008 CYTHON_FALLTHROUGH;
68827009 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7010 CYTHON_FALLTHROUGH;
68837011 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7012 CYTHON_FALLTHROUGH;
68847013 case 0: break;
68857014 default: goto __pyx_L5_argtuple_error;
68867015 }
68877016 kw_args = PyDict_Size(__pyx_kwds);
68887017 switch (pos_args) {
68897018 case 0:
6890 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
7019 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
68917020 else goto __pyx_L5_argtuple_error;
7021 CYTHON_FALLTHROUGH;
68927022 case 1:
68937023 if (kw_args > 0) {
6894 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y);
7024 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y);
68957025 if (value) { values[1] = value; kw_args--; }
68967026 }
7027 CYTHON_FALLTHROUGH;
68977028 case 2:
68987029 if (kw_args > 0) {
6899 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_w);
7030 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w);
69007031 if (value) { values[2] = value; kw_args--; }
69017032 }
7033 CYTHON_FALLTHROUGH;
69027034 case 3:
69037035 if (kw_args > 0) {
6904 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h);
7036 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h);
69057037 if (value) { values[3] = value; kw_args--; }
69067038 }
69077039 }
69117043 } else {
69127044 switch (PyTuple_GET_SIZE(__pyx_args)) {
69137045 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7046 CYTHON_FALLTHROUGH;
69147047 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7048 CYTHON_FALLTHROUGH;
69157049 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7050 CYTHON_FALLTHROUGH;
69167051 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
69177052 break;
69187053 default: goto __pyx_L5_argtuple_error;
70187153 *
70197154 * if not self.colliderect(other):
70207155 */
7021 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error)
7156 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_v_other); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error)
70227157 __Pyx_GOTREF(__pyx_t_3);
7023 __Pyx_INCREF(__pyx_v_other);
7024 __Pyx_GIVEREF(__pyx_v_other);
7025 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other);
7026 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
7027 __Pyx_GOTREF(__pyx_t_1);
7028 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7029 __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_1);
7030 __pyx_t_1 = 0;
7158 __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3);
7159 __pyx_t_3 = 0;
70317160
70327161 /* "pygame_sdl2/rect.pyx":259
70337162 * other = Rect(other, y, w, h)
70457174 * return Rect(0,0,0,0)
70467175 *
70477176 */
7048 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
7049 __Pyx_GOTREF(__pyx_t_3);
7177 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
7178 __Pyx_GOTREF(__pyx_t_1);
70507179 __pyx_t_5 = NULL;
7051 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
7052 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
7180 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
7181 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
70537182 if (likely(__pyx_t_5)) {
7054 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
7183 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
70557184 __Pyx_INCREF(__pyx_t_5);
70567185 __Pyx_INCREF(function);
7057 __Pyx_DECREF_SET(__pyx_t_3, function);
7186 __Pyx_DECREF_SET(__pyx_t_1, function);
70587187 }
70597188 }
70607189 if (!__pyx_t_5) {
7061 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_other); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
7062 __Pyx_GOTREF(__pyx_t_1);
7190 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_other); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
7191 __Pyx_GOTREF(__pyx_t_3);
70637192 } else {
70647193 #if CYTHON_FAST_PYCALL
7065 if (PyFunction_Check(__pyx_t_3)) {
7194 if (PyFunction_Check(__pyx_t_1)) {
70667195 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_other};
7067 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
7196 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
70687197 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7069 __Pyx_GOTREF(__pyx_t_1);
7198 __Pyx_GOTREF(__pyx_t_3);
70707199 } else
70717200 #endif
70727201 #if CYTHON_FAST_PYCCALL
7073 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
7202 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
70747203 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_other};
7075 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
7204 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
70767205 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7077 __Pyx_GOTREF(__pyx_t_1);
7206 __Pyx_GOTREF(__pyx_t_3);
70787207 } else
70797208 #endif
70807209 {
70847213 __Pyx_INCREF(__pyx_v_other);
70857214 __Pyx_GIVEREF(__pyx_v_other);
70867215 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_other);
7087 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
7088 __Pyx_GOTREF(__pyx_t_1);
7216 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
7217 __Pyx_GOTREF(__pyx_t_3);
70897218 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
70907219 }
70917220 }
7221 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7222 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 262, __pyx_L1_error)
70927223 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7093 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 262, __pyx_L1_error)
7094 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
70957224 __pyx_t_2 = ((!__pyx_t_4) != 0);
70967225 if (__pyx_t_2) {
70977226
71037232 * r = self.copy()
71047233 */
71057234 __Pyx_XDECREF(__pyx_r);
7106 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error)
7107 __Pyx_GOTREF(__pyx_t_1);
7108 __pyx_r = __pyx_t_1;
7109 __pyx_t_1 = 0;
7235 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error)
7236 __Pyx_GOTREF(__pyx_t_3);
7237 __pyx_r = __pyx_t_3;
7238 __pyx_t_3 = 0;
71107239 goto __pyx_L0;
71117240
71127241 /* "pygame_sdl2/rect.pyx":262
71257254 *
71267255 * # Remember that (0,0) is the top left.
71277256 */
7128 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error)
7129 __Pyx_GOTREF(__pyx_t_3);
7257 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error)
7258 __Pyx_GOTREF(__pyx_t_1);
71307259 __pyx_t_6 = NULL;
7131 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
7132 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
7260 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
7261 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
71337262 if (likely(__pyx_t_6)) {
7134 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
7263 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
71357264 __Pyx_INCREF(__pyx_t_6);
71367265 __Pyx_INCREF(function);
7137 __Pyx_DECREF_SET(__pyx_t_3, function);
7266 __Pyx_DECREF_SET(__pyx_t_1, function);
71387267 }
71397268 }
71407269 if (__pyx_t_6) {
7141 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error)
7270 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error)
71427271 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
71437272 } else {
7144 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error)
7145 }
7146 __Pyx_GOTREF(__pyx_t_1);
7147 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7148 __pyx_v_r = __pyx_t_1;
7149 __pyx_t_1 = 0;
7273 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error)
7274 }
7275 __Pyx_GOTREF(__pyx_t_3);
7276 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7277 __pyx_v_r = __pyx_t_3;
7278 __pyx_t_3 = 0;
71507279
71517280 /* "pygame_sdl2/rect.pyx":268
71527281 *
71557284 * d = other.left - r.left
71567285 * r.left += d
71577286 */
7158 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
7287 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error)
7288 __Pyx_GOTREF(__pyx_t_3);
7289 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
71597290 __Pyx_GOTREF(__pyx_t_1);
7160 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error)
7161 __Pyx_GOTREF(__pyx_t_3);
7162 __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error)
7291 __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error)
7292 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
71637293 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7164 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
71657294 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
71667295 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
71677296 if (__pyx_t_2) {
71757304 */
71767305 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 269, __pyx_L1_error)
71777306 __Pyx_GOTREF(__pyx_t_6);
7178 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error)
7307 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
7308 __Pyx_GOTREF(__pyx_t_1);
7309 __pyx_t_3 = PyNumber_Subtract(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error)
71797310 __Pyx_GOTREF(__pyx_t_3);
7180 __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
7181 __Pyx_GOTREF(__pyx_t_1);
71827311 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7183 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7184 __pyx_v_d = __pyx_t_1;
7185 __pyx_t_1 = 0;
7312 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7313 __pyx_v_d = __pyx_t_3;
7314 __pyx_t_3 = 0;
71867315
71877316 /* "pygame_sdl2/rect.pyx":270
71887317 * if r.left < other.left:
71917320 * r.width -= d
71927321 * if r.right > other.right:
71937322 */
7194 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
7323 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error)
7324 __Pyx_GOTREF(__pyx_t_3);
7325 __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
71957326 __Pyx_GOTREF(__pyx_t_1);
7196 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error)
7197 __Pyx_GOTREF(__pyx_t_3);
7327 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7328 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_left, __pyx_t_1) < 0) __PYX_ERR(0, 270, __pyx_L1_error)
71987329 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7199 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_left, __pyx_t_3) < 0) __PYX_ERR(0, 270, __pyx_L1_error)
7200 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
72017330
72027331 /* "pygame_sdl2/rect.pyx":271
72037332 * d = other.left - r.left
72067335 * if r.right > other.right:
72077336 * d = r.right - other.right
72087337 */
7209 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_width); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error)
7338 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
7339 __Pyx_GOTREF(__pyx_t_1);
7340 __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error)
72107341 __Pyx_GOTREF(__pyx_t_3);
7211 __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
7212 __Pyx_GOTREF(__pyx_t_1);
7342 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7343 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_width, __pyx_t_3) < 0) __PYX_ERR(0, 271, __pyx_L1_error)
72137344 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7214 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_width, __pyx_t_1) < 0) __PYX_ERR(0, 271, __pyx_L1_error)
7215 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
72167345
72177346 /* "pygame_sdl2/rect.pyx":268
72187347 *
72307359 * d = r.right - other.right
72317360 * r.width -=d
72327361 */
7233 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
7362 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
7363 __Pyx_GOTREF(__pyx_t_3);
7364 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
72347365 __Pyx_GOTREF(__pyx_t_1);
7235 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
7236 __Pyx_GOTREF(__pyx_t_3);
7237 __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error)
7366 __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error)
7367 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
72387368 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7239 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
72407369 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 272, __pyx_L1_error)
72417370 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
72427371 if (__pyx_t_2) {
72507379 */
72517380 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_right); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 273, __pyx_L1_error)
72527381 __Pyx_GOTREF(__pyx_t_6);
7253 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
7382 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
7383 __Pyx_GOTREF(__pyx_t_1);
7384 __pyx_t_3 = PyNumber_Subtract(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
72547385 __Pyx_GOTREF(__pyx_t_3);
7255 __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
7256 __Pyx_GOTREF(__pyx_t_1);
72577386 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7258 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7259 __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_1);
7260 __pyx_t_1 = 0;
7387 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7388 __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_3);
7389 __pyx_t_3 = 0;
72617390
72627391 /* "pygame_sdl2/rect.pyx":274
72637392 * if r.right > other.right:
72667395 * if r.top < other.top:
72677396 * d = other.top - r.top
72687397 */
7269 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
7398 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_width); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error)
7399 __Pyx_GOTREF(__pyx_t_3);
7400 __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
72707401 __Pyx_GOTREF(__pyx_t_1);
7271 __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error)
7272 __Pyx_GOTREF(__pyx_t_3);
7402 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7403 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_width, __pyx_t_1) < 0) __PYX_ERR(0, 274, __pyx_L1_error)
72737404 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7274 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_width, __pyx_t_3) < 0) __PYX_ERR(0, 274, __pyx_L1_error)
7275 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
72767405
72777406 /* "pygame_sdl2/rect.pyx":272
72787407 * r.left += d
72907419 * d = other.top - r.top
72917420 * r.top += d
72927421 */
7293 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_top); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error)
7422 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_top); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error)
7423 __Pyx_GOTREF(__pyx_t_1);
7424 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error)
72947425 __Pyx_GOTREF(__pyx_t_3);
7295 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error)
7296 __Pyx_GOTREF(__pyx_t_1);
7297 __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L1_error)
7426 __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L1_error)
7427 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
72987428 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7299 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
73007429 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 275, __pyx_L1_error)
73017430 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
73027431 if (__pyx_t_2) {
73107439 */
73117440 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L1_error)
73127441 __Pyx_GOTREF(__pyx_t_6);
7313 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_top); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
7442 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_top); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
7443 __Pyx_GOTREF(__pyx_t_3);
7444 __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
73147445 __Pyx_GOTREF(__pyx_t_1);
7315 __pyx_t_3 = PyNumber_Subtract(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
7316 __Pyx_GOTREF(__pyx_t_3);
73177446 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7318 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7319 __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_3);
7320 __pyx_t_3 = 0;
7447 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7448 __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_1);
7449 __pyx_t_1 = 0;
73217450
73227451 /* "pygame_sdl2/rect.pyx":277
73237452 * if r.top < other.top:
73267455 * r.height -= d
73277456 * if r.bottom > other.bottom:
73287457 */
7329 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_top); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error)
7458 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_top); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
7459 __Pyx_GOTREF(__pyx_t_1);
7460 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error)
73307461 __Pyx_GOTREF(__pyx_t_3);
7331 __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
7332 __Pyx_GOTREF(__pyx_t_1);
7462 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7463 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_top, __pyx_t_3) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
73337464 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7334 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_top, __pyx_t_1) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
7335 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
73367465
73377466 /* "pygame_sdl2/rect.pyx":278
73387467 * d = other.top - r.top
73417470 * if r.bottom > other.bottom:
73427471 * d = r.bottom - other.bottom
73437472 */
7344 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_height); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
7473 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
7474 __Pyx_GOTREF(__pyx_t_3);
7475 __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
73457476 __Pyx_GOTREF(__pyx_t_1);
7346 __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
7347 __Pyx_GOTREF(__pyx_t_3);
7477 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7478 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_height, __pyx_t_1) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
73487479 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7349 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_height, __pyx_t_3) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
7350 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
73517480
73527481 /* "pygame_sdl2/rect.pyx":275
73537482 * d = r.right - other.right
73657494 * d = r.bottom - other.bottom
73667495 * r.height -= d
73677496 */
7368 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_bottom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
7497 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_bottom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
7498 __Pyx_GOTREF(__pyx_t_1);
7499 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
73697500 __Pyx_GOTREF(__pyx_t_3);
7370 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
7371 __Pyx_GOTREF(__pyx_t_1);
7372 __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L1_error)
7501 __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L1_error)
7502 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
73737503 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7374 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
73757504 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 279, __pyx_L1_error)
73767505 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
73777506 if (__pyx_t_2) {
73857514 */
73867515 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_bottom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 280, __pyx_L1_error)
73877516 __Pyx_GOTREF(__pyx_t_6);
7388 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
7517 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
7518 __Pyx_GOTREF(__pyx_t_3);
7519 __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
73897520 __Pyx_GOTREF(__pyx_t_1);
7390 __pyx_t_3 = PyNumber_Subtract(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
7391 __Pyx_GOTREF(__pyx_t_3);
73927521 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7393 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7394 __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_3);
7395 __pyx_t_3 = 0;
7522 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7523 __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_1);
7524 __pyx_t_1 = 0;
73967525
73977526 /* "pygame_sdl2/rect.pyx":281
73987527 * if r.bottom > other.bottom:
74017530 *
74027531 * return r
74037532 */
7404 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error)
7533 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_height); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
7534 __Pyx_GOTREF(__pyx_t_1);
7535 __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error)
74057536 __Pyx_GOTREF(__pyx_t_3);
7406 __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
7407 __Pyx_GOTREF(__pyx_t_1);
7537 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7538 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_height, __pyx_t_3) < 0) __PYX_ERR(0, 281, __pyx_L1_error)
74087539 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7409 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_height, __pyx_t_1) < 0) __PYX_ERR(0, 281, __pyx_L1_error)
7410 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
74117540
74127541 /* "pygame_sdl2/rect.pyx":279
74137542 * r.top += d
76347763 int __pyx_t_1;
76357764 int __pyx_t_2;
76367765 PyObject *__pyx_t_3 = NULL;
7637 PyObject *__pyx_t_4 = NULL;
7638 int __pyx_t_5;
7766 int __pyx_t_4;
7767 PyObject *__pyx_t_5 = NULL;
76397768 PyObject *__pyx_t_6 = NULL;
76407769 PyObject *__pyx_t_7 = NULL;
76417770 __Pyx_RefNannySetupContext("union_ip", 0);
76597788 *
76607789 * x = min(self.x, other.x)
76617790 */
7662 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error)
7791 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_v_other); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error)
76637792 __Pyx_GOTREF(__pyx_t_3);
7664 __Pyx_INCREF(__pyx_v_other);
7665 __Pyx_GIVEREF(__pyx_v_other);
7666 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other);
7667 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 292, __pyx_L1_error)
7668 __Pyx_GOTREF(__pyx_t_4);
7669 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7670 __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_4);
7671 __pyx_t_4 = 0;
7793 __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3);
7794 __pyx_t_3 = 0;
76727795
76737796 /* "pygame_sdl2/rect.pyx":291
76747797 *
76867809 * y = min(self.y, other.y)
76877810 * self.w = max(self.right, other.right) - x
76887811 */
7689 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
7690 __Pyx_GOTREF(__pyx_t_4);
7691 __pyx_t_5 = __pyx_v_self->x;
7692 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L1_error)
7812 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error)
7813 __Pyx_GOTREF(__pyx_t_3);
7814 __pyx_t_4 = __pyx_v_self->x;
7815 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L1_error)
76937816 __Pyx_GOTREF(__pyx_t_6);
7694 __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 294, __pyx_L1_error)
7817 __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 294, __pyx_L1_error)
76957818 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
76967819 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 294, __pyx_L1_error)
76977820 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
76987821 if (__pyx_t_2) {
7699 __Pyx_INCREF(__pyx_t_4);
7700 __pyx_t_3 = __pyx_t_4;
7822 __Pyx_INCREF(__pyx_t_3);
7823 __pyx_t_5 = __pyx_t_3;
77017824 } else {
7702 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 294, __pyx_L1_error)
7825 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 294, __pyx_L1_error)
77037826 __Pyx_GOTREF(__pyx_t_7);
7704 __pyx_t_3 = __pyx_t_7;
7827 __pyx_t_5 = __pyx_t_7;
77057828 __pyx_t_7 = 0;
77067829 }
7707 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7708 __pyx_t_4 = __pyx_t_3;
7709 __Pyx_INCREF(__pyx_t_4);
77107830 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7711 __pyx_v_x = __pyx_t_4;
7712 __pyx_t_4 = 0;
7831 __pyx_t_3 = __pyx_t_5;
7832 __Pyx_INCREF(__pyx_t_3);
7833 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7834 __pyx_v_x = __pyx_t_3;
7835 __pyx_t_3 = 0;
77137836
77147837 /* "pygame_sdl2/rect.pyx":295
77157838 *
77187841 * self.w = max(self.right, other.right) - x
77197842 * self.h = max(self.bottom, other.bottom) - y
77207843 */
7721 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __pyx_L1_error)
7722 __Pyx_GOTREF(__pyx_t_4);
7723 __pyx_t_5 = __pyx_v_self->y;
7724 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 295, __pyx_L1_error)
7844 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
7845 __Pyx_GOTREF(__pyx_t_3);
7846 __pyx_t_4 = __pyx_v_self->y;
7847 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 295, __pyx_L1_error)
77257848 __Pyx_GOTREF(__pyx_t_7);
7726 __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L1_error)
7849 __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L1_error)
77277850 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
77287851 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 295, __pyx_L1_error)
77297852 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
77307853 if (__pyx_t_2) {
7731 __Pyx_INCREF(__pyx_t_4);
7732 __pyx_t_3 = __pyx_t_4;
7854 __Pyx_INCREF(__pyx_t_3);
7855 __pyx_t_5 = __pyx_t_3;
77337856 } else {
7734 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L1_error)
7857 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L1_error)
77357858 __Pyx_GOTREF(__pyx_t_6);
7736 __pyx_t_3 = __pyx_t_6;
7859 __pyx_t_5 = __pyx_t_6;
77377860 __pyx_t_6 = 0;
77387861 }
7739 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7740 __pyx_t_4 = __pyx_t_3;
7741 __Pyx_INCREF(__pyx_t_4);
77427862 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7743 __pyx_v_y = __pyx_t_4;
7744 __pyx_t_4 = 0;
7863 __pyx_t_3 = __pyx_t_5;
7864 __Pyx_INCREF(__pyx_t_3);
7865 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7866 __pyx_v_y = __pyx_t_3;
7867 __pyx_t_3 = 0;
77457868
77467869 /* "pygame_sdl2/rect.pyx":296
77477870 * x = min(self.x, other.x)
77507873 * self.h = max(self.bottom, other.bottom) - y
77517874 * self.x = x
77527875 */
7753 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error)
7754 __Pyx_GOTREF(__pyx_t_4);
7755 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error)
7876 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error)
77567877 __Pyx_GOTREF(__pyx_t_3);
7757 __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 296, __pyx_L1_error)
7878 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error)
7879 __Pyx_GOTREF(__pyx_t_5);
7880 __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 296, __pyx_L1_error)
77587881 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 296, __pyx_L1_error)
77597882 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
77607883 if (__pyx_t_2) {
7761 __Pyx_INCREF(__pyx_t_4);
7762 __pyx_t_6 = __pyx_t_4;
7763 } else {
77647884 __Pyx_INCREF(__pyx_t_3);
77657885 __pyx_t_6 = __pyx_t_3;
7766 }
7886 } else {
7887 __Pyx_INCREF(__pyx_t_5);
7888 __pyx_t_6 = __pyx_t_5;
7889 }
7890 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
77677891 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7768 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7769 __pyx_t_4 = PyNumber_Subtract(__pyx_t_6, __pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error)
7770 __Pyx_GOTREF(__pyx_t_4);
7892 __pyx_t_3 = PyNumber_Subtract(__pyx_t_6, __pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error)
7893 __Pyx_GOTREF(__pyx_t_3);
77717894 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7772 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 296, __pyx_L1_error)
7773 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7774 __pyx_v_self->w = __pyx_t_5;
7895 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 296, __pyx_L1_error)
7896 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7897 __pyx_v_self->w = __pyx_t_4;
77757898
77767899 /* "pygame_sdl2/rect.pyx":297
77777900 * y = min(self.y, other.y)
77807903 * self.x = x
77817904 * self.y = y
77827905 */
7783 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
7784 __Pyx_GOTREF(__pyx_t_4);
7906 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
7907 __Pyx_GOTREF(__pyx_t_3);
77857908 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error)
77867909 __Pyx_GOTREF(__pyx_t_6);
7787 __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 297, __pyx_L1_error)
7910 __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 297, __pyx_L1_error)
77887911 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 297, __pyx_L1_error)
77897912 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
77907913 if (__pyx_t_2) {
7791 __Pyx_INCREF(__pyx_t_4);
7792 __pyx_t_3 = __pyx_t_4;
7914 __Pyx_INCREF(__pyx_t_3);
7915 __pyx_t_5 = __pyx_t_3;
77937916 } else {
77947917 __Pyx_INCREF(__pyx_t_6);
7795 __pyx_t_3 = __pyx_t_6;
7918 __pyx_t_5 = __pyx_t_6;
77967919 }
77977920 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7798 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7799 __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_v_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
7800 __Pyx_GOTREF(__pyx_t_4);
78017921 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7802 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 297, __pyx_L1_error)
7803 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7804 __pyx_v_self->h = __pyx_t_5;
7922 __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_v_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
7923 __Pyx_GOTREF(__pyx_t_3);
7924 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7925 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 297, __pyx_L1_error)
7926 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7927 __pyx_v_self->h = __pyx_t_4;
78057928
78067929 /* "pygame_sdl2/rect.pyx":298
78077930 * self.w = max(self.right, other.right) - x
78107933 * self.y = y
78117934 *
78127935 */
7813 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_x); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 298, __pyx_L1_error)
7814 __pyx_v_self->x = __pyx_t_5;
7936 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_x); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 298, __pyx_L1_error)
7937 __pyx_v_self->x = __pyx_t_4;
78157938
78167939 /* "pygame_sdl2/rect.pyx":299
78177940 * self.h = max(self.bottom, other.bottom) - y
78207943 *
78217944 * def unionall(self, other_seq):
78227945 */
7823 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_y); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L1_error)
7824 __pyx_v_self->y = __pyx_t_5;
7946 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_y); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L1_error)
7947 __pyx_v_self->y = __pyx_t_4;
78257948
78267949 /* "pygame_sdl2/rect.pyx":290
78277950 * return r
78367959 goto __pyx_L0;
78377960 __pyx_L1_error:;
78387961 __Pyx_XDECREF(__pyx_t_3);
7839 __Pyx_XDECREF(__pyx_t_4);
7962 __Pyx_XDECREF(__pyx_t_5);
78407963 __Pyx_XDECREF(__pyx_t_6);
78417964 __Pyx_XDECREF(__pyx_t_7);
78427965 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.union_ip", __pyx_clineno, __pyx_lineno, __pyx_filename);
80738196 if (unlikely(!__pyx_t_4)) {
80748197 PyObject* exc_type = PyErr_Occurred();
80758198 if (exc_type) {
8076 if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
8199 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
80778200 else __PYX_ERR(0, 307, __pyx_L1_error)
80788201 }
80798202 break;
82288351 *
82298352 * # Not sure if this is entirely correct. Docs and tests are ambiguous.
82308353 */
8231 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error)
8354 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_v_other); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error)
82328355 __Pyx_GOTREF(__pyx_t_3);
8233 __Pyx_INCREF(__pyx_v_other);
8234 __Pyx_GIVEREF(__pyx_v_other);
8235 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other);
8236 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error)
8237 __Pyx_GOTREF(__pyx_t_4);
8238 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8239 __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_4);
8240 __pyx_t_4 = 0;
8356 __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3);
8357 __pyx_t_3 = 0;
82418358
82428359 /* "pygame_sdl2/rect.pyx":311
82438360 *
82558372 * r.topleft = other.topleft
82568373 * w_ratio = other.w / float(r.w)
82578374 */
8258 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L1_error)
8259 __Pyx_GOTREF(__pyx_t_3);
8375 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error)
8376 __Pyx_GOTREF(__pyx_t_4);
82608377 __pyx_t_5 = NULL;
8261 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
8262 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
8378 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
8379 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
82638380 if (likely(__pyx_t_5)) {
8264 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8381 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
82658382 __Pyx_INCREF(__pyx_t_5);
82668383 __Pyx_INCREF(function);
8267 __Pyx_DECREF_SET(__pyx_t_3, function);
8384 __Pyx_DECREF_SET(__pyx_t_4, function);
82688385 }
82698386 }
82708387 if (__pyx_t_5) {
8271 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error)
8388 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L1_error)
82728389 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
82738390 } else {
8274 __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error)
8275 }
8276 __Pyx_GOTREF(__pyx_t_4);
8277 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8278 __pyx_v_r = __pyx_t_4;
8279 __pyx_t_4 = 0;
8391 __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L1_error)
8392 }
8393 __Pyx_GOTREF(__pyx_t_3);
8394 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8395 __pyx_v_r = __pyx_t_3;
8396 __pyx_t_3 = 0;
82808397
82818398 /* "pygame_sdl2/rect.pyx":316
82828399 * # Not sure if this is entirely correct. Docs and tests are ambiguous.
82858402 * w_ratio = other.w / float(r.w)
82868403 * h_ratio = other.h / float(r.h)
82878404 */
8288 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_topleft); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 316, __pyx_L1_error)
8289 __Pyx_GOTREF(__pyx_t_4);
8290 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_topleft, __pyx_t_4) < 0) __PYX_ERR(0, 316, __pyx_L1_error)
8291 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8405 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_topleft); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error)
8406 __Pyx_GOTREF(__pyx_t_3);
8407 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_topleft, __pyx_t_3) < 0) __PYX_ERR(0, 316, __pyx_L1_error)
8408 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
82928409
82938410 /* "pygame_sdl2/rect.pyx":317
82948411 * r = self.copy()
82978414 * h_ratio = other.h / float(r.h)
82988415 * factor = min(w_ratio, h_ratio)
82998416 */
8300 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error)
8417 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error)
8418 __Pyx_GOTREF(__pyx_t_3);
8419 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error)
83018420 __Pyx_GOTREF(__pyx_t_4);
8302 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error)
8303 __Pyx_GOTREF(__pyx_t_3);
8304 __pyx_t_5 = __Pyx_PyNumber_Float(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 317, __pyx_L1_error)
8421 __pyx_t_5 = __Pyx_PyNumber_Float(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 317, __pyx_L1_error)
83058422 __Pyx_GOTREF(__pyx_t_5);
8423 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8424 __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error)
8425 __Pyx_GOTREF(__pyx_t_4);
83068426 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8307 __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error)
8308 __Pyx_GOTREF(__pyx_t_3);
8309 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
83108427 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8311 __pyx_v_w_ratio = __pyx_t_3;
8312 __pyx_t_3 = 0;
8428 __pyx_v_w_ratio = __pyx_t_4;
8429 __pyx_t_4 = 0;
83138430
83148431 /* "pygame_sdl2/rect.pyx":318
83158432 * r.topleft = other.topleft
83188435 * factor = min(w_ratio, h_ratio)
83198436 * r.w *= factor
83208437 */
8321 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error)
8322 __Pyx_GOTREF(__pyx_t_3);
8438 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error)
8439 __Pyx_GOTREF(__pyx_t_4);
83238440 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error)
83248441 __Pyx_GOTREF(__pyx_t_5);
8325 __pyx_t_4 = __Pyx_PyNumber_Float(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error)
8326 __Pyx_GOTREF(__pyx_t_4);
8442 __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error)
8443 __Pyx_GOTREF(__pyx_t_3);
83278444 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8328 __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error)
8445 __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error)
83298446 __Pyx_GOTREF(__pyx_t_5);
8447 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
83308448 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8331 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
83328449 __pyx_v_h_ratio = __pyx_t_5;
83338450 __pyx_t_5 = 0;
83348451
83428459 __Pyx_INCREF(__pyx_v_h_ratio);
83438460 __pyx_t_5 = __pyx_v_h_ratio;
83448461 __Pyx_INCREF(__pyx_v_w_ratio);
8345 __pyx_t_4 = __pyx_v_w_ratio;
8346 __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 319, __pyx_L1_error)
8462 __pyx_t_3 = __pyx_v_w_ratio;
8463 __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 319, __pyx_L1_error)
83478464 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 319, __pyx_L1_error)
83488465 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
83498466 if (__pyx_t_2) {
83508467 __Pyx_INCREF(__pyx_t_5);
8351 __pyx_t_3 = __pyx_t_5;
8468 __pyx_t_4 = __pyx_t_5;
83528469 } else {
8353 __Pyx_INCREF(__pyx_t_4);
8354 __pyx_t_3 = __pyx_t_4;
8355 }
8470 __Pyx_INCREF(__pyx_t_3);
8471 __pyx_t_4 = __pyx_t_3;
8472 }
8473 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8474 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8475 __pyx_t_5 = __pyx_t_4;
8476 __Pyx_INCREF(__pyx_t_5);
83568477 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8357 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8358 __pyx_t_5 = __pyx_t_3;
8359 __Pyx_INCREF(__pyx_t_5);
8360 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
83618478 __pyx_v_factor = __pyx_t_5;
83628479 __pyx_t_5 = 0;
83638480
83708487 */
83718488 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 320, __pyx_L1_error)
83728489 __Pyx_GOTREF(__pyx_t_5);
8373 __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_5, __pyx_v_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __pyx_L1_error)
8374 __Pyx_GOTREF(__pyx_t_3);
8490 __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_t_5, __pyx_v_factor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
8491 __Pyx_GOTREF(__pyx_t_4);
83758492 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8376 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_w, __pyx_t_3) < 0) __PYX_ERR(0, 320, __pyx_L1_error)
8377 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8493 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_w, __pyx_t_4) < 0) __PYX_ERR(0, 320, __pyx_L1_error)
8494 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
83788495
83798496 /* "pygame_sdl2/rect.pyx":321
83808497 * factor = min(w_ratio, h_ratio)
83838500 * return r
83848501 *
83858502 */
8386 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error)
8387 __Pyx_GOTREF(__pyx_t_3);
8388 __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_t_3, __pyx_v_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 321, __pyx_L1_error)
8503 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L1_error)
8504 __Pyx_GOTREF(__pyx_t_4);
8505 __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_t_4, __pyx_v_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 321, __pyx_L1_error)
83898506 __Pyx_GOTREF(__pyx_t_5);
8390 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8507 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
83918508 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_h, __pyx_t_5) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
83928509 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
83938510
85978714 *
85988715 * return other.x >= self.x and other.right <= self.right and \
85998716 */
8600 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L1_error)
8717 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_v_other); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L1_error)
86018718 __Pyx_GOTREF(__pyx_t_3);
8602 __Pyx_INCREF(__pyx_v_other);
8603 __Pyx_GIVEREF(__pyx_v_other);
8604 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other);
8605 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error)
8606 __Pyx_GOTREF(__pyx_t_4);
8607 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8608 __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_4);
8609 __pyx_t_4 = 0;
8719 __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3);
8720 __pyx_t_3 = 0;
86108721
86118722 /* "pygame_sdl2/rect.pyx":333
86128723 *
86258736 * other.left < self.right and other.top < self.bottom
86268737 */
86278738 __Pyx_XDECREF(__pyx_r);
8628 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error)
8629 __Pyx_GOTREF(__pyx_t_3);
8739 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L1_error)
8740 __Pyx_GOTREF(__pyx_t_4);
86308741 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
86318742 __Pyx_GOTREF(__pyx_t_5);
8632 __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error)
8633 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8743 __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error)
8744 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
86348745 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
86358746 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 336, __pyx_L1_error)
86368747 if (__pyx_t_2) {
86378748 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
86388749 } else {
86398750 __Pyx_INCREF(__pyx_t_6);
8640 __pyx_t_4 = __pyx_t_6;
8751 __pyx_t_3 = __pyx_t_6;
86418752 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
86428753 goto __pyx_L4_bool_binop_done;
86438754 }
86458756 __Pyx_GOTREF(__pyx_t_6);
86468757 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
86478758 __Pyx_GOTREF(__pyx_t_5);
8648 __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error)
8759 __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L1_error)
86498760 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
86508761 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8651 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 336, __pyx_L1_error)
8762 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 336, __pyx_L1_error)
86528763 if (__pyx_t_2) {
8653 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8764 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
86548765 } else {
8655 __Pyx_INCREF(__pyx_t_3);
8656 __pyx_t_4 = __pyx_t_3;
8657 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8766 __Pyx_INCREF(__pyx_t_4);
8767 __pyx_t_3 = __pyx_t_4;
8768 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
86588769 goto __pyx_L4_bool_binop_done;
86598770 }
86608771
86658776 * other.left < self.right and other.top < self.bottom
86668777 *
86678778 */
8668 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error)
8669 __Pyx_GOTREF(__pyx_t_3);
8779 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error)
8780 __Pyx_GOTREF(__pyx_t_4);
86708781 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error)
86718782 __Pyx_GOTREF(__pyx_t_5);
8672 __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error)
8673 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8783 __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error)
8784 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
86748785 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
86758786 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
86768787 if (__pyx_t_2) {
86778788 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
86788789 } else {
86798790 __Pyx_INCREF(__pyx_t_6);
8680 __pyx_t_4 = __pyx_t_6;
8791 __pyx_t_3 = __pyx_t_6;
86818792 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
86828793 goto __pyx_L4_bool_binop_done;
86838794 }
86858796 __Pyx_GOTREF(__pyx_t_6);
86868797 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error)
86878798 __Pyx_GOTREF(__pyx_t_5);
8688 __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error)
8799 __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error)
86898800 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
86908801 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8691 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
8802 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
86928803 if (__pyx_t_2) {
8693 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8804 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
86948805 } else {
8695 __Pyx_INCREF(__pyx_t_3);
8696 __pyx_t_4 = __pyx_t_3;
8697 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8806 __Pyx_INCREF(__pyx_t_4);
8807 __pyx_t_3 = __pyx_t_4;
8808 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
86988809 goto __pyx_L4_bool_binop_done;
86998810 }
87008811
87058816 *
87068817 * def collidepoint(self, x, y=None):
87078818 */
8708 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 338, __pyx_L1_error)
8709 __Pyx_GOTREF(__pyx_t_3);
8819 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error)
8820 __Pyx_GOTREF(__pyx_t_4);
87108821 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 338, __pyx_L1_error)
87118822 __Pyx_GOTREF(__pyx_t_5);
8712 __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 338, __pyx_L1_error)
8713 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8823 __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 338, __pyx_L1_error)
8824 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
87148825 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
87158826 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 338, __pyx_L1_error)
87168827 if (__pyx_t_2) {
87178828 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
87188829 } else {
87198830 __Pyx_INCREF(__pyx_t_6);
8720 __pyx_t_4 = __pyx_t_6;
8831 __pyx_t_3 = __pyx_t_6;
87218832 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
87228833 goto __pyx_L4_bool_binop_done;
87238834 }
87258836 __Pyx_GOTREF(__pyx_t_6);
87268837 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 338, __pyx_L1_error)
87278838 __Pyx_GOTREF(__pyx_t_5);
8728 __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 338, __pyx_L1_error)
8839 __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error)
87298840 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
87308841 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8731 __Pyx_INCREF(__pyx_t_3);
8732 __pyx_t_4 = __pyx_t_3;
8733 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8842 __Pyx_INCREF(__pyx_t_4);
8843 __pyx_t_3 = __pyx_t_4;
8844 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
87348845 __pyx_L4_bool_binop_done:;
8735 __pyx_r = __pyx_t_4;
8736 __pyx_t_4 = 0;
8846 __pyx_r = __pyx_t_3;
8847 __pyx_t_3 = 0;
87378848 goto __pyx_L0;
87388849
87398850 /* "pygame_sdl2/rect.pyx":332
87848895 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
87858896 switch (pos_args) {
87868897 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8898 CYTHON_FALLTHROUGH;
87878899 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8900 CYTHON_FALLTHROUGH;
87888901 case 0: break;
87898902 default: goto __pyx_L5_argtuple_error;
87908903 }
87918904 kw_args = PyDict_Size(__pyx_kwds);
87928905 switch (pos_args) {
87938906 case 0:
8794 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
8907 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
87958908 else goto __pyx_L5_argtuple_error;
8909 CYTHON_FALLTHROUGH;
87968910 case 1:
87978911 if (kw_args > 0) {
8798 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y);
8912 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y);
87998913 if (value) { values[1] = value; kw_args--; }
88008914 }
88018915 }
88058919 } else {
88068920 switch (PyTuple_GET_SIZE(__pyx_args)) {
88078921 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8922 CYTHON_FALLTHROUGH;
88088923 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
88098924 break;
88108925 default: goto __pyx_L5_argtuple_error;
88618976 */
88628977 if ((likely(PyTuple_CheckExact(__pyx_v_x))) || (PyList_CheckExact(__pyx_v_x))) {
88638978 PyObject* sequence = __pyx_v_x;
8864 #if !CYTHON_COMPILING_IN_PYPY
8865 Py_ssize_t size = Py_SIZE(sequence);
8866 #else
8867 Py_ssize_t size = PySequence_Size(sequence);
8868 #endif
8979 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
88698980 if (unlikely(size != 2)) {
88708981 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
88718982 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
90629173 *
90639174 * return self.left < other.right and self.top < other.bottom and \
90649175 */
9065 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error)
9176 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_v_other); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error)
90669177 __Pyx_GOTREF(__pyx_t_3);
9067 __Pyx_INCREF(__pyx_v_other);
9068 __Pyx_GIVEREF(__pyx_v_other);
9069 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other);
9070 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 348, __pyx_L1_error)
9071 __Pyx_GOTREF(__pyx_t_4);
9072 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9073 __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_4);
9074 __pyx_t_4 = 0;
9178 __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3);
9179 __pyx_t_3 = 0;
90759180
90769181 /* "pygame_sdl2/rect.pyx":347
90779182 *
90909195 *
90919196 */
90929197 __Pyx_XDECREF(__pyx_r);
9093 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
9094 __Pyx_GOTREF(__pyx_t_3);
9198 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error)
9199 __Pyx_GOTREF(__pyx_t_4);
90959200 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error)
90969201 __Pyx_GOTREF(__pyx_t_5);
9097 __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error)
9098 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9202 __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error)
9203 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
90999204 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
91009205 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 350, __pyx_L1_error)
91019206 if (__pyx_t_2) {
91029207 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
91039208 } else {
91049209 __Pyx_INCREF(__pyx_t_6);
9105 __pyx_t_4 = __pyx_t_6;
9210 __pyx_t_3 = __pyx_t_6;
91069211 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
91079212 goto __pyx_L4_bool_binop_done;
91089213 }
91109215 __Pyx_GOTREF(__pyx_t_6);
91119216 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error)
91129217 __Pyx_GOTREF(__pyx_t_5);
9113 __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
9218 __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error)
91149219 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
91159220 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9116 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 350, __pyx_L1_error)
9221 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 350, __pyx_L1_error)
91179222 if (__pyx_t_2) {
9118 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9223 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
91199224 } else {
9120 __Pyx_INCREF(__pyx_t_3);
9121 __pyx_t_4 = __pyx_t_3;
9122 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9225 __Pyx_INCREF(__pyx_t_4);
9226 __pyx_t_3 = __pyx_t_4;
9227 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
91239228 goto __pyx_L4_bool_binop_done;
91249229 }
91259230
91309235 *
91319236 * def collidelist(self, other_list):
91329237 */
9133 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error)
9134 __Pyx_GOTREF(__pyx_t_3);
9238 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error)
9239 __Pyx_GOTREF(__pyx_t_4);
91359240 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error)
91369241 __Pyx_GOTREF(__pyx_t_5);
9137 __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error)
9138 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9242 __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error)
9243 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
91399244 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
91409245 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 351, __pyx_L1_error)
91419246 if (__pyx_t_2) {
91429247 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
91439248 } else {
91449249 __Pyx_INCREF(__pyx_t_6);
9145 __pyx_t_4 = __pyx_t_6;
9250 __pyx_t_3 = __pyx_t_6;
91469251 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
91479252 goto __pyx_L4_bool_binop_done;
91489253 }
91509255 __Pyx_GOTREF(__pyx_t_6);
91519256 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error)
91529257 __Pyx_GOTREF(__pyx_t_5);
9153 __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error)
9258 __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error)
91549259 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
91559260 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9156 __Pyx_INCREF(__pyx_t_3);
9157 __pyx_t_4 = __pyx_t_3;
9158 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9261 __Pyx_INCREF(__pyx_t_4);
9262 __pyx_t_3 = __pyx_t_4;
9263 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
91599264 __pyx_L4_bool_binop_done:;
9160 __pyx_r = __pyx_t_4;
9161 __pyx_t_4 = 0;
9265 __pyx_r = __pyx_t_3;
9266 __pyx_t_3 = 0;
91629267 goto __pyx_L0;
91639268
91649269 /* "pygame_sdl2/rect.pyx":346
92289333 * if self.colliderect(other):
92299334 * return n
92309335 */
9231 __pyx_t_1 = PyObject_Length(__pyx_v_other_list); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 354, __pyx_L1_error)
9336 __pyx_t_1 = PyObject_Length(__pyx_v_other_list); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 354, __pyx_L1_error)
92329337 __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
92339338 __Pyx_GOTREF(__pyx_t_2);
9234 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error)
9339 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error)
92359340 __Pyx_GOTREF(__pyx_t_3);
9236 __Pyx_GIVEREF(__pyx_t_2);
9237 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
9238 __pyx_t_2 = 0;
9239 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
9341 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9342 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
92409343 __Pyx_GOTREF(__pyx_t_2);
9241 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9242 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error)
9243 __Pyx_GOTREF(__pyx_t_3);
9244 __Pyx_GIVEREF(__pyx_t_2);
9245 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
9344 __Pyx_GIVEREF(__pyx_t_3);
9345 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
92469346 __Pyx_INCREF(__pyx_v_other_list);
92479347 __Pyx_GIVEREF(__pyx_v_other_list);
9248 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other_list);
9249 __pyx_t_2 = 0;
9250 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
9251 __Pyx_GOTREF(__pyx_t_2);
9252 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9253 if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
9254 __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
9348 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_other_list);
9349 __pyx_t_3 = 0;
9350 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error)
9351 __Pyx_GOTREF(__pyx_t_3);
9352 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9353 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
9354 __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = 0;
92559355 __pyx_t_4 = NULL;
92569356 } else {
9257 __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error)
9258 __Pyx_GOTREF(__pyx_t_3);
9259 __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 354, __pyx_L1_error)
9260 }
9261 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9357 __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
9358 __Pyx_GOTREF(__pyx_t_2);
9359 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 354, __pyx_L1_error)
9360 }
9361 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
92629362 for (;;) {
92639363 if (likely(!__pyx_t_4)) {
9264 if (likely(PyList_CheckExact(__pyx_t_3))) {
9265 if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break;
9364 if (likely(PyList_CheckExact(__pyx_t_2))) {
9365 if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
92669366 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9267 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 354, __pyx_L1_error)
9367 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 354, __pyx_L1_error)
92689368 #else
9269 __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
9270 __Pyx_GOTREF(__pyx_t_2);
9369 __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error)
9370 __Pyx_GOTREF(__pyx_t_3);
92719371 #endif
92729372 } else {
9273 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
9373 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
92749374 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9275 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 354, __pyx_L1_error)
9375 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 354, __pyx_L1_error)
92769376 #else
9277 __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
9278 __Pyx_GOTREF(__pyx_t_2);
9377 __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error)
9378 __Pyx_GOTREF(__pyx_t_3);
92799379 #endif
92809380 }
92819381 } else {
9282 __pyx_t_2 = __pyx_t_4(__pyx_t_3);
9283 if (unlikely(!__pyx_t_2)) {
9382 __pyx_t_3 = __pyx_t_4(__pyx_t_2);
9383 if (unlikely(!__pyx_t_3)) {
92849384 PyObject* exc_type = PyErr_Occurred();
92859385 if (exc_type) {
9286 if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9386 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
92879387 else __PYX_ERR(0, 354, __pyx_L1_error)
92889388 }
92899389 break;
92909390 }
9291 __Pyx_GOTREF(__pyx_t_2);
9292 }
9293 if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
9294 PyObject* sequence = __pyx_t_2;
9295 #if !CYTHON_COMPILING_IN_PYPY
9296 Py_ssize_t size = Py_SIZE(sequence);
9297 #else
9298 Py_ssize_t size = PySequence_Size(sequence);
9299 #endif
9391 __Pyx_GOTREF(__pyx_t_3);
9392 }
9393 if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
9394 PyObject* sequence = __pyx_t_3;
9395 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
93009396 if (unlikely(size != 2)) {
93019397 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
93029398 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
93189414 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error)
93199415 __Pyx_GOTREF(__pyx_t_6);
93209416 #endif
9321 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9417 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
93229418 } else {
93239419 Py_ssize_t index = -1;
9324 __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 354, __pyx_L1_error)
9420 __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 354, __pyx_L1_error)
93259421 __Pyx_GOTREF(__pyx_t_7);
9326 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9422 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
93279423 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
93289424 index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
93299425 __Pyx_GOTREF(__pyx_t_5);
93659461 }
93669462 }
93679463 if (!__pyx_t_5) {
9368 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_other); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L1_error)
9369 __Pyx_GOTREF(__pyx_t_2);
9464 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_other); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error)
9465 __Pyx_GOTREF(__pyx_t_3);
93709466 } else {
93719467 #if CYTHON_FAST_PYCALL
93729468 if (PyFunction_Check(__pyx_t_6)) {
93739469 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_other};
9374 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L1_error)
9470 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error)
93759471 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9376 __Pyx_GOTREF(__pyx_t_2);
9472 __Pyx_GOTREF(__pyx_t_3);
93779473 } else
93789474 #endif
93799475 #if CYTHON_FAST_PYCCALL
93809476 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
93819477 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_other};
9382 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L1_error)
9478 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error)
93839479 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9384 __Pyx_GOTREF(__pyx_t_2);
9480 __Pyx_GOTREF(__pyx_t_3);
93859481 } else
93869482 #endif
93879483 {
93919487 __Pyx_INCREF(__pyx_v_other);
93929488 __Pyx_GIVEREF(__pyx_v_other);
93939489 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_other);
9394 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L1_error)
9395 __Pyx_GOTREF(__pyx_t_2);
9490 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error)
9491 __Pyx_GOTREF(__pyx_t_3);
93969492 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
93979493 }
93989494 }
93999495 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9400 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 355, __pyx_L1_error)
9401 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9496 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 355, __pyx_L1_error)
9497 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
94029498 if (__pyx_t_9) {
94039499
94049500 /* "pygame_sdl2/rect.pyx":356
94119507 __Pyx_XDECREF(__pyx_r);
94129508 __Pyx_INCREF(__pyx_v_n);
94139509 __pyx_r = __pyx_v_n;
9414 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9510 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
94159511 goto __pyx_L0;
94169512
94179513 /* "pygame_sdl2/rect.pyx":355
94319527 * return n
94329528 */
94339529 }
9434 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9530 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
94359531
94369532 /* "pygame_sdl2/rect.pyx":357
94379533 * if self.colliderect(other):
95289624 * if self.colliderect(other):
95299625 * ret.append(n)
95309626 */
9531 __pyx_t_2 = PyObject_Length(__pyx_v_other_list); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 361, __pyx_L1_error)
9627 __pyx_t_2 = PyObject_Length(__pyx_v_other_list); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 361, __pyx_L1_error)
95329628 __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
95339629 __Pyx_GOTREF(__pyx_t_1);
9534 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error)
9630 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error)
95359631 __Pyx_GOTREF(__pyx_t_3);
9536 __Pyx_GIVEREF(__pyx_t_1);
9537 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
9538 __pyx_t_1 = 0;
9539 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
9632 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9633 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
95409634 __Pyx_GOTREF(__pyx_t_1);
9541 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9542 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error)
9543 __Pyx_GOTREF(__pyx_t_3);
9544 __Pyx_GIVEREF(__pyx_t_1);
9545 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
9635 __Pyx_GIVEREF(__pyx_t_3);
9636 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
95469637 __Pyx_INCREF(__pyx_v_other_list);
95479638 __Pyx_GIVEREF(__pyx_v_other_list);
9548 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_other_list);
9549 __pyx_t_1 = 0;
9550 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
9551 __Pyx_GOTREF(__pyx_t_1);
9552 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9553 if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
9554 __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0;
9639 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_other_list);
9640 __pyx_t_3 = 0;
9641 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error)
9642 __Pyx_GOTREF(__pyx_t_3);
9643 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9644 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
9645 __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
95559646 __pyx_t_4 = NULL;
95569647 } else {
9557 __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error)
9558 __Pyx_GOTREF(__pyx_t_3);
9559 __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
9560 }
9561 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9648 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
9649 __Pyx_GOTREF(__pyx_t_1);
9650 __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
9651 }
9652 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
95629653 for (;;) {
95639654 if (likely(!__pyx_t_4)) {
9564 if (likely(PyList_CheckExact(__pyx_t_3))) {
9565 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
9655 if (likely(PyList_CheckExact(__pyx_t_1))) {
9656 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
95669657 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9567 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
9658 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
95689659 #else
9569 __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
9570 __Pyx_GOTREF(__pyx_t_1);
9660 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error)
9661 __Pyx_GOTREF(__pyx_t_3);
95719662 #endif
95729663 } else {
9573 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
9664 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
95749665 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9575 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
9666 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
95769667 #else
9577 __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
9578 __Pyx_GOTREF(__pyx_t_1);
9668 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error)
9669 __Pyx_GOTREF(__pyx_t_3);
95799670 #endif
95809671 }
95819672 } else {
9582 __pyx_t_1 = __pyx_t_4(__pyx_t_3);
9583 if (unlikely(!__pyx_t_1)) {
9673 __pyx_t_3 = __pyx_t_4(__pyx_t_1);
9674 if (unlikely(!__pyx_t_3)) {
95849675 PyObject* exc_type = PyErr_Occurred();
95859676 if (exc_type) {
9586 if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9677 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
95879678 else __PYX_ERR(0, 361, __pyx_L1_error)
95889679 }
95899680 break;
95909681 }
9591 __Pyx_GOTREF(__pyx_t_1);
9592 }
9593 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
9594 PyObject* sequence = __pyx_t_1;
9595 #if !CYTHON_COMPILING_IN_PYPY
9596 Py_ssize_t size = Py_SIZE(sequence);
9597 #else
9598 Py_ssize_t size = PySequence_Size(sequence);
9599 #endif
9682 __Pyx_GOTREF(__pyx_t_3);
9683 }
9684 if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
9685 PyObject* sequence = __pyx_t_3;
9686 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
96009687 if (unlikely(size != 2)) {
96019688 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
96029689 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
96189705 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 361, __pyx_L1_error)
96199706 __Pyx_GOTREF(__pyx_t_6);
96209707 #endif
9621 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9708 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
96229709 } else {
96239710 Py_ssize_t index = -1;
9624 __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 361, __pyx_L1_error)
9711 __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 361, __pyx_L1_error)
96259712 __Pyx_GOTREF(__pyx_t_7);
9626 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9713 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
96279714 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
96289715 index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
96299716 __Pyx_GOTREF(__pyx_t_5);
96659752 }
96669753 }
96679754 if (!__pyx_t_5) {
9668 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_other); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
9669 __Pyx_GOTREF(__pyx_t_1);
9755 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_other); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error)
9756 __Pyx_GOTREF(__pyx_t_3);
96709757 } else {
96719758 #if CYTHON_FAST_PYCALL
96729759 if (PyFunction_Check(__pyx_t_6)) {
96739760 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_other};
9674 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
9761 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error)
96759762 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9676 __Pyx_GOTREF(__pyx_t_1);
9763 __Pyx_GOTREF(__pyx_t_3);
96779764 } else
96789765 #endif
96799766 #if CYTHON_FAST_PYCCALL
96809767 if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
96819768 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_other};
9682 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
9769 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error)
96839770 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9684 __Pyx_GOTREF(__pyx_t_1);
9771 __Pyx_GOTREF(__pyx_t_3);
96859772 } else
96869773 #endif
96879774 {
96919778 __Pyx_INCREF(__pyx_v_other);
96929779 __Pyx_GIVEREF(__pyx_v_other);
96939780 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_other);
9694 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
9695 __Pyx_GOTREF(__pyx_t_1);
9781 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error)
9782 __Pyx_GOTREF(__pyx_t_3);
96969783 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
96979784 }
96989785 }
96999786 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9700 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 362, __pyx_L1_error)
9701 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9787 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 362, __pyx_L1_error)
9788 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
97029789 if (__pyx_t_9) {
97039790
97049791 /* "pygame_sdl2/rect.pyx":363
97089795 * return ret
97099796 *
97109797 */
9711 __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_n); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 363, __pyx_L1_error)
9798 __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_n); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 363, __pyx_L1_error)
97129799
97139800 /* "pygame_sdl2/rect.pyx":362
97149801 * ret = []
97279814 * ret.append(n)
97289815 */
97299816 }
9730 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9817 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
97319818
97329819 /* "pygame_sdl2/rect.pyx":364
97339820 * if self.colliderect(other):
97929879 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
97939880 switch (pos_args) {
97949881 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9882 CYTHON_FALLTHROUGH;
97959883 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9884 CYTHON_FALLTHROUGH;
97969885 case 0: break;
97979886 default: goto __pyx_L5_argtuple_error;
97989887 }
97999888 kw_args = PyDict_Size(__pyx_kwds);
98009889 switch (pos_args) {
98019890 case 0:
9802 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_dict)) != 0)) kw_args--;
9891 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other_dict)) != 0)) kw_args--;
98039892 else goto __pyx_L5_argtuple_error;
9893 CYTHON_FALLTHROUGH;
98049894 case 1:
98059895 if (kw_args > 0) {
9806 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rects_values);
9896 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rects_values);
98079897 if (value) { values[1] = value; kw_args--; }
98089898 }
98099899 }
98139903 } else {
98149904 switch (PyTuple_GET_SIZE(__pyx_args)) {
98159905 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9906 CYTHON_FALLTHROUGH;
98169907 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
98179908 break;
98189909 default: goto __pyx_L5_argtuple_error;
98629953 */
98639954 __pyx_t_2 = 0;
98649955 if (unlikely(__pyx_v_other_dict == Py_None)) {
9865 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
9956 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
98669957 __PYX_ERR(0, 368, __pyx_L1_error)
98679958 }
98689959 __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_other_dict, 0, __pyx_n_s_iteritems, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error)
997710068 * def collidedictall(self, other_dict, rects_values=0):
997810069 */
997910070 __Pyx_XDECREF(__pyx_r);
9980 __Pyx_INCREF(Py_None);
9981 __pyx_r = Py_None;
10071 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
998210072 goto __pyx_L0;
998310073
998410074 /* "pygame_sdl2/rect.pyx":366
1003110121 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1003210122 switch (pos_args) {
1003310123 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10124 CYTHON_FALLTHROUGH;
1003410125 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10126 CYTHON_FALLTHROUGH;
1003510127 case 0: break;
1003610128 default: goto __pyx_L5_argtuple_error;
1003710129 }
1003810130 kw_args = PyDict_Size(__pyx_kwds);
1003910131 switch (pos_args) {
1004010132 case 0:
10041 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_other_dict)) != 0)) kw_args--;
10133 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other_dict)) != 0)) kw_args--;
1004210134 else goto __pyx_L5_argtuple_error;
10135 CYTHON_FALLTHROUGH;
1004310136 case 1:
1004410137 if (kw_args > 0) {
10045 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rects_values);
10138 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rects_values);
1004610139 if (value) { values[1] = value; kw_args--; }
1004710140 }
1004810141 }
1005210145 } else {
1005310146 switch (PyTuple_GET_SIZE(__pyx_args)) {
1005410147 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10148 CYTHON_FALLTHROUGH;
1005510149 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1005610150 break;
1005710151 default: goto __pyx_L5_argtuple_error;
1011510209 */
1011610210 __pyx_t_2 = 0;
1011710211 if (unlikely(__pyx_v_other_dict == Py_None)) {
10118 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
10212 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
1011910213 __PYX_ERR(0, 375, __pyx_L1_error)
1012010214 }
1012110215 __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_other_dict, 0, __pyx_n_s_iteritems, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error)
1020510299 __Pyx_INCREF(__pyx_v_val);
1020610300 __Pyx_GIVEREF(__pyx_v_val);
1020710301 PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_val);
10208 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_t_6); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 377, __pyx_L1_error)
10302 __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_t_6); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 377, __pyx_L1_error)
1020910303 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1021010304
1021110305 /* "pygame_sdl2/rect.pyx":376
1070310797 * rect.x, rect.y, rect.w, rect.h = rectlike
1070410798 * return 0
1070510799 */
10706 __pyx_t_8 = PyObject_Length(__pyx_v_rectlike); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 402, __pyx_L3_error)
10800 __pyx_t_8 = PyObject_Length(__pyx_v_rectlike); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 402, __pyx_L3_error)
1070710801 __pyx_t_5 = ((__pyx_t_8 == 4) != 0);
1070810802 if (__pyx_t_5) {
1070910803
1071610810 */
1071710811 if ((likely(PyTuple_CheckExact(__pyx_v_rectlike))) || (PyList_CheckExact(__pyx_v_rectlike))) {
1071810812 PyObject* sequence = __pyx_v_rectlike;
10719 #if !CYTHON_COMPILING_IN_PYPY
10720 Py_ssize_t size = Py_SIZE(sequence);
10721 #else
10722 Py_ssize_t size = PySequence_Size(sequence);
10723 #endif
10813 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
1072410814 if (unlikely(size != 4)) {
1072510815 if (size > 4) __Pyx_RaiseTooManyValuesError(4);
1072610816 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
1076010850 __Pyx_GOTREF(__pyx_t_12);
1076110851 __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
1076210852 for (index=0; index < 4; index++) {
10763 PyObject* item = __pyx_t_13(__pyx_t_12); if (unlikely(!item)) goto __pyx_L12_unpacking_failed;
10853 PyObject* item = __pyx_t_13(__pyx_t_12); if (unlikely(!item)) goto __pyx_L10_unpacking_failed;
1076410854 __Pyx_GOTREF(item);
1076510855 *(temps[index]) = item;
1076610856 }
1076710857 if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 4) < 0) __PYX_ERR(0, 403, __pyx_L3_error)
1076810858 __pyx_t_13 = NULL;
1076910859 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10770 goto __pyx_L13_unpacking_done;
10771 __pyx_L12_unpacking_failed:;
10860 goto __pyx_L11_unpacking_done;
10861 __pyx_L10_unpacking_failed:;
1077210862 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
1077310863 __pyx_t_13 = NULL;
1077410864 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
1077510865 __PYX_ERR(0, 403, __pyx_L3_error)
10776 __pyx_L13_unpacking_done:;
10866 __pyx_L11_unpacking_done:;
1077710867 }
1077810868 __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 403, __pyx_L3_error)
1077910869 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1081410904 * rect.x, rect.y = rectlike
1081510905 * rect.w, rect.h = rectlike
1081610906 */
10817 __pyx_t_8 = PyObject_Length(__pyx_v_rectlike); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 406, __pyx_L3_error)
10907 __pyx_t_8 = PyObject_Length(__pyx_v_rectlike); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 406, __pyx_L3_error)
1081810908 __pyx_t_5 = ((__pyx_t_8 == 2) != 0);
1081910909 if (__pyx_t_5) {
1082010910
1082710917 */
1082810918 if ((likely(PyTuple_CheckExact(__pyx_v_rectlike))) || (PyList_CheckExact(__pyx_v_rectlike))) {
1082910919 PyObject* sequence = __pyx_v_rectlike;
10830 #if !CYTHON_COMPILING_IN_PYPY
10831 Py_ssize_t size = Py_SIZE(sequence);
10832 #else
10833 Py_ssize_t size = PySequence_Size(sequence);
10834 #endif
10920 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
1083510921 if (unlikely(size != 2)) {
1083610922 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
1083710923 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
1085810944 __pyx_t_9 = PyObject_GetIter(__pyx_v_rectlike); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 407, __pyx_L3_error)
1085910945 __Pyx_GOTREF(__pyx_t_9);
1086010946 __pyx_t_13 = Py_TYPE(__pyx_t_9)->tp_iternext;
10861 index = 0; __pyx_t_11 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_11)) goto __pyx_L14_unpacking_failed;
10947 index = 0; __pyx_t_11 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_11)) goto __pyx_L12_unpacking_failed;
1086210948 __Pyx_GOTREF(__pyx_t_11);
10863 index = 1; __pyx_t_10 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_10)) goto __pyx_L14_unpacking_failed;
10949 index = 1; __pyx_t_10 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_10)) goto __pyx_L12_unpacking_failed;
1086410950 __Pyx_GOTREF(__pyx_t_10);
1086510951 if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_9), 2) < 0) __PYX_ERR(0, 407, __pyx_L3_error)
1086610952 __pyx_t_13 = NULL;
1086710953 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10868 goto __pyx_L15_unpacking_done;
10869 __pyx_L14_unpacking_failed:;
10954 goto __pyx_L13_unpacking_done;
10955 __pyx_L12_unpacking_failed:;
1087010956 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
1087110957 __pyx_t_13 = NULL;
1087210958 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
1087310959 __PYX_ERR(0, 407, __pyx_L3_error)
10874 __pyx_L15_unpacking_done:;
10960 __pyx_L13_unpacking_done:;
1087510961 }
1087610962 __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error)
1087710963 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
1088910975 */
1089010976 if ((likely(PyTuple_CheckExact(__pyx_v_rectlike))) || (PyList_CheckExact(__pyx_v_rectlike))) {
1089110977 PyObject* sequence = __pyx_v_rectlike;
10892 #if !CYTHON_COMPILING_IN_PYPY
10893 Py_ssize_t size = Py_SIZE(sequence);
10894 #else
10895 Py_ssize_t size = PySequence_Size(sequence);
10896 #endif
10978 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
1089710979 if (unlikely(size != 2)) {
1089810980 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
1089910981 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
1092011002 __pyx_t_9 = PyObject_GetIter(__pyx_v_rectlike); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 408, __pyx_L3_error)
1092111003 __Pyx_GOTREF(__pyx_t_9);
1092211004 __pyx_t_13 = Py_TYPE(__pyx_t_9)->tp_iternext;
10923 index = 0; __pyx_t_10 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_10)) goto __pyx_L16_unpacking_failed;
11005 index = 0; __pyx_t_10 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_10)) goto __pyx_L14_unpacking_failed;
1092411006 __Pyx_GOTREF(__pyx_t_10);
10925 index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_11)) goto __pyx_L16_unpacking_failed;
11007 index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_11)) goto __pyx_L14_unpacking_failed;
1092611008 __Pyx_GOTREF(__pyx_t_11);
1092711009 if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_9), 2) < 0) __PYX_ERR(0, 408, __pyx_L3_error)
1092811010 __pyx_t_13 = NULL;
1092911011 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10930 goto __pyx_L17_unpacking_done;
10931 __pyx_L16_unpacking_failed:;
11012 goto __pyx_L15_unpacking_done;
11013 __pyx_L14_unpacking_failed:;
1093211014 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
1093311015 __pyx_t_13 = NULL;
1093411016 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
1093511017 __PYX_ERR(0, 408, __pyx_L3_error)
10936 __pyx_L17_unpacking_done:;
11018 __pyx_L15_unpacking_done:;
1093711019 }
1093811020 __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L3_error)
1093911021 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
1097211054 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
1097311055 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
1097411056 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10975 goto __pyx_L10_try_end;
11057 goto __pyx_L8_try_end;
1097611058 __pyx_L3_error:;
10977 __Pyx_PyThreadState_assign
1097811059 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
1097911060 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
1098011061 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
1100111082 * if isinstance(rectlike, Rect):
1100211083 * rl = rectlike
1100311084 */
11004 __Pyx_PyThreadState_assign
1100511085 __Pyx_XGIVEREF(__pyx_t_1);
1100611086 __Pyx_XGIVEREF(__pyx_t_2);
1100711087 __Pyx_XGIVEREF(__pyx_t_3);
1100811088 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
1100911089 goto __pyx_L0;
1101011090 __pyx_L4_exception_handled:;
11011 __Pyx_PyThreadState_assign
1101211091 __Pyx_XGIVEREF(__pyx_t_1);
1101311092 __Pyx_XGIVEREF(__pyx_t_2);
1101411093 __Pyx_XGIVEREF(__pyx_t_3);
1101511094 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
11016 __pyx_L10_try_end:;
11095 __pyx_L8_try_end:;
1101711096 }
1101811097
1101911098 /* "pygame_sdl2/rect.pyx":414
1102411103 * else:
1102511104 */
1102611105 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_argname); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 414, __pyx_L1_error)
11027 if (__pyx_t_5) {
11106 if (unlikely(__pyx_t_5)) {
1102811107
1102911108 /* "pygame_sdl2/rect.pyx":415
1103011109 *
1107811157 }
1107911158 }
1108011159 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11081 __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 415, __pyx_L1_error)
11160 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 415, __pyx_L1_error)
1108211161 __Pyx_GOTREF(__pyx_t_10);
11083 __Pyx_GIVEREF(__pyx_t_11);
11084 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11);
11085 __pyx_t_11 = 0;
11086 __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 415, __pyx_L1_error)
11087 __Pyx_GOTREF(__pyx_t_11);
11162 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
11163 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
1108811164 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11089 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
11090 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
1109111165 __PYX_ERR(0, 415, __pyx_L1_error)
1109211166
1109311167 /* "pygame_sdl2/rect.pyx":414
1110511179 * raise TypeError("Argument must be a rect style object.") # <<<<<<<<<<<<<<
1110611180 */
1110711181 /*else*/ {
11108 __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 417, __pyx_L1_error)
11109 __Pyx_GOTREF(__pyx_t_11);
11110 __Pyx_Raise(__pyx_t_11, 0, 0, 0);
11111 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
11182 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 417, __pyx_L1_error)
11183 __Pyx_GOTREF(__pyx_t_10);
11184 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
11185 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
1111211186 __PYX_ERR(0, 417, __pyx_L1_error)
1111311187 }
1111411188
1114811222
1114911223 static void __pyx_tp_dealloc_11pygame_sdl2_4rect_Rect(PyObject *o) {
1115011224 struct __pyx_obj_11pygame_sdl2_4rect_Rect *p = (struct __pyx_obj_11pygame_sdl2_4rect_Rect *)o;
11151 #if PY_VERSION_HEX >= 0x030400a1
11152 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
11225 #if CYTHON_USE_TP_FINALIZE
11226 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
1115311227 if (PyObject_CallFinalizerFromDealloc(o)) return;
1115411228 }
1115511229 #endif
1161711691 };
1161811692
1161911693 #if PY_MAJOR_VERSION >= 3
11694 #if CYTHON_PEP489_MULTI_PHASE_INIT
11695 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
11696 static int __pyx_pymod_exec_rect(PyObject* module); /*proto*/
11697 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
11698 {Py_mod_create, (void*)__pyx_pymod_create},
11699 {Py_mod_exec, (void*)__pyx_pymod_exec_rect},
11700 {0, NULL}
11701 };
11702 #endif
11703
1162011704 static struct PyModuleDef __pyx_moduledef = {
11621 #if PY_VERSION_HEX < 0x03020000
11622 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
11623 #else
1162411705 PyModuleDef_HEAD_INIT,
11625 #endif
1162611706 "rect",
1162711707 0, /* m_doc */
11708 #if CYTHON_PEP489_MULTI_PHASE_INIT
11709 0, /* m_size */
11710 #else
1162811711 -1, /* m_size */
11712 #endif
1162911713 __pyx_methods /* m_methods */,
11714 #if CYTHON_PEP489_MULTI_PHASE_INIT
11715 __pyx_moduledef_slots, /* m_slots */
11716 #else
1163011717 NULL, /* m_reload */
11718 #endif
1163111719 NULL, /* m_traverse */
1163211720 NULL, /* m_clear */
1163311721 NULL /* m_free */
1163911727 {&__pyx_kp_u_Argument_must_be_a_rect_style_ob_2, __pyx_k_Argument_must_be_a_rect_style_ob_2, sizeof(__pyx_k_Argument_must_be_a_rect_style_ob_2), 0, 1, 0, 0},
1164011728 {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
1164111729 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
11730 {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
11731 {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0},
1164211732 {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
1164311733 {&__pyx_n_s_bottom, __pyx_k_bottom, sizeof(__pyx_k_bottom), 0, 0, 1, 1},
1164411734 {&__pyx_n_s_center, __pyx_k_center, sizeof(__pyx_k_center), 0, 0, 1, 1},
1164511735 {&__pyx_n_s_centerx, __pyx_k_centerx, sizeof(__pyx_k_centerx), 0, 0, 1, 1},
1164611736 {&__pyx_n_s_centery, __pyx_k_centery, sizeof(__pyx_k_centery), 0, 0, 1, 1},
1164711737 {&__pyx_n_s_clamp_ip, __pyx_k_clamp_ip, sizeof(__pyx_k_clamp_ip), 0, 0, 1, 1},
11738 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
1164811739 {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
1164911740 {&__pyx_n_s_colliderect, __pyx_k_colliderect, sizeof(__pyx_k_colliderect), 0, 0, 1, 1},
1165011741 {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
11742 {&__pyx_n_u_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 1, 0, 1},
1165111743 {&__pyx_n_s_flatten, __pyx_k_flatten, sizeof(__pyx_k_flatten), 0, 0, 1, 1},
1165211744 {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
1165311745 {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
1166211754 {&__pyx_n_s_other_dict, __pyx_k_other_dict, sizeof(__pyx_k_other_dict), 0, 0, 1, 1},
1166311755 {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1},
1166411756 {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
11665 {&__pyx_kp_u_rect_d_d_d_d, __pyx_k_rect_d_d_d_d, sizeof(__pyx_k_rect_d_d_d_d), 0, 1, 0, 0},
11757 {&__pyx_kp_u_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 1, 0, 0},
1166611758 {&__pyx_n_s_rects_values, __pyx_k_rects_values, sizeof(__pyx_k_rects_values), 0, 0, 1, 1},
1166711759 {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1},
1166811760 {&__pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_k_src_pygame_sdl2_rect_pyx, sizeof(__pyx_k_src_pygame_sdl2_rect_pyx), 0, 0, 1, 0},
1171011802 *
1171111803 * r = self.copy()
1171211804 */
11713 __pyx_tuple__2 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 263, __pyx_L1_error)
11714 __Pyx_GOTREF(__pyx_tuple__2);
11715 __Pyx_GIVEREF(__pyx_tuple__2);
11805 __pyx_tuple__4 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 263, __pyx_L1_error)
11806 __Pyx_GOTREF(__pyx_tuple__4);
11807 __Pyx_GIVEREF(__pyx_tuple__4);
1171611808
1171711809 /* "pygame_sdl2/rect.pyx":417
1171811810 * raise TypeError("Argument {} must be a rect style object.".format(argname))
1171911811 * else:
1172011812 * raise TypeError("Argument must be a rect style object.") # <<<<<<<<<<<<<<
1172111813 */
11722 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Argument_must_be_a_rect_style_ob); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 417, __pyx_L1_error)
11723 __Pyx_GOTREF(__pyx_tuple__3);
11724 __Pyx_GIVEREF(__pyx_tuple__3);
11814 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Argument_must_be_a_rect_style_ob); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 417, __pyx_L1_error)
11815 __Pyx_GOTREF(__pyx_tuple__5);
11816 __Pyx_GIVEREF(__pyx_tuple__5);
1172511817
1172611818 /* "pygame_sdl2/rect.pyx":22
1172711819 * import collections
1173011822 * if len(args) == 1:
1173111823 * return args[0]
1173211824 */
11733 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_args); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 22, __pyx_L1_error)
11734 __Pyx_GOTREF(__pyx_tuple__4);
11735 __Pyx_GIVEREF(__pyx_tuple__4);
11736 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_flatten, 22, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 22, __pyx_L1_error)
11825 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_args); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 22, __pyx_L1_error)
11826 __Pyx_GOTREF(__pyx_tuple__6);
11827 __Pyx_GIVEREF(__pyx_tuple__6);
11828 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_flatten, 22, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 22, __pyx_L1_error)
1173711829 __Pyx_RefNannyFinishContext();
1173811830 return 0;
1173911831 __pyx_L1_error:;
1175311845 return -1;
1175411846 }
1175511847
11848 static int __Pyx_modinit_global_init_code(void); /*proto*/
11849 static int __Pyx_modinit_variable_export_code(void); /*proto*/
11850 static int __Pyx_modinit_function_export_code(void); /*proto*/
11851 static int __Pyx_modinit_type_init_code(void); /*proto*/
11852 static int __Pyx_modinit_type_import_code(void); /*proto*/
11853 static int __Pyx_modinit_variable_import_code(void); /*proto*/
11854 static int __Pyx_modinit_function_import_code(void); /*proto*/
11855
11856 static int __Pyx_modinit_global_init_code(void) {
11857 __Pyx_RefNannyDeclarations
11858 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
11859 /*--- Global init code ---*/
11860 __Pyx_RefNannyFinishContext();
11861 return 0;
11862 }
11863
11864 static int __Pyx_modinit_variable_export_code(void) {
11865 __Pyx_RefNannyDeclarations
11866 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
11867 /*--- Variable export code ---*/
11868 __Pyx_RefNannyFinishContext();
11869 return 0;
11870 }
11871
11872 static int __Pyx_modinit_function_export_code(void) {
11873 __Pyx_RefNannyDeclarations
11874 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
11875 /*--- Function export code ---*/
11876 if (__Pyx_ExportFunction("to_sdl_rect", (void (*)(void))__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
11877 __Pyx_RefNannyFinishContext();
11878 return 0;
11879 __pyx_L1_error:;
11880 __Pyx_RefNannyFinishContext();
11881 return -1;
11882 }
11883
11884 static int __Pyx_modinit_type_init_code(void) {
11885 __Pyx_RefNannyDeclarations
11886 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
11887 /*--- Type init code ---*/
11888 if (PyType_Ready(&__pyx_type_11pygame_sdl2_4rect_Rect) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
11889 __pyx_type_11pygame_sdl2_4rect_Rect.tp_print = 0;
11890 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11pygame_sdl2_4rect_Rect.tp_dictoffset && __pyx_type_11pygame_sdl2_4rect_Rect.tp_getattro == PyObject_GenericGetAttr)) {
11891 __pyx_type_11pygame_sdl2_4rect_Rect.tp_getattro = __Pyx_PyObject_GenericGetAttr;
11892 }
11893 if (PyObject_SetAttrString(__pyx_m, "Rect", (PyObject *)&__pyx_type_11pygame_sdl2_4rect_Rect) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
11894 if (__pyx_type_11pygame_sdl2_4rect_Rect.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_4rect_Rect.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_4rect_Rect, __weakref__);
11895 __pyx_ptype_11pygame_sdl2_4rect_Rect = &__pyx_type_11pygame_sdl2_4rect_Rect;
11896 __Pyx_RefNannyFinishContext();
11897 return 0;
11898 __pyx_L1_error:;
11899 __Pyx_RefNannyFinishContext();
11900 return -1;
11901 }
11902
11903 static int __Pyx_modinit_type_import_code(void) {
11904 __Pyx_RefNannyDeclarations
11905 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
11906 /*--- Type import code ---*/
11907 __Pyx_RefNannyFinishContext();
11908 return 0;
11909 }
11910
11911 static int __Pyx_modinit_variable_import_code(void) {
11912 __Pyx_RefNannyDeclarations
11913 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
11914 /*--- Variable import code ---*/
11915 __Pyx_RefNannyFinishContext();
11916 return 0;
11917 }
11918
11919 static int __Pyx_modinit_function_import_code(void) {
11920 __Pyx_RefNannyDeclarations
11921 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
11922 /*--- Function import code ---*/
11923 __Pyx_RefNannyFinishContext();
11924 return 0;
11925 }
11926
11927
1175611928 #if PY_MAJOR_VERSION < 3
11757 PyMODINIT_FUNC initrect(void); /*proto*/
11758 PyMODINIT_FUNC initrect(void)
11929 #ifdef CYTHON_NO_PYINIT_EXPORT
11930 #define __Pyx_PyMODINIT_FUNC void
1175911931 #else
11760 PyMODINIT_FUNC PyInit_rect(void); /*proto*/
11761 PyMODINIT_FUNC PyInit_rect(void)
11932 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
11933 #endif
11934 #else
11935 #ifdef CYTHON_NO_PYINIT_EXPORT
11936 #define __Pyx_PyMODINIT_FUNC PyObject *
11937 #else
11938 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
11939 #endif
11940 #endif
11941 #ifndef CYTHON_SMALL_CODE
11942 #if defined(__clang__)
11943 #define CYTHON_SMALL_CODE
11944 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
11945 #define CYTHON_SMALL_CODE __attribute__((cold))
11946 #else
11947 #define CYTHON_SMALL_CODE
11948 #endif
11949 #endif
11950
11951
11952 #if PY_MAJOR_VERSION < 3
11953 __Pyx_PyMODINIT_FUNC initrect(void) CYTHON_SMALL_CODE; /*proto*/
11954 __Pyx_PyMODINIT_FUNC initrect(void)
11955 #else
11956 __Pyx_PyMODINIT_FUNC PyInit_rect(void) CYTHON_SMALL_CODE; /*proto*/
11957 __Pyx_PyMODINIT_FUNC PyInit_rect(void)
11958 #if CYTHON_PEP489_MULTI_PHASE_INIT
11959 {
11960 return PyModuleDef_Init(&__pyx_moduledef);
11961 }
11962 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
11963 PyObject *value = PyObject_GetAttrString(spec, from_name);
11964 int result = 0;
11965 if (likely(value)) {
11966 result = PyDict_SetItemString(moddict, to_name, value);
11967 Py_DECREF(value);
11968 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
11969 PyErr_Clear();
11970 } else {
11971 result = -1;
11972 }
11973 return result;
11974 }
11975 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
11976 PyObject *module = NULL, *moddict, *modname;
11977 if (__pyx_m)
11978 return __Pyx_NewRef(__pyx_m);
11979 modname = PyObject_GetAttrString(spec, "name");
11980 if (unlikely(!modname)) goto bad;
11981 module = PyModule_NewObject(modname);
11982 Py_DECREF(modname);
11983 if (unlikely(!module)) goto bad;
11984 moddict = PyModule_GetDict(module);
11985 if (unlikely(!moddict)) goto bad;
11986 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
11987 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
11988 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
11989 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
11990 return module;
11991 bad:
11992 Py_XDECREF(module);
11993 return NULL;
11994 }
11995
11996
11997 static int __pyx_pymod_exec_rect(PyObject *__pyx_pyinit_module)
11998 #endif
1176211999 #endif
1176312000 {
1176412001 PyObject *__pyx_t_1 = NULL;
1176512002 __Pyx_RefNannyDeclarations
12003 #if CYTHON_PEP489_MULTI_PHASE_INIT
12004 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
12005 #elif PY_MAJOR_VERSION >= 3
12006 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
12007 #endif
1176612008 #if CYTHON_REFNANNY
11767 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
11768 if (!__Pyx_RefNanny) {
11769 PyErr_Clear();
11770 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
11771 if (!__Pyx_RefNanny)
11772 Py_FatalError("failed to import 'refnanny' module");
11773 }
11774 #endif
11775 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_rect(void)", 0);
12009 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
12010 if (!__Pyx_RefNanny) {
12011 PyErr_Clear();
12012 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
12013 if (!__Pyx_RefNanny)
12014 Py_FatalError("failed to import 'refnanny' module");
12015 }
12016 #endif
12017 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_rect(void)", 0);
1177612018 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1177712019 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
1177812020 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
1178912031 #ifdef __Pyx_Generator_USED
1179012032 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1179112033 #endif
12034 #ifdef __Pyx_AsyncGen_USED
12035 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12036 #endif
1179212037 #ifdef __Pyx_StopAsyncIteration_USED
1179312038 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1179412039 #endif
1180012045 #endif
1180112046 #endif
1180212047 /*--- Module creation code ---*/
12048 #if CYTHON_PEP489_MULTI_PHASE_INIT
12049 __pyx_m = __pyx_pyinit_module;
12050 Py_INCREF(__pyx_m);
12051 #else
1180312052 #if PY_MAJOR_VERSION < 3
1180412053 __pyx_m = Py_InitModule4("rect", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
1180512054 #else
1180612055 __pyx_m = PyModule_Create(&__pyx_moduledef);
1180712056 #endif
1180812057 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
12058 #endif
1180912059 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
1181012060 Py_INCREF(__pyx_d);
1181112061 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
12062 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
1181212063 #if CYTHON_COMPILING_IN_PYPY
1181312064 Py_INCREF(__pyx_b);
1181412065 #endif
1183312084 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1183412085 /*--- Constants init code ---*/
1183512086 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
11836 /*--- Global init code ---*/
11837 /*--- Variable export code ---*/
11838 /*--- Function export code ---*/
11839 if (__Pyx_ExportFunction("to_sdl_rect", (void (*)(void))__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
11840 /*--- Type init code ---*/
11841 if (PyType_Ready(&__pyx_type_11pygame_sdl2_4rect_Rect) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
11842 __pyx_type_11pygame_sdl2_4rect_Rect.tp_print = 0;
11843 if (PyObject_SetAttrString(__pyx_m, "Rect", (PyObject *)&__pyx_type_11pygame_sdl2_4rect_Rect) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
11844 if (__pyx_type_11pygame_sdl2_4rect_Rect.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_4rect_Rect.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_4rect_Rect, __weakref__);
11845 __pyx_ptype_11pygame_sdl2_4rect_Rect = &__pyx_type_11pygame_sdl2_4rect_Rect;
11846 /*--- Type import code ---*/
11847 /*--- Variable import code ---*/
11848 /*--- Function import code ---*/
12087 /*--- Global type/function init code ---*/
12088 (void)__Pyx_modinit_global_init_code();
12089 (void)__Pyx_modinit_variable_export_code();
12090 if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error;
12091 if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
12092 (void)__Pyx_modinit_type_import_code();
12093 (void)__Pyx_modinit_variable_import_code();
12094 (void)__Pyx_modinit_function_import_code();
1184912095 /*--- Execution code ---*/
1185012096 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
1185112097 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1188012126 * # Copyright 2014 Patrick Dawson <pat@dw.is>
1188112127 * #
1188212128 */
11883 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
12129 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
1188412130 __Pyx_GOTREF(__pyx_t_1);
1188512131 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1188612132 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1189212138 __Pyx_XDECREF(__pyx_t_1);
1189312139 if (__pyx_m) {
1189412140 if (__pyx_d) {
11895 __Pyx_AddTraceback("init pygame_sdl2.rect", __pyx_clineno, __pyx_lineno, __pyx_filename);
12141 __Pyx_AddTraceback("init pygame_sdl2.rect", 0, __pyx_lineno, __pyx_filename);
1189612142 }
1189712143 Py_DECREF(__pyx_m); __pyx_m = 0;
1189812144 } else if (!PyErr_Occurred()) {
1190012146 }
1190112147 __pyx_L0:;
1190212148 __Pyx_RefNannyFinishContext();
11903 #if PY_MAJOR_VERSION < 3
12149 #if CYTHON_PEP489_MULTI_PHASE_INIT
12150 return (__pyx_m != NULL) ? 0 : -1;
12151 #elif PY_MAJOR_VERSION >= 3
12152 return __pyx_m;
12153 #else
1190412154 return;
11905 #else
11906 return __pyx_m;
1190712155 #endif
1190812156 }
1190912157
1192512173 }
1192612174 #endif
1192712175
12176 /* PyObjectGetAttrStr */
12177 #if CYTHON_USE_TYPE_SLOTS
12178 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
12179 PyTypeObject* tp = Py_TYPE(obj);
12180 if (likely(tp->tp_getattro))
12181 return tp->tp_getattro(obj, attr_name);
12182 #if PY_MAJOR_VERSION < 3
12183 if (likely(tp->tp_getattr))
12184 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
12185 #endif
12186 return PyObject_GetAttr(obj, attr_name);
12187 }
12188 #endif
12189
1192812190 /* GetBuiltinName */
1192912191 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
1193012192 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
1194012202 }
1194112203
1194212204 /* KeywordStringCheck */
11943 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
12205 static int __Pyx_CheckKeywordStrings(
1194412206 PyObject *kwdict,
1194512207 const char* function_name,
1194612208 int kw_allowed)
1195412216 #else
1195512217 while (PyDict_Next(kwdict, &pos, &key, 0)) {
1195612218 #if PY_MAJOR_VERSION < 3
11957 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
12219 if (unlikely(!PyString_Check(key)))
1195812220 #endif
1195912221 if (unlikely(!PyUnicode_Check(key)))
1196012222 goto invalid_keyword_type;
1198012242 }
1198112243
1198212244 /* GetItemInt */
11983 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
12245 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
1198412246 PyObject *r;
1198512247 if (!j) return NULL;
1198612248 r = PyObject_GetItem(o, j);
1199112253 CYTHON_NCP_UNUSED int wraparound,
1199212254 CYTHON_NCP_UNUSED int boundscheck) {
1199312255 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11994 if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
11995 if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
11996 PyObject *r = PyList_GET_ITEM(o, i);
12256 Py_ssize_t wrapped_i = i;
12257 if (wraparound & unlikely(i < 0)) {
12258 wrapped_i += PyList_GET_SIZE(o);
12259 }
12260 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
12261 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
1199712262 Py_INCREF(r);
1199812263 return r;
1199912264 }
1200612271 CYTHON_NCP_UNUSED int wraparound,
1200712272 CYTHON_NCP_UNUSED int boundscheck) {
1200812273 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12009 if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
12010 if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
12011 PyObject *r = PyTuple_GET_ITEM(o, i);
12274 Py_ssize_t wrapped_i = i;
12275 if (wraparound & unlikely(i < 0)) {
12276 wrapped_i += PyTuple_GET_SIZE(o);
12277 }
12278 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
12279 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
1201212280 Py_INCREF(r);
1201312281 return r;
1201412282 }
1206612334 PyErr_SetString(PyExc_SystemError, "Missing type object");
1206712335 return 0;
1206812336 }
12069 if (likely(PyObject_TypeCheck(obj, type)))
12337 if (likely(__Pyx_TypeCheck(obj, type)))
1207012338 return 1;
1207112339 PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
1207212340 Py_TYPE(obj)->tp_name, type->tp_name);
1208912357 /* IterFinish */
1209012358 static CYTHON_INLINE int __Pyx_IterFinish(void) {
1209112359 #if CYTHON_FAST_THREAD_STATE
12092 PyThreadState *tstate = PyThreadState_GET();
12360 PyThreadState *tstate = __Pyx_PyThreadState_Current;
1209312361 PyObject* exc_type = tstate->curexc_type;
1209412362 if (unlikely(exc_type)) {
12095 if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
12363 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
1209612364 PyObject *exc_value, *exc_tb;
1209712365 exc_value = tstate->curexc_value;
1209812366 exc_tb = tstate->curexc_traceback;
1229312561 "raise: exception class must be a subclass of BaseException");
1229412562 goto bad;
1229512563 }
12296 #if PY_VERSION_HEX >= 0x03030000
1229712564 if (cause) {
12298 #else
12299 if (cause && cause != Py_None) {
12300 #endif
1230112565 PyObject *fixed_cause;
1230212566 if (cause == Py_None) {
1230312567 fixed_cause = NULL;
1232512589 PyErr_Restore(tmp_type, tmp_value, tb);
1232612590 Py_XDECREF(tmp_tb);
1232712591 #else
12328 PyThreadState *tstate = PyThreadState_GET();
12592 PyThreadState *tstate = __Pyx_PyThreadState_Current;
1232912593 PyObject* tmp_tb = tstate->curexc_traceback;
1233012594 if (tb != tmp_tb) {
1233112595 Py_INCREF(tb);
1234012604 }
1234112605 #endif
1234212606
12343 /* ArgTypeTest */
12344 static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
12345 PyErr_Format(PyExc_TypeError,
12346 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
12347 name, type->tp_name, Py_TYPE(obj)->tp_name);
12348 }
12349 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
12350 const char *name, int exact)
12351 {
12352 if (unlikely(!type)) {
12353 PyErr_SetString(PyExc_SystemError, "Missing type object");
12354 return 0;
12355 }
12356 if (none_allowed && obj == Py_None) return 1;
12357 else if (exact) {
12358 if (likely(Py_TYPE(obj) == type)) return 1;
12359 #if PY_MAJOR_VERSION == 2
12360 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
12607 /* CIntToDigits */
12608 static const char DIGIT_PAIRS_10[2*10*10+1] = {
12609 "00010203040506070809"
12610 "10111213141516171819"
12611 "20212223242526272829"
12612 "30313233343536373839"
12613 "40414243444546474849"
12614 "50515253545556575859"
12615 "60616263646566676869"
12616 "70717273747576777879"
12617 "80818283848586878889"
12618 "90919293949596979899"
12619 };
12620 static const char DIGIT_PAIRS_8[2*8*8+1] = {
12621 "0001020304050607"
12622 "1011121314151617"
12623 "2021222324252627"
12624 "3031323334353637"
12625 "4041424344454647"
12626 "5051525354555657"
12627 "6061626364656667"
12628 "7071727374757677"
12629 };
12630 static const char DIGITS_HEX[2*16+1] = {
12631 "0123456789abcdef"
12632 "0123456789ABCDEF"
12633 };
12634
12635 /* BuildPyUnicode */
12636 static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
12637 int prepend_sign, char padding_char) {
12638 PyObject *uval;
12639 Py_ssize_t uoffset = ulength - clength;
12640 #if CYTHON_USE_UNICODE_INTERNALS
12641 Py_ssize_t i;
12642 #if CYTHON_PEP393_ENABLED
12643 void *udata;
12644 uval = PyUnicode_New(ulength, 127);
12645 if (unlikely(!uval)) return NULL;
12646 udata = PyUnicode_DATA(uval);
12647 #else
12648 Py_UNICODE *udata;
12649 uval = PyUnicode_FromUnicode(NULL, ulength);
12650 if (unlikely(!uval)) return NULL;
12651 udata = PyUnicode_AS_UNICODE(uval);
12652 #endif
12653 if (uoffset > 0) {
12654 i = 0;
12655 if (prepend_sign) {
12656 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
12657 i++;
12658 }
12659 for (; i < uoffset; i++) {
12660 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
12661 }
12662 }
12663 for (i=0; i < clength; i++) {
12664 __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
12665 }
12666 #else
12667 {
12668 uval = NULL;
12669 PyObject *sign = NULL, *padding = NULL;
12670 if (uoffset > 0) {
12671 prepend_sign = !!prepend_sign;
12672 if (uoffset > prepend_sign) {
12673 padding = PyUnicode_FromOrdinal(padding_char);
12674 if (likely(padding) && uoffset > prepend_sign + 1) {
12675 PyObject *tmp;
12676 PyObject *repeat = PyInt_FromSize_t(uoffset - prepend_sign);
12677 if (unlikely(!repeat)) goto done_or_error;
12678 tmp = PyNumber_Multiply(padding, repeat);
12679 Py_DECREF(repeat);
12680 Py_DECREF(padding);
12681 padding = tmp;
12682 }
12683 if (unlikely(!padding)) goto done_or_error;
12684 }
12685 if (prepend_sign) {
12686 sign = PyUnicode_FromOrdinal('-');
12687 if (unlikely(!sign)) goto done_or_error;
12688 }
12689 }
12690 uval = PyUnicode_DecodeASCII(chars, clength, NULL);
12691 if (likely(uval) && padding) {
12692 PyObject *tmp = PyNumber_Add(padding, uval);
12693 Py_DECREF(uval);
12694 uval = tmp;
12695 }
12696 if (likely(uval) && sign) {
12697 PyObject *tmp = PyNumber_Add(sign, uval);
12698 Py_DECREF(uval);
12699 uval = tmp;
12700 }
12701 done_or_error:
12702 Py_XDECREF(padding);
12703 Py_XDECREF(sign);
12704 }
12705 #endif
12706 return uval;
12707 }
12708
12709 /* CIntToPyUnicode */
12710 #ifdef _MSC_VER
12711 #ifndef _MSC_STDINT_H_
12712 #if _MSC_VER < 1300
12713 typedef unsigned short uint16_t;
12714 #else
12715 typedef unsigned __int16 uint16_t;
1236112716 #endif
12717 #endif
12718 #else
12719 #include <stdint.h>
12720 #endif
12721 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
12722 char digits[sizeof(int)*3+2];
12723 char *dpos, *end = digits + sizeof(int)*3+2;
12724 const char *hex_digits = DIGITS_HEX;
12725 Py_ssize_t length, ulength;
12726 int prepend_sign, last_one_off;
12727 int remaining;
12728 const int neg_one = (int) -1, const_zero = (int) 0;
12729 const int is_unsigned = neg_one > const_zero;
12730 if (format_char == 'X') {
12731 hex_digits += 16;
12732 format_char = 'x';
12733 }
12734 remaining = value;
12735 last_one_off = 0;
12736 dpos = end;
12737 do {
12738 int digit_pos;
12739 switch (format_char) {
12740 case 'o':
12741 digit_pos = abs((int)(remaining % (8*8)));
12742 remaining = (int) (remaining / (8*8));
12743 dpos -= 2;
12744 *(uint16_t*)dpos = ((uint16_t*)DIGIT_PAIRS_8)[digit_pos];
12745 last_one_off = (digit_pos < 8);
12746 break;
12747 case 'd':
12748 digit_pos = abs((int)(remaining % (10*10)));
12749 remaining = (int) (remaining / (10*10));
12750 dpos -= 2;
12751 *(uint16_t*)dpos = ((uint16_t*)DIGIT_PAIRS_10)[digit_pos];
12752 last_one_off = (digit_pos < 10);
12753 break;
12754 case 'x':
12755 *(--dpos) = hex_digits[abs((int)(remaining % 16))];
12756 remaining = (int) (remaining / 16);
12757 break;
12758 default:
12759 assert(0);
12760 break;
12761 }
12762 } while (unlikely(remaining != 0));
12763 if (last_one_off) {
12764 assert(*dpos == '0');
12765 dpos++;
12766 }
12767 length = end - dpos;
12768 ulength = length;
12769 prepend_sign = 0;
12770 if (!is_unsigned && value <= neg_one) {
12771 if (padding_char == ' ' || width <= length + 1) {
12772 *(--dpos) = '-';
12773 ++length;
12774 } else {
12775 prepend_sign = 1;
12776 }
12777 ++ulength;
12778 }
12779 if (width > ulength) {
12780 ulength = width;
12781 }
12782 if (ulength == 1) {
12783 return PyUnicode_FromOrdinal(*dpos);
12784 }
12785 return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
12786 }
12787
12788 /* JoinPyUnicode */
12789 static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
12790 CYTHON_UNUSED Py_UCS4 max_char) {
12791 #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12792 PyObject *result_uval;
12793 int result_ukind;
12794 Py_ssize_t i, char_pos;
12795 void *result_udata;
12796 #if CYTHON_PEP393_ENABLED
12797 result_uval = PyUnicode_New(result_ulength, max_char);
12798 if (unlikely(!result_uval)) return NULL;
12799 result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
12800 result_udata = PyUnicode_DATA(result_uval);
12801 #else
12802 result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
12803 if (unlikely(!result_uval)) return NULL;
12804 result_ukind = sizeof(Py_UNICODE);
12805 result_udata = PyUnicode_AS_UNICODE(result_uval);
12806 #endif
12807 char_pos = 0;
12808 for (i=0; i < value_count; i++) {
12809 int ukind;
12810 Py_ssize_t ulength;
12811 void *udata;
12812 PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
12813 if (unlikely(__Pyx_PyUnicode_READY(uval)))
12814 goto bad;
12815 ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
12816 if (unlikely(!ulength))
12817 continue;
12818 if (unlikely(char_pos + ulength < 0))
12819 goto overflow;
12820 ukind = __Pyx_PyUnicode_KIND(uval);
12821 udata = __Pyx_PyUnicode_DATA(uval);
12822 if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
12823 memcpy((char *)result_udata + char_pos * result_ukind, udata, (size_t) (ulength * result_ukind));
12824 } else {
12825 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
12826 _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
12827 #else
12828 Py_ssize_t j;
12829 for (j=0; j < ulength; j++) {
12830 Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
12831 __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
12832 }
12833 #endif
12834 }
12835 char_pos += ulength;
12836 }
12837 return result_uval;
12838 overflow:
12839 PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
12840 bad:
12841 Py_DECREF(result_uval);
12842 return NULL;
12843 #else
12844 result_ulength++;
12845 value_count++;
12846 return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
12847 #endif
12848 }
12849
12850 /* PyCFunctionFastCall */
12851 #if CYTHON_FAST_PYCCALL
12852 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
12853 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
12854 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
12855 PyObject *self = PyCFunction_GET_SELF(func);
12856 int flags = PyCFunction_GET_FLAGS(func);
12857 assert(PyCFunction_Check(func));
12858 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
12859 assert(nargs >= 0);
12860 assert(nargs == 0 || args != NULL);
12861 /* _PyCFunction_FastCallDict() must not be called with an exception set,
12862 because it may clear it (directly or indirectly) and so the
12863 caller loses its exception */
12864 assert(!PyErr_Occurred());
12865 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
12866 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
12867 } else {
12868 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
12869 }
12870 }
12871 #endif
12872
12873 /* PyFunctionFastCall */
12874 #if CYTHON_FAST_PYCALL
12875 #include "frameobject.h"
12876 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
12877 PyObject *globals) {
12878 PyFrameObject *f;
12879 PyThreadState *tstate = __Pyx_PyThreadState_Current;
12880 PyObject **fastlocals;
12881 Py_ssize_t i;
12882 PyObject *result;
12883 assert(globals != NULL);
12884 /* XXX Perhaps we should create a specialized
12885 PyFrame_New() that doesn't take locals, but does
12886 take builtins without sanity checking them.
12887 */
12888 assert(tstate != NULL);
12889 f = PyFrame_New(tstate, co, globals, NULL);
12890 if (f == NULL) {
12891 return NULL;
12892 }
12893 fastlocals = f->f_localsplus;
12894 for (i = 0; i < na; i++) {
12895 Py_INCREF(*args);
12896 fastlocals[i] = *args++;
12897 }
12898 result = PyEval_EvalFrameEx(f,0);
12899 ++tstate->recursion_depth;
12900 Py_DECREF(f);
12901 --tstate->recursion_depth;
12902 return result;
12903 }
12904 #if 1 || PY_VERSION_HEX < 0x030600B1
12905 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
12906 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
12907 PyObject *globals = PyFunction_GET_GLOBALS(func);
12908 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
12909 PyObject *closure;
12910 #if PY_MAJOR_VERSION >= 3
12911 PyObject *kwdefs;
12912 #endif
12913 PyObject *kwtuple, **k;
12914 PyObject **d;
12915 Py_ssize_t nd;
12916 Py_ssize_t nk;
12917 PyObject *result;
12918 assert(kwargs == NULL || PyDict_Check(kwargs));
12919 nk = kwargs ? PyDict_Size(kwargs) : 0;
12920 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
12921 return NULL;
12922 }
12923 if (
12924 #if PY_MAJOR_VERSION >= 3
12925 co->co_kwonlyargcount == 0 &&
12926 #endif
12927 likely(kwargs == NULL || nk == 0) &&
12928 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
12929 if (argdefs == NULL && co->co_argcount == nargs) {
12930 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
12931 goto done;
12932 }
12933 else if (nargs == 0 && argdefs != NULL
12934 && co->co_argcount == Py_SIZE(argdefs)) {
12935 /* function called with no arguments, but all parameters have
12936 a default value: use default values as arguments .*/
12937 args = &PyTuple_GET_ITEM(argdefs, 0);
12938 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
12939 goto done;
12940 }
12941 }
12942 if (kwargs != NULL) {
12943 Py_ssize_t pos, i;
12944 kwtuple = PyTuple_New(2 * nk);
12945 if (kwtuple == NULL) {
12946 result = NULL;
12947 goto done;
12948 }
12949 k = &PyTuple_GET_ITEM(kwtuple, 0);
12950 pos = i = 0;
12951 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
12952 Py_INCREF(k[i]);
12953 Py_INCREF(k[i+1]);
12954 i += 2;
12955 }
12956 nk = i / 2;
1236212957 }
1236312958 else {
12364 if (likely(PyObject_TypeCheck(obj, type))) return 1;
12365 }
12366 __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
12367 return 0;
12368 }
12959 kwtuple = NULL;
12960 k = NULL;
12961 }
12962 closure = PyFunction_GET_CLOSURE(func);
12963 #if PY_MAJOR_VERSION >= 3
12964 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
12965 #endif
12966 if (argdefs != NULL) {
12967 d = &PyTuple_GET_ITEM(argdefs, 0);
12968 nd = Py_SIZE(argdefs);
12969 }
12970 else {
12971 d = NULL;
12972 nd = 0;
12973 }
12974 #if PY_MAJOR_VERSION >= 3
12975 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
12976 args, nargs,
12977 k, (int)nk,
12978 d, (int)nd, kwdefs, closure);
12979 #else
12980 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
12981 args, nargs,
12982 k, (int)nk,
12983 d, (int)nd, closure);
12984 #endif
12985 Py_XDECREF(kwtuple);
12986 done:
12987 Py_LeaveRecursiveCall();
12988 return result;
12989 }
12990 #endif
12991 #endif
12992
12993 /* PyObjectCallMethO */
12994 #if CYTHON_COMPILING_IN_CPYTHON
12995 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
12996 PyObject *self, *result;
12997 PyCFunction cfunc;
12998 cfunc = PyCFunction_GET_FUNCTION(func);
12999 self = PyCFunction_GET_SELF(func);
13000 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
13001 return NULL;
13002 result = cfunc(self, arg);
13003 Py_LeaveRecursiveCall();
13004 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
13005 PyErr_SetString(
13006 PyExc_SystemError,
13007 "NULL result without error in PyObject_Call");
13008 }
13009 return result;
13010 }
13011 #endif
13012
13013 /* PyObjectCallOneArg */
13014 #if CYTHON_COMPILING_IN_CPYTHON
13015 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
13016 PyObject *result;
13017 PyObject *args = PyTuple_New(1);
13018 if (unlikely(!args)) return NULL;
13019 Py_INCREF(arg);
13020 PyTuple_SET_ITEM(args, 0, arg);
13021 result = __Pyx_PyObject_Call(func, args, NULL);
13022 Py_DECREF(args);
13023 return result;
13024 }
13025 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
13026 #if CYTHON_FAST_PYCALL
13027 if (PyFunction_Check(func)) {
13028 return __Pyx_PyFunction_FastCall(func, &arg, 1);
13029 }
13030 #endif
13031 if (likely(PyCFunction_Check(func))) {
13032 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
13033 return __Pyx_PyObject_CallMethO(func, arg);
13034 #if CYTHON_FAST_PYCCALL
13035 } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
13036 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
13037 #endif
13038 }
13039 }
13040 return __Pyx__PyObject_CallOneArg(func, arg);
13041 }
13042 #else
13043 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
13044 PyObject *result;
13045 PyObject *args = PyTuple_Pack(1, arg);
13046 if (unlikely(!args)) return NULL;
13047 result = __Pyx_PyObject_Call(func, args, NULL);
13048 Py_DECREF(args);
13049 return result;
13050 }
13051 #endif
13052
13053 /* ObjectGetItem */
13054 #if CYTHON_USE_TYPE_SLOTS
13055 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
13056 PyObject *runerr;
13057 Py_ssize_t key_value;
13058 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
13059 if (unlikely(!(m && m->sq_item))) {
13060 PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
13061 return NULL;
13062 }
13063 key_value = __Pyx_PyIndex_AsSsize_t(index);
13064 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
13065 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
13066 }
13067 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
13068 PyErr_Clear();
13069 PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
13070 }
13071 return NULL;
13072 }
13073 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
13074 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
13075 if (likely(m && m->mp_subscript)) {
13076 return m->mp_subscript(obj, key);
13077 }
13078 return __Pyx_PyObject_GetIndex(obj, key);
13079 }
13080 #endif
1236913081
1237013082 /* PyIntBinop */
12371 #if !CYTHON_COMPILING_IN_PYPY
13083 #if !CYTHON_COMPILING_IN_PYPY
1237213084 static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
1237313085 if (op1 == op2) {
1237413086 Py_RETURN_TRUE;
1240013112 a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
1240113113 break;
1240213114 }
13115 CYTHON_FALLTHROUGH;
1240313116 case 2:
1240413117 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
1240513118 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
1240613119 break;
1240713120 }
13121 CYTHON_FALLTHROUGH;
1240813122 case -3:
1240913123 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
1241013124 a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
1241113125 break;
1241213126 }
13127 CYTHON_FALLTHROUGH;
1241313128 case 3:
1241413129 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
1241513130 a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
1241613131 break;
1241713132 }
13133 CYTHON_FALLTHROUGH;
1241813134 case -4:
1241913135 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
1242013136 a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
1242113137 break;
1242213138 }
13139 CYTHON_FALLTHROUGH;
1242313140 case 4:
1242413141 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
1242513142 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
1242613143 break;
1242713144 }
13145 CYTHON_FALLTHROUGH;
1242813146 #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
1242913147 default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
1243013148 #else
1245213170 }
1245313171 #endif
1245413172
12455 /* PyCFunctionFastCall */
12456 #if CYTHON_FAST_PYCCALL
12457 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
12458 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
12459 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
12460 PyObject *self = PyCFunction_GET_SELF(func);
12461 assert(PyCFunction_Check(func));
12462 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
12463 assert(nargs >= 0);
12464 assert(nargs == 0 || args != NULL);
12465 /* _PyCFunction_FastCallDict() must not be called with an exception set,
12466 because it may clear it (directly or indirectly) and so the
12467 caller loses its exception */
12468 assert(!PyErr_Occurred());
12469 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
12470 }
12471 #endif // CYTHON_FAST_PYCCALL
12472
12473 /* PyFunctionFastCall */
12474 #if CYTHON_FAST_PYCALL
12475 #include "frameobject.h"
12476 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
12477 PyObject *globals) {
12478 PyFrameObject *f;
12479 PyThreadState *tstate = PyThreadState_GET();
12480 PyObject **fastlocals;
12481 Py_ssize_t i;
12482 PyObject *result;
12483 assert(globals != NULL);
12484 /* XXX Perhaps we should create a specialized
12485 PyFrame_New() that doesn't take locals, but does
12486 take builtins without sanity checking them.
12487 */
12488 assert(tstate != NULL);
12489 f = PyFrame_New(tstate, co, globals, NULL);
12490 if (f == NULL) {
12491 return NULL;
12492 }
12493 fastlocals = f->f_localsplus;
12494 for (i = 0; i < na; i++) {
12495 Py_INCREF(*args);
12496 fastlocals[i] = *args++;
12497 }
12498 result = PyEval_EvalFrameEx(f,0);
12499 ++tstate->recursion_depth;
12500 Py_DECREF(f);
12501 --tstate->recursion_depth;
12502 return result;
12503 }
12504 #if 1 || PY_VERSION_HEX < 0x030600B1
12505 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
12506 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
12507 PyObject *globals = PyFunction_GET_GLOBALS(func);
12508 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
12509 PyObject *closure;
12510 #if PY_MAJOR_VERSION >= 3
12511 PyObject *kwdefs;
12512 #endif
12513 PyObject *kwtuple, **k;
12514 PyObject **d;
12515 Py_ssize_t nd;
12516 Py_ssize_t nk;
12517 PyObject *result;
12518 assert(kwargs == NULL || PyDict_Check(kwargs));
12519 nk = kwargs ? PyDict_Size(kwargs) : 0;
12520 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
12521 return NULL;
12522 }
12523 if (
12524 #if PY_MAJOR_VERSION >= 3
12525 co->co_kwonlyargcount == 0 &&
12526 #endif
12527 likely(kwargs == NULL || nk == 0) &&
12528 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
12529 if (argdefs == NULL && co->co_argcount == nargs) {
12530 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
12531 goto done;
12532 }
12533 else if (nargs == 0 && argdefs != NULL
12534 && co->co_argcount == Py_SIZE(argdefs)) {
12535 /* function called with no arguments, but all parameters have
12536 a default value: use default values as arguments .*/
12537 args = &PyTuple_GET_ITEM(argdefs, 0);
12538 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
12539 goto done;
12540 }
12541 }
12542 if (kwargs != NULL) {
12543 Py_ssize_t pos, i;
12544 kwtuple = PyTuple_New(2 * nk);
12545 if (kwtuple == NULL) {
12546 result = NULL;
12547 goto done;
12548 }
12549 k = &PyTuple_GET_ITEM(kwtuple, 0);
12550 pos = i = 0;
12551 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
12552 Py_INCREF(k[i]);
12553 Py_INCREF(k[i+1]);
12554 i += 2;
12555 }
12556 nk = i / 2;
12557 }
12558 else {
12559 kwtuple = NULL;
12560 k = NULL;
12561 }
12562 closure = PyFunction_GET_CLOSURE(func);
12563 #if PY_MAJOR_VERSION >= 3
12564 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
12565 #endif
12566 if (argdefs != NULL) {
12567 d = &PyTuple_GET_ITEM(argdefs, 0);
12568 nd = Py_SIZE(argdefs);
12569 }
12570 else {
12571 d = NULL;
12572 nd = 0;
12573 }
12574 #if PY_MAJOR_VERSION >= 3
12575 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
12576 args, nargs,
12577 k, (int)nk,
12578 d, (int)nd, kwdefs, closure);
12579 #else
12580 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
12581 args, nargs,
12582 k, (int)nk,
12583 d, (int)nd, closure);
12584 #endif
12585 Py_XDECREF(kwtuple);
12586 done:
12587 Py_LeaveRecursiveCall();
12588 return result;
12589 }
12590 #endif // CPython < 3.6
12591 #endif // CYTHON_FAST_PYCALL
12592
12593 /* PyObjectCallMethO */
12594 #if CYTHON_COMPILING_IN_CPYTHON
12595 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
12596 PyObject *self, *result;
12597 PyCFunction cfunc;
12598 cfunc = PyCFunction_GET_FUNCTION(func);
12599 self = PyCFunction_GET_SELF(func);
12600 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
12601 return NULL;
12602 result = cfunc(self, arg);
12603 Py_LeaveRecursiveCall();
12604 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
12605 PyErr_SetString(
12606 PyExc_SystemError,
12607 "NULL result without error in PyObject_Call");
12608 }
12609 return result;
12610 }
12611 #endif
12612
12613 /* PyObjectCallOneArg */
12614 #if CYTHON_COMPILING_IN_CPYTHON
12615 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
12616 PyObject *result;
12617 PyObject *args = PyTuple_New(1);
12618 if (unlikely(!args)) return NULL;
12619 Py_INCREF(arg);
12620 PyTuple_SET_ITEM(args, 0, arg);
12621 result = __Pyx_PyObject_Call(func, args, NULL);
12622 Py_DECREF(args);
12623 return result;
12624 }
12625 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
12626 #if CYTHON_FAST_PYCALL
12627 if (PyFunction_Check(func)) {
12628 return __Pyx_PyFunction_FastCall(func, &arg, 1);
12629 }
12630 #endif
12631 #ifdef __Pyx_CyFunction_USED
12632 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
12633 #else
12634 if (likely(PyCFunction_Check(func))) {
12635 #endif
12636 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
12637 return __Pyx_PyObject_CallMethO(func, arg);
12638 #if CYTHON_FAST_PYCCALL
12639 } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
12640 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
12641 #endif
12642 }
12643 }
12644 return __Pyx__PyObject_CallOneArg(func, arg);
12645 }
12646 #else
12647 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
12648 PyObject *result;
12649 PyObject *args = PyTuple_Pack(1, arg);
12650 if (unlikely(!args)) return NULL;
12651 result = __Pyx_PyObject_Call(func, args, NULL);
12652 Py_DECREF(args);
12653 return result;
13173 /* PyObjectSetAttrStr */
13174 #if CYTHON_USE_TYPE_SLOTS
13175 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
13176 PyTypeObject* tp = Py_TYPE(obj);
13177 if (likely(tp->tp_setattro))
13178 return tp->tp_setattro(obj, attr_name, value);
13179 #if PY_MAJOR_VERSION < 3
13180 if (likely(tp->tp_setattr))
13181 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
13182 #endif
13183 return PyObject_SetAttr(obj, attr_name, value);
1265413184 }
1265513185 #endif
1265613186
1265713187 /* PyObjectCallNoArg */
12658 #if CYTHON_COMPILING_IN_CPYTHON
13188 #if CYTHON_COMPILING_IN_CPYTHON
1265913189 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
1266013190 #if CYTHON_FAST_PYCALL
1266113191 if (PyFunction_Check(func)) {
1266313193 }
1266413194 #endif
1266513195 #ifdef __Pyx_CyFunction_USED
12666 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
13196 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
1266713197 #else
1266813198 if (likely(PyCFunction_Check(func))) {
1266913199 #endif
1267613206 #endif
1267713207
1267813208 /* GetModuleGlobalName */
12679 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
13209 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
1268013210 PyObject *result;
1268113211 #if !CYTHON_AVOID_BORROWED_REFS
13212 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
13213 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
13214 if (likely(result)) {
13215 Py_INCREF(result);
13216 } else if (unlikely(PyErr_Occurred())) {
13217 result = NULL;
13218 } else {
13219 #else
1268213220 result = PyDict_GetItem(__pyx_d, name);
1268313221 if (likely(result)) {
1268413222 Py_INCREF(result);
1268513223 } else {
13224 #endif
1268613225 #else
1268713226 result = PyObject_GetItem(__pyx_d, name);
1268813227 if (!result) {
1269413233 }
1269513234
1269613235 /* RaiseDoubleKeywords */
12697 static void __Pyx_RaiseDoubleKeywordsError(
13236 static void __Pyx_RaiseDoubleKeywordsError(
1269813237 const char* func_name,
1269913238 PyObject* kw_name)
1270013239 {
1270813247 }
1270913248
1271013249 /* ParseKeywords */
12711 static int __Pyx_ParseOptionalKeywords(
13250 static int __Pyx_ParseOptionalKeywords(
1271213251 PyObject *kwds,
1271313252 PyObject **argnames[],
1271413253 PyObject *kwds2,
1281013349 }
1281113350
1281213351 /* RaiseArgTupleInvalid */
12813 static void __Pyx_RaiseArgtupleInvalid(
13352 static void __Pyx_RaiseArgtupleInvalid(
1281413353 const char* func_name,
1281513354 int exact,
1281613355 Py_ssize_t num_min,
1283613375 }
1283713376
1283813377 /* PyObjectCallMethod0 */
12839 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
13378 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
1284013379 PyObject *method, *result = NULL;
1284113380 method = __Pyx_PyObject_GetAttrStr(obj, method_name);
1284213381 if (unlikely(!method)) goto bad;
1285813397 }
1285913398
1286013399 /* RaiseNoneIterError */
12861 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
13400 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
1286213401 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
1286313402 }
1286413403
1286513404 /* UnpackTupleError */
12866 static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
13405 static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
1286713406 if (t == Py_None) {
1286813407 __Pyx_RaiseNoneNotIterableError();
1286913408 } else if (PyTuple_GET_SIZE(t) < index) {
1287413413 }
1287513414
1287613415 /* UnpackTuple2 */
12877 static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
12878 int is_tuple, int has_known_size, int decref_tuple) {
13416 static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
13417 PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
13418 PyObject *value1 = NULL, *value2 = NULL;
13419 #if CYTHON_COMPILING_IN_PYPY
13420 value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad;
13421 value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad;
13422 #else
13423 value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1);
13424 value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2);
13425 #endif
13426 if (decref_tuple) {
13427 Py_DECREF(tuple);
13428 }
13429 *pvalue1 = value1;
13430 *pvalue2 = value2;
13431 return 0;
13432 #if CYTHON_COMPILING_IN_PYPY
13433 bad:
13434 Py_XDECREF(value1);
13435 Py_XDECREF(value2);
13436 if (decref_tuple) { Py_XDECREF(tuple); }
13437 return -1;
13438 #endif
13439 }
13440 static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
13441 int has_known_size, int decref_tuple) {
1287913442 Py_ssize_t index;
1288013443 PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
12881 if (!is_tuple && unlikely(!PyTuple_Check(tuple))) {
12882 iternextfunc iternext;
12883 iter = PyObject_GetIter(tuple);
12884 if (unlikely(!iter)) goto bad;
12885 if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
12886 iternext = Py_TYPE(iter)->tp_iternext;
12887 value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
12888 value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
12889 if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
12890 Py_DECREF(iter);
12891 } else {
12892 if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) {
12893 __Pyx_UnpackTupleError(tuple, 2);
12894 goto bad;
12895 }
12896 #if CYTHON_COMPILING_IN_PYPY
12897 value1 = PySequence_ITEM(tuple, 0);
12898 if (unlikely(!value1)) goto bad;
12899 value2 = PySequence_ITEM(tuple, 1);
12900 if (unlikely(!value2)) goto bad;
12901 #else
12902 value1 = PyTuple_GET_ITEM(tuple, 0);
12903 value2 = PyTuple_GET_ITEM(tuple, 1);
12904 Py_INCREF(value1);
12905 Py_INCREF(value2);
12906 #endif
12907 if (decref_tuple) { Py_DECREF(tuple); }
12908 }
13444 iternextfunc iternext;
13445 iter = PyObject_GetIter(tuple);
13446 if (unlikely(!iter)) goto bad;
13447 if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
13448 iternext = Py_TYPE(iter)->tp_iternext;
13449 value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
13450 value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
13451 if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
13452 Py_DECREF(iter);
1290913453 *pvalue1 = value1;
1291013454 *pvalue2 = value2;
1291113455 return 0;
1292113465 }
1292213466
1292313467 /* dict_iter */
12924 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
13468 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
1292513469 Py_ssize_t* p_orig_length, int* p_source_is_dict) {
1292613470 is_dict = is_dict || likely(PyDict_CheckExact(iterable));
1292713471 *p_source_is_dict = is_dict;
13472 if (is_dict) {
1292813473 #if !CYTHON_COMPILING_IN_PYPY
12929 if (is_dict) {
1293013474 *p_orig_length = PyDict_Size(iterable);
1293113475 Py_INCREF(iterable);
1293213476 return iterable;
12933 }
12934 #endif
13477 #elif PY_MAJOR_VERSION >= 3
13478 static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
13479 PyObject **pp = NULL;
13480 if (method_name) {
13481 const char *name = PyUnicode_AsUTF8(method_name);
13482 if (strcmp(name, "iteritems") == 0) pp = &py_items;
13483 else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
13484 else if (strcmp(name, "itervalues") == 0) pp = &py_values;
13485 if (pp) {
13486 if (!*pp) {
13487 *pp = PyUnicode_FromString(name + 4);
13488 if (!*pp)
13489 return NULL;
13490 }
13491 method_name = *pp;
13492 }
13493 }
13494 #endif
13495 }
1293513496 *p_orig_length = 0;
1293613497 if (method_name) {
1293713498 PyObject* iter;
1301713578 }
1301813579
1301913580 /* SaveResetException */
13020 #if CYTHON_FAST_THREAD_STATE
13581 #if CYTHON_FAST_THREAD_STATE
1302113582 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
13583 #if PY_VERSION_HEX >= 0x030700A3
13584 *type = tstate->exc_state.exc_type;
13585 *value = tstate->exc_state.exc_value;
13586 *tb = tstate->exc_state.exc_traceback;
13587 #else
1302213588 *type = tstate->exc_type;
1302313589 *value = tstate->exc_value;
1302413590 *tb = tstate->exc_traceback;
13591 #endif
1302513592 Py_XINCREF(*type);
1302613593 Py_XINCREF(*value);
1302713594 Py_XINCREF(*tb);
1302813595 }
1302913596 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
1303013597 PyObject *tmp_type, *tmp_value, *tmp_tb;
13598 #if PY_VERSION_HEX >= 0x030700A3
13599 tmp_type = tstate->exc_state.exc_type;
13600 tmp_value = tstate->exc_state.exc_value;
13601 tmp_tb = tstate->exc_state.exc_traceback;
13602 tstate->exc_state.exc_type = type;
13603 tstate->exc_state.exc_value = value;
13604 tstate->exc_state.exc_traceback = tb;
13605 #else
1303113606 tmp_type = tstate->exc_type;
1303213607 tmp_value = tstate->exc_value;
1303313608 tmp_tb = tstate->exc_traceback;
1303413609 tstate->exc_type = type;
1303513610 tstate->exc_value = value;
1303613611 tstate->exc_traceback = tb;
13612 #endif
1303713613 Py_XDECREF(tmp_type);
1303813614 Py_XDECREF(tmp_value);
1303913615 Py_XDECREF(tmp_tb);
1304013616 }
1304113617 #endif
1304213618
13619 /* PyObject_GenericGetAttrNoDict */
13620 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
13621 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
13622 PyErr_Format(PyExc_AttributeError,
13623 #if PY_MAJOR_VERSION >= 3
13624 "'%.50s' object has no attribute '%U'",
13625 tp->tp_name, attr_name);
13626 #else
13627 "'%.50s' object has no attribute '%.400s'",
13628 tp->tp_name, PyString_AS_STRING(attr_name));
13629 #endif
13630 return NULL;
13631 }
13632 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
13633 PyObject *descr;
13634 PyTypeObject *tp = Py_TYPE(obj);
13635 if (unlikely(!PyString_Check(attr_name))) {
13636 return PyObject_GenericGetAttr(obj, attr_name);
13637 }
13638 assert(!tp->tp_dictoffset);
13639 descr = _PyType_Lookup(tp, attr_name);
13640 if (unlikely(!descr)) {
13641 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
13642 }
13643 Py_INCREF(descr);
13644 #if PY_MAJOR_VERSION < 3
13645 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
13646 #endif
13647 {
13648 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
13649 if (unlikely(f)) {
13650 PyObject *res = f(descr, obj, (PyObject *)tp);
13651 Py_DECREF(descr);
13652 return res;
13653 }
13654 }
13655 return descr;
13656 }
13657 #endif
13658
13659 /* PyObject_GenericGetAttr */
13660 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
13661 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
13662 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
13663 return PyObject_GenericGetAttr(obj, attr_name);
13664 }
13665 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
13666 }
13667 #endif
13668
1304313669 /* Import */
13044 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
13670 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
1304513671 PyObject *empty_list = 0;
1304613672 PyObject *module = 0;
1304713673 PyObject *global_dict = 0;
1304813674 PyObject *empty_dict = 0;
1304913675 PyObject *list;
13050 #if PY_VERSION_HEX < 0x03030000
13676 #if PY_MAJOR_VERSION < 3
1305113677 PyObject *py_import;
1305213678 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
1305313679 if (!py_import)
1307113697 #if PY_MAJOR_VERSION >= 3
1307213698 if (level == -1) {
1307313699 if (strchr(__Pyx_MODULE_NAME, '.')) {
13074 #if PY_VERSION_HEX < 0x03030000
13075 PyObject *py_level = PyInt_FromLong(1);
13076 if (!py_level)
13077 goto bad;
13078 module = PyObject_CallFunctionObjArgs(py_import,
13079 name, global_dict, empty_dict, list, py_level, NULL);
13080 Py_DECREF(py_level);
13081 #else
1308213700 module = PyImport_ImportModuleLevelObject(
1308313701 name, global_dict, empty_dict, list, 1);
13084 #endif
1308513702 if (!module) {
1308613703 if (!PyErr_ExceptionMatches(PyExc_ImportError))
1308713704 goto bad;
1309213709 }
1309313710 #endif
1309413711 if (!module) {
13095 #if PY_VERSION_HEX < 0x03030000
13712 #if PY_MAJOR_VERSION < 3
1309613713 PyObject *py_level = PyInt_FromLong(level);
1309713714 if (!py_level)
1309813715 goto bad;
1310613723 }
1310713724 }
1310813725 bad:
13109 #if PY_VERSION_HEX < 0x03030000
13726 #if PY_MAJOR_VERSION < 3
1311013727 Py_XDECREF(py_import);
1311113728 #endif
1311213729 Py_XDECREF(empty_list);
1311413731 return module;
1311513732 }
1311613733
13734 /* CLineInTraceback */
13735 #ifndef CYTHON_CLINE_IN_TRACEBACK
13736 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
13737 PyObject *use_cline;
13738 PyObject *ptype, *pvalue, *ptraceback;
13739 #if CYTHON_COMPILING_IN_CPYTHON
13740 PyObject **cython_runtime_dict;
13741 #endif
13742 if (unlikely(!__pyx_cython_runtime)) {
13743 return c_line;
13744 }
13745 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
13746 #if CYTHON_COMPILING_IN_CPYTHON
13747 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
13748 if (likely(cython_runtime_dict)) {
13749 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
13750 } else
13751 #endif
13752 {
13753 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
13754 if (use_cline_obj) {
13755 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
13756 Py_DECREF(use_cline_obj);
13757 } else {
13758 PyErr_Clear();
13759 use_cline = NULL;
13760 }
13761 }
13762 if (!use_cline) {
13763 c_line = 0;
13764 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
13765 }
13766 else if (PyObject_Not(use_cline) != 0) {
13767 c_line = 0;
13768 }
13769 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
13770 return c_line;
13771 }
13772 #endif
13773
1311713774 /* CodeObjectCache */
13118 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
13775 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
1311913776 int start = 0, mid = 0, end = count - 1;
1312013777 if (end >= 0 && code_line > entries[end].code_line) {
1312113778 return count;
1319513852 }
1319613853
1319713854 /* AddTraceback */
13198 #include "compile.h"
13855 #include "compile.h"
1319913856 #include "frameobject.h"
1320013857 #include "traceback.h"
1320113858 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
1325413911 int py_line, const char *filename) {
1325513912 PyCodeObject *py_code = 0;
1325613913 PyFrameObject *py_frame = 0;
13257 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
13914 PyThreadState *tstate = __Pyx_PyThreadState_Current;
13915 if (c_line) {
13916 c_line = __Pyx_CLineForTraceback(tstate, c_line);
13917 }
13918 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
1325813919 if (!py_code) {
1325913920 py_code = __Pyx_CreateCodeObjectForTraceback(
1326013921 funcname, c_line, py_line, filename);
1326113922 if (!py_code) goto bad;
13262 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
13923 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
1326313924 }
1326413925 py_frame = PyFrame_New(
13265 PyThreadState_GET(), /*PyThreadState *tstate,*/
13266 py_code, /*PyCodeObject *code,*/
13267 __pyx_d, /*PyObject *globals,*/
13268 0 /*PyObject *locals*/
13926 tstate, /*PyThreadState *tstate,*/
13927 py_code, /*PyCodeObject *code,*/
13928 __pyx_d, /*PyObject *globals,*/
13929 0 /*PyObject *locals*/
1326913930 );
1327013931 if (!py_frame) goto bad;
1327113932 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
1327613937 }
1327713938
1327813939 /* CIntFromPyVerify */
13279 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
13940 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
1328013941 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
1328113942 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
1328213943 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
1329813959 }
1329913960
1330013961 /* CIntToPy */
13301 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
13962 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
1330213963 const long neg_one = (long) -1, const_zero = (long) 0;
1330313964 const int is_unsigned = neg_one > const_zero;
1330413965 if (is_unsigned) {
1332913990 }
1333013991
1333113992 /* CIntToPy */
13332 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
13993 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
1333313994 const int neg_one = (int) -1, const_zero = (int) 0;
1333413995 const int is_unsigned = neg_one > const_zero;
1333513996 if (is_unsigned) {
1336014021 }
1336114022
1336214023 /* CIntFromPy */
13363 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
14024 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
1336414025 const int neg_one = (int) -1, const_zero = (int) 0;
1336514026 const int is_unsigned = neg_one > const_zero;
1336614027 #if PY_MAJOR_VERSION < 3
1354914210 }
1355014211
1355114212 /* CIntFromPy */
13552 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
14213 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
1355314214 const long neg_one = (long) -1, const_zero = (long) 0;
1355414215 const int is_unsigned = neg_one > const_zero;
1355514216 #if PY_MAJOR_VERSION < 3
1373714398 return (long) -1;
1373814399 }
1373914400
14401 /* FastTypeChecks */
14402 #if CYTHON_COMPILING_IN_CPYTHON
14403 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
14404 while (a) {
14405 a = a->tp_base;
14406 if (a == b)
14407 return 1;
14408 }
14409 return b == &PyBaseObject_Type;
14410 }
14411 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
14412 PyObject *mro;
14413 if (a == b) return 1;
14414 mro = a->tp_mro;
14415 if (likely(mro)) {
14416 Py_ssize_t i, n;
14417 n = PyTuple_GET_SIZE(mro);
14418 for (i = 0; i < n; i++) {
14419 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
14420 return 1;
14421 }
14422 return 0;
14423 }
14424 return __Pyx_InBases(a, b);
14425 }
14426 #if PY_MAJOR_VERSION == 2
14427 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
14428 PyObject *exception, *value, *tb;
14429 int res;
14430 __Pyx_PyThreadState_declare
14431 __Pyx_PyThreadState_assign
14432 __Pyx_ErrFetch(&exception, &value, &tb);
14433 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
14434 if (unlikely(res == -1)) {
14435 PyErr_WriteUnraisable(err);
14436 res = 0;
14437 }
14438 if (!res) {
14439 res = PyObject_IsSubclass(err, exc_type2);
14440 if (unlikely(res == -1)) {
14441 PyErr_WriteUnraisable(err);
14442 res = 0;
14443 }
14444 }
14445 __Pyx_ErrRestore(exception, value, tb);
14446 return res;
14447 }
14448 #else
14449 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
14450 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
14451 if (!res) {
14452 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
14453 }
14454 return res;
14455 }
14456 #endif
14457 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
14458 Py_ssize_t i, n;
14459 assert(PyExceptionClass_Check(exc_type));
14460 n = PyTuple_GET_SIZE(tuple);
14461 #if PY_MAJOR_VERSION >= 3
14462 for (i=0; i<n; i++) {
14463 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
14464 }
14465 #endif
14466 for (i=0; i<n; i++) {
14467 PyObject *t = PyTuple_GET_ITEM(tuple, i);
14468 #if PY_MAJOR_VERSION < 3
14469 if (likely(exc_type == t)) return 1;
14470 #endif
14471 if (likely(PyExceptionClass_Check(t))) {
14472 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
14473 } else {
14474 }
14475 }
14476 return 0;
14477 }
14478 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
14479 if (likely(err == exc_type)) return 1;
14480 if (likely(PyExceptionClass_Check(err))) {
14481 if (likely(PyExceptionClass_Check(exc_type))) {
14482 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
14483 } else if (likely(PyTuple_Check(exc_type))) {
14484 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
14485 } else {
14486 }
14487 }
14488 return PyErr_GivenExceptionMatches(err, exc_type);
14489 }
14490 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
14491 assert(PyExceptionClass_Check(exc_type1));
14492 assert(PyExceptionClass_Check(exc_type2));
14493 if (likely(err == exc_type1 || err == exc_type2)) return 1;
14494 if (likely(PyExceptionClass_Check(err))) {
14495 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
14496 }
14497 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
14498 }
14499 #endif
14500
1374014501 /* CheckBinaryVersion */
13741 static int __Pyx_check_binary_version(void) {
14502 static int __Pyx_check_binary_version(void) {
1374214503 char ctversion[4], rtversion[4];
1374314504 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
1374414505 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
1375414515 }
1375514516
1375614517 /* FunctionExport */
13757 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
14518 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
1375814519 PyObject *d = 0;
1375914520 PyObject *cobj = 0;
1376014521 union {
1379114552 }
1379214553
1379314554 /* InitStrings */
13794 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
14555 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
1379514556 while (t->p) {
1379614557 #if PY_MAJOR_VERSION < 3
1379714558 if (t->is_unicode) {
1381614577 #endif
1381714578 if (!*t->p)
1381814579 return -1;
14580 if (PyObject_Hash(*t->p) == -1)
14581 return -1;
1381914582 ++t;
1382014583 }
1382114584 return 0;
1382414587 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
1382514588 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
1382614589 }
13827 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
14590 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
1382814591 Py_ssize_t ignore;
1382914592 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
1383014593 }
13831 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
13832 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
14594 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
14595 #if !CYTHON_PEP393_ENABLED
14596 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
14597 char* defenc_c;
14598 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
14599 if (!defenc) return NULL;
14600 defenc_c = PyBytes_AS_STRING(defenc);
14601 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
14602 {
14603 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
14604 char* c;
14605 for (c = defenc_c; c < end; c++) {
14606 if ((unsigned char) (*c) >= 128) {
14607 PyUnicode_AsASCIIString(o);
14608 return NULL;
14609 }
14610 }
14611 }
14612 #endif
14613 *length = PyBytes_GET_SIZE(defenc);
14614 return defenc_c;
14615 }
14616 #else
14617 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
14618 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
14619 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
14620 if (likely(PyUnicode_IS_ASCII(o))) {
14621 *length = PyUnicode_GET_LENGTH(o);
14622 return PyUnicode_AsUTF8(o);
14623 } else {
14624 PyUnicode_AsASCIIString(o);
14625 return NULL;
14626 }
14627 #else
14628 return PyUnicode_AsUTF8AndSize(o, length);
14629 #endif
14630 }
14631 #endif
14632 #endif
14633 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
14634 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1383314635 if (
1383414636 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1383514637 __Pyx_sys_getdefaultencoding_not_ascii &&
1383614638 #endif
1383714639 PyUnicode_Check(o)) {
13838 #if PY_VERSION_HEX < 0x03030000
13839 char* defenc_c;
13840 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
13841 if (!defenc) return NULL;
13842 defenc_c = PyBytes_AS_STRING(defenc);
13843 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
13844 {
13845 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
13846 char* c;
13847 for (c = defenc_c; c < end; c++) {
13848 if ((unsigned char) (*c) >= 128) {
13849 PyUnicode_AsASCIIString(o);
13850 return NULL;
13851 }
13852 }
13853 }
13854 #endif
13855 *length = PyBytes_GET_SIZE(defenc);
13856 return defenc_c;
13857 #else
13858 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
13859 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
13860 if (PyUnicode_IS_ASCII(o)) {
13861 *length = PyUnicode_GET_LENGTH(o);
13862 return PyUnicode_AsUTF8(o);
13863 } else {
13864 PyUnicode_AsASCIIString(o);
13865 return NULL;
13866 }
13867 #else
13868 return PyUnicode_AsUTF8AndSize(o, length);
13869 #endif
13870 #endif
14640 return __Pyx_PyUnicode_AsStringAndSize(o, length);
1387114641 } else
1387214642 #endif
1387314643 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
1389114661 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
1389214662 else return PyObject_IsTrue(x);
1389314663 }
14664 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
14665 #if PY_MAJOR_VERSION >= 3
14666 if (PyLong_Check(result)) {
14667 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
14668 "__int__ returned non-int (type %.200s). "
14669 "The ability to return an instance of a strict subclass of int "
14670 "is deprecated, and may be removed in a future version of Python.",
14671 Py_TYPE(result)->tp_name)) {
14672 Py_DECREF(result);
14673 return NULL;
14674 }
14675 return result;
14676 }
14677 #endif
14678 PyErr_Format(PyExc_TypeError,
14679 "__%.4s__ returned non-%.4s (type %.200s)",
14680 type_name, type_name, Py_TYPE(result)->tp_name);
14681 Py_DECREF(result);
14682 return NULL;
14683 }
1389414684 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
1389514685 #if CYTHON_USE_TYPE_SLOTS
1389614686 PyNumberMethods *m;
1389814688 const char *name = NULL;
1389914689 PyObject *res = NULL;
1390014690 #if PY_MAJOR_VERSION < 3
13901 if (PyInt_Check(x) || PyLong_Check(x))
14691 if (likely(PyInt_Check(x) || PyLong_Check(x)))
1390214692 #else
13903 if (PyLong_Check(x))
14693 if (likely(PyLong_Check(x)))
1390414694 #endif
1390514695 return __Pyx_NewRef(x);
1390614696 #if CYTHON_USE_TYPE_SLOTS
1390814698 #if PY_MAJOR_VERSION < 3
1390914699 if (m && m->nb_int) {
1391014700 name = "int";
13911 res = PyNumber_Int(x);
14701 res = m->nb_int(x);
1391214702 }
1391314703 else if (m && m->nb_long) {
1391414704 name = "long";
13915 res = PyNumber_Long(x);
14705 res = m->nb_long(x);
1391614706 }
1391714707 #else
13918 if (m && m->nb_int) {
14708 if (likely(m && m->nb_int)) {
1391914709 name = "int";
13920 res = PyNumber_Long(x);
14710 res = m->nb_int(x);
1392114711 }
1392214712 #endif
1392314713 #else
13924 res = PyNumber_Int(x);
13925 #endif
13926 if (res) {
14714 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
14715 res = PyNumber_Int(x);
14716 }
14717 #endif
14718 if (likely(res)) {
1392714719 #if PY_MAJOR_VERSION < 3
13928 if (!PyInt_Check(res) && !PyLong_Check(res)) {
14720 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
1392914721 #else
13930 if (!PyLong_Check(res)) {
13931 #endif
13932 PyErr_Format(PyExc_TypeError,
13933 "__%.4s__ returned non-%.4s (type %.200s)",
13934 name, name, Py_TYPE(res)->tp_name);
13935 Py_DECREF(res);
13936 return NULL;
14722 if (unlikely(!PyLong_CheckExact(res))) {
14723 #endif
14724 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
1393714725 }
1393814726 }
1393914727 else if (!PyErr_Occurred()) {
1400414792 Py_DECREF(x);
1400514793 return ival;
1400614794 }
14795 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
14796 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
14797 }
1400714798 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
1400814799 return PyInt_FromSize_t(ival);
1400914800 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
88 #else
9 #define CYTHON_ABI "0_25_2"
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
102120 #define CYTHON_COMPILING_IN_CPYTHON 1
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
105129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412552
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
423555 #define __PYX_EXTERN_C extern "C"
428560
429561 #define __PYX_HAVE__pygame_sdl2__render
430562 #define __PYX_HAVE_API__pygame_sdl2__render
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
438571 #include <omp.h>
439572 #endif /* _OPENMP */
440573
441 #ifdef PYREX_WITHOUT_ASSERTIONS
574 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
442575 #define CYTHON_WITHOUT_ASSERTIONS
443576 #endif
444577
469602 #define __Pyx_sst_abs(value) abs(value)
470603 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
471604 #define __Pyx_sst_abs(value) labs(value)
472 #elif defined (_MSC_VER) && defined (_M_X64)
473 #define __Pyx_sst_abs(value) _abs64(value)
605 #elif defined (_MSC_VER)
606 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
474607 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
475608 #define __Pyx_sst_abs(value) llabs(value)
476609 #elif defined (__GNUC__)
478611 #else
479612 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
480613 #endif
481 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
482 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
614 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
615 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
483616 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
484617 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
485618 #define __Pyx_PyBytes_FromString PyBytes_FromString
492625 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
493626 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
494627 #endif
495 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
496 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
628 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
629 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
634 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
635 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
638 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
497639 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
498640 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
499641 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
500642 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
501643 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
502 #if PY_MAJOR_VERSION < 3
503 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
504 {
644 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
505645 const Py_UNICODE *u_end = u;
506646 while (*u_end++) ;
507647 return (size_t)(u_end - u - 1);
508648 }
509 #else
510 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
511 #endif
512649 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
513650 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
514651 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
515652 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
516653 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
517 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
654 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
518655 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
519656 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
657 #define __Pyx_PySequence_Tuple(obj)\
658 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
520659 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
521660 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
522661 #if CYTHON_ASSUME_SAFE_MACROS
615754 #define likely(x) (x)
616755 #define unlikely(x) (x)
617756 #endif /* __GNUC__ */
618
619 static PyObject *__pyx_m;
757 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
758
759 static PyObject *__pyx_m = NULL;
620760 static PyObject *__pyx_d;
621761 static PyObject *__pyx_b;
762 static PyObject *__pyx_cython_runtime = NULL;
622763 static PyObject *__pyx_empty_tuple;
623764 static PyObject *__pyx_empty_bytes;
624765 static PyObject *__pyx_empty_unicode;
630771
631772 static const char *__pyx_f[] = {
632773 "src/pygame_sdl2/render.pyx",
774 "stringsource",
633775 "src/pygame_sdl2/surface.pxd",
634776 "src/pygame_sdl2/display.pxd",
635777 "src/pygame_sdl2/rect.pxd",
636778 };
779 /* NoFastGil.proto */
780 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
781 #define __Pyx_PyGILState_Release PyGILState_Release
782 #define __Pyx_FastGIL_Remember()
783 #define __Pyx_FastGIL_Forget()
784 #define __Pyx_FastGilFuncInit()
785
786 /* ForceInitThreads.proto */
787 #ifndef __PYX_FORCE_INIT_THREADS
788 #define __PYX_FORCE_INIT_THREADS 0
789 #endif
790
637791
638792 /*--- Type declarations ---*/
639793 struct __pyx_obj_11pygame_sdl2_7surface_Surface;
9471101
9481102 /* PyObjectGetAttrStr.proto */
9491103 #if CYTHON_USE_TYPE_SLOTS
950 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
951 PyTypeObject* tp = Py_TYPE(obj);
952 if (likely(tp->tp_getattro))
953 return tp->tp_getattro(obj, attr_name);
954 #if PY_MAJOR_VERSION < 3
955 if (likely(tp->tp_getattr))
956 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
957 #endif
958 return PyObject_GetAttr(obj, attr_name);
959 }
1104 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
9601105 #else
9611106 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
9621107 #endif
10101155 /* PyThreadStateGet.proto */
10111156 #if CYTHON_FAST_THREAD_STATE
10121157 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1013 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
1158 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1159 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
10141160 #else
10151161 #define __Pyx_PyThreadState_declare
10161162 #define __Pyx_PyThreadState_assign
1163 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
10171164 #endif
10181165
10191166 /* PyErrFetchRestore.proto */
10201167 #if CYTHON_FAST_THREAD_STATE
1168 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
10211169 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
10221170 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
10231171 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
10241172 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
10251173 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
10261174 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1175 #if CYTHON_COMPILING_IN_CPYTHON
1176 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
10271177 #else
1178 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1179 #endif
1180 #else
1181 #define __Pyx_PyErr_Clear() PyErr_Clear()
1182 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
10281183 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
10291184 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1185 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1186 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
10301187 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
10311188 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
10321189 #endif
10561213 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
10571214
10581215 /* KeywordStringCheck.proto */
1059 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
1216 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
10601217
10611218 /* RaiseDoubleKeywords.proto */
10621219 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
10671224 const char* function_name);
10681225
10691226 /* ArgTypeTest.proto */
1070 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
1071 const char *name, int exact);
1227 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1228 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1229 __Pyx__ArgTypeTest(obj, type, name, exact))
1230 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1231
1232 /* DictGetItem.proto */
1233 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1234 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1235 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1236 (likely(PyDict_CheckExact(obj)) ?\
1237 __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1238 #else
1239 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1240 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1241 #endif
10721242
10731243 /* ExtTypeTest.proto */
10741244 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
10951265 static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
10961266
10971267 /* UnpackTuple2.proto */
1098 static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
1099 int is_tuple, int has_known_size, int decref_tuple);
1268 #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
1269 (likely(is_tuple || PyTuple_Check(tuple)) ?\
1270 (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
1271 __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
1272 (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
1273 __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
1274 static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
1275 PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
1276 static int __Pyx_unpack_tuple2_generic(
1277 PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);
11001278
11011279 /* dict_iter.proto */
11021280 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
11221300 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
11231301 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
11241302 int wraparound, int boundscheck);
1125 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1303 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
11261304 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
11271305 int is_list, int wraparound, int boundscheck);
11281306
1307 /* ObjectGetItem.proto */
1308 #if CYTHON_USE_TYPE_SLOTS
1309 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1310 #else
1311 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1312 #endif
1313
1314 /* PyErrExceptionMatches.proto */
1315 #if CYTHON_FAST_THREAD_STATE
1316 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1317 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1318 #else
1319 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1320 #endif
1321
1322 /* GetAttr.proto */
1323 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1324
1325 /* GetAttr3.proto */
1326 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1327
1328 /* Import.proto */
1329 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1330
1331 /* ImportFrom.proto */
1332 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1333
1334 /* HasAttr.proto */
1335 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1336
1337 /* PyObject_GenericGetAttrNoDict.proto */
1338 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1339 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1340 #else
1341 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1342 #endif
1343
1344 /* PyObject_GenericGetAttr.proto */
1345 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1346 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1347 #else
1348 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1349 #endif
1350
11291351 /* SetVTable.proto */
11301352 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
11311353
1354 /* SetupReduce.proto */
1355 static int __Pyx_setup_reduce(PyObject* type_obj);
1356
11321357 /* GetVTable.proto */
11331358 static void* __Pyx_GetVtable(PyObject *dict);
11341359
1135 /* Import.proto */
1136 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1137
1138 /* ImportFrom.proto */
1139 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1360 /* CLineInTraceback.proto */
1361 #ifdef CYTHON_CLINE_IN_TRACEBACK
1362 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1363 #else
1364 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1365 #endif
11401366
11411367 /* CodeObjectCache.proto */
11421368 typedef struct {
11631389 /* CIntToPy.proto */
11641390 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
11651391
1166 /* ForceInitThreads.proto */
1167 #ifndef __PYX_FORCE_INIT_THREADS
1168 #define __PYX_FORCE_INIT_THREADS 0
1169 #endif
1170
11711392 /* CIntToPy.proto */
11721393 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
11731394
11751396 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value);
11761397
11771398 /* CIntFromPy.proto */
1399 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1400
1401 /* CIntFromPy.proto */
11781402 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
11791403
11801404 /* CIntFromPy.proto */
11811405 static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *);
11821406
1183 /* CIntFromPy.proto */
1184 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1407 /* FastTypeChecks.proto */
1408 #if CYTHON_COMPILING_IN_CPYTHON
1409 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1410 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1411 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1412 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1413 #else
1414 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1415 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1416 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1417 #endif
1418 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
11851419
11861420 /* CheckBinaryVersion.proto */
11871421 static int __Pyx_check_binary_version(void);
12501484 static PyTypeObject *__pyx_ptype_11pygame_sdl2_6render_Container = 0;
12511485 static int __pyx_v_11pygame_sdl2_6render_DEBUG_DRAW_BBOX;
12521486 static PyObject *__pyx_f_11pygame_sdl2_6render_rinfo_to_dict(SDL_RendererInfo *); /*proto*/
1487 static PyObject *__pyx_f_11pygame_sdl2_6render___pyx_unpickle_TextureAtlas__set_state(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *, PyObject *); /*proto*/
12531488 #define __Pyx_MODULE_NAME "pygame_sdl2.render"
1489 extern int __pyx_module_is_main_pygame_sdl2__render;
12541490 int __pyx_module_is_main_pygame_sdl2__render = 0;
12551491
12561492 /* Implementation of 'pygame_sdl2.render' */
12571493 static PyObject *__pyx_builtin_range;
1494 static PyObject *__pyx_builtin_TypeError;
12581495 static PyObject *__pyx_builtin_ValueError;
12591496 static PyObject *__pyx_builtin_open;
12601497 static const char __pyx_k_a[] = "a";
12721509 static const char __pyx_k_x2[] = "x2";
12731510 static const char __pyx_k_y1[] = "y1";
12741511 static const char __pyx_k_y2[] = "y2";
1512 static const char __pyx_k_new[] = "__new__";
12751513 static const char __pyx_k_pos[] = "pos";
12761514 static const char __pyx_k_ren[] = "ren";
12771515 static const char __pyx_k_rtt[] = "rtt";
12781516 static const char __pyx_k_tex[] = "tex";
12791517 static const char __pyx_k_Rect[] = "Rect";
12801518 static const char __pyx_k_dest[] = "dest";
1519 static const char __pyx_k_dict[] = "__dict__";
12811520 static const char __pyx_k_info[] = "info";
12821521 static const char __pyx_k_json[] = "json";
12831522 static const char __pyx_k_keys[] = "keys";
13011540 static const char __pyx_k_driver[] = "driver";
13021541 static const char __pyx_k_frames[] = "frames";
13031542 static const char __pyx_k_import[] = "__import__";
1543 static const char __pyx_k_name_2[] = "__name__";
1544 static const char __pyx_k_pickle[] = "pickle";
1545 static const char __pyx_k_reduce[] = "__reduce__";
13041546 static const char __pyx_k_render[] = "render";
1547 static const char __pyx_k_update[] = "update";
13051548 static const char __pyx_k_window[] = "window";
13061549 static const char __pyx_k_rotated[] = "rotated";
1550 static const char __pyx_k_getstate[] = "__getstate__";
1551 static const char __pyx_k_pyx_type[] = "__pyx_type";
1552 static const char __pyx_k_setstate[] = "__setstate__";
13071553 static const char __pyx_k_software[] = "software";
13081554 static const char __pyx_k_warnings[] = "warnings";
1555 static const char __pyx_k_TypeError[] = "TypeError";
13091556 static const char __pyx_k_iteritems[] = "iteritems";
1557 static const char __pyx_k_pyx_state[] = "__pyx_state";
1558 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
13101559 static const char __pyx_k_ValueError[] = "ValueError";
1560 static const char __pyx_k_pyx_result[] = "__pyx_result";
13111561 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
13121562 static const char __pyx_k_sourceSize[] = "sourceSize";
1563 static const char __pyx_k_PickleError[] = "PickleError";
13131564 static const char __pyx_k_accelerated[] = "accelerated";
13141565 static const char __pyx_k_get_drivers[] = "get_drivers";
13151566 static const char __pyx_k_num_drivers[] = "num_drivers";
13161567 static const char __pyx_k_load_texture[] = "load_texture";
1568 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
1569 static const char __pyx_k_stringsource[] = "stringsource";
13171570 static const char __pyx_k_BLENDMODE_ADD[] = "BLENDMODE_ADD";
13181571 static const char __pyx_k_BLENDMODE_MOD[] = "BLENDMODE_MOD";
1572 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
13191573 static const char __pyx_k_BLENDMODE_NONE[] = "BLENDMODE_NONE";
13201574 static const char __pyx_k_BLENDMODE_BLEND[] = "BLENDMODE_BLEND";
1575 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
1576 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
13211577 static const char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect";
13221578 static const char __pyx_k_spriteSourceSize[] = "spriteSourceSize";
13231579 static const char __pyx_k_max_texture_width[] = "max_texture_width";
13241580 static const char __pyx_k_pygame_sdl2_color[] = "pygame_sdl2.color";
13251581 static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error";
13261582 static const char __pyx_k_Invalid_argument_s[] = "Invalid argument: %s";
1583 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
13271584 static const char __pyx_k_max_texture_height[] = "max_texture_height";
13281585 static const char __pyx_k_pygame_sdl2_render[] = "pygame_sdl2.render";
1586 static const char __pyx_k_pyx_unpickle_TextureAtlas[] = "__pyx_unpickle_TextureAtlas";
13291587 static const char __pyx_k_Rotation_not_supported_yet[] = "Rotation not supported yet.";
13301588 static const char __pyx_k_src_pygame_sdl2_render_pyx[] = "src/pygame_sdl2/render.pyx";
13311589 static const char __pyx_k_Renderer_is_not_accelerated[] = "Renderer is not accelerated.";
1590 static const char __pyx_k_Pickling_of_struct_members_such[] = "Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)";
1591 static const char __pyx_k_Incompatible_checksums_s_vs_0xdc[] = "Incompatible checksums (%s vs 0xdcdc1ac = (frames))";
1592 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
1593 static const char __pyx_k_Pickling_of_struct_members_such_2[] = "Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)";
1594 static const char __pyx_k_Pickling_of_struct_members_such_3[] = "Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)";
13321595 static PyObject *__pyx_n_s_BLENDMODE_ADD;
13331596 static PyObject *__pyx_n_s_BLENDMODE_BLEND;
13341597 static PyObject *__pyx_n_s_BLENDMODE_MOD;
13351598 static PyObject *__pyx_n_s_BLENDMODE_NONE;
13361599 static PyObject *__pyx_n_s_Color;
1600 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xdc;
13371601 static PyObject *__pyx_kp_u_Invalid_argument_s;
1602 static PyObject *__pyx_n_s_PickleError;
1603 static PyObject *__pyx_kp_s_Pickling_of_struct_members_such;
1604 static PyObject *__pyx_kp_s_Pickling_of_struct_members_such_2;
1605 static PyObject *__pyx_kp_s_Pickling_of_struct_members_such_3;
13381606 static PyObject *__pyx_n_s_Rect;
13391607 static PyObject *__pyx_kp_u_Renderer_is_not_accelerated;
13401608 static PyObject *__pyx_kp_u_Rotation_not_supported_yet;
1609 static PyObject *__pyx_n_s_TypeError;
13411610 static PyObject *__pyx_n_s_ValueError;
13421611 static PyObject *__pyx_n_s_a;
13431612 static PyObject *__pyx_n_u_accelerated;
13441613 static PyObject *__pyx_n_s_b;
1614 static PyObject *__pyx_n_s_cline_in_traceback;
13451615 static PyObject *__pyx_n_s_color;
13461616 static PyObject *__pyx_n_s_dest;
1617 static PyObject *__pyx_n_s_dict;
13471618 static PyObject *__pyx_n_s_driver;
13481619 static PyObject *__pyx_n_s_error;
13491620 static PyObject *__pyx_n_s_fi;
13511622 static PyObject *__pyx_n_u_frames;
13521623 static PyObject *__pyx_n_s_g;
13531624 static PyObject *__pyx_n_s_get_drivers;
1625 static PyObject *__pyx_n_s_getstate;
13541626 static PyObject *__pyx_n_s_h;
13551627 static PyObject *__pyx_n_u_h;
13561628 static PyObject *__pyx_n_u_image;
13671639 static PyObject *__pyx_n_u_meta;
13681640 static PyObject *__pyx_n_s_n;
13691641 static PyObject *__pyx_n_u_name;
1642 static PyObject *__pyx_n_s_name_2;
1643 static PyObject *__pyx_n_s_new;
1644 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
13701645 static PyObject *__pyx_n_s_nodes;
13711646 static PyObject *__pyx_n_s_num_drivers;
13721647 static PyObject *__pyx_n_s_open;
1648 static PyObject *__pyx_n_s_pickle;
13731649 static PyObject *__pyx_n_s_pos;
13741650 static PyObject *__pyx_n_s_pygame_sdl2_color;
13751651 static PyObject *__pyx_n_s_pygame_sdl2_error;
13761652 static PyObject *__pyx_n_s_pygame_sdl2_rect;
13771653 static PyObject *__pyx_n_s_pygame_sdl2_render;
1654 static PyObject *__pyx_n_s_pyx_PickleError;
1655 static PyObject *__pyx_n_s_pyx_checksum;
1656 static PyObject *__pyx_n_s_pyx_result;
1657 static PyObject *__pyx_n_s_pyx_state;
1658 static PyObject *__pyx_n_s_pyx_type;
1659 static PyObject *__pyx_n_s_pyx_unpickle_TextureAtlas;
13781660 static PyObject *__pyx_n_s_pyx_vtable;
13791661 static PyObject *__pyx_n_s_r;
13801662 static PyObject *__pyx_n_u_r;
13811663 static PyObject *__pyx_n_s_range;
13821664 static PyObject *__pyx_n_s_rect;
1665 static PyObject *__pyx_n_s_reduce;
1666 static PyObject *__pyx_n_s_reduce_cython;
1667 static PyObject *__pyx_n_s_reduce_ex;
13831668 static PyObject *__pyx_n_s_ren;
13841669 static PyObject *__pyx_n_s_render;
13851670 static PyObject *__pyx_n_s_rinfo;
13861671 static PyObject *__pyx_n_u_rotated;
13871672 static PyObject *__pyx_n_u_rtt;
13881673 static PyObject *__pyx_n_s_rv;
1674 static PyObject *__pyx_n_s_setstate;
1675 static PyObject *__pyx_n_s_setstate_cython;
13891676 static PyObject *__pyx_n_u_software;
13901677 static PyObject *__pyx_n_u_sourceSize;
13911678 static PyObject *__pyx_n_u_spriteSourceSize;
13921679 static PyObject *__pyx_kp_s_src_pygame_sdl2_render_pyx;
1680 static PyObject *__pyx_kp_s_stringsource;
13931681 static PyObject *__pyx_n_s_test;
13941682 static PyObject *__pyx_n_s_tex;
1683 static PyObject *__pyx_n_s_update;
13951684 static PyObject *__pyx_n_s_vsync;
13961685 static PyObject *__pyx_n_u_vsync;
13971686 static PyObject *__pyx_n_s_w;
14221711 static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_22fill_rect(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect); /* proto */
14231712 static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_24set_viewport(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, PyObject *__pyx_v_rect); /* proto */
14241713 static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_26create_texture(struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_size); /* proto */
1714 static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_28__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self); /* proto */
1715 static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_30__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
14251716 static int __pyx_pf_11pygame_sdl2_6render_7Texture___cinit__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */
14261717 static void __pyx_pf_11pygame_sdl2_6render_7Texture_2__dealloc__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */
14271718 static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_1w___get__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */
14281719 static int __pyx_pf_11pygame_sdl2_6render_7Texture_1w_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
14291720 static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_1h___get__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */
14301721 static int __pyx_pf_11pygame_sdl2_6render_7Texture_1h_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
1722 static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self); /* proto */
1723 static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
14311724 static int __pyx_pf_11pygame_sdl2_6render_11TextureNode___init__(struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, PyObject *__pyx_v_tex); /* proto */
14321725 static PyObject *__pyx_pf_11pygame_sdl2_6render_11TextureNode_2render(struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, PyObject *__pyx_v_dest); /* proto */
1726 static PyObject *__pyx_pf_11pygame_sdl2_6render_11TextureNode_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self); /* proto */
1727 static PyObject *__pyx_pf_11pygame_sdl2_6render_11TextureNode_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
14331728 static int __pyx_pf_11pygame_sdl2_6render_12TextureAtlas___init__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_ren, PyObject *__pyx_v_fi); /* proto */
14341729 static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_2__getitem__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
14351730 static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_4keys(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self); /* proto */
1731 static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_6__reduce_cython__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self); /* proto */
1732 static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_8__setstate_cython__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
14361733 static int __pyx_pf_11pygame_sdl2_6render_6Sprite___init__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_nodes); /* proto */
14371734 static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_2render(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_dest); /* proto */
14381735 static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_4collides(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_other); /* proto */
14491746 static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5hflip_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
14501747 static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip___get__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */
14511748 static int __pyx_pf_11pygame_sdl2_6render_6Sprite_5vflip_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
1749 static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self); /* proto */
1750 static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
14521751 static int __pyx_pf_11pygame_sdl2_6render_9Container___init__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_rect); /* proto */
14531752 static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_2add(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_sprite); /* proto */
14541753 static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_4render(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dest); /* proto */
14561755 static int __pyx_pf_11pygame_sdl2_6render_9Container_3pos_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
14571756 static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_4rect___get__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self); /* proto */
14581757 static int __pyx_pf_11pygame_sdl2_6render_9Container_4rect_2__set__(struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
1758 static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self); /* proto */
1759 static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
1760 static PyObject *__pyx_pf_11pygame_sdl2_6render_2__pyx_unpickle_TextureAtlas(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
14591761 static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Renderer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
14601762 static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Texture(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
14611763 static PyObject *__pyx_tp_new_11pygame_sdl2_6render_TextureNode(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
14631765 static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Sprite(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
14641766 static PyObject *__pyx_tp_new_11pygame_sdl2_6render_Container(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
14651767 static PyObject *__pyx_int_0;
1768 static PyObject *__pyx_int_231588268;
14661769 static PyObject *__pyx_int_neg_1;
14671770 static PyObject *__pyx_tuple_;
14681771 static PyObject *__pyx_tuple__2;
14691772 static PyObject *__pyx_tuple__3;
1470 static PyObject *__pyx_codeobj__4;
1773 static PyObject *__pyx_tuple__4;
1774 static PyObject *__pyx_tuple__5;
1775 static PyObject *__pyx_tuple__6;
1776 static PyObject *__pyx_tuple__7;
1777 static PyObject *__pyx_tuple__8;
1778 static PyObject *__pyx_tuple__9;
1779 static PyObject *__pyx_tuple__10;
1780 static PyObject *__pyx_tuple__11;
1781 static PyObject *__pyx_tuple__12;
1782 static PyObject *__pyx_tuple__13;
1783 static PyObject *__pyx_tuple__15;
1784 static PyObject *__pyx_codeobj__14;
1785 static PyObject *__pyx_codeobj__16;
1786 /* Late includes */
14711787
14721788 /* "pygame_sdl2/render.pyx":40
14731789 * cdef bint DEBUG_DRAW_BBOX = True
15001816 * "software" : rinfo.flags & SDL_RENDERER_SOFTWARE != 0,
15011817 * "accelerated" : rinfo.flags & SDL_RENDERER_ACCELERATED != 0,
15021818 */
1503 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
1819 __pyx_t_1 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
15041820 __Pyx_GOTREF(__pyx_t_1);
15051821 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_rinfo->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
15061822 __Pyx_GOTREF(__pyx_t_2);
16351951 int __pyx_t_2;
16361952 int __pyx_t_3;
16371953 int __pyx_t_4;
1638 PyObject *__pyx_t_5 = NULL;
1954 int __pyx_t_5;
16391955 PyObject *__pyx_t_6 = NULL;
1640 int __pyx_t_7;
1956 PyObject *__pyx_t_7 = NULL;
1957 int __pyx_t_8;
16411958 __Pyx_RefNannySetupContext("get_drivers", 0);
16421959
16431960 /* "pygame_sdl2/render.pyx":55
16691986 * raise error()
16701987 */
16711988 __pyx_t_2 = __pyx_v_num_drivers;
1672 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
1673 __pyx_v_n = __pyx_t_3;
1989 __pyx_t_3 = __pyx_t_2;
1990 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
1991 __pyx_v_n = __pyx_t_4;
16741992
16751993 /* "pygame_sdl2/render.pyx":59
16761994 * num_drivers = SDL_GetNumRenderDrivers()
16791997 * raise error()
16801998 *
16811999 */
1682 __pyx_t_4 = ((SDL_GetRenderDriverInfo(__pyx_v_n, (&__pyx_v_rinfo)) != 0) != 0);
1683 if (__pyx_t_4) {
2000 __pyx_t_5 = ((SDL_GetRenderDriverInfo(__pyx_v_n, (&__pyx_v_rinfo)) != 0) != 0);
2001 if (unlikely(__pyx_t_5)) {
16842002
16852003 /* "pygame_sdl2/render.pyx":60
16862004 * for n in range(num_drivers):
16892007 *
16902008 * rv.append(rinfo_to_dict(&rinfo))
16912009 */
1692 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 60, __pyx_L1_error)
1693 __Pyx_GOTREF(__pyx_t_5);
1694 __pyx_t_6 = NULL;
1695 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
1696 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
1697 if (likely(__pyx_t_6)) {
1698 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
1699 __Pyx_INCREF(__pyx_t_6);
2010 __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 60, __pyx_L1_error)
2011 __Pyx_GOTREF(__pyx_t_6);
2012 __pyx_t_7 = NULL;
2013 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
2014 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
2015 if (likely(__pyx_t_7)) {
2016 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
2017 __Pyx_INCREF(__pyx_t_7);
17002018 __Pyx_INCREF(function);
1701 __Pyx_DECREF_SET(__pyx_t_5, function);
2019 __Pyx_DECREF_SET(__pyx_t_6, function);
17022020 }
17032021 }
1704 if (__pyx_t_6) {
1705 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
1706 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2022 if (__pyx_t_7) {
2023 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
2024 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17072025 } else {
1708 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
2026 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
17092027 }
17102028 __Pyx_GOTREF(__pyx_t_1);
1711 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2029 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17122030 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17132031 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17142032 __PYX_ERR(0, 60, __pyx_L1_error)
17312049 */
17322050 __pyx_t_1 = __pyx_f_11pygame_sdl2_6render_rinfo_to_dict((&__pyx_v_rinfo)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
17332051 __Pyx_GOTREF(__pyx_t_1);
1734 __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_t_1); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 62, __pyx_L1_error)
2052 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 62, __pyx_L1_error)
17352053 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17362054 }
17372055
17582076 /* function exit code */
17592077 __pyx_L1_error:;
17602078 __Pyx_XDECREF(__pyx_t_1);
1761 __Pyx_XDECREF(__pyx_t_5);
17622079 __Pyx_XDECREF(__pyx_t_6);
2080 __Pyx_XDECREF(__pyx_t_7);
17632081 __Pyx_AddTraceback("pygame_sdl2.render.get_drivers", __pyx_clineno, __pyx_lineno, __pyx_filename);
17642082 __pyx_r = NULL;
17652083 __pyx_L0:;
19132231 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19142232 switch (pos_args) {
19152233 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2234 CYTHON_FALLTHROUGH;
19162235 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2236 CYTHON_FALLTHROUGH;
19172237 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2238 CYTHON_FALLTHROUGH;
19182239 case 0: break;
19192240 default: goto __pyx_L5_argtuple_error;
19202241 }
19222243 switch (pos_args) {
19232244 case 0:
19242245 if (kw_args > 0) {
1925 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_window);
2246 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_window);
19262247 if (value) { values[0] = value; kw_args--; }
19272248 }
2249 CYTHON_FALLTHROUGH;
19282250 case 1:
19292251 if (kw_args > 0) {
1930 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_vsync);
2252 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vsync);
19312253 if (value) { values[1] = value; kw_args--; }
19322254 }
2255 CYTHON_FALLTHROUGH;
19332256 case 2:
19342257 if (kw_args > 0) {
1935 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_driver);
2258 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_driver);
19362259 if (value) { values[2] = value; kw_args--; }
19372260 }
19382261 }
19422265 } else {
19432266 switch (PyTuple_GET_SIZE(__pyx_args)) {
19442267 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2268 CYTHON_FALLTHROUGH;
19452269 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2270 CYTHON_FALLTHROUGH;
19462271 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2272 CYTHON_FALLTHROUGH;
19472273 case 0: break;
19482274 default: goto __pyx_L5_argtuple_error;
19492275 }
20902416 *
20912417 */
20922418 __pyx_t_2 = ((__pyx_v_self->renderer == NULL) != 0);
2093 if (__pyx_t_2) {
2419 if (unlikely(__pyx_t_2)) {
20942420
20952421 /* "pygame_sdl2/render.pyx":90
20962422 * self.renderer = SDL_GetRenderer(window.window)
21492475 *
21502476 */
21512477 __pyx_t_2 = ((SDL_GetRendererInfo(__pyx_v_self->renderer, (&__pyx_v_rinfo)) != 0) != 0);
2152 if (__pyx_t_2) {
2478 if (unlikely(__pyx_t_2)) {
21532479
21542480 /* "pygame_sdl2/render.pyx":94
21552481 * cdef SDL_RendererInfo rinfo
22342560 }
22352561 __Pyx_GOTREF(__pyx_t_4);
22362562 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2237 __pyx_t_5 = PyObject_GetItem(__pyx_t_4, __pyx_n_u_accelerated); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 98, __pyx_L1_error)
2563 __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_u_accelerated); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 98, __pyx_L1_error)
22382564 __Pyx_GOTREF(__pyx_t_5);
22392565 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22402566 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 98, __pyx_L1_error)
23322658 *
23332659 * if isinstance(fi, Surface):
23342660 */
2335 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Texture), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
2661 __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_Texture)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
23362662 __Pyx_GOTREF(__pyx_t_1);
23372663 __pyx_v_t = ((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_t_1);
23382664 __pyx_t_1 = 0;
23752701 * if tex == NULL:
23762702 */
23772703 /*else*/ {
2378 __pyx_t_4 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_4 == NULL)) __PYX_ERR(0, 108, __pyx_L1_error)
2704 __pyx_t_4 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_fi, NULL); if (unlikely(__pyx_t_4 == ((SDL_RWops *)NULL))) __PYX_ERR(0, 108, __pyx_L1_error)
23792705 __pyx_v_tex = IMG_LoadTexture_RW(__pyx_v_self->renderer, __pyx_t_4, 1);
23802706 }
23812707 __pyx_L3:;
23882714 *
23892715 */
23902716 __pyx_t_3 = ((__pyx_v_tex == NULL) != 0);
2391 if (__pyx_t_3) {
2717 if (unlikely(__pyx_t_3)) {
23922718
23932719 /* "pygame_sdl2/render.pyx":111
23942720 *
24492775 * def load_atlas(self, filename):
24502776 */
24512777 __Pyx_XDECREF(__pyx_r);
2452 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
2778 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureNode), ((PyObject *)__pyx_v_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
24532779 __Pyx_GOTREF(__pyx_t_1);
2454 __Pyx_INCREF(((PyObject *)__pyx_v_t));
2455 __Pyx_GIVEREF(((PyObject *)__pyx_v_t));
2456 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_t));
2457 __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureNode), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L1_error)
2458 __Pyx_GOTREF(__pyx_t_5);
2459 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2460 __pyx_r = __pyx_t_5;
2461 __pyx_t_5 = 0;
2780 __pyx_r = __pyx_t_1;
2781 __pyx_t_1 = 0;
24622782 goto __pyx_L0;
24632783
24642784 /* "pygame_sdl2/render.pyx":101
25922912 #ifdef WITH_THREAD
25932913 PyThreadState *_save;
25942914 Py_UNBLOCK_THREADS
2915 __Pyx_FastGIL_Remember();
25952916 #endif
25962917 /*try:*/ {
25972918
26152936 /*finally:*/ {
26162937 /*normal exit:*/{
26172938 #ifdef WITH_THREAD
2939 __Pyx_FastGIL_Forget();
26182940 Py_BLOCK_THREADS
26192941 #endif
26202942 goto __pyx_L5;
27243046 */
27253047 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
27263048 __Pyx_GOTREF(__pyx_t_1);
2727 __pyx_t_2 = PyObject_IsInstance(__pyx_v_col, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 130, __pyx_L1_error)
3049 __pyx_t_2 = PyObject_IsInstance(__pyx_v_col, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 130, __pyx_L1_error)
27283050 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27293051 __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
27303052 if (__pyx_t_3) {
28163138 __Pyx_GOTREF(__pyx_t_1);
28173139 __pyx_t_10 = __Pyx_PyInt_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_10 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
28183140 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2819 SDL_SetRenderDrawColor(__pyx_v_self->renderer, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10);
3141 (void)(SDL_SetRenderDrawColor(__pyx_v_self->renderer, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10));
28203142
28213143 /* "pygame_sdl2/render.pyx":129
28223144 * return self._info
28883210 *
28893211 * def draw_line(self, color not None, x1, y1, x2, y2):
28903212 */
2891 SDL_RenderClear(__pyx_v_self->renderer);
3213 (void)(SDL_RenderClear(__pyx_v_self->renderer));
28923214
28933215 /* "pygame_sdl2/render.pyx":134
28943216 * SDL_SetRenderDrawColor(self.renderer, col.r, col.g, col.b, col.a)
29383260 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
29393261 switch (pos_args) {
29403262 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3263 CYTHON_FALLTHROUGH;
29413264 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3265 CYTHON_FALLTHROUGH;
29423266 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3267 CYTHON_FALLTHROUGH;
29433268 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3269 CYTHON_FALLTHROUGH;
29443270 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3271 CYTHON_FALLTHROUGH;
29453272 case 0: break;
29463273 default: goto __pyx_L5_argtuple_error;
29473274 }
29483275 kw_args = PyDict_Size(__pyx_kwds);
29493276 switch (pos_args) {
29503277 case 0:
2951 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
3278 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
29523279 else goto __pyx_L5_argtuple_error;
3280 CYTHON_FALLTHROUGH;
29533281 case 1:
2954 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
3282 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x1)) != 0)) kw_args--;
29553283 else {
29563284 __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, 1); __PYX_ERR(0, 138, __pyx_L3_error)
29573285 }
3286 CYTHON_FALLTHROUGH;
29583287 case 2:
2959 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
3288 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y1)) != 0)) kw_args--;
29603289 else {
29613290 __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, 2); __PYX_ERR(0, 138, __pyx_L3_error)
29623291 }
3292 CYTHON_FALLTHROUGH;
29633293 case 3:
2964 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
3294 if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x2)) != 0)) kw_args--;
29653295 else {
29663296 __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, 3); __PYX_ERR(0, 138, __pyx_L3_error)
29673297 }
3298 CYTHON_FALLTHROUGH;
29683299 case 4:
2969 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
3300 if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y2)) != 0)) kw_args--;
29703301 else {
29713302 __Pyx_RaiseArgtupleInvalid("draw_line", 1, 5, 5, 4); __PYX_ERR(0, 138, __pyx_L3_error)
29723303 }
30473378 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_x2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error)
30483379 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_y2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error)
30493380 __pyx_t_6 = ((SDL_RenderDrawLine(__pyx_v_self->renderer, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5) != 0) != 0);
3050 if (__pyx_t_6) {
3381 if (unlikely(__pyx_t_6)) {
30513382
30523383 /* "pygame_sdl2/render.pyx":141
30533384 * self.set_drawcolor(color)
31373468 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
31383469 switch (pos_args) {
31393470 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3471 CYTHON_FALLTHROUGH;
31403472 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3473 CYTHON_FALLTHROUGH;
31413474 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3475 CYTHON_FALLTHROUGH;
31423476 case 0: break;
31433477 default: goto __pyx_L5_argtuple_error;
31443478 }
31453479 kw_args = PyDict_Size(__pyx_kwds);
31463480 switch (pos_args) {
31473481 case 0:
3148 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
3482 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
31493483 else goto __pyx_L5_argtuple_error;
3484 CYTHON_FALLTHROUGH;
31503485 case 1:
3151 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
3486 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
31523487 else {
31533488 __Pyx_RaiseArgtupleInvalid("draw_point", 1, 3, 3, 1); __PYX_ERR(0, 143, __pyx_L3_error)
31543489 }
3490 CYTHON_FALLTHROUGH;
31553491 case 2:
3156 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
3492 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
31573493 else {
31583494 __Pyx_RaiseArgtupleInvalid("draw_point", 1, 3, 3, 2); __PYX_ERR(0, 143, __pyx_L3_error)
31593495 }
32223558 */
32233559 __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_x); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L1_error)
32243560 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_y); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L1_error)
3225 SDL_RenderDrawPoint(__pyx_v_self->renderer, __pyx_t_2, __pyx_t_3);
3561 (void)(SDL_RenderDrawPoint(__pyx_v_self->renderer, __pyx_t_2, __pyx_t_3));
32263562
32273563 /* "pygame_sdl2/render.pyx":143
32283564 * raise error()
32693605 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
32703606 switch (pos_args) {
32713607 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3608 CYTHON_FALLTHROUGH;
32723609 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3610 CYTHON_FALLTHROUGH;
32733611 case 0: break;
32743612 default: goto __pyx_L5_argtuple_error;
32753613 }
32763614 kw_args = PyDict_Size(__pyx_kwds);
32773615 switch (pos_args) {
32783616 case 0:
3279 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
3617 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
32803618 else goto __pyx_L5_argtuple_error;
3619 CYTHON_FALLTHROUGH;
32813620 case 1:
3282 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
3621 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
32833622 else {
32843623 __Pyx_RaiseArgtupleInvalid("draw_rect", 1, 2, 2, 1); __PYX_ERR(0, 147, __pyx_L3_error)
32853624 }
33333672 * self.set_drawcolor(color)
33343673 * SDL_RenderDrawRect(self.renderer, &r)
33353674 */
3336 __pyx_t_1 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_r), NULL); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 149, __pyx_L1_error)
3675 __pyx_t_1 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_r), NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 149, __pyx_L1_error)
33373676
33383677 /* "pygame_sdl2/render.pyx":150
33393678 * cdef SDL_Rect r
33533692 *
33543693 * def fill_rect(self, color not None, rect):
33553694 */
3356 SDL_RenderDrawRect(__pyx_v_self->renderer, (&__pyx_v_r));
3695 (void)(SDL_RenderDrawRect(__pyx_v_self->renderer, (&__pyx_v_r)));
33573696
33583697 /* "pygame_sdl2/render.pyx":147
33593698 * SDL_RenderDrawPoint(self.renderer, x, y)
34003739 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
34013740 switch (pos_args) {
34023741 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3742 CYTHON_FALLTHROUGH;
34033743 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3744 CYTHON_FALLTHROUGH;
34043745 case 0: break;
34053746 default: goto __pyx_L5_argtuple_error;
34063747 }
34073748 kw_args = PyDict_Size(__pyx_kwds);
34083749 switch (pos_args) {
34093750 case 0:
3410 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
3751 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
34113752 else goto __pyx_L5_argtuple_error;
3753 CYTHON_FALLTHROUGH;
34123754 case 1:
3413 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
3755 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
34143756 else {
34153757 __Pyx_RaiseArgtupleInvalid("fill_rect", 1, 2, 2, 1); __PYX_ERR(0, 153, __pyx_L3_error)
34163758 }
34643806 * self.set_drawcolor(color)
34653807 * SDL_RenderFillRect(self.renderer, &r)
34663808 */
3467 __pyx_t_1 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_r), NULL); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 155, __pyx_L1_error)
3809 __pyx_t_1 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_r), NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 155, __pyx_L1_error)
34683810
34693811 /* "pygame_sdl2/render.pyx":156
34703812 * cdef SDL_Rect r
34843826 *
34853827 * def set_viewport(self, rect=None):
34863828 */
3487 SDL_RenderFillRect(__pyx_v_self->renderer, (&__pyx_v_r));
3829 (void)(SDL_RenderFillRect(__pyx_v_self->renderer, (&__pyx_v_r)));
34883830
34893831 /* "pygame_sdl2/render.pyx":153
34903832 * SDL_RenderDrawRect(self.renderer, &r)
35313873 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
35323874 switch (pos_args) {
35333875 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3876 CYTHON_FALLTHROUGH;
35343877 case 0: break;
35353878 default: goto __pyx_L5_argtuple_error;
35363879 }
35383881 switch (pos_args) {
35393882 case 0:
35403883 if (kw_args > 0) {
3541 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect);
3884 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rect);
35423885 if (value) { values[0] = value; kw_args--; }
35433886 }
35443887 }
35483891 } else {
35493892 switch (PyTuple_GET_SIZE(__pyx_args)) {
35503893 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3894 CYTHON_FALLTHROUGH;
35513895 case 0: break;
35523896 default: goto __pyx_L5_argtuple_error;
35533897 }
35963940 * else:
35973941 * to_sdl_rect(rect, &vprect)
35983942 */
3599 SDL_RenderSetViewport(__pyx_v_self->renderer, NULL);
3943 (void)(SDL_RenderSetViewport(__pyx_v_self->renderer, NULL));
36003944
36013945 /* "pygame_sdl2/render.pyx":161
36023946 * def set_viewport(self, rect=None):
36163960 *
36173961 */
36183962 /*else*/ {
3619 __pyx_t_3 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_vprect), NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 164, __pyx_L1_error)
3963 __pyx_t_3 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_vprect), NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 164, __pyx_L1_error)
36203964
36213965 /* "pygame_sdl2/render.pyx":165
36223966 * else:
36253969 *
36263970 * def create_texture(self, size):
36273971 */
3628 SDL_RenderSetViewport(__pyx_v_self->renderer, (&__pyx_v_vprect));
3972 (void)(SDL_RenderSetViewport(__pyx_v_self->renderer, (&__pyx_v_vprect)));
36293973 }
36303974 __pyx_L3:;
36313975
36874031 *
36884032 */
36894033 __pyx_t_1 = ((SDL_RenderTargetSupported(__pyx_v_self->renderer) != SDL_TRUE) != 0);
3690 if (__pyx_t_1) {
4034 if (unlikely(__pyx_t_1)) {
36914035
36924036 /* "pygame_sdl2/render.pyx":169
36934037 * def create_texture(self, size):
37474091 __Pyx_AddTraceback("pygame_sdl2.render.Renderer.create_texture", __pyx_clineno, __pyx_lineno, __pyx_filename);
37484092 __pyx_r = NULL;
37494093 __pyx_L0:;
4094 __Pyx_XGIVEREF(__pyx_r);
4095 __Pyx_RefNannyFinishContext();
4096 return __pyx_r;
4097 }
4098
4099 /* "(tree fragment)":1
4100 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4101 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4102 * def __setstate_cython__(self, __pyx_state):
4103 */
4104
4105 /* Python wrapper */
4106 static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_29__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4107 static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_29__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4108 PyObject *__pyx_r = 0;
4109 __Pyx_RefNannyDeclarations
4110 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
4111 __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_28__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self));
4112
4113 /* function exit code */
4114 __Pyx_RefNannyFinishContext();
4115 return __pyx_r;
4116 }
4117
4118 static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_28__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self) {
4119 PyObject *__pyx_r = NULL;
4120 __Pyx_RefNannyDeclarations
4121 PyObject *__pyx_t_1 = NULL;
4122 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
4123
4124 /* "(tree fragment)":2
4125 * def __reduce_cython__(self):
4126 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4127 * def __setstate_cython__(self, __pyx_state):
4128 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4129 */
4130 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
4131 __Pyx_GOTREF(__pyx_t_1);
4132 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4133 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4134 __PYX_ERR(1, 2, __pyx_L1_error)
4135
4136 /* "(tree fragment)":1
4137 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4138 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4139 * def __setstate_cython__(self, __pyx_state):
4140 */
4141
4142 /* function exit code */
4143 __pyx_L1_error:;
4144 __Pyx_XDECREF(__pyx_t_1);
4145 __Pyx_AddTraceback("pygame_sdl2.render.Renderer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4146 __pyx_r = NULL;
4147 __Pyx_XGIVEREF(__pyx_r);
4148 __Pyx_RefNannyFinishContext();
4149 return __pyx_r;
4150 }
4151
4152 /* "(tree fragment)":3
4153 * def __reduce_cython__(self):
4154 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4155 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4156 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4157 */
4158
4159 /* Python wrapper */
4160 static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_31__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
4161 static PyObject *__pyx_pw_11pygame_sdl2_6render_8Renderer_31__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4162 PyObject *__pyx_r = 0;
4163 __Pyx_RefNannyDeclarations
4164 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
4165 __pyx_r = __pyx_pf_11pygame_sdl2_6render_8Renderer_30__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Renderer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4166
4167 /* function exit code */
4168 __Pyx_RefNannyFinishContext();
4169 return __pyx_r;
4170 }
4171
4172 static PyObject *__pyx_pf_11pygame_sdl2_6render_8Renderer_30__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Renderer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
4173 PyObject *__pyx_r = NULL;
4174 __Pyx_RefNannyDeclarations
4175 PyObject *__pyx_t_1 = NULL;
4176 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
4177
4178 /* "(tree fragment)":4
4179 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4180 * def __setstate_cython__(self, __pyx_state):
4181 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4182 */
4183 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
4184 __Pyx_GOTREF(__pyx_t_1);
4185 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4186 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4187 __PYX_ERR(1, 4, __pyx_L1_error)
4188
4189 /* "(tree fragment)":3
4190 * def __reduce_cython__(self):
4191 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4192 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4193 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4194 */
4195
4196 /* function exit code */
4197 __pyx_L1_error:;
4198 __Pyx_XDECREF(__pyx_t_1);
4199 __Pyx_AddTraceback("pygame_sdl2.render.Renderer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4200 __pyx_r = NULL;
37504201 __Pyx_XGIVEREF(__pyx_r);
37514202 __Pyx_RefNannyFinishContext();
37524203 return __pyx_r;
39154366 *
39164367 */
39174368 __pyx_t_1 = ((SDL_QueryTexture(__pyx_v_self->texture, (&__pyx_v_format), (&__pyx_v_access), (&__pyx_v_w), (&__pyx_v_h)) != 0) != 0);
3918 if (__pyx_t_1) {
4369 if (unlikely(__pyx_t_1)) {
39194370
39204371 /* "pygame_sdl2/render.pyx":194
39214372 *
41384589 __Pyx_AddTraceback("pygame_sdl2.render.Texture.h.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
41394590 __pyx_r = -1;
41404591 __pyx_L0:;
4592 __Pyx_RefNannyFinishContext();
4593 return __pyx_r;
4594 }
4595
4596 /* "(tree fragment)":1
4597 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4598 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4599 * def __setstate_cython__(self, __pyx_state):
4600 */
4601
4602 /* Python wrapper */
4603 static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4604 static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4605 PyObject *__pyx_r = 0;
4606 __Pyx_RefNannyDeclarations
4607 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
4608 __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_4__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self));
4609
4610 /* function exit code */
4611 __Pyx_RefNannyFinishContext();
4612 return __pyx_r;
4613 }
4614
4615 static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self) {
4616 PyObject *__pyx_r = NULL;
4617 __Pyx_RefNannyDeclarations
4618 PyObject *__pyx_t_1 = NULL;
4619 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
4620
4621 /* "(tree fragment)":2
4622 * def __reduce_cython__(self):
4623 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4624 * def __setstate_cython__(self, __pyx_state):
4625 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4626 */
4627 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
4628 __Pyx_GOTREF(__pyx_t_1);
4629 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4630 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4631 __PYX_ERR(1, 2, __pyx_L1_error)
4632
4633 /* "(tree fragment)":1
4634 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4635 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4636 * def __setstate_cython__(self, __pyx_state):
4637 */
4638
4639 /* function exit code */
4640 __pyx_L1_error:;
4641 __Pyx_XDECREF(__pyx_t_1);
4642 __Pyx_AddTraceback("pygame_sdl2.render.Texture.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4643 __pyx_r = NULL;
4644 __Pyx_XGIVEREF(__pyx_r);
4645 __Pyx_RefNannyFinishContext();
4646 return __pyx_r;
4647 }
4648
4649 /* "(tree fragment)":3
4650 * def __reduce_cython__(self):
4651 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4652 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4653 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4654 */
4655
4656 /* Python wrapper */
4657 static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
4658 static PyObject *__pyx_pw_11pygame_sdl2_6render_7Texture_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4659 PyObject *__pyx_r = 0;
4660 __Pyx_RefNannyDeclarations
4661 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
4662 __pyx_r = __pyx_pf_11pygame_sdl2_6render_7Texture_6__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Texture *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4663
4664 /* function exit code */
4665 __Pyx_RefNannyFinishContext();
4666 return __pyx_r;
4667 }
4668
4669 static PyObject *__pyx_pf_11pygame_sdl2_6render_7Texture_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Texture *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
4670 PyObject *__pyx_r = NULL;
4671 __Pyx_RefNannyDeclarations
4672 PyObject *__pyx_t_1 = NULL;
4673 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
4674
4675 /* "(tree fragment)":4
4676 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4677 * def __setstate_cython__(self, __pyx_state):
4678 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
4679 */
4680 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
4681 __Pyx_GOTREF(__pyx_t_1);
4682 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4683 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4684 __PYX_ERR(1, 4, __pyx_L1_error)
4685
4686 /* "(tree fragment)":3
4687 * def __reduce_cython__(self):
4688 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4689 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4690 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
4691 */
4692
4693 /* function exit code */
4694 __pyx_L1_error:;
4695 __Pyx_XDECREF(__pyx_t_1);
4696 __Pyx_AddTraceback("pygame_sdl2.render.Texture.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4697 __pyx_r = NULL;
4698 __Pyx_XGIVEREF(__pyx_r);
41414699 __Pyx_RefNannyFinishContext();
41424700 return __pyx_r;
41434701 }
41654723 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
41664724 switch (pos_args) {
41674725 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4726 CYTHON_FALLTHROUGH;
41684727 case 0: break;
41694728 default: goto __pyx_L5_argtuple_error;
41704729 }
41714730 kw_args = PyDict_Size(__pyx_kwds);
41724731 switch (pos_args) {
41734732 case 0:
4174 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tex)) != 0)) kw_args--;
4733 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tex)) != 0)) kw_args--;
41754734 else goto __pyx_L5_argtuple_error;
41764735 }
41774736 if (unlikely(kw_args > 0)) {
42624821 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
42634822 __pyx_t_3 = 0;
42644823 __pyx_t_4 = 0;
4265 __pyx_t_6 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_5, (&__pyx_v_self->source_rect), NULL); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 218, __pyx_L1_error)
4824 __pyx_t_6 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_5, (&__pyx_v_self->source_rect), NULL); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 218, __pyx_L1_error)
42664825 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
42674826
42684827 /* "pygame_sdl2/render.pyx":219
42904849 PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_4);
42914850 __pyx_t_5 = 0;
42924851 __pyx_t_4 = 0;
4293 __pyx_t_6 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_3, (&__pyx_v_self->trimmed_rect), NULL); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
4852 __pyx_t_6 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_3, (&__pyx_v_self->trimmed_rect), NULL); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 219, __pyx_L1_error)
42944853 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
42954854
42964855 /* "pygame_sdl2/render.pyx":220
43384897 */
43394898 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_tex, __pyx_ptype_11pygame_sdl2_6render_TextureNode);
43404899 __pyx_t_1 = (__pyx_t_2 != 0);
4341 if (__pyx_t_1) {
4900 if (likely(__pyx_t_1)) {
43424901
43434902 /* "pygame_sdl2/render.pyx":224
43444903 *
44274986 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
44284987 switch (pos_args) {
44294988 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4989 CYTHON_FALLTHROUGH;
44304990 case 0: break;
44314991 default: goto __pyx_L5_argtuple_error;
44324992 }
44344994 switch (pos_args) {
44354995 case 0:
44364996 if (kw_args > 0) {
4437 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest);
4997 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dest);
44384998 if (value) { values[0] = value; kw_args--; }
44394999 }
44405000 }
44445004 } else {
44455005 switch (PyTuple_GET_SIZE(__pyx_args)) {
44465006 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5007 CYTHON_FALLTHROUGH;
44475008 case 0: break;
44485009 default: goto __pyx_L5_argtuple_error;
44495010 }
44965057 #ifdef WITH_THREAD
44975058 PyThreadState *_save;
44985059 Py_UNBLOCK_THREADS
5060 __Pyx_FastGIL_Remember();
44995061 #endif
45005062 /*try:*/ {
45015063
45065068 *
45075069 * else:
45085070 */
4509 SDL_RenderCopy(__pyx_v_self->texture->renderer, __pyx_v_self->texture->texture, NULL, NULL);
5071 (void)(SDL_RenderCopy(__pyx_v_self->texture->renderer, __pyx_v_self->texture->texture, NULL, NULL));
45105072 }
45115073
45125074 /* "pygame_sdl2/render.pyx":233
45195081 /*finally:*/ {
45205082 /*normal exit:*/{
45215083 #ifdef WITH_THREAD
5084 __Pyx_FastGIL_Forget();
45225085 Py_BLOCK_THREADS
45235086 #endif
45245087 goto __pyx_L6;
45455108 * if dest_rect.w == 0 or dest_rect.h == 0:
45465109 */
45475110 /*else*/ {
4548 __pyx_t_3 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_dest, (&__pyx_v_dest_rect), NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 237, __pyx_L1_error)
5111 __pyx_t_3 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_dest, (&__pyx_v_dest_rect), NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 237, __pyx_L1_error)
45495112
45505113 /* "pygame_sdl2/render.pyx":238
45515114 * else:
45585121 #ifdef WITH_THREAD
45595122 PyThreadState *_save;
45605123 Py_UNBLOCK_THREADS
5124 __Pyx_FastGIL_Remember();
45615125 #endif
45625126 /*try:*/ {
45635127
46155179 *
46165180 *
46175181 */
4618 SDL_RenderCopy(__pyx_v_self->texture->renderer, __pyx_v_self->texture->texture, NULL, (&__pyx_v_dest_rect));
5182 (void)(SDL_RenderCopy(__pyx_v_self->texture->renderer, __pyx_v_self->texture->texture, NULL, (&__pyx_v_dest_rect)));
46195183 }
46205184
46215185 /* "pygame_sdl2/render.pyx":238
46285192 /*finally:*/ {
46295193 /*normal exit:*/{
46305194 #ifdef WITH_THREAD
5195 __Pyx_FastGIL_Forget();
46315196 Py_BLOCK_THREADS
46325197 #endif
46335198 goto __pyx_L9;
46535218 __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.render", __pyx_clineno, __pyx_lineno, __pyx_filename);
46545219 __pyx_r = NULL;
46555220 __pyx_L0:;
5221 __Pyx_XGIVEREF(__pyx_r);
5222 __Pyx_RefNannyFinishContext();
5223 return __pyx_r;
5224 }
5225
5226 /* "(tree fragment)":1
5227 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5228 * raise TypeError("Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)")
5229 * def __setstate_cython__(self, __pyx_state):
5230 */
5231
5232 /* Python wrapper */
5233 static PyObject *__pyx_pw_11pygame_sdl2_6render_11TextureNode_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
5234 static PyObject *__pyx_pw_11pygame_sdl2_6render_11TextureNode_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5235 PyObject *__pyx_r = 0;
5236 __Pyx_RefNannyDeclarations
5237 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5238 __pyx_r = __pyx_pf_11pygame_sdl2_6render_11TextureNode_4__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_self));
5239
5240 /* function exit code */
5241 __Pyx_RefNannyFinishContext();
5242 return __pyx_r;
5243 }
5244
5245 static PyObject *__pyx_pf_11pygame_sdl2_6render_11TextureNode_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self) {
5246 PyObject *__pyx_r = NULL;
5247 __Pyx_RefNannyDeclarations
5248 PyObject *__pyx_t_1 = NULL;
5249 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
5250
5251 /* "(tree fragment)":2
5252 * def __reduce_cython__(self):
5253 * raise TypeError("Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)") # <<<<<<<<<<<<<<
5254 * def __setstate_cython__(self, __pyx_state):
5255 * raise TypeError("Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)")
5256 */
5257 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
5258 __Pyx_GOTREF(__pyx_t_1);
5259 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5260 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5261 __PYX_ERR(1, 2, __pyx_L1_error)
5262
5263 /* "(tree fragment)":1
5264 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5265 * raise TypeError("Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)")
5266 * def __setstate_cython__(self, __pyx_state):
5267 */
5268
5269 /* function exit code */
5270 __pyx_L1_error:;
5271 __Pyx_XDECREF(__pyx_t_1);
5272 __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5273 __pyx_r = NULL;
5274 __Pyx_XGIVEREF(__pyx_r);
5275 __Pyx_RefNannyFinishContext();
5276 return __pyx_r;
5277 }
5278
5279 /* "(tree fragment)":3
5280 * def __reduce_cython__(self):
5281 * raise TypeError("Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)")
5282 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5283 * raise TypeError("Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)")
5284 */
5285
5286 /* Python wrapper */
5287 static PyObject *__pyx_pw_11pygame_sdl2_6render_11TextureNode_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
5288 static PyObject *__pyx_pw_11pygame_sdl2_6render_11TextureNode_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5289 PyObject *__pyx_r = 0;
5290 __Pyx_RefNannyDeclarations
5291 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
5292 __pyx_r = __pyx_pf_11pygame_sdl2_6render_11TextureNode_6__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5293
5294 /* function exit code */
5295 __Pyx_RefNannyFinishContext();
5296 return __pyx_r;
5297 }
5298
5299 static PyObject *__pyx_pf_11pygame_sdl2_6render_11TextureNode_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_TextureNode *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
5300 PyObject *__pyx_r = NULL;
5301 __Pyx_RefNannyDeclarations
5302 PyObject *__pyx_t_1 = NULL;
5303 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
5304
5305 /* "(tree fragment)":4
5306 * raise TypeError("Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)")
5307 * def __setstate_cython__(self, __pyx_state):
5308 * raise TypeError("Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)") # <<<<<<<<<<<<<<
5309 */
5310 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
5311 __Pyx_GOTREF(__pyx_t_1);
5312 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5313 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5314 __PYX_ERR(1, 4, __pyx_L1_error)
5315
5316 /* "(tree fragment)":3
5317 * def __reduce_cython__(self):
5318 * raise TypeError("Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)")
5319 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5320 * raise TypeError("Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)")
5321 */
5322
5323 /* function exit code */
5324 __pyx_L1_error:;
5325 __Pyx_XDECREF(__pyx_t_1);
5326 __Pyx_AddTraceback("pygame_sdl2.render.TextureNode.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5327 __pyx_r = NULL;
46565328 __Pyx_XGIVEREF(__pyx_r);
46575329 __Pyx_RefNannyFinishContext();
46585330 return __pyx_r;
46825354 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
46835355 switch (pos_args) {
46845356 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5357 CYTHON_FALLTHROUGH;
46855358 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5359 CYTHON_FALLTHROUGH;
46865360 case 0: break;
46875361 default: goto __pyx_L5_argtuple_error;
46885362 }
46895363 kw_args = PyDict_Size(__pyx_kwds);
46905364 switch (pos_args) {
46915365 case 0:
4692 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ren)) != 0)) kw_args--;
5366 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ren)) != 0)) kw_args--;
46935367 else goto __pyx_L5_argtuple_error;
5368 CYTHON_FALLTHROUGH;
46945369 case 1:
4695 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fi)) != 0)) kw_args--;
5370 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fi)) != 0)) kw_args--;
46965371 else {
46975372 __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 248, __pyx_L3_error)
46985373 }
48345509 *
48355510 * cdef TextureNode tn = ren.load_texture(image)
48365511 */
4837 __pyx_t_1 = PyObject_GetItem(__pyx_v_jdata, __pyx_n_u_meta); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
5512 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_jdata, __pyx_n_u_meta); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
48385513 __Pyx_GOTREF(__pyx_t_1);
4839 __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_n_u_image); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
5514 __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_image); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
48405515 __Pyx_GOTREF(__pyx_t_3);
48415516 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48425517 __pyx_v_image = __pyx_t_3;
49055580 *
49065581 * cdef TextureNode itex
49075582 */
4908 __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error)
5583 __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error)
49095584 __Pyx_GOTREF(__pyx_t_3);
49105585 __Pyx_GIVEREF(__pyx_t_3);
49115586 __Pyx_GOTREF(__pyx_v_self->frames);
49215596 * itex = TextureNode(tn)
49225597 */
49235598 __pyx_t_6 = 0;
4924 __pyx_t_1 = PyObject_GetItem(__pyx_v_jdata, __pyx_n_u_frames); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
5599 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_jdata, __pyx_n_u_frames); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
49255600 __Pyx_GOTREF(__pyx_t_1);
49265601 if (unlikely(__pyx_t_1 == Py_None)) {
4927 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
5602 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
49285603 __PYX_ERR(0, 257, __pyx_L1_error)
49295604 }
49305605 __pyx_t_4 = __Pyx_dict_iterator(__pyx_t_1, 0, __pyx_n_s_iteritems, (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error)
49505625 */
49515626 if ((likely(PyTuple_CheckExact(__pyx_v_itm))) || (PyList_CheckExact(__pyx_v_itm))) {
49525627 PyObject* sequence = __pyx_v_itm;
4953 #if !CYTHON_COMPILING_IN_PYPY
4954 Py_ssize_t size = Py_SIZE(sequence);
4955 #else
4956 Py_ssize_t size = PySequence_Size(sequence);
4957 #endif
5628 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
49585629 if (unlikely(size != 2)) {
49595630 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
49605631 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
50085679 * f = idict["frame"]
50095680 * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame")
50105681 */
5011 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
5682 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureNode), ((PyObject *)__pyx_v_tn)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
50125683 __Pyx_GOTREF(__pyx_t_1);
5013 __Pyx_INCREF(((PyObject *)__pyx_v_tn));
5014 __Pyx_GIVEREF(((PyObject *)__pyx_v_tn));
5015 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_tn));
5016 __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureNode), __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error)
5017 __Pyx_GOTREF(__pyx_t_4);
5018 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5019 __Pyx_XDECREF_SET(__pyx_v_itex, ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_4));
5020 __pyx_t_4 = 0;
5684 __Pyx_XDECREF_SET(__pyx_v_itex, ((struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)__pyx_t_1));
5685 __pyx_t_1 = 0;
50215686
50225687 /* "pygame_sdl2/render.pyx":260
50235688 * iname, idict = itm
50265691 * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.source_rect, "frame")
50275692 * f = idict["spriteSourceSize"]
50285693 */
5029 __pyx_t_4 = PyObject_GetItem(__pyx_v_idict, __pyx_n_u_frame); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 260, __pyx_L1_error)
5030 __Pyx_GOTREF(__pyx_t_4);
5031 __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_4);
5032 __pyx_t_4 = 0;
5694 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_idict, __pyx_n_u_frame); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
5695 __Pyx_GOTREF(__pyx_t_1);
5696 __Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_1);
5697 __pyx_t_1 = 0;
50335698
50345699 /* "pygame_sdl2/render.pyx":261
50355700 * itex = TextureNode(tn)
50385703 * f = idict["spriteSourceSize"]
50395704 * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize")
50405705 */
5041 __pyx_t_4 = PyObject_GetItem(__pyx_v_f, __pyx_n_u_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
5706 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_u_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
5707 __Pyx_GOTREF(__pyx_t_1);
5708 __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_u_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
50425709 __Pyx_GOTREF(__pyx_t_4);
5043 __pyx_t_1 = PyObject_GetItem(__pyx_v_f, __pyx_n_u_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
5044 __Pyx_GOTREF(__pyx_t_1);
5045 __pyx_t_5 = PyObject_GetItem(__pyx_v_f, __pyx_n_u_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 261, __pyx_L1_error)
5710 __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_u_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 261, __pyx_L1_error)
50465711 __Pyx_GOTREF(__pyx_t_5);
5047 __pyx_t_2 = PyObject_GetItem(__pyx_v_f, __pyx_n_u_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error)
5712 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_u_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error)
50485713 __Pyx_GOTREF(__pyx_t_2);
50495714 __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 261, __pyx_L1_error)
50505715 __Pyx_GOTREF(__pyx_t_11);
5716 __Pyx_GIVEREF(__pyx_t_1);
5717 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
50515718 __Pyx_GIVEREF(__pyx_t_4);
5052 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4);
5053 __Pyx_GIVEREF(__pyx_t_1);
5054 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_1);
5719 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
50555720 __Pyx_GIVEREF(__pyx_t_5);
50565721 PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_5);
50575722 __Pyx_GIVEREF(__pyx_t_2);
50585723 PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_2);
5724 __pyx_t_1 = 0;
50595725 __pyx_t_4 = 0;
5060 __pyx_t_1 = 0;
50615726 __pyx_t_5 = 0;
50625727 __pyx_t_2 = 0;
50635728 __pyx_t_12.__pyx_n = 1;
50645729 __pyx_t_12.argname = __pyx_n_u_frame;
5065 __pyx_t_9 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_11, (&__pyx_v_itex->source_rect), &__pyx_t_12); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 261, __pyx_L1_error)
5730 __pyx_t_9 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_11, (&__pyx_v_itex->source_rect), &__pyx_t_12); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 261, __pyx_L1_error)
50665731 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
50675732
50685733 /* "pygame_sdl2/render.pyx":262
50725737 * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize")
50735738 * if idict["rotated"]:
50745739 */
5075 __pyx_t_11 = PyObject_GetItem(__pyx_v_idict, __pyx_n_u_spriteSourceSize); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 262, __pyx_L1_error)
5740 __pyx_t_11 = __Pyx_PyObject_Dict_GetItem(__pyx_v_idict, __pyx_n_u_spriteSourceSize); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 262, __pyx_L1_error)
50765741 __Pyx_GOTREF(__pyx_t_11);
50775742 __Pyx_DECREF_SET(__pyx_v_f, __pyx_t_11);
50785743 __pyx_t_11 = 0;
50845749 * if idict["rotated"]:
50855750 * raise error("Rotation not supported yet.")
50865751 */
5087 __pyx_t_11 = PyObject_GetItem(__pyx_v_f, __pyx_n_u_x); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 263, __pyx_L1_error)
5752 __pyx_t_11 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_u_x); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 263, __pyx_L1_error)
50885753 __Pyx_GOTREF(__pyx_t_11);
5089 __pyx_t_2 = PyObject_GetItem(__pyx_v_f, __pyx_n_u_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error)
5754 __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_u_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error)
50905755 __Pyx_GOTREF(__pyx_t_2);
5091 __pyx_t_5 = PyObject_GetItem(__pyx_v_f, __pyx_n_u_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error)
5756 __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_u_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error)
50925757 __Pyx_GOTREF(__pyx_t_5);
5093 __pyx_t_1 = PyObject_GetItem(__pyx_v_f, __pyx_n_u_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error)
5758 __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_f, __pyx_n_u_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error)
5759 __Pyx_GOTREF(__pyx_t_4);
5760 __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error)
50945761 __Pyx_GOTREF(__pyx_t_1);
5095 __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error)
5096 __Pyx_GOTREF(__pyx_t_4);
50975762 __Pyx_GIVEREF(__pyx_t_11);
5098 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11);
5763 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11);
50995764 __Pyx_GIVEREF(__pyx_t_2);
5100 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
5765 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
51015766 __Pyx_GIVEREF(__pyx_t_5);
5102 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5);
5103 __Pyx_GIVEREF(__pyx_t_1);
5104 PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_1);
5767 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5);
5768 __Pyx_GIVEREF(__pyx_t_4);
5769 PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
51055770 __pyx_t_11 = 0;
51065771 __pyx_t_2 = 0;
51075772 __pyx_t_5 = 0;
5108 __pyx_t_1 = 0;
5773 __pyx_t_4 = 0;
51095774 __pyx_t_12.__pyx_n = 1;
51105775 __pyx_t_12.argname = __pyx_n_u_spriteSourceSize;
5111 __pyx_t_9 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_4, (&__pyx_v_itex->trimmed_rect), &__pyx_t_12); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 263, __pyx_L1_error)
5112 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5776 __pyx_t_9 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_1, (&__pyx_v_itex->trimmed_rect), &__pyx_t_12); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 263, __pyx_L1_error)
5777 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51135778
51145779 /* "pygame_sdl2/render.pyx":264
51155780 * f = idict["spriteSourceSize"]
51185783 * raise error("Rotation not supported yet.")
51195784 * itex.source_w = idict["sourceSize"]["w"]
51205785 */
5121 __pyx_t_4 = PyObject_GetItem(__pyx_v_idict, __pyx_n_u_rotated); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
5122 __Pyx_GOTREF(__pyx_t_4);
5123 __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 264, __pyx_L1_error)
5124 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5125 if (__pyx_t_13) {
5786 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_idict, __pyx_n_u_rotated); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error)
5787 __Pyx_GOTREF(__pyx_t_1);
5788 __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 264, __pyx_L1_error)
5789 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5790 if (unlikely(__pyx_t_13)) {
51265791
51275792 /* "pygame_sdl2/render.pyx":265
51285793 * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize")
51315796 * itex.source_w = idict["sourceSize"]["w"]
51325797 * itex.source_h = idict["sourceSize"]["h"]
51335798 */
5134 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error)
5799 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error)
5800 __Pyx_GOTREF(__pyx_t_1);
5801 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error)
51355802 __Pyx_GOTREF(__pyx_t_4);
5136 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error)
5137 __Pyx_GOTREF(__pyx_t_1);
5803 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5804 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
51385805 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5139 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5140 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51415806 __PYX_ERR(0, 265, __pyx_L1_error)
51425807
51435808 /* "pygame_sdl2/render.pyx":264
51565821 * itex.source_h = idict["sourceSize"]["h"]
51575822 *
51585823 */
5159 __pyx_t_1 = PyObject_GetItem(__pyx_v_idict, __pyx_n_u_sourceSize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
5824 __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_idict, __pyx_n_u_sourceSize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
5825 __Pyx_GOTREF(__pyx_t_4);
5826 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_u_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
51605827 __Pyx_GOTREF(__pyx_t_1);
5161 __pyx_t_4 = PyObject_GetItem(__pyx_t_1, __pyx_n_u_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
5162 __Pyx_GOTREF(__pyx_t_4);
5828 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5829 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 266, __pyx_L1_error)
51635830 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5164 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 266, __pyx_L1_error)
5165 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
51665831 __pyx_v_itex->source_w = __pyx_t_9;
51675832
51685833 /* "pygame_sdl2/render.pyx":267
51725837 *
51735838 * self.frames[iname] = itex
51745839 */
5175 __pyx_t_4 = PyObject_GetItem(__pyx_v_idict, __pyx_n_u_sourceSize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L1_error)
5840 __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_idict, __pyx_n_u_sourceSize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error)
5841 __Pyx_GOTREF(__pyx_t_1);
5842 __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L1_error)
51765843 __Pyx_GOTREF(__pyx_t_4);
5177 __pyx_t_1 = PyObject_GetItem(__pyx_t_4, __pyx_n_u_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error)
5178 __Pyx_GOTREF(__pyx_t_1);
5844 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5845 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 267, __pyx_L1_error)
51795846 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5180 __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 267, __pyx_L1_error)
5181 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51825847 __pyx_v_itex->source_h = __pyx_t_9;
51835848
51845849 /* "pygame_sdl2/render.pyx":269
52605925 * def keys(self):
52615926 */
52625927 __Pyx_XDECREF(__pyx_r);
5263 __pyx_t_1 = PyObject_GetItem(__pyx_v_self->frames, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
5928 __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->frames, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
52645929 __Pyx_GOTREF(__pyx_t_1);
52655930 __pyx_r = __pyx_t_1;
52665931 __pyx_t_1 = 0;
53606025 __Pyx_XDECREF(__pyx_t_2);
53616026 __Pyx_XDECREF(__pyx_t_3);
53626027 __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.keys", __pyx_clineno, __pyx_lineno, __pyx_filename);
6028 __pyx_r = NULL;
6029 __pyx_L0:;
6030 __Pyx_XGIVEREF(__pyx_r);
6031 __Pyx_RefNannyFinishContext();
6032 return __pyx_r;
6033 }
6034
6035 /* "(tree fragment)":1
6036 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6037 * cdef bint use_setstate
6038 * state = (self.frames,)
6039 */
6040
6041 /* Python wrapper */
6042 static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
6043 static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6044 PyObject *__pyx_r = 0;
6045 __Pyx_RefNannyDeclarations
6046 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6047 __pyx_r = __pyx_pf_11pygame_sdl2_6render_12TextureAtlas_6__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)__pyx_v_self));
6048
6049 /* function exit code */
6050 __Pyx_RefNannyFinishContext();
6051 return __pyx_r;
6052 }
6053
6054 static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_6__reduce_cython__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self) {
6055 int __pyx_v_use_setstate;
6056 PyObject *__pyx_v_state = NULL;
6057 PyObject *__pyx_v__dict = NULL;
6058 PyObject *__pyx_r = NULL;
6059 __Pyx_RefNannyDeclarations
6060 PyObject *__pyx_t_1 = NULL;
6061 int __pyx_t_2;
6062 int __pyx_t_3;
6063 PyObject *__pyx_t_4 = NULL;
6064 PyObject *__pyx_t_5 = NULL;
6065 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6066
6067 /* "(tree fragment)":3
6068 * def __reduce_cython__(self):
6069 * cdef bint use_setstate
6070 * state = (self.frames,) # <<<<<<<<<<<<<<
6071 * _dict = getattr(self, '__dict__', None)
6072 * if _dict is not None:
6073 */
6074 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
6075 __Pyx_GOTREF(__pyx_t_1);
6076 __Pyx_INCREF(__pyx_v_self->frames);
6077 __Pyx_GIVEREF(__pyx_v_self->frames);
6078 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->frames);
6079 __pyx_v_state = ((PyObject*)__pyx_t_1);
6080 __pyx_t_1 = 0;
6081
6082 /* "(tree fragment)":4
6083 * cdef bint use_setstate
6084 * state = (self.frames,)
6085 * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
6086 * if _dict is not None:
6087 * state += (_dict,)
6088 */
6089 __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
6090 __Pyx_GOTREF(__pyx_t_1);
6091 __pyx_v__dict = __pyx_t_1;
6092 __pyx_t_1 = 0;
6093
6094 /* "(tree fragment)":5
6095 * state = (self.frames,)
6096 * _dict = getattr(self, '__dict__', None)
6097 * if _dict is not None: # <<<<<<<<<<<<<<
6098 * state += (_dict,)
6099 * use_setstate = True
6100 */
6101 __pyx_t_2 = (__pyx_v__dict != Py_None);
6102 __pyx_t_3 = (__pyx_t_2 != 0);
6103 if (__pyx_t_3) {
6104
6105 /* "(tree fragment)":6
6106 * _dict = getattr(self, '__dict__', None)
6107 * if _dict is not None:
6108 * state += (_dict,) # <<<<<<<<<<<<<<
6109 * use_setstate = True
6110 * else:
6111 */
6112 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
6113 __Pyx_GOTREF(__pyx_t_1);
6114 __Pyx_INCREF(__pyx_v__dict);
6115 __Pyx_GIVEREF(__pyx_v__dict);
6116 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
6117 __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
6118 __Pyx_GOTREF(__pyx_t_4);
6119 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6120 __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
6121 __pyx_t_4 = 0;
6122
6123 /* "(tree fragment)":7
6124 * if _dict is not None:
6125 * state += (_dict,)
6126 * use_setstate = True # <<<<<<<<<<<<<<
6127 * else:
6128 * use_setstate = self.frames is not None
6129 */
6130 __pyx_v_use_setstate = 1;
6131
6132 /* "(tree fragment)":5
6133 * state = (self.frames,)
6134 * _dict = getattr(self, '__dict__', None)
6135 * if _dict is not None: # <<<<<<<<<<<<<<
6136 * state += (_dict,)
6137 * use_setstate = True
6138 */
6139 goto __pyx_L3;
6140 }
6141
6142 /* "(tree fragment)":9
6143 * use_setstate = True
6144 * else:
6145 * use_setstate = self.frames is not None # <<<<<<<<<<<<<<
6146 * if use_setstate:
6147 * return __pyx_unpickle_TextureAtlas, (type(self), 0xdcdc1ac, None), state
6148 */
6149 /*else*/ {
6150 __pyx_t_3 = (__pyx_v_self->frames != Py_None);
6151 __pyx_v_use_setstate = __pyx_t_3;
6152 }
6153 __pyx_L3:;
6154
6155 /* "(tree fragment)":10
6156 * else:
6157 * use_setstate = self.frames is not None
6158 * if use_setstate: # <<<<<<<<<<<<<<
6159 * return __pyx_unpickle_TextureAtlas, (type(self), 0xdcdc1ac, None), state
6160 * else:
6161 */
6162 __pyx_t_3 = (__pyx_v_use_setstate != 0);
6163 if (__pyx_t_3) {
6164
6165 /* "(tree fragment)":11
6166 * use_setstate = self.frames is not None
6167 * if use_setstate:
6168 * return __pyx_unpickle_TextureAtlas, (type(self), 0xdcdc1ac, None), state # <<<<<<<<<<<<<<
6169 * else:
6170 * return __pyx_unpickle_TextureAtlas, (type(self), 0xdcdc1ac, state)
6171 */
6172 __Pyx_XDECREF(__pyx_r);
6173 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_TextureAtlas); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 11, __pyx_L1_error)
6174 __Pyx_GOTREF(__pyx_t_4);
6175 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error)
6176 __Pyx_GOTREF(__pyx_t_1);
6177 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6178 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6179 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6180 __Pyx_INCREF(__pyx_int_231588268);
6181 __Pyx_GIVEREF(__pyx_int_231588268);
6182 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_231588268);
6183 __Pyx_INCREF(Py_None);
6184 __Pyx_GIVEREF(Py_None);
6185 PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
6186 __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 11, __pyx_L1_error)
6187 __Pyx_GOTREF(__pyx_t_5);
6188 __Pyx_GIVEREF(__pyx_t_4);
6189 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
6190 __Pyx_GIVEREF(__pyx_t_1);
6191 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
6192 __Pyx_INCREF(__pyx_v_state);
6193 __Pyx_GIVEREF(__pyx_v_state);
6194 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
6195 __pyx_t_4 = 0;
6196 __pyx_t_1 = 0;
6197 __pyx_r = __pyx_t_5;
6198 __pyx_t_5 = 0;
6199 goto __pyx_L0;
6200
6201 /* "(tree fragment)":10
6202 * else:
6203 * use_setstate = self.frames is not None
6204 * if use_setstate: # <<<<<<<<<<<<<<
6205 * return __pyx_unpickle_TextureAtlas, (type(self), 0xdcdc1ac, None), state
6206 * else:
6207 */
6208 }
6209
6210 /* "(tree fragment)":13
6211 * return __pyx_unpickle_TextureAtlas, (type(self), 0xdcdc1ac, None), state
6212 * else:
6213 * return __pyx_unpickle_TextureAtlas, (type(self), 0xdcdc1ac, state) # <<<<<<<<<<<<<<
6214 * def __setstate_cython__(self, __pyx_state):
6215 * __pyx_unpickle_TextureAtlas__set_state(self, __pyx_state)
6216 */
6217 /*else*/ {
6218 __Pyx_XDECREF(__pyx_r);
6219 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_TextureAtlas); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
6220 __Pyx_GOTREF(__pyx_t_5);
6221 __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
6222 __Pyx_GOTREF(__pyx_t_1);
6223 __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6224 __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6225 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6226 __Pyx_INCREF(__pyx_int_231588268);
6227 __Pyx_GIVEREF(__pyx_int_231588268);
6228 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_231588268);
6229 __Pyx_INCREF(__pyx_v_state);
6230 __Pyx_GIVEREF(__pyx_v_state);
6231 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
6232 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
6233 __Pyx_GOTREF(__pyx_t_4);
6234 __Pyx_GIVEREF(__pyx_t_5);
6235 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6236 __Pyx_GIVEREF(__pyx_t_1);
6237 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
6238 __pyx_t_5 = 0;
6239 __pyx_t_1 = 0;
6240 __pyx_r = __pyx_t_4;
6241 __pyx_t_4 = 0;
6242 goto __pyx_L0;
6243 }
6244
6245 /* "(tree fragment)":1
6246 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6247 * cdef bint use_setstate
6248 * state = (self.frames,)
6249 */
6250
6251 /* function exit code */
6252 __pyx_L1_error:;
6253 __Pyx_XDECREF(__pyx_t_1);
6254 __Pyx_XDECREF(__pyx_t_4);
6255 __Pyx_XDECREF(__pyx_t_5);
6256 __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6257 __pyx_r = NULL;
6258 __pyx_L0:;
6259 __Pyx_XDECREF(__pyx_v_state);
6260 __Pyx_XDECREF(__pyx_v__dict);
6261 __Pyx_XGIVEREF(__pyx_r);
6262 __Pyx_RefNannyFinishContext();
6263 return __pyx_r;
6264 }
6265
6266 /* "(tree fragment)":14
6267 * else:
6268 * return __pyx_unpickle_TextureAtlas, (type(self), 0xdcdc1ac, state)
6269 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6270 * __pyx_unpickle_TextureAtlas__set_state(self, __pyx_state)
6271 */
6272
6273 /* Python wrapper */
6274 static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
6275 static PyObject *__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6276 PyObject *__pyx_r = 0;
6277 __Pyx_RefNannyDeclarations
6278 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6279 __pyx_r = __pyx_pf_11pygame_sdl2_6render_12TextureAtlas_8__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6280
6281 /* function exit code */
6282 __Pyx_RefNannyFinishContext();
6283 return __pyx_r;
6284 }
6285
6286 static PyObject *__pyx_pf_11pygame_sdl2_6render_12TextureAtlas_8__setstate_cython__(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6287 PyObject *__pyx_r = NULL;
6288 __Pyx_RefNannyDeclarations
6289 PyObject *__pyx_t_1 = NULL;
6290 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
6291
6292 /* "(tree fragment)":15
6293 * return __pyx_unpickle_TextureAtlas, (type(self), 0xdcdc1ac, state)
6294 * def __setstate_cython__(self, __pyx_state):
6295 * __pyx_unpickle_TextureAtlas__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
6296 */
6297 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 15, __pyx_L1_error)
6298 __pyx_t_1 = __pyx_f_11pygame_sdl2_6render___pyx_unpickle_TextureAtlas__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
6299 __Pyx_GOTREF(__pyx_t_1);
6300 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6301
6302 /* "(tree fragment)":14
6303 * else:
6304 * return __pyx_unpickle_TextureAtlas, (type(self), 0xdcdc1ac, state)
6305 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6306 * __pyx_unpickle_TextureAtlas__set_state(self, __pyx_state)
6307 */
6308
6309 /* function exit code */
6310 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6311 goto __pyx_L0;
6312 __pyx_L1_error:;
6313 __Pyx_XDECREF(__pyx_t_1);
6314 __Pyx_AddTraceback("pygame_sdl2.render.TextureAtlas.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
53636315 __pyx_r = NULL;
53646316 __pyx_L0:;
53656317 __Pyx_XGIVEREF(__pyx_r);
53906342 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
53916343 switch (pos_args) {
53926344 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6345 CYTHON_FALLTHROUGH;
53936346 case 0: break;
53946347 default: goto __pyx_L5_argtuple_error;
53956348 }
53966349 kw_args = PyDict_Size(__pyx_kwds);
53976350 switch (pos_args) {
53986351 case 0:
5399 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nodes)) != 0)) kw_args--;
6352 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nodes)) != 0)) kw_args--;
54006353 else goto __pyx_L5_argtuple_error;
54016354 }
54026355 if (unlikely(kw_args > 0)) {
55096462 * memset(&self.bounding_box, 0, sizeof(SDL_Rect))
55106463 *
55116464 */
5512 memset((&__pyx_v_self->_pos), 0, (sizeof(SDL_Rect)));
6465 (void)(memset((&__pyx_v_self->_pos), 0, (sizeof(SDL_Rect))));
55136466
55146467 /* "pygame_sdl2/render.pyx":301
55156468 *
55186471 *
55196472 * if isinstance(nodes, TextureNode):
55206473 */
5521 memset((&__pyx_v_self->bounding_box), 0, (sizeof(SDL_Rect)));
6474 (void)(memset((&__pyx_v_self->bounding_box), 0, (sizeof(SDL_Rect))));
55226475
55236476 /* "pygame_sdl2/render.pyx":303
55246477 * memset(&self.bounding_box, 0, sizeof(SDL_Rect))
56096562 if (unlikely(!__pyx_t_6)) {
56106563 PyObject* exc_type = PyErr_Occurred();
56116564 if (exc_type) {
5612 if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
6565 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
56136566 else __PYX_ERR(0, 308, __pyx_L1_error)
56146567 }
56156568 break;
56286581 */
56296582 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_node, __pyx_ptype_11pygame_sdl2_6render_TextureNode);
56306583 __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
5631 if (__pyx_t_1) {
6584 if (unlikely(__pyx_t_1)) {
56326585
56336586 /* "pygame_sdl2/render.pyx":310
56346587 * for node in nodes:
56396592 */
56406593 __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_Invalid_argument_s, __pyx_v_node); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L1_error)
56416594 __Pyx_GOTREF(__pyx_t_6);
5642 __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 310, __pyx_L1_error)
6595 __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 310, __pyx_L1_error)
56436596 __Pyx_GOTREF(__pyx_t_7);
5644 __Pyx_GIVEREF(__pyx_t_6);
5645 PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
5646 __pyx_t_6 = 0;
5647 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L1_error)
5648 __Pyx_GOTREF(__pyx_t_6);
6597 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6598 __Pyx_Raise(__pyx_t_7, 0, 0, 0);
56496599 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5650 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
5651 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
56526600 __PYX_ERR(0, 310, __pyx_L1_error)
56536601
56546602 /* "pygame_sdl2/render.pyx":309
56776625 * cdef void adjust_rect(Sprite self, const SDL_Rect *dest, const SDL_Rect *rin, SDL_Rect *rout) nogil:
56786626 */
56796627 if (unlikely(__pyx_v_self->nodes == Py_None)) {
5680 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
6628 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
56816629 __PYX_ERR(0, 313, __pyx_L1_error)
56826630 }
5683 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->nodes, __pyx_v_node); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 313, __pyx_L1_error)
6631 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->nodes, __pyx_v_node); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 313, __pyx_L1_error)
56846632
56856633 /* "pygame_sdl2/render.pyx":308
56866634 * self.nodes = []
57976745 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
57986746 switch (pos_args) {
57996747 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6748 CYTHON_FALLTHROUGH;
58006749 case 0: break;
58016750 default: goto __pyx_L5_argtuple_error;
58026751 }
58046753 switch (pos_args) {
58056754 case 0:
58066755 if (kw_args > 0) {
5807 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest);
6756 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dest);
58086757 if (value) { values[0] = value; kw_args--; }
58096758 }
58106759 }
58146763 } else {
58156764 switch (PyTuple_GET_SIZE(__pyx_args)) {
58166765 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6766 CYTHON_FALLTHROUGH;
58176767 case 0: break;
58186768 default: goto __pyx_L5_argtuple_error;
58196769 }
58896839 * else:
58906840 * to_sdl_rect(dest, &dest_rect)
58916841 */
5892 memcpy((&__pyx_v_dest_rect), (&__pyx_v_self->_pos), (sizeof(SDL_Rect)));
6842 (void)(memcpy((&__pyx_v_dest_rect), (&__pyx_v_self->_pos), (sizeof(SDL_Rect))));
58936843
58946844 /* "pygame_sdl2/render.pyx":327
58956845 * cdef SDL_Point pivot
59096859 * with nogil:
59106860 */
59116861 /*else*/ {
5912 __pyx_t_5 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_dest, (&__pyx_v_dest_rect), NULL); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 330, __pyx_L1_error)
6862 __pyx_t_5 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_dest, (&__pyx_v_dest_rect), NULL); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 330, __pyx_L1_error)
59136863 }
59146864 __pyx_L3:;
59156865
59246874 #ifdef WITH_THREAD
59256875 PyThreadState *_save;
59266876 Py_UNBLOCK_THREADS
6877 __Pyx_FastGIL_Remember();
59276878 #endif
59286879 /*try:*/ {
59296880
59346885 * SDL_SetTextureAlphaMod(tex.texture, self._color.a)
59356886 *
59366887 */
5937 SDL_SetTextureColorMod(__pyx_v_tex->texture, __pyx_v_self->_color.r, __pyx_v_self->_color.g, __pyx_v_self->_color.b);
6888 (void)(SDL_SetTextureColorMod(__pyx_v_tex->texture, __pyx_v_self->_color.r, __pyx_v_self->_color.g, __pyx_v_self->_color.b));
59386889
59396890 /* "pygame_sdl2/render.pyx":334
59406891 * with nogil:
59436894 *
59446895 * if DEBUG_DRAW_BBOX:
59456896 */
5946 SDL_SetTextureAlphaMod(__pyx_v_tex->texture, __pyx_v_self->_color.a);
6897 (void)(SDL_SetTextureAlphaMod(__pyx_v_tex->texture, __pyx_v_self->_color.a));
59476898
59486899 /* "pygame_sdl2/render.pyx":336
59496900 * SDL_SetTextureAlphaMod(tex.texture, self._color.a)
59716922 *
59726923 * cdef TextureNode tn
59736924 */
5974 SDL_SetRenderDrawColor(__pyx_v_tex->renderer, 0x00, 0x00, 0x00, 0x00);
6925 (void)(SDL_SetRenderDrawColor(__pyx_v_tex->renderer, 0x00, 0x00, 0x00, 0x00));
59756926
59766927 /* "pygame_sdl2/render.pyx":336
59776928 * SDL_SetTextureAlphaMod(tex.texture, self._color.a)
59936944 /*finally:*/ {
59946945 /*normal exit:*/{
59956946 #ifdef WITH_THREAD
6947 __Pyx_FastGIL_Forget();
59966948 Py_BLOCK_THREADS
59976949 #endif
59986950 goto __pyx_L6;
60476999 #ifdef WITH_THREAD
60487000 PyThreadState *_save;
60497001 Py_UNBLOCK_THREADS
7002 __Pyx_FastGIL_Remember();
60507003 #endif
60517004 /*try:*/ {
60527005
60847037 * &real_dest, self._rotation, &pivot,
60857038 * <SDL_RendererFlip>self._flip)
60867039 */
6087 SDL_RenderCopyEx(__pyx_v_tex->renderer, __pyx_v_tex->texture, (&__pyx_v_tn->source_rect), (&__pyx_v_real_dest), __pyx_v_self->_rotation, (&__pyx_v_pivot), ((SDL_RendererFlip)__pyx_v_self->_flip));
7040 (void)(SDL_RenderCopyEx(__pyx_v_tex->renderer, __pyx_v_tex->texture, (&__pyx_v_tn->source_rect), (&__pyx_v_real_dest), __pyx_v_self->_rotation, (&__pyx_v_pivot), ((SDL_RendererFlip)__pyx_v_self->_flip)));
60887041 }
60897042
60907043 /* "pygame_sdl2/render.pyx":346
60977050 /*finally:*/ {
60987051 /*normal exit:*/{
60997052 #ifdef WITH_THREAD
7053 __Pyx_FastGIL_Forget();
61007054 Py_BLOCK_THREADS
61017055 #endif
61027056 goto __pyx_L14;
64167370 */
64177371 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error)
64187372 __Pyx_GOTREF(__pyx_t_1);
6419 __pyx_t_2 = PyObject_IsInstance(__pyx_v_val, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 374, __pyx_L1_error)
7373 __pyx_t_2 = PyObject_IsInstance(__pyx_v_val, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 374, __pyx_L1_error)
64207374 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
64217375 __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
64227376 if (__pyx_t_3) {
69587912 */
69597913 if ((likely(PyTuple_CheckExact(__pyx_v_arg))) || (PyList_CheckExact(__pyx_v_arg))) {
69607914 PyObject* sequence = __pyx_v_arg;
6961 #if !CYTHON_COMPILING_IN_PYPY
6962 Py_ssize_t size = Py_SIZE(sequence);
6963 #else
6964 Py_ssize_t size = PySequence_Size(sequence);
6965 #endif
7915 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
69667916 if (unlikely(size != 2)) {
69677917 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
69687918 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
73728322 return __pyx_r;
73738323 }
73748324
8325 /* "(tree fragment)":1
8326 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8327 * raise TypeError("Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)")
8328 * def __setstate_cython__(self, __pyx_state):
8329 */
8330
8331 /* Python wrapper */
8332 static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
8333 static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8334 PyObject *__pyx_r = 0;
8335 __Pyx_RefNannyDeclarations
8336 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
8337 __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_6__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self));
8338
8339 /* function exit code */
8340 __Pyx_RefNannyFinishContext();
8341 return __pyx_r;
8342 }
8343
8344 static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self) {
8345 PyObject *__pyx_r = NULL;
8346 __Pyx_RefNannyDeclarations
8347 PyObject *__pyx_t_1 = NULL;
8348 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
8349
8350 /* "(tree fragment)":2
8351 * def __reduce_cython__(self):
8352 * raise TypeError("Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)") # <<<<<<<<<<<<<<
8353 * def __setstate_cython__(self, __pyx_state):
8354 * raise TypeError("Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)")
8355 */
8356 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
8357 __Pyx_GOTREF(__pyx_t_1);
8358 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8359 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8360 __PYX_ERR(1, 2, __pyx_L1_error)
8361
8362 /* "(tree fragment)":1
8363 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8364 * raise TypeError("Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)")
8365 * def __setstate_cython__(self, __pyx_state):
8366 */
8367
8368 /* function exit code */
8369 __pyx_L1_error:;
8370 __Pyx_XDECREF(__pyx_t_1);
8371 __Pyx_AddTraceback("pygame_sdl2.render.Sprite.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8372 __pyx_r = NULL;
8373 __Pyx_XGIVEREF(__pyx_r);
8374 __Pyx_RefNannyFinishContext();
8375 return __pyx_r;
8376 }
8377
8378 /* "(tree fragment)":3
8379 * def __reduce_cython__(self):
8380 * raise TypeError("Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)")
8381 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8382 * raise TypeError("Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)")
8383 */
8384
8385 /* Python wrapper */
8386 static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
8387 static PyObject *__pyx_pw_11pygame_sdl2_6render_6Sprite_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8388 PyObject *__pyx_r = 0;
8389 __Pyx_RefNannyDeclarations
8390 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
8391 __pyx_r = __pyx_pf_11pygame_sdl2_6render_6Sprite_8__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Sprite *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8392
8393 /* function exit code */
8394 __Pyx_RefNannyFinishContext();
8395 return __pyx_r;
8396 }
8397
8398 static PyObject *__pyx_pf_11pygame_sdl2_6render_6Sprite_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Sprite *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
8399 PyObject *__pyx_r = NULL;
8400 __Pyx_RefNannyDeclarations
8401 PyObject *__pyx_t_1 = NULL;
8402 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
8403
8404 /* "(tree fragment)":4
8405 * raise TypeError("Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)")
8406 * def __setstate_cython__(self, __pyx_state):
8407 * raise TypeError("Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)") # <<<<<<<<<<<<<<
8408 */
8409 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
8410 __Pyx_GOTREF(__pyx_t_1);
8411 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8412 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8413 __PYX_ERR(1, 4, __pyx_L1_error)
8414
8415 /* "(tree fragment)":3
8416 * def __reduce_cython__(self):
8417 * raise TypeError("Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)")
8418 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8419 * raise TypeError("Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)")
8420 */
8421
8422 /* function exit code */
8423 __pyx_L1_error:;
8424 __Pyx_XDECREF(__pyx_t_1);
8425 __Pyx_AddTraceback("pygame_sdl2.render.Sprite.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8426 __pyx_r = NULL;
8427 __Pyx_XGIVEREF(__pyx_r);
8428 __Pyx_RefNannyFinishContext();
8429 return __pyx_r;
8430 }
8431
73758432 /* "pygame_sdl2/render.pyx":439
73768433 * cdef list sprites
73778434 *
73998456 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
74008457 switch (pos_args) {
74018458 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8459 CYTHON_FALLTHROUGH;
74028460 case 0: break;
74038461 default: goto __pyx_L5_argtuple_error;
74048462 }
74058463 kw_args = PyDict_Size(__pyx_kwds);
74068464 switch (pos_args) {
74078465 case 0:
7408 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
8466 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
74098467 else goto __pyx_L5_argtuple_error;
74108468 }
74118469 if (unlikely(kw_args > 0)) {
74648522 * if len(rect) == 2:
74658523 * self._rect.w = self._rect.h = 0
74668524 */
7467 __pyx_t_2 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_self->_rect), NULL); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 443, __pyx_L1_error)
8525 __pyx_t_2 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_self->_rect), NULL); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 443, __pyx_L1_error)
74688526
74698527 /* "pygame_sdl2/render.pyx":444
74708528 * self.sprites = []
74738531 * self._rect.w = self._rect.h = 0
74748532 *
74758533 */
7476 __pyx_t_3 = PyObject_Length(__pyx_v_rect); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 444, __pyx_L1_error)
8534 __pyx_t_3 = PyObject_Length(__pyx_v_rect); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 444, __pyx_L1_error)
74778535 __pyx_t_4 = ((__pyx_t_3 == 2) != 0);
74788536 if (__pyx_t_4) {
74798537
75568614 * def render(self, dest=None):
75578615 */
75588616 if (unlikely(__pyx_v_self->sprites == Py_None)) {
7559 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
8617 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
75608618 __PYX_ERR(0, 448, __pyx_L1_error)
75618619 }
7562 __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->sprites, ((PyObject *)__pyx_v_sprite)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 448, __pyx_L1_error)
8620 __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->sprites, ((PyObject *)__pyx_v_sprite)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 448, __pyx_L1_error)
75638621
75648622 /* "pygame_sdl2/render.pyx":447
75658623 * self._rect.w = self._rect.h = 0
76058663 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
76068664 switch (pos_args) {
76078665 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8666 CYTHON_FALLTHROUGH;
76088667 case 0: break;
76098668 default: goto __pyx_L5_argtuple_error;
76108669 }
76128671 switch (pos_args) {
76138672 case 0:
76148673 if (kw_args > 0) {
7615 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest);
8674 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dest);
76168675 if (value) { values[0] = value; kw_args--; }
76178676 }
76188677 }
76228681 } else {
76238682 switch (PyTuple_GET_SIZE(__pyx_args)) {
76248683 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8684 CYTHON_FALLTHROUGH;
76258685 case 0: break;
76268686 default: goto __pyx_L5_argtuple_error;
76278687 }
77108770 *
77118771 * for s in self.sprites:
77128772 */
7713 SDL_RenderSetClipRect(__pyx_v_ren, (&__pyx_v_self->_rect));
8773 (void)(SDL_RenderSetClipRect(__pyx_v_ren, (&__pyx_v_self->_rect)));
77148774
77158775 /* "pygame_sdl2/render.pyx":454
77168776 * cdef SDL_Renderer *ren = (<TextureNode>(<Sprite>self.sprites[0]).nodes[0]).texture.renderer
78488908 *
78498909 * property pos:
78508910 */
7851 SDL_RenderSetClipRect(__pyx_v_ren, NULL);
8911 (void)(SDL_RenderSetClipRect(__pyx_v_ren, NULL));
78528912
78538913 /* "pygame_sdl2/render.pyx":450
78548914 * self.sprites.append(sprite)
82019261 * to_sdl_rect(val, &self._rect) # <<<<<<<<<<<<<<
82029262 *
82039263 */
8204 __pyx_t_1 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_val, (&__pyx_v_self->_rect), NULL); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 476, __pyx_L1_error)
9264 __pyx_t_1 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_val, (&__pyx_v_self->_rect), NULL); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 476, __pyx_L1_error)
82059265
82069266 /* "pygame_sdl2/render.pyx":475
82079267 * return Rect(self._rect.x, self._rect.y, self._rect.w, self._rect.h)
82189278 __Pyx_AddTraceback("pygame_sdl2.render.Container.rect.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
82199279 __pyx_r = -1;
82209280 __pyx_L0:;
9281 __Pyx_RefNannyFinishContext();
9282 return __pyx_r;
9283 }
9284
9285 /* "(tree fragment)":1
9286 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9287 * raise TypeError("Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)")
9288 * def __setstate_cython__(self, __pyx_state):
9289 */
9290
9291 /* Python wrapper */
9292 static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9293 static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9294 PyObject *__pyx_r = 0;
9295 __Pyx_RefNannyDeclarations
9296 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9297 __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_6__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self));
9298
9299 /* function exit code */
9300 __Pyx_RefNannyFinishContext();
9301 return __pyx_r;
9302 }
9303
9304 static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self) {
9305 PyObject *__pyx_r = NULL;
9306 __Pyx_RefNannyDeclarations
9307 PyObject *__pyx_t_1 = NULL;
9308 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9309
9310 /* "(tree fragment)":2
9311 * def __reduce_cython__(self):
9312 * raise TypeError("Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)") # <<<<<<<<<<<<<<
9313 * def __setstate_cython__(self, __pyx_state):
9314 * raise TypeError("Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)")
9315 */
9316 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
9317 __Pyx_GOTREF(__pyx_t_1);
9318 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9319 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9320 __PYX_ERR(1, 2, __pyx_L1_error)
9321
9322 /* "(tree fragment)":1
9323 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9324 * raise TypeError("Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)")
9325 * def __setstate_cython__(self, __pyx_state):
9326 */
9327
9328 /* function exit code */
9329 __pyx_L1_error:;
9330 __Pyx_XDECREF(__pyx_t_1);
9331 __Pyx_AddTraceback("pygame_sdl2.render.Container.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9332 __pyx_r = NULL;
9333 __Pyx_XGIVEREF(__pyx_r);
9334 __Pyx_RefNannyFinishContext();
9335 return __pyx_r;
9336 }
9337
9338 /* "(tree fragment)":3
9339 * def __reduce_cython__(self):
9340 * raise TypeError("Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)")
9341 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9342 * raise TypeError("Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)")
9343 */
9344
9345 /* Python wrapper */
9346 static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
9347 static PyObject *__pyx_pw_11pygame_sdl2_6render_9Container_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9348 PyObject *__pyx_r = 0;
9349 __Pyx_RefNannyDeclarations
9350 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9351 __pyx_r = __pyx_pf_11pygame_sdl2_6render_9Container_8__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_6render_Container *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9352
9353 /* function exit code */
9354 __Pyx_RefNannyFinishContext();
9355 return __pyx_r;
9356 }
9357
9358 static PyObject *__pyx_pf_11pygame_sdl2_6render_9Container_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_6render_Container *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
9359 PyObject *__pyx_r = NULL;
9360 __Pyx_RefNannyDeclarations
9361 PyObject *__pyx_t_1 = NULL;
9362 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9363
9364 /* "(tree fragment)":4
9365 * raise TypeError("Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)")
9366 * def __setstate_cython__(self, __pyx_state):
9367 * raise TypeError("Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)") # <<<<<<<<<<<<<<
9368 */
9369 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
9370 __Pyx_GOTREF(__pyx_t_1);
9371 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9372 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9373 __PYX_ERR(1, 4, __pyx_L1_error)
9374
9375 /* "(tree fragment)":3
9376 * def __reduce_cython__(self):
9377 * raise TypeError("Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)")
9378 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9379 * raise TypeError("Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)")
9380 */
9381
9382 /* function exit code */
9383 __pyx_L1_error:;
9384 __Pyx_XDECREF(__pyx_t_1);
9385 __Pyx_AddTraceback("pygame_sdl2.render.Container.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9386 __pyx_r = NULL;
9387 __Pyx_XGIVEREF(__pyx_r);
9388 __Pyx_RefNannyFinishContext();
9389 return __pyx_r;
9390 }
9391
9392 /* "(tree fragment)":1
9393 * def __pyx_unpickle_TextureAtlas(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
9394 * if __pyx_checksum != 0xdcdc1ac:
9395 * from pickle import PickleError as __pyx_PickleError
9396 */
9397
9398 /* Python wrapper */
9399 static PyObject *__pyx_pw_11pygame_sdl2_6render_3__pyx_unpickle_TextureAtlas(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9400 static PyMethodDef __pyx_mdef_11pygame_sdl2_6render_3__pyx_unpickle_TextureAtlas = {"__pyx_unpickle_TextureAtlas", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_3__pyx_unpickle_TextureAtlas, METH_VARARGS|METH_KEYWORDS, 0};
9401 static PyObject *__pyx_pw_11pygame_sdl2_6render_3__pyx_unpickle_TextureAtlas(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9402 PyObject *__pyx_v___pyx_type = 0;
9403 long __pyx_v___pyx_checksum;
9404 PyObject *__pyx_v___pyx_state = 0;
9405 PyObject *__pyx_r = 0;
9406 __Pyx_RefNannyDeclarations
9407 __Pyx_RefNannySetupContext("__pyx_unpickle_TextureAtlas (wrapper)", 0);
9408 {
9409 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
9410 PyObject* values[3] = {0,0,0};
9411 if (unlikely(__pyx_kwds)) {
9412 Py_ssize_t kw_args;
9413 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9414 switch (pos_args) {
9415 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9416 CYTHON_FALLTHROUGH;
9417 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9418 CYTHON_FALLTHROUGH;
9419 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9420 CYTHON_FALLTHROUGH;
9421 case 0: break;
9422 default: goto __pyx_L5_argtuple_error;
9423 }
9424 kw_args = PyDict_Size(__pyx_kwds);
9425 switch (pos_args) {
9426 case 0:
9427 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
9428 else goto __pyx_L5_argtuple_error;
9429 CYTHON_FALLTHROUGH;
9430 case 1:
9431 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
9432 else {
9433 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TextureAtlas", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
9434 }
9435 CYTHON_FALLTHROUGH;
9436 case 2:
9437 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
9438 else {
9439 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TextureAtlas", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
9440 }
9441 }
9442 if (unlikely(kw_args > 0)) {
9443 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_TextureAtlas") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
9444 }
9445 } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
9446 goto __pyx_L5_argtuple_error;
9447 } else {
9448 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9449 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9450 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9451 }
9452 __pyx_v___pyx_type = values[0];
9453 __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
9454 __pyx_v___pyx_state = values[2];
9455 }
9456 goto __pyx_L4_argument_unpacking_done;
9457 __pyx_L5_argtuple_error:;
9458 __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_TextureAtlas", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
9459 __pyx_L3_error:;
9460 __Pyx_AddTraceback("pygame_sdl2.render.__pyx_unpickle_TextureAtlas", __pyx_clineno, __pyx_lineno, __pyx_filename);
9461 __Pyx_RefNannyFinishContext();
9462 return NULL;
9463 __pyx_L4_argument_unpacking_done:;
9464 __pyx_r = __pyx_pf_11pygame_sdl2_6render_2__pyx_unpickle_TextureAtlas(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
9465
9466 /* function exit code */
9467 __Pyx_RefNannyFinishContext();
9468 return __pyx_r;
9469 }
9470
9471 static PyObject *__pyx_pf_11pygame_sdl2_6render_2__pyx_unpickle_TextureAtlas(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
9472 PyObject *__pyx_v___pyx_PickleError = NULL;
9473 PyObject *__pyx_v___pyx_result = NULL;
9474 PyObject *__pyx_r = NULL;
9475 __Pyx_RefNannyDeclarations
9476 int __pyx_t_1;
9477 PyObject *__pyx_t_2 = NULL;
9478 PyObject *__pyx_t_3 = NULL;
9479 PyObject *__pyx_t_4 = NULL;
9480 PyObject *__pyx_t_5 = NULL;
9481 PyObject *__pyx_t_6 = NULL;
9482 int __pyx_t_7;
9483 __Pyx_RefNannySetupContext("__pyx_unpickle_TextureAtlas", 0);
9484
9485 /* "(tree fragment)":2
9486 * def __pyx_unpickle_TextureAtlas(__pyx_type, long __pyx_checksum, __pyx_state):
9487 * if __pyx_checksum != 0xdcdc1ac: # <<<<<<<<<<<<<<
9488 * from pickle import PickleError as __pyx_PickleError
9489 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xdcdc1ac = (frames))" % __pyx_checksum)
9490 */
9491 __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xdcdc1ac) != 0);
9492 if (__pyx_t_1) {
9493
9494 /* "(tree fragment)":3
9495 * def __pyx_unpickle_TextureAtlas(__pyx_type, long __pyx_checksum, __pyx_state):
9496 * if __pyx_checksum != 0xdcdc1ac:
9497 * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
9498 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xdcdc1ac = (frames))" % __pyx_checksum)
9499 * __pyx_result = TextureAtlas.__new__(__pyx_type)
9500 */
9501 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
9502 __Pyx_GOTREF(__pyx_t_2);
9503 __Pyx_INCREF(__pyx_n_s_PickleError);
9504 __Pyx_GIVEREF(__pyx_n_s_PickleError);
9505 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
9506 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error)
9507 __Pyx_GOTREF(__pyx_t_3);
9508 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9509 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
9510 __Pyx_GOTREF(__pyx_t_2);
9511 __Pyx_INCREF(__pyx_t_2);
9512 __pyx_v___pyx_PickleError = __pyx_t_2;
9513 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9514 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9515
9516 /* "(tree fragment)":4
9517 * if __pyx_checksum != 0xdcdc1ac:
9518 * from pickle import PickleError as __pyx_PickleError
9519 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xdcdc1ac = (frames))" % __pyx_checksum) # <<<<<<<<<<<<<<
9520 * __pyx_result = TextureAtlas.__new__(__pyx_type)
9521 * if __pyx_state is not None:
9522 */
9523 __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4, __pyx_L1_error)
9524 __Pyx_GOTREF(__pyx_t_2);
9525 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xdc, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error)
9526 __Pyx_GOTREF(__pyx_t_4);
9527 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9528 __Pyx_INCREF(__pyx_v___pyx_PickleError);
9529 __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
9530 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
9531 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
9532 if (likely(__pyx_t_5)) {
9533 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
9534 __Pyx_INCREF(__pyx_t_5);
9535 __Pyx_INCREF(function);
9536 __Pyx_DECREF_SET(__pyx_t_2, function);
9537 }
9538 }
9539 if (!__pyx_t_5) {
9540 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
9541 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9542 __Pyx_GOTREF(__pyx_t_3);
9543 } else {
9544 #if CYTHON_FAST_PYCALL
9545 if (PyFunction_Check(__pyx_t_2)) {
9546 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
9547 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
9548 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9549 __Pyx_GOTREF(__pyx_t_3);
9550 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9551 } else
9552 #endif
9553 #if CYTHON_FAST_PYCCALL
9554 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
9555 PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
9556 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
9557 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9558 __Pyx_GOTREF(__pyx_t_3);
9559 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9560 } else
9561 #endif
9562 {
9563 __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 4, __pyx_L1_error)
9564 __Pyx_GOTREF(__pyx_t_6);
9565 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
9566 __Pyx_GIVEREF(__pyx_t_4);
9567 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
9568 __pyx_t_4 = 0;
9569 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 4, __pyx_L1_error)
9570 __Pyx_GOTREF(__pyx_t_3);
9571 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9572 }
9573 }
9574 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9575 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
9576 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9577 __PYX_ERR(1, 4, __pyx_L1_error)
9578
9579 /* "(tree fragment)":2
9580 * def __pyx_unpickle_TextureAtlas(__pyx_type, long __pyx_checksum, __pyx_state):
9581 * if __pyx_checksum != 0xdcdc1ac: # <<<<<<<<<<<<<<
9582 * from pickle import PickleError as __pyx_PickleError
9583 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xdcdc1ac = (frames))" % __pyx_checksum)
9584 */
9585 }
9586
9587 /* "(tree fragment)":5
9588 * from pickle import PickleError as __pyx_PickleError
9589 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xdcdc1ac = (frames))" % __pyx_checksum)
9590 * __pyx_result = TextureAtlas.__new__(__pyx_type) # <<<<<<<<<<<<<<
9591 * if __pyx_state is not None:
9592 * __pyx_unpickle_TextureAtlas__set_state(<TextureAtlas> __pyx_result, __pyx_state)
9593 */
9594 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_11pygame_sdl2_6render_TextureAtlas), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
9595 __Pyx_GOTREF(__pyx_t_2);
9596 __pyx_t_6 = NULL;
9597 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
9598 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
9599 if (likely(__pyx_t_6)) {
9600 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
9601 __Pyx_INCREF(__pyx_t_6);
9602 __Pyx_INCREF(function);
9603 __Pyx_DECREF_SET(__pyx_t_2, function);
9604 }
9605 }
9606 if (!__pyx_t_6) {
9607 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
9608 __Pyx_GOTREF(__pyx_t_3);
9609 } else {
9610 #if CYTHON_FAST_PYCALL
9611 if (PyFunction_Check(__pyx_t_2)) {
9612 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
9613 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
9614 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9615 __Pyx_GOTREF(__pyx_t_3);
9616 } else
9617 #endif
9618 #if CYTHON_FAST_PYCCALL
9619 if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
9620 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
9621 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
9622 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9623 __Pyx_GOTREF(__pyx_t_3);
9624 } else
9625 #endif
9626 {
9627 __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
9628 __Pyx_GOTREF(__pyx_t_4);
9629 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
9630 __Pyx_INCREF(__pyx_v___pyx_type);
9631 __Pyx_GIVEREF(__pyx_v___pyx_type);
9632 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type);
9633 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
9634 __Pyx_GOTREF(__pyx_t_3);
9635 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9636 }
9637 }
9638 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9639 __pyx_v___pyx_result = __pyx_t_3;
9640 __pyx_t_3 = 0;
9641
9642 /* "(tree fragment)":6
9643 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xdcdc1ac = (frames))" % __pyx_checksum)
9644 * __pyx_result = TextureAtlas.__new__(__pyx_type)
9645 * if __pyx_state is not None: # <<<<<<<<<<<<<<
9646 * __pyx_unpickle_TextureAtlas__set_state(<TextureAtlas> __pyx_result, __pyx_state)
9647 * return __pyx_result
9648 */
9649 __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
9650 __pyx_t_7 = (__pyx_t_1 != 0);
9651 if (__pyx_t_7) {
9652
9653 /* "(tree fragment)":7
9654 * __pyx_result = TextureAtlas.__new__(__pyx_type)
9655 * if __pyx_state is not None:
9656 * __pyx_unpickle_TextureAtlas__set_state(<TextureAtlas> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
9657 * return __pyx_result
9658 * cdef __pyx_unpickle_TextureAtlas__set_state(TextureAtlas __pyx_result, tuple __pyx_state):
9659 */
9660 if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 7, __pyx_L1_error)
9661 __pyx_t_3 = __pyx_f_11pygame_sdl2_6render___pyx_unpickle_TextureAtlas__set_state(((struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
9662 __Pyx_GOTREF(__pyx_t_3);
9663 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9664
9665 /* "(tree fragment)":6
9666 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xdcdc1ac = (frames))" % __pyx_checksum)
9667 * __pyx_result = TextureAtlas.__new__(__pyx_type)
9668 * if __pyx_state is not None: # <<<<<<<<<<<<<<
9669 * __pyx_unpickle_TextureAtlas__set_state(<TextureAtlas> __pyx_result, __pyx_state)
9670 * return __pyx_result
9671 */
9672 }
9673
9674 /* "(tree fragment)":8
9675 * if __pyx_state is not None:
9676 * __pyx_unpickle_TextureAtlas__set_state(<TextureAtlas> __pyx_result, __pyx_state)
9677 * return __pyx_result # <<<<<<<<<<<<<<
9678 * cdef __pyx_unpickle_TextureAtlas__set_state(TextureAtlas __pyx_result, tuple __pyx_state):
9679 * __pyx_result.frames = __pyx_state[0]
9680 */
9681 __Pyx_XDECREF(__pyx_r);
9682 __Pyx_INCREF(__pyx_v___pyx_result);
9683 __pyx_r = __pyx_v___pyx_result;
9684 goto __pyx_L0;
9685
9686 /* "(tree fragment)":1
9687 * def __pyx_unpickle_TextureAtlas(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
9688 * if __pyx_checksum != 0xdcdc1ac:
9689 * from pickle import PickleError as __pyx_PickleError
9690 */
9691
9692 /* function exit code */
9693 __pyx_L1_error:;
9694 __Pyx_XDECREF(__pyx_t_2);
9695 __Pyx_XDECREF(__pyx_t_3);
9696 __Pyx_XDECREF(__pyx_t_4);
9697 __Pyx_XDECREF(__pyx_t_5);
9698 __Pyx_XDECREF(__pyx_t_6);
9699 __Pyx_AddTraceback("pygame_sdl2.render.__pyx_unpickle_TextureAtlas", __pyx_clineno, __pyx_lineno, __pyx_filename);
9700 __pyx_r = NULL;
9701 __pyx_L0:;
9702 __Pyx_XDECREF(__pyx_v___pyx_PickleError);
9703 __Pyx_XDECREF(__pyx_v___pyx_result);
9704 __Pyx_XGIVEREF(__pyx_r);
9705 __Pyx_RefNannyFinishContext();
9706 return __pyx_r;
9707 }
9708
9709 /* "(tree fragment)":9
9710 * __pyx_unpickle_TextureAtlas__set_state(<TextureAtlas> __pyx_result, __pyx_state)
9711 * return __pyx_result
9712 * cdef __pyx_unpickle_TextureAtlas__set_state(TextureAtlas __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
9713 * __pyx_result.frames = __pyx_state[0]
9714 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
9715 */
9716
9717 static PyObject *__pyx_f_11pygame_sdl2_6render___pyx_unpickle_TextureAtlas__set_state(struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
9718 PyObject *__pyx_r = NULL;
9719 __Pyx_RefNannyDeclarations
9720 PyObject *__pyx_t_1 = NULL;
9721 int __pyx_t_2;
9722 Py_ssize_t __pyx_t_3;
9723 int __pyx_t_4;
9724 int __pyx_t_5;
9725 PyObject *__pyx_t_6 = NULL;
9726 PyObject *__pyx_t_7 = NULL;
9727 PyObject *__pyx_t_8 = NULL;
9728 PyObject *__pyx_t_9 = NULL;
9729 __Pyx_RefNannySetupContext("__pyx_unpickle_TextureAtlas__set_state", 0);
9730
9731 /* "(tree fragment)":10
9732 * return __pyx_result
9733 * cdef __pyx_unpickle_TextureAtlas__set_state(TextureAtlas __pyx_result, tuple __pyx_state):
9734 * __pyx_result.frames = __pyx_state[0] # <<<<<<<<<<<<<<
9735 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
9736 * __pyx_result.__dict__.update(__pyx_state[1])
9737 */
9738 if (unlikely(__pyx_v___pyx_state == Py_None)) {
9739 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
9740 __PYX_ERR(1, 10, __pyx_L1_error)
9741 }
9742 __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 10, __pyx_L1_error)
9743 __Pyx_GOTREF(__pyx_t_1);
9744 __Pyx_GIVEREF(__pyx_t_1);
9745 __Pyx_GOTREF(__pyx_v___pyx_result->frames);
9746 __Pyx_DECREF(__pyx_v___pyx_result->frames);
9747 __pyx_v___pyx_result->frames = __pyx_t_1;
9748 __pyx_t_1 = 0;
9749
9750 /* "(tree fragment)":11
9751 * cdef __pyx_unpickle_TextureAtlas__set_state(TextureAtlas __pyx_result, tuple __pyx_state):
9752 * __pyx_result.frames = __pyx_state[0]
9753 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
9754 * __pyx_result.__dict__.update(__pyx_state[1])
9755 */
9756 if (unlikely(__pyx_v___pyx_state == Py_None)) {
9757 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
9758 __PYX_ERR(1, 11, __pyx_L1_error)
9759 }
9760 __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
9761 __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
9762 if (__pyx_t_4) {
9763 } else {
9764 __pyx_t_2 = __pyx_t_4;
9765 goto __pyx_L4_bool_binop_done;
9766 }
9767 __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 11, __pyx_L1_error)
9768 __pyx_t_5 = (__pyx_t_4 != 0);
9769 __pyx_t_2 = __pyx_t_5;
9770 __pyx_L4_bool_binop_done:;
9771 if (__pyx_t_2) {
9772
9773 /* "(tree fragment)":12
9774 * __pyx_result.frames = __pyx_state[0]
9775 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
9776 * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
9777 */
9778 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error)
9779 __Pyx_GOTREF(__pyx_t_6);
9780 __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 12, __pyx_L1_error)
9781 __Pyx_GOTREF(__pyx_t_7);
9782 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9783 if (unlikely(__pyx_v___pyx_state == Py_None)) {
9784 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
9785 __PYX_ERR(1, 12, __pyx_L1_error)
9786 }
9787 __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 12, __pyx_L1_error)
9788 __Pyx_GOTREF(__pyx_t_6);
9789 __pyx_t_8 = NULL;
9790 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
9791 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
9792 if (likely(__pyx_t_8)) {
9793 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
9794 __Pyx_INCREF(__pyx_t_8);
9795 __Pyx_INCREF(function);
9796 __Pyx_DECREF_SET(__pyx_t_7, function);
9797 }
9798 }
9799 if (!__pyx_t_8) {
9800 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
9801 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9802 __Pyx_GOTREF(__pyx_t_1);
9803 } else {
9804 #if CYTHON_FAST_PYCALL
9805 if (PyFunction_Check(__pyx_t_7)) {
9806 PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
9807 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
9808 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9809 __Pyx_GOTREF(__pyx_t_1);
9810 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9811 } else
9812 #endif
9813 #if CYTHON_FAST_PYCCALL
9814 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
9815 PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
9816 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
9817 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9818 __Pyx_GOTREF(__pyx_t_1);
9819 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9820 } else
9821 #endif
9822 {
9823 __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 12, __pyx_L1_error)
9824 __Pyx_GOTREF(__pyx_t_9);
9825 __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
9826 __Pyx_GIVEREF(__pyx_t_6);
9827 PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
9828 __pyx_t_6 = 0;
9829 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
9830 __Pyx_GOTREF(__pyx_t_1);
9831 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9832 }
9833 }
9834 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9835 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9836
9837 /* "(tree fragment)":11
9838 * cdef __pyx_unpickle_TextureAtlas__set_state(TextureAtlas __pyx_result, tuple __pyx_state):
9839 * __pyx_result.frames = __pyx_state[0]
9840 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
9841 * __pyx_result.__dict__.update(__pyx_state[1])
9842 */
9843 }
9844
9845 /* "(tree fragment)":9
9846 * __pyx_unpickle_TextureAtlas__set_state(<TextureAtlas> __pyx_result, __pyx_state)
9847 * return __pyx_result
9848 * cdef __pyx_unpickle_TextureAtlas__set_state(TextureAtlas __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
9849 * __pyx_result.frames = __pyx_state[0]
9850 * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
9851 */
9852
9853 /* function exit code */
9854 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9855 goto __pyx_L0;
9856 __pyx_L1_error:;
9857 __Pyx_XDECREF(__pyx_t_1);
9858 __Pyx_XDECREF(__pyx_t_6);
9859 __Pyx_XDECREF(__pyx_t_7);
9860 __Pyx_XDECREF(__pyx_t_8);
9861 __Pyx_XDECREF(__pyx_t_9);
9862 __Pyx_AddTraceback("pygame_sdl2.render.__pyx_unpickle_TextureAtlas__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
9863 __pyx_r = 0;
9864 __pyx_L0:;
9865 __Pyx_XGIVEREF(__pyx_r);
82219866 __Pyx_RefNannyFinishContext();
82229867 return __pyx_r;
82239868 }
82449889
82459890 static void __pyx_tp_dealloc_11pygame_sdl2_6render_Renderer(PyObject *o) {
82469891 struct __pyx_obj_11pygame_sdl2_6render_Renderer *p = (struct __pyx_obj_11pygame_sdl2_6render_Renderer *)o;
8247 #if PY_VERSION_HEX >= 0x030400a1
8248 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
9892 #if CYTHON_USE_TP_FINALIZE
9893 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
82499894 if (PyObject_CallFinalizerFromDealloc(o)) return;
82509895 }
82519896 #endif
82929937 {"fill_rect", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_23fill_rect, METH_VARARGS|METH_KEYWORDS, 0},
82939938 {"set_viewport", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_25set_viewport, METH_VARARGS|METH_KEYWORDS, 0},
82949939 {"create_texture", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_27create_texture, METH_O, 0},
9940 {"__reduce_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_29__reduce_cython__, METH_NOARGS, 0},
9941 {"__setstate_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_8Renderer_31__setstate_cython__, METH_O, 0},
82959942 {0, 0, 0, 0}
82969943 };
82979944
837310020 }
837410021
837510022 static void __pyx_tp_dealloc_11pygame_sdl2_6render_Texture(PyObject *o) {
8376 #if PY_VERSION_HEX >= 0x030400a1
8377 if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
10023 #if CYTHON_USE_TP_FINALIZE
10024 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
837810025 if (PyObject_CallFinalizerFromDealloc(o)) return;
837910026 }
838010027 #endif
841810065 }
841910066
842010067 static PyMethodDef __pyx_methods_11pygame_sdl2_6render_Texture[] = {
10068 {"__reduce_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_7Texture_5__reduce_cython__, METH_NOARGS, 0},
10069 {"__setstate_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_7Texture_7__setstate_cython__, METH_O, 0},
842110070 {0, 0, 0, 0}
842210071 };
842310072
850110150
850210151 static void __pyx_tp_dealloc_11pygame_sdl2_6render_TextureNode(PyObject *o) {
850310152 struct __pyx_obj_11pygame_sdl2_6render_TextureNode *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)o;
8504 #if PY_VERSION_HEX >= 0x030400a1
8505 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
10153 #if CYTHON_USE_TP_FINALIZE
10154 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
850610155 if (PyObject_CallFinalizerFromDealloc(o)) return;
850710156 }
850810157 #endif
851510164 int e;
851610165 struct __pyx_obj_11pygame_sdl2_6render_TextureNode *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureNode *)o;
851710166 if (p->texture) {
8518 e = (*v)(((PyObject*)p->texture), a); if (e) return e;
10167 e = (*v)(((PyObject *)p->texture), a); if (e) return e;
851910168 }
852010169 return 0;
852110170 }
853110180
853210181 static PyMethodDef __pyx_methods_11pygame_sdl2_6render_TextureNode[] = {
853310182 {"render", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_11TextureNode_3render, METH_VARARGS|METH_KEYWORDS, 0},
10183 {"__reduce_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_11TextureNode_5__reduce_cython__, METH_NOARGS, 0},
10184 {"__setstate_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_11TextureNode_7__setstate_cython__, METH_O, 0},
853410185 {0, 0, 0, 0}
853510186 };
853610187
860810259
860910260 static void __pyx_tp_dealloc_11pygame_sdl2_6render_TextureAtlas(PyObject *o) {
861010261 struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *p = (struct __pyx_obj_11pygame_sdl2_6render_TextureAtlas *)o;
8611 #if PY_VERSION_HEX >= 0x030400a1
8612 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
10262 #if CYTHON_USE_TP_FINALIZE
10263 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
861310264 if (PyObject_CallFinalizerFromDealloc(o)) return;
861410265 }
861510266 #endif
864510296
864610297 static PyMethodDef __pyx_methods_11pygame_sdl2_6render_TextureAtlas[] = {
864710298 {"keys", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_5keys, METH_NOARGS, 0},
10299 {"__reduce_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_7__reduce_cython__, METH_NOARGS, 0},
10300 {"__setstate_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_12TextureAtlas_9__setstate_cython__, METH_O, 0},
864810301 {0, 0, 0, 0}
864910302 };
865010303
874310396
874410397 static void __pyx_tp_dealloc_11pygame_sdl2_6render_Sprite(PyObject *o) {
874510398 struct __pyx_obj_11pygame_sdl2_6render_Sprite *p = (struct __pyx_obj_11pygame_sdl2_6render_Sprite *)o;
8746 #if PY_VERSION_HEX >= 0x030400a1
8747 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
10399 #if CYTHON_USE_TP_FINALIZE
10400 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
874810401 if (PyObject_CallFinalizerFromDealloc(o)) return;
874910402 }
875010403 #endif
886810521 static PyMethodDef __pyx_methods_11pygame_sdl2_6render_Sprite[] = {
886910522 {"render", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_6Sprite_3render, METH_VARARGS|METH_KEYWORDS, 0},
887010523 {"collides", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_6Sprite_5collides, METH_O, 0},
10524 {"__reduce_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_6Sprite_7__reduce_cython__, METH_NOARGS, 0},
10525 {"__setstate_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_6Sprite_9__setstate_cython__, METH_O, 0},
887110526 {0, 0, 0, 0}
887210527 };
887310528
895610611
895710612 static void __pyx_tp_dealloc_11pygame_sdl2_6render_Container(PyObject *o) {
895810613 struct __pyx_obj_11pygame_sdl2_6render_Container *p = (struct __pyx_obj_11pygame_sdl2_6render_Container *)o;
8959 #if PY_VERSION_HEX >= 0x030400a1
8960 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
10614 #if CYTHON_USE_TP_FINALIZE
10615 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
896110616 if (PyObject_CallFinalizerFromDealloc(o)) return;
896210617 }
896310618 #endif
901510670 static PyMethodDef __pyx_methods_11pygame_sdl2_6render_Container[] = {
901610671 {"add", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_9Container_3add, METH_O, 0},
901710672 {"render", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_9Container_5render, METH_VARARGS|METH_KEYWORDS, 0},
10673 {"__reduce_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_9Container_7__reduce_cython__, METH_NOARGS, 0},
10674 {"__setstate_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_6render_9Container_9__setstate_cython__, METH_O, 0},
901810675 {0, 0, 0, 0}
901910676 };
902010677
908710744 };
908810745
908910746 #if PY_MAJOR_VERSION >= 3
10747 #if CYTHON_PEP489_MULTI_PHASE_INIT
10748 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
10749 static int __pyx_pymod_exec_render(PyObject* module); /*proto*/
10750 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
10751 {Py_mod_create, (void*)__pyx_pymod_create},
10752 {Py_mod_exec, (void*)__pyx_pymod_exec_render},
10753 {0, NULL}
10754 };
10755 #endif
10756
909010757 static struct PyModuleDef __pyx_moduledef = {
9091 #if PY_VERSION_HEX < 0x03020000
9092 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
9093 #else
909410758 PyModuleDef_HEAD_INIT,
9095 #endif
909610759 "render",
909710760 0, /* m_doc */
10761 #if CYTHON_PEP489_MULTI_PHASE_INIT
10762 0, /* m_size */
10763 #else
909810764 -1, /* m_size */
10765 #endif
909910766 __pyx_methods /* m_methods */,
10767 #if CYTHON_PEP489_MULTI_PHASE_INIT
10768 __pyx_moduledef_slots, /* m_slots */
10769 #else
910010770 NULL, /* m_reload */
10771 #endif
910110772 NULL, /* m_traverse */
910210773 NULL, /* m_clear */
910310774 NULL /* m_free */
911010781 {&__pyx_n_s_BLENDMODE_MOD, __pyx_k_BLENDMODE_MOD, sizeof(__pyx_k_BLENDMODE_MOD), 0, 0, 1, 1},
911110782 {&__pyx_n_s_BLENDMODE_NONE, __pyx_k_BLENDMODE_NONE, sizeof(__pyx_k_BLENDMODE_NONE), 0, 0, 1, 1},
911210783 {&__pyx_n_s_Color, __pyx_k_Color, sizeof(__pyx_k_Color), 0, 0, 1, 1},
10784 {&__pyx_kp_s_Incompatible_checksums_s_vs_0xdc, __pyx_k_Incompatible_checksums_s_vs_0xdc, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xdc), 0, 0, 1, 0},
911310785 {&__pyx_kp_u_Invalid_argument_s, __pyx_k_Invalid_argument_s, sizeof(__pyx_k_Invalid_argument_s), 0, 1, 0, 0},
10786 {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
10787 {&__pyx_kp_s_Pickling_of_struct_members_such, __pyx_k_Pickling_of_struct_members_such, sizeof(__pyx_k_Pickling_of_struct_members_such), 0, 0, 1, 0},
10788 {&__pyx_kp_s_Pickling_of_struct_members_such_2, __pyx_k_Pickling_of_struct_members_such_2, sizeof(__pyx_k_Pickling_of_struct_members_such_2), 0, 0, 1, 0},
10789 {&__pyx_kp_s_Pickling_of_struct_members_such_3, __pyx_k_Pickling_of_struct_members_such_3, sizeof(__pyx_k_Pickling_of_struct_members_such_3), 0, 0, 1, 0},
911410790 {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1},
911510791 {&__pyx_kp_u_Renderer_is_not_accelerated, __pyx_k_Renderer_is_not_accelerated, sizeof(__pyx_k_Renderer_is_not_accelerated), 0, 1, 0, 0},
911610792 {&__pyx_kp_u_Rotation_not_supported_yet, __pyx_k_Rotation_not_supported_yet, sizeof(__pyx_k_Rotation_not_supported_yet), 0, 1, 0, 0},
10793 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
911710794 {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
911810795 {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
911910796 {&__pyx_n_u_accelerated, __pyx_k_accelerated, sizeof(__pyx_k_accelerated), 0, 1, 0, 1},
912010797 {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
10798 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
912110799 {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1},
912210800 {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1},
10801 {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
912310802 {&__pyx_n_s_driver, __pyx_k_driver, sizeof(__pyx_k_driver), 0, 0, 1, 1},
912410803 {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
912510804 {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1},
912710806 {&__pyx_n_u_frames, __pyx_k_frames, sizeof(__pyx_k_frames), 0, 1, 0, 1},
912810807 {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1},
912910808 {&__pyx_n_s_get_drivers, __pyx_k_get_drivers, sizeof(__pyx_k_get_drivers), 0, 0, 1, 1},
10809 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
913010810 {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
913110811 {&__pyx_n_u_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 1, 0, 1},
913210812 {&__pyx_n_u_image, __pyx_k_image, sizeof(__pyx_k_image), 0, 1, 0, 1},
914310823 {&__pyx_n_u_meta, __pyx_k_meta, sizeof(__pyx_k_meta), 0, 1, 0, 1},
914410824 {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
914510825 {&__pyx_n_u_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 1, 0, 1},
10826 {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
10827 {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
10828 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
914610829 {&__pyx_n_s_nodes, __pyx_k_nodes, sizeof(__pyx_k_nodes), 0, 0, 1, 1},
914710830 {&__pyx_n_s_num_drivers, __pyx_k_num_drivers, sizeof(__pyx_k_num_drivers), 0, 0, 1, 1},
914810831 {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
10832 {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
914910833 {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
915010834 {&__pyx_n_s_pygame_sdl2_color, __pyx_k_pygame_sdl2_color, sizeof(__pyx_k_pygame_sdl2_color), 0, 0, 1, 1},
915110835 {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1},
915210836 {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1},
915310837 {&__pyx_n_s_pygame_sdl2_render, __pyx_k_pygame_sdl2_render, sizeof(__pyx_k_pygame_sdl2_render), 0, 0, 1, 1},
10838 {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
10839 {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
10840 {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
10841 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
10842 {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
10843 {&__pyx_n_s_pyx_unpickle_TextureAtlas, __pyx_k_pyx_unpickle_TextureAtlas, sizeof(__pyx_k_pyx_unpickle_TextureAtlas), 0, 0, 1, 1},
915410844 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
915510845 {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
915610846 {&__pyx_n_u_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 1, 0, 1},
915710847 {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
915810848 {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1},
10849 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
10850 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
10851 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
915910852 {&__pyx_n_s_ren, __pyx_k_ren, sizeof(__pyx_k_ren), 0, 0, 1, 1},
916010853 {&__pyx_n_s_render, __pyx_k_render, sizeof(__pyx_k_render), 0, 0, 1, 1},
916110854 {&__pyx_n_s_rinfo, __pyx_k_rinfo, sizeof(__pyx_k_rinfo), 0, 0, 1, 1},
916210855 {&__pyx_n_u_rotated, __pyx_k_rotated, sizeof(__pyx_k_rotated), 0, 1, 0, 1},
916310856 {&__pyx_n_u_rtt, __pyx_k_rtt, sizeof(__pyx_k_rtt), 0, 1, 0, 1},
916410857 {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1},
10858 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
10859 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
916510860 {&__pyx_n_u_software, __pyx_k_software, sizeof(__pyx_k_software), 0, 1, 0, 1},
916610861 {&__pyx_n_u_sourceSize, __pyx_k_sourceSize, sizeof(__pyx_k_sourceSize), 0, 1, 0, 1},
916710862 {&__pyx_n_u_spriteSourceSize, __pyx_k_spriteSourceSize, sizeof(__pyx_k_spriteSourceSize), 0, 1, 0, 1},
916810863 {&__pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_k_src_pygame_sdl2_render_pyx, sizeof(__pyx_k_src_pygame_sdl2_render_pyx), 0, 0, 1, 0},
10864 {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
916910865 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
917010866 {&__pyx_n_s_tex, __pyx_k_tex, sizeof(__pyx_k_tex), 0, 0, 1, 1},
10867 {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
917110868 {&__pyx_n_s_vsync, __pyx_k_vsync, sizeof(__pyx_k_vsync), 0, 0, 1, 1},
917210869 {&__pyx_n_u_vsync, __pyx_k_vsync, sizeof(__pyx_k_vsync), 0, 1, 0, 1},
917310870 {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
918710884 };
918810885 static int __Pyx_InitCachedBuiltins(void) {
918910886 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 58, __pyx_L1_error)
10887 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
919010888 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 227, __pyx_L1_error)
919110889 __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 249, __pyx_L1_error)
919210890 return 0;
920810906 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_Renderer_is_not_accelerated); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 99, __pyx_L1_error)
920910907 __Pyx_GOTREF(__pyx_tuple_);
921010908 __Pyx_GIVEREF(__pyx_tuple_);
10909
10910 /* "(tree fragment)":2
10911 * def __reduce_cython__(self):
10912 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10913 * def __setstate_cython__(self, __pyx_state):
10914 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10915 */
10916 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 2, __pyx_L1_error)
10917 __Pyx_GOTREF(__pyx_tuple__2);
10918 __Pyx_GIVEREF(__pyx_tuple__2);
10919
10920 /* "(tree fragment)":4
10921 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10922 * def __setstate_cython__(self, __pyx_state):
10923 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10924 */
10925 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 4, __pyx_L1_error)
10926 __Pyx_GOTREF(__pyx_tuple__3);
10927 __Pyx_GIVEREF(__pyx_tuple__3);
10928
10929 /* "(tree fragment)":2
10930 * def __reduce_cython__(self):
10931 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10932 * def __setstate_cython__(self, __pyx_state):
10933 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10934 */
10935 __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 2, __pyx_L1_error)
10936 __Pyx_GOTREF(__pyx_tuple__4);
10937 __Pyx_GIVEREF(__pyx_tuple__4);
10938
10939 /* "(tree fragment)":4
10940 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
10941 * def __setstate_cython__(self, __pyx_state):
10942 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
10943 */
10944 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 4, __pyx_L1_error)
10945 __Pyx_GOTREF(__pyx_tuple__5);
10946 __Pyx_GIVEREF(__pyx_tuple__5);
10947
10948 /* "(tree fragment)":2
10949 * def __reduce_cython__(self):
10950 * raise TypeError("Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)") # <<<<<<<<<<<<<<
10951 * def __setstate_cython__(self, __pyx_state):
10952 * raise TypeError("Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)")
10953 */
10954 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Pickling_of_struct_members_such); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 2, __pyx_L1_error)
10955 __Pyx_GOTREF(__pyx_tuple__6);
10956 __Pyx_GIVEREF(__pyx_tuple__6);
10957
10958 /* "(tree fragment)":4
10959 * raise TypeError("Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)")
10960 * def __setstate_cython__(self, __pyx_state):
10961 * raise TypeError("Pickling of struct members such as self.source_rect,self.trimmed_rect must be explicitly requested with @auto_pickle(True)") # <<<<<<<<<<<<<<
10962 */
10963 __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Pickling_of_struct_members_such); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 4, __pyx_L1_error)
10964 __Pyx_GOTREF(__pyx_tuple__7);
10965 __Pyx_GIVEREF(__pyx_tuple__7);
921110966
921210967 /* "pygame_sdl2/render.pyx":265
921310968 * to_sdl_rect((f['x'], f['y'], f['w'], f['h']), &itex.trimmed_rect, "spriteSourceSize")
921610971 * itex.source_w = idict["sourceSize"]["w"]
921710972 * itex.source_h = idict["sourceSize"]["h"]
921810973 */
9219 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Rotation_not_supported_yet); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 265, __pyx_L1_error)
9220 __Pyx_GOTREF(__pyx_tuple__2);
9221 __Pyx_GIVEREF(__pyx_tuple__2);
10974 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Rotation_not_supported_yet); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 265, __pyx_L1_error)
10975 __Pyx_GOTREF(__pyx_tuple__8);
10976 __Pyx_GIVEREF(__pyx_tuple__8);
10977
10978 /* "(tree fragment)":2
10979 * def __reduce_cython__(self):
10980 * raise TypeError("Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)") # <<<<<<<<<<<<<<
10981 * def __setstate_cython__(self, __pyx_state):
10982 * raise TypeError("Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)")
10983 */
10984 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Pickling_of_struct_members_such_2); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 2, __pyx_L1_error)
10985 __Pyx_GOTREF(__pyx_tuple__9);
10986 __Pyx_GIVEREF(__pyx_tuple__9);
10987
10988 /* "(tree fragment)":4
10989 * raise TypeError("Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)")
10990 * def __setstate_cython__(self, __pyx_state):
10991 * raise TypeError("Pickling of struct members such as self._color,self._pos,self.bounding_box must be explicitly requested with @auto_pickle(True)") # <<<<<<<<<<<<<<
10992 */
10993 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Pickling_of_struct_members_such_2); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 4, __pyx_L1_error)
10994 __Pyx_GOTREF(__pyx_tuple__10);
10995 __Pyx_GIVEREF(__pyx_tuple__10);
10996
10997 /* "(tree fragment)":2
10998 * def __reduce_cython__(self):
10999 * raise TypeError("Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)") # <<<<<<<<<<<<<<
11000 * def __setstate_cython__(self, __pyx_state):
11001 * raise TypeError("Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)")
11002 */
11003 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Pickling_of_struct_members_such_3); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 2, __pyx_L1_error)
11004 __Pyx_GOTREF(__pyx_tuple__11);
11005 __Pyx_GIVEREF(__pyx_tuple__11);
11006
11007 /* "(tree fragment)":4
11008 * raise TypeError("Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)")
11009 * def __setstate_cython__(self, __pyx_state):
11010 * raise TypeError("Pickling of struct members such as self._rect must be explicitly requested with @auto_pickle(True)") # <<<<<<<<<<<<<<
11011 */
11012 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Pickling_of_struct_members_such_3); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 4, __pyx_L1_error)
11013 __Pyx_GOTREF(__pyx_tuple__12);
11014 __Pyx_GIVEREF(__pyx_tuple__12);
922211015
922311016 /* "pygame_sdl2/render.pyx":52
922411017 * }
922711020 * cdef SDL_RendererInfo rinfo
922811021 * cdef int num_drivers
922911022 */
9230 __pyx_tuple__3 = PyTuple_Pack(4, __pyx_n_s_rinfo, __pyx_n_s_num_drivers, __pyx_n_s_rv, __pyx_n_s_n); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 52, __pyx_L1_error)
9231 __Pyx_GOTREF(__pyx_tuple__3);
9232 __Pyx_GIVEREF(__pyx_tuple__3);
9233 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_get_drivers, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 52, __pyx_L1_error)
11023 __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_rinfo, __pyx_n_s_num_drivers, __pyx_n_s_rv, __pyx_n_s_n); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 52, __pyx_L1_error)
11024 __Pyx_GOTREF(__pyx_tuple__13);
11025 __Pyx_GIVEREF(__pyx_tuple__13);
11026 __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_render_pyx, __pyx_n_s_get_drivers, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 52, __pyx_L1_error)
11027
11028 /* "(tree fragment)":1
11029 * def __pyx_unpickle_TextureAtlas(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
11030 * if __pyx_checksum != 0xdcdc1ac:
11031 * from pickle import PickleError as __pyx_PickleError
11032 */
11033 __pyx_tuple__15 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 1, __pyx_L1_error)
11034 __Pyx_GOTREF(__pyx_tuple__15);
11035 __Pyx_GIVEREF(__pyx_tuple__15);
11036 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_TextureAtlas, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 1, __pyx_L1_error)
923411037 __Pyx_RefNannyFinishContext();
923511038 return 0;
923611039 __pyx_L1_error:;
924111044 static int __Pyx_InitGlobals(void) {
924211045 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
924311046 __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
11047 __pyx_int_231588268 = PyInt_FromLong(231588268L); if (unlikely(!__pyx_int_231588268)) __PYX_ERR(0, 1, __pyx_L1_error)
924411048 __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
924511049 return 0;
924611050 __pyx_L1_error:;
924711051 return -1;
924811052 }
924911053
11054 static int __Pyx_modinit_global_init_code(void); /*proto*/
11055 static int __Pyx_modinit_variable_export_code(void); /*proto*/
11056 static int __Pyx_modinit_function_export_code(void); /*proto*/
11057 static int __Pyx_modinit_type_init_code(void); /*proto*/
11058 static int __Pyx_modinit_type_import_code(void); /*proto*/
11059 static int __Pyx_modinit_variable_import_code(void); /*proto*/
11060 static int __Pyx_modinit_function_import_code(void); /*proto*/
11061
11062 static int __Pyx_modinit_global_init_code(void) {
11063 __Pyx_RefNannyDeclarations
11064 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
11065 /*--- Global init code ---*/
11066 __Pyx_RefNannyFinishContext();
11067 return 0;
11068 }
11069
11070 static int __Pyx_modinit_variable_export_code(void) {
11071 __Pyx_RefNannyDeclarations
11072 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
11073 /*--- Variable export code ---*/
11074 __Pyx_RefNannyFinishContext();
11075 return 0;
11076 }
11077
11078 static int __Pyx_modinit_function_export_code(void) {
11079 __Pyx_RefNannyDeclarations
11080 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
11081 /*--- Function export code ---*/
11082 __Pyx_RefNannyFinishContext();
11083 return 0;
11084 }
11085
11086 static int __Pyx_modinit_type_init_code(void) {
11087 __Pyx_RefNannyDeclarations
11088 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
11089 /*--- Type init code ---*/
11090 __pyx_vtabptr_11pygame_sdl2_6render_Renderer = &__pyx_vtable_11pygame_sdl2_6render_Renderer;
11091 __pyx_vtable_11pygame_sdl2_6render_Renderer.set_drawcolor = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_6render_Renderer *, PyObject *))__pyx_f_11pygame_sdl2_6render_8Renderer_set_drawcolor;
11092 if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_Renderer) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
11093 __pyx_type_11pygame_sdl2_6render_Renderer.tp_print = 0;
11094 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11pygame_sdl2_6render_Renderer.tp_dictoffset && __pyx_type_11pygame_sdl2_6render_Renderer.tp_getattro == PyObject_GenericGetAttr)) {
11095 __pyx_type_11pygame_sdl2_6render_Renderer.tp_getattro = __Pyx_PyObject_GenericGetAttr;
11096 }
11097 if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_6render_Renderer.tp_dict, __pyx_vtabptr_11pygame_sdl2_6render_Renderer) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
11098 if (PyObject_SetAttrString(__pyx_m, "Renderer", (PyObject *)&__pyx_type_11pygame_sdl2_6render_Renderer) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
11099 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11pygame_sdl2_6render_Renderer) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
11100 __pyx_ptype_11pygame_sdl2_6render_Renderer = &__pyx_type_11pygame_sdl2_6render_Renderer;
11101 __pyx_vtabptr_11pygame_sdl2_6render_Texture = &__pyx_vtable_11pygame_sdl2_6render_Texture;
11102 __pyx_vtable_11pygame_sdl2_6render_Texture.set = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_6render_Texture *, SDL_Renderer *, SDL_Texture *))__pyx_f_11pygame_sdl2_6render_7Texture_set;
11103 if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_Texture) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
11104 __pyx_type_11pygame_sdl2_6render_Texture.tp_print = 0;
11105 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11pygame_sdl2_6render_Texture.tp_dictoffset && __pyx_type_11pygame_sdl2_6render_Texture.tp_getattro == PyObject_GenericGetAttr)) {
11106 __pyx_type_11pygame_sdl2_6render_Texture.tp_getattro = __Pyx_PyObject_GenericGetAttr;
11107 }
11108 if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_6render_Texture.tp_dict, __pyx_vtabptr_11pygame_sdl2_6render_Texture) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
11109 if (PyObject_SetAttrString(__pyx_m, "Texture", (PyObject *)&__pyx_type_11pygame_sdl2_6render_Texture) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
11110 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11pygame_sdl2_6render_Texture) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
11111 __pyx_ptype_11pygame_sdl2_6render_Texture = &__pyx_type_11pygame_sdl2_6render_Texture;
11112 if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_TextureNode) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
11113 __pyx_type_11pygame_sdl2_6render_TextureNode.tp_print = 0;
11114 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11pygame_sdl2_6render_TextureNode.tp_dictoffset && __pyx_type_11pygame_sdl2_6render_TextureNode.tp_getattro == PyObject_GenericGetAttr)) {
11115 __pyx_type_11pygame_sdl2_6render_TextureNode.tp_getattro = __Pyx_PyObject_GenericGetAttr;
11116 }
11117 if (PyObject_SetAttrString(__pyx_m, "TextureNode", (PyObject *)&__pyx_type_11pygame_sdl2_6render_TextureNode) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
11118 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11pygame_sdl2_6render_TextureNode) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
11119 __pyx_ptype_11pygame_sdl2_6render_TextureNode = &__pyx_type_11pygame_sdl2_6render_TextureNode;
11120 if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_TextureAtlas) < 0) __PYX_ERR(0, 245, __pyx_L1_error)
11121 __pyx_type_11pygame_sdl2_6render_TextureAtlas.tp_print = 0;
11122 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11pygame_sdl2_6render_TextureAtlas.tp_dictoffset && __pyx_type_11pygame_sdl2_6render_TextureAtlas.tp_getattro == PyObject_GenericGetAttr)) {
11123 __pyx_type_11pygame_sdl2_6render_TextureAtlas.tp_getattro = __Pyx_PyObject_GenericGetAttr;
11124 }
11125 if (PyObject_SetAttrString(__pyx_m, "TextureAtlas", (PyObject *)&__pyx_type_11pygame_sdl2_6render_TextureAtlas) < 0) __PYX_ERR(0, 245, __pyx_L1_error)
11126 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11pygame_sdl2_6render_TextureAtlas) < 0) __PYX_ERR(0, 245, __pyx_L1_error)
11127 __pyx_ptype_11pygame_sdl2_6render_TextureAtlas = &__pyx_type_11pygame_sdl2_6render_TextureAtlas;
11128 __pyx_vtabptr_11pygame_sdl2_6render_Sprite = &__pyx_vtable_11pygame_sdl2_6render_Sprite;
11129 __pyx_vtable_11pygame_sdl2_6render_Sprite.adjust_rect = (void (*)(struct __pyx_obj_11pygame_sdl2_6render_Sprite *, SDL_Rect const *, SDL_Rect const *, SDL_Rect *))__pyx_f_11pygame_sdl2_6render_6Sprite_adjust_rect;
11130 if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_Sprite) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
11131 __pyx_type_11pygame_sdl2_6render_Sprite.tp_print = 0;
11132 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11pygame_sdl2_6render_Sprite.tp_dictoffset && __pyx_type_11pygame_sdl2_6render_Sprite.tp_getattro == PyObject_GenericGetAttr)) {
11133 __pyx_type_11pygame_sdl2_6render_Sprite.tp_getattro = __Pyx_PyObject_GenericGetAttr;
11134 }
11135 if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_6render_Sprite.tp_dict, __pyx_vtabptr_11pygame_sdl2_6render_Sprite) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
11136 if (PyObject_SetAttrString(__pyx_m, "Sprite", (PyObject *)&__pyx_type_11pygame_sdl2_6render_Sprite) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
11137 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11pygame_sdl2_6render_Sprite) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
11138 __pyx_ptype_11pygame_sdl2_6render_Sprite = &__pyx_type_11pygame_sdl2_6render_Sprite;
11139 if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_Container) < 0) __PYX_ERR(0, 433, __pyx_L1_error)
11140 __pyx_type_11pygame_sdl2_6render_Container.tp_print = 0;
11141 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11pygame_sdl2_6render_Container.tp_dictoffset && __pyx_type_11pygame_sdl2_6render_Container.tp_getattro == PyObject_GenericGetAttr)) {
11142 __pyx_type_11pygame_sdl2_6render_Container.tp_getattro = __Pyx_PyObject_GenericGetAttr;
11143 }
11144 #if CYTHON_COMPILING_IN_CPYTHON
11145 {
11146 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_11pygame_sdl2_6render_Container, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 433, __pyx_L1_error)
11147 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
11148 __pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
11149 __pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__.doc = __pyx_doc_11pygame_sdl2_6render_9Container___init__;
11150 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__;
11151 }
11152 }
11153 #endif
11154 if (PyObject_SetAttrString(__pyx_m, "Container", (PyObject *)&__pyx_type_11pygame_sdl2_6render_Container) < 0) __PYX_ERR(0, 433, __pyx_L1_error)
11155 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11pygame_sdl2_6render_Container) < 0) __PYX_ERR(0, 433, __pyx_L1_error)
11156 __pyx_ptype_11pygame_sdl2_6render_Container = &__pyx_type_11pygame_sdl2_6render_Container;
11157 __Pyx_RefNannyFinishContext();
11158 return 0;
11159 __pyx_L1_error:;
11160 __Pyx_RefNannyFinishContext();
11161 return -1;
11162 }
11163
11164 static int __Pyx_modinit_type_import_code(void) {
11165 __Pyx_RefNannyDeclarations
11166 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
11167 /*--- Type import code ---*/
11168 __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error)
11169 __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(2, 23, __pyx_L1_error)
11170 __pyx_ptype_11pygame_sdl2_7display_Window = __Pyx_ImportType("pygame_sdl2.display", "Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7display_Window)) __PYX_ERR(3, 23, __pyx_L1_error)
11171 __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType("pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_4rect_Rect)) __PYX_ERR(4, 21, __pyx_L1_error)
11172 __Pyx_RefNannyFinishContext();
11173 return 0;
11174 __pyx_L1_error:;
11175 __Pyx_RefNannyFinishContext();
11176 return -1;
11177 }
11178
11179 static int __Pyx_modinit_variable_import_code(void) {
11180 __Pyx_RefNannyDeclarations
11181 PyObject *__pyx_t_1 = NULL;
11182 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
11183 /*--- Variable import code ---*/
11184 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.display"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
11185 if (__Pyx_ImportVoidPtr(__pyx_t_1, "main_window", (void **)&__pyx_vp_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
11186 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11187 __Pyx_RefNannyFinishContext();
11188 return 0;
11189 __pyx_L1_error:;
11190 __Pyx_XDECREF(__pyx_t_1);
11191 __Pyx_RefNannyFinishContext();
11192 return -1;
11193 }
11194
11195 static int __Pyx_modinit_function_import_code(void) {
11196 __Pyx_RefNannyDeclarations
11197 PyObject *__pyx_t_1 = NULL;
11198 PyObject *__pyx_t_2 = NULL;
11199 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
11200 /*--- Function import code ---*/
11201 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
11202 if (__Pyx_ImportFunction(__pyx_t_1, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
11203 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11204 __pyx_t_2 = __Pyx_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error)
11205 if (__Pyx_ImportFunction(__pyx_t_2, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
11206 Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11207 __Pyx_RefNannyFinishContext();
11208 return 0;
11209 __pyx_L1_error:;
11210 __Pyx_XDECREF(__pyx_t_1);
11211 __Pyx_XDECREF(__pyx_t_2);
11212 __Pyx_RefNannyFinishContext();
11213 return -1;
11214 }
11215
11216
925011217 #if PY_MAJOR_VERSION < 3
9251 PyMODINIT_FUNC initrender(void); /*proto*/
9252 PyMODINIT_FUNC initrender(void)
11218 #ifdef CYTHON_NO_PYINIT_EXPORT
11219 #define __Pyx_PyMODINIT_FUNC void
925311220 #else
9254 PyMODINIT_FUNC PyInit_render(void); /*proto*/
9255 PyMODINIT_FUNC PyInit_render(void)
11221 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
11222 #endif
11223 #else
11224 #ifdef CYTHON_NO_PYINIT_EXPORT
11225 #define __Pyx_PyMODINIT_FUNC PyObject *
11226 #else
11227 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
11228 #endif
11229 #endif
11230 #ifndef CYTHON_SMALL_CODE
11231 #if defined(__clang__)
11232 #define CYTHON_SMALL_CODE
11233 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
11234 #define CYTHON_SMALL_CODE __attribute__((cold))
11235 #else
11236 #define CYTHON_SMALL_CODE
11237 #endif
11238 #endif
11239
11240
11241 #if PY_MAJOR_VERSION < 3
11242 __Pyx_PyMODINIT_FUNC initrender(void) CYTHON_SMALL_CODE; /*proto*/
11243 __Pyx_PyMODINIT_FUNC initrender(void)
11244 #else
11245 __Pyx_PyMODINIT_FUNC PyInit_render(void) CYTHON_SMALL_CODE; /*proto*/
11246 __Pyx_PyMODINIT_FUNC PyInit_render(void)
11247 #if CYTHON_PEP489_MULTI_PHASE_INIT
11248 {
11249 return PyModuleDef_Init(&__pyx_moduledef);
11250 }
11251 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
11252 PyObject *value = PyObject_GetAttrString(spec, from_name);
11253 int result = 0;
11254 if (likely(value)) {
11255 result = PyDict_SetItemString(moddict, to_name, value);
11256 Py_DECREF(value);
11257 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
11258 PyErr_Clear();
11259 } else {
11260 result = -1;
11261 }
11262 return result;
11263 }
11264 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
11265 PyObject *module = NULL, *moddict, *modname;
11266 if (__pyx_m)
11267 return __Pyx_NewRef(__pyx_m);
11268 modname = PyObject_GetAttrString(spec, "name");
11269 if (unlikely(!modname)) goto bad;
11270 module = PyModule_NewObject(modname);
11271 Py_DECREF(modname);
11272 if (unlikely(!module)) goto bad;
11273 moddict = PyModule_GetDict(module);
11274 if (unlikely(!moddict)) goto bad;
11275 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
11276 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
11277 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
11278 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
11279 return module;
11280 bad:
11281 Py_XDECREF(module);
11282 return NULL;
11283 }
11284
11285
11286 static int __pyx_pymod_exec_render(PyObject *__pyx_pyinit_module)
11287 #endif
925611288 #endif
925711289 {
925811290 PyObject *__pyx_t_1 = NULL;
925911291 PyObject *__pyx_t_2 = NULL;
9260 PyObject *__pyx_t_3 = NULL;
9261 PyObject *__pyx_t_4 = NULL;
9262 PyObject *__pyx_t_5 = NULL;
926311292 __Pyx_RefNannyDeclarations
11293 #if CYTHON_PEP489_MULTI_PHASE_INIT
11294 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
11295 #elif PY_MAJOR_VERSION >= 3
11296 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
11297 #endif
926411298 #if CYTHON_REFNANNY
9265 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
9266 if (!__Pyx_RefNanny) {
9267 PyErr_Clear();
9268 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
9269 if (!__Pyx_RefNanny)
9270 Py_FatalError("failed to import 'refnanny' module");
9271 }
9272 #endif
9273 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_render(void)", 0);
11299 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
11300 if (!__Pyx_RefNanny) {
11301 PyErr_Clear();
11302 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
11303 if (!__Pyx_RefNanny)
11304 Py_FatalError("failed to import 'refnanny' module");
11305 }
11306 #endif
11307 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_render(void)", 0);
927411308 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
927511309 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
927611310 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
928711321 #ifdef __Pyx_Generator_USED
928811322 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
928911323 #endif
11324 #ifdef __Pyx_AsyncGen_USED
11325 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
11326 #endif
929011327 #ifdef __Pyx_StopAsyncIteration_USED
929111328 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
929211329 #endif
929811335 #endif
929911336 #endif
930011337 /*--- Module creation code ---*/
11338 #if CYTHON_PEP489_MULTI_PHASE_INIT
11339 __pyx_m = __pyx_pyinit_module;
11340 Py_INCREF(__pyx_m);
11341 #else
930111342 #if PY_MAJOR_VERSION < 3
930211343 __pyx_m = Py_InitModule4("render", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
930311344 #else
930411345 __pyx_m = PyModule_Create(&__pyx_moduledef);
930511346 #endif
930611347 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
11348 #endif
930711349 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
930811350 Py_INCREF(__pyx_d);
930911351 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
11352 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
931011353 #if CYTHON_COMPILING_IN_PYPY
931111354 Py_INCREF(__pyx_b);
931211355 #endif
933111374 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
933211375 /*--- Constants init code ---*/
933311376 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9334 /*--- Global init code ---*/
9335 /*--- Variable export code ---*/
9336 /*--- Function export code ---*/
9337 /*--- Type init code ---*/
9338 __pyx_vtabptr_11pygame_sdl2_6render_Renderer = &__pyx_vtable_11pygame_sdl2_6render_Renderer;
9339 __pyx_vtable_11pygame_sdl2_6render_Renderer.set_drawcolor = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_6render_Renderer *, PyObject *))__pyx_f_11pygame_sdl2_6render_8Renderer_set_drawcolor;
9340 if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_Renderer) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
9341 __pyx_type_11pygame_sdl2_6render_Renderer.tp_print = 0;
9342 if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_6render_Renderer.tp_dict, __pyx_vtabptr_11pygame_sdl2_6render_Renderer) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
9343 if (PyObject_SetAttrString(__pyx_m, "Renderer", (PyObject *)&__pyx_type_11pygame_sdl2_6render_Renderer) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
9344 __pyx_ptype_11pygame_sdl2_6render_Renderer = &__pyx_type_11pygame_sdl2_6render_Renderer;
9345 __pyx_vtabptr_11pygame_sdl2_6render_Texture = &__pyx_vtable_11pygame_sdl2_6render_Texture;
9346 __pyx_vtable_11pygame_sdl2_6render_Texture.set = (PyObject *(*)(struct __pyx_obj_11pygame_sdl2_6render_Texture *, SDL_Renderer *, SDL_Texture *))__pyx_f_11pygame_sdl2_6render_7Texture_set;
9347 if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_Texture) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
9348 __pyx_type_11pygame_sdl2_6render_Texture.tp_print = 0;
9349 if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_6render_Texture.tp_dict, __pyx_vtabptr_11pygame_sdl2_6render_Texture) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
9350 if (PyObject_SetAttrString(__pyx_m, "Texture", (PyObject *)&__pyx_type_11pygame_sdl2_6render_Texture) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
9351 __pyx_ptype_11pygame_sdl2_6render_Texture = &__pyx_type_11pygame_sdl2_6render_Texture;
9352 if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_TextureNode) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
9353 __pyx_type_11pygame_sdl2_6render_TextureNode.tp_print = 0;
9354 if (PyObject_SetAttrString(__pyx_m, "TextureNode", (PyObject *)&__pyx_type_11pygame_sdl2_6render_TextureNode) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
9355 __pyx_ptype_11pygame_sdl2_6render_TextureNode = &__pyx_type_11pygame_sdl2_6render_TextureNode;
9356 if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_TextureAtlas) < 0) __PYX_ERR(0, 245, __pyx_L1_error)
9357 __pyx_type_11pygame_sdl2_6render_TextureAtlas.tp_print = 0;
9358 if (PyObject_SetAttrString(__pyx_m, "TextureAtlas", (PyObject *)&__pyx_type_11pygame_sdl2_6render_TextureAtlas) < 0) __PYX_ERR(0, 245, __pyx_L1_error)
9359 __pyx_ptype_11pygame_sdl2_6render_TextureAtlas = &__pyx_type_11pygame_sdl2_6render_TextureAtlas;
9360 __pyx_vtabptr_11pygame_sdl2_6render_Sprite = &__pyx_vtable_11pygame_sdl2_6render_Sprite;
9361 __pyx_vtable_11pygame_sdl2_6render_Sprite.adjust_rect = (void (*)(struct __pyx_obj_11pygame_sdl2_6render_Sprite *, SDL_Rect const *, SDL_Rect const *, SDL_Rect *))__pyx_f_11pygame_sdl2_6render_6Sprite_adjust_rect;
9362 if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_Sprite) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
9363 __pyx_type_11pygame_sdl2_6render_Sprite.tp_print = 0;
9364 if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_6render_Sprite.tp_dict, __pyx_vtabptr_11pygame_sdl2_6render_Sprite) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
9365 if (PyObject_SetAttrString(__pyx_m, "Sprite", (PyObject *)&__pyx_type_11pygame_sdl2_6render_Sprite) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
9366 __pyx_ptype_11pygame_sdl2_6render_Sprite = &__pyx_type_11pygame_sdl2_6render_Sprite;
9367 if (PyType_Ready(&__pyx_type_11pygame_sdl2_6render_Container) < 0) __PYX_ERR(0, 433, __pyx_L1_error)
9368 __pyx_type_11pygame_sdl2_6render_Container.tp_print = 0;
9369 #if CYTHON_COMPILING_IN_CPYTHON
9370 {
9371 PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_11pygame_sdl2_6render_Container, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 433, __pyx_L1_error)
9372 if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
9373 __pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
9374 __pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__.doc = __pyx_doc_11pygame_sdl2_6render_9Container___init__;
9375 ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_11pygame_sdl2_6render_9Container___init__;
9376 }
9377 }
9378 #endif
9379 if (PyObject_SetAttrString(__pyx_m, "Container", (PyObject *)&__pyx_type_11pygame_sdl2_6render_Container) < 0) __PYX_ERR(0, 433, __pyx_L1_error)
9380 __pyx_ptype_11pygame_sdl2_6render_Container = &__pyx_type_11pygame_sdl2_6render_Container;
9381 /*--- Type import code ---*/
9382 __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
9383 __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
9384 __pyx_ptype_11pygame_sdl2_7display_Window = __Pyx_ImportType("pygame_sdl2.display", "Window", sizeof(struct __pyx_obj_11pygame_sdl2_7display_Window), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7display_Window)) __PYX_ERR(2, 23, __pyx_L1_error)
9385 __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType("pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_4rect_Rect)) __PYX_ERR(3, 21, __pyx_L1_error)
9386 /*--- Variable import code ---*/
9387 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.display"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
9388 if (__Pyx_ImportVoidPtr(__pyx_t_1, "main_window", (void **)&__pyx_vp_11pygame_sdl2_7display_main_window, "struct __pyx_obj_11pygame_sdl2_7display_Window *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9389 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9390 /*--- Function import code ---*/
9391 __pyx_t_2 = __Pyx_ImportModule("pygame_sdl2.rwobject"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error)
9392 if (__Pyx_ImportFunction(__pyx_t_2, "to_rwops", (void (**)(void))&__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9393 Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9394 __pyx_t_3 = __Pyx_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_3) __PYX_ERR(0, 1, __pyx_L1_error)
9395 if (__Pyx_ImportFunction(__pyx_t_3, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9396 Py_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11377 /*--- Global type/function init code ---*/
11378 (void)__Pyx_modinit_global_init_code();
11379 (void)__Pyx_modinit_variable_export_code();
11380 (void)__Pyx_modinit_function_export_code();
11381 if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
11382 if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
11383 if (unlikely(__Pyx_modinit_variable_import_code() != 0)) goto __pyx_L1_error;
11384 if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error;
939711385 /*--- Execution code ---*/
939811386 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
939911387 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
940611394 * from pygame_sdl2.error import error
940711395 * from pygame_sdl2.color import Color
940811396 */
9409 __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error)
9410 __Pyx_GOTREF(__pyx_t_4);
11397 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
11398 __Pyx_GOTREF(__pyx_t_1);
941111399 __Pyx_INCREF(__pyx_n_s_Rect);
941211400 __Pyx_GIVEREF(__pyx_n_s_Rect);
9413 PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_Rect);
9414 __pyx_t_5 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_4, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 27, __pyx_L1_error)
9415 __Pyx_GOTREF(__pyx_t_5);
9416 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9417 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_Rect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error)
9418 __Pyx_GOTREF(__pyx_t_4);
9419 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_4) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
9420 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9421 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11401 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Rect);
11402 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
11403 __Pyx_GOTREF(__pyx_t_2);
11404 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11405 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
11406 __Pyx_GOTREF(__pyx_t_1);
11407 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_1) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
11408 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11409 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
942211410
942311411 /* "pygame_sdl2/render.pyx":28
942411412 *
942711415 * from pygame_sdl2.color import Color
942811416 * import json
942911417 */
9430 __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 28, __pyx_L1_error)
9431 __Pyx_GOTREF(__pyx_t_5);
11418 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
11419 __Pyx_GOTREF(__pyx_t_2);
943211420 __Pyx_INCREF(__pyx_n_s_error);
943311421 __Pyx_GIVEREF(__pyx_n_s_error);
9434 PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_error);
9435 __pyx_t_4 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_5, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error)
9436 __Pyx_GOTREF(__pyx_t_4);
9437 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9438 __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 28, __pyx_L1_error)
9439 __Pyx_GOTREF(__pyx_t_5);
9440 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_5) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
9441 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9442 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11422 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error);
11423 __pyx_t_1 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
11424 __Pyx_GOTREF(__pyx_t_1);
11425 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11426 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
11427 __Pyx_GOTREF(__pyx_t_2);
11428 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
11429 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11430 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
944311431
944411432 /* "pygame_sdl2/render.pyx":29
944511433 * from pygame_sdl2.rect import Rect
944811436 * import json
944911437 * import warnings
945011438 */
9451 __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error)
9452 __Pyx_GOTREF(__pyx_t_4);
11439 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
11440 __Pyx_GOTREF(__pyx_t_1);
945311441 __Pyx_INCREF(__pyx_n_s_Color);
945411442 __Pyx_GIVEREF(__pyx_n_s_Color);
9455 PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_Color);
9456 __pyx_t_5 = __Pyx_Import(__pyx_n_s_pygame_sdl2_color, __pyx_t_4, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 29, __pyx_L1_error)
9457 __Pyx_GOTREF(__pyx_t_5);
9458 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9459 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_Color); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error)
9460 __Pyx_GOTREF(__pyx_t_4);
9461 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Color, __pyx_t_4) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
9462 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9463 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11443 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Color);
11444 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_color, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
11445 __Pyx_GOTREF(__pyx_t_2);
11446 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11447 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Color); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
11448 __Pyx_GOTREF(__pyx_t_1);
11449 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Color, __pyx_t_1) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
11450 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11451 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
946411452
946511453 /* "pygame_sdl2/render.pyx":30
946611454 * from pygame_sdl2.error import error
946911457 * import warnings
947011458 *
947111459 */
9472 __pyx_t_5 = __Pyx_Import(__pyx_n_s_json, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 30, __pyx_L1_error)
9473 __Pyx_GOTREF(__pyx_t_5);
9474 if (PyDict_SetItem(__pyx_d, __pyx_n_s_json, __pyx_t_5) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
9475 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11460 __pyx_t_2 = __Pyx_Import(__pyx_n_s_json, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error)
11461 __Pyx_GOTREF(__pyx_t_2);
11462 if (PyDict_SetItem(__pyx_d, __pyx_n_s_json, __pyx_t_2) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
11463 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
947611464
947711465 /* "pygame_sdl2/render.pyx":31
947811466 * from pygame_sdl2.color import Color
948111469 *
948211470 * BLENDMODE_NONE = SDL_BLENDMODE_NONE
948311471 */
9484 __pyx_t_5 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 31, __pyx_L1_error)
9485 __Pyx_GOTREF(__pyx_t_5);
9486 if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_5) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
9487 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11472 __pyx_t_2 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
11473 __Pyx_GOTREF(__pyx_t_2);
11474 if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_2) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
11475 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
948811476
948911477 /* "pygame_sdl2/render.pyx":33
949011478 * import warnings
949311481 * BLENDMODE_BLEND = SDL_BLENDMODE_BLEND
949411482 * BLENDMODE_ADD = SDL_BLENDMODE_ADD
949511483 */
9496 __pyx_t_5 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_NONE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 33, __pyx_L1_error)
9497 __Pyx_GOTREF(__pyx_t_5);
9498 if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_NONE, __pyx_t_5) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
9499 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11484 __pyx_t_2 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_NONE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 33, __pyx_L1_error)
11485 __Pyx_GOTREF(__pyx_t_2);
11486 if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_NONE, __pyx_t_2) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
11487 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
950011488
950111489 /* "pygame_sdl2/render.pyx":34
950211490 *
950511493 * BLENDMODE_ADD = SDL_BLENDMODE_ADD
950611494 * BLENDMODE_MOD = SDL_BLENDMODE_MOD
950711495 */
9508 __pyx_t_5 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_BLEND); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 34, __pyx_L1_error)
9509 __Pyx_GOTREF(__pyx_t_5);
9510 if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_BLEND, __pyx_t_5) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
9511 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11496 __pyx_t_2 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_BLEND); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
11497 __Pyx_GOTREF(__pyx_t_2);
11498 if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_BLEND, __pyx_t_2) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
11499 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
951211500
951311501 /* "pygame_sdl2/render.pyx":35
951411502 * BLENDMODE_NONE = SDL_BLENDMODE_NONE
951711505 * BLENDMODE_MOD = SDL_BLENDMODE_MOD
951811506 *
951911507 */
9520 __pyx_t_5 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_ADD); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 35, __pyx_L1_error)
9521 __Pyx_GOTREF(__pyx_t_5);
9522 if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_ADD, __pyx_t_5) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
9523 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11508 __pyx_t_2 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_ADD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
11509 __Pyx_GOTREF(__pyx_t_2);
11510 if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_ADD, __pyx_t_2) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
11511 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
952411512
952511513 /* "pygame_sdl2/render.pyx":36
952611514 * BLENDMODE_BLEND = SDL_BLENDMODE_BLEND
952911517 *
953011518 * cdef bint DEBUG_DRAW_BBOX = True
953111519 */
9532 __pyx_t_5 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_MOD); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
9533 __Pyx_GOTREF(__pyx_t_5);
9534 if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_MOD, __pyx_t_5) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
9535 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11520 __pyx_t_2 = __Pyx_PyInt_From_SDL_BlendMode(SDL_BLENDMODE_MOD); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
11521 __Pyx_GOTREF(__pyx_t_2);
11522 if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLENDMODE_MOD, __pyx_t_2) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
11523 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
953611524
953711525 /* "pygame_sdl2/render.pyx":38
953811526 * BLENDMODE_MOD = SDL_BLENDMODE_MOD
955011538 * cdef SDL_RendererInfo rinfo
955111539 * cdef int num_drivers
955211540 */
9553 __pyx_t_5 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_6render_1get_drivers, NULL, __pyx_n_s_pygame_sdl2_render); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 52, __pyx_L1_error)
9554 __Pyx_GOTREF(__pyx_t_5);
9555 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_drivers, __pyx_t_5) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
9556 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11541 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_6render_1get_drivers, NULL, __pyx_n_s_pygame_sdl2_render); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
11542 __Pyx_GOTREF(__pyx_t_2);
11543 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_drivers, __pyx_t_2) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
11544 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11545
11546 /* "(tree fragment)":1
11547 * def __pyx_unpickle_TextureAtlas(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
11548 * if __pyx_checksum != 0xdcdc1ac:
11549 * from pickle import PickleError as __pyx_PickleError
11550 */
11551 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_6render_3__pyx_unpickle_TextureAtlas, NULL, __pyx_n_s_pygame_sdl2_render); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
11552 __Pyx_GOTREF(__pyx_t_2);
11553 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_TextureAtlas, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
11554 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
955711555
955811556 /* "pygame_sdl2/render.pyx":1
955911557 * # Copyright 2014 Patrick Dawson <pat@dw.is> # <<<<<<<<<<<<<<
956011558 * #
956111559 * # This software is provided 'as-is', without any express or implied
956211560 */
9563 __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1, __pyx_L1_error)
9564 __Pyx_GOTREF(__pyx_t_5);
9565 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9566 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11561 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
11562 __Pyx_GOTREF(__pyx_t_2);
11563 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
11564 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
956711565
956811566 /*--- Wrapped vars code ---*/
956911567
957111569 __pyx_L1_error:;
957211570 __Pyx_XDECREF(__pyx_t_1);
957311571 __Pyx_XDECREF(__pyx_t_2);
9574 __Pyx_XDECREF(__pyx_t_3);
9575 __Pyx_XDECREF(__pyx_t_4);
9576 __Pyx_XDECREF(__pyx_t_5);
957711572 if (__pyx_m) {
957811573 if (__pyx_d) {
9579 __Pyx_AddTraceback("init pygame_sdl2.render", __pyx_clineno, __pyx_lineno, __pyx_filename);
11574 __Pyx_AddTraceback("init pygame_sdl2.render", 0, __pyx_lineno, __pyx_filename);
958011575 }
958111576 Py_DECREF(__pyx_m); __pyx_m = 0;
958211577 } else if (!PyErr_Occurred()) {
958411579 }
958511580 __pyx_L0:;
958611581 __Pyx_RefNannyFinishContext();
9587 #if PY_MAJOR_VERSION < 3
11582 #if CYTHON_PEP489_MULTI_PHASE_INIT
11583 return (__pyx_m != NULL) ? 0 : -1;
11584 #elif PY_MAJOR_VERSION >= 3
11585 return __pyx_m;
11586 #else
958811587 return;
9589 #else
9590 return __pyx_m;
959111588 #endif
959211589 }
959311590
960911606 }
961011607 #endif
961111608
11609 /* PyObjectGetAttrStr */
11610 #if CYTHON_USE_TYPE_SLOTS
11611 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
11612 PyTypeObject* tp = Py_TYPE(obj);
11613 if (likely(tp->tp_getattro))
11614 return tp->tp_getattro(obj, attr_name);
11615 #if PY_MAJOR_VERSION < 3
11616 if (likely(tp->tp_getattr))
11617 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
11618 #endif
11619 return PyObject_GetAttr(obj, attr_name);
11620 }
11621 #endif
11622
961211623 /* GetBuiltinName */
961311624 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
961411625 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
962711638 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
962811639 PyObject *result;
962911640 #if !CYTHON_AVOID_BORROWED_REFS
11641 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
11642 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
11643 if (likely(result)) {
11644 Py_INCREF(result);
11645 } else if (unlikely(PyErr_Occurred())) {
11646 result = NULL;
11647 } else {
11648 #else
963011649 result = PyDict_GetItem(__pyx_d, name);
963111650 if (likely(result)) {
963211651 Py_INCREF(result);
963311652 } else {
11653 #endif
963411654 #else
963511655 result = PyObject_GetItem(__pyx_d, name);
963611656 if (!result) {
964211662 }
964311663
964411664 /* PyCFunctionFastCall */
9645 #if CYTHON_FAST_PYCCALL
11665 #if CYTHON_FAST_PYCCALL
964611666 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
964711667 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
964811668 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
964911669 PyObject *self = PyCFunction_GET_SELF(func);
11670 int flags = PyCFunction_GET_FLAGS(func);
965011671 assert(PyCFunction_Check(func));
9651 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
11672 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
965211673 assert(nargs >= 0);
965311674 assert(nargs == 0 || args != NULL);
965411675 /* _PyCFunction_FastCallDict() must not be called with an exception set,
965511676 because it may clear it (directly or indirectly) and so the
965611677 caller loses its exception */
965711678 assert(!PyErr_Occurred());
9658 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
9659 }
9660 #endif // CYTHON_FAST_PYCCALL
11679 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
11680 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
11681 } else {
11682 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
11683 }
11684 }
11685 #endif
966111686
966211687 /* PyFunctionFastCall */
9663 #if CYTHON_FAST_PYCALL
11688 #if CYTHON_FAST_PYCALL
966411689 #include "frameobject.h"
966511690 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
966611691 PyObject *globals) {
966711692 PyFrameObject *f;
9668 PyThreadState *tstate = PyThreadState_GET();
11693 PyThreadState *tstate = __Pyx_PyThreadState_Current;
966911694 PyObject **fastlocals;
967011695 Py_ssize_t i;
967111696 PyObject *result;
977611801 Py_LeaveRecursiveCall();
977711802 return result;
977811803 }
9779 #endif // CPython < 3.6
9780 #endif // CYTHON_FAST_PYCALL
11804 #endif
11805 #endif
978111806
978211807 /* PyObjectCall */
9783 #if CYTHON_COMPILING_IN_CPYTHON
11808 #if CYTHON_COMPILING_IN_CPYTHON
978411809 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
978511810 PyObject *result;
978611811 ternaryfunc call = func->ob_type->tp_call;
980011825 #endif
980111826
980211827 /* PyObjectCallMethO */
9803 #if CYTHON_COMPILING_IN_CPYTHON
11828 #if CYTHON_COMPILING_IN_CPYTHON
980411829 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
980511830 PyObject *self, *result;
980611831 PyCFunction cfunc;
982011845 #endif
982111846
982211847 /* PyObjectCallOneArg */
9823 #if CYTHON_COMPILING_IN_CPYTHON
11848 #if CYTHON_COMPILING_IN_CPYTHON
982411849 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
982511850 PyObject *result;
982611851 PyObject *args = PyTuple_New(1);
983711862 return __Pyx_PyFunction_FastCall(func, &arg, 1);
983811863 }
983911864 #endif
9840 #ifdef __Pyx_CyFunction_USED
9841 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
9842 #else
984311865 if (likely(PyCFunction_Check(func))) {
9844 #endif
984511866 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
984611867 return __Pyx_PyObject_CallMethO(func, arg);
984711868 #if CYTHON_FAST_PYCCALL
987211893 }
987311894 #endif
987411895 #ifdef __Pyx_CyFunction_USED
9875 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
11896 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
987611897 #else
987711898 if (likely(PyCFunction_Check(func))) {
987811899 #endif
1002412045 "raise: exception class must be a subclass of BaseException");
1002512046 goto bad;
1002612047 }
10027 #if PY_VERSION_HEX >= 0x03030000
1002812048 if (cause) {
10029 #else
10030 if (cause && cause != Py_None) {
10031 #endif
1003212049 PyObject *fixed_cause;
1003312050 if (cause == Py_None) {
1003412051 fixed_cause = NULL;
1005612073 PyErr_Restore(tmp_type, tmp_value, tb);
1005712074 Py_XDECREF(tmp_tb);
1005812075 #else
10059 PyThreadState *tstate = PyThreadState_GET();
12076 PyThreadState *tstate = __Pyx_PyThreadState_Current;
1006012077 PyObject* tmp_tb = tstate->curexc_traceback;
1006112078 if (tb != tmp_tb) {
1006212079 Py_INCREF(tb);
1007212089 #endif
1007312090
1007412091 /* RaiseArgTupleInvalid */
10075 static void __Pyx_RaiseArgtupleInvalid(
12092 static void __Pyx_RaiseArgtupleInvalid(
1007612093 const char* func_name,
1007712094 int exact,
1007812095 Py_ssize_t num_min,
1009812115 }
1009912116
1010012117 /* KeywordStringCheck */
10101 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
12118 static int __Pyx_CheckKeywordStrings(
1010212119 PyObject *kwdict,
1010312120 const char* function_name,
1010412121 int kw_allowed)
1011212129 #else
1011312130 while (PyDict_Next(kwdict, &pos, &key, 0)) {
1011412131 #if PY_MAJOR_VERSION < 3
10115 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
12132 if (unlikely(!PyString_Check(key)))
1011612133 #endif
1011712134 if (unlikely(!PyUnicode_Check(key)))
1011812135 goto invalid_keyword_type;
1013812155 }
1013912156
1014012157 /* RaiseDoubleKeywords */
10141 static void __Pyx_RaiseDoubleKeywordsError(
12158 static void __Pyx_RaiseDoubleKeywordsError(
1014212159 const char* func_name,
1014312160 PyObject* kw_name)
1014412161 {
1015212169 }
1015312170
1015412171 /* ParseKeywords */
10155 static int __Pyx_ParseOptionalKeywords(
12172 static int __Pyx_ParseOptionalKeywords(
1015612173 PyObject *kwds,
1015712174 PyObject **argnames[],
1015812175 PyObject *kwds2,
1025412271 }
1025512272
1025612273 /* ArgTypeTest */
10257 static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
10258 PyErr_Format(PyExc_TypeError,
10259 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
10260 name, type->tp_name, Py_TYPE(obj)->tp_name);
10261 }
10262 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
10263 const char *name, int exact)
12274 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
1026412275 {
1026512276 if (unlikely(!type)) {
1026612277 PyErr_SetString(PyExc_SystemError, "Missing type object");
1026712278 return 0;
1026812279 }
10269 if (none_allowed && obj == Py_None) return 1;
1027012280 else if (exact) {
10271 if (likely(Py_TYPE(obj) == type)) return 1;
1027212281 #if PY_MAJOR_VERSION == 2
10273 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
12282 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
1027412283 #endif
1027512284 }
1027612285 else {
10277 if (likely(PyObject_TypeCheck(obj, type))) return 1;
10278 }
10279 __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
12286 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
12287 }
12288 PyErr_Format(PyExc_TypeError,
12289 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
12290 name, type->tp_name, Py_TYPE(obj)->tp_name);
1028012291 return 0;
1028112292 }
1028212293
12294 /* DictGetItem */
12295 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
12296 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
12297 PyObject *value;
12298 value = PyDict_GetItemWithError(d, key);
12299 if (unlikely(!value)) {
12300 if (!PyErr_Occurred()) {
12301 PyObject* args = PyTuple_Pack(1, key);
12302 if (likely(args))
12303 PyErr_SetObject(PyExc_KeyError, args);
12304 Py_XDECREF(args);
12305 }
12306 return NULL;
12307 }
12308 Py_INCREF(value);
12309 return value;
12310 }
12311 #endif
12312
1028312313 /* ExtTypeTest */
10284 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
12314 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
1028512315 if (unlikely(!type)) {
1028612316 PyErr_SetString(PyExc_SystemError, "Missing type object");
1028712317 return 0;
1028812318 }
10289 if (likely(PyObject_TypeCheck(obj, type)))
12319 if (likely(__Pyx_TypeCheck(obj, type)))
1029012320 return 1;
1029112321 PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
1029212322 Py_TYPE(obj)->tp_name, type->tp_name);
1029412324 }
1029512325
1029612326 /* IterFinish */
10297 static CYTHON_INLINE int __Pyx_IterFinish(void) {
12327 static CYTHON_INLINE int __Pyx_IterFinish(void) {
1029812328 #if CYTHON_FAST_THREAD_STATE
10299 PyThreadState *tstate = PyThreadState_GET();
12329 PyThreadState *tstate = __Pyx_PyThreadState_Current;
1030012330 PyObject* exc_type = tstate->curexc_type;
1030112331 if (unlikely(exc_type)) {
10302 if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
12332 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
1030312333 PyObject *exc_value, *exc_tb;
1030412334 exc_value = tstate->curexc_value;
1030512335 exc_tb = tstate->curexc_traceback;
1032912359 }
1033012360
1033112361 /* PyObjectCallMethod0 */
10332 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
12362 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
1033312363 PyObject *method, *result = NULL;
1033412364 method = __Pyx_PyObject_GetAttrStr(obj, method_name);
1033512365 if (unlikely(!method)) goto bad;
1035112381 }
1035212382
1035312383 /* RaiseNeedMoreValuesToUnpack */
10354 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
12384 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
1035512385 PyErr_Format(PyExc_ValueError,
1035612386 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
1035712387 index, (index == 1) ? "" : "s");
1035812388 }
1035912389
1036012390 /* RaiseTooManyValuesToUnpack */
10361 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
12391 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
1036212392 PyErr_Format(PyExc_ValueError,
1036312393 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
1036412394 }
1036512395
1036612396 /* UnpackItemEndCheck */
10367 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
12397 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
1036812398 if (unlikely(retval)) {
1036912399 Py_DECREF(retval);
1037012400 __Pyx_RaiseTooManyValuesError(expected);
1037612406 }
1037712407
1037812408 /* RaiseNoneIterError */
10379 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
12409 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
1038012410 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
1038112411 }
1038212412
1038312413 /* UnpackTupleError */
10384 static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
12414 static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
1038512415 if (t == Py_None) {
1038612416 __Pyx_RaiseNoneNotIterableError();
1038712417 } else if (PyTuple_GET_SIZE(t) < index) {
1039212422 }
1039312423
1039412424 /* UnpackTuple2 */
10395 static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
10396 int is_tuple, int has_known_size, int decref_tuple) {
12425 static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
12426 PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
12427 PyObject *value1 = NULL, *value2 = NULL;
12428 #if CYTHON_COMPILING_IN_PYPY
12429 value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad;
12430 value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad;
12431 #else
12432 value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1);
12433 value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2);
12434 #endif
12435 if (decref_tuple) {
12436 Py_DECREF(tuple);
12437 }
12438 *pvalue1 = value1;
12439 *pvalue2 = value2;
12440 return 0;
12441 #if CYTHON_COMPILING_IN_PYPY
12442 bad:
12443 Py_XDECREF(value1);
12444 Py_XDECREF(value2);
12445 if (decref_tuple) { Py_XDECREF(tuple); }
12446 return -1;
12447 #endif
12448 }
12449 static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
12450 int has_known_size, int decref_tuple) {
1039712451 Py_ssize_t index;
1039812452 PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
10399 if (!is_tuple && unlikely(!PyTuple_Check(tuple))) {
10400 iternextfunc iternext;
10401 iter = PyObject_GetIter(tuple);
10402 if (unlikely(!iter)) goto bad;
10403 if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
10404 iternext = Py_TYPE(iter)->tp_iternext;
10405 value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
10406 value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
10407 if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
10408 Py_DECREF(iter);
10409 } else {
10410 if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) {
10411 __Pyx_UnpackTupleError(tuple, 2);
10412 goto bad;
10413 }
10414 #if CYTHON_COMPILING_IN_PYPY
10415 value1 = PySequence_ITEM(tuple, 0);
10416 if (unlikely(!value1)) goto bad;
10417 value2 = PySequence_ITEM(tuple, 1);
10418 if (unlikely(!value2)) goto bad;
10419 #else
10420 value1 = PyTuple_GET_ITEM(tuple, 0);
10421 value2 = PyTuple_GET_ITEM(tuple, 1);
10422 Py_INCREF(value1);
10423 Py_INCREF(value2);
10424 #endif
10425 if (decref_tuple) { Py_DECREF(tuple); }
10426 }
12453 iternextfunc iternext;
12454 iter = PyObject_GetIter(tuple);
12455 if (unlikely(!iter)) goto bad;
12456 if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
12457 iternext = Py_TYPE(iter)->tp_iternext;
12458 value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
12459 value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
12460 if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
12461 Py_DECREF(iter);
1042712462 *pvalue1 = value1;
1042812463 *pvalue2 = value2;
1042912464 return 0;
1043912474 }
1044012475
1044112476 /* dict_iter */
10442 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
12477 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
1044312478 Py_ssize_t* p_orig_length, int* p_source_is_dict) {
1044412479 is_dict = is_dict || likely(PyDict_CheckExact(iterable));
1044512480 *p_source_is_dict = is_dict;
12481 if (is_dict) {
1044612482 #if !CYTHON_COMPILING_IN_PYPY
10447 if (is_dict) {
1044812483 *p_orig_length = PyDict_Size(iterable);
1044912484 Py_INCREF(iterable);
1045012485 return iterable;
10451 }
10452 #endif
12486 #elif PY_MAJOR_VERSION >= 3
12487 static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
12488 PyObject **pp = NULL;
12489 if (method_name) {
12490 const char *name = PyUnicode_AsUTF8(method_name);
12491 if (strcmp(name, "iteritems") == 0) pp = &py_items;
12492 else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
12493 else if (strcmp(name, "itervalues") == 0) pp = &py_values;
12494 if (pp) {
12495 if (!*pp) {
12496 *pp = PyUnicode_FromString(name + 4);
12497 if (!*pp)
12498 return NULL;
12499 }
12500 method_name = *pp;
12501 }
12502 }
12503 #endif
12504 }
1045312505 *p_orig_length = 0;
1045412506 if (method_name) {
1045512507 PyObject* iter;
1053512587 }
1053612588
1053712589 /* GetItemInt */
10538 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
12590 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
1053912591 PyObject *r;
1054012592 if (!j) return NULL;
1054112593 r = PyObject_GetItem(o, j);
1054612598 CYTHON_NCP_UNUSED int wraparound,
1054712599 CYTHON_NCP_UNUSED int boundscheck) {
1054812600 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10549 if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
10550 if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
10551 PyObject *r = PyList_GET_ITEM(o, i);
12601 Py_ssize_t wrapped_i = i;
12602 if (wraparound & unlikely(i < 0)) {
12603 wrapped_i += PyList_GET_SIZE(o);
12604 }
12605 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
12606 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
1055212607 Py_INCREF(r);
1055312608 return r;
1055412609 }
1056112616 CYTHON_NCP_UNUSED int wraparound,
1056212617 CYTHON_NCP_UNUSED int boundscheck) {
1056312618 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10564 if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
10565 if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
10566 PyObject *r = PyTuple_GET_ITEM(o, i);
12619 Py_ssize_t wrapped_i = i;
12620 if (wraparound & unlikely(i < 0)) {
12621 wrapped_i += PyTuple_GET_SIZE(o);
12622 }
12623 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
12624 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
1056712625 Py_INCREF(r);
1056812626 return r;
1056912627 }
1061512673 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
1061612674 }
1061712675
10618 /* SetVTable */
10619 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
10620 #if PY_VERSION_HEX >= 0x02070000
10621 PyObject *ob = PyCapsule_New(vtable, 0, 0);
12676 /* ObjectGetItem */
12677 #if CYTHON_USE_TYPE_SLOTS
12678 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
12679 PyObject *runerr;
12680 Py_ssize_t key_value;
12681 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
12682 if (unlikely(!(m && m->sq_item))) {
12683 PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
12684 return NULL;
12685 }
12686 key_value = __Pyx_PyIndex_AsSsize_t(index);
12687 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
12688 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
12689 }
12690 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
12691 PyErr_Clear();
12692 PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
12693 }
12694 return NULL;
12695 }
12696 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
12697 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
12698 if (likely(m && m->mp_subscript)) {
12699 return m->mp_subscript(obj, key);
12700 }
12701 return __Pyx_PyObject_GetIndex(obj, key);
12702 }
12703 #endif
12704
12705 /* PyErrExceptionMatches */
12706 #if CYTHON_FAST_THREAD_STATE
12707 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
12708 Py_ssize_t i, n;
12709 n = PyTuple_GET_SIZE(tuple);
12710 #if PY_MAJOR_VERSION >= 3
12711 for (i=0; i<n; i++) {
12712 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
12713 }
12714 #endif
12715 for (i=0; i<n; i++) {
12716 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
12717 }
12718 return 0;
12719 }
12720 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
12721 PyObject *exc_type = tstate->curexc_type;
12722 if (exc_type == err) return 1;
12723 if (unlikely(!exc_type)) return 0;
12724 if (unlikely(PyTuple_Check(err)))
12725 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
12726 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
12727 }
12728 #endif
12729
12730 /* GetAttr */
12731 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
12732 #if CYTHON_USE_TYPE_SLOTS
12733 #if PY_MAJOR_VERSION >= 3
12734 if (likely(PyUnicode_Check(n)))
1062212735 #else
10623 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
10624 #endif
10625 if (!ob)
10626 goto bad;
10627 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
10628 goto bad;
10629 Py_DECREF(ob);
10630 return 0;
10631 bad:
10632 Py_XDECREF(ob);
10633 return -1;
10634 }
10635
10636 /* GetVTable */
10637 static void* __Pyx_GetVtable(PyObject *dict) {
10638 void* ptr;
10639 PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
10640 if (!ob)
10641 goto bad;
10642 #if PY_VERSION_HEX >= 0x02070000
10643 ptr = PyCapsule_GetPointer(ob, 0);
10644 #else
10645 ptr = PyCObject_AsVoidPtr(ob);
10646 #endif
10647 if (!ptr && !PyErr_Occurred())
10648 PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
10649 Py_DECREF(ob);
10650 return ptr;
10651 bad:
10652 Py_XDECREF(ob);
10653 return NULL;
12736 if (likely(PyString_Check(n)))
12737 #endif
12738 return __Pyx_PyObject_GetAttrStr(o, n);
12739 #endif
12740 return PyObject_GetAttr(o, n);
12741 }
12742
12743 /* GetAttr3 */
12744 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
12745 __Pyx_PyThreadState_declare
12746 __Pyx_PyThreadState_assign
12747 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
12748 return NULL;
12749 __Pyx_PyErr_Clear();
12750 Py_INCREF(d);
12751 return d;
12752 }
12753 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
12754 PyObject *r = __Pyx_GetAttr(o, n);
12755 return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
1065412756 }
1065512757
1065612758 /* Import */
10657 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
12759 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
1065812760 PyObject *empty_list = 0;
1065912761 PyObject *module = 0;
1066012762 PyObject *global_dict = 0;
1066112763 PyObject *empty_dict = 0;
1066212764 PyObject *list;
10663 #if PY_VERSION_HEX < 0x03030000
12765 #if PY_MAJOR_VERSION < 3
1066412766 PyObject *py_import;
1066512767 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
1066612768 if (!py_import)
1068412786 #if PY_MAJOR_VERSION >= 3
1068512787 if (level == -1) {
1068612788 if (strchr(__Pyx_MODULE_NAME, '.')) {
10687 #if PY_VERSION_HEX < 0x03030000
10688 PyObject *py_level = PyInt_FromLong(1);
10689 if (!py_level)
10690 goto bad;
10691 module = PyObject_CallFunctionObjArgs(py_import,
10692 name, global_dict, empty_dict, list, py_level, NULL);
10693 Py_DECREF(py_level);
10694 #else
1069512789 module = PyImport_ImportModuleLevelObject(
1069612790 name, global_dict, empty_dict, list, 1);
10697 #endif
1069812791 if (!module) {
1069912792 if (!PyErr_ExceptionMatches(PyExc_ImportError))
1070012793 goto bad;
1070512798 }
1070612799 #endif
1070712800 if (!module) {
10708 #if PY_VERSION_HEX < 0x03030000
12801 #if PY_MAJOR_VERSION < 3
1070912802 PyObject *py_level = PyInt_FromLong(level);
1071012803 if (!py_level)
1071112804 goto bad;
1071912812 }
1072012813 }
1072112814 bad:
10722 #if PY_VERSION_HEX < 0x03030000
12815 #if PY_MAJOR_VERSION < 3
1072312816 Py_XDECREF(py_import);
1072412817 #endif
1072512818 Py_XDECREF(empty_list);
1072812821 }
1072912822
1073012823 /* ImportFrom */
10731 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
12824 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
1073212825 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
1073312826 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
1073412827 PyErr_Format(PyExc_ImportError,
1074112834 return value;
1074212835 }
1074312836
12837 /* HasAttr */
12838 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
12839 PyObject *r;
12840 if (unlikely(!__Pyx_PyBaseString_Check(n))) {
12841 PyErr_SetString(PyExc_TypeError,
12842 "hasattr(): attribute name must be string");
12843 return -1;
12844 }
12845 r = __Pyx_GetAttr(o, n);
12846 if (unlikely(!r)) {
12847 PyErr_Clear();
12848 return 0;
12849 } else {
12850 Py_DECREF(r);
12851 return 1;
12852 }
12853 }
12854
12855 /* PyObject_GenericGetAttrNoDict */
12856 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
12857 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
12858 PyErr_Format(PyExc_AttributeError,
12859 #if PY_MAJOR_VERSION >= 3
12860 "'%.50s' object has no attribute '%U'",
12861 tp->tp_name, attr_name);
12862 #else
12863 "'%.50s' object has no attribute '%.400s'",
12864 tp->tp_name, PyString_AS_STRING(attr_name));
12865 #endif
12866 return NULL;
12867 }
12868 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
12869 PyObject *descr;
12870 PyTypeObject *tp = Py_TYPE(obj);
12871 if (unlikely(!PyString_Check(attr_name))) {
12872 return PyObject_GenericGetAttr(obj, attr_name);
12873 }
12874 assert(!tp->tp_dictoffset);
12875 descr = _PyType_Lookup(tp, attr_name);
12876 if (unlikely(!descr)) {
12877 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
12878 }
12879 Py_INCREF(descr);
12880 #if PY_MAJOR_VERSION < 3
12881 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
12882 #endif
12883 {
12884 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
12885 if (unlikely(f)) {
12886 PyObject *res = f(descr, obj, (PyObject *)tp);
12887 Py_DECREF(descr);
12888 return res;
12889 }
12890 }
12891 return descr;
12892 }
12893 #endif
12894
12895 /* PyObject_GenericGetAttr */
12896 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
12897 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
12898 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
12899 return PyObject_GenericGetAttr(obj, attr_name);
12900 }
12901 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
12902 }
12903 #endif
12904
12905 /* SetVTable */
12906 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
12907 #if PY_VERSION_HEX >= 0x02070000
12908 PyObject *ob = PyCapsule_New(vtable, 0, 0);
12909 #else
12910 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
12911 #endif
12912 if (!ob)
12913 goto bad;
12914 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
12915 goto bad;
12916 Py_DECREF(ob);
12917 return 0;
12918 bad:
12919 Py_XDECREF(ob);
12920 return -1;
12921 }
12922
12923 /* SetupReduce */
12924 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
12925 int ret;
12926 PyObject *name_attr;
12927 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
12928 if (likely(name_attr)) {
12929 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
12930 } else {
12931 ret = -1;
12932 }
12933 if (unlikely(ret < 0)) {
12934 PyErr_Clear();
12935 ret = 0;
12936 }
12937 Py_XDECREF(name_attr);
12938 return ret;
12939 }
12940 static int __Pyx_setup_reduce(PyObject* type_obj) {
12941 int ret = 0;
12942 PyObject *object_reduce = NULL;
12943 PyObject *object_reduce_ex = NULL;
12944 PyObject *reduce = NULL;
12945 PyObject *reduce_ex = NULL;
12946 PyObject *reduce_cython = NULL;
12947 PyObject *setstate = NULL;
12948 PyObject *setstate_cython = NULL;
12949 #if CYTHON_USE_PYTYPE_LOOKUP
12950 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
12951 #else
12952 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
12953 #endif
12954 #if CYTHON_USE_PYTYPE_LOOKUP
12955 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
12956 #else
12957 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
12958 #endif
12959 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
12960 if (reduce_ex == object_reduce_ex) {
12961 #if CYTHON_USE_PYTYPE_LOOKUP
12962 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
12963 #else
12964 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
12965 #endif
12966 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
12967 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
12968 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
12969 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
12970 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
12971 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
12972 if (!setstate) PyErr_Clear();
12973 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
12974 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
12975 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
12976 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
12977 }
12978 PyType_Modified((PyTypeObject*)type_obj);
12979 }
12980 }
12981 goto GOOD;
12982 BAD:
12983 if (!PyErr_Occurred())
12984 PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
12985 ret = -1;
12986 GOOD:
12987 #if !CYTHON_USE_PYTYPE_LOOKUP
12988 Py_XDECREF(object_reduce);
12989 Py_XDECREF(object_reduce_ex);
12990 #endif
12991 Py_XDECREF(reduce);
12992 Py_XDECREF(reduce_ex);
12993 Py_XDECREF(reduce_cython);
12994 Py_XDECREF(setstate);
12995 Py_XDECREF(setstate_cython);
12996 return ret;
12997 }
12998
12999 /* GetVTable */
13000 static void* __Pyx_GetVtable(PyObject *dict) {
13001 void* ptr;
13002 PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
13003 if (!ob)
13004 goto bad;
13005 #if PY_VERSION_HEX >= 0x02070000
13006 ptr = PyCapsule_GetPointer(ob, 0);
13007 #else
13008 ptr = PyCObject_AsVoidPtr(ob);
13009 #endif
13010 if (!ptr && !PyErr_Occurred())
13011 PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
13012 Py_DECREF(ob);
13013 return ptr;
13014 bad:
13015 Py_XDECREF(ob);
13016 return NULL;
13017 }
13018
13019 /* CLineInTraceback */
13020 #ifndef CYTHON_CLINE_IN_TRACEBACK
13021 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
13022 PyObject *use_cline;
13023 PyObject *ptype, *pvalue, *ptraceback;
13024 #if CYTHON_COMPILING_IN_CPYTHON
13025 PyObject **cython_runtime_dict;
13026 #endif
13027 if (unlikely(!__pyx_cython_runtime)) {
13028 return c_line;
13029 }
13030 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
13031 #if CYTHON_COMPILING_IN_CPYTHON
13032 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
13033 if (likely(cython_runtime_dict)) {
13034 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
13035 } else
13036 #endif
13037 {
13038 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
13039 if (use_cline_obj) {
13040 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
13041 Py_DECREF(use_cline_obj);
13042 } else {
13043 PyErr_Clear();
13044 use_cline = NULL;
13045 }
13046 }
13047 if (!use_cline) {
13048 c_line = 0;
13049 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
13050 }
13051 else if (PyObject_Not(use_cline) != 0) {
13052 c_line = 0;
13053 }
13054 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
13055 return c_line;
13056 }
13057 #endif
13058
1074413059 /* CodeObjectCache */
10745 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
13060 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
1074613061 int start = 0, mid = 0, end = count - 1;
1074713062 if (end >= 0 && code_line > entries[end].code_line) {
1074813063 return count;
1082213137 }
1082313138
1082413139 /* AddTraceback */
10825 #include "compile.h"
13140 #include "compile.h"
1082613141 #include "frameobject.h"
1082713142 #include "traceback.h"
1082813143 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
1088113196 int py_line, const char *filename) {
1088213197 PyCodeObject *py_code = 0;
1088313198 PyFrameObject *py_frame = 0;
10884 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
13199 PyThreadState *tstate = __Pyx_PyThreadState_Current;
13200 if (c_line) {
13201 c_line = __Pyx_CLineForTraceback(tstate, c_line);
13202 }
13203 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
1088513204 if (!py_code) {
1088613205 py_code = __Pyx_CreateCodeObjectForTraceback(
1088713206 funcname, c_line, py_line, filename);
1088813207 if (!py_code) goto bad;
10889 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
13208 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
1089013209 }
1089113210 py_frame = PyFrame_New(
10892 PyThreadState_GET(), /*PyThreadState *tstate,*/
10893 py_code, /*PyCodeObject *code,*/
10894 __pyx_d, /*PyObject *globals,*/
10895 0 /*PyObject *locals*/
13211 tstate, /*PyThreadState *tstate,*/
13212 py_code, /*PyCodeObject *code,*/
13213 __pyx_d, /*PyObject *globals,*/
13214 0 /*PyObject *locals*/
1089613215 );
1089713216 if (!py_frame) goto bad;
1089813217 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
1090313222 }
1090413223
1090513224 /* CIntToPy */
10906 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_BlendMode(SDL_BlendMode value) {
13225 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_SDL_BlendMode(SDL_BlendMode value) {
1090713226 const SDL_BlendMode neg_one = (SDL_BlendMode) -1, const_zero = (SDL_BlendMode) 0;
1090813227 const int is_unsigned = neg_one > const_zero;
1090913228 if (is_unsigned) {
1093313252 }
1093413253 }
1093513254
10936 /* CIntToPy */
10937 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
10938 const int neg_one = (int) -1, const_zero = (int) 0;
10939 const int is_unsigned = neg_one > const_zero;
10940 if (is_unsigned) {
10941 if (sizeof(int) < sizeof(long)) {
10942 return PyInt_FromLong((long) value);
10943 } else if (sizeof(int) <= sizeof(unsigned long)) {
10944 return PyLong_FromUnsignedLong((unsigned long) value);
10945 #ifdef HAVE_LONG_LONG
10946 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
10947 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
10948 #endif
10949 }
10950 } else {
10951 if (sizeof(int) <= sizeof(long)) {
10952 return PyInt_FromLong((long) value);
10953 #ifdef HAVE_LONG_LONG
10954 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
10955 return PyLong_FromLongLong((PY_LONG_LONG) value);
10956 #endif
10957 }
10958 }
10959 {
10960 int one = 1; int little = (int)*(unsigned char *)&one;
10961 unsigned char *bytes = (unsigned char *)&value;
10962 return _PyLong_FromByteArray(bytes, sizeof(int),
10963 little, !is_unsigned);
10964 }
10965 }
10966
1096713255 /* CIntFromPyVerify */
10968 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
13256 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
1096913257 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
1097013258 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
1097113259 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
1098713275 }
1098813276
1098913277 /* CIntToPy */
10990 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
13278 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
13279 const int neg_one = (int) -1, const_zero = (int) 0;
13280 const int is_unsigned = neg_one > const_zero;
13281 if (is_unsigned) {
13282 if (sizeof(int) < sizeof(long)) {
13283 return PyInt_FromLong((long) value);
13284 } else if (sizeof(int) <= sizeof(unsigned long)) {
13285 return PyLong_FromUnsignedLong((unsigned long) value);
13286 #ifdef HAVE_LONG_LONG
13287 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
13288 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
13289 #endif
13290 }
13291 } else {
13292 if (sizeof(int) <= sizeof(long)) {
13293 return PyInt_FromLong((long) value);
13294 #ifdef HAVE_LONG_LONG
13295 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
13296 return PyLong_FromLongLong((PY_LONG_LONG) value);
13297 #endif
13298 }
13299 }
13300 {
13301 int one = 1; int little = (int)*(unsigned char *)&one;
13302 unsigned char *bytes = (unsigned char *)&value;
13303 return _PyLong_FromByteArray(bytes, sizeof(int),
13304 little, !is_unsigned);
13305 }
13306 }
13307
13308 /* CIntToPy */
13309 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
1099113310 const long neg_one = (long) -1, const_zero = (long) 0;
1099213311 const int is_unsigned = neg_one > const_zero;
1099313312 if (is_unsigned) {
1101813337 }
1101913338
1102013339 /* CIntToPy */
11021 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
13340 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
1102213341 const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0;
1102313342 const int is_unsigned = neg_one > const_zero;
1102413343 if (is_unsigned) {
1104913368 }
1105013369
1105113370 /* CIntFromPy */
11052 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
13371 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
13372 const long neg_one = (long) -1, const_zero = (long) 0;
13373 const int is_unsigned = neg_one > const_zero;
13374 #if PY_MAJOR_VERSION < 3
13375 if (likely(PyInt_Check(x))) {
13376 if (sizeof(long) < sizeof(long)) {
13377 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
13378 } else {
13379 long val = PyInt_AS_LONG(x);
13380 if (is_unsigned && unlikely(val < 0)) {
13381 goto raise_neg_overflow;
13382 }
13383 return (long) val;
13384 }
13385 } else
13386 #endif
13387 if (likely(PyLong_Check(x))) {
13388 if (is_unsigned) {
13389 #if CYTHON_USE_PYLONG_INTERNALS
13390 const digit* digits = ((PyLongObject*)x)->ob_digit;
13391 switch (Py_SIZE(x)) {
13392 case 0: return (long) 0;
13393 case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
13394 case 2:
13395 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
13396 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
13397 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13398 } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
13399 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
13400 }
13401 }
13402 break;
13403 case 3:
13404 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
13405 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
13406 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13407 } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
13408 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
13409 }
13410 }
13411 break;
13412 case 4:
13413 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
13414 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
13415 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13416 } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
13417 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
13418 }
13419 }
13420 break;
13421 }
13422 #endif
13423 #if CYTHON_COMPILING_IN_CPYTHON
13424 if (unlikely(Py_SIZE(x) < 0)) {
13425 goto raise_neg_overflow;
13426 }
13427 #else
13428 {
13429 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
13430 if (unlikely(result < 0))
13431 return (long) -1;
13432 if (unlikely(result == 1))
13433 goto raise_neg_overflow;
13434 }
13435 #endif
13436 if (sizeof(long) <= sizeof(unsigned long)) {
13437 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
13438 #ifdef HAVE_LONG_LONG
13439 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
13440 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
13441 #endif
13442 }
13443 } else {
13444 #if CYTHON_USE_PYLONG_INTERNALS
13445 const digit* digits = ((PyLongObject*)x)->ob_digit;
13446 switch (Py_SIZE(x)) {
13447 case 0: return (long) 0;
13448 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
13449 case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
13450 case -2:
13451 if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
13452 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
13453 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13454 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
13455 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13456 }
13457 }
13458 break;
13459 case 2:
13460 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
13461 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
13462 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13463 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
13464 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13465 }
13466 }
13467 break;
13468 case -3:
13469 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
13470 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
13471 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13472 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
13473 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13474 }
13475 }
13476 break;
13477 case 3:
13478 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
13479 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
13480 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13481 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
13482 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13483 }
13484 }
13485 break;
13486 case -4:
13487 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
13488 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
13489 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13490 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
13491 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13492 }
13493 }
13494 break;
13495 case 4:
13496 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
13497 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
13498 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13499 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
13500 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
13501 }
13502 }
13503 break;
13504 }
13505 #endif
13506 if (sizeof(long) <= sizeof(long)) {
13507 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
13508 #ifdef HAVE_LONG_LONG
13509 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
13510 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
13511 #endif
13512 }
13513 }
13514 {
13515 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
13516 PyErr_SetString(PyExc_RuntimeError,
13517 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
13518 #else
13519 long val;
13520 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
13521 #if PY_MAJOR_VERSION < 3
13522 if (likely(v) && !PyLong_Check(v)) {
13523 PyObject *tmp = v;
13524 v = PyNumber_Long(tmp);
13525 Py_DECREF(tmp);
13526 }
13527 #endif
13528 if (likely(v)) {
13529 int one = 1; int is_little = (int)*(unsigned char *)&one;
13530 unsigned char *bytes = (unsigned char *)&val;
13531 int ret = _PyLong_AsByteArray((PyLongObject *)v,
13532 bytes, sizeof(val),
13533 is_little, !is_unsigned);
13534 Py_DECREF(v);
13535 if (likely(!ret))
13536 return val;
13537 }
13538 #endif
13539 return (long) -1;
13540 }
13541 } else {
13542 long val;
13543 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
13544 if (!tmp) return (long) -1;
13545 val = __Pyx_PyInt_As_long(tmp);
13546 Py_DECREF(tmp);
13547 return val;
13548 }
13549 raise_overflow:
13550 PyErr_SetString(PyExc_OverflowError,
13551 "value too large to convert to long");
13552 return (long) -1;
13553 raise_neg_overflow:
13554 PyErr_SetString(PyExc_OverflowError,
13555 "can't convert negative value to long");
13556 return (long) -1;
13557 }
13558
13559 /* CIntFromPy */
13560 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
1105313561 const int neg_one = (int) -1, const_zero = (int) 0;
1105413562 const int is_unsigned = neg_one > const_zero;
1105513563 #if PY_MAJOR_VERSION < 3
1123813746 }
1123913747
1124013748 /* CIntFromPy */
11241 static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) {
13749 static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) {
1124213750 const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0;
1124313751 const int is_unsigned = neg_one > const_zero;
1124413752 #if PY_MAJOR_VERSION < 3
1142613934 return (uint8_t) -1;
1142713935 }
1142813936
11429 /* CIntFromPy */
11430 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
11431 const long neg_one = (long) -1, const_zero = (long) 0;
11432 const int is_unsigned = neg_one > const_zero;
11433 #if PY_MAJOR_VERSION < 3
11434 if (likely(PyInt_Check(x))) {
11435 if (sizeof(long) < sizeof(long)) {
11436 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
13937 /* FastTypeChecks */
13938 #if CYTHON_COMPILING_IN_CPYTHON
13939 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
13940 while (a) {
13941 a = a->tp_base;
13942 if (a == b)
13943 return 1;
13944 }
13945 return b == &PyBaseObject_Type;
13946 }
13947 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
13948 PyObject *mro;
13949 if (a == b) return 1;
13950 mro = a->tp_mro;
13951 if (likely(mro)) {
13952 Py_ssize_t i, n;
13953 n = PyTuple_GET_SIZE(mro);
13954 for (i = 0; i < n; i++) {
13955 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
13956 return 1;
13957 }
13958 return 0;
13959 }
13960 return __Pyx_InBases(a, b);
13961 }
13962 #if PY_MAJOR_VERSION == 2
13963 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
13964 PyObject *exception, *value, *tb;
13965 int res;
13966 __Pyx_PyThreadState_declare
13967 __Pyx_PyThreadState_assign
13968 __Pyx_ErrFetch(&exception, &value, &tb);
13969 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
13970 if (unlikely(res == -1)) {
13971 PyErr_WriteUnraisable(err);
13972 res = 0;
13973 }
13974 if (!res) {
13975 res = PyObject_IsSubclass(err, exc_type2);
13976 if (unlikely(res == -1)) {
13977 PyErr_WriteUnraisable(err);
13978 res = 0;
13979 }
13980 }
13981 __Pyx_ErrRestore(exception, value, tb);
13982 return res;
13983 }
13984 #else
13985 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
13986 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
13987 if (!res) {
13988 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
13989 }
13990 return res;
13991 }
13992 #endif
13993 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
13994 Py_ssize_t i, n;
13995 assert(PyExceptionClass_Check(exc_type));
13996 n = PyTuple_GET_SIZE(tuple);
13997 #if PY_MAJOR_VERSION >= 3
13998 for (i=0; i<n; i++) {
13999 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
14000 }
14001 #endif
14002 for (i=0; i<n; i++) {
14003 PyObject *t = PyTuple_GET_ITEM(tuple, i);
14004 #if PY_MAJOR_VERSION < 3
14005 if (likely(exc_type == t)) return 1;
14006 #endif
14007 if (likely(PyExceptionClass_Check(t))) {
14008 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
1143714009 } else {
11438 long val = PyInt_AS_LONG(x);
11439 if (is_unsigned && unlikely(val < 0)) {
11440 goto raise_neg_overflow;
11441 }
11442 return (long) val;
1144314010 }
11444 } else
11445 #endif
11446 if (likely(PyLong_Check(x))) {
11447 if (is_unsigned) {
11448 #if CYTHON_USE_PYLONG_INTERNALS
11449 const digit* digits = ((PyLongObject*)x)->ob_digit;
11450 switch (Py_SIZE(x)) {
11451 case 0: return (long) 0;
11452 case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
11453 case 2:
11454 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
11455 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11456 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11457 } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
11458 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
11459 }
11460 }
11461 break;
11462 case 3:
11463 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
11464 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
11465 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11466 } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
11467 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
11468 }
11469 }
11470 break;
11471 case 4:
11472 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
11473 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
11474 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11475 } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
11476 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
11477 }
11478 }
11479 break;
11480 }
11481 #endif
11482 #if CYTHON_COMPILING_IN_CPYTHON
11483 if (unlikely(Py_SIZE(x) < 0)) {
11484 goto raise_neg_overflow;
11485 }
11486 #else
11487 {
11488 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
11489 if (unlikely(result < 0))
11490 return (long) -1;
11491 if (unlikely(result == 1))
11492 goto raise_neg_overflow;
11493 }
11494 #endif
11495 if (sizeof(long) <= sizeof(unsigned long)) {
11496 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
11497 #ifdef HAVE_LONG_LONG
11498 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
11499 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
11500 #endif
11501 }
14011 }
14012 return 0;
14013 }
14014 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
14015 if (likely(err == exc_type)) return 1;
14016 if (likely(PyExceptionClass_Check(err))) {
14017 if (likely(PyExceptionClass_Check(exc_type))) {
14018 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
14019 } else if (likely(PyTuple_Check(exc_type))) {
14020 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
1150214021 } else {
11503 #if CYTHON_USE_PYLONG_INTERNALS
11504 const digit* digits = ((PyLongObject*)x)->ob_digit;
11505 switch (Py_SIZE(x)) {
11506 case 0: return (long) 0;
11507 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
11508 case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
11509 case -2:
11510 if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
11511 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11512 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11513 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
11514 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11515 }
11516 }
11517 break;
11518 case 2:
11519 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
11520 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11521 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11522 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
11523 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11524 }
11525 }
11526 break;
11527 case -3:
11528 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
11529 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
11530 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11531 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
11532 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11533 }
11534 }
11535 break;
11536 case 3:
11537 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
11538 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
11539 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11540 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
11541 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11542 }
11543 }
11544 break;
11545 case -4:
11546 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
11547 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
11548 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11549 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
11550 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11551 }
11552 }
11553 break;
11554 case 4:
11555 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
11556 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
11557 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11558 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
11559 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11560 }
11561 }
11562 break;
11563 }
11564 #endif
11565 if (sizeof(long) <= sizeof(long)) {
11566 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
11567 #ifdef HAVE_LONG_LONG
11568 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
11569 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
11570 #endif
11571 }
1157214022 }
11573 {
11574 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
11575 PyErr_SetString(PyExc_RuntimeError,
11576 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
11577 #else
11578 long val;
11579 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
11580 #if PY_MAJOR_VERSION < 3
11581 if (likely(v) && !PyLong_Check(v)) {
11582 PyObject *tmp = v;
11583 v = PyNumber_Long(tmp);
11584 Py_DECREF(tmp);
11585 }
11586 #endif
11587 if (likely(v)) {
11588 int one = 1; int is_little = (int)*(unsigned char *)&one;
11589 unsigned char *bytes = (unsigned char *)&val;
11590 int ret = _PyLong_AsByteArray((PyLongObject *)v,
11591 bytes, sizeof(val),
11592 is_little, !is_unsigned);
11593 Py_DECREF(v);
11594 if (likely(!ret))
11595 return val;
11596 }
11597 #endif
11598 return (long) -1;
11599 }
11600 } else {
11601 long val;
11602 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
11603 if (!tmp) return (long) -1;
11604 val = __Pyx_PyInt_As_long(tmp);
11605 Py_DECREF(tmp);
11606 return val;
11607 }
11608 raise_overflow:
11609 PyErr_SetString(PyExc_OverflowError,
11610 "value too large to convert to long");
11611 return (long) -1;
11612 raise_neg_overflow:
11613 PyErr_SetString(PyExc_OverflowError,
11614 "can't convert negative value to long");
11615 return (long) -1;
11616 }
14023 }
14024 return PyErr_GivenExceptionMatches(err, exc_type);
14025 }
14026 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
14027 assert(PyExceptionClass_Check(exc_type1));
14028 assert(PyExceptionClass_Check(exc_type2));
14029 if (likely(err == exc_type1 || err == exc_type2)) return 1;
14030 if (likely(PyExceptionClass_Check(err))) {
14031 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
14032 }
14033 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
14034 }
14035 #endif
1161714036
1161814037 /* CheckBinaryVersion */
11619 static int __Pyx_check_binary_version(void) {
14038 static int __Pyx_check_binary_version(void) {
1162014039 char ctversion[4], rtversion[4];
1162114040 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
1162214041 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
1163214051 }
1163314052
1163414053 /* ModuleImport */
11635 #ifndef __PYX_HAVE_RT_ImportModule
14054 #ifndef __PYX_HAVE_RT_ImportModule
1163614055 #define __PYX_HAVE_RT_ImportModule
1163714056 static PyObject *__Pyx_ImportModule(const char *name) {
1163814057 PyObject *py_name = 0;
1165014069 #endif
1165114070
1165214071 /* TypeImport */
11653 #ifndef __PYX_HAVE_RT_ImportType
14072 #ifndef __PYX_HAVE_RT_ImportType
1165414073 #define __PYX_HAVE_RT_ImportType
1165514074 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
1165614075 size_t size, int strict)
1171514134 #endif
1171614135
1171714136 /* VoidPtrImport */
11718 #ifndef __PYX_HAVE_RT_ImportVoidPtr
14137 #ifndef __PYX_HAVE_RT_ImportVoidPtr
1171914138 #define __PYX_HAVE_RT_ImportVoidPtr
1172014139 static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) {
1172114140 PyObject *d = 0;
1176414183 #endif
1176514184
1176614185 /* FunctionImport */
11767 #ifndef __PYX_HAVE_RT_ImportFunction
14186 #ifndef __PYX_HAVE_RT_ImportFunction
1176814187 #define __PYX_HAVE_RT_ImportFunction
1176914188 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
1177014189 PyObject *d = 0;
1181814237 #endif
1181914238
1182014239 /* InitStrings */
11821 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
14240 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
1182214241 while (t->p) {
1182314242 #if PY_MAJOR_VERSION < 3
1182414243 if (t->is_unicode) {
1184314262 #endif
1184414263 if (!*t->p)
1184514264 return -1;
14265 if (PyObject_Hash(*t->p) == -1)
14266 return -1;
1184614267 ++t;
1184714268 }
1184814269 return 0;
1185114272 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
1185214273 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
1185314274 }
11854 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
14275 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
1185514276 Py_ssize_t ignore;
1185614277 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
1185714278 }
11858 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
11859 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
14279 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
14280 #if !CYTHON_PEP393_ENABLED
14281 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
14282 char* defenc_c;
14283 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
14284 if (!defenc) return NULL;
14285 defenc_c = PyBytes_AS_STRING(defenc);
14286 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
14287 {
14288 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
14289 char* c;
14290 for (c = defenc_c; c < end; c++) {
14291 if ((unsigned char) (*c) >= 128) {
14292 PyUnicode_AsASCIIString(o);
14293 return NULL;
14294 }
14295 }
14296 }
14297 #endif
14298 *length = PyBytes_GET_SIZE(defenc);
14299 return defenc_c;
14300 }
14301 #else
14302 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
14303 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
14304 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
14305 if (likely(PyUnicode_IS_ASCII(o))) {
14306 *length = PyUnicode_GET_LENGTH(o);
14307 return PyUnicode_AsUTF8(o);
14308 } else {
14309 PyUnicode_AsASCIIString(o);
14310 return NULL;
14311 }
14312 #else
14313 return PyUnicode_AsUTF8AndSize(o, length);
14314 #endif
14315 }
14316 #endif
14317 #endif
14318 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
14319 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1186014320 if (
1186114321 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1186214322 __Pyx_sys_getdefaultencoding_not_ascii &&
1186314323 #endif
1186414324 PyUnicode_Check(o)) {
11865 #if PY_VERSION_HEX < 0x03030000
11866 char* defenc_c;
11867 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
11868 if (!defenc) return NULL;
11869 defenc_c = PyBytes_AS_STRING(defenc);
11870 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
11871 {
11872 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
11873 char* c;
11874 for (c = defenc_c; c < end; c++) {
11875 if ((unsigned char) (*c) >= 128) {
11876 PyUnicode_AsASCIIString(o);
11877 return NULL;
11878 }
11879 }
11880 }
11881 #endif
11882 *length = PyBytes_GET_SIZE(defenc);
11883 return defenc_c;
11884 #else
11885 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
11886 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
11887 if (PyUnicode_IS_ASCII(o)) {
11888 *length = PyUnicode_GET_LENGTH(o);
11889 return PyUnicode_AsUTF8(o);
11890 } else {
11891 PyUnicode_AsASCIIString(o);
11892 return NULL;
11893 }
11894 #else
11895 return PyUnicode_AsUTF8AndSize(o, length);
11896 #endif
11897 #endif
14325 return __Pyx_PyUnicode_AsStringAndSize(o, length);
1189814326 } else
1189914327 #endif
1190014328 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
1191814346 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
1191914347 else return PyObject_IsTrue(x);
1192014348 }
14349 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
14350 #if PY_MAJOR_VERSION >= 3
14351 if (PyLong_Check(result)) {
14352 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
14353 "__int__ returned non-int (type %.200s). "
14354 "The ability to return an instance of a strict subclass of int "
14355 "is deprecated, and may be removed in a future version of Python.",
14356 Py_TYPE(result)->tp_name)) {
14357 Py_DECREF(result);
14358 return NULL;
14359 }
14360 return result;
14361 }
14362 #endif
14363 PyErr_Format(PyExc_TypeError,
14364 "__%.4s__ returned non-%.4s (type %.200s)",
14365 type_name, type_name, Py_TYPE(result)->tp_name);
14366 Py_DECREF(result);
14367 return NULL;
14368 }
1192114369 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
1192214370 #if CYTHON_USE_TYPE_SLOTS
1192314371 PyNumberMethods *m;
1192514373 const char *name = NULL;
1192614374 PyObject *res = NULL;
1192714375 #if PY_MAJOR_VERSION < 3
11928 if (PyInt_Check(x) || PyLong_Check(x))
14376 if (likely(PyInt_Check(x) || PyLong_Check(x)))
1192914377 #else
11930 if (PyLong_Check(x))
14378 if (likely(PyLong_Check(x)))
1193114379 #endif
1193214380 return __Pyx_NewRef(x);
1193314381 #if CYTHON_USE_TYPE_SLOTS
1193514383 #if PY_MAJOR_VERSION < 3
1193614384 if (m && m->nb_int) {
1193714385 name = "int";
11938 res = PyNumber_Int(x);
14386 res = m->nb_int(x);
1193914387 }
1194014388 else if (m && m->nb_long) {
1194114389 name = "long";
11942 res = PyNumber_Long(x);
14390 res = m->nb_long(x);
1194314391 }
1194414392 #else
11945 if (m && m->nb_int) {
14393 if (likely(m && m->nb_int)) {
1194614394 name = "int";
11947 res = PyNumber_Long(x);
14395 res = m->nb_int(x);
1194814396 }
1194914397 #endif
1195014398 #else
11951 res = PyNumber_Int(x);
11952 #endif
11953 if (res) {
14399 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
14400 res = PyNumber_Int(x);
14401 }
14402 #endif
14403 if (likely(res)) {
1195414404 #if PY_MAJOR_VERSION < 3
11955 if (!PyInt_Check(res) && !PyLong_Check(res)) {
14405 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
1195614406 #else
11957 if (!PyLong_Check(res)) {
11958 #endif
11959 PyErr_Format(PyExc_TypeError,
11960 "__%.4s__ returned non-%.4s (type %.200s)",
11961 name, name, Py_TYPE(res)->tp_name);
11962 Py_DECREF(res);
11963 return NULL;
14407 if (unlikely(!PyLong_CheckExact(res))) {
14408 #endif
14409 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
1196414410 }
1196514411 }
1196614412 else if (!PyErr_Occurred()) {
1203114477 Py_DECREF(x);
1203214478 return ival;
1203314479 }
14480 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
14481 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
14482 }
1203414483 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
1203514484 return PyInt_FromSize_t(ival);
1203614485 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
8 #else
9 #define CYTHON_ABI "0_25_2"
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
8 #else
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
102120 #define CYTHON_COMPILING_IN_CPYTHON 1
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
105129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
409549 { \
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420552
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
428560
429561 #define __PYX_HAVE__pygame_sdl2__rwobject
430562 #define __PYX_HAVE_API__pygame_sdl2__rwobject
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
438571 #include <omp.h>
439572 #endif /* _OPENMP */
440573
441 #ifdef PYREX_WITHOUT_ASSERTIONS
574 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
442575 #define CYTHON_WITHOUT_ASSERTIONS
443576 #endif
444577
469602 #define __Pyx_sst_abs(value) abs(value)
470603 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
471604 #define __Pyx_sst_abs(value) labs(value)
472 #elif defined (_MSC_VER) && defined (_M_X64)
473 #define __Pyx_sst_abs(value) _abs64(value)
605 #elif defined (_MSC_VER)
606 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
474607 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
475608 #define __Pyx_sst_abs(value) llabs(value)
476609 #elif defined (__GNUC__)
478611 #else
479612 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
480613 #endif
481 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
482 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
614 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
615 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
483616 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
484617 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
485618 #define __Pyx_PyBytes_FromString PyBytes_FromString
492625 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
493626 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
494627 #endif
495 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
496 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
628 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
629 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
634 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
635 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
638 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
497639 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
498640 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
499641 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
500642 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
501643 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
502 #if PY_MAJOR_VERSION < 3
503 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
504 {
644 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
505645 const Py_UNICODE *u_end = u;
506646 while (*u_end++) ;
507647 return (size_t)(u_end - u - 1);
508648 }
509 #else
510 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
511 #endif
512649 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
513650 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
514651 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
515652 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
516653 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
517 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
654 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
518655 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
519656 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
657 #define __Pyx_PySequence_Tuple(obj)\
658 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
520659 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
521660 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
522661 #if CYTHON_ASSUME_SAFE_MACROS
615754 #define likely(x) (x)
616755 #define unlikely(x) (x)
617756 #endif /* __GNUC__ */
618
619 static PyObject *__pyx_m;
757 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
758
759 static PyObject *__pyx_m = NULL;
620760 static PyObject *__pyx_d;
621761 static PyObject *__pyx_b;
762 static PyObject *__pyx_cython_runtime = NULL;
622763 static PyObject *__pyx_empty_tuple;
623764 static PyObject *__pyx_empty_bytes;
624765 static PyObject *__pyx_empty_unicode;
632773 "src/pygame_sdl2/rwobject.pyx",
633774 "type.pxd",
634775 };
776 /* ForceInitThreads.proto */
777 #ifndef __PYX_FORCE_INIT_THREADS
778 #define __PYX_FORCE_INIT_THREADS 0
779 #endif
780
781 /* NoFastGil.proto */
782 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
783 #define __Pyx_PyGILState_Release PyGILState_Release
784 #define __Pyx_FastGIL_Remember()
785 #define __Pyx_FastGIL_Forget()
786 #define __Pyx_FastGilFuncInit()
787
635788
636789 /*--- Type declarations ---*/
637790 struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops;
728881
729882 /* PyObjectGetAttrStr.proto */
730883 #if CYTHON_USE_TYPE_SLOTS
731 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
732 PyTypeObject* tp = Py_TYPE(obj);
733 if (likely(tp->tp_getattro))
734 return tp->tp_getattro(obj, attr_name);
735 #if PY_MAJOR_VERSION < 3
736 if (likely(tp->tp_getattr))
737 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
738 #endif
739 return PyObject_GetAttr(obj, attr_name);
740 }
884 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
741885 #else
742886 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
743887 #endif
744888
745889 /* GetBuiltinName.proto */
746890 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
747
748 /* PyObjectCall.proto */
749 #if CYTHON_COMPILING_IN_CPYTHON
750 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
751 #else
752 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
753 #endif
754
755 /* ForceInitThreads.proto */
756 #ifndef __PYX_FORCE_INIT_THREADS
757 #define __PYX_FORCE_INIT_THREADS 0
758 #endif
759891
760892 /* PyCFunctionFastCall.proto */
761893 #if CYTHON_FAST_PYCCALL
775907 #endif
776908 #endif
777909
910 /* PyObjectCall.proto */
911 #if CYTHON_COMPILING_IN_CPYTHON
912 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
913 #else
914 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
915 #endif
916
778917 /* PyObjectCallMethO.proto */
779918 #if CYTHON_COMPILING_IN_CPYTHON
780919 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
793932 /* PyThreadStateGet.proto */
794933 #if CYTHON_FAST_THREAD_STATE
795934 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
796 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
935 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
936 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
797937 #else
798938 #define __Pyx_PyThreadState_declare
799939 #define __Pyx_PyThreadState_assign
940 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
800941 #endif
801942
802943 /* SaveResetException.proto */
820961
821962 /* PyErrFetchRestore.proto */
822963 #if CYTHON_FAST_THREAD_STATE
964 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
823965 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
824966 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
825967 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
826968 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
827969 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
828970 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
829 #else
971 #if CYTHON_COMPILING_IN_CPYTHON
972 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
973 #else
974 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
975 #endif
976 #else
977 #define __Pyx_PyErr_Clear() PyErr_Clear()
978 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
830979 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
831980 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
981 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
982 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
832983 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
833984 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
834985 #endif
8661017 /* RaiseException.proto */
8671018 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
8681019
1020 /* GetAttr.proto */
1021 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1022
1023 /* HasAttr.proto */
1024 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1025
8691026 /* Import.proto */
8701027 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
8711028
8721029 /* ImportFrom.proto */
8731030 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1031
1032 /* CLineInTraceback.proto */
1033 #ifdef CYTHON_CLINE_IN_TRACEBACK
1034 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1035 #else
1036 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1037 #endif
8741038
8751039 /* CodeObjectCache.proto */
8761040 typedef struct {
9091073 /* CIntFromPy.proto */
9101074 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
9111075
1076 /* FastTypeChecks.proto */
1077 #if CYTHON_COMPILING_IN_CPYTHON
1078 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1079 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1080 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1081 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1082 #else
1083 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1084 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1085 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1086 #endif
1087 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1088
9121089 /* CheckBinaryVersion.proto */
9131090 static int __Pyx_check_binary_version(void);
9141091
9711148 static int __pyx_f_11pygame_sdl2_8rwobject_subfile_close(SDL_RWops *); /*proto*/
9721149 static SDL_RWops *__pyx_f_11pygame_sdl2_8rwobject_RWopsFromPython(PyObject *); /*proto*/
9731150 #define __Pyx_MODULE_NAME "pygame_sdl2.rwobject"
1151 extern int __pyx_module_is_main_pygame_sdl2__rwobject;
9741152 int __pyx_module_is_main_pygame_sdl2__rwobject = 0;
9751153
9761154 /* Implementation of 'pygame_sdl2.rwobject' */
10021180 static const char __pyx_k_AttributeError[] = "AttributeError";
10031181 static const char __pyx_k_Could_not_open_r[] = "Could not open {!r}: {}";
10041182 static const char __pyx_k_Could_not_open_r_2[] = "Could not open {!r}.";
1183 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
10051184 static const char __pyx_k_pygame_sdl2_compat[] = "pygame_sdl2.compat";
10061185 static const char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding";
10071186 static const char __pyx_k_r_is_not_a_filename_or_file_lik[] = "{!r} is not a filename or file-like object.";
10121191 static PyObject *__pyx_n_u_ascii;
10131192 static PyObject *__pyx_n_s_base;
10141193 static PyObject *__pyx_n_s_bytes;
1194 static PyObject *__pyx_n_s_cline_in_traceback;
10151195 static PyObject *__pyx_n_s_close;
10161196 static PyObject *__pyx_n_s_decode;
10171197 static PyObject *__pyx_n_s_encode;
10431223 static PyObject *__pyx_tuple__2;
10441224 static PyObject *__pyx_tuple__3;
10451225 static PyObject *__pyx_tuple__4;
1226 /* Late includes */
10461227
10471228 /* "pygame_sdl2/rwobject.pyx":56
10481229 *
10571238 PyObject *__pyx_r = NULL;
10581239 __Pyx_RefNannyDeclarations
10591240 PyObject *__pyx_t_1 = NULL;
1060 PyObject *__pyx_t_2 = NULL;
1061 char *__pyx_t_3;
1241 char *__pyx_t_2;
10621242 __Pyx_RefNannySetupContext("set_error", 0);
10631243 __Pyx_INCREF(__pyx_v_e);
10641244
10691249 * msg = <char *> e
10701250 * SDL_SetError("%s", msg)
10711251 */
1072 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
1252 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_e); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
10731253 __Pyx_GOTREF(__pyx_t_1);
1074 __Pyx_INCREF(__pyx_v_e);
1075 __Pyx_GIVEREF(__pyx_v_e);
1076 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_e);
1077 __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyUnicode_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
1078 __Pyx_GOTREF(__pyx_t_2);
1079 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1080 __Pyx_DECREF_SET(__pyx_v_e, __pyx_t_2);
1081 __pyx_t_2 = 0;
1254 __Pyx_DECREF_SET(__pyx_v_e, __pyx_t_1);
1255 __pyx_t_1 = 0;
10821256
10831257 /* "pygame_sdl2/rwobject.pyx":59
10841258 * cdef char *msg
10871261 * SDL_SetError("%s", msg)
10881262 *
10891263 */
1090 __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_e); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error)
1091 __pyx_v_msg = ((char *)__pyx_t_3);
1264 __pyx_t_2 = __Pyx_PyObject_AsWritableString(__pyx_v_e); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error)
1265 __pyx_v_msg = ((char *)__pyx_t_2);
10921266
10931267 /* "pygame_sdl2/rwobject.pyx":60
10941268 * e = str(e)
10971271 *
10981272 * cdef Sint64 python_size(SDL_RWops *context) with gil:
10991273 */
1100 SDL_SetError(((char const *)"%s"), __pyx_v_msg);
1274 (void)(SDL_SetError(((char const *)"%s"), __pyx_v_msg));
11011275
11021276 /* "pygame_sdl2/rwobject.pyx":56
11031277 *
11121286 goto __pyx_L0;
11131287 __pyx_L1_error:;
11141288 __Pyx_XDECREF(__pyx_t_1);
1115 __Pyx_XDECREF(__pyx_t_2);
11161289 __Pyx_AddTraceback("pygame_sdl2.rwobject.set_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
11171290 __pyx_r = 0;
11181291 __pyx_L0:;
11461319 PyObject *__pyx_t_8 = NULL;
11471320 Sint64 __pyx_t_9;
11481321 #ifdef WITH_THREAD
1149 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
1322 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
11501323 #endif
11511324 __Pyx_RefNannySetupContext("python_size", 0);
11521325
13191492 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13201493 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13211494 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
1322 goto __pyx_L10_try_end;
1495 goto __pyx_L8_try_end;
13231496 __pyx_L3_error:;
1324 __Pyx_PyThreadState_assign
13251497 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13261498 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
13271499 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
13631535 * cur = f.tell()
13641536 * f.seek(0, 2)
13651537 */
1366 __Pyx_PyThreadState_assign
13671538 __Pyx_XGIVEREF(__pyx_t_2);
13681539 __Pyx_XGIVEREF(__pyx_t_3);
13691540 __Pyx_XGIVEREF(__pyx_t_4);
13701541 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13711542 goto __pyx_L1_error;
13721543 __pyx_L6_except_return:;
1373 __Pyx_PyThreadState_assign
13741544 __Pyx_XGIVEREF(__pyx_t_2);
13751545 __Pyx_XGIVEREF(__pyx_t_3);
13761546 __Pyx_XGIVEREF(__pyx_t_4);
13771547 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
13781548 goto __pyx_L0;
1379 __pyx_L10_try_end:;
1549 __pyx_L8_try_end:;
13801550 }
13811551
13821552 /* "pygame_sdl2/rwobject.pyx":73
14041574 __Pyx_XDECREF(__pyx_t_5);
14051575 __Pyx_XDECREF(__pyx_t_6);
14061576 __Pyx_XDECREF(__pyx_t_8);
1407 __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
1577 __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
14081578 __pyx_r = 0;
14091579 __pyx_L0:;
14101580 __Pyx_XDECREF(__pyx_v_f);
14121582 __Pyx_XDECREF(__pyx_v_rv);
14131583 __Pyx_RefNannyFinishContext();
14141584 #ifdef WITH_THREAD
1415 PyGILState_Release(__pyx_gilstate_save);
1585 __Pyx_PyGILState_Release(__pyx_gilstate_save);
14161586 #endif
14171587 return __pyx_r;
14181588 }
14511621 PyObject *__pyx_t_18 = NULL;
14521622 Sint64 __pyx_t_19;
14531623 #ifdef WITH_THREAD
1454 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
1624 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14551625 #endif
14561626 __Pyx_RefNannySetupContext("python_seek", 0);
14571627
15881758 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
15891759 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
15901760 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
1591 goto __pyx_L10_try_end;
1761 goto __pyx_L8_try_end;
15921762 __pyx_L3_error:;
1593 __Pyx_PyThreadState_assign
15941763 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
15951764 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
15961765 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16231792 * return -1
16241793 *
16251794 */
1626 __pyx_t_7 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 82, __pyx_L16_error)
1795 __pyx_t_7 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 82, __pyx_L14_error)
16271796 __Pyx_GOTREF(__pyx_t_7);
16281797 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16291798
16381807 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16391808 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16401809 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
1641 goto __pyx_L15_return;
1810 goto __pyx_L13_return;
16421811 }
16431812
16441813 /* "pygame_sdl2/rwobject.pyx":81
16491818 * return -1
16501819 */
16511820 /*finally:*/ {
1821 __pyx_L14_error:;
16521822 /*exception exit:*/{
16531823 __Pyx_PyThreadState_declare
1654 __pyx_L16_error:;
1824 __Pyx_PyThreadState_assign
16551825 __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
1656 __Pyx_PyThreadState_assign
16571826 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
16581827 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16591828 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16701839 __Pyx_DECREF(__pyx_v_e);
16711840 __pyx_v_e = NULL;
16721841 }
1673 __Pyx_PyThreadState_assign
16741842 if (PY_MAJOR_VERSION >= 3) {
16751843 __Pyx_XGIVEREF(__pyx_t_16);
16761844 __Pyx_XGIVEREF(__pyx_t_17);
16851853 __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
16861854 goto __pyx_L5_except_error;
16871855 }
1688 __pyx_L15_return: {
1856 __pyx_L13_return: {
16891857 __pyx_t_19 = __pyx_r;
16901858 __Pyx_DECREF(__pyx_v_e);
16911859 __pyx_v_e = NULL;
17041872 * f.seek(seek, whence)
17051873 * rv = f.tell()
17061874 */
1707 __Pyx_PyThreadState_assign
17081875 __Pyx_XGIVEREF(__pyx_t_2);
17091876 __Pyx_XGIVEREF(__pyx_t_3);
17101877 __Pyx_XGIVEREF(__pyx_t_4);
17111878 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
17121879 goto __pyx_L1_error;
17131880 __pyx_L6_except_return:;
1714 __Pyx_PyThreadState_assign
17151881 __Pyx_XGIVEREF(__pyx_t_2);
17161882 __Pyx_XGIVEREF(__pyx_t_3);
17171883 __Pyx_XGIVEREF(__pyx_t_4);
17181884 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
17191885 goto __pyx_L0;
1720 __pyx_L10_try_end:;
1886 __pyx_L8_try_end:;
17211887 }
17221888
17231889 /* "pygame_sdl2/rwobject.pyx":85
17471913 __Pyx_XDECREF(__pyx_t_7);
17481914 __Pyx_XDECREF(__pyx_t_8);
17491915 __Pyx_XDECREF(__pyx_t_10);
1750 __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_seek", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
1916 __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_seek", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17511917 __pyx_r = 0;
17521918 __pyx_L0:;
17531919 __Pyx_XDECREF(__pyx_v_f);
17551921 __Pyx_XDECREF(__pyx_v_e);
17561922 __Pyx_RefNannyFinishContext();
17571923 #ifdef WITH_THREAD
1758 PyGILState_Release(__pyx_gilstate_save);
1924 __Pyx_PyGILState_Release(__pyx_gilstate_save);
17591925 #endif
17601926 return __pyx_r;
17611927 }
17951961 char *__pyx_t_19;
17961962 Py_ssize_t __pyx_t_20;
17971963 #ifdef WITH_THREAD
1798 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
1964 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17991965 #endif
18001966 __Pyx_RefNannySetupContext("python_read", 0);
18011967
18982064 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
18992065 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
19002066 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
1901 goto __pyx_L10_try_end;
2067 goto __pyx_L8_try_end;
19022068 __pyx_L3_error:;
1903 __Pyx_PyThreadState_assign
19042069 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
19052070 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
19062071 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
19322097 * return -1
19332098 *
19342099 */
1935 __pyx_t_6 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 93, __pyx_L16_error)
2100 __pyx_t_6 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 93, __pyx_L14_error)
19362101 __Pyx_GOTREF(__pyx_t_6);
19372102 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19382103
19472112 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19482113 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19492114 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
1950 goto __pyx_L15_return;
2115 goto __pyx_L13_return;
19512116 }
19522117
19532118 /* "pygame_sdl2/rwobject.pyx":92
19582123 * return -1
19592124 */
19602125 /*finally:*/ {
2126 __pyx_L14_error:;
19612127 /*exception exit:*/{
19622128 __Pyx_PyThreadState_declare
1963 __pyx_L16_error:;
2129 __Pyx_PyThreadState_assign
19642130 __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
1965 __Pyx_PyThreadState_assign
19662131 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
19672132 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
19682133 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
19782143 __Pyx_DECREF(__pyx_v_e);
19792144 __pyx_v_e = NULL;
19802145 }
1981 __Pyx_PyThreadState_assign
19822146 if (PY_MAJOR_VERSION >= 3) {
19832147 __Pyx_XGIVEREF(__pyx_t_15);
19842148 __Pyx_XGIVEREF(__pyx_t_16);
19932157 __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
19942158 goto __pyx_L5_except_error;
19952159 }
1996 __pyx_L15_return: {
2160 __pyx_L13_return: {
19972161 __pyx_t_18 = __pyx_r;
19982162 __Pyx_DECREF(__pyx_v_e);
19992163 __pyx_v_e = NULL;
20122176 * data = f.read(size * maxnum)
20132177 * except Exception as e:
20142178 */
2015 __Pyx_PyThreadState_assign
20162179 __Pyx_XGIVEREF(__pyx_t_2);
20172180 __Pyx_XGIVEREF(__pyx_t_3);
20182181 __Pyx_XGIVEREF(__pyx_t_4);
20192182 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
20202183 goto __pyx_L1_error;
20212184 __pyx_L6_except_return:;
2022 __Pyx_PyThreadState_assign
20232185 __Pyx_XGIVEREF(__pyx_t_2);
20242186 __Pyx_XGIVEREF(__pyx_t_3);
20252187 __Pyx_XGIVEREF(__pyx_t_4);
20262188 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
20272189 goto __pyx_L0;
2028 __pyx_L10_try_end:;
2190 __pyx_L8_try_end:;
20292191 }
20302192
20312193 /* "pygame_sdl2/rwobject.pyx":96
20352197 * return len(data)
20362198 *
20372199 */
2038 __pyx_t_19 = __Pyx_PyObject_AsString(__pyx_v_data); if (unlikely((!__pyx_t_19) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
2039 __pyx_t_20 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 96, __pyx_L1_error)
2040 memcpy(__pyx_v_ptr, ((void *)((char *)__pyx_t_19)), __pyx_t_20);
2200 __pyx_t_19 = __Pyx_PyObject_AsWritableString(__pyx_v_data); if (unlikely((!__pyx_t_19) && PyErr_Occurred())) __PYX_ERR(0, 96, __pyx_L1_error)
2201 __pyx_t_20 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_20 == ((Py_ssize_t)-1))) __PYX_ERR(0, 96, __pyx_L1_error)
2202 (void)(memcpy(__pyx_v_ptr, ((void *)((char *)__pyx_t_19)), __pyx_t_20));
20412203
20422204 /* "pygame_sdl2/rwobject.pyx":97
20432205 *
20462208 *
20472209 * cdef size_t python_write(SDL_RWops *context, const void *ptr, size_t size, size_t maxnum) with gil:
20482210 */
2049 __pyx_t_20 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_20 == -1)) __PYX_ERR(0, 97, __pyx_L1_error)
2211 __pyx_t_20 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_20 == ((Py_ssize_t)-1))) __PYX_ERR(0, 97, __pyx_L1_error)
20502212 __pyx_r = __pyx_t_20;
20512213 goto __pyx_L0;
20522214
20652227 __Pyx_XDECREF(__pyx_t_6);
20662228 __Pyx_XDECREF(__pyx_t_7);
20672229 __Pyx_XDECREF(__pyx_t_8);
2068 __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_read", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
2230 __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_read", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20692231 __pyx_r = 0;
20702232 __pyx_L0:;
20712233 __Pyx_XDECREF(__pyx_v_f);
20732235 __Pyx_XDECREF(__pyx_v_e);
20742236 __Pyx_RefNannyFinishContext();
20752237 #ifdef WITH_THREAD
2076 PyGILState_Release(__pyx_gilstate_save);
2238 __Pyx_PyGILState_Release(__pyx_gilstate_save);
20772239 #endif
20782240 return __pyx_r;
20792241 }
21112273 size_t __pyx_t_17;
21122274 Py_ssize_t __pyx_t_18;
21132275 #ifdef WITH_THREAD
2114 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
2276 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21152277 #endif
21162278 __Pyx_RefNannySetupContext("python_write", 0);
21172279
22202382 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22212383 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22222384 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2223 goto __pyx_L10_try_end;
2385 goto __pyx_L8_try_end;
22242386 __pyx_L3_error:;
2225 __Pyx_PyThreadState_assign
22262387 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
22272388 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
22282389 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22532414 * return -1
22542415 *
22552416 */
2256 __pyx_t_6 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 106, __pyx_L16_error)
2417 __pyx_t_6 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 106, __pyx_L14_error)
22572418 __Pyx_GOTREF(__pyx_t_6);
22582419 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22592420
22682429 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22692430 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22702431 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2271 goto __pyx_L15_return;
2432 goto __pyx_L13_return;
22722433 }
22732434
22742435 /* "pygame_sdl2/rwobject.pyx":105
22792440 * return -1
22802441 */
22812442 /*finally:*/ {
2443 __pyx_L14_error:;
22822444 /*exception exit:*/{
22832445 __Pyx_PyThreadState_declare
2284 __pyx_L16_error:;
2446 __Pyx_PyThreadState_assign
22852447 __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
2286 __Pyx_PyThreadState_assign
22872448 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
22882449 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
22892450 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
22982459 __Pyx_DECREF(__pyx_v_e);
22992460 __pyx_v_e = NULL;
23002461 }
2301 __Pyx_PyThreadState_assign
23022462 if (PY_MAJOR_VERSION >= 3) {
23032463 __Pyx_XGIVEREF(__pyx_t_14);
23042464 __Pyx_XGIVEREF(__pyx_t_15);
23132473 __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10;
23142474 goto __pyx_L5_except_error;
23152475 }
2316 __pyx_L15_return: {
2476 __pyx_L13_return: {
23172477 __pyx_t_17 = __pyx_r;
23182478 __Pyx_DECREF(__pyx_v_e);
23192479 __pyx_v_e = NULL;
23322492 * f.write(data)
23332493 * except Exception as e:
23342494 */
2335 __Pyx_PyThreadState_assign
23362495 __Pyx_XGIVEREF(__pyx_t_2);
23372496 __Pyx_XGIVEREF(__pyx_t_3);
23382497 __Pyx_XGIVEREF(__pyx_t_4);
23392498 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
23402499 goto __pyx_L1_error;
23412500 __pyx_L6_except_return:;
2342 __Pyx_PyThreadState_assign
23432501 __Pyx_XGIVEREF(__pyx_t_2);
23442502 __Pyx_XGIVEREF(__pyx_t_3);
23452503 __Pyx_XGIVEREF(__pyx_t_4);
23462504 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
23472505 goto __pyx_L0;
2348 __pyx_L10_try_end:;
2506 __pyx_L8_try_end:;
23492507 }
23502508
23512509 /* "pygame_sdl2/rwobject.pyx":109
23552513 *
23562514 * cdef int python_close(SDL_RWops *context) with gil:
23572515 */
2358 __pyx_t_18 = PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_18 == -1)) __PYX_ERR(0, 109, __pyx_L1_error)
2516 __pyx_t_18 = PyBytes_GET_SIZE(__pyx_v_data); if (unlikely(__pyx_t_18 == ((Py_ssize_t)-1))) __PYX_ERR(0, 109, __pyx_L1_error)
23592517 __pyx_r = __pyx_t_18;
23602518 goto __pyx_L0;
23612519
23732531 __Pyx_XDECREF(__pyx_t_5);
23742532 __Pyx_XDECREF(__pyx_t_6);
23752533 __Pyx_XDECREF(__pyx_t_7);
2376 __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_write", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
2534 __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_write", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
23772535 __pyx_r = 0;
23782536 __pyx_L0:;
23792537 __Pyx_XDECREF(__pyx_v_f);
23812539 __Pyx_XDECREF(__pyx_v_e);
23822540 __Pyx_RefNannyFinishContext();
23832541 #ifdef WITH_THREAD
2384 PyGILState_Release(__pyx_gilstate_save);
2542 __Pyx_PyGILState_Release(__pyx_gilstate_save);
23852543 #endif
23862544 return __pyx_r;
23872545 }
24162574 PyObject *__pyx_t_15 = NULL;
24172575 PyObject *__pyx_t_16 = NULL;
24182576 #ifdef WITH_THREAD
2419 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
2577 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
24202578 #endif
24212579 __Pyx_RefNannySetupContext("python_close", 0);
24222580
24882646 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
24892647 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
24902648 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2491 goto __pyx_L10_try_end;
2649 goto __pyx_L8_try_end;
24922650 __pyx_L3_error:;
2493 __Pyx_PyThreadState_assign
24942651 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
24952652 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
24962653 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
25202677 * return -1
25212678 *
25222679 */
2523 __pyx_t_8 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 117, __pyx_L16_error)
2680 __pyx_t_8 = __pyx_f_11pygame_sdl2_8rwobject_set_error(__pyx_v_e); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 117, __pyx_L14_error)
25242681 __Pyx_GOTREF(__pyx_t_8);
25252682 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
25262683
25352692 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25362693 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25372694 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2538 goto __pyx_L15_return;
2695 goto __pyx_L13_return;
25392696 }
25402697
25412698 /* "pygame_sdl2/rwobject.pyx":116
25462703 * return -1
25472704 */
25482705 /*finally:*/ {
2706 __pyx_L14_error:;
25492707 /*exception exit:*/{
25502708 __Pyx_PyThreadState_declare
2551 __pyx_L16_error:;
2709 __Pyx_PyThreadState_assign
25522710 __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
2553 __Pyx_PyThreadState_assign
25542711 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
25552712 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
25562713 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
25652722 __Pyx_DECREF(__pyx_v_e);
25662723 __pyx_v_e = NULL;
25672724 }
2568 __Pyx_PyThreadState_assign
25692725 if (PY_MAJOR_VERSION >= 3) {
25702726 __Pyx_XGIVEREF(__pyx_t_14);
25712727 __Pyx_XGIVEREF(__pyx_t_15);
25802736 __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10;
25812737 goto __pyx_L5_except_error;
25822738 }
2583 __pyx_L15_return: {
2739 __pyx_L13_return: {
25842740 __pyx_t_9 = __pyx_r;
25852741 __Pyx_DECREF(__pyx_v_e);
25862742 __pyx_v_e = NULL;
25992755 * f.close()
26002756 * except Exception as e:
26012757 */
2602 __Pyx_PyThreadState_assign
26032758 __Pyx_XGIVEREF(__pyx_t_2);
26042759 __Pyx_XGIVEREF(__pyx_t_3);
26052760 __Pyx_XGIVEREF(__pyx_t_4);
26062761 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
26072762 goto __pyx_L1_error;
26082763 __pyx_L6_except_return:;
2609 __Pyx_PyThreadState_assign
26102764 __Pyx_XGIVEREF(__pyx_t_2);
26112765 __Pyx_XGIVEREF(__pyx_t_3);
26122766 __Pyx_XGIVEREF(__pyx_t_4);
26132767 __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
26142768 goto __pyx_L0;
2615 __pyx_L10_try_end:;
2769 __pyx_L8_try_end:;
26162770 }
26172771
26182772 /* "pygame_sdl2/rwobject.pyx":120
26572811 __Pyx_XDECREF(__pyx_t_5);
26582812 __Pyx_XDECREF(__pyx_t_6);
26592813 __Pyx_XDECREF(__pyx_t_8);
2660 __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_close", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
2814 __Pyx_WriteUnraisable("pygame_sdl2.rwobject.python_close", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
26612815 __pyx_r = 0;
26622816 __pyx_L0:;
26632817 __Pyx_XDECREF(__pyx_v_f);
26642818 __Pyx_XDECREF(__pyx_v_e);
26652819 __Pyx_RefNannyFinishContext();
26662820 #ifdef WITH_THREAD
2667 PyGILState_Release(__pyx_gilstate_save);
2821 __Pyx_PyGILState_Release(__pyx_gilstate_save);
26682822 #endif
26692823 return __pyx_r;
26702824 }
28933047 */
28943048 if (unlikely(__pyx_v_size == 0)) {
28953049 #ifdef WITH_THREAD
2896 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
3050 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
28973051 #endif
28983052 PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
28993053 #ifdef WITH_THREAD
2900 PyGILState_Release(__pyx_gilstate_save);
3054 __Pyx_PyGILState_Release(__pyx_gilstate_save);
29013055 #endif
29023056 __PYX_ERR(0, 153, __pyx_L1_error)
29033057 }
29983152
29993153 /* function exit code */
30003154 __pyx_L1_error:;
3001 __Pyx_WriteUnraisable("pygame_sdl2.rwobject.subfile_read", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
3155 __Pyx_WriteUnraisable("pygame_sdl2.rwobject.subfile_read", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
30023156 __pyx_r = 0;
30033157 __pyx_L0:;
30043158 return __pyx_r;
30323186 * free(sf)
30333187 * SDL_FreeRW(context)
30343188 */
3035 SDL_RWclose(__pyx_v_sf->rw);
3189 (void)(SDL_RWclose(__pyx_v_sf->rw));
30363190
30373191 /* "pygame_sdl2/rwobject.pyx":169
30383192 *
31183272 */
31193273 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error)
31203274 __Pyx_GOTREF(__pyx_t_1);
3121 __pyx_t_2 = PyObject_IsInstance(__pyx_v_mode, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 182, __pyx_L1_error)
3275 __pyx_t_2 = PyObject_IsInstance(__pyx_v_mode, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 182, __pyx_L1_error)
31223276 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
31233277 __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
31243278 if (__pyx_t_3) {
31563310 */
31573311 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_file_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 185, __pyx_L1_error)
31583312 __Pyx_GOTREF(__pyx_t_4);
3159 __pyx_t_2 = PyObject_IsInstance(__pyx_v_filelike, __pyx_t_4); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 185, __pyx_L1_error)
3313 __pyx_t_2 = PyObject_IsInstance(__pyx_v_filelike, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 185, __pyx_L1_error)
31603314 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31613315 __pyx_t_5 = (__pyx_t_2 != 0);
31623316 if (__pyx_t_5) {
31993353 */
32003354 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_bytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error)
32013355 __Pyx_GOTREF(__pyx_t_4);
3202 __pyx_t_3 = PyObject_IsInstance(__pyx_v_filelike, __pyx_t_4); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 189, __pyx_L1_error)
3356 __pyx_t_3 = PyObject_IsInstance(__pyx_v_filelike, __pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 189, __pyx_L1_error)
32033357 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32043358 __pyx_t_5 = (__pyx_t_3 != 0);
32053359 if (__pyx_t_5) {
32833437 */
32843438 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
32853439 __Pyx_GOTREF(__pyx_t_4);
3286 __pyx_t_5 = PyObject_IsInstance(__pyx_v_filelike, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 191, __pyx_L1_error)
3440 __pyx_t_5 = PyObject_IsInstance(__pyx_v_filelike, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 191, __pyx_L1_error)
32873441 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32883442 __pyx_t_3 = (__pyx_t_5 != 0);
32893443 if (__pyx_t_3) {
33533507 * cmode = mode
33543508 *
33553509 */
3356 __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_dname); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 199, __pyx_L1_error)
3510 __pyx_t_9 = __Pyx_PyObject_AsWritableString(__pyx_v_dname); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 199, __pyx_L1_error)
33573511 __pyx_v_cname = __pyx_t_9;
33583512
33593513 /* "pygame_sdl2/rwobject.pyx":200
33633517 *
33643518 * with nogil:
33653519 */
3366 __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_mode); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L1_error)
3520 __pyx_t_9 = __Pyx_PyObject_AsWritableString(__pyx_v_mode); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L1_error)
33673521 __pyx_v_cmode = __pyx_t_9;
33683522
33693523 /* "pygame_sdl2/rwobject.pyx":202
33773531 #ifdef WITH_THREAD
33783532 PyThreadState *_save;
33793533 Py_UNBLOCK_THREADS
3534 __Pyx_FastGIL_Remember();
33803535 #endif
33813536 /*try:*/ {
33823537
34003555 /*finally:*/ {
34013556 /*normal exit:*/{
34023557 #ifdef WITH_THREAD
3558 __Pyx_FastGIL_Forget();
34033559 Py_BLOCK_THREADS
34043560 #endif
34053561 goto __pyx_L11;
34163572 *
34173573 */
34183574 __pyx_t_3 = ((__pyx_v_rv == NULL) != 0);
3419 if (__pyx_t_3) {
3575 if (unlikely(__pyx_t_3)) {
34203576
34213577 /* "pygame_sdl2/rwobject.pyx":206
34223578 *
34763632 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
34773633 }
34783634 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3479 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error)
3635 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error)
34803636 __Pyx_GOTREF(__pyx_t_4);
3481 __Pyx_GIVEREF(__pyx_t_1);
3482 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
3483 __pyx_t_1 = 0;
3484 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
3485 __Pyx_GOTREF(__pyx_t_1);
3637 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3638 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
34863639 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3487 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3488 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34893640 __PYX_ERR(0, 206, __pyx_L1_error)
34903641
34913642 /* "pygame_sdl2/rwobject.pyx":205
35493700 * base = filelike.base
35503701 * length = filelike.length
35513702 */
3552 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L14_error)
3553 __Pyx_GOTREF(__pyx_t_1);
3554 __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
3555 __pyx_t_1 = 0;
3703 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L14_error)
3704 __Pyx_GOTREF(__pyx_t_4);
3705 __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_4);
3706 __pyx_t_4 = 0;
35563707
35573708 /* "pygame_sdl2/rwobject.pyx":216
35583709 * # subfile, so use an optimized path.
35613712 * length = filelike.length
35623713 *
35633714 */
3564 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L14_error)
3565 __Pyx_GOTREF(__pyx_t_1);
3566 __pyx_v_base = __pyx_t_1;
3567 __pyx_t_1 = 0;
3715 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_base); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L14_error)
3716 __Pyx_GOTREF(__pyx_t_4);
3717 __pyx_v_base = __pyx_t_4;
3718 __pyx_t_4 = 0;
35683719
35693720 /* "pygame_sdl2/rwobject.pyx":217
35703721 * name = filelike.name
35733724 *
35743725 * if name is not None:
35753726 */
3576 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L14_error)
3577 __Pyx_GOTREF(__pyx_t_1);
3578 __pyx_v_length = __pyx_t_1;
3579 __pyx_t_1 = 0;
3727 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filelike, __pyx_n_s_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 217, __pyx_L14_error)
3728 __Pyx_GOTREF(__pyx_t_4);
3729 __pyx_v_length = __pyx_t_4;
3730 __pyx_t_4 = 0;
35803731
35813732 /* "pygame_sdl2/rwobject.pyx":219
35823733 * length = filelike.length
35963747 * name = name.decode(fsencoding)
35973748 *
35983749 */
3599 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L14_error)
3600 __Pyx_GOTREF(__pyx_t_1);
3601 __pyx_t_5 = PyObject_IsInstance(__pyx_v_name, __pyx_t_1); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 221, __pyx_L14_error)
3602 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3750 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L14_error)
3751 __Pyx_GOTREF(__pyx_t_4);
3752 __pyx_t_5 = PyObject_IsInstance(__pyx_v_name, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 221, __pyx_L14_error)
3753 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36033754 __pyx_t_3 = ((!(__pyx_t_5 != 0)) != 0);
36043755 if (__pyx_t_3) {
36053756
36103761 *
36113762 * dname = name.encode("utf-8")
36123763 */
3613 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L14_error)
3614 __Pyx_GOTREF(__pyx_t_4);
3764 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L14_error)
3765 __Pyx_GOTREF(__pyx_t_1);
36153766 __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_fsencoding); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 222, __pyx_L14_error)
36163767 __Pyx_GOTREF(__pyx_t_7);
36173768 __pyx_t_8 = NULL;
3618 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3619 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
3769 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
3770 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
36203771 if (likely(__pyx_t_8)) {
3621 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3772 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
36223773 __Pyx_INCREF(__pyx_t_8);
36233774 __Pyx_INCREF(function);
3624 __Pyx_DECREF_SET(__pyx_t_4, function);
3775 __Pyx_DECREF_SET(__pyx_t_1, function);
36253776 }
36263777 }
36273778 if (!__pyx_t_8) {
3628 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L14_error)
3779 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L14_error)
36293780 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3630 __Pyx_GOTREF(__pyx_t_1);
3781 __Pyx_GOTREF(__pyx_t_4);
36313782 } else {
36323783 #if CYTHON_FAST_PYCALL
3633 if (PyFunction_Check(__pyx_t_4)) {
3784 if (PyFunction_Check(__pyx_t_1)) {
36343785 PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
3635 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L14_error)
3786 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L14_error)
36363787 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3637 __Pyx_GOTREF(__pyx_t_1);
3788 __Pyx_GOTREF(__pyx_t_4);
36383789 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
36393790 } else
36403791 #endif
36413792 #if CYTHON_FAST_PYCCALL
3642 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
3793 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
36433794 PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
3644 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L14_error)
3795 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L14_error)
36453796 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3646 __Pyx_GOTREF(__pyx_t_1);
3797 __Pyx_GOTREF(__pyx_t_4);
36473798 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
36483799 } else
36493800 #endif
36543805 __Pyx_GIVEREF(__pyx_t_7);
36553806 PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_7);
36563807 __pyx_t_7 = 0;
3657 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L14_error)
3658 __Pyx_GOTREF(__pyx_t_1);
3808 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L14_error)
3809 __Pyx_GOTREF(__pyx_t_4);
36593810 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36603811 }
36613812 }
3662 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3663 __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
3664 __pyx_t_1 = 0;
3813 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3814 __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_4);
3815 __pyx_t_4 = 0;
36653816
36663817 /* "pygame_sdl2/rwobject.pyx":221
36673818 * if name is not None:
36793830 * cname = dname
36803831 *
36813832 */
3682 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L14_error)
3833 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L14_error)
3834 __Pyx_GOTREF(__pyx_t_4);
3835 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L14_error)
36833836 __Pyx_GOTREF(__pyx_t_1);
3684 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L14_error)
3685 __Pyx_GOTREF(__pyx_t_4);
3686 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3687 __pyx_v_dname = __pyx_t_4;
3688 __pyx_t_4 = 0;
3837 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3838 __pyx_v_dname = __pyx_t_1;
3839 __pyx_t_1 = 0;
36893840
36903841 /* "pygame_sdl2/rwobject.pyx":225
36913842 *
36943845 *
36953846 * with nogil:
36963847 */
3697 __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_v_dname); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L14_error)
3848 __pyx_t_9 = __Pyx_PyObject_AsWritableString(__pyx_v_dname); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L14_error)
36983849 __pyx_v_cname = __pyx_t_9;
36993850
37003851 /* "pygame_sdl2/rwobject.pyx":227
37083859 #ifdef WITH_THREAD
37093860 PyThreadState *_save;
37103861 Py_UNBLOCK_THREADS
3862 __Pyx_FastGIL_Remember();
37113863 #endif
37123864 /*try:*/ {
37133865
37313883 /*finally:*/ {
37323884 /*normal exit:*/{
37333885 #ifdef WITH_THREAD
3886 __Pyx_FastGIL_Forget();
37343887 Py_BLOCK_THREADS
37353888 #endif
3736 goto __pyx_L28;
3889 goto __pyx_L24;
37373890 }
3738 __pyx_L28:;
3891 __pyx_L24:;
37393892 }
37403893 }
37413894
37473900 *
37483901 */
37493902 __pyx_t_3 = ((!(__pyx_v_rw != 0)) != 0);
3750 if (__pyx_t_3) {
3903 if (unlikely(__pyx_t_3)) {
37513904
37523905 /* "pygame_sdl2/rwobject.pyx":231
37533906 *
37563909 *
37573910 * SDL_RWseek(rw, base, RW_SEEK_SET);
37583911 */
3759 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Could_not_open_r_2, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L14_error)
3760 __Pyx_GOTREF(__pyx_t_1);
3912 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Could_not_open_r_2, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L14_error)
3913 __Pyx_GOTREF(__pyx_t_4);
37613914 __pyx_t_6 = NULL;
3762 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
3763 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
3915 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3916 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
37643917 if (likely(__pyx_t_6)) {
3765 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
3918 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
37663919 __Pyx_INCREF(__pyx_t_6);
37673920 __Pyx_INCREF(function);
3768 __Pyx_DECREF_SET(__pyx_t_1, function);
3921 __Pyx_DECREF_SET(__pyx_t_4, function);
37693922 }
37703923 }
37713924 if (!__pyx_t_6) {
3772 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L14_error)
3773 __Pyx_GOTREF(__pyx_t_4);
3925 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L14_error)
3926 __Pyx_GOTREF(__pyx_t_1);
37743927 } else {
37753928 #if CYTHON_FAST_PYCALL
3776 if (PyFunction_Check(__pyx_t_1)) {
3929 if (PyFunction_Check(__pyx_t_4)) {
37773930 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_name};
3778 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L14_error)
3931 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L14_error)
37793932 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3780 __Pyx_GOTREF(__pyx_t_4);
3933 __Pyx_GOTREF(__pyx_t_1);
37813934 } else
37823935 #endif
37833936 #if CYTHON_FAST_PYCCALL
3784 if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
3937 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
37853938 PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_name};
3786 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L14_error)
3939 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L14_error)
37873940 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3788 __Pyx_GOTREF(__pyx_t_4);
3941 __Pyx_GOTREF(__pyx_t_1);
37893942 } else
37903943 #endif
37913944 {
37953948 __Pyx_INCREF(__pyx_v_name);
37963949 __Pyx_GIVEREF(__pyx_v_name);
37973950 PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_name);
3798 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L14_error)
3799 __Pyx_GOTREF(__pyx_t_4);
3951 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L14_error)
3952 __Pyx_GOTREF(__pyx_t_1);
38003953 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
38013954 }
38023955 }
3803 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3804 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L14_error)
3805 __Pyx_GOTREF(__pyx_t_1);
3806 __Pyx_GIVEREF(__pyx_t_4);
3807 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
3808 __pyx_t_4 = 0;
3809 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L14_error)
3956 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3957 __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L14_error)
38103958 __Pyx_GOTREF(__pyx_t_4);
38113959 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
38123960 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
38303978 * sf = <SubFile *> calloc(sizeof(SubFile), 1)
38313979 */
38323980 __pyx_t_14 = __Pyx_PyInt_As_int64_t(__pyx_v_base); if (unlikely((__pyx_t_14 == ((Sint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L14_error)
3833 SDL_RWseek(__pyx_v_rw, __pyx_t_14, RW_SEEK_SET);
3981 (void)(SDL_RWseek(__pyx_v_rw, __pyx_t_14, RW_SEEK_SET));
38343982
38353983 /* "pygame_sdl2/rwobject.pyx":235
38363984 * SDL_RWseek(rw, base, RW_SEEK_SET);
39814129 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
39824130 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
39834131 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
3984 goto __pyx_L21_try_end;
4132 goto __pyx_L19_try_end;
39854133 __pyx_L14_error:;
3986 __Pyx_PyThreadState_assign
39874134 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
39884135 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
39894136 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
40124159 *
40134160 * # If we have these properties, we're either an APK asset or a Ren'Py-style
40144161 */
4015 __Pyx_PyThreadState_assign
40164162 __Pyx_XGIVEREF(__pyx_t_11);
40174163 __Pyx_XGIVEREF(__pyx_t_12);
40184164 __Pyx_XGIVEREF(__pyx_t_13);
40194165 __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
40204166 goto __pyx_L1_error;
40214167 __pyx_L18_try_return:;
4022 __Pyx_PyThreadState_assign
40234168 __Pyx_XGIVEREF(__pyx_t_11);
40244169 __Pyx_XGIVEREF(__pyx_t_12);
40254170 __Pyx_XGIVEREF(__pyx_t_13);
40264171 __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
40274172 goto __pyx_L0;
40284173 __pyx_L15_exception_handled:;
4029 __Pyx_PyThreadState_assign
40304174 __Pyx_XGIVEREF(__pyx_t_11);
40314175 __Pyx_XGIVEREF(__pyx_t_12);
40324176 __Pyx_XGIVEREF(__pyx_t_13);
40334177 __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
4034 __pyx_L21_try_end:;
4178 __pyx_L19_try_end:;
40354179 }
40364180
40374181 /* "pygame_sdl2/rwobject.pyx":210
40504194 * raise IOError("{!r} is not a filename or file-like object.".format(filelike))
40514195 *
40524196 */
4053 __pyx_t_5 = PyObject_HasAttr(__pyx_v_filelike, __pyx_n_u_read); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 256, __pyx_L1_error)
4197 __pyx_t_5 = __Pyx_HasAttr(__pyx_v_filelike, __pyx_n_u_read); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 256, __pyx_L1_error)
40544198 __pyx_t_2 = (__pyx_t_5 != 0);
40554199 if (!__pyx_t_2) {
40564200 } else {
40574201 __pyx_t_3 = __pyx_t_2;
4058 goto __pyx_L31_bool_binop_done;
4202 goto __pyx_L27_bool_binop_done;
40594203 }
4060 __pyx_t_2 = PyObject_HasAttr(__pyx_v_filelike, __pyx_n_u_write); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 256, __pyx_L1_error)
4204 __pyx_t_2 = __Pyx_HasAttr(__pyx_v_filelike, __pyx_n_u_write); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 256, __pyx_L1_error)
40614205 __pyx_t_5 = (__pyx_t_2 != 0);
40624206 __pyx_t_3 = __pyx_t_5;
4063 __pyx_L31_bool_binop_done:;
4207 __pyx_L27_bool_binop_done:;
40644208 __pyx_t_5 = ((!__pyx_t_3) != 0);
4065 if (__pyx_t_5) {
4209 if (unlikely(__pyx_t_5)) {
40664210
40674211 /* "pygame_sdl2/rwobject.pyx":257
40684212 *
41164260 }
41174261 }
41184262 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4119 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
4263 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IOError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
41204264 __Pyx_GOTREF(__pyx_t_1);
4121 __Pyx_GIVEREF(__pyx_t_4);
4122 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
4123 __pyx_t_4 = 0;
4124 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 257, __pyx_L1_error)
4125 __Pyx_GOTREF(__pyx_t_4);
4265 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4266 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
41264267 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4127 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
4128 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
41294268 __PYX_ERR(0, 257, __pyx_L1_error)
41304269
41314270 /* "pygame_sdl2/rwobject.pyx":256
42774416 *
42784417 * PyEval_InitThreads()
42794418 */
4280 __pyx_t_1 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_filelike, NULL); if (unlikely(__pyx_t_1 == NULL)) __PYX_ERR(0, 274, __pyx_L1_error)
4419 __pyx_t_1 = __pyx_f_11pygame_sdl2_8rwobject_to_rwops(__pyx_v_filelike, NULL); if (unlikely(__pyx_t_1 == ((SDL_RWops *)NULL))) __PYX_ERR(0, 274, __pyx_L1_error)
42814420 __pyx_r = __pyx_t_1;
42824421 goto __pyx_L0;
42834422
43034442 };
43044443
43054444 #if PY_MAJOR_VERSION >= 3
4445 #if CYTHON_PEP489_MULTI_PHASE_INIT
4446 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
4447 static int __pyx_pymod_exec_rwobject(PyObject* module); /*proto*/
4448 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
4449 {Py_mod_create, (void*)__pyx_pymod_create},
4450 {Py_mod_exec, (void*)__pyx_pymod_exec_rwobject},
4451 {0, NULL}
4452 };
4453 #endif
4454
43064455 static struct PyModuleDef __pyx_moduledef = {
4307 #if PY_VERSION_HEX < 0x03020000
4308 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
4309 #else
43104456 PyModuleDef_HEAD_INIT,
4311 #endif
43124457 "rwobject",
43134458 0, /* m_doc */
4459 #if CYTHON_PEP489_MULTI_PHASE_INIT
4460 0, /* m_size */
4461 #else
43144462 -1, /* m_size */
4463 #endif
43154464 __pyx_methods /* m_methods */,
4465 #if CYTHON_PEP489_MULTI_PHASE_INIT
4466 __pyx_moduledef_slots, /* m_slots */
4467 #else
43164468 NULL, /* m_reload */
4469 #endif
43174470 NULL, /* m_traverse */
43184471 NULL, /* m_clear */
43194472 NULL /* m_free */
43284481 {&__pyx_n_u_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 1, 0, 1},
43294482 {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
43304483 {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1},
4484 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
43314485 {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
43324486 {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
43334487 {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
44264580 return -1;
44274581 }
44284582
4583 static int __Pyx_modinit_global_init_code(void); /*proto*/
4584 static int __Pyx_modinit_variable_export_code(void); /*proto*/
4585 static int __Pyx_modinit_function_export_code(void); /*proto*/
4586 static int __Pyx_modinit_type_init_code(void); /*proto*/
4587 static int __Pyx_modinit_type_import_code(void); /*proto*/
4588 static int __Pyx_modinit_variable_import_code(void); /*proto*/
4589 static int __Pyx_modinit_function_import_code(void); /*proto*/
4590
4591 static int __Pyx_modinit_global_init_code(void) {
4592 __Pyx_RefNannyDeclarations
4593 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
4594 /*--- Global init code ---*/
4595 __Pyx_RefNannyFinishContext();
4596 return 0;
4597 }
4598
4599 static int __Pyx_modinit_variable_export_code(void) {
4600 __Pyx_RefNannyDeclarations
4601 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
4602 /*--- Variable export code ---*/
4603 __Pyx_RefNannyFinishContext();
4604 return 0;
4605 }
4606
4607 static int __Pyx_modinit_function_export_code(void) {
4608 __Pyx_RefNannyDeclarations
4609 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
4610 /*--- Function export code ---*/
4611 if (__Pyx_ExportFunction("to_rwops", (void (*)(void))__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4612 if (__Pyx_ExportFunction("RWopsFromPython", (void (*)(void))__pyx_f_11pygame_sdl2_8rwobject_RWopsFromPython, "SDL_RWops *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4613 __Pyx_RefNannyFinishContext();
4614 return 0;
4615 __pyx_L1_error:;
4616 __Pyx_RefNannyFinishContext();
4617 return -1;
4618 }
4619
4620 static int __Pyx_modinit_type_init_code(void) {
4621 __Pyx_RefNannyDeclarations
4622 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
4623 /*--- Type init code ---*/
4624 __Pyx_RefNannyFinishContext();
4625 return 0;
4626 }
4627
4628 static int __Pyx_modinit_type_import_code(void) {
4629 __Pyx_RefNannyDeclarations
4630 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
4631 /*--- Type import code ---*/
4632 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
4633 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
4634 sizeof(PyTypeObject),
4635 #else
4636 sizeof(PyHeapTypeObject),
4637 #endif
4638 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(1, 9, __pyx_L1_error)
4639 __Pyx_RefNannyFinishContext();
4640 return 0;
4641 __pyx_L1_error:;
4642 __Pyx_RefNannyFinishContext();
4643 return -1;
4644 }
4645
4646 static int __Pyx_modinit_variable_import_code(void) {
4647 __Pyx_RefNannyDeclarations
4648 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
4649 /*--- Variable import code ---*/
4650 __Pyx_RefNannyFinishContext();
4651 return 0;
4652 }
4653
4654 static int __Pyx_modinit_function_import_code(void) {
4655 __Pyx_RefNannyDeclarations
4656 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
4657 /*--- Function import code ---*/
4658 __Pyx_RefNannyFinishContext();
4659 return 0;
4660 }
4661
4662
44294663 #if PY_MAJOR_VERSION < 3
4430 PyMODINIT_FUNC initrwobject(void); /*proto*/
4431 PyMODINIT_FUNC initrwobject(void)
4432 #else
4433 PyMODINIT_FUNC PyInit_rwobject(void); /*proto*/
4434 PyMODINIT_FUNC PyInit_rwobject(void)
4664 #ifdef CYTHON_NO_PYINIT_EXPORT
4665 #define __Pyx_PyMODINIT_FUNC void
4666 #else
4667 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
4668 #endif
4669 #else
4670 #ifdef CYTHON_NO_PYINIT_EXPORT
4671 #define __Pyx_PyMODINIT_FUNC PyObject *
4672 #else
4673 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
4674 #endif
4675 #endif
4676 #ifndef CYTHON_SMALL_CODE
4677 #if defined(__clang__)
4678 #define CYTHON_SMALL_CODE
4679 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
4680 #define CYTHON_SMALL_CODE __attribute__((cold))
4681 #else
4682 #define CYTHON_SMALL_CODE
4683 #endif
4684 #endif
4685
4686
4687 #if PY_MAJOR_VERSION < 3
4688 __Pyx_PyMODINIT_FUNC initrwobject(void) CYTHON_SMALL_CODE; /*proto*/
4689 __Pyx_PyMODINIT_FUNC initrwobject(void)
4690 #else
4691 __Pyx_PyMODINIT_FUNC PyInit_rwobject(void) CYTHON_SMALL_CODE; /*proto*/
4692 __Pyx_PyMODINIT_FUNC PyInit_rwobject(void)
4693 #if CYTHON_PEP489_MULTI_PHASE_INIT
4694 {
4695 return PyModuleDef_Init(&__pyx_moduledef);
4696 }
4697 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
4698 PyObject *value = PyObject_GetAttrString(spec, from_name);
4699 int result = 0;
4700 if (likely(value)) {
4701 result = PyDict_SetItemString(moddict, to_name, value);
4702 Py_DECREF(value);
4703 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
4704 PyErr_Clear();
4705 } else {
4706 result = -1;
4707 }
4708 return result;
4709 }
4710 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
4711 PyObject *module = NULL, *moddict, *modname;
4712 if (__pyx_m)
4713 return __Pyx_NewRef(__pyx_m);
4714 modname = PyObject_GetAttrString(spec, "name");
4715 if (unlikely(!modname)) goto bad;
4716 module = PyModule_NewObject(modname);
4717 Py_DECREF(modname);
4718 if (unlikely(!module)) goto bad;
4719 moddict = PyModule_GetDict(module);
4720 if (unlikely(!moddict)) goto bad;
4721 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
4722 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
4723 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
4724 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
4725 return module;
4726 bad:
4727 Py_XDECREF(module);
4728 return NULL;
4729 }
4730
4731
4732 static int __pyx_pymod_exec_rwobject(PyObject *__pyx_pyinit_module)
4733 #endif
44354734 #endif
44364735 {
44374736 PyObject *__pyx_t_1 = NULL;
44384737 PyObject *__pyx_t_2 = NULL;
44394738 PyObject *__pyx_t_3 = NULL;
4440 PyObject *__pyx_t_4 = NULL;
4441 int __pyx_t_5;
4739 int __pyx_t_4;
44424740 __Pyx_RefNannyDeclarations
4741 #if CYTHON_PEP489_MULTI_PHASE_INIT
4742 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
4743 #elif PY_MAJOR_VERSION >= 3
4744 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
4745 #endif
44434746 #if CYTHON_REFNANNY
4444 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
4445 if (!__Pyx_RefNanny) {
4446 PyErr_Clear();
4447 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
4448 if (!__Pyx_RefNanny)
4449 Py_FatalError("failed to import 'refnanny' module");
4450 }
4451 #endif
4452 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_rwobject(void)", 0);
4747 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
4748 if (!__Pyx_RefNanny) {
4749 PyErr_Clear();
4750 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
4751 if (!__Pyx_RefNanny)
4752 Py_FatalError("failed to import 'refnanny' module");
4753 }
4754 #endif
4755 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_rwobject(void)", 0);
44534756 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
44544757 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
44554758 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
44664769 #ifdef __Pyx_Generator_USED
44674770 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
44684771 #endif
4772 #ifdef __Pyx_AsyncGen_USED
4773 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4774 #endif
44694775 #ifdef __Pyx_StopAsyncIteration_USED
44704776 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
44714777 #endif
44774783 #endif
44784784 #endif
44794785 /*--- Module creation code ---*/
4786 #if CYTHON_PEP489_MULTI_PHASE_INIT
4787 __pyx_m = __pyx_pyinit_module;
4788 Py_INCREF(__pyx_m);
4789 #else
44804790 #if PY_MAJOR_VERSION < 3
44814791 __pyx_m = Py_InitModule4("rwobject", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
44824792 #else
44834793 __pyx_m = PyModule_Create(&__pyx_moduledef);
44844794 #endif
44854795 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
4796 #endif
44864797 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
44874798 Py_INCREF(__pyx_d);
44884799 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
4800 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
44894801 #if CYTHON_COMPILING_IN_PYPY
44904802 Py_INCREF(__pyx_b);
44914803 #endif
45104822 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
45114823 /*--- Constants init code ---*/
45124824 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4513 /*--- Global init code ---*/
4514 /*--- Variable export code ---*/
4515 /*--- Function export code ---*/
4516 if (__Pyx_ExportFunction("to_rwops", (void (*)(void))__pyx_f_11pygame_sdl2_8rwobject_to_rwops, "SDL_RWops *(PyObject *, struct __pyx_opt_args_11pygame_sdl2_8rwobject_to_rwops *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4517 if (__Pyx_ExportFunction("RWopsFromPython", (void (*)(void))__pyx_f_11pygame_sdl2_8rwobject_RWopsFromPython, "SDL_RWops *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4518 /*--- Type init code ---*/
4519 /*--- Type import code ---*/
4520 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
4521 #if CYTHON_COMPILING_IN_PYPY
4522 sizeof(PyTypeObject),
4523 #else
4524 sizeof(PyHeapTypeObject),
4525 #endif
4526 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(1, 9, __pyx_L1_error)
4527 /*--- Variable import code ---*/
4528 /*--- Function import code ---*/
4825 /*--- Global type/function init code ---*/
4826 (void)__Pyx_modinit_global_init_code();
4827 (void)__Pyx_modinit_variable_export_code();
4828 if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error;
4829 (void)__Pyx_modinit_type_init_code();
4830 if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
4831 (void)__Pyx_modinit_variable_import_code();
4832 (void)__Pyx_modinit_function_import_code();
45294833 /*--- Execution code ---*/
45304834 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
45314835 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
45854889 *
45864890 * cdef extern from "SDL.h" nogil:
45874891 */
4588 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
4892 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
4893 __Pyx_GOTREF(__pyx_t_1);
4894 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 30, __pyx_L1_error)
45894895 __Pyx_GOTREF(__pyx_t_3);
4590 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error)
4591 __Pyx_GOTREF(__pyx_t_4);
4896 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4897 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
4898 __Pyx_GOTREF(__pyx_t_1);
45924899 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4593 __pyx_t_3 = NULL;
4594 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
4595 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
4596 if (likely(__pyx_t_3)) {
4597 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
4598 __Pyx_INCREF(__pyx_t_3);
4599 __Pyx_INCREF(function);
4600 __Pyx_DECREF_SET(__pyx_t_4, function);
4601 }
4602 }
4603 if (__pyx_t_3) {
4604 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
4605 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4606 } else {
4607 __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
4608 }
4609 __Pyx_GOTREF(__pyx_t_1);
4610 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4611 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 30, __pyx_L1_error)
4612 if (!__pyx_t_5) {
4900 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 30, __pyx_L1_error)
4901 if (!__pyx_t_4) {
46134902 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
46144903 } else {
46154904 __Pyx_INCREF(__pyx_t_1);
46354924 * #
46364925 * # This software is provided 'as-is', without any express or implied
46374926 */
4638 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
4927 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
46394928 __Pyx_GOTREF(__pyx_t_2);
46404929 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
46414930 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
46474936 __Pyx_XDECREF(__pyx_t_1);
46484937 __Pyx_XDECREF(__pyx_t_2);
46494938 __Pyx_XDECREF(__pyx_t_3);
4650 __Pyx_XDECREF(__pyx_t_4);
46514939 if (__pyx_m) {
46524940 if (__pyx_d) {
4653 __Pyx_AddTraceback("init pygame_sdl2.rwobject", __pyx_clineno, __pyx_lineno, __pyx_filename);
4941 __Pyx_AddTraceback("init pygame_sdl2.rwobject", 0, __pyx_lineno, __pyx_filename);
46544942 }
46554943 Py_DECREF(__pyx_m); __pyx_m = 0;
46564944 } else if (!PyErr_Occurred()) {
46584946 }
46594947 __pyx_L0:;
46604948 __Pyx_RefNannyFinishContext();
4661 #if PY_MAJOR_VERSION < 3
4949 #if CYTHON_PEP489_MULTI_PHASE_INIT
4950 return (__pyx_m != NULL) ? 0 : -1;
4951 #elif PY_MAJOR_VERSION >= 3
4952 return __pyx_m;
4953 #else
46624954 return;
4663 #else
4664 return __pyx_m;
46654955 #endif
46664956 }
46674957
46834973 }
46844974 #endif
46854975
4976 /* PyObjectGetAttrStr */
4977 #if CYTHON_USE_TYPE_SLOTS
4978 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
4979 PyTypeObject* tp = Py_TYPE(obj);
4980 if (likely(tp->tp_getattro))
4981 return tp->tp_getattro(obj, attr_name);
4982 #if PY_MAJOR_VERSION < 3
4983 if (likely(tp->tp_getattr))
4984 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
4985 #endif
4986 return PyObject_GetAttr(obj, attr_name);
4987 }
4988 #endif
4989
46864990 /* GetBuiltinName */
46874991 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
46884992 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
46965000 }
46975001 return result;
46985002 }
5003
5004 /* PyCFunctionFastCall */
5005 #if CYTHON_FAST_PYCCALL
5006 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
5007 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
5008 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
5009 PyObject *self = PyCFunction_GET_SELF(func);
5010 int flags = PyCFunction_GET_FLAGS(func);
5011 assert(PyCFunction_Check(func));
5012 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
5013 assert(nargs >= 0);
5014 assert(nargs == 0 || args != NULL);
5015 /* _PyCFunction_FastCallDict() must not be called with an exception set,
5016 because it may clear it (directly or indirectly) and so the
5017 caller loses its exception */
5018 assert(!PyErr_Occurred());
5019 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
5020 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
5021 } else {
5022 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
5023 }
5024 }
5025 #endif
5026
5027 /* PyFunctionFastCall */
5028 #if CYTHON_FAST_PYCALL
5029 #include "frameobject.h"
5030 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
5031 PyObject *globals) {
5032 PyFrameObject *f;
5033 PyThreadState *tstate = __Pyx_PyThreadState_Current;
5034 PyObject **fastlocals;
5035 Py_ssize_t i;
5036 PyObject *result;
5037 assert(globals != NULL);
5038 /* XXX Perhaps we should create a specialized
5039 PyFrame_New() that doesn't take locals, but does
5040 take builtins without sanity checking them.
5041 */
5042 assert(tstate != NULL);
5043 f = PyFrame_New(tstate, co, globals, NULL);
5044 if (f == NULL) {
5045 return NULL;
5046 }
5047 fastlocals = f->f_localsplus;
5048 for (i = 0; i < na; i++) {
5049 Py_INCREF(*args);
5050 fastlocals[i] = *args++;
5051 }
5052 result = PyEval_EvalFrameEx(f,0);
5053 ++tstate->recursion_depth;
5054 Py_DECREF(f);
5055 --tstate->recursion_depth;
5056 return result;
5057 }
5058 #if 1 || PY_VERSION_HEX < 0x030600B1
5059 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
5060 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
5061 PyObject *globals = PyFunction_GET_GLOBALS(func);
5062 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
5063 PyObject *closure;
5064 #if PY_MAJOR_VERSION >= 3
5065 PyObject *kwdefs;
5066 #endif
5067 PyObject *kwtuple, **k;
5068 PyObject **d;
5069 Py_ssize_t nd;
5070 Py_ssize_t nk;
5071 PyObject *result;
5072 assert(kwargs == NULL || PyDict_Check(kwargs));
5073 nk = kwargs ? PyDict_Size(kwargs) : 0;
5074 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
5075 return NULL;
5076 }
5077 if (
5078 #if PY_MAJOR_VERSION >= 3
5079 co->co_kwonlyargcount == 0 &&
5080 #endif
5081 likely(kwargs == NULL || nk == 0) &&
5082 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
5083 if (argdefs == NULL && co->co_argcount == nargs) {
5084 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
5085 goto done;
5086 }
5087 else if (nargs == 0 && argdefs != NULL
5088 && co->co_argcount == Py_SIZE(argdefs)) {
5089 /* function called with no arguments, but all parameters have
5090 a default value: use default values as arguments .*/
5091 args = &PyTuple_GET_ITEM(argdefs, 0);
5092 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
5093 goto done;
5094 }
5095 }
5096 if (kwargs != NULL) {
5097 Py_ssize_t pos, i;
5098 kwtuple = PyTuple_New(2 * nk);
5099 if (kwtuple == NULL) {
5100 result = NULL;
5101 goto done;
5102 }
5103 k = &PyTuple_GET_ITEM(kwtuple, 0);
5104 pos = i = 0;
5105 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
5106 Py_INCREF(k[i]);
5107 Py_INCREF(k[i+1]);
5108 i += 2;
5109 }
5110 nk = i / 2;
5111 }
5112 else {
5113 kwtuple = NULL;
5114 k = NULL;
5115 }
5116 closure = PyFunction_GET_CLOSURE(func);
5117 #if PY_MAJOR_VERSION >= 3
5118 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
5119 #endif
5120 if (argdefs != NULL) {
5121 d = &PyTuple_GET_ITEM(argdefs, 0);
5122 nd = Py_SIZE(argdefs);
5123 }
5124 else {
5125 d = NULL;
5126 nd = 0;
5127 }
5128 #if PY_MAJOR_VERSION >= 3
5129 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
5130 args, nargs,
5131 k, (int)nk,
5132 d, (int)nd, kwdefs, closure);
5133 #else
5134 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
5135 args, nargs,
5136 k, (int)nk,
5137 d, (int)nd, closure);
5138 #endif
5139 Py_XDECREF(kwtuple);
5140 done:
5141 Py_LeaveRecursiveCall();
5142 return result;
5143 }
5144 #endif
5145 #endif
46995146
47005147 /* PyObjectCall */
47015148 #if CYTHON_COMPILING_IN_CPYTHON
47175164 }
47185165 #endif
47195166
4720 /* PyCFunctionFastCall */
4721 #if CYTHON_FAST_PYCCALL
4722 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
4723 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
4724 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
4725 PyObject *self = PyCFunction_GET_SELF(func);
4726 assert(PyCFunction_Check(func));
4727 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
4728 assert(nargs >= 0);
4729 assert(nargs == 0 || args != NULL);
4730 /* _PyCFunction_FastCallDict() must not be called with an exception set,
4731 because it may clear it (directly or indirectly) and so the
4732 caller loses its exception */
4733 assert(!PyErr_Occurred());
4734 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
4735 }
4736 #endif // CYTHON_FAST_PYCCALL
4737
4738 /* PyFunctionFastCall */
4739 #if CYTHON_FAST_PYCALL
4740 #include "frameobject.h"
4741 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
4742 PyObject *globals) {
4743 PyFrameObject *f;
4744 PyThreadState *tstate = PyThreadState_GET();
4745 PyObject **fastlocals;
4746 Py_ssize_t i;
4747 PyObject *result;
4748 assert(globals != NULL);
4749 /* XXX Perhaps we should create a specialized
4750 PyFrame_New() that doesn't take locals, but does
4751 take builtins without sanity checking them.
4752 */
4753 assert(tstate != NULL);
4754 f = PyFrame_New(tstate, co, globals, NULL);
4755 if (f == NULL) {
4756 return NULL;
4757 }
4758 fastlocals = f->f_localsplus;
4759 for (i = 0; i < na; i++) {
4760 Py_INCREF(*args);
4761 fastlocals[i] = *args++;
4762 }
4763 result = PyEval_EvalFrameEx(f,0);
4764 ++tstate->recursion_depth;
4765 Py_DECREF(f);
4766 --tstate->recursion_depth;
4767 return result;
4768 }
4769 #if 1 || PY_VERSION_HEX < 0x030600B1
4770 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
4771 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
4772 PyObject *globals = PyFunction_GET_GLOBALS(func);
4773 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
4774 PyObject *closure;
4775 #if PY_MAJOR_VERSION >= 3
4776 PyObject *kwdefs;
4777 #endif
4778 PyObject *kwtuple, **k;
4779 PyObject **d;
4780 Py_ssize_t nd;
4781 Py_ssize_t nk;
4782 PyObject *result;
4783 assert(kwargs == NULL || PyDict_Check(kwargs));
4784 nk = kwargs ? PyDict_Size(kwargs) : 0;
4785 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
4786 return NULL;
4787 }
4788 if (
4789 #if PY_MAJOR_VERSION >= 3
4790 co->co_kwonlyargcount == 0 &&
4791 #endif
4792 likely(kwargs == NULL || nk == 0) &&
4793 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
4794 if (argdefs == NULL && co->co_argcount == nargs) {
4795 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
4796 goto done;
4797 }
4798 else if (nargs == 0 && argdefs != NULL
4799 && co->co_argcount == Py_SIZE(argdefs)) {
4800 /* function called with no arguments, but all parameters have
4801 a default value: use default values as arguments .*/
4802 args = &PyTuple_GET_ITEM(argdefs, 0);
4803 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
4804 goto done;
4805 }
4806 }
4807 if (kwargs != NULL) {
4808 Py_ssize_t pos, i;
4809 kwtuple = PyTuple_New(2 * nk);
4810 if (kwtuple == NULL) {
4811 result = NULL;
4812 goto done;
4813 }
4814 k = &PyTuple_GET_ITEM(kwtuple, 0);
4815 pos = i = 0;
4816 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
4817 Py_INCREF(k[i]);
4818 Py_INCREF(k[i+1]);
4819 i += 2;
4820 }
4821 nk = i / 2;
4822 }
4823 else {
4824 kwtuple = NULL;
4825 k = NULL;
4826 }
4827 closure = PyFunction_GET_CLOSURE(func);
4828 #if PY_MAJOR_VERSION >= 3
4829 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
4830 #endif
4831 if (argdefs != NULL) {
4832 d = &PyTuple_GET_ITEM(argdefs, 0);
4833 nd = Py_SIZE(argdefs);
4834 }
4835 else {
4836 d = NULL;
4837 nd = 0;
4838 }
4839 #if PY_MAJOR_VERSION >= 3
4840 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
4841 args, nargs,
4842 k, (int)nk,
4843 d, (int)nd, kwdefs, closure);
4844 #else
4845 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
4846 args, nargs,
4847 k, (int)nk,
4848 d, (int)nd, closure);
4849 #endif
4850 Py_XDECREF(kwtuple);
4851 done:
4852 Py_LeaveRecursiveCall();
4853 return result;
4854 }
4855 #endif // CPython < 3.6
4856 #endif // CYTHON_FAST_PYCALL
4857
48585167 /* PyObjectCallMethO */
48595168 #if CYTHON_COMPILING_IN_CPYTHON
48605169 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
48935202 return __Pyx_PyFunction_FastCall(func, &arg, 1);
48945203 }
48955204 #endif
4896 #ifdef __Pyx_CyFunction_USED
4897 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
4898 #else
48995205 if (likely(PyCFunction_Check(func))) {
4900 #endif
49015206 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
49025207 return __Pyx_PyObject_CallMethO(func, arg);
49035208 #if CYTHON_FAST_PYCCALL
49205225 #endif
49215226
49225227 /* PyObjectCallNoArg */
4923 #if CYTHON_COMPILING_IN_CPYTHON
5228 #if CYTHON_COMPILING_IN_CPYTHON
49245229 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
49255230 #if CYTHON_FAST_PYCALL
49265231 if (PyFunction_Check(func)) {
49285233 }
49295234 #endif
49305235 #ifdef __Pyx_CyFunction_USED
4931 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
5236 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
49325237 #else
49335238 if (likely(PyCFunction_Check(func))) {
49345239 #endif
49415246 #endif
49425247
49435248 /* SaveResetException */
4944 #if CYTHON_FAST_THREAD_STATE
5249 #if CYTHON_FAST_THREAD_STATE
49455250 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
5251 #if PY_VERSION_HEX >= 0x030700A3
5252 *type = tstate->exc_state.exc_type;
5253 *value = tstate->exc_state.exc_value;
5254 *tb = tstate->exc_state.exc_traceback;
5255 #else
49465256 *type = tstate->exc_type;
49475257 *value = tstate->exc_value;
49485258 *tb = tstate->exc_traceback;
5259 #endif
49495260 Py_XINCREF(*type);
49505261 Py_XINCREF(*value);
49515262 Py_XINCREF(*tb);
49525263 }
49535264 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
49545265 PyObject *tmp_type, *tmp_value, *tmp_tb;
5266 #if PY_VERSION_HEX >= 0x030700A3
5267 tmp_type = tstate->exc_state.exc_type;
5268 tmp_value = tstate->exc_state.exc_value;
5269 tmp_tb = tstate->exc_state.exc_traceback;
5270 tstate->exc_state.exc_type = type;
5271 tstate->exc_state.exc_value = value;
5272 tstate->exc_state.exc_traceback = tb;
5273 #else
49555274 tmp_type = tstate->exc_type;
49565275 tmp_value = tstate->exc_value;
49575276 tmp_tb = tstate->exc_traceback;
49585277 tstate->exc_type = type;
49595278 tstate->exc_value = value;
49605279 tstate->exc_traceback = tb;
5280 #endif
49615281 Py_XDECREF(tmp_type);
49625282 Py_XDECREF(tmp_value);
49635283 Py_XDECREF(tmp_tb);
49655285 #endif
49665286
49675287 /* GetException */
4968 #if CYTHON_FAST_THREAD_STATE
5288 #if CYTHON_FAST_THREAD_STATE
49695289 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
49705290 #else
49715291 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
50025322 *value = local_value;
50035323 *tb = local_tb;
50045324 #if CYTHON_FAST_THREAD_STATE
5325 #if PY_VERSION_HEX >= 0x030700A3
5326 tmp_type = tstate->exc_state.exc_type;
5327 tmp_value = tstate->exc_state.exc_value;
5328 tmp_tb = tstate->exc_state.exc_traceback;
5329 tstate->exc_state.exc_type = local_type;
5330 tstate->exc_state.exc_value = local_value;
5331 tstate->exc_state.exc_traceback = local_tb;
5332 #else
50055333 tmp_type = tstate->exc_type;
50065334 tmp_value = tstate->exc_value;
50075335 tmp_tb = tstate->exc_traceback;
50085336 tstate->exc_type = local_type;
50095337 tstate->exc_value = local_value;
50105338 tstate->exc_traceback = local_tb;
5339 #endif
50115340 Py_XDECREF(tmp_type);
50125341 Py_XDECREF(tmp_value);
50135342 Py_XDECREF(tmp_tb);
50265355 }
50275356
50285357 /* PyErrFetchRestore */
5029 #if CYTHON_FAST_THREAD_STATE
5358 #if CYTHON_FAST_THREAD_STATE
50305359 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
50315360 PyObject *tmp_type, *tmp_value, *tmp_tb;
50325361 tmp_type = tstate->curexc_type;
50505379 #endif
50515380
50525381 /* WriteUnraisableException */
5053 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
5382 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
50545383 CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
50555384 int full_traceback, CYTHON_UNUSED int nogil) {
50565385 PyObject *old_exc, *old_val, *old_tb;
50925421 }
50935422
50945423 /* PyErrExceptionMatches */
5095 #if CYTHON_FAST_THREAD_STATE
5424 #if CYTHON_FAST_THREAD_STATE
5425 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
5426 Py_ssize_t i, n;
5427 n = PyTuple_GET_SIZE(tuple);
5428 #if PY_MAJOR_VERSION >= 3
5429 for (i=0; i<n; i++) {
5430 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
5431 }
5432 #endif
5433 for (i=0; i<n; i++) {
5434 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
5435 }
5436 return 0;
5437 }
50965438 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
50975439 PyObject *exc_type = tstate->curexc_type;
50985440 if (exc_type == err) return 1;
50995441 if (unlikely(!exc_type)) return 0;
5100 return PyErr_GivenExceptionMatches(exc_type, err);
5442 if (unlikely(PyTuple_Check(err)))
5443 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
5444 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
51015445 }
51025446 #endif
51035447
51045448 /* SwapException */
5105 #if CYTHON_FAST_THREAD_STATE
5449 #if CYTHON_FAST_THREAD_STATE
51065450 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
51075451 PyObject *tmp_type, *tmp_value, *tmp_tb;
5452 #if PY_VERSION_HEX >= 0x030700A3
5453 tmp_type = tstate->exc_state.exc_type;
5454 tmp_value = tstate->exc_state.exc_value;
5455 tmp_tb = tstate->exc_state.exc_traceback;
5456 tstate->exc_state.exc_type = *type;
5457 tstate->exc_state.exc_value = *value;
5458 tstate->exc_state.exc_traceback = *tb;
5459 #else
51085460 tmp_type = tstate->exc_type;
51095461 tmp_value = tstate->exc_value;
51105462 tmp_tb = tstate->exc_traceback;
51115463 tstate->exc_type = *type;
51125464 tstate->exc_value = *value;
51135465 tstate->exc_traceback = *tb;
5466 #endif
51145467 *type = tmp_type;
51155468 *value = tmp_value;
51165469 *tb = tmp_tb;
51275480 #endif
51285481
51295482 /* GetModuleGlobalName */
5130 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
5483 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
51315484 PyObject *result;
51325485 #if !CYTHON_AVOID_BORROWED_REFS
5486 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
5487 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
5488 if (likely(result)) {
5489 Py_INCREF(result);
5490 } else if (unlikely(PyErr_Occurred())) {
5491 result = NULL;
5492 } else {
5493 #else
51335494 result = PyDict_GetItem(__pyx_d, name);
51345495 if (likely(result)) {
51355496 Py_INCREF(result);
51365497 } else {
5498 #endif
51375499 #else
51385500 result = PyObject_GetItem(__pyx_d, name);
51395501 if (!result) {
51635525 } else if (length == 1) {
51645526 return (equals == Py_EQ);
51655527 } else {
5166 int result = memcmp(ps1, ps2, (size_t)length);
5528 int result;
5529 #if CYTHON_USE_UNICODE_INTERNALS
5530 Py_hash_t hash1, hash2;
5531 hash1 = ((PyBytesObject*)s1)->ob_shash;
5532 hash2 = ((PyBytesObject*)s2)->ob_shash;
5533 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
5534 return (equals == Py_NE);
5535 }
5536 #endif
5537 result = memcmp(ps1, ps2, (size_t)length);
51675538 return (equals == Py_EQ) ? (result == 0) : (result != 0);
51685539 }
51695540 } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
52985669 "raise: exception class must be a subclass of BaseException");
52995670 goto bad;
53005671 }
5301 #if PY_VERSION_HEX >= 0x03030000
53025672 if (cause) {
5303 #else
5304 if (cause && cause != Py_None) {
5305 #endif
53065673 PyObject *fixed_cause;
53075674 if (cause == Py_None) {
53085675 fixed_cause = NULL;
53305697 PyErr_Restore(tmp_type, tmp_value, tb);
53315698 Py_XDECREF(tmp_tb);
53325699 #else
5333 PyThreadState *tstate = PyThreadState_GET();
5700 PyThreadState *tstate = __Pyx_PyThreadState_Current;
53345701 PyObject* tmp_tb = tstate->curexc_traceback;
53355702 if (tb != tmp_tb) {
53365703 Py_INCREF(tb);
53455712 }
53465713 #endif
53475714
5715 /* GetAttr */
5716 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
5717 #if CYTHON_USE_TYPE_SLOTS
5718 #if PY_MAJOR_VERSION >= 3
5719 if (likely(PyUnicode_Check(n)))
5720 #else
5721 if (likely(PyString_Check(n)))
5722 #endif
5723 return __Pyx_PyObject_GetAttrStr(o, n);
5724 #endif
5725 return PyObject_GetAttr(o, n);
5726 }
5727
5728 /* HasAttr */
5729 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
5730 PyObject *r;
5731 if (unlikely(!__Pyx_PyBaseString_Check(n))) {
5732 PyErr_SetString(PyExc_TypeError,
5733 "hasattr(): attribute name must be string");
5734 return -1;
5735 }
5736 r = __Pyx_GetAttr(o, n);
5737 if (unlikely(!r)) {
5738 PyErr_Clear();
5739 return 0;
5740 } else {
5741 Py_DECREF(r);
5742 return 1;
5743 }
5744 }
5745
53485746 /* Import */
5349 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
5747 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
53505748 PyObject *empty_list = 0;
53515749 PyObject *module = 0;
53525750 PyObject *global_dict = 0;
53535751 PyObject *empty_dict = 0;
53545752 PyObject *list;
5355 #if PY_VERSION_HEX < 0x03030000
5753 #if PY_MAJOR_VERSION < 3
53565754 PyObject *py_import;
53575755 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
53585756 if (!py_import)
53765774 #if PY_MAJOR_VERSION >= 3
53775775 if (level == -1) {
53785776 if (strchr(__Pyx_MODULE_NAME, '.')) {
5379 #if PY_VERSION_HEX < 0x03030000
5380 PyObject *py_level = PyInt_FromLong(1);
5381 if (!py_level)
5382 goto bad;
5383 module = PyObject_CallFunctionObjArgs(py_import,
5384 name, global_dict, empty_dict, list, py_level, NULL);
5385 Py_DECREF(py_level);
5386 #else
53875777 module = PyImport_ImportModuleLevelObject(
53885778 name, global_dict, empty_dict, list, 1);
5389 #endif
53905779 if (!module) {
53915780 if (!PyErr_ExceptionMatches(PyExc_ImportError))
53925781 goto bad;
53975786 }
53985787 #endif
53995788 if (!module) {
5400 #if PY_VERSION_HEX < 0x03030000
5789 #if PY_MAJOR_VERSION < 3
54015790 PyObject *py_level = PyInt_FromLong(level);
54025791 if (!py_level)
54035792 goto bad;
54115800 }
54125801 }
54135802 bad:
5414 #if PY_VERSION_HEX < 0x03030000
5803 #if PY_MAJOR_VERSION < 3
54155804 Py_XDECREF(py_import);
54165805 #endif
54175806 Py_XDECREF(empty_list);
54205809 }
54215810
54225811 /* ImportFrom */
5423 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
5812 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
54245813 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
54255814 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
54265815 PyErr_Format(PyExc_ImportError,
54335822 return value;
54345823 }
54355824
5825 /* CLineInTraceback */
5826 #ifndef CYTHON_CLINE_IN_TRACEBACK
5827 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
5828 PyObject *use_cline;
5829 PyObject *ptype, *pvalue, *ptraceback;
5830 #if CYTHON_COMPILING_IN_CPYTHON
5831 PyObject **cython_runtime_dict;
5832 #endif
5833 if (unlikely(!__pyx_cython_runtime)) {
5834 return c_line;
5835 }
5836 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
5837 #if CYTHON_COMPILING_IN_CPYTHON
5838 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
5839 if (likely(cython_runtime_dict)) {
5840 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
5841 } else
5842 #endif
5843 {
5844 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
5845 if (use_cline_obj) {
5846 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
5847 Py_DECREF(use_cline_obj);
5848 } else {
5849 PyErr_Clear();
5850 use_cline = NULL;
5851 }
5852 }
5853 if (!use_cline) {
5854 c_line = 0;
5855 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
5856 }
5857 else if (PyObject_Not(use_cline) != 0) {
5858 c_line = 0;
5859 }
5860 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
5861 return c_line;
5862 }
5863 #endif
5864
54365865 /* CodeObjectCache */
5437 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
5866 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
54385867 int start = 0, mid = 0, end = count - 1;
54395868 if (end >= 0 && code_line > entries[end].code_line) {
54405869 return count;
55145943 }
55155944
55165945 /* AddTraceback */
5517 #include "compile.h"
5946 #include "compile.h"
55185947 #include "frameobject.h"
55195948 #include "traceback.h"
55205949 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
55736002 int py_line, const char *filename) {
55746003 PyCodeObject *py_code = 0;
55756004 PyFrameObject *py_frame = 0;
5576 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
6005 PyThreadState *tstate = __Pyx_PyThreadState_Current;
6006 if (c_line) {
6007 c_line = __Pyx_CLineForTraceback(tstate, c_line);
6008 }
6009 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
55776010 if (!py_code) {
55786011 py_code = __Pyx_CreateCodeObjectForTraceback(
55796012 funcname, c_line, py_line, filename);
55806013 if (!py_code) goto bad;
5581 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
6014 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
55826015 }
55836016 py_frame = PyFrame_New(
5584 PyThreadState_GET(), /*PyThreadState *tstate,*/
5585 py_code, /*PyCodeObject *code,*/
5586 __pyx_d, /*PyObject *globals,*/
5587 0 /*PyObject *locals*/
6017 tstate, /*PyThreadState *tstate,*/
6018 py_code, /*PyCodeObject *code,*/
6019 __pyx_d, /*PyObject *globals,*/
6020 0 /*PyObject *locals*/
55886021 );
55896022 if (!py_frame) goto bad;
55906023 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
55956028 }
55966029
55976030 /* CIntFromPyVerify */
5598 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
6031 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
55996032 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
56006033 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
56016034 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
56176050 }
56186051
56196052 /* CIntToPy */
5620 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) {
6053 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int64_t(int64_t value) {
56216054 const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0;
56226055 const int is_unsigned = neg_one > const_zero;
56236056 if (is_unsigned) {
56486081 }
56496082
56506083 /* CIntToPy */
5651 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
6084 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
56526085 const int neg_one = (int) -1, const_zero = (int) 0;
56536086 const int is_unsigned = neg_one > const_zero;
56546087 if (is_unsigned) {
56796112 }
56806113
56816114 /* CIntFromPy */
5682 static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) {
6115 static CYTHON_INLINE int64_t __Pyx_PyInt_As_int64_t(PyObject *x) {
56836116 const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0;
56846117 const int is_unsigned = neg_one > const_zero;
56856118 #if PY_MAJOR_VERSION < 3
58686301 }
58696302
58706303 /* CIntToPy */
5871 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
6304 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
58726305 const long neg_one = (long) -1, const_zero = (long) 0;
58736306 const int is_unsigned = neg_one > const_zero;
58746307 if (is_unsigned) {
58996332 }
59006333
59016334 /* CIntFromPy */
5902 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
6335 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
59036336 const long neg_one = (long) -1, const_zero = (long) 0;
59046337 const int is_unsigned = neg_one > const_zero;
59056338 #if PY_MAJOR_VERSION < 3
60886521 }
60896522
60906523 /* CIntFromPy */
6091 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
6524 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
60926525 const int neg_one = (int) -1, const_zero = (int) 0;
60936526 const int is_unsigned = neg_one > const_zero;
60946527 #if PY_MAJOR_VERSION < 3
62766709 return (int) -1;
62776710 }
62786711
6712 /* FastTypeChecks */
6713 #if CYTHON_COMPILING_IN_CPYTHON
6714 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
6715 while (a) {
6716 a = a->tp_base;
6717 if (a == b)
6718 return 1;
6719 }
6720 return b == &PyBaseObject_Type;
6721 }
6722 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
6723 PyObject *mro;
6724 if (a == b) return 1;
6725 mro = a->tp_mro;
6726 if (likely(mro)) {
6727 Py_ssize_t i, n;
6728 n = PyTuple_GET_SIZE(mro);
6729 for (i = 0; i < n; i++) {
6730 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
6731 return 1;
6732 }
6733 return 0;
6734 }
6735 return __Pyx_InBases(a, b);
6736 }
6737 #if PY_MAJOR_VERSION == 2
6738 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
6739 PyObject *exception, *value, *tb;
6740 int res;
6741 __Pyx_PyThreadState_declare
6742 __Pyx_PyThreadState_assign
6743 __Pyx_ErrFetch(&exception, &value, &tb);
6744 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
6745 if (unlikely(res == -1)) {
6746 PyErr_WriteUnraisable(err);
6747 res = 0;
6748 }
6749 if (!res) {
6750 res = PyObject_IsSubclass(err, exc_type2);
6751 if (unlikely(res == -1)) {
6752 PyErr_WriteUnraisable(err);
6753 res = 0;
6754 }
6755 }
6756 __Pyx_ErrRestore(exception, value, tb);
6757 return res;
6758 }
6759 #else
6760 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
6761 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
6762 if (!res) {
6763 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
6764 }
6765 return res;
6766 }
6767 #endif
6768 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
6769 Py_ssize_t i, n;
6770 assert(PyExceptionClass_Check(exc_type));
6771 n = PyTuple_GET_SIZE(tuple);
6772 #if PY_MAJOR_VERSION >= 3
6773 for (i=0; i<n; i++) {
6774 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
6775 }
6776 #endif
6777 for (i=0; i<n; i++) {
6778 PyObject *t = PyTuple_GET_ITEM(tuple, i);
6779 #if PY_MAJOR_VERSION < 3
6780 if (likely(exc_type == t)) return 1;
6781 #endif
6782 if (likely(PyExceptionClass_Check(t))) {
6783 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
6784 } else {
6785 }
6786 }
6787 return 0;
6788 }
6789 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
6790 if (likely(err == exc_type)) return 1;
6791 if (likely(PyExceptionClass_Check(err))) {
6792 if (likely(PyExceptionClass_Check(exc_type))) {
6793 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
6794 } else if (likely(PyTuple_Check(exc_type))) {
6795 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
6796 } else {
6797 }
6798 }
6799 return PyErr_GivenExceptionMatches(err, exc_type);
6800 }
6801 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
6802 assert(PyExceptionClass_Check(exc_type1));
6803 assert(PyExceptionClass_Check(exc_type2));
6804 if (likely(err == exc_type1 || err == exc_type2)) return 1;
6805 if (likely(PyExceptionClass_Check(err))) {
6806 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
6807 }
6808 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
6809 }
6810 #endif
6811
62796812 /* CheckBinaryVersion */
6280 static int __Pyx_check_binary_version(void) {
6813 static int __Pyx_check_binary_version(void) {
62816814 char ctversion[4], rtversion[4];
62826815 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
62836816 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
62936826 }
62946827
62956828 /* FunctionExport */
6296 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
6829 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
62976830 PyObject *d = 0;
62986831 PyObject *cobj = 0;
62996832 union {
63306863 }
63316864
63326865 /* ModuleImport */
6333 #ifndef __PYX_HAVE_RT_ImportModule
6866 #ifndef __PYX_HAVE_RT_ImportModule
63346867 #define __PYX_HAVE_RT_ImportModule
63356868 static PyObject *__Pyx_ImportModule(const char *name) {
63366869 PyObject *py_name = 0;
63486881 #endif
63496882
63506883 /* TypeImport */
6351 #ifndef __PYX_HAVE_RT_ImportType
6884 #ifndef __PYX_HAVE_RT_ImportType
63526885 #define __PYX_HAVE_RT_ImportType
63536886 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
63546887 size_t size, int strict)
64136946 #endif
64146947
64156948 /* InitStrings */
6416 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
6949 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
64176950 while (t->p) {
64186951 #if PY_MAJOR_VERSION < 3
64196952 if (t->is_unicode) {
64386971 #endif
64396972 if (!*t->p)
64406973 return -1;
6974 if (PyObject_Hash(*t->p) == -1)
6975 return -1;
64416976 ++t;
64426977 }
64436978 return 0;
64466981 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
64476982 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
64486983 }
6449 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
6984 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
64506985 Py_ssize_t ignore;
64516986 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
64526987 }
6453 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6454 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
6988 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
6989 #if !CYTHON_PEP393_ENABLED
6990 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6991 char* defenc_c;
6992 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
6993 if (!defenc) return NULL;
6994 defenc_c = PyBytes_AS_STRING(defenc);
6995 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6996 {
6997 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
6998 char* c;
6999 for (c = defenc_c; c < end; c++) {
7000 if ((unsigned char) (*c) >= 128) {
7001 PyUnicode_AsASCIIString(o);
7002 return NULL;
7003 }
7004 }
7005 }
7006 #endif
7007 *length = PyBytes_GET_SIZE(defenc);
7008 return defenc_c;
7009 }
7010 #else
7011 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
7012 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
7013 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
7014 if (likely(PyUnicode_IS_ASCII(o))) {
7015 *length = PyUnicode_GET_LENGTH(o);
7016 return PyUnicode_AsUTF8(o);
7017 } else {
7018 PyUnicode_AsASCIIString(o);
7019 return NULL;
7020 }
7021 #else
7022 return PyUnicode_AsUTF8AndSize(o, length);
7023 #endif
7024 }
7025 #endif
7026 #endif
7027 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
7028 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
64557029 if (
64567030 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
64577031 __Pyx_sys_getdefaultencoding_not_ascii &&
64587032 #endif
64597033 PyUnicode_Check(o)) {
6460 #if PY_VERSION_HEX < 0x03030000
6461 char* defenc_c;
6462 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
6463 if (!defenc) return NULL;
6464 defenc_c = PyBytes_AS_STRING(defenc);
6465 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6466 {
6467 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
6468 char* c;
6469 for (c = defenc_c; c < end; c++) {
6470 if ((unsigned char) (*c) >= 128) {
6471 PyUnicode_AsASCIIString(o);
6472 return NULL;
6473 }
6474 }
6475 }
6476 #endif
6477 *length = PyBytes_GET_SIZE(defenc);
6478 return defenc_c;
6479 #else
6480 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
6481 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6482 if (PyUnicode_IS_ASCII(o)) {
6483 *length = PyUnicode_GET_LENGTH(o);
6484 return PyUnicode_AsUTF8(o);
6485 } else {
6486 PyUnicode_AsASCIIString(o);
6487 return NULL;
6488 }
6489 #else
6490 return PyUnicode_AsUTF8AndSize(o, length);
6491 #endif
6492 #endif
7034 return __Pyx_PyUnicode_AsStringAndSize(o, length);
64937035 } else
64947036 #endif
64957037 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
65137055 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
65147056 else return PyObject_IsTrue(x);
65157057 }
7058 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
7059 #if PY_MAJOR_VERSION >= 3
7060 if (PyLong_Check(result)) {
7061 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
7062 "__int__ returned non-int (type %.200s). "
7063 "The ability to return an instance of a strict subclass of int "
7064 "is deprecated, and may be removed in a future version of Python.",
7065 Py_TYPE(result)->tp_name)) {
7066 Py_DECREF(result);
7067 return NULL;
7068 }
7069 return result;
7070 }
7071 #endif
7072 PyErr_Format(PyExc_TypeError,
7073 "__%.4s__ returned non-%.4s (type %.200s)",
7074 type_name, type_name, Py_TYPE(result)->tp_name);
7075 Py_DECREF(result);
7076 return NULL;
7077 }
65167078 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
65177079 #if CYTHON_USE_TYPE_SLOTS
65187080 PyNumberMethods *m;
65207082 const char *name = NULL;
65217083 PyObject *res = NULL;
65227084 #if PY_MAJOR_VERSION < 3
6523 if (PyInt_Check(x) || PyLong_Check(x))
6524 #else
6525 if (PyLong_Check(x))
7085 if (likely(PyInt_Check(x) || PyLong_Check(x)))
7086 #else
7087 if (likely(PyLong_Check(x)))
65267088 #endif
65277089 return __Pyx_NewRef(x);
65287090 #if CYTHON_USE_TYPE_SLOTS
65307092 #if PY_MAJOR_VERSION < 3
65317093 if (m && m->nb_int) {
65327094 name = "int";
6533 res = PyNumber_Int(x);
7095 res = m->nb_int(x);
65347096 }
65357097 else if (m && m->nb_long) {
65367098 name = "long";
6537 res = PyNumber_Long(x);
7099 res = m->nb_long(x);
65387100 }
65397101 #else
6540 if (m && m->nb_int) {
7102 if (likely(m && m->nb_int)) {
65417103 name = "int";
6542 res = PyNumber_Long(x);
7104 res = m->nb_int(x);
65437105 }
65447106 #endif
65457107 #else
6546 res = PyNumber_Int(x);
6547 #endif
6548 if (res) {
7108 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
7109 res = PyNumber_Int(x);
7110 }
7111 #endif
7112 if (likely(res)) {
65497113 #if PY_MAJOR_VERSION < 3
6550 if (!PyInt_Check(res) && !PyLong_Check(res)) {
6551 #else
6552 if (!PyLong_Check(res)) {
6553 #endif
6554 PyErr_Format(PyExc_TypeError,
6555 "__%.4s__ returned non-%.4s (type %.200s)",
6556 name, name, Py_TYPE(res)->tp_name);
6557 Py_DECREF(res);
6558 return NULL;
7114 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
7115 #else
7116 if (unlikely(!PyLong_CheckExact(res))) {
7117 #endif
7118 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
65597119 }
65607120 }
65617121 else if (!PyErr_Occurred()) {
66267186 Py_DECREF(x);
66277187 return ival;
66287188 }
7189 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
7190 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
7191 }
66297192 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
66307193 return PyInt_FromSize_t(ival);
66317194 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
8 #else
9 #define CYTHON_ABI "0_25_2"
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
8 #else
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
105123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
108132 #define CYTHON_USE_ASYNC_SLOTS 0
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
409549 { \
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420552
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
428560
429561 #define __PYX_HAVE__pygame_sdl2__scrap
430562 #define __PYX_HAVE_API__pygame_sdl2__scrap
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
437570 #include <omp.h>
438571 #endif /* _OPENMP */
439572
440 #ifdef PYREX_WITHOUT_ASSERTIONS
573 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
441574 #define CYTHON_WITHOUT_ASSERTIONS
442575 #endif
443576
468601 #define __Pyx_sst_abs(value) abs(value)
469602 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
470603 #define __Pyx_sst_abs(value) labs(value)
471 #elif defined (_MSC_VER) && defined (_M_X64)
472 #define __Pyx_sst_abs(value) _abs64(value)
604 #elif defined (_MSC_VER)
605 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
473606 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
474607 #define __Pyx_sst_abs(value) llabs(value)
475608 #elif defined (__GNUC__)
477610 #else
478611 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
479612 #endif
480 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
481 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
613 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
614 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
482615 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
483616 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
484617 #define __Pyx_PyBytes_FromString PyBytes_FromString
491624 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
492625 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
493626 #endif
494 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
495 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
627 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
628 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
629 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
634 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
635 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
496638 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
497639 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
498640 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
499641 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
500642 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
501 #if PY_MAJOR_VERSION < 3
502 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
503 {
643 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
504644 const Py_UNICODE *u_end = u;
505645 while (*u_end++) ;
506646 return (size_t)(u_end - u - 1);
507647 }
508 #else
509 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
510 #endif
511648 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
512649 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
513650 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
514651 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
515652 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
516 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
653 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
517654 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
518655 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
656 #define __Pyx_PySequence_Tuple(obj)\
657 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
519658 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
520659 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
521660 #if CYTHON_ASSUME_SAFE_MACROS
614753 #define likely(x) (x)
615754 #define unlikely(x) (x)
616755 #endif /* __GNUC__ */
617
618 static PyObject *__pyx_m;
756 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
757
758 static PyObject *__pyx_m = NULL;
619759 static PyObject *__pyx_d;
620760 static PyObject *__pyx_b;
761 static PyObject *__pyx_cython_runtime = NULL;
621762 static PyObject *__pyx_empty_tuple;
622763 static PyObject *__pyx_empty_bytes;
623764 static PyObject *__pyx_empty_unicode;
699840
700841 /* PyObjectGetAttrStr.proto */
701842 #if CYTHON_USE_TYPE_SLOTS
702 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
703 PyTypeObject* tp = Py_TYPE(obj);
704 if (likely(tp->tp_getattro))
705 return tp->tp_getattro(obj, attr_name);
706 #if PY_MAJOR_VERSION < 3
707 if (likely(tp->tp_getattr))
708 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
709 #endif
710 return PyObject_GetAttr(obj, attr_name);
711 }
843 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
712844 #else
713845 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
714846 #endif
762894 /* PyThreadStateGet.proto */
763895 #if CYTHON_FAST_THREAD_STATE
764896 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
765 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
897 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
898 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
766899 #else
767900 #define __Pyx_PyThreadState_declare
768901 #define __Pyx_PyThreadState_assign
902 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
769903 #endif
770904
771905 /* PyErrFetchRestore.proto */
772906 #if CYTHON_FAST_THREAD_STATE
907 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
773908 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
774909 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
775910 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
776911 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
777912 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
778913 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
779 #else
914 #if CYTHON_COMPILING_IN_CPYTHON
915 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
916 #else
917 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
918 #endif
919 #else
920 #define __Pyx_PyErr_Clear() PyErr_Clear()
921 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
780922 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
781923 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
924 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
925 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
782926 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
783927 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
784928 #endif
803947
804948 /* ImportFrom.proto */
805949 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
950
951 /* CLineInTraceback.proto */
952 #ifdef CYTHON_CLINE_IN_TRACEBACK
953 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
954 #else
955 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
956 #endif
806957
807958 /* CodeObjectCache.proto */
808959 typedef struct {
832983 /* CIntFromPy.proto */
833984 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
834985
986 /* FastTypeChecks.proto */
987 #if CYTHON_COMPILING_IN_CPYTHON
988 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
989 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
990 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
991 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
992 #else
993 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
994 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
995 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
996 #endif
997 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
998
835999 /* CheckBinaryVersion.proto */
8361000 static int __Pyx_check_binary_version(void);
8371001
8511015
8521016 /* Module declarations from 'pygame_sdl2.scrap' */
8531017 #define __Pyx_MODULE_NAME "pygame_sdl2.scrap"
1018 extern int __pyx_module_is_main_pygame_sdl2__scrap;
8541019 int __pyx_module_is_main_pygame_sdl2__scrap = 0;
8551020
8561021 /* Implementation of 'pygame_sdl2.scrap' */
8751040 static const char __pyx_k_Not_implemented[] = "Not implemented.";
8761041 static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error";
8771042 static const char __pyx_k_pygame_sdl2_scrap[] = "pygame_sdl2.scrap";
1043 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
8781044 static const char __pyx_k_pygame_sdl2_compat[] = "pygame_sdl2.compat";
8791045 static const char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals";
8801046 static const char __pyx_k_src_pygame_sdl2_scrap_pyx[] = "src/pygame_sdl2/scrap.pyx";
8811047 static PyObject *__pyx_kp_u_Not_implemented;
8821048 static PyObject *__pyx_n_s_SCRAP_TEXT;
8831049 static PyObject *__pyx_n_s_bytes;
1050 static PyObject *__pyx_n_s_cline_in_traceback;
8841051 static PyObject *__pyx_n_s_contains;
8851052 static PyObject *__pyx_n_s_data;
8861053 static PyObject *__pyx_n_s_error;
9221089 static PyObject *__pyx_codeobj__10;
9231090 static PyObject *__pyx_codeobj__11;
9241091 static PyObject *__pyx_codeobj__13;
1092 /* Late includes */
9251093
9261094 /* "pygame_sdl2/scrap.pyx":26
9271095 * from pygame_sdl2.compat import bytes_
10141182 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10151183 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 31, __pyx_L1_error)
10161184 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1017 if (__pyx_t_3) {
1185 if (likely(__pyx_t_3)) {
10181186
10191187 /* "pygame_sdl2/scrap.pyx":32
10201188 * cdef char *text = NULL
10331201 * rv = bytes_(text)
10341202 */
10351203 __pyx_t_3 = ((__pyx_v_text == NULL) != 0);
1036 if (__pyx_t_3) {
1204 if (unlikely(__pyx_t_3)) {
10371205
10381206 /* "pygame_sdl2/scrap.pyx":34
10391207 * text = SDL_GetClipboardText()
13001468 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13011469 switch (pos_args) {
13021470 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1471 CYTHON_FALLTHROUGH;
13031472 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1473 CYTHON_FALLTHROUGH;
13041474 case 0: break;
13051475 default: goto __pyx_L5_argtuple_error;
13061476 }
13071477 kw_args = PyDict_Size(__pyx_kwds);
13081478 switch (pos_args) {
13091479 case 0:
1310 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
1480 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
13111481 else goto __pyx_L5_argtuple_error;
1482 CYTHON_FALLTHROUGH;
13121483 case 1:
1313 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
1484 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
13141485 else {
13151486 __Pyx_RaiseArgtupleInvalid("put", 1, 2, 2, 1); __PYX_ERR(0, 44, __pyx_L3_error)
13161487 }
13671538 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13681539 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 45, __pyx_L1_error)
13691540 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1370 if (__pyx_t_3) {
1541 if (unlikely(__pyx_t_3)) {
13711542
13721543 /* "pygame_sdl2/scrap.pyx":46
13731544 * def put(type, data):
14581629 */
14591630 __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_data); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 50, __pyx_L1_error)
14601631 __pyx_t_3 = ((SDL_SetClipboardText(__pyx_t_6) != 0) != 0);
1461 if (__pyx_t_3) {
1632 if (unlikely(__pyx_t_3)) {
14621633
14631634 /* "pygame_sdl2/scrap.pyx":51
14641635 *
17171888 };
17181889
17191890 #if PY_MAJOR_VERSION >= 3
1891 #if CYTHON_PEP489_MULTI_PHASE_INIT
1892 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
1893 static int __pyx_pymod_exec_scrap(PyObject* module); /*proto*/
1894 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
1895 {Py_mod_create, (void*)__pyx_pymod_create},
1896 {Py_mod_exec, (void*)__pyx_pymod_exec_scrap},
1897 {0, NULL}
1898 };
1899 #endif
1900
17201901 static struct PyModuleDef __pyx_moduledef = {
1721 #if PY_VERSION_HEX < 0x03020000
1722 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
1723 #else
17241902 PyModuleDef_HEAD_INIT,
1725 #endif
17261903 "scrap",
17271904 0, /* m_doc */
1905 #if CYTHON_PEP489_MULTI_PHASE_INIT
1906 0, /* m_size */
1907 #else
17281908 -1, /* m_size */
1909 #endif
17291910 __pyx_methods /* m_methods */,
1911 #if CYTHON_PEP489_MULTI_PHASE_INIT
1912 __pyx_moduledef_slots, /* m_slots */
1913 #else
17301914 NULL, /* m_reload */
1915 #endif
17311916 NULL, /* m_traverse */
17321917 NULL, /* m_clear */
17331918 NULL /* m_free */
17381923 {&__pyx_kp_u_Not_implemented, __pyx_k_Not_implemented, sizeof(__pyx_k_Not_implemented), 0, 1, 0, 0},
17391924 {&__pyx_n_s_SCRAP_TEXT, __pyx_k_SCRAP_TEXT, sizeof(__pyx_k_SCRAP_TEXT), 0, 0, 1, 1},
17401925 {&__pyx_n_s_bytes, __pyx_k_bytes, sizeof(__pyx_k_bytes), 0, 0, 1, 1},
1926 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
17411927 {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1},
17421928 {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
17431929 {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
17981984 * pass
17991985 *
18001986 */
1801 __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_init, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 26, __pyx_L1_error)
1987 __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_init, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 26, __pyx_L1_error)
18021988
18031989 /* "pygame_sdl2/scrap.pyx":29
18041990 * pass
18101996 __pyx_tuple__4 = PyTuple_Pack(3, __pyx_n_s_type, __pyx_n_s_text, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 29, __pyx_L1_error)
18111997 __Pyx_GOTREF(__pyx_tuple__4);
18121998 __Pyx_GIVEREF(__pyx_tuple__4);
1813 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_get, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 29, __pyx_L1_error)
1999 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_get, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 29, __pyx_L1_error)
18142000
18152001 /* "pygame_sdl2/scrap.pyx":41
18162002 * raise error("Not implemented.")
18192005 * return [SCRAP_TEXT]
18202006 *
18212007 */
1822 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_get_types, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 41, __pyx_L1_error)
2008 __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_get_types, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 41, __pyx_L1_error)
18232009
18242010 /* "pygame_sdl2/scrap.pyx":44
18252011 * return [SCRAP_TEXT]
18312017 __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_type, __pyx_n_s_data); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 44, __pyx_L1_error)
18322018 __Pyx_GOTREF(__pyx_tuple__7);
18332019 __Pyx_GIVEREF(__pyx_tuple__7);
1834 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_put, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 44, __pyx_L1_error)
2020 __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_put, 44, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 44, __pyx_L1_error)
18352021
18362022 /* "pygame_sdl2/scrap.pyx":53
18372023 * raise error()
18432029 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_n_s_type); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 53, __pyx_L1_error)
18442030 __Pyx_GOTREF(__pyx_tuple__9);
18452031 __Pyx_GIVEREF(__pyx_tuple__9);
1846 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_contains, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 53, __pyx_L1_error)
2032 __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_contains, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 53, __pyx_L1_error)
18472033
18482034 /* "pygame_sdl2/scrap.pyx":59
18492035 * return SDL_HasClipboardText() == SDL_TRUE
18522038 * return False
18532039 *
18542040 */
1855 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_lost, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 59, __pyx_L1_error)
2041 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_lost, 59, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 59, __pyx_L1_error)
18562042
18572043 /* "pygame_sdl2/scrap.pyx":62
18582044 * return False
18632049 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_mode); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 62, __pyx_L1_error)
18642050 __Pyx_GOTREF(__pyx_tuple__12);
18652051 __Pyx_GIVEREF(__pyx_tuple__12);
1866 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_set_mode, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 62, __pyx_L1_error)
2052 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_scrap_pyx, __pyx_n_s_set_mode, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 62, __pyx_L1_error)
18672053 __Pyx_RefNannyFinishContext();
18682054 return 0;
18692055 __pyx_L1_error:;
18782064 return -1;
18792065 }
18802066
2067 static int __Pyx_modinit_global_init_code(void); /*proto*/
2068 static int __Pyx_modinit_variable_export_code(void); /*proto*/
2069 static int __Pyx_modinit_function_export_code(void); /*proto*/
2070 static int __Pyx_modinit_type_init_code(void); /*proto*/
2071 static int __Pyx_modinit_type_import_code(void); /*proto*/
2072 static int __Pyx_modinit_variable_import_code(void); /*proto*/
2073 static int __Pyx_modinit_function_import_code(void); /*proto*/
2074
2075 static int __Pyx_modinit_global_init_code(void) {
2076 __Pyx_RefNannyDeclarations
2077 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
2078 /*--- Global init code ---*/
2079 __Pyx_RefNannyFinishContext();
2080 return 0;
2081 }
2082
2083 static int __Pyx_modinit_variable_export_code(void) {
2084 __Pyx_RefNannyDeclarations
2085 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
2086 /*--- Variable export code ---*/
2087 __Pyx_RefNannyFinishContext();
2088 return 0;
2089 }
2090
2091 static int __Pyx_modinit_function_export_code(void) {
2092 __Pyx_RefNannyDeclarations
2093 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
2094 /*--- Function export code ---*/
2095 __Pyx_RefNannyFinishContext();
2096 return 0;
2097 }
2098
2099 static int __Pyx_modinit_type_init_code(void) {
2100 __Pyx_RefNannyDeclarations
2101 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
2102 /*--- Type init code ---*/
2103 __Pyx_RefNannyFinishContext();
2104 return 0;
2105 }
2106
2107 static int __Pyx_modinit_type_import_code(void) {
2108 __Pyx_RefNannyDeclarations
2109 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
2110 /*--- Type import code ---*/
2111 __Pyx_RefNannyFinishContext();
2112 return 0;
2113 }
2114
2115 static int __Pyx_modinit_variable_import_code(void) {
2116 __Pyx_RefNannyDeclarations
2117 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
2118 /*--- Variable import code ---*/
2119 __Pyx_RefNannyFinishContext();
2120 return 0;
2121 }
2122
2123 static int __Pyx_modinit_function_import_code(void) {
2124 __Pyx_RefNannyDeclarations
2125 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
2126 /*--- Function import code ---*/
2127 __Pyx_RefNannyFinishContext();
2128 return 0;
2129 }
2130
2131
18812132 #if PY_MAJOR_VERSION < 3
1882 PyMODINIT_FUNC initscrap(void); /*proto*/
1883 PyMODINIT_FUNC initscrap(void)
1884 #else
1885 PyMODINIT_FUNC PyInit_scrap(void); /*proto*/
1886 PyMODINIT_FUNC PyInit_scrap(void)
2133 #ifdef CYTHON_NO_PYINIT_EXPORT
2134 #define __Pyx_PyMODINIT_FUNC void
2135 #else
2136 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
2137 #endif
2138 #else
2139 #ifdef CYTHON_NO_PYINIT_EXPORT
2140 #define __Pyx_PyMODINIT_FUNC PyObject *
2141 #else
2142 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
2143 #endif
2144 #endif
2145 #ifndef CYTHON_SMALL_CODE
2146 #if defined(__clang__)
2147 #define CYTHON_SMALL_CODE
2148 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
2149 #define CYTHON_SMALL_CODE __attribute__((cold))
2150 #else
2151 #define CYTHON_SMALL_CODE
2152 #endif
2153 #endif
2154
2155
2156 #if PY_MAJOR_VERSION < 3
2157 __Pyx_PyMODINIT_FUNC initscrap(void) CYTHON_SMALL_CODE; /*proto*/
2158 __Pyx_PyMODINIT_FUNC initscrap(void)
2159 #else
2160 __Pyx_PyMODINIT_FUNC PyInit_scrap(void) CYTHON_SMALL_CODE; /*proto*/
2161 __Pyx_PyMODINIT_FUNC PyInit_scrap(void)
2162 #if CYTHON_PEP489_MULTI_PHASE_INIT
2163 {
2164 return PyModuleDef_Init(&__pyx_moduledef);
2165 }
2166 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
2167 PyObject *value = PyObject_GetAttrString(spec, from_name);
2168 int result = 0;
2169 if (likely(value)) {
2170 result = PyDict_SetItemString(moddict, to_name, value);
2171 Py_DECREF(value);
2172 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
2173 PyErr_Clear();
2174 } else {
2175 result = -1;
2176 }
2177 return result;
2178 }
2179 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
2180 PyObject *module = NULL, *moddict, *modname;
2181 if (__pyx_m)
2182 return __Pyx_NewRef(__pyx_m);
2183 modname = PyObject_GetAttrString(spec, "name");
2184 if (unlikely(!modname)) goto bad;
2185 module = PyModule_NewObject(modname);
2186 Py_DECREF(modname);
2187 if (unlikely(!module)) goto bad;
2188 moddict = PyModule_GetDict(module);
2189 if (unlikely(!moddict)) goto bad;
2190 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
2191 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
2192 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
2193 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
2194 return module;
2195 bad:
2196 Py_XDECREF(module);
2197 return NULL;
2198 }
2199
2200
2201 static int __pyx_pymod_exec_scrap(PyObject *__pyx_pyinit_module)
2202 #endif
18872203 #endif
18882204 {
18892205 PyObject *__pyx_t_1 = NULL;
18902206 PyObject *__pyx_t_2 = NULL;
18912207 __Pyx_RefNannyDeclarations
2208 #if CYTHON_PEP489_MULTI_PHASE_INIT
2209 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
2210 #elif PY_MAJOR_VERSION >= 3
2211 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
2212 #endif
18922213 #if CYTHON_REFNANNY
1893 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
1894 if (!__Pyx_RefNanny) {
1895 PyErr_Clear();
1896 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
1897 if (!__Pyx_RefNanny)
1898 Py_FatalError("failed to import 'refnanny' module");
1899 }
1900 #endif
1901 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_scrap(void)", 0);
2214 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
2215 if (!__Pyx_RefNanny) {
2216 PyErr_Clear();
2217 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
2218 if (!__Pyx_RefNanny)
2219 Py_FatalError("failed to import 'refnanny' module");
2220 }
2221 #endif
2222 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_scrap(void)", 0);
19022223 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19032224 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
19042225 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
19152236 #ifdef __Pyx_Generator_USED
19162237 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19172238 #endif
2239 #ifdef __Pyx_AsyncGen_USED
2240 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2241 #endif
19182242 #ifdef __Pyx_StopAsyncIteration_USED
19192243 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19202244 #endif
19262250 #endif
19272251 #endif
19282252 /*--- Module creation code ---*/
2253 #if CYTHON_PEP489_MULTI_PHASE_INIT
2254 __pyx_m = __pyx_pyinit_module;
2255 Py_INCREF(__pyx_m);
2256 #else
19292257 #if PY_MAJOR_VERSION < 3
19302258 __pyx_m = Py_InitModule4("scrap", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
19312259 #else
19322260 __pyx_m = PyModule_Create(&__pyx_moduledef);
19332261 #endif
19342262 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
2263 #endif
19352264 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
19362265 Py_INCREF(__pyx_d);
19372266 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
2267 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
19382268 #if CYTHON_COMPILING_IN_PYPY
19392269 Py_INCREF(__pyx_b);
19402270 #endif
19592289 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
19602290 /*--- Constants init code ---*/
19612291 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1962 /*--- Global init code ---*/
1963 /*--- Variable export code ---*/
1964 /*--- Function export code ---*/
1965 /*--- Type init code ---*/
1966 /*--- Type import code ---*/
1967 /*--- Variable import code ---*/
1968 /*--- Function import code ---*/
2292 /*--- Global type/function init code ---*/
2293 (void)__Pyx_modinit_global_init_code();
2294 (void)__Pyx_modinit_variable_export_code();
2295 (void)__Pyx_modinit_function_export_code();
2296 (void)__Pyx_modinit_type_init_code();
2297 (void)__Pyx_modinit_type_import_code();
2298 (void)__Pyx_modinit_variable_import_code();
2299 (void)__Pyx_modinit_function_import_code();
19692300 /*--- Execution code ---*/
19702301 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
19712302 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21222453 * #
21232454 * # This software is provided 'as-is', without any express or implied
21242455 */
2125 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
2456 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
21262457 __Pyx_GOTREF(__pyx_t_2);
21272458 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
21282459 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21352466 __Pyx_XDECREF(__pyx_t_2);
21362467 if (__pyx_m) {
21372468 if (__pyx_d) {
2138 __Pyx_AddTraceback("init pygame_sdl2.scrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
2469 __Pyx_AddTraceback("init pygame_sdl2.scrap", 0, __pyx_lineno, __pyx_filename);
21392470 }
21402471 Py_DECREF(__pyx_m); __pyx_m = 0;
21412472 } else if (!PyErr_Occurred()) {
21432474 }
21442475 __pyx_L0:;
21452476 __Pyx_RefNannyFinishContext();
2146 #if PY_MAJOR_VERSION < 3
2477 #if CYTHON_PEP489_MULTI_PHASE_INIT
2478 return (__pyx_m != NULL) ? 0 : -1;
2479 #elif PY_MAJOR_VERSION >= 3
2480 return __pyx_m;
2481 #else
21472482 return;
2148 #else
2149 return __pyx_m;
21502483 #endif
21512484 }
21522485
21682501 }
21692502 #endif
21702503
2504 /* PyObjectGetAttrStr */
2505 #if CYTHON_USE_TYPE_SLOTS
2506 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
2507 PyTypeObject* tp = Py_TYPE(obj);
2508 if (likely(tp->tp_getattro))
2509 return tp->tp_getattro(obj, attr_name);
2510 #if PY_MAJOR_VERSION < 3
2511 if (likely(tp->tp_getattr))
2512 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
2513 #endif
2514 return PyObject_GetAttr(obj, attr_name);
2515 }
2516 #endif
2517
21712518 /* GetBuiltinName */
21722519 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
21732520 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
21862533 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
21872534 PyObject *result;
21882535 #if !CYTHON_AVOID_BORROWED_REFS
2536 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
2537 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
2538 if (likely(result)) {
2539 Py_INCREF(result);
2540 } else if (unlikely(PyErr_Occurred())) {
2541 result = NULL;
2542 } else {
2543 #else
21892544 result = PyDict_GetItem(__pyx_d, name);
21902545 if (likely(result)) {
21912546 Py_INCREF(result);
21922547 } else {
2548 #endif
21932549 #else
21942550 result = PyObject_GetItem(__pyx_d, name);
21952551 if (!result) {
22012557 }
22022558
22032559 /* PyCFunctionFastCall */
2204 #if CYTHON_FAST_PYCCALL
2560 #if CYTHON_FAST_PYCCALL
22052561 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
22062562 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
22072563 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
22082564 PyObject *self = PyCFunction_GET_SELF(func);
2565 int flags = PyCFunction_GET_FLAGS(func);
22092566 assert(PyCFunction_Check(func));
2210 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
2567 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
22112568 assert(nargs >= 0);
22122569 assert(nargs == 0 || args != NULL);
22132570 /* _PyCFunction_FastCallDict() must not be called with an exception set,
22142571 because it may clear it (directly or indirectly) and so the
22152572 caller loses its exception */
22162573 assert(!PyErr_Occurred());
2217 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
2218 }
2219 #endif // CYTHON_FAST_PYCCALL
2574 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
2575 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
2576 } else {
2577 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
2578 }
2579 }
2580 #endif
22202581
22212582 /* PyFunctionFastCall */
2222 #if CYTHON_FAST_PYCALL
2583 #if CYTHON_FAST_PYCALL
22232584 #include "frameobject.h"
22242585 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
22252586 PyObject *globals) {
22262587 PyFrameObject *f;
2227 PyThreadState *tstate = PyThreadState_GET();
2588 PyThreadState *tstate = __Pyx_PyThreadState_Current;
22282589 PyObject **fastlocals;
22292590 Py_ssize_t i;
22302591 PyObject *result;
23352696 Py_LeaveRecursiveCall();
23362697 return result;
23372698 }
2338 #endif // CPython < 3.6
2339 #endif // CYTHON_FAST_PYCALL
2699 #endif
2700 #endif
23402701
23412702 /* PyObjectCall */
2342 #if CYTHON_COMPILING_IN_CPYTHON
2703 #if CYTHON_COMPILING_IN_CPYTHON
23432704 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
23442705 PyObject *result;
23452706 ternaryfunc call = func->ob_type->tp_call;
23592720 #endif
23602721
23612722 /* PyObjectCallMethO */
2362 #if CYTHON_COMPILING_IN_CPYTHON
2723 #if CYTHON_COMPILING_IN_CPYTHON
23632724 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
23642725 PyObject *self, *result;
23652726 PyCFunction cfunc;
23792740 #endif
23802741
23812742 /* PyObjectCallOneArg */
2382 #if CYTHON_COMPILING_IN_CPYTHON
2743 #if CYTHON_COMPILING_IN_CPYTHON
23832744 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
23842745 PyObject *result;
23852746 PyObject *args = PyTuple_New(1);
23962757 return __Pyx_PyFunction_FastCall(func, &arg, 1);
23972758 }
23982759 #endif
2399 #ifdef __Pyx_CyFunction_USED
2400 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
2401 #else
24022760 if (likely(PyCFunction_Check(func))) {
2403 #endif
24042761 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24052762 return __Pyx_PyObject_CallMethO(func, arg);
24062763 #if CYTHON_FAST_PYCCALL
24312788 }
24322789 #endif
24332790 #ifdef __Pyx_CyFunction_USED
2434 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
2791 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
24352792 #else
24362793 if (likely(PyCFunction_Check(func))) {
24372794 #endif
25832940 "raise: exception class must be a subclass of BaseException");
25842941 goto bad;
25852942 }
2586 #if PY_VERSION_HEX >= 0x03030000
25872943 if (cause) {
2588 #else
2589 if (cause && cause != Py_None) {
2590 #endif
25912944 PyObject *fixed_cause;
25922945 if (cause == Py_None) {
25932946 fixed_cause = NULL;
26152968 PyErr_Restore(tmp_type, tmp_value, tb);
26162969 Py_XDECREF(tmp_tb);
26172970 #else
2618 PyThreadState *tstate = PyThreadState_GET();
2971 PyThreadState *tstate = __Pyx_PyThreadState_Current;
26192972 PyObject* tmp_tb = tstate->curexc_traceback;
26202973 if (tb != tmp_tb) {
26212974 Py_INCREF(tb);
26312984 #endif
26322985
26332986 /* RaiseArgTupleInvalid */
2634 static void __Pyx_RaiseArgtupleInvalid(
2987 static void __Pyx_RaiseArgtupleInvalid(
26352988 const char* func_name,
26362989 int exact,
26372990 Py_ssize_t num_min,
26573010 }
26583011
26593012 /* RaiseDoubleKeywords */
2660 static void __Pyx_RaiseDoubleKeywordsError(
3013 static void __Pyx_RaiseDoubleKeywordsError(
26613014 const char* func_name,
26623015 PyObject* kw_name)
26633016 {
26713024 }
26723025
26733026 /* ParseKeywords */
2674 static int __Pyx_ParseOptionalKeywords(
3027 static int __Pyx_ParseOptionalKeywords(
26753028 PyObject *kwds,
26763029 PyObject **argnames[],
26773030 PyObject *kwds2,
27733126 }
27743127
27753128 /* Import */
2776 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
3129 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
27773130 PyObject *empty_list = 0;
27783131 PyObject *module = 0;
27793132 PyObject *global_dict = 0;
27803133 PyObject *empty_dict = 0;
27813134 PyObject *list;
2782 #if PY_VERSION_HEX < 0x03030000
3135 #if PY_MAJOR_VERSION < 3
27833136 PyObject *py_import;
27843137 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
27853138 if (!py_import)
28033156 #if PY_MAJOR_VERSION >= 3
28043157 if (level == -1) {
28053158 if (strchr(__Pyx_MODULE_NAME, '.')) {
2806 #if PY_VERSION_HEX < 0x03030000
2807 PyObject *py_level = PyInt_FromLong(1);
2808 if (!py_level)
2809 goto bad;
2810 module = PyObject_CallFunctionObjArgs(py_import,
2811 name, global_dict, empty_dict, list, py_level, NULL);
2812 Py_DECREF(py_level);
2813 #else
28143159 module = PyImport_ImportModuleLevelObject(
28153160 name, global_dict, empty_dict, list, 1);
2816 #endif
28173161 if (!module) {
28183162 if (!PyErr_ExceptionMatches(PyExc_ImportError))
28193163 goto bad;
28243168 }
28253169 #endif
28263170 if (!module) {
2827 #if PY_VERSION_HEX < 0x03030000
3171 #if PY_MAJOR_VERSION < 3
28283172 PyObject *py_level = PyInt_FromLong(level);
28293173 if (!py_level)
28303174 goto bad;
28383182 }
28393183 }
28403184 bad:
2841 #if PY_VERSION_HEX < 0x03030000
3185 #if PY_MAJOR_VERSION < 3
28423186 Py_XDECREF(py_import);
28433187 #endif
28443188 Py_XDECREF(empty_list);
28473191 }
28483192
28493193 /* ImportFrom */
2850 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
3194 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
28513195 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
28523196 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
28533197 PyErr_Format(PyExc_ImportError,
28603204 return value;
28613205 }
28623206
3207 /* CLineInTraceback */
3208 #ifndef CYTHON_CLINE_IN_TRACEBACK
3209 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
3210 PyObject *use_cline;
3211 PyObject *ptype, *pvalue, *ptraceback;
3212 #if CYTHON_COMPILING_IN_CPYTHON
3213 PyObject **cython_runtime_dict;
3214 #endif
3215 if (unlikely(!__pyx_cython_runtime)) {
3216 return c_line;
3217 }
3218 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
3219 #if CYTHON_COMPILING_IN_CPYTHON
3220 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
3221 if (likely(cython_runtime_dict)) {
3222 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
3223 } else
3224 #endif
3225 {
3226 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
3227 if (use_cline_obj) {
3228 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
3229 Py_DECREF(use_cline_obj);
3230 } else {
3231 PyErr_Clear();
3232 use_cline = NULL;
3233 }
3234 }
3235 if (!use_cline) {
3236 c_line = 0;
3237 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
3238 }
3239 else if (PyObject_Not(use_cline) != 0) {
3240 c_line = 0;
3241 }
3242 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
3243 return c_line;
3244 }
3245 #endif
3246
28633247 /* CodeObjectCache */
2864 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
3248 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
28653249 int start = 0, mid = 0, end = count - 1;
28663250 if (end >= 0 && code_line > entries[end].code_line) {
28673251 return count;
29413325 }
29423326
29433327 /* AddTraceback */
2944 #include "compile.h"
3328 #include "compile.h"
29453329 #include "frameobject.h"
29463330 #include "traceback.h"
29473331 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
30003384 int py_line, const char *filename) {
30013385 PyCodeObject *py_code = 0;
30023386 PyFrameObject *py_frame = 0;
3003 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
3387 PyThreadState *tstate = __Pyx_PyThreadState_Current;
3388 if (c_line) {
3389 c_line = __Pyx_CLineForTraceback(tstate, c_line);
3390 }
3391 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
30043392 if (!py_code) {
30053393 py_code = __Pyx_CreateCodeObjectForTraceback(
30063394 funcname, c_line, py_line, filename);
30073395 if (!py_code) goto bad;
3008 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
3396 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
30093397 }
30103398 py_frame = PyFrame_New(
3011 PyThreadState_GET(), /*PyThreadState *tstate,*/
3012 py_code, /*PyCodeObject *code,*/
3013 __pyx_d, /*PyObject *globals,*/
3014 0 /*PyObject *locals*/
3399 tstate, /*PyThreadState *tstate,*/
3400 py_code, /*PyCodeObject *code,*/
3401 __pyx_d, /*PyObject *globals,*/
3402 0 /*PyObject *locals*/
30153403 );
30163404 if (!py_frame) goto bad;
30173405 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
30223410 }
30233411
30243412 /* CIntToPy */
3025 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
3413 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
30263414 const long neg_one = (long) -1, const_zero = (long) 0;
30273415 const int is_unsigned = neg_one > const_zero;
30283416 if (is_unsigned) {
30533441 }
30543442
30553443 /* CIntFromPyVerify */
3056 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
3444 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
30573445 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
30583446 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
30593447 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
30753463 }
30763464
30773465 /* CIntFromPy */
3078 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
3466 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
30793467 const long neg_one = (long) -1, const_zero = (long) 0;
30803468 const int is_unsigned = neg_one > const_zero;
30813469 #if PY_MAJOR_VERSION < 3
32643652 }
32653653
32663654 /* CIntFromPy */
3267 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
3655 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
32683656 const int neg_one = (int) -1, const_zero = (int) 0;
32693657 const int is_unsigned = neg_one > const_zero;
32703658 #if PY_MAJOR_VERSION < 3
34523840 return (int) -1;
34533841 }
34543842
3843 /* FastTypeChecks */
3844 #if CYTHON_COMPILING_IN_CPYTHON
3845 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
3846 while (a) {
3847 a = a->tp_base;
3848 if (a == b)
3849 return 1;
3850 }
3851 return b == &PyBaseObject_Type;
3852 }
3853 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
3854 PyObject *mro;
3855 if (a == b) return 1;
3856 mro = a->tp_mro;
3857 if (likely(mro)) {
3858 Py_ssize_t i, n;
3859 n = PyTuple_GET_SIZE(mro);
3860 for (i = 0; i < n; i++) {
3861 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
3862 return 1;
3863 }
3864 return 0;
3865 }
3866 return __Pyx_InBases(a, b);
3867 }
3868 #if PY_MAJOR_VERSION == 2
3869 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
3870 PyObject *exception, *value, *tb;
3871 int res;
3872 __Pyx_PyThreadState_declare
3873 __Pyx_PyThreadState_assign
3874 __Pyx_ErrFetch(&exception, &value, &tb);
3875 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
3876 if (unlikely(res == -1)) {
3877 PyErr_WriteUnraisable(err);
3878 res = 0;
3879 }
3880 if (!res) {
3881 res = PyObject_IsSubclass(err, exc_type2);
3882 if (unlikely(res == -1)) {
3883 PyErr_WriteUnraisable(err);
3884 res = 0;
3885 }
3886 }
3887 __Pyx_ErrRestore(exception, value, tb);
3888 return res;
3889 }
3890 #else
3891 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
3892 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
3893 if (!res) {
3894 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
3895 }
3896 return res;
3897 }
3898 #endif
3899 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
3900 Py_ssize_t i, n;
3901 assert(PyExceptionClass_Check(exc_type));
3902 n = PyTuple_GET_SIZE(tuple);
3903 #if PY_MAJOR_VERSION >= 3
3904 for (i=0; i<n; i++) {
3905 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
3906 }
3907 #endif
3908 for (i=0; i<n; i++) {
3909 PyObject *t = PyTuple_GET_ITEM(tuple, i);
3910 #if PY_MAJOR_VERSION < 3
3911 if (likely(exc_type == t)) return 1;
3912 #endif
3913 if (likely(PyExceptionClass_Check(t))) {
3914 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
3915 } else {
3916 }
3917 }
3918 return 0;
3919 }
3920 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
3921 if (likely(err == exc_type)) return 1;
3922 if (likely(PyExceptionClass_Check(err))) {
3923 if (likely(PyExceptionClass_Check(exc_type))) {
3924 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
3925 } else if (likely(PyTuple_Check(exc_type))) {
3926 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
3927 } else {
3928 }
3929 }
3930 return PyErr_GivenExceptionMatches(err, exc_type);
3931 }
3932 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
3933 assert(PyExceptionClass_Check(exc_type1));
3934 assert(PyExceptionClass_Check(exc_type2));
3935 if (likely(err == exc_type1 || err == exc_type2)) return 1;
3936 if (likely(PyExceptionClass_Check(err))) {
3937 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
3938 }
3939 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
3940 }
3941 #endif
3942
34553943 /* CheckBinaryVersion */
3456 static int __Pyx_check_binary_version(void) {
3944 static int __Pyx_check_binary_version(void) {
34573945 char ctversion[4], rtversion[4];
34583946 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
34593947 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
34693957 }
34703958
34713959 /* InitStrings */
3472 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
3960 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
34733961 while (t->p) {
34743962 #if PY_MAJOR_VERSION < 3
34753963 if (t->is_unicode) {
34943982 #endif
34953983 if (!*t->p)
34963984 return -1;
3985 if (PyObject_Hash(*t->p) == -1)
3986 return -1;
34973987 ++t;
34983988 }
34993989 return 0;
35023992 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
35033993 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
35043994 }
3505 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
3995 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
35063996 Py_ssize_t ignore;
35073997 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
35083998 }
3509 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
3510 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
3999 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
4000 #if !CYTHON_PEP393_ENABLED
4001 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
4002 char* defenc_c;
4003 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
4004 if (!defenc) return NULL;
4005 defenc_c = PyBytes_AS_STRING(defenc);
4006 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
4007 {
4008 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
4009 char* c;
4010 for (c = defenc_c; c < end; c++) {
4011 if ((unsigned char) (*c) >= 128) {
4012 PyUnicode_AsASCIIString(o);
4013 return NULL;
4014 }
4015 }
4016 }
4017 #endif
4018 *length = PyBytes_GET_SIZE(defenc);
4019 return defenc_c;
4020 }
4021 #else
4022 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
4023 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
4024 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
4025 if (likely(PyUnicode_IS_ASCII(o))) {
4026 *length = PyUnicode_GET_LENGTH(o);
4027 return PyUnicode_AsUTF8(o);
4028 } else {
4029 PyUnicode_AsASCIIString(o);
4030 return NULL;
4031 }
4032 #else
4033 return PyUnicode_AsUTF8AndSize(o, length);
4034 #endif
4035 }
4036 #endif
4037 #endif
4038 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
4039 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
35114040 if (
35124041 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
35134042 __Pyx_sys_getdefaultencoding_not_ascii &&
35144043 #endif
35154044 PyUnicode_Check(o)) {
3516 #if PY_VERSION_HEX < 0x03030000
3517 char* defenc_c;
3518 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
3519 if (!defenc) return NULL;
3520 defenc_c = PyBytes_AS_STRING(defenc);
3521 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
3522 {
3523 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
3524 char* c;
3525 for (c = defenc_c; c < end; c++) {
3526 if ((unsigned char) (*c) >= 128) {
3527 PyUnicode_AsASCIIString(o);
3528 return NULL;
3529 }
3530 }
3531 }
3532 #endif
3533 *length = PyBytes_GET_SIZE(defenc);
3534 return defenc_c;
3535 #else
3536 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
3537 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
3538 if (PyUnicode_IS_ASCII(o)) {
3539 *length = PyUnicode_GET_LENGTH(o);
3540 return PyUnicode_AsUTF8(o);
3541 } else {
3542 PyUnicode_AsASCIIString(o);
3543 return NULL;
3544 }
3545 #else
3546 return PyUnicode_AsUTF8AndSize(o, length);
3547 #endif
3548 #endif
4045 return __Pyx_PyUnicode_AsStringAndSize(o, length);
35494046 } else
35504047 #endif
35514048 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
35694066 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
35704067 else return PyObject_IsTrue(x);
35714068 }
4069 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
4070 #if PY_MAJOR_VERSION >= 3
4071 if (PyLong_Check(result)) {
4072 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
4073 "__int__ returned non-int (type %.200s). "
4074 "The ability to return an instance of a strict subclass of int "
4075 "is deprecated, and may be removed in a future version of Python.",
4076 Py_TYPE(result)->tp_name)) {
4077 Py_DECREF(result);
4078 return NULL;
4079 }
4080 return result;
4081 }
4082 #endif
4083 PyErr_Format(PyExc_TypeError,
4084 "__%.4s__ returned non-%.4s (type %.200s)",
4085 type_name, type_name, Py_TYPE(result)->tp_name);
4086 Py_DECREF(result);
4087 return NULL;
4088 }
35724089 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
35734090 #if CYTHON_USE_TYPE_SLOTS
35744091 PyNumberMethods *m;
35764093 const char *name = NULL;
35774094 PyObject *res = NULL;
35784095 #if PY_MAJOR_VERSION < 3
3579 if (PyInt_Check(x) || PyLong_Check(x))
3580 #else
3581 if (PyLong_Check(x))
4096 if (likely(PyInt_Check(x) || PyLong_Check(x)))
4097 #else
4098 if (likely(PyLong_Check(x)))
35824099 #endif
35834100 return __Pyx_NewRef(x);
35844101 #if CYTHON_USE_TYPE_SLOTS
35864103 #if PY_MAJOR_VERSION < 3
35874104 if (m && m->nb_int) {
35884105 name = "int";
3589 res = PyNumber_Int(x);
4106 res = m->nb_int(x);
35904107 }
35914108 else if (m && m->nb_long) {
35924109 name = "long";
3593 res = PyNumber_Long(x);
4110 res = m->nb_long(x);
35944111 }
35954112 #else
3596 if (m && m->nb_int) {
4113 if (likely(m && m->nb_int)) {
35974114 name = "int";
3598 res = PyNumber_Long(x);
4115 res = m->nb_int(x);
35994116 }
36004117 #endif
36014118 #else
3602 res = PyNumber_Int(x);
3603 #endif
3604 if (res) {
4119 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
4120 res = PyNumber_Int(x);
4121 }
4122 #endif
4123 if (likely(res)) {
36054124 #if PY_MAJOR_VERSION < 3
3606 if (!PyInt_Check(res) && !PyLong_Check(res)) {
3607 #else
3608 if (!PyLong_Check(res)) {
3609 #endif
3610 PyErr_Format(PyExc_TypeError,
3611 "__%.4s__ returned non-%.4s (type %.200s)",
3612 name, name, Py_TYPE(res)->tp_name);
3613 Py_DECREF(res);
3614 return NULL;
4125 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
4126 #else
4127 if (unlikely(!PyLong_CheckExact(res))) {
4128 #endif
4129 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
36154130 }
36164131 }
36174132 else if (!PyErr_Occurred()) {
36824197 Py_DECREF(x);
36834198 return ival;
36844199 }
4200 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
4201 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
4202 }
36854203 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
36864204 return PyInt_FromSize_t(ival);
36874205 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
88 #else
9 #define CYTHON_ABI "0_25_2"
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
102120 #define CYTHON_COMPILING_IN_CPYTHON 1
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
105129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412552
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
423555 #define __PYX_EXTERN_C extern "C"
428560
429561 #define __PYX_HAVE__pygame_sdl2__surface
430562 #define __PYX_HAVE_API__pygame_sdl2__surface
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
438571 #include <omp.h>
439572 #endif /* _OPENMP */
440573
441 #ifdef PYREX_WITHOUT_ASSERTIONS
574 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
442575 #define CYTHON_WITHOUT_ASSERTIONS
443576 #endif
444577
469602 #define __Pyx_sst_abs(value) abs(value)
470603 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
471604 #define __Pyx_sst_abs(value) labs(value)
472 #elif defined (_MSC_VER) && defined (_M_X64)
473 #define __Pyx_sst_abs(value) _abs64(value)
605 #elif defined (_MSC_VER)
606 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
474607 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
475608 #define __Pyx_sst_abs(value) llabs(value)
476609 #elif defined (__GNUC__)
478611 #else
479612 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
480613 #endif
481 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
482 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
614 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
615 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
483616 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
484617 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
485618 #define __Pyx_PyBytes_FromString PyBytes_FromString
492625 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
493626 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
494627 #endif
495 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
496 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
628 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
629 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
634 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
635 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
638 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
497639 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
498640 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
499641 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
500642 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
501643 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
502 #if PY_MAJOR_VERSION < 3
503 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
504 {
644 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
505645 const Py_UNICODE *u_end = u;
506646 while (*u_end++) ;
507647 return (size_t)(u_end - u - 1);
508648 }
509 #else
510 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
511 #endif
512649 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
513650 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
514651 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
515652 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
516653 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
517 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
654 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
518655 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
519656 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
657 #define __Pyx_PySequence_Tuple(obj)\
658 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
520659 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
521660 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
522661 #if CYTHON_ASSUME_SAFE_MACROS
615754 #define likely(x) (x)
616755 #define unlikely(x) (x)
617756 #endif /* __GNUC__ */
618
619 static PyObject *__pyx_m;
757 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
758
759 static PyObject *__pyx_m = NULL;
620760 static PyObject *__pyx_d;
621761 static PyObject *__pyx_b;
762 static PyObject *__pyx_cython_runtime = NULL;
622763 static PyObject *__pyx_empty_tuple;
623764 static PyObject *__pyx_empty_bytes;
624765 static PyObject *__pyx_empty_unicode;
630771
631772 static const char *__pyx_f[] = {
632773 "src/pygame_sdl2/surface.pyx",
774 "stringsource",
633775 "src/pygame_sdl2/color.pxd",
634776 "src/pygame_sdl2/rect.pxd",
635777 };
778 /* NoFastGil.proto */
779 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
780 #define __Pyx_PyGILState_Release PyGILState_Release
781 #define __Pyx_FastGIL_Remember()
782 #define __Pyx_FastGIL_Forget()
783 #define __Pyx_FastGilFuncInit()
784
785 /* ForceInitThreads.proto */
786 #ifndef __PYX_FORCE_INIT_THREADS
787 #define __PYX_FORCE_INIT_THREADS 0
788 #endif
789
636790
637791 /*--- Type declarations ---*/
638792 struct __pyx_obj_11pygame_sdl2_5color_Color;
806960
807961 /* PyObjectGetAttrStr.proto */
808962 #if CYTHON_USE_TYPE_SLOTS
809 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
810 PyTypeObject* tp = Py_TYPE(obj);
811 if (likely(tp->tp_getattro))
812 return tp->tp_getattro(obj, attr_name);
813 #if PY_MAJOR_VERSION < 3
814 if (likely(tp->tp_getattr))
815 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
816 #endif
817 return PyObject_GetAttr(obj, attr_name);
818 }
963 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
819964 #else
820965 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
821966 #endif
828973 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
829974
830975 /* KeywordStringCheck.proto */
831 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
976 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
832977
833978 /* GetModuleGlobalName.proto */
834979 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
843988 /* PyThreadStateGet.proto */
844989 #if CYTHON_FAST_THREAD_STATE
845990 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
846 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
991 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
992 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
847993 #else
848994 #define __Pyx_PyThreadState_declare
849995 #define __Pyx_PyThreadState_assign
996 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
850997 #endif
851998
852999 /* PyErrFetchRestore.proto */
8531000 #if CYTHON_FAST_THREAD_STATE
1001 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
8541002 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
8551003 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
8561004 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
8571005 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
8581006 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
8591007 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1008 #if CYTHON_COMPILING_IN_CPYTHON
1009 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
8601010 #else
1011 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1012 #endif
1013 #else
1014 #define __Pyx_PyErr_Clear() PyErr_Clear()
1015 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
8611016 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
8621017 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1018 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1019 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
8631020 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
8641021 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
8651022 #endif
9291086 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
9301087
9311088 /* ArgTypeTest.proto */
932 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
933 const char *name, int exact);
1089 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1090 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1091 __Pyx__ArgTypeTest(obj, type, name, exact))
1092 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
9341093
9351094 /* GetItemInt.proto */
9361095 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
9501109 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
9511110 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
9521111 int wraparound, int boundscheck);
953 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1112 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
9541113 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
9551114 int is_list, int wraparound, int boundscheck);
9561115
9731132
9741133 /* PyObjectCallMethod1.proto */
9751134 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
1135 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg);
9761136
9771137 /* append.proto */
9781138 static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);
9871147 static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
9881148
9891149 /* UnpackTuple2.proto */
990 static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
991 int is_tuple, int has_known_size, int decref_tuple);
1150 #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
1151 (likely(is_tuple || PyTuple_Check(tuple)) ?\
1152 (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
1153 __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
1154 (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
1155 __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
1156 static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
1157 PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
1158 static int __Pyx_unpack_tuple2_generic(
1159 PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);
9921160
9931161 /* dict_iter.proto */
9941162 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
9961164 static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
9971165 PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
9981166
1167 /* PyObject_GenericGetAttrNoDict.proto */
1168 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1169 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1170 #else
1171 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1172 #endif
1173
1174 /* PyObject_GenericGetAttr.proto */
1175 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1176 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1177 #else
1178 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1179 #endif
1180
9991181 /* SetVTable.proto */
10001182 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
10011183
1184 /* SetupReduce.proto */
1185 static int __Pyx_setup_reduce(PyObject* type_obj);
1186
10021187 /* GetVTable.proto */
10031188 static void* __Pyx_GetVtable(PyObject *dict);
10041189
10071192
10081193 /* ImportFrom.proto */
10091194 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1195
1196 /* CLineInTraceback.proto */
1197 #ifdef CYTHON_CLINE_IN_TRACEBACK
1198 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1199 #else
1200 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1201 #endif
10101202
10111203 /* CodeObjectCache.proto */
10121204 typedef struct {
10331225 /* CIntToPy.proto */
10341226 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);
10351227
1036 /* ForceInitThreads.proto */
1037 #ifndef __PYX_FORCE_INIT_THREADS
1038 #define __PYX_FORCE_INIT_THREADS 0
1039 #endif
1040
10411228 /* CIntToPy.proto */
10421229 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value);
10431230
10581245
10591246 /* CIntFromPy.proto */
10601247 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1248
1249 /* FastTypeChecks.proto */
1250 #if CYTHON_COMPILING_IN_CPYTHON
1251 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1252 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1253 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1254 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1255 #else
1256 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1257 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1258 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1259 #endif
1260 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
10611261
10621262 /* CheckBinaryVersion.proto */
10631263 static int __Pyx_check_binary_version(void);
11131313 static SDL_Surface *__pyx_f_11pygame_sdl2_7surface_PySurface_AsSurface(PyObject *); /*proto*/
11141314 static PyObject *__pyx_f_11pygame_sdl2_7surface_PySurface_New(SDL_Surface *); /*proto*/
11151315 #define __Pyx_MODULE_NAME "pygame_sdl2.surface"
1316 extern int __pyx_module_is_main_pygame_sdl2__surface;
11161317 int __pyx_module_is_main_pygame_sdl2__surface = 0;
11171318
11181319 /* Implementation of 'pygame_sdl2.surface' */
11191320 static PyObject *__pyx_builtin_IndexError;
11201321 static PyObject *__pyx_builtin_ValueError;
1322 static PyObject *__pyx_builtin_TypeError;
11211323 static const char __pyx_k_2[] = "2";
11221324 static const char __pyx_k_dx[] = "dx";
11231325 static const char __pyx_k_dy[] = "dy";
11291331 static const char __pyx_k_kind[] = "kind";
11301332 static const char __pyx_k_lock[] = "lock";
11311333 static const char __pyx_k_main[] = "__main__";
1334 static const char __pyx_k_name[] = "__name__";
11321335 static const char __pyx_k_rect[] = "rect";
11331336 static const char __pyx_k_size[] = "size";
11341337 static const char __pyx_k_test[] = "__test__";
11431346 static const char __pyx_k_append[] = "append";
11441347 static const char __pyx_k_format[] = "format";
11451348 static const char __pyx_k_import[] = "__import__";
1349 static const char __pyx_k_reduce[] = "__reduce__";
11461350 static const char __pyx_k_remove[] = "remove";
11471351 static const char __pyx_k_source[] = "source";
11481352 static const char __pyx_k_unlock[] = "unlock";
11521356 static const char __pyx_k_SRCALPHA[] = "SRCALPHA";
11531357 static const char __pyx_k_get_rect[] = "get_rect";
11541358 static const char __pyx_k_get_size[] = "get_size";
1359 static const char __pyx_k_getstate[] = "__getstate__";
1360 static const char __pyx_k_setstate[] = "__setstate__";
11551361 static const char __pyx_k_warnings[] = "warnings";
1362 static const char __pyx_k_TypeError[] = "TypeError";
11561363 static const char __pyx_k_get_alpha[] = "get_alpha";
11571364 static const char __pyx_k_min_alpha[] = "min_alpha";
1365 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
11581366 static const char __pyx_k_set_alpha[] = "set_alpha";
11591367 static const char __pyx_k_IndexError[] = "IndexError";
11601368 static const char __pyx_k_ValueError[] = "ValueError";
11651373 static const char __pyx_k_get_surface[] = "get_surface";
11661374 static const char __pyx_k_pygame_sdl2[] = "pygame_sdl2";
11671375 static const char __pyx_k_convert_alpha[] = "convert_alpha";
1376 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
11681377 static const char __pyx_k_special_flags[] = "special_flags";
1378 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
11691379 static const char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect";
11701380 static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error";
1381 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
11711382 static const char __pyx_k_pygame_sdl2_locals[] = "pygame_sdl2.locals";
11721383 static const char __pyx_k_Position_outside_surface[] = "Position outside surface.";
11731384 static const char __pyx_k_No_video_mode_has_been_set[] = "No video mode has been set.";
11761387 static const char __pyx_k_Surface_has_unsupported_bytesize[] = "Surface has unsupported bytesize.";
11771388 static const char __pyx_k_Surface_set_masks_is_not_support[] = "Surface.set_masks is not supported.";
11781389 static const char __pyx_k_Surface_set_shifts_is_not_suppor[] = "Surface.set_shifts is not supported.";
1390 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
11791391 static const char __pyx_k_subsurface_rectangle_outside_sur[] = "subsurface rectangle outside surface area.";
11801392 static const char __pyx_k_subsurface_size_must_be_non_nega[] = "subsurface size must be non-negative.";
11811393 static PyObject *__pyx_kp_u_2;
11901402 static PyObject *__pyx_kp_u_Surface_set_masks_is_not_support;
11911403 static PyObject *__pyx_kp_u_Surface_set_shifts_is_not_suppor;
11921404 static PyObject *__pyx_kp_u_Surface_x_x;
1405 static PyObject *__pyx_n_s_TypeError;
11931406 static PyObject *__pyx_n_s_ValueError;
11941407 static PyObject *__pyx_n_s_append;
11951408 static PyObject *__pyx_n_s_area;
11961409 static PyObject *__pyx_n_u_area;
1410 static PyObject *__pyx_n_s_cline_in_traceback;
11971411 static PyObject *__pyx_n_s_clip;
11981412 static PyObject *__pyx_n_s_color;
11991413 static PyObject *__pyx_n_s_convert;
12111425 static PyObject *__pyx_n_s_get_rect;
12121426 static PyObject *__pyx_n_s_get_size;
12131427 static PyObject *__pyx_n_s_get_surface;
1428 static PyObject *__pyx_n_s_getstate;
12141429 static PyObject *__pyx_n_s_import;
12151430 static PyObject *__pyx_n_s_items;
12161431 static PyObject *__pyx_n_s_kind;
12181433 static PyObject *__pyx_n_s_main;
12191434 static PyObject *__pyx_n_s_masks;
12201435 static PyObject *__pyx_n_s_min_alpha;
1436 static PyObject *__pyx_n_s_name;
1437 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
12211438 static PyObject *__pyx_n_s_pos;
12221439 static PyObject *__pyx_n_s_pygame_sdl2;
12231440 static PyObject *__pyx_n_s_pygame_sdl2_error;
12251442 static PyObject *__pyx_n_s_pygame_sdl2_rect;
12261443 static PyObject *__pyx_n_s_pyx_vtable;
12271444 static PyObject *__pyx_n_s_rect;
1445 static PyObject *__pyx_n_s_reduce;
1446 static PyObject *__pyx_n_s_reduce_cython;
1447 static PyObject *__pyx_n_s_reduce_ex;
12281448 static PyObject *__pyx_n_s_remove;
12291449 static PyObject *__pyx_n_s_set_alpha;
1450 static PyObject *__pyx_n_s_setstate;
1451 static PyObject *__pyx_n_s_setstate_cython;
12301452 static PyObject *__pyx_n_s_size;
12311453 static PyObject *__pyx_n_s_source;
12321454 static PyObject *__pyx_n_s_special_flags;
12901512 static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_94get_view(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_kind); /* proto */
12911513 static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_96get_buffer(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */
12921514 static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_15_pixels_address___get__(struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */
1515 static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_98__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self); /* proto */
1516 static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_100__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
12931517 static PyObject *__pyx_tp_new_11pygame_sdl2_7surface_Surface(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
12941518 static PyObject *__pyx_int_0;
12951519 static PyObject *__pyx_int_1;
13181542 static PyObject *__pyx_tuple__19;
13191543 static PyObject *__pyx_tuple__20;
13201544 static PyObject *__pyx_tuple__21;
1545 static PyObject *__pyx_tuple__22;
1546 static PyObject *__pyx_tuple__23;
1547 /* Late includes */
13211548
13221549 /* "pygame_sdl2/surface.pyx":37
13231550 * SDL_Surface * dst, SDL_Rect * dstrect, int the_args);
14121639 * src += srcpitch;
14131640 * dst += dstpitch;
14141641 */
1415 memmove(__pyx_v_dst, __pyx_v_src, __pyx_v_span);
1642 (void)(memmove(__pyx_v_dst, __pyx_v_src, __pyx_v_span));
14161643
14171644 /* "pygame_sdl2/surface.pyx":47
14181645 * h -= 1
17321959 __Pyx_XDECREF(__pyx_t_3);
17331960 __Pyx_XDECREF(__pyx_t_4);
17341961 __Pyx_XDECREF(__pyx_t_5);
1735 __Pyx_WriteUnraisable("pygame_sdl2.surface.Surface.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
1962 __Pyx_WriteUnraisable("pygame_sdl2.surface.Surface.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17361963 __pyx_L0:;
17371964 __Pyx_RefNannyFinishContext();
17381965 }
18692096 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18702097 switch (pos_args) {
18712098 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2099 CYTHON_FALLTHROUGH;
18722100 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2101 CYTHON_FALLTHROUGH;
18732102 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2103 CYTHON_FALLTHROUGH;
18742104 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2105 CYTHON_FALLTHROUGH;
18752106 case 0: break;
18762107 default: goto __pyx_L5_argtuple_error;
18772108 }
18782109 kw_args = PyDict_Size(__pyx_kwds);
18792110 switch (pos_args) {
18802111 case 0:
1881 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
2112 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
18822113 else goto __pyx_L5_argtuple_error;
2114 CYTHON_FALLTHROUGH;
18832115 case 1:
18842116 if (kw_args > 0) {
1885 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags);
2117 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags);
18862118 if (value) { values[1] = value; kw_args--; }
18872119 }
2120 CYTHON_FALLTHROUGH;
18882121 case 2:
18892122 if (kw_args > 0) {
1890 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_depth);
2123 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_depth);
18912124 if (value) { values[2] = value; kw_args--; }
18922125 }
2126 CYTHON_FALLTHROUGH;
18932127 case 3:
18942128 if (kw_args > 0) {
1895 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_masks);
2129 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_masks);
18962130 if (value) { values[3] = value; kw_args--; }
18972131 }
18982132 }
19022136 } else {
19032137 switch (PyTuple_GET_SIZE(__pyx_args)) {
19042138 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2139 CYTHON_FALLTHROUGH;
19052140 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2141 CYTHON_FALLTHROUGH;
19062142 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2143 CYTHON_FALLTHROUGH;
19072144 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19082145 break;
19092146 default: goto __pyx_L5_argtuple_error;
20572294 */
20582295 if ((likely(PyTuple_CheckExact(__pyx_v_size))) || (PyList_CheckExact(__pyx_v_size))) {
20592296 PyObject* sequence = __pyx_v_size;
2060 #if !CYTHON_COMPILING_IN_PYPY
2061 Py_ssize_t size = Py_SIZE(sequence);
2062 #else
2063 Py_ssize_t size = PySequence_Size(sequence);
2064 #endif
2297 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
20652298 if (unlikely(size != 2)) {
20662299 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
20672300 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
21622395 */
21632396 if ((likely(PyTuple_CheckExact(__pyx_v_masks))) || (PyList_CheckExact(__pyx_v_masks))) {
21642397 PyObject* sequence = __pyx_v_masks;
2165 #if !CYTHON_COMPILING_IN_PYPY
2166 Py_ssize_t size = Py_SIZE(sequence);
2167 #else
2168 Py_ssize_t size = PySequence_Size(sequence);
2169 #endif
2398 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
21702399 if (unlikely(size != 4)) {
21712400 if (size > 4) __Pyx_RaiseTooManyValuesError(4);
21722401 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
26572886 #ifdef WITH_THREAD
26582887 PyThreadState *_save;
26592888 Py_UNBLOCK_THREADS
2889 __Pyx_FastGIL_Remember();
26602890 #endif
26612891 /*try:*/ {
26622892
26802910 /*finally:*/ {
26812911 /*normal exit:*/{
26822912 #ifdef WITH_THREAD
2913 __Pyx_FastGIL_Forget();
26832914 Py_BLOCK_THREADS
26842915 #endif
26852916 goto __pyx_L17;
26962927 *
26972928 */
26982929 __pyx_t_2 = ((!(__pyx_v_surface != 0)) != 0);
2699 if (__pyx_t_2) {
2930 if (unlikely(__pyx_t_2)) {
27002931
27012932 /* "pygame_sdl2/surface.pyx":164
27022933 *
28373068 __Pyx_XDECREF(__pyx_t_1);
28383069 __Pyx_XDECREF(__pyx_t_2);
28393070 __Pyx_XDECREF(__pyx_t_3);
2840 __Pyx_WriteUnraisable("pygame_sdl2.surface.Surface.take_surface", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
3071 __Pyx_WriteUnraisable("pygame_sdl2.surface.Surface.take_surface", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
28413072 __pyx_L0:;
28423073 __Pyx_RefNannyFinishContext();
28433074 }
30023233 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
30033234 switch (pos_args) {
30043235 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3236 CYTHON_FALLTHROUGH;
30053237 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3238 CYTHON_FALLTHROUGH;
30063239 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3240 CYTHON_FALLTHROUGH;
30073241 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3242 CYTHON_FALLTHROUGH;
30083243 case 0: break;
30093244 default: goto __pyx_L5_argtuple_error;
30103245 }
30113246 kw_args = PyDict_Size(__pyx_kwds);
30123247 switch (pos_args) {
30133248 case 0:
3014 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
3249 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
30153250 else goto __pyx_L5_argtuple_error;
3251 CYTHON_FALLTHROUGH;
30163252 case 1:
3017 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dest)) != 0)) kw_args--;
3253 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dest)) != 0)) kw_args--;
30183254 else {
30193255 __Pyx_RaiseArgtupleInvalid("blit", 0, 2, 4, 1); __PYX_ERR(0, 179, __pyx_L3_error)
30203256 }
3257 CYTHON_FALLTHROUGH;
30213258 case 2:
30223259 if (kw_args > 0) {
3023 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_area);
3260 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_area);
30243261 if (value) { values[2] = value; kw_args--; }
30253262 }
3263 CYTHON_FALLTHROUGH;
30263264 case 3:
30273265 if (kw_args > 0) {
3028 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_special_flags);
3266 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_special_flags);
30293267 if (value) { values[3] = value; kw_args--; }
30303268 }
30313269 }
30353273 } else {
30363274 switch (PyTuple_GET_SIZE(__pyx_args)) {
30373275 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3276 CYTHON_FALLTHROUGH;
30383277 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3278 CYTHON_FALLTHROUGH;
30393279 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
30403280 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
30413281 break;
31353375 *
31363376 */
31373377 __pyx_t_1 = (SDL_GetSurfaceAlphaMod(__pyx_v_source->surface, (&__pyx_v_alpha)) != 0);
3138 if (__pyx_t_1) {
3378 if (unlikely(__pyx_t_1)) {
31393379
31403380 /* "pygame_sdl2/surface.pyx":195
31413381 * if not source.surface.format.Amask:
32933533 * temp = Surface(source.get_size(), SRCALPHA)
32943534 *
32953535 */
3296 SDL_SetSurfaceBlendMode(__pyx_v_source->surface, SDL_BLENDMODE_NONE);
3536 (void)(SDL_SetSurfaceBlendMode(__pyx_v_source->surface, SDL_BLENDMODE_NONE));
32973537
32983538 /* "pygame_sdl2/surface.pyx":204
32993539 *
33493589 #ifdef WITH_THREAD
33503590 PyThreadState *_save;
33513591 Py_UNBLOCK_THREADS
3592 __Pyx_FastGIL_Remember();
33523593 #endif
33533594 /*try:*/ {
33543595
33593600 *
33603601 * source = temp
33613602 */
3362 SDL_UpperBlit(__pyx_v_source->surface, NULL, __pyx_v_temp->surface, NULL);
3603 (void)(SDL_UpperBlit(__pyx_v_source->surface, NULL, __pyx_v_temp->surface, NULL));
33633604 }
33643605
33653606 /* "pygame_sdl2/surface.pyx":206
33723613 /*finally:*/ {
33733614 /*normal exit:*/{
33743615 #ifdef WITH_THREAD
3616 __Pyx_FastGIL_Forget();
33753617 Py_BLOCK_THREADS
33763618 #endif
33773619 goto __pyx_L12;
34343676 * else:
34353677 * SDL_SetSurfaceBlendMode(source.surface, SDL_BLENDMODE_BLEND)
34363678 */
3437 SDL_SetSurfaceBlendMode(__pyx_v_source->surface, SDL_BLENDMODE_NONE);
3679 (void)(SDL_SetSurfaceBlendMode(__pyx_v_source->surface, SDL_BLENDMODE_NONE));
34383680
34393681 /* "pygame_sdl2/surface.pyx":212
34403682 * colorkey = False
34543696 * to_sdl_rect(dest, &dest_rect, "dest")
34553697 */
34563698 /*else*/ {
3457 SDL_SetSurfaceBlendMode(__pyx_v_source->surface, SDL_BLENDMODE_BLEND);
3699 (void)(SDL_SetSurfaceBlendMode(__pyx_v_source->surface, SDL_BLENDMODE_BLEND));
34583700 }
34593701 __pyx_L13:;
34603702
34673709 */
34683710 __pyx_t_8.__pyx_n = 1;
34693711 __pyx_t_8.argname = __pyx_n_u_dest;
3470 __pyx_t_7 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_dest, (&__pyx_v_dest_rect), &__pyx_t_8); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 217, __pyx_L1_error)
3712 __pyx_t_7 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_dest, (&__pyx_v_dest_rect), &__pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 217, __pyx_L1_error)
34713713
34723714 /* "pygame_sdl2/surface.pyx":219
34733715 * to_sdl_rect(dest, &dest_rect, "dest")
34893731 */
34903732 __pyx_t_8.__pyx_n = 1;
34913733 __pyx_t_8.argname = __pyx_n_u_area;
3492 __pyx_t_7 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_area, (&__pyx_v_area_rect), &__pyx_t_8); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 220, __pyx_L1_error)
3734 __pyx_t_7 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_area, (&__pyx_v_area_rect), &__pyx_t_8); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 220, __pyx_L1_error)
34933735
34943736 /* "pygame_sdl2/surface.pyx":221
34953737 * if area is not None:
35203762 #ifdef WITH_THREAD
35213763 PyThreadState *_save;
35223764 Py_UNBLOCK_THREADS
3765 __Pyx_FastGIL_Remember();
35233766 #endif
35243767 /*try:*/ {
35253768
35833826 /*finally:*/ {
35843827 /*normal exit:*/{
35853828 #ifdef WITH_THREAD
3829 __Pyx_FastGIL_Forget();
35863830 Py_BLOCK_THREADS
35873831 #endif
35883832 goto __pyx_L17;
35993843 *
36003844 */
36013845 __pyx_t_5 = (__pyx_v_err != 0);
3602 if (__pyx_t_5) {
3846 if (unlikely(__pyx_t_5)) {
36033847
36043848 /* "pygame_sdl2/surface.pyx":231
36053849 *
38544098 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
38554099 switch (pos_args) {
38564100 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4101 CYTHON_FALLTHROUGH;
38574102 case 0: break;
38584103 default: goto __pyx_L5_argtuple_error;
38594104 }
38614106 switch (pos_args) {
38624107 case 0:
38634108 if (kw_args > 0) {
3864 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface);
4109 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface);
38654110 if (value) { values[0] = value; kw_args--; }
38664111 }
38674112 }
38714116 } else {
38724117 switch (PyTuple_GET_SIZE(__pyx_args)) {
38734118 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4119 CYTHON_FALLTHROUGH;
38744120 case 0: break;
38754121 default: goto __pyx_L5_argtuple_error;
38764122 }
39794225 */
39804226 __pyx_t_2 = (__pyx_v_surface == Py_None);
39814227 __pyx_t_1 = (__pyx_t_2 != 0);
3982 if (__pyx_t_1) {
4228 if (unlikely(__pyx_t_1)) {
39834229
39844230 /* "pygame_sdl2/surface.pyx":241
39854231 *
40464292 #ifdef WITH_THREAD
40474293 PyThreadState *_save;
40484294 Py_UNBLOCK_THREADS
4295 __Pyx_FastGIL_Remember();
40494296 #endif
40504297 /*try:*/ {
40514298
40694316 /*finally:*/ {
40704317 /*normal exit:*/{
40714318 #ifdef WITH_THREAD
4319 __Pyx_FastGIL_Forget();
40724320 Py_BLOCK_THREADS
40734321 #endif
40744322 goto __pyx_L8;
41474395 #ifdef WITH_THREAD
41484396 PyThreadState *_save;
41494397 Py_UNBLOCK_THREADS
4398 __Pyx_FastGIL_Remember();
41504399 #endif
41514400 /*try:*/ {
41524401
41704419 /*finally:*/ {
41714420 /*normal exit:*/{
41724421 #ifdef WITH_THREAD
4422 __Pyx_FastGIL_Forget();
41734423 Py_BLOCK_THREADS
41744424 #endif
41754425 goto __pyx_L11;
42604510 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
42614511 switch (pos_args) {
42624512 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4513 CYTHON_FALLTHROUGH;
42634514 case 0: break;
42644515 default: goto __pyx_L5_argtuple_error;
42654516 }
42674518 switch (pos_args) {
42684519 case 0:
42694520 if (kw_args > 0) {
4270 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface);
4521 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface);
42714522 if (value) { values[0] = value; kw_args--; }
42724523 }
42734524 }
42774528 } else {
42784529 switch (PyTuple_GET_SIZE(__pyx_args)) {
42794530 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4531 CYTHON_FALLTHROUGH;
42804532 case 0: break;
42814533 default: goto __pyx_L5_argtuple_error;
42824534 }
43914643 */
43924644 __pyx_t_2 = (((PyObject *)__pyx_v_surface) == Py_None);
43934645 __pyx_t_1 = (__pyx_t_2 != 0);
4394 if (__pyx_t_1) {
4646 if (unlikely(__pyx_t_1)) {
43954647
43964648 /* "pygame_sdl2/surface.pyx":282
43974649 *
44944746 #ifdef WITH_THREAD
44954747 PyThreadState *_save;
44964748 Py_UNBLOCK_THREADS
4749 __Pyx_FastGIL_Remember();
44974750 #endif
44984751 /*try:*/ {
44994752
45174770 /*finally:*/ {
45184771 /*normal exit:*/{
45194772 #ifdef WITH_THREAD
4773 __Pyx_FastGIL_Forget();
45204774 Py_BLOCK_THREADS
45214775 #endif
45224776 goto __pyx_L8;
46214875 #ifdef WITH_THREAD
46224876 PyThreadState *_save;
46234877 Py_UNBLOCK_THREADS
4878 __Pyx_FastGIL_Remember();
46244879 #endif
46254880 /*try:*/ {
46264881
46444899 /*finally:*/ {
46454900 /*normal exit:*/{
46464901 #ifdef WITH_THREAD
4902 __Pyx_FastGIL_Forget();
46474903 Py_BLOCK_THREADS
46484904 #endif
46494905 goto __pyx_L12;
49255181 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
49265182 switch (pos_args) {
49275183 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5184 CYTHON_FALLTHROUGH;
49285185 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5186 CYTHON_FALLTHROUGH;
49295187 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5188 CYTHON_FALLTHROUGH;
49305189 case 0: break;
49315190 default: goto __pyx_L5_argtuple_error;
49325191 }
49335192 kw_args = PyDict_Size(__pyx_kwds);
49345193 switch (pos_args) {
49355194 case 0:
4936 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
5195 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
49375196 else goto __pyx_L5_argtuple_error;
5197 CYTHON_FALLTHROUGH;
49385198 case 1:
49395199 if (kw_args > 0) {
4940 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect);
5200 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rect);
49415201 if (value) { values[1] = value; kw_args--; }
49425202 }
5203 CYTHON_FALLTHROUGH;
49435204 case 2:
49445205 if (kw_args > 0) {
4945 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_special_flags);
5206 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_special_flags);
49465207 if (value) { values[2] = value; kw_args--; }
49475208 }
49485209 }
49525213 } else {
49535214 switch (PyTuple_GET_SIZE(__pyx_args)) {
49545215 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5216 CYTHON_FALLTHROUGH;
49555217 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5218 CYTHON_FALLTHROUGH;
49565219 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
49575220 break;
49585221 default: goto __pyx_L5_argtuple_error;
50045267 * cdef int err
50055268 *
50065269 */
5007 __pyx_t_1 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_1 == 0xaabbccdd && PyErr_Occurred())) __PYX_ERR(0, 328, __pyx_L1_error)
5270 __pyx_t_1 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_1 == ((Uint32)0xaabbccdd) && PyErr_Occurred())) __PYX_ERR(0, 328, __pyx_L1_error)
50085271 __pyx_v_pixel = __pyx_t_1;
50095272
50105273 /* "pygame_sdl2/surface.pyx":331
50255288 *
50265289 * if sdl_rect.x < 0:
50275290 */
5028 __pyx_t_4 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 332, __pyx_L1_error)
5291 __pyx_t_4 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 332, __pyx_L1_error)
50295292
50305293 /* "pygame_sdl2/surface.pyx":334
50315294 * to_sdl_rect(rect, &sdl_rect)
51565419 #ifdef WITH_THREAD
51575420 PyThreadState *_save;
51585421 Py_UNBLOCK_THREADS
5422 __Pyx_FastGIL_Remember();
51595423 #endif
51605424 /*try:*/ {
51615425
51795443 /*finally:*/ {
51805444 /*normal exit:*/{
51815445 #ifdef WITH_THREAD
5446 __Pyx_FastGIL_Forget();
51825447 Py_BLOCK_THREADS
51835448 #endif
51845449 goto __pyx_L11;
51955460 *
51965461 */
51975462 __pyx_t_3 = (__pyx_v_err != 0);
5198 if (__pyx_t_3) {
5463 if (unlikely(__pyx_t_3)) {
51995464
52005465 /* "pygame_sdl2/surface.pyx":349
52015466 *
53395604 #ifdef WITH_THREAD
53405605 PyThreadState *_save;
53415606 Py_UNBLOCK_THREADS
5607 __Pyx_FastGIL_Remember();
53425608 #endif
53435609 /*try:*/ {
53445610
53625628 /*finally:*/ {
53635629 /*normal exit:*/{
53645630 #ifdef WITH_THREAD
5631 __Pyx_FastGIL_Forget();
53655632 Py_BLOCK_THREADS
53665633 #endif
53675634 goto __pyx_L15;
53785645 *
53795646 */
53805647 __pyx_t_3 = (__pyx_v_err != 0);
5381 if (__pyx_t_3) {
5648 if (unlikely(__pyx_t_3)) {
53825649
53835650 /* "pygame_sdl2/surface.pyx":358
53845651 *
55445811 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
55455812 switch (pos_args) {
55465813 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5814 CYTHON_FALLTHROUGH;
55475815 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5816 CYTHON_FALLTHROUGH;
55485817 case 0: break;
55495818 default: goto __pyx_L5_argtuple_error;
55505819 }
55525821 switch (pos_args) {
55535822 case 0:
55545823 if (kw_args > 0) {
5555 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dx);
5824 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dx);
55565825 if (value) { values[0] = value; kw_args--; }
55575826 }
5827 CYTHON_FALLTHROUGH;
55585828 case 1:
55595829 if (kw_args > 0) {
5560 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dy);
5830 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dy);
55615831 if (value) { values[1] = value; kw_args--; }
55625832 }
55635833 }
55675837 } else {
55685838 switch (PyTuple_GET_SIZE(__pyx_args)) {
55695839 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5840 CYTHON_FALLTHROUGH;
55705841 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5842 CYTHON_FALLTHROUGH;
55715843 case 0: break;
55725844 default: goto __pyx_L5_argtuple_error;
55735845 }
58806152 #ifdef WITH_THREAD
58816153 PyThreadState *_save;
58826154 Py_UNBLOCK_THREADS
6155 __Pyx_FastGIL_Remember();
58836156 #endif
58846157 /*try:*/ {
58856158
59036176 /*finally:*/ {
59046177 /*normal exit:*/{
59056178 #ifdef WITH_THREAD
6179 __Pyx_FastGIL_Forget();
59066180 Py_BLOCK_THREADS
59076181 #endif
59086182 goto __pyx_L7;
59886262 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
59896263 switch (pos_args) {
59906264 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6265 CYTHON_FALLTHROUGH;
59916266 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6267 CYTHON_FALLTHROUGH;
59926268 case 0: break;
59936269 default: goto __pyx_L5_argtuple_error;
59946270 }
59956271 kw_args = PyDict_Size(__pyx_kwds);
59966272 switch (pos_args) {
59976273 case 0:
5998 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
6274 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
59996275 else goto __pyx_L5_argtuple_error;
6276 CYTHON_FALLTHROUGH;
60006277 case 1:
60016278 if (kw_args > 0) {
6002 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags);
6279 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags);
60036280 if (value) { values[1] = value; kw_args--; }
60046281 }
60056282 }
60096286 } else {
60106287 switch (PyTuple_GET_SIZE(__pyx_args)) {
60116288 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6289 CYTHON_FALLTHROUGH;
60126290 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
60136291 break;
60146292 default: goto __pyx_L5_argtuple_error;
60626340 *
60636341 */
60646342 __pyx_t_2 = (SDL_SetColorKey(__pyx_v_self->surface, SDL_FALSE, 0) != 0);
6065 if (__pyx_t_2) {
6343 if (unlikely(__pyx_t_2)) {
60666344
60676345 /* "pygame_sdl2/surface.pyx":413
60686346 * if color is None:
61226400 *
61236401 */
61246402 /*else*/ {
6125 __pyx_t_6 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_6 == 0xaabbccdd && PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L1_error)
6403 __pyx_t_6 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_6 == ((Uint32)0xaabbccdd) && PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L1_error)
61266404 __pyx_t_2 = (SDL_SetColorKey(__pyx_v_self->surface, SDL_TRUE, __pyx_t_6) != 0);
6127 if (__pyx_t_2) {
6405 if (unlikely(__pyx_t_2)) {
61286406
61296407 /* "pygame_sdl2/surface.pyx":417
61306408 * else:
62386516 * return get_color(key, self.surface)
62396517 */
62406518 __Pyx_XDECREF(__pyx_r);
6241 __Pyx_INCREF(Py_None);
6242 __pyx_r = Py_None;
6519 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
62436520 goto __pyx_L0;
62446521
62456522 /* "pygame_sdl2/surface.pyx":422
63096586 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
63106587 switch (pos_args) {
63116588 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6589 CYTHON_FALLTHROUGH;
63126590 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6591 CYTHON_FALLTHROUGH;
63136592 case 0: break;
63146593 default: goto __pyx_L5_argtuple_error;
63156594 }
63166595 kw_args = PyDict_Size(__pyx_kwds);
63176596 switch (pos_args) {
63186597 case 0:
6319 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
6598 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
63206599 else goto __pyx_L5_argtuple_error;
6600 CYTHON_FALLTHROUGH;
63216601 case 1:
63226602 if (kw_args > 0) {
6323 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags);
6603 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags);
63246604 if (value) { values[1] = value; kw_args--; }
63256605 }
63266606 }
63306610 } else {
63316611 switch (PyTuple_GET_SIZE(__pyx_args)) {
63326612 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6613 CYTHON_FALLTHROUGH;
63336614 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
63346615 break;
63356616 default: goto __pyx_L5_argtuple_error;
64266707 */
64276708 __pyx_t_3 = __Pyx_PyInt_As_uint8_t(__pyx_v_value); if (unlikely((__pyx_t_3 == ((Uint8)-1)) && PyErr_Occurred())) __PYX_ERR(0, 434, __pyx_L1_error)
64286709 __pyx_t_2 = (SDL_SetSurfaceAlphaMod(__pyx_v_self->surface, __pyx_t_3) != 0);
6429 if (__pyx_t_2) {
6710 if (unlikely(__pyx_t_2)) {
64306711
64316712 /* "pygame_sdl2/surface.pyx":435
64326713 *
65506831 *
65516832 */
65526833 __pyx_t_1 = (SDL_GetSurfaceAlphaMod(__pyx_v_self->surface, (&__pyx_v_rv)) != 0);
6553 if (__pyx_t_1) {
6834 if (unlikely(__pyx_t_1)) {
65546835
65556836 /* "pygame_sdl2/surface.pyx":443
65566837 *
66246905 */
66256906 /*else*/ {
66266907 __Pyx_XDECREF(__pyx_r);
6627 __Pyx_INCREF(Py_None);
6628 __pyx_r = Py_None;
6908 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
66296909 goto __pyx_L0;
66306910 }
66316911
66746954 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
66756955 switch (pos_args) {
66766956 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6957 CYTHON_FALLTHROUGH;
66776958 case 0: break;
66786959 default: goto __pyx_L5_argtuple_error;
66796960 }
66816962 switch (pos_args) {
66826963 case 0:
66836964 if (kw_args > 0) {
6684 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lock);
6965 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lock);
66856966 if (value) { values[0] = value; kw_args--; }
66866967 }
66876968 }
66916972 } else {
66926973 switch (PyTuple_GET_SIZE(__pyx_args)) {
66936974 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6975 CYTHON_FALLTHROUGH;
66946976 case 0: break;
66956977 default: goto __pyx_L5_argtuple_error;
66966978 }
68297111 *
68307112 * SDL_LockSurface(root.surface)
68317113 */
6832 __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_root->locklist, __pyx_v_lock); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 462, __pyx_L1_error)
7114 __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_root->locklist, __pyx_v_lock); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 462, __pyx_L1_error)
68337115
68347116 /* "pygame_sdl2/surface.pyx":464
68357117 * root.locklist.append(lock)
68387120 *
68397121 * def unlock(self, lock=None):
68407122 */
6841 SDL_LockSurface(__pyx_v_root->surface);
7123 (void)(SDL_LockSurface(__pyx_v_root->surface));
68427124
68437125 /* "pygame_sdl2/surface.pyx":450
68447126 * return None
68877169 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
68887170 switch (pos_args) {
68897171 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7172 CYTHON_FALLTHROUGH;
68907173 case 0: break;
68917174 default: goto __pyx_L5_argtuple_error;
68927175 }
68947177 switch (pos_args) {
68957178 case 0:
68967179 if (kw_args > 0) {
6897 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lock);
7180 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lock);
68987181 if (value) { values[0] = value; kw_args--; }
68997182 }
69007183 }
69047187 } else {
69057188 switch (PyTuple_GET_SIZE(__pyx_args)) {
69067189 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7190 CYTHON_FALLTHROUGH;
69077191 case 0: break;
69087192 default: goto __pyx_L5_argtuple_error;
69097193 }
74807764 */
74817765 if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) {
74827766 PyObject* sequence = __pyx_v_pos;
7483 #if !CYTHON_COMPILING_IN_PYPY
7484 Py_ssize_t size = Py_SIZE(sequence);
7485 #else
7486 Py_ssize_t size = PySequence_Size(sequence);
7487 #endif
7767 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
74887768 if (unlikely(size != 2)) {
74897769 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
74907770 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
75577837 __pyx_t_8 = ((!(__pyx_t_9 != 0)) != 0);
75587838 __pyx_t_7 = __pyx_t_8;
75597839 __pyx_L6_bool_binop_done:;
7560 if (__pyx_t_7) {
7840 if (unlikely(__pyx_t_7)) {
75617841
75627842 /* "pygame_sdl2/surface.pyx":512
75637843 *
75897869 *
75907870 */
75917871 __pyx_t_7 = ((__pyx_v_self->surface->format->BytesPerPixel != 4) != 0);
7592 if (__pyx_t_7) {
7872 if (unlikely(__pyx_t_7)) {
75937873
75947874 /* "pygame_sdl2/surface.pyx":515
75957875 *
77698049 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
77708050 switch (pos_args) {
77718051 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8052 CYTHON_FALLTHROUGH;
77728053 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8054 CYTHON_FALLTHROUGH;
77738055 case 0: break;
77748056 default: goto __pyx_L5_argtuple_error;
77758057 }
77768058 kw_args = PyDict_Size(__pyx_kwds);
77778059 switch (pos_args) {
77788060 case 0:
7779 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--;
8061 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--;
77808062 else goto __pyx_L5_argtuple_error;
8063 CYTHON_FALLTHROUGH;
77818064 case 1:
7782 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
8065 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
77838066 else {
77848067 __Pyx_RaiseArgtupleInvalid("set_at", 1, 2, 2, 1); __PYX_ERR(0, 529, __pyx_L3_error)
77858068 }
78398122 */
78408123 if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) {
78418124 PyObject* sequence = __pyx_v_pos;
7842 #if !CYTHON_COMPILING_IN_PYPY
7843 Py_ssize_t size = Py_SIZE(sequence);
7844 #else
7845 Py_ssize_t size = PySequence_Size(sequence);
7846 #endif
8125 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
78478126 if (unlikely(size != 2)) {
78488127 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
78498128 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
79168195 __pyx_t_8 = ((!(__pyx_t_9 != 0)) != 0);
79178196 __pyx_t_7 = __pyx_t_8;
79188197 __pyx_L6_bool_binop_done:;
7919 if (__pyx_t_7) {
8198 if (unlikely(__pyx_t_7)) {
79208199
79218200 /* "pygame_sdl2/surface.pyx":537
79228201 *
79488227 *
79498228 */
79508229 __pyx_t_7 = ((__pyx_v_self->surface->format->BytesPerPixel != 4) != 0);
7951 if (__pyx_t_7) {
8230 if (unlikely(__pyx_t_7)) {
79528231
79538232 /* "pygame_sdl2/surface.pyx":540
79548233 *
79828261 *
79838262 * self.lock()
79848263 */
7985 __pyx_t_10 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_10 == 0xaabbccdd && PyErr_Occurred())) __PYX_ERR(0, 542, __pyx_L1_error)
8264 __pyx_t_10 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_10 == ((Uint32)0xaabbccdd) && PyErr_Occurred())) __PYX_ERR(0, 542, __pyx_L1_error)
79868265 __pyx_v_pixel = __pyx_t_10;
79878266
79888267 /* "pygame_sdl2/surface.pyx":544
81508429 */
81518430 if ((likely(PyTuple_CheckExact(__pyx_v_pos))) || (PyList_CheckExact(__pyx_v_pos))) {
81528431 PyObject* sequence = __pyx_v_pos;
8153 #if !CYTHON_COMPILING_IN_PYPY
8154 Py_ssize_t size = Py_SIZE(sequence);
8155 #else
8156 Py_ssize_t size = PySequence_Size(sequence);
8157 #endif
8432 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
81588433 if (unlikely(size != 2)) {
81598434 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
81608435 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
82278502 __pyx_t_8 = ((!(__pyx_t_9 != 0)) != 0);
82288503 __pyx_t_7 = __pyx_t_8;
82298504 __pyx_L6_bool_binop_done:;
8230 if (__pyx_t_7) {
8505 if (unlikely(__pyx_t_7)) {
82318506
82328507 /* "pygame_sdl2/surface.pyx":561
82338508 *
82598534 *
82608535 */
82618536 __pyx_t_7 = ((__pyx_v_self->surface->format->BytesPerPixel != 4) != 0);
8262 if (__pyx_t_7) {
8537 if (unlikely(__pyx_t_7)) {
82638538
82648539 /* "pygame_sdl2/surface.pyx":564
82658540 *
84518726 * def unmap_rgb(self, pixel):
84528727 */
84538728 __Pyx_XDECREF(__pyx_r);
8454 __pyx_t_1 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_1 == 0xaabbccdd && PyErr_Occurred())) __PYX_ERR(0, 579, __pyx_L1_error)
8729 __pyx_t_1 = __pyx_f_11pygame_sdl2_5color_map_color(__pyx_v_self->surface, __pyx_v_color); if (unlikely(__pyx_t_1 == ((Uint32)0xaabbccdd) && PyErr_Occurred())) __PYX_ERR(0, 579, __pyx_L1_error)
84558730 __pyx_t_2 = __Pyx_PyInt_From_uint32_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error)
84568731 __Pyx_GOTREF(__pyx_t_2);
84578732 __pyx_r = __pyx_t_2;
85878862 * else:
85888863 * to_sdl_rect(rect, &sdl_rect)
85898864 */
8590 SDL_SetClipRect(__pyx_v_self->surface, NULL);
8865 (void)(SDL_SetClipRect(__pyx_v_self->surface, NULL));
85918866
85928867 /* "pygame_sdl2/surface.pyx":587
85938868 * cdef SDL_Rect sdl_rect
86078882 *
86088883 */
86098884 /*else*/ {
8610 __pyx_t_3 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 590, __pyx_L1_error)
8885 __pyx_t_3 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_rect, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 590, __pyx_L1_error)
86118886
86128887 /* "pygame_sdl2/surface.pyx":591
86138888 * else:
86168891 *
86178892 * def get_clip(self):
86188893 */
8619 SDL_SetClipRect(__pyx_v_self->surface, (&__pyx_v_sdl_rect));
8894 (void)(SDL_SetClipRect(__pyx_v_self->surface, (&__pyx_v_sdl_rect)));
86208895 }
86218896 __pyx_L3:;
86228897
87899064 * to_sdl_rect(args[0], &sdl_rect)
87909065 * else:
87919066 */
8792 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 603, __pyx_L1_error)
9067 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 603, __pyx_L1_error)
87939068 __pyx_t_2 = ((__pyx_t_1 == 1) != 0);
87949069 if (__pyx_t_2) {
87959070
88029077 */
88039078 __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error)
88049079 __Pyx_GOTREF(__pyx_t_3);
8805 __pyx_t_4 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_3, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 604, __pyx_L1_error)
9080 __pyx_t_4 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_t_3, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 604, __pyx_L1_error)
88069081 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
88079082
88089083 /* "pygame_sdl2/surface.pyx":603
88239098 * if sdl_rect.w < 0 or sdl_rect.h < 0:
88249099 */
88259100 /*else*/ {
8826 __pyx_t_4 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_args, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 606, __pyx_L1_error)
9101 __pyx_t_4 = __pyx_f_11pygame_sdl2_4rect_to_sdl_rect(__pyx_v_args, (&__pyx_v_sdl_rect), NULL); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 606, __pyx_L1_error)
88279102 }
88289103 __pyx_L3:;
88299104
88439118 __pyx_t_5 = ((__pyx_v_sdl_rect.h < 0) != 0);
88449119 __pyx_t_2 = __pyx_t_5;
88459120 __pyx_L5_bool_binop_done:;
8846 if (__pyx_t_2) {
9121 if (unlikely(__pyx_t_2)) {
88479122
88489123 /* "pygame_sdl2/surface.pyx":609
88499124 *
89309205 * or (sdl_rect.y < 0)
89319206 * or (sdl_rect.x + sdl_rect.w > self.surface.w)
89329207 */
8933 if (__pyx_t_2) {
9208 if (unlikely(__pyx_t_2)) {
89349209
89359210 /* "pygame_sdl2/surface.pyx":616
89369211 * or (sdl_rect.y + sdl_rect.h > self.surface.h)):
989710172 *
989810173 * return rv
989910174 */
9900 __pyx_t_10 = PyObject_SetAttr(__pyx_v_rv, __pyx_v_k, __pyx_v_v); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 685, __pyx_L1_error)
10175 __pyx_t_10 = PyObject_SetAttr(__pyx_v_rv, __pyx_v_k, __pyx_v_v); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 685, __pyx_L1_error)
990110176 }
990210177 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
990310178
1084711122 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1084811123 switch (pos_args) {
1084911124 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11125 CYTHON_FALLTHROUGH;
1085011126 case 0: break;
1085111127 default: goto __pyx_L5_argtuple_error;
1085211128 }
1085411130 switch (pos_args) {
1085511131 case 0:
1085611132 if (kw_args > 0) {
10857 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_alpha);
11133 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_min_alpha);
1085811134 if (value) { values[0] = value; kw_args--; }
1085911135 }
1086011136 }
1086411140 } else {
1086511141 switch (PyTuple_GET_SIZE(__pyx_args)) {
1086611142 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11143 CYTHON_FALLTHROUGH;
1086711144 case 0: break;
1086811145 default: goto __pyx_L5_argtuple_error;
1086911146 }
1114311420 #ifdef WITH_THREAD
1114411421 PyThreadState *_save;
1114511422 Py_UNBLOCK_THREADS
11423 __Pyx_FastGIL_Remember();
1114611424 #endif
1114711425 /*try:*/ {
1114811426
1140411682 /*finally:*/ {
1140511683 /*normal exit:*/{
1140611684 #ifdef WITH_THREAD
11685 __Pyx_FastGIL_Forget();
1140711686 Py_BLOCK_THREADS
1140811687 #endif
1140911688 goto __pyx_L9;
1165811937 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1165911938 switch (pos_args) {
1166011939 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11940 CYTHON_FALLTHROUGH;
1166111941 case 0: break;
1166211942 default: goto __pyx_L5_argtuple_error;
1166311943 }
1166511945 switch (pos_args) {
1166611946 case 0:
1166711947 if (kw_args > 0) {
11668 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kind);
11948 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kind);
1166911949 if (value) { values[0] = value; kw_args--; }
1167011950 }
1167111951 }
1167511955 } else {
1167611956 switch (PyTuple_GET_SIZE(__pyx_args)) {
1167711957 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11958 CYTHON_FALLTHROUGH;
1167811959 case 0: break;
1167911960 default: goto __pyx_L5_argtuple_error;
1168011961 }
1186812149 return __pyx_r;
1186912150 }
1187012151
12152 /* "(tree fragment)":1
12153 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
12154 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12155 * def __setstate_cython__(self, __pyx_state):
12156 */
12157
12158 /* Python wrapper */
12159 static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_99__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
12160 static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_99__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
12161 PyObject *__pyx_r = 0;
12162 __Pyx_RefNannyDeclarations
12163 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
12164 __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_98__reduce_cython__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self));
12165
12166 /* function exit code */
12167 __Pyx_RefNannyFinishContext();
12168 return __pyx_r;
12169 }
12170
12171 static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_98__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self) {
12172 PyObject *__pyx_r = NULL;
12173 __Pyx_RefNannyDeclarations
12174 PyObject *__pyx_t_1 = NULL;
12175 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
12176
12177 /* "(tree fragment)":2
12178 * def __reduce_cython__(self):
12179 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
12180 * def __setstate_cython__(self, __pyx_state):
12181 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12182 */
12183 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
12184 __Pyx_GOTREF(__pyx_t_1);
12185 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
12186 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12187 __PYX_ERR(1, 2, __pyx_L1_error)
12188
12189 /* "(tree fragment)":1
12190 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
12191 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12192 * def __setstate_cython__(self, __pyx_state):
12193 */
12194
12195 /* function exit code */
12196 __pyx_L1_error:;
12197 __Pyx_XDECREF(__pyx_t_1);
12198 __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12199 __pyx_r = NULL;
12200 __Pyx_XGIVEREF(__pyx_r);
12201 __Pyx_RefNannyFinishContext();
12202 return __pyx_r;
12203 }
12204
12205 /* "(tree fragment)":3
12206 * def __reduce_cython__(self):
12207 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12208 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12209 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12210 */
12211
12212 /* Python wrapper */
12213 static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_101__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
12214 static PyObject *__pyx_pw_11pygame_sdl2_7surface_7Surface_101__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
12215 PyObject *__pyx_r = 0;
12216 __Pyx_RefNannyDeclarations
12217 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
12218 __pyx_r = __pyx_pf_11pygame_sdl2_7surface_7Surface_100__setstate_cython__(((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
12219
12220 /* function exit code */
12221 __Pyx_RefNannyFinishContext();
12222 return __pyx_r;
12223 }
12224
12225 static PyObject *__pyx_pf_11pygame_sdl2_7surface_7Surface_100__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_7surface_Surface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
12226 PyObject *__pyx_r = NULL;
12227 __Pyx_RefNannyDeclarations
12228 PyObject *__pyx_t_1 = NULL;
12229 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
12230
12231 /* "(tree fragment)":4
12232 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12233 * def __setstate_cython__(self, __pyx_state):
12234 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
12235 */
12236 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
12237 __Pyx_GOTREF(__pyx_t_1);
12238 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
12239 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12240 __PYX_ERR(1, 4, __pyx_L1_error)
12241
12242 /* "(tree fragment)":3
12243 * def __reduce_cython__(self):
12244 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12245 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12246 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12247 */
12248
12249 /* function exit code */
12250 __pyx_L1_error:;
12251 __Pyx_XDECREF(__pyx_t_1);
12252 __Pyx_AddTraceback("pygame_sdl2.surface.Surface.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12253 __pyx_r = NULL;
12254 __Pyx_XGIVEREF(__pyx_r);
12255 __Pyx_RefNannyFinishContext();
12256 return __pyx_r;
12257 }
12258
1187112259 /* "pygame_sdl2/surface.pyx":818
1187212260 *
1187312261 *
1192712315 * rv.take_surface(surf)
1192812316 * return rv
1192912317 */
11930 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error)
12318 __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_7surface_Surface), __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error)
1193112319 __Pyx_GOTREF(__pyx_t_1);
1193212320 __pyx_v_rv = ((struct __pyx_obj_11pygame_sdl2_7surface_Surface *)__pyx_t_1);
1193312321 __pyx_t_1 = 0;
1199512383
1199612384 static void __pyx_tp_dealloc_11pygame_sdl2_7surface_Surface(PyObject *o) {
1199712385 struct __pyx_obj_11pygame_sdl2_7surface_Surface *p = (struct __pyx_obj_11pygame_sdl2_7surface_Surface *)o;
11998 #if PY_VERSION_HEX >= 0x030400a1
11999 if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
12386 #if CYTHON_USE_TP_FINALIZE
12387 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
1200012388 if (PyObject_CallFinalizerFromDealloc(o)) return;
1200112389 }
1200212390 #endif
1202412412 e = (*v)(p->locklist, a); if (e) return e;
1202512413 }
1202612414 if (p->parent) {
12027 e = (*v)(((PyObject*)p->parent), a); if (e) return e;
12415 e = (*v)(((PyObject *)p->parent), a); if (e) return e;
1202812416 }
1202912417 if (p->root) {
12030 e = (*v)(((PyObject*)p->root), a); if (e) return e;
12418 e = (*v)(((PyObject *)p->root), a); if (e) return e;
1203112419 }
1203212420 if (p->get_window_flags) {
1203312421 e = (*v)(p->get_window_flags, a); if (e) return e;
1210312491 {"get_bounding_rect", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_93get_bounding_rect, METH_VARARGS|METH_KEYWORDS, 0},
1210412492 {"get_view", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_95get_view, METH_VARARGS|METH_KEYWORDS, 0},
1210512493 {"get_buffer", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_97get_buffer, METH_NOARGS, 0},
12494 {"__reduce_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_99__reduce_cython__, METH_NOARGS, 0},
12495 {"__setstate_cython__", (PyCFunction)__pyx_pw_11pygame_sdl2_7surface_7Surface_101__setstate_cython__, METH_O, 0},
1210612496 {0, 0, 0, 0}
1210712497 };
1210812498
1217412564 };
1217512565
1217612566 #if PY_MAJOR_VERSION >= 3
12567 #if CYTHON_PEP489_MULTI_PHASE_INIT
12568 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
12569 static int __pyx_pymod_exec_surface(PyObject* module); /*proto*/
12570 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
12571 {Py_mod_create, (void*)__pyx_pymod_create},
12572 {Py_mod_exec, (void*)__pyx_pymod_exec_surface},
12573 {0, NULL}
12574 };
12575 #endif
12576
1217712577 static struct PyModuleDef __pyx_moduledef = {
12178 #if PY_VERSION_HEX < 0x03020000
12179 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
12180 #else
1218112578 PyModuleDef_HEAD_INIT,
12182 #endif
1218312579 "surface",
1218412580 0, /* m_doc */
12581 #if CYTHON_PEP489_MULTI_PHASE_INIT
12582 0, /* m_size */
12583 #else
1218512584 -1, /* m_size */
12585 #endif
1218612586 __pyx_methods /* m_methods */,
12587 #if CYTHON_PEP489_MULTI_PHASE_INIT
12588 __pyx_moduledef_slots, /* m_slots */
12589 #else
1218712590 NULL, /* m_reload */
12591 #endif
1218812592 NULL, /* m_traverse */
1218912593 NULL, /* m_clear */
1219012594 NULL /* m_free */
1220412608 {&__pyx_kp_u_Surface_set_masks_is_not_support, __pyx_k_Surface_set_masks_is_not_support, sizeof(__pyx_k_Surface_set_masks_is_not_support), 0, 1, 0, 0},
1220512609 {&__pyx_kp_u_Surface_set_shifts_is_not_suppor, __pyx_k_Surface_set_shifts_is_not_suppor, sizeof(__pyx_k_Surface_set_shifts_is_not_suppor), 0, 1, 0, 0},
1220612610 {&__pyx_kp_u_Surface_x_x, __pyx_k_Surface_x_x, sizeof(__pyx_k_Surface_x_x), 0, 1, 0, 0},
12611 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
1220712612 {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
1220812613 {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
1220912614 {&__pyx_n_s_area, __pyx_k_area, sizeof(__pyx_k_area), 0, 0, 1, 1},
1221012615 {&__pyx_n_u_area, __pyx_k_area, sizeof(__pyx_k_area), 0, 1, 0, 1},
12616 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
1221112617 {&__pyx_n_s_clip, __pyx_k_clip, sizeof(__pyx_k_clip), 0, 0, 1, 1},
1221212618 {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1},
1221312619 {&__pyx_n_s_convert, __pyx_k_convert, sizeof(__pyx_k_convert), 0, 0, 1, 1},
1222512631 {&__pyx_n_s_get_rect, __pyx_k_get_rect, sizeof(__pyx_k_get_rect), 0, 0, 1, 1},
1222612632 {&__pyx_n_s_get_size, __pyx_k_get_size, sizeof(__pyx_k_get_size), 0, 0, 1, 1},
1222712633 {&__pyx_n_s_get_surface, __pyx_k_get_surface, sizeof(__pyx_k_get_surface), 0, 0, 1, 1},
12634 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
1222812635 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
1222912636 {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
1223012637 {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1},
1223212639 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
1223312640 {&__pyx_n_s_masks, __pyx_k_masks, sizeof(__pyx_k_masks), 0, 0, 1, 1},
1223412641 {&__pyx_n_s_min_alpha, __pyx_k_min_alpha, sizeof(__pyx_k_min_alpha), 0, 0, 1, 1},
12642 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
12643 {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
1223512644 {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
1223612645 {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1},
1223712646 {&__pyx_n_s_pygame_sdl2_error, __pyx_k_pygame_sdl2_error, sizeof(__pyx_k_pygame_sdl2_error), 0, 0, 1, 1},
1223912648 {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1},
1224012649 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
1224112650 {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1},
12651 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
12652 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
12653 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
1224212654 {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1},
1224312655 {&__pyx_n_s_set_alpha, __pyx_k_set_alpha, sizeof(__pyx_k_set_alpha), 0, 0, 1, 1},
12656 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
12657 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
1224412658 {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
1224512659 {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1},
1224612660 {&__pyx_n_s_special_flags, __pyx_k_special_flags, sizeof(__pyx_k_special_flags), 0, 0, 1, 1},
1225912673 static int __Pyx_InitCachedBuiltins(void) {
1226012674 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 512, __pyx_L1_error)
1226112675 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 537, __pyx_L1_error)
12676 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
1226212677 return 0;
1226312678 __pyx_L1_error:;
1226412679 return -1;
1248012895 __Pyx_GOTREF(__pyx_tuple__20);
1248112896 __Pyx_GIVEREF(__pyx_tuple__20);
1248212897
12898 /* "(tree fragment)":2
12899 * def __reduce_cython__(self):
12900 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
12901 * def __setstate_cython__(self, __pyx_state):
12902 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12903 */
12904 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 2, __pyx_L1_error)
12905 __Pyx_GOTREF(__pyx_tuple__21);
12906 __Pyx_GIVEREF(__pyx_tuple__21);
12907
12908 /* "(tree fragment)":4
12909 * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
12910 * def __setstate_cython__(self, __pyx_state):
12911 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
12912 */
12913 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 4, __pyx_L1_error)
12914 __Pyx_GOTREF(__pyx_tuple__22);
12915 __Pyx_GIVEREF(__pyx_tuple__22);
12916
1248312917 /* "pygame_sdl2/surface.pyx":822
1248412918 *
1248512919 * cdef api object PySurface_New(SDL_Surface *surf):
1248712921 * rv.take_surface(surf)
1248812922 * return rv
1248912923 */
12490 __pyx_tuple__21 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 822, __pyx_L1_error)
12491 __Pyx_GOTREF(__pyx_tuple__21);
12492 __Pyx_GIVEREF(__pyx_tuple__21);
12924 __pyx_tuple__23 = PyTuple_Pack(1, __pyx_empty_tuple); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 822, __pyx_L1_error)
12925 __Pyx_GOTREF(__pyx_tuple__23);
12926 __Pyx_GIVEREF(__pyx_tuple__23);
1249312927 __Pyx_RefNannyFinishContext();
1249412928 return 0;
1249512929 __pyx_L1_error:;
1251012944 return -1;
1251112945 }
1251212946
12947 static int __Pyx_modinit_global_init_code(void); /*proto*/
12948 static int __Pyx_modinit_variable_export_code(void); /*proto*/
12949 static int __Pyx_modinit_function_export_code(void); /*proto*/
12950 static int __Pyx_modinit_type_init_code(void); /*proto*/
12951 static int __Pyx_modinit_type_import_code(void); /*proto*/
12952 static int __Pyx_modinit_variable_import_code(void); /*proto*/
12953 static int __Pyx_modinit_function_import_code(void); /*proto*/
12954
12955 static int __Pyx_modinit_global_init_code(void) {
12956 __Pyx_RefNannyDeclarations
12957 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
12958 /*--- Global init code ---*/
12959 __Pyx_RefNannyFinishContext();
12960 return 0;
12961 }
12962
12963 static int __Pyx_modinit_variable_export_code(void) {
12964 __Pyx_RefNannyDeclarations
12965 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
12966 /*--- Variable export code ---*/
12967 __Pyx_RefNannyFinishContext();
12968 return 0;
12969 }
12970
12971 static int __Pyx_modinit_function_export_code(void) {
12972 __Pyx_RefNannyDeclarations
12973 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
12974 /*--- Function export code ---*/
12975 if (__Pyx_ExportFunction("PySurface_AsSurface", (void (*)(void))__pyx_f_11pygame_sdl2_7surface_PySurface_AsSurface, "SDL_Surface *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12976 if (__Pyx_ExportFunction("PySurface_New", (void (*)(void))__pyx_f_11pygame_sdl2_7surface_PySurface_New, "PyObject *(SDL_Surface *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12977 __Pyx_RefNannyFinishContext();
12978 return 0;
12979 __pyx_L1_error:;
12980 __Pyx_RefNannyFinishContext();
12981 return -1;
12982 }
12983
12984 static int __Pyx_modinit_type_init_code(void) {
12985 __Pyx_RefNannyDeclarations
12986 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
12987 /*--- Type init code ---*/
12988 __pyx_vtabptr_11pygame_sdl2_7surface_Surface = &__pyx_vtable_11pygame_sdl2_7surface_Surface;
12989 __pyx_vtable_11pygame_sdl2_7surface_Surface.take_surface = (void (*)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *))__pyx_f_11pygame_sdl2_7surface_7Surface_take_surface;
12990 if (PyType_Ready(&__pyx_type_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error)
12991 __pyx_type_11pygame_sdl2_7surface_Surface.tp_print = 0;
12992 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11pygame_sdl2_7surface_Surface.tp_dictoffset && __pyx_type_11pygame_sdl2_7surface_Surface.tp_getattro == PyObject_GenericGetAttr)) {
12993 __pyx_type_11pygame_sdl2_7surface_Surface.tp_getattro = __Pyx_PyObject_GenericGetAttr;
12994 }
12995 if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_7surface_Surface.tp_dict, __pyx_vtabptr_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error)
12996 if (PyObject_SetAttrString(__pyx_m, "Surface", (PyObject *)&__pyx_type_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error)
12997 if (__pyx_type_11pygame_sdl2_7surface_Surface.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_7surface_Surface.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_7surface_Surface, __weakref__);
12998 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error)
12999 __pyx_ptype_11pygame_sdl2_7surface_Surface = &__pyx_type_11pygame_sdl2_7surface_Surface;
13000 __Pyx_RefNannyFinishContext();
13001 return 0;
13002 __pyx_L1_error:;
13003 __Pyx_RefNannyFinishContext();
13004 return -1;
13005 }
13006
13007 static int __Pyx_modinit_type_import_code(void) {
13008 __Pyx_RefNannyDeclarations
13009 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
13010 /*--- Type import code ---*/
13011 __pyx_ptype_11pygame_sdl2_5color_Color = __Pyx_ImportType("pygame_sdl2.color", "Color", sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_5color_Color)) __PYX_ERR(2, 26, __pyx_L1_error)
13012 __pyx_vtabptr_11pygame_sdl2_5color_Color = (struct __pyx_vtabstruct_11pygame_sdl2_5color_Color*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_5color_Color->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_5color_Color)) __PYX_ERR(2, 26, __pyx_L1_error)
13013 __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType("pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_4rect_Rect)) __PYX_ERR(3, 21, __pyx_L1_error)
13014 __Pyx_RefNannyFinishContext();
13015 return 0;
13016 __pyx_L1_error:;
13017 __Pyx_RefNannyFinishContext();
13018 return -1;
13019 }
13020
13021 static int __Pyx_modinit_variable_import_code(void) {
13022 __Pyx_RefNannyDeclarations
13023 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
13024 /*--- Variable import code ---*/
13025 __Pyx_RefNannyFinishContext();
13026 return 0;
13027 }
13028
13029 static int __Pyx_modinit_function_import_code(void) {
13030 __Pyx_RefNannyDeclarations
13031 PyObject *__pyx_t_1 = NULL;
13032 PyObject *__pyx_t_2 = NULL;
13033 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
13034 /*--- Function import code ---*/
13035 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.color"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
13036 if (__Pyx_ImportFunction(__pyx_t_1, "map_color", (void (**)(void))&__pyx_f_11pygame_sdl2_5color_map_color, "Uint32 (SDL_Surface *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
13037 if (__Pyx_ImportFunction(__pyx_t_1, "get_color", (void (**)(void))&__pyx_f_11pygame_sdl2_5color_get_color, "PyObject *(Uint32, SDL_Surface *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
13038 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13039 __pyx_t_2 = __Pyx_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error)
13040 if (__Pyx_ImportFunction(__pyx_t_2, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
13041 Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13042 __Pyx_RefNannyFinishContext();
13043 return 0;
13044 __pyx_L1_error:;
13045 __Pyx_XDECREF(__pyx_t_1);
13046 __Pyx_XDECREF(__pyx_t_2);
13047 __Pyx_RefNannyFinishContext();
13048 return -1;
13049 }
13050
13051
1251313052 #if PY_MAJOR_VERSION < 3
12514 PyMODINIT_FUNC initsurface(void); /*proto*/
12515 PyMODINIT_FUNC initsurface(void)
13053 #ifdef CYTHON_NO_PYINIT_EXPORT
13054 #define __Pyx_PyMODINIT_FUNC void
1251613055 #else
12517 PyMODINIT_FUNC PyInit_surface(void); /*proto*/
12518 PyMODINIT_FUNC PyInit_surface(void)
13056 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
13057 #endif
13058 #else
13059 #ifdef CYTHON_NO_PYINIT_EXPORT
13060 #define __Pyx_PyMODINIT_FUNC PyObject *
13061 #else
13062 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
13063 #endif
13064 #endif
13065 #ifndef CYTHON_SMALL_CODE
13066 #if defined(__clang__)
13067 #define CYTHON_SMALL_CODE
13068 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
13069 #define CYTHON_SMALL_CODE __attribute__((cold))
13070 #else
13071 #define CYTHON_SMALL_CODE
13072 #endif
13073 #endif
13074
13075
13076 #if PY_MAJOR_VERSION < 3
13077 __Pyx_PyMODINIT_FUNC initsurface(void) CYTHON_SMALL_CODE; /*proto*/
13078 __Pyx_PyMODINIT_FUNC initsurface(void)
13079 #else
13080 __Pyx_PyMODINIT_FUNC PyInit_surface(void) CYTHON_SMALL_CODE; /*proto*/
13081 __Pyx_PyMODINIT_FUNC PyInit_surface(void)
13082 #if CYTHON_PEP489_MULTI_PHASE_INIT
13083 {
13084 return PyModuleDef_Init(&__pyx_moduledef);
13085 }
13086 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
13087 PyObject *value = PyObject_GetAttrString(spec, from_name);
13088 int result = 0;
13089 if (likely(value)) {
13090 result = PyDict_SetItemString(moddict, to_name, value);
13091 Py_DECREF(value);
13092 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
13093 PyErr_Clear();
13094 } else {
13095 result = -1;
13096 }
13097 return result;
13098 }
13099 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
13100 PyObject *module = NULL, *moddict, *modname;
13101 if (__pyx_m)
13102 return __Pyx_NewRef(__pyx_m);
13103 modname = PyObject_GetAttrString(spec, "name");
13104 if (unlikely(!modname)) goto bad;
13105 module = PyModule_NewObject(modname);
13106 Py_DECREF(modname);
13107 if (unlikely(!module)) goto bad;
13108 moddict = PyModule_GetDict(module);
13109 if (unlikely(!moddict)) goto bad;
13110 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
13111 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
13112 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
13113 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
13114 return module;
13115 bad:
13116 Py_XDECREF(module);
13117 return NULL;
13118 }
13119
13120
13121 static int __pyx_pymod_exec_surface(PyObject *__pyx_pyinit_module)
13122 #endif
1251913123 #endif
1252013124 {
1252113125 PyObject *__pyx_t_1 = NULL;
1252213126 PyObject *__pyx_t_2 = NULL;
12523 PyObject *__pyx_t_3 = NULL;
12524 PyObject *__pyx_t_4 = NULL;
1252513127 __Pyx_RefNannyDeclarations
13128 #if CYTHON_PEP489_MULTI_PHASE_INIT
13129 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
13130 #elif PY_MAJOR_VERSION >= 3
13131 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
13132 #endif
1252613133 #if CYTHON_REFNANNY
12527 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
12528 if (!__Pyx_RefNanny) {
12529 PyErr_Clear();
12530 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
12531 if (!__Pyx_RefNanny)
12532 Py_FatalError("failed to import 'refnanny' module");
12533 }
12534 #endif
12535 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_surface(void)", 0);
13134 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
13135 if (!__Pyx_RefNanny) {
13136 PyErr_Clear();
13137 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
13138 if (!__Pyx_RefNanny)
13139 Py_FatalError("failed to import 'refnanny' module");
13140 }
13141 #endif
13142 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_surface(void)", 0);
1253613143 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1253713144 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
1253813145 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
1254913156 #ifdef __Pyx_Generator_USED
1255013157 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1255113158 #endif
13159 #ifdef __Pyx_AsyncGen_USED
13160 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
13161 #endif
1255213162 #ifdef __Pyx_StopAsyncIteration_USED
1255313163 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1255413164 #endif
1256013170 #endif
1256113171 #endif
1256213172 /*--- Module creation code ---*/
13173 #if CYTHON_PEP489_MULTI_PHASE_INIT
13174 __pyx_m = __pyx_pyinit_module;
13175 Py_INCREF(__pyx_m);
13176 #else
1256313177 #if PY_MAJOR_VERSION < 3
1256413178 __pyx_m = Py_InitModule4("surface", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
1256513179 #else
1256613180 __pyx_m = PyModule_Create(&__pyx_moduledef);
1256713181 #endif
1256813182 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
13183 #endif
1256913184 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
1257013185 Py_INCREF(__pyx_d);
1257113186 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
13187 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
1257213188 #if CYTHON_COMPILING_IN_PYPY
1257313189 Py_INCREF(__pyx_b);
1257413190 #endif
1259313209 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1259413210 /*--- Constants init code ---*/
1259513211 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12596 /*--- Global init code ---*/
12597 /*--- Variable export code ---*/
12598 /*--- Function export code ---*/
12599 if (__Pyx_ExportFunction("PySurface_AsSurface", (void (*)(void))__pyx_f_11pygame_sdl2_7surface_PySurface_AsSurface, "SDL_Surface *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12600 if (__Pyx_ExportFunction("PySurface_New", (void (*)(void))__pyx_f_11pygame_sdl2_7surface_PySurface_New, "PyObject *(SDL_Surface *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12601 /*--- Type init code ---*/
12602 __pyx_vtabptr_11pygame_sdl2_7surface_Surface = &__pyx_vtable_11pygame_sdl2_7surface_Surface;
12603 __pyx_vtable_11pygame_sdl2_7surface_Surface.take_surface = (void (*)(struct __pyx_obj_11pygame_sdl2_7surface_Surface *, SDL_Surface *))__pyx_f_11pygame_sdl2_7surface_7Surface_take_surface;
12604 if (PyType_Ready(&__pyx_type_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error)
12605 __pyx_type_11pygame_sdl2_7surface_Surface.tp_print = 0;
12606 if (__Pyx_SetVtable(__pyx_type_11pygame_sdl2_7surface_Surface.tp_dict, __pyx_vtabptr_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error)
12607 if (PyObject_SetAttrString(__pyx_m, "Surface", (PyObject *)&__pyx_type_11pygame_sdl2_7surface_Surface) < 0) __PYX_ERR(0, 53, __pyx_L1_error)
12608 if (__pyx_type_11pygame_sdl2_7surface_Surface.tp_weaklistoffset == 0) __pyx_type_11pygame_sdl2_7surface_Surface.tp_weaklistoffset = offsetof(struct __pyx_obj_11pygame_sdl2_7surface_Surface, __weakref__);
12609 __pyx_ptype_11pygame_sdl2_7surface_Surface = &__pyx_type_11pygame_sdl2_7surface_Surface;
12610 /*--- Type import code ---*/
12611 __pyx_ptype_11pygame_sdl2_5color_Color = __Pyx_ImportType("pygame_sdl2.color", "Color", sizeof(struct __pyx_obj_11pygame_sdl2_5color_Color), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_5color_Color)) __PYX_ERR(1, 26, __pyx_L1_error)
12612 __pyx_vtabptr_11pygame_sdl2_5color_Color = (struct __pyx_vtabstruct_11pygame_sdl2_5color_Color*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_5color_Color->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_5color_Color)) __PYX_ERR(1, 26, __pyx_L1_error)
12613 __pyx_ptype_11pygame_sdl2_4rect_Rect = __Pyx_ImportType("pygame_sdl2.rect", "Rect", sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_4rect_Rect)) __PYX_ERR(2, 21, __pyx_L1_error)
12614 /*--- Variable import code ---*/
12615 /*--- Function import code ---*/
12616 __pyx_t_1 = __Pyx_ImportModule("pygame_sdl2.color"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
12617 if (__Pyx_ImportFunction(__pyx_t_1, "map_color", (void (**)(void))&__pyx_f_11pygame_sdl2_5color_map_color, "Uint32 (SDL_Surface *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12618 if (__Pyx_ImportFunction(__pyx_t_1, "get_color", (void (**)(void))&__pyx_f_11pygame_sdl2_5color_get_color, "PyObject *(Uint32, SDL_Surface *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12619 Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12620 __pyx_t_2 = __Pyx_ImportModule("pygame_sdl2.rect"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error)
12621 if (__Pyx_ImportFunction(__pyx_t_2, "to_sdl_rect", (void (**)(void))&__pyx_f_11pygame_sdl2_4rect_to_sdl_rect, "int (PyObject *, SDL_Rect *, struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12622 Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13212 /*--- Global type/function init code ---*/
13213 (void)__Pyx_modinit_global_init_code();
13214 (void)__Pyx_modinit_variable_export_code();
13215 if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error;
13216 if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
13217 if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
13218 (void)__Pyx_modinit_variable_import_code();
13219 if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error;
1262313220 /*--- Execution code ---*/
1262413221 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
1262513222 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1263213229 *
1263313230 * from pygame_sdl2.error import error
1263413231 */
12635 __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
12636 __Pyx_GOTREF(__pyx_t_3);
13232 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
13233 __Pyx_GOTREF(__pyx_t_1);
1263713234 __Pyx_INCREF(__pyx_n_s_Rect);
1263813235 __Pyx_GIVEREF(__pyx_n_s_Rect);
12639 PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_Rect);
12640 __pyx_t_4 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error)
12641 __Pyx_GOTREF(__pyx_t_4);
12642 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12643 __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
12644 __Pyx_GOTREF(__pyx_t_3);
12645 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_3) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
12646 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12647 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13236 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Rect);
13237 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_rect, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
13238 __Pyx_GOTREF(__pyx_t_2);
13239 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13240 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
13241 __Pyx_GOTREF(__pyx_t_1);
13242 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
13243 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13244 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1264813245
1264913246 /* "pygame_sdl2/surface.pyx":27
1265013247 * from pygame_sdl2.rect import Rect
1265313250 * from pygame_sdl2.locals import SRCALPHA
1265413251 * import pygame_sdl2
1265513252 */
12656 __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error)
12657 __Pyx_GOTREF(__pyx_t_4);
13253 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
13254 __Pyx_GOTREF(__pyx_t_2);
1265813255 __Pyx_INCREF(__pyx_n_s_error);
1265913256 __Pyx_GIVEREF(__pyx_n_s_error);
12660 PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_error);
12661 __pyx_t_3 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 27, __pyx_L1_error)
12662 __Pyx_GOTREF(__pyx_t_3);
12663 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12664 __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 27, __pyx_L1_error)
12665 __Pyx_GOTREF(__pyx_t_4);
12666 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_4) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
12667 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12668 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13257 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_error);
13258 __pyx_t_1 = __Pyx_Import(__pyx_n_s_pygame_sdl2_error, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 27, __pyx_L1_error)
13259 __Pyx_GOTREF(__pyx_t_1);
13260 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13261 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
13262 __Pyx_GOTREF(__pyx_t_2);
13263 if (PyDict_SetItem(__pyx_d, __pyx_n_s_error, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
13264 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13265 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1266913266
1267013267 /* "pygame_sdl2/surface.pyx":28
1267113268 *
1267413271 * import pygame_sdl2
1267513272 *
1267613273 */
12677 __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
12678 __Pyx_GOTREF(__pyx_t_3);
13274 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
13275 __Pyx_GOTREF(__pyx_t_1);
1267913276 __Pyx_INCREF(__pyx_n_s_SRCALPHA);
1268013277 __Pyx_GIVEREF(__pyx_n_s_SRCALPHA);
12681 PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_SRCALPHA);
12682 __pyx_t_4 = __Pyx_Import(__pyx_n_s_pygame_sdl2_locals, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error)
12683 __Pyx_GOTREF(__pyx_t_4);
12684 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12685 __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
12686 __Pyx_GOTREF(__pyx_t_3);
12687 if (PyDict_SetItem(__pyx_d, __pyx_n_s_SRCALPHA, __pyx_t_3) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
12688 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12689 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13278 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_SRCALPHA);
13279 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2_locals, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
13280 __Pyx_GOTREF(__pyx_t_2);
13281 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13282 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_SRCALPHA); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
13283 __Pyx_GOTREF(__pyx_t_1);
13284 if (PyDict_SetItem(__pyx_d, __pyx_n_s_SRCALPHA, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
13285 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13286 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1269013287
1269113288 /* "pygame_sdl2/surface.pyx":29
1269213289 * from pygame_sdl2.error import error
1269513292 *
1269613293 * import warnings
1269713294 */
12698 __pyx_t_4 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error)
12699 __Pyx_GOTREF(__pyx_t_4);
12700 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_4) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
12701 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13295 __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __pyx_L1_error)
13296 __Pyx_GOTREF(__pyx_t_2);
13297 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame_sdl2, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
13298 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1270213299
1270313300 /* "pygame_sdl2/surface.pyx":31
1270413301 * import pygame_sdl2
1270713304 *
1270813305 * cdef extern from "src/surface.h" nogil:
1270913306 */
12710 __pyx_t_4 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error)
12711 __Pyx_GOTREF(__pyx_t_4);
12712 if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_4) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
12713 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13307 __pyx_t_2 = __Pyx_Import(__pyx_n_s_warnings, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
13308 __Pyx_GOTREF(__pyx_t_2);
13309 if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_2) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
13310 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1271413311
1271513312 /* "pygame_sdl2/surface.pyx":51
1271613313 *
1272613323 * # Copyright 2014 Tom Rothamel <tom@rothamel.us>
1272713324 * #
1272813325 */
12729 __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
12730 __Pyx_GOTREF(__pyx_t_4);
12731 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12732 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13326 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
13327 __Pyx_GOTREF(__pyx_t_2);
13328 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
13329 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1273313330
1273413331 /*--- Wrapped vars code ---*/
1273513332
1273713334 __pyx_L1_error:;
1273813335 __Pyx_XDECREF(__pyx_t_1);
1273913336 __Pyx_XDECREF(__pyx_t_2);
12740 __Pyx_XDECREF(__pyx_t_3);
12741 __Pyx_XDECREF(__pyx_t_4);
1274213337 if (__pyx_m) {
1274313338 if (__pyx_d) {
12744 __Pyx_AddTraceback("init pygame_sdl2.surface", __pyx_clineno, __pyx_lineno, __pyx_filename);
13339 __Pyx_AddTraceback("init pygame_sdl2.surface", 0, __pyx_lineno, __pyx_filename);
1274513340 }
1274613341 Py_DECREF(__pyx_m); __pyx_m = 0;
1274713342 } else if (!PyErr_Occurred()) {
1274913344 }
1275013345 __pyx_L0:;
1275113346 __Pyx_RefNannyFinishContext();
12752 #if PY_MAJOR_VERSION < 3
13347 #if CYTHON_PEP489_MULTI_PHASE_INIT
13348 return (__pyx_m != NULL) ? 0 : -1;
13349 #elif PY_MAJOR_VERSION >= 3
13350 return __pyx_m;
13351 #else
1275313352 return;
12754 #else
12755 return __pyx_m;
1275613353 #endif
1275713354 }
1275813355
1277113368 Py_XDECREF(p);
1277213369 Py_XDECREF(m);
1277313370 return (__Pyx_RefNannyAPIStruct *)r;
13371 }
13372 #endif
13373
13374 /* PyObjectGetAttrStr */
13375 #if CYTHON_USE_TYPE_SLOTS
13376 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
13377 PyTypeObject* tp = Py_TYPE(obj);
13378 if (likely(tp->tp_getattro))
13379 return tp->tp_getattro(obj, attr_name);
13380 #if PY_MAJOR_VERSION < 3
13381 if (likely(tp->tp_getattr))
13382 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
13383 #endif
13384 return PyObject_GetAttr(obj, attr_name);
1277413385 }
1277513386 #endif
1277613387
1281513426 }
1281613427
1281713428 /* KeywordStringCheck */
12818 static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
13429 static int __Pyx_CheckKeywordStrings(
1281913430 PyObject *kwdict,
1282013431 const char* function_name,
1282113432 int kw_allowed)
1282913440 #else
1283013441 while (PyDict_Next(kwdict, &pos, &key, 0)) {
1283113442 #if PY_MAJOR_VERSION < 3
12832 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
13443 if (unlikely(!PyString_Check(key)))
1283313444 #endif
1283413445 if (unlikely(!PyUnicode_Check(key)))
1283513446 goto invalid_keyword_type;
1285813469 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
1285913470 PyObject *result;
1286013471 #if !CYTHON_AVOID_BORROWED_REFS
13472 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
13473 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
13474 if (likely(result)) {
13475 Py_INCREF(result);
13476 } else if (unlikely(PyErr_Occurred())) {
13477 result = NULL;
13478 } else {
13479 #else
1286113480 result = PyDict_GetItem(__pyx_d, name);
1286213481 if (likely(result)) {
1286313482 Py_INCREF(result);
1286413483 } else {
13484 #endif
1286513485 #else
1286613486 result = PyObject_GetItem(__pyx_d, name);
1286713487 if (!result) {
1287313493 }
1287413494
1287513495 /* PyObjectCall */
12876 #if CYTHON_COMPILING_IN_CPYTHON
13496 #if CYTHON_COMPILING_IN_CPYTHON
1287713497 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
1287813498 PyObject *result;
1287913499 ternaryfunc call = func->ob_type->tp_call;
1289313513 #endif
1289413514
1289513515 /* PyErrFetchRestore */
12896 #if CYTHON_FAST_THREAD_STATE
13516 #if CYTHON_FAST_THREAD_STATE
1289713517 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
1289813518 PyObject *tmp_type, *tmp_value, *tmp_tb;
1289913519 tmp_type = tstate->curexc_type;
1291713537 #endif
1291813538
1291913539 /* WriteUnraisableException */
12920 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
13540 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
1292113541 CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
1292213542 int full_traceback, CYTHON_UNUSED int nogil) {
1292313543 PyObject *old_exc, *old_val, *old_tb;
1295913579 }
1296013580
1296113581 /* RaiseDoubleKeywords */
12962 static void __Pyx_RaiseDoubleKeywordsError(
13582 static void __Pyx_RaiseDoubleKeywordsError(
1296313583 const char* func_name,
1296413584 PyObject* kw_name)
1296513585 {
1297313593 }
1297413594
1297513595 /* ParseKeywords */
12976 static int __Pyx_ParseOptionalKeywords(
13596 static int __Pyx_ParseOptionalKeywords(
1297713597 PyObject *kwds,
1297813598 PyObject **argnames[],
1297913599 PyObject *kwds2,
1307513695 }
1307613696
1307713697 /* RaiseTooManyValuesToUnpack */
13078 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
13698 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
1307913699 PyErr_Format(PyExc_ValueError,
1308013700 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
1308113701 }
1308213702
1308313703 /* RaiseNeedMoreValuesToUnpack */
13084 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
13704 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
1308513705 PyErr_Format(PyExc_ValueError,
1308613706 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
1308713707 index, (index == 1) ? "" : "s");
1308813708 }
1308913709
1309013710 /* IterFinish */
13091 static CYTHON_INLINE int __Pyx_IterFinish(void) {
13711 static CYTHON_INLINE int __Pyx_IterFinish(void) {
1309213712 #if CYTHON_FAST_THREAD_STATE
13093 PyThreadState *tstate = PyThreadState_GET();
13713 PyThreadState *tstate = __Pyx_PyThreadState_Current;
1309413714 PyObject* exc_type = tstate->curexc_type;
1309513715 if (unlikely(exc_type)) {
13096 if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
13716 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
1309713717 PyObject *exc_value, *exc_tb;
1309813718 exc_value = tstate->curexc_value;
1309913719 exc_tb = tstate->curexc_traceback;
1312313743 }
1312413744
1312513745 /* UnpackItemEndCheck */
13126 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
13746 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
1312713747 if (unlikely(retval)) {
1312813748 Py_DECREF(retval);
1312913749 __Pyx_RaiseTooManyValuesError(expected);
1313513755 }
1313613756
1313713757 /* ExtTypeTest */
13138 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
13758 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
1313913759 if (unlikely(!type)) {
1314013760 PyErr_SetString(PyExc_SystemError, "Missing type object");
1314113761 return 0;
1314213762 }
13143 if (likely(PyObject_TypeCheck(obj, type)))
13763 if (likely(__Pyx_TypeCheck(obj, type)))
1314413764 return 1;
1314513765 PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
1314613766 Py_TYPE(obj)->tp_name, type->tp_name);
1314813768 }
1314913769
1315013770 /* PyCFunctionFastCall */
13151 #if CYTHON_FAST_PYCCALL
13771 #if CYTHON_FAST_PYCCALL
1315213772 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
1315313773 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
1315413774 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
1315513775 PyObject *self = PyCFunction_GET_SELF(func);
13776 int flags = PyCFunction_GET_FLAGS(func);
1315613777 assert(PyCFunction_Check(func));
13157 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
13778 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
1315813779 assert(nargs >= 0);
1315913780 assert(nargs == 0 || args != NULL);
1316013781 /* _PyCFunction_FastCallDict() must not be called with an exception set,
1316113782 because it may clear it (directly or indirectly) and so the
1316213783 caller loses its exception */
1316313784 assert(!PyErr_Occurred());
13164 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
13165 }
13166 #endif // CYTHON_FAST_PYCCALL
13785 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
13786 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
13787 } else {
13788 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
13789 }
13790 }
13791 #endif
1316713792
1316813793 /* PyFunctionFastCall */
13169 #if CYTHON_FAST_PYCALL
13794 #if CYTHON_FAST_PYCALL
1317013795 #include "frameobject.h"
1317113796 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
1317213797 PyObject *globals) {
1317313798 PyFrameObject *f;
13174 PyThreadState *tstate = PyThreadState_GET();
13799 PyThreadState *tstate = __Pyx_PyThreadState_Current;
1317513800 PyObject **fastlocals;
1317613801 Py_ssize_t i;
1317713802 PyObject *result;
1328213907 Py_LeaveRecursiveCall();
1328313908 return result;
1328413909 }
13285 #endif // CPython < 3.6
13286 #endif // CYTHON_FAST_PYCALL
13910 #endif
13911 #endif
1328713912
1328813913 /* PyObjectCallMethO */
13289 #if CYTHON_COMPILING_IN_CPYTHON
13914 #if CYTHON_COMPILING_IN_CPYTHON
1329013915 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
1329113916 PyObject *self, *result;
1329213917 PyCFunction cfunc;
1330613931 #endif
1330713932
1330813933 /* PyObjectCallOneArg */
13309 #if CYTHON_COMPILING_IN_CPYTHON
13934 #if CYTHON_COMPILING_IN_CPYTHON
1331013935 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
1331113936 PyObject *result;
1331213937 PyObject *args = PyTuple_New(1);
1332313948 return __Pyx_PyFunction_FastCall(func, &arg, 1);
1332413949 }
1332513950 #endif
13326 #ifdef __Pyx_CyFunction_USED
13327 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
13328 #else
1332913951 if (likely(PyCFunction_Check(func))) {
13330 #endif
1333113952 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
1333213953 return __Pyx_PyObject_CallMethO(func, arg);
1333313954 #if CYTHON_FAST_PYCCALL
1335813979 }
1335913980 #endif
1336013981 #ifdef __Pyx_CyFunction_USED
13361 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
13982 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
1336213983 #else
1336313984 if (likely(PyCFunction_Check(func))) {
1336413985 #endif
1348614107 "raise: exception class must be a subclass of BaseException");
1348714108 goto bad;
1348814109 }
13489 #if PY_VERSION_HEX >= 0x03030000
1349014110 if (cause) {
13491 #else
13492 if (cause && cause != Py_None) {
13493 #endif
1349414111 PyObject *fixed_cause;
1349514112 if (cause == Py_None) {
1349614113 fixed_cause = NULL;
1351814135 PyErr_Restore(tmp_type, tmp_value, tb);
1351914136 Py_XDECREF(tmp_tb);
1352014137 #else
13521 PyThreadState *tstate = PyThreadState_GET();
14138 PyThreadState *tstate = __Pyx_PyThreadState_Current;
1352214139 PyObject* tmp_tb = tstate->curexc_traceback;
1352314140 if (tb != tmp_tb) {
1352414141 Py_INCREF(tb);
1353414151 #endif
1353514152
1353614153 /* ArgTypeTest */
13537 static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
13538 PyErr_Format(PyExc_TypeError,
13539 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
13540 name, type->tp_name, Py_TYPE(obj)->tp_name);
13541 }
13542 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
13543 const char *name, int exact)
14154 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
1354414155 {
1354514156 if (unlikely(!type)) {
1354614157 PyErr_SetString(PyExc_SystemError, "Missing type object");
1354714158 return 0;
1354814159 }
13549 if (none_allowed && obj == Py_None) return 1;
1355014160 else if (exact) {
13551 if (likely(Py_TYPE(obj) == type)) return 1;
1355214161 #if PY_MAJOR_VERSION == 2
13553 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
14162 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
1355414163 #endif
1355514164 }
1355614165 else {
13557 if (likely(PyObject_TypeCheck(obj, type))) return 1;
13558 }
13559 __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
14166 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
14167 }
14168 PyErr_Format(PyExc_TypeError,
14169 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
14170 name, type->tp_name, Py_TYPE(obj)->tp_name);
1356014171 return 0;
1356114172 }
1356214173
1356314174 /* GetItemInt */
13564 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
14175 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
1356514176 PyObject *r;
1356614177 if (!j) return NULL;
1356714178 r = PyObject_GetItem(o, j);
1357214183 CYTHON_NCP_UNUSED int wraparound,
1357314184 CYTHON_NCP_UNUSED int boundscheck) {
1357414185 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13575 if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
13576 if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
13577 PyObject *r = PyList_GET_ITEM(o, i);
14186 Py_ssize_t wrapped_i = i;
14187 if (wraparound & unlikely(i < 0)) {
14188 wrapped_i += PyList_GET_SIZE(o);
14189 }
14190 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
14191 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
1357814192 Py_INCREF(r);
1357914193 return r;
1358014194 }
1358714201 CYTHON_NCP_UNUSED int wraparound,
1358814202 CYTHON_NCP_UNUSED int boundscheck) {
1358914203 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13590 if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
13591 if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
13592 PyObject *r = PyTuple_GET_ITEM(o, i);
14204 Py_ssize_t wrapped_i = i;
14205 if (wraparound & unlikely(i < 0)) {
14206 wrapped_i += PyTuple_GET_SIZE(o);
14207 }
14208 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
14209 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
1359314210 Py_INCREF(r);
1359414211 return r;
1359514212 }
1364214259 }
1364314260
1364414261 /* PyObjectCallMethod1 */
13645 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
13646 PyObject *method, *result = NULL;
13647 method = __Pyx_PyObject_GetAttrStr(obj, method_name);
13648 if (unlikely(!method)) goto done;
14262 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
14263 PyObject *result = NULL;
1364914264 #if CYTHON_UNPACK_METHODS
1365014265 if (likely(PyMethod_Check(method))) {
1365114266 PyObject *self = PyMethod_GET_SELF(method);
1367314288 Py_INCREF(arg);
1367414289 PyTuple_SET_ITEM(args, 1, arg);
1367514290 Py_INCREF(function);
13676 Py_DECREF(method); method = NULL;
1367714291 result = __Pyx_PyObject_Call(function, args, NULL);
1367814292 Py_DECREF(args);
1367914293 Py_DECREF(function);
1368214296 }
1368314297 #endif
1368414298 result = __Pyx_PyObject_CallOneArg(method, arg);
14299 goto done;
1368514300 done:
13686 Py_XDECREF(method);
1368714301 return result;
1368814302 }
14303 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
14304 PyObject *method, *result;
14305 method = __Pyx_PyObject_GetAttrStr(obj, method_name);
14306 if (unlikely(!method)) return NULL;
14307 result = __Pyx__PyObject_CallMethod1(method, arg);
14308 Py_DECREF(method);
14309 return result;
14310 }
1368914311
1369014312 /* append */
13691 static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
14313 static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
1369214314 if (likely(PyList_CheckExact(L))) {
1369314315 if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
1369414316 } else {
1370114323 }
1370214324
1370314325 /* PyObjectCallMethod0 */
13704 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
14326 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
1370514327 PyObject *method, *result = NULL;
1370614328 method = __Pyx_PyObject_GetAttrStr(obj, method_name);
1370714329 if (unlikely(!method)) goto bad;
1372314345 }
1372414346
1372514347 /* RaiseNoneIterError */
13726 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
14348 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
1372714349 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
1372814350 }
1372914351
1373014352 /* UnpackTupleError */
13731 static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
14353 static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
1373214354 if (t == Py_None) {
1373314355 __Pyx_RaiseNoneNotIterableError();
1373414356 } else if (PyTuple_GET_SIZE(t) < index) {
1373914361 }
1374014362
1374114363 /* UnpackTuple2 */
13742 static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
13743 int is_tuple, int has_known_size, int decref_tuple) {
14364 static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
14365 PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
14366 PyObject *value1 = NULL, *value2 = NULL;
14367 #if CYTHON_COMPILING_IN_PYPY
14368 value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad;
14369 value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad;
14370 #else
14371 value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1);
14372 value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2);
14373 #endif
14374 if (decref_tuple) {
14375 Py_DECREF(tuple);
14376 }
14377 *pvalue1 = value1;
14378 *pvalue2 = value2;
14379 return 0;
14380 #if CYTHON_COMPILING_IN_PYPY
14381 bad:
14382 Py_XDECREF(value1);
14383 Py_XDECREF(value2);
14384 if (decref_tuple) { Py_XDECREF(tuple); }
14385 return -1;
14386 #endif
14387 }
14388 static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
14389 int has_known_size, int decref_tuple) {
1374414390 Py_ssize_t index;
1374514391 PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
13746 if (!is_tuple && unlikely(!PyTuple_Check(tuple))) {
13747 iternextfunc iternext;
13748 iter = PyObject_GetIter(tuple);
13749 if (unlikely(!iter)) goto bad;
13750 if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
13751 iternext = Py_TYPE(iter)->tp_iternext;
13752 value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
13753 value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
13754 if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
13755 Py_DECREF(iter);
13756 } else {
13757 if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) {
13758 __Pyx_UnpackTupleError(tuple, 2);
13759 goto bad;
13760 }
13761 #if CYTHON_COMPILING_IN_PYPY
13762 value1 = PySequence_ITEM(tuple, 0);
13763 if (unlikely(!value1)) goto bad;
13764 value2 = PySequence_ITEM(tuple, 1);
13765 if (unlikely(!value2)) goto bad;
13766 #else
13767 value1 = PyTuple_GET_ITEM(tuple, 0);
13768 value2 = PyTuple_GET_ITEM(tuple, 1);
13769 Py_INCREF(value1);
13770 Py_INCREF(value2);
13771 #endif
13772 if (decref_tuple) { Py_DECREF(tuple); }
13773 }
14392 iternextfunc iternext;
14393 iter = PyObject_GetIter(tuple);
14394 if (unlikely(!iter)) goto bad;
14395 if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
14396 iternext = Py_TYPE(iter)->tp_iternext;
14397 value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
14398 value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
14399 if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
14400 Py_DECREF(iter);
1377414401 *pvalue1 = value1;
1377514402 *pvalue2 = value2;
1377614403 return 0;
1378614413 }
1378714414
1378814415 /* dict_iter */
13789 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
14416 static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
1379014417 Py_ssize_t* p_orig_length, int* p_source_is_dict) {
1379114418 is_dict = is_dict || likely(PyDict_CheckExact(iterable));
1379214419 *p_source_is_dict = is_dict;
14420 if (is_dict) {
1379314421 #if !CYTHON_COMPILING_IN_PYPY
13794 if (is_dict) {
1379514422 *p_orig_length = PyDict_Size(iterable);
1379614423 Py_INCREF(iterable);
1379714424 return iterable;
13798 }
13799 #endif
14425 #elif PY_MAJOR_VERSION >= 3
14426 static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
14427 PyObject **pp = NULL;
14428 if (method_name) {
14429 const char *name = PyUnicode_AsUTF8(method_name);
14430 if (strcmp(name, "iteritems") == 0) pp = &py_items;
14431 else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
14432 else if (strcmp(name, "itervalues") == 0) pp = &py_values;
14433 if (pp) {
14434 if (!*pp) {
14435 *pp = PyUnicode_FromString(name + 4);
14436 if (!*pp)
14437 return NULL;
14438 }
14439 method_name = *pp;
14440 }
14441 }
14442 #endif
14443 }
1380014444 *p_orig_length = 0;
1380114445 if (method_name) {
1380214446 PyObject* iter;
1388114525 return 1;
1388214526 }
1388314527
14528 /* PyObject_GenericGetAttrNoDict */
14529 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
14530 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
14531 PyErr_Format(PyExc_AttributeError,
14532 #if PY_MAJOR_VERSION >= 3
14533 "'%.50s' object has no attribute '%U'",
14534 tp->tp_name, attr_name);
14535 #else
14536 "'%.50s' object has no attribute '%.400s'",
14537 tp->tp_name, PyString_AS_STRING(attr_name));
14538 #endif
14539 return NULL;
14540 }
14541 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
14542 PyObject *descr;
14543 PyTypeObject *tp = Py_TYPE(obj);
14544 if (unlikely(!PyString_Check(attr_name))) {
14545 return PyObject_GenericGetAttr(obj, attr_name);
14546 }
14547 assert(!tp->tp_dictoffset);
14548 descr = _PyType_Lookup(tp, attr_name);
14549 if (unlikely(!descr)) {
14550 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
14551 }
14552 Py_INCREF(descr);
14553 #if PY_MAJOR_VERSION < 3
14554 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
14555 #endif
14556 {
14557 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
14558 if (unlikely(f)) {
14559 PyObject *res = f(descr, obj, (PyObject *)tp);
14560 Py_DECREF(descr);
14561 return res;
14562 }
14563 }
14564 return descr;
14565 }
14566 #endif
14567
14568 /* PyObject_GenericGetAttr */
14569 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
14570 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
14571 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
14572 return PyObject_GenericGetAttr(obj, attr_name);
14573 }
14574 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
14575 }
14576 #endif
14577
1388414578 /* SetVTable */
13885 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
14579 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
1388614580 #if PY_VERSION_HEX >= 0x02070000
1388714581 PyObject *ob = PyCapsule_New(vtable, 0, 0);
1388814582 #else
1389914593 return -1;
1390014594 }
1390114595
14596 /* SetupReduce */
14597 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
14598 int ret;
14599 PyObject *name_attr;
14600 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
14601 if (likely(name_attr)) {
14602 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
14603 } else {
14604 ret = -1;
14605 }
14606 if (unlikely(ret < 0)) {
14607 PyErr_Clear();
14608 ret = 0;
14609 }
14610 Py_XDECREF(name_attr);
14611 return ret;
14612 }
14613 static int __Pyx_setup_reduce(PyObject* type_obj) {
14614 int ret = 0;
14615 PyObject *object_reduce = NULL;
14616 PyObject *object_reduce_ex = NULL;
14617 PyObject *reduce = NULL;
14618 PyObject *reduce_ex = NULL;
14619 PyObject *reduce_cython = NULL;
14620 PyObject *setstate = NULL;
14621 PyObject *setstate_cython = NULL;
14622 #if CYTHON_USE_PYTYPE_LOOKUP
14623 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
14624 #else
14625 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
14626 #endif
14627 #if CYTHON_USE_PYTYPE_LOOKUP
14628 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
14629 #else
14630 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
14631 #endif
14632 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
14633 if (reduce_ex == object_reduce_ex) {
14634 #if CYTHON_USE_PYTYPE_LOOKUP
14635 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
14636 #else
14637 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
14638 #endif
14639 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
14640 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
14641 reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
14642 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
14643 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
14644 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
14645 if (!setstate) PyErr_Clear();
14646 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
14647 setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
14648 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
14649 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
14650 }
14651 PyType_Modified((PyTypeObject*)type_obj);
14652 }
14653 }
14654 goto GOOD;
14655 BAD:
14656 if (!PyErr_Occurred())
14657 PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
14658 ret = -1;
14659 GOOD:
14660 #if !CYTHON_USE_PYTYPE_LOOKUP
14661 Py_XDECREF(object_reduce);
14662 Py_XDECREF(object_reduce_ex);
14663 #endif
14664 Py_XDECREF(reduce);
14665 Py_XDECREF(reduce_ex);
14666 Py_XDECREF(reduce_cython);
14667 Py_XDECREF(setstate);
14668 Py_XDECREF(setstate_cython);
14669 return ret;
14670 }
14671
1390214672 /* GetVTable */
13903 static void* __Pyx_GetVtable(PyObject *dict) {
14673 static void* __Pyx_GetVtable(PyObject *dict) {
1390414674 void* ptr;
1390514675 PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
1390614676 if (!ob)
1392014690 }
1392114691
1392214692 /* Import */
13923 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
14693 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
1392414694 PyObject *empty_list = 0;
1392514695 PyObject *module = 0;
1392614696 PyObject *global_dict = 0;
1392714697 PyObject *empty_dict = 0;
1392814698 PyObject *list;
13929 #if PY_VERSION_HEX < 0x03030000
14699 #if PY_MAJOR_VERSION < 3
1393014700 PyObject *py_import;
1393114701 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
1393214702 if (!py_import)
1395014720 #if PY_MAJOR_VERSION >= 3
1395114721 if (level == -1) {
1395214722 if (strchr(__Pyx_MODULE_NAME, '.')) {
13953 #if PY_VERSION_HEX < 0x03030000
13954 PyObject *py_level = PyInt_FromLong(1);
13955 if (!py_level)
13956 goto bad;
13957 module = PyObject_CallFunctionObjArgs(py_import,
13958 name, global_dict, empty_dict, list, py_level, NULL);
13959 Py_DECREF(py_level);
13960 #else
1396114723 module = PyImport_ImportModuleLevelObject(
1396214724 name, global_dict, empty_dict, list, 1);
13963 #endif
1396414725 if (!module) {
1396514726 if (!PyErr_ExceptionMatches(PyExc_ImportError))
1396614727 goto bad;
1397114732 }
1397214733 #endif
1397314734 if (!module) {
13974 #if PY_VERSION_HEX < 0x03030000
14735 #if PY_MAJOR_VERSION < 3
1397514736 PyObject *py_level = PyInt_FromLong(level);
1397614737 if (!py_level)
1397714738 goto bad;
1398514746 }
1398614747 }
1398714748 bad:
13988 #if PY_VERSION_HEX < 0x03030000
14749 #if PY_MAJOR_VERSION < 3
1398914750 Py_XDECREF(py_import);
1399014751 #endif
1399114752 Py_XDECREF(empty_list);
1399414755 }
1399514756
1399614757 /* ImportFrom */
13997 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
14758 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
1399814759 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
1399914760 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
1400014761 PyErr_Format(PyExc_ImportError,
1400714768 return value;
1400814769 }
1400914770
14771 /* CLineInTraceback */
14772 #ifndef CYTHON_CLINE_IN_TRACEBACK
14773 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
14774 PyObject *use_cline;
14775 PyObject *ptype, *pvalue, *ptraceback;
14776 #if CYTHON_COMPILING_IN_CPYTHON
14777 PyObject **cython_runtime_dict;
14778 #endif
14779 if (unlikely(!__pyx_cython_runtime)) {
14780 return c_line;
14781 }
14782 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
14783 #if CYTHON_COMPILING_IN_CPYTHON
14784 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
14785 if (likely(cython_runtime_dict)) {
14786 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
14787 } else
14788 #endif
14789 {
14790 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
14791 if (use_cline_obj) {
14792 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
14793 Py_DECREF(use_cline_obj);
14794 } else {
14795 PyErr_Clear();
14796 use_cline = NULL;
14797 }
14798 }
14799 if (!use_cline) {
14800 c_line = 0;
14801 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
14802 }
14803 else if (PyObject_Not(use_cline) != 0) {
14804 c_line = 0;
14805 }
14806 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
14807 return c_line;
14808 }
14809 #endif
14810
1401014811 /* CodeObjectCache */
14011 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
14812 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
1401214813 int start = 0, mid = 0, end = count - 1;
1401314814 if (end >= 0 && code_line > entries[end].code_line) {
1401414815 return count;
1408814889 }
1408914890
1409014891 /* AddTraceback */
14091 #include "compile.h"
14892 #include "compile.h"
1409214893 #include "frameobject.h"
1409314894 #include "traceback.h"
1409414895 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
1414714948 int py_line, const char *filename) {
1414814949 PyCodeObject *py_code = 0;
1414914950 PyFrameObject *py_frame = 0;
14150 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
14951 PyThreadState *tstate = __Pyx_PyThreadState_Current;
14952 if (c_line) {
14953 c_line = __Pyx_CLineForTraceback(tstate, c_line);
14954 }
14955 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
1415114956 if (!py_code) {
1415214957 py_code = __Pyx_CreateCodeObjectForTraceback(
1415314958 funcname, c_line, py_line, filename);
1415414959 if (!py_code) goto bad;
14155 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
14960 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
1415614961 }
1415714962 py_frame = PyFrame_New(
14158 PyThreadState_GET(), /*PyThreadState *tstate,*/
14159 py_code, /*PyCodeObject *code,*/
14160 __pyx_d, /*PyObject *globals,*/
14161 0 /*PyObject *locals*/
14963 tstate, /*PyThreadState *tstate,*/
14964 py_code, /*PyCodeObject *code,*/
14965 __pyx_d, /*PyObject *globals,*/
14966 0 /*PyObject *locals*/
1416214967 );
1416314968 if (!py_frame) goto bad;
1416414969 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
1416914974 }
1417014975
1417114976 /* CIntFromPyVerify */
14172 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
14977 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
1417314978 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
1417414979 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
1417514980 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
1419114996 }
1419214997
1419314998 /* CIntToPy */
14194 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
14999 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
1419515000 const int neg_one = (int) -1, const_zero = (int) 0;
1419615001 const int is_unsigned = neg_one > const_zero;
1419715002 if (is_unsigned) {
1422215027 }
1422315028
1422415029 /* CIntToPy */
14225 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
15030 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
1422615031 const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
1422715032 const int is_unsigned = neg_one > const_zero;
1422815033 if (is_unsigned) {
1425315058 }
1425415059
1425515060 /* CIntToPy */
14256 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
15061 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
1425715062 const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0;
1425815063 const int is_unsigned = neg_one > const_zero;
1425915064 if (is_unsigned) {
1428415089 }
1428515090
1428615091 /* CIntToPy */
14287 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
15092 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
1428815093 const long neg_one = (long) -1, const_zero = (long) 0;
1428915094 const int is_unsigned = neg_one > const_zero;
1429015095 if (is_unsigned) {
1431515120 }
1431615121
1431715122 /* CIntToPy */
14318 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) {
15123 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) {
1431915124 const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0;
1432015125 const int is_unsigned = neg_one > const_zero;
1432115126 if (is_unsigned) {
1434615151 }
1434715152
1434815153 /* CIntFromPy */
14349 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
15154 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
1435015155 const int neg_one = (int) -1, const_zero = (int) 0;
1435115156 const int is_unsigned = neg_one > const_zero;
1435215157 #if PY_MAJOR_VERSION < 3
1453515340 }
1453615341
1453715342 /* CIntFromPy */
14538 static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
15343 static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
1453915344 const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
1454015345 const int is_unsigned = neg_one > const_zero;
1454115346 #if PY_MAJOR_VERSION < 3
1472415529 }
1472515530
1472615531 /* CIntFromPy */
14727 static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) {
15532 static CYTHON_INLINE uint8_t __Pyx_PyInt_As_uint8_t(PyObject *x) {
1472815533 const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0;
1472915534 const int is_unsigned = neg_one > const_zero;
1473015535 #if PY_MAJOR_VERSION < 3
1491315718 }
1491415719
1491515720 /* CIntFromPy */
14916 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
15721 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
1491715722 const long neg_one = (long) -1, const_zero = (long) 0;
1491815723 const int is_unsigned = neg_one > const_zero;
1491915724 #if PY_MAJOR_VERSION < 3
1510115906 return (long) -1;
1510215907 }
1510315908
15909 /* FastTypeChecks */
15910 #if CYTHON_COMPILING_IN_CPYTHON
15911 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
15912 while (a) {
15913 a = a->tp_base;
15914 if (a == b)
15915 return 1;
15916 }
15917 return b == &PyBaseObject_Type;
15918 }
15919 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
15920 PyObject *mro;
15921 if (a == b) return 1;
15922 mro = a->tp_mro;
15923 if (likely(mro)) {
15924 Py_ssize_t i, n;
15925 n = PyTuple_GET_SIZE(mro);
15926 for (i = 0; i < n; i++) {
15927 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
15928 return 1;
15929 }
15930 return 0;
15931 }
15932 return __Pyx_InBases(a, b);
15933 }
15934 #if PY_MAJOR_VERSION == 2
15935 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
15936 PyObject *exception, *value, *tb;
15937 int res;
15938 __Pyx_PyThreadState_declare
15939 __Pyx_PyThreadState_assign
15940 __Pyx_ErrFetch(&exception, &value, &tb);
15941 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
15942 if (unlikely(res == -1)) {
15943 PyErr_WriteUnraisable(err);
15944 res = 0;
15945 }
15946 if (!res) {
15947 res = PyObject_IsSubclass(err, exc_type2);
15948 if (unlikely(res == -1)) {
15949 PyErr_WriteUnraisable(err);
15950 res = 0;
15951 }
15952 }
15953 __Pyx_ErrRestore(exception, value, tb);
15954 return res;
15955 }
15956 #else
15957 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
15958 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
15959 if (!res) {
15960 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
15961 }
15962 return res;
15963 }
15964 #endif
15965 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
15966 Py_ssize_t i, n;
15967 assert(PyExceptionClass_Check(exc_type));
15968 n = PyTuple_GET_SIZE(tuple);
15969 #if PY_MAJOR_VERSION >= 3
15970 for (i=0; i<n; i++) {
15971 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
15972 }
15973 #endif
15974 for (i=0; i<n; i++) {
15975 PyObject *t = PyTuple_GET_ITEM(tuple, i);
15976 #if PY_MAJOR_VERSION < 3
15977 if (likely(exc_type == t)) return 1;
15978 #endif
15979 if (likely(PyExceptionClass_Check(t))) {
15980 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
15981 } else {
15982 }
15983 }
15984 return 0;
15985 }
15986 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
15987 if (likely(err == exc_type)) return 1;
15988 if (likely(PyExceptionClass_Check(err))) {
15989 if (likely(PyExceptionClass_Check(exc_type))) {
15990 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
15991 } else if (likely(PyTuple_Check(exc_type))) {
15992 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
15993 } else {
15994 }
15995 }
15996 return PyErr_GivenExceptionMatches(err, exc_type);
15997 }
15998 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
15999 assert(PyExceptionClass_Check(exc_type1));
16000 assert(PyExceptionClass_Check(exc_type2));
16001 if (likely(err == exc_type1 || err == exc_type2)) return 1;
16002 if (likely(PyExceptionClass_Check(err))) {
16003 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
16004 }
16005 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
16006 }
16007 #endif
16008
1510416009 /* CheckBinaryVersion */
15105 static int __Pyx_check_binary_version(void) {
16010 static int __Pyx_check_binary_version(void) {
1510616011 char ctversion[4], rtversion[4];
1510716012 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
1510816013 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
1511816023 }
1511916024
1512016025 /* FunctionExport */
15121 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
16026 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
1512216027 PyObject *d = 0;
1512316028 PyObject *cobj = 0;
1512416029 union {
1515516060 }
1515616061
1515716062 /* ModuleImport */
15158 #ifndef __PYX_HAVE_RT_ImportModule
16063 #ifndef __PYX_HAVE_RT_ImportModule
1515916064 #define __PYX_HAVE_RT_ImportModule
1516016065 static PyObject *__Pyx_ImportModule(const char *name) {
1516116066 PyObject *py_name = 0;
1517316078 #endif
1517416079
1517516080 /* TypeImport */
15176 #ifndef __PYX_HAVE_RT_ImportType
16081 #ifndef __PYX_HAVE_RT_ImportType
1517716082 #define __PYX_HAVE_RT_ImportType
1517816083 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
1517916084 size_t size, int strict)
1523816143 #endif
1523916144
1524016145 /* FunctionImport */
15241 #ifndef __PYX_HAVE_RT_ImportFunction
16146 #ifndef __PYX_HAVE_RT_ImportFunction
1524216147 #define __PYX_HAVE_RT_ImportFunction
1524316148 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
1524416149 PyObject *d = 0;
1529216197 #endif
1529316198
1529416199 /* InitStrings */
15295 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
16200 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
1529616201 while (t->p) {
1529716202 #if PY_MAJOR_VERSION < 3
1529816203 if (t->is_unicode) {
1531716222 #endif
1531816223 if (!*t->p)
1531916224 return -1;
16225 if (PyObject_Hash(*t->p) == -1)
16226 return -1;
1532016227 ++t;
1532116228 }
1532216229 return 0;
1532516232 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
1532616233 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
1532716234 }
15328 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
16235 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
1532916236 Py_ssize_t ignore;
1533016237 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
1533116238 }
15332 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
15333 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
16239 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
16240 #if !CYTHON_PEP393_ENABLED
16241 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
16242 char* defenc_c;
16243 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
16244 if (!defenc) return NULL;
16245 defenc_c = PyBytes_AS_STRING(defenc);
16246 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
16247 {
16248 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
16249 char* c;
16250 for (c = defenc_c; c < end; c++) {
16251 if ((unsigned char) (*c) >= 128) {
16252 PyUnicode_AsASCIIString(o);
16253 return NULL;
16254 }
16255 }
16256 }
16257 #endif
16258 *length = PyBytes_GET_SIZE(defenc);
16259 return defenc_c;
16260 }
16261 #else
16262 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
16263 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
16264 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
16265 if (likely(PyUnicode_IS_ASCII(o))) {
16266 *length = PyUnicode_GET_LENGTH(o);
16267 return PyUnicode_AsUTF8(o);
16268 } else {
16269 PyUnicode_AsASCIIString(o);
16270 return NULL;
16271 }
16272 #else
16273 return PyUnicode_AsUTF8AndSize(o, length);
16274 #endif
16275 }
16276 #endif
16277 #endif
16278 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
16279 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1533416280 if (
1533516281 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1533616282 __Pyx_sys_getdefaultencoding_not_ascii &&
1533716283 #endif
1533816284 PyUnicode_Check(o)) {
15339 #if PY_VERSION_HEX < 0x03030000
15340 char* defenc_c;
15341 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
15342 if (!defenc) return NULL;
15343 defenc_c = PyBytes_AS_STRING(defenc);
15344 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
15345 {
15346 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
15347 char* c;
15348 for (c = defenc_c; c < end; c++) {
15349 if ((unsigned char) (*c) >= 128) {
15350 PyUnicode_AsASCIIString(o);
15351 return NULL;
15352 }
15353 }
15354 }
15355 #endif
15356 *length = PyBytes_GET_SIZE(defenc);
15357 return defenc_c;
15358 #else
15359 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
15360 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
15361 if (PyUnicode_IS_ASCII(o)) {
15362 *length = PyUnicode_GET_LENGTH(o);
15363 return PyUnicode_AsUTF8(o);
15364 } else {
15365 PyUnicode_AsASCIIString(o);
15366 return NULL;
15367 }
15368 #else
15369 return PyUnicode_AsUTF8AndSize(o, length);
15370 #endif
15371 #endif
16285 return __Pyx_PyUnicode_AsStringAndSize(o, length);
1537216286 } else
1537316287 #endif
1537416288 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
1539216306 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
1539316307 else return PyObject_IsTrue(x);
1539416308 }
16309 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
16310 #if PY_MAJOR_VERSION >= 3
16311 if (PyLong_Check(result)) {
16312 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
16313 "__int__ returned non-int (type %.200s). "
16314 "The ability to return an instance of a strict subclass of int "
16315 "is deprecated, and may be removed in a future version of Python.",
16316 Py_TYPE(result)->tp_name)) {
16317 Py_DECREF(result);
16318 return NULL;
16319 }
16320 return result;
16321 }
16322 #endif
16323 PyErr_Format(PyExc_TypeError,
16324 "__%.4s__ returned non-%.4s (type %.200s)",
16325 type_name, type_name, Py_TYPE(result)->tp_name);
16326 Py_DECREF(result);
16327 return NULL;
16328 }
1539516329 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
1539616330 #if CYTHON_USE_TYPE_SLOTS
1539716331 PyNumberMethods *m;
1539916333 const char *name = NULL;
1540016334 PyObject *res = NULL;
1540116335 #if PY_MAJOR_VERSION < 3
15402 if (PyInt_Check(x) || PyLong_Check(x))
16336 if (likely(PyInt_Check(x) || PyLong_Check(x)))
1540316337 #else
15404 if (PyLong_Check(x))
16338 if (likely(PyLong_Check(x)))
1540516339 #endif
1540616340 return __Pyx_NewRef(x);
1540716341 #if CYTHON_USE_TYPE_SLOTS
1540916343 #if PY_MAJOR_VERSION < 3
1541016344 if (m && m->nb_int) {
1541116345 name = "int";
15412 res = PyNumber_Int(x);
16346 res = m->nb_int(x);
1541316347 }
1541416348 else if (m && m->nb_long) {
1541516349 name = "long";
15416 res = PyNumber_Long(x);
16350 res = m->nb_long(x);
1541716351 }
1541816352 #else
15419 if (m && m->nb_int) {
16353 if (likely(m && m->nb_int)) {
1542016354 name = "int";
15421 res = PyNumber_Long(x);
16355 res = m->nb_int(x);
1542216356 }
1542316357 #endif
1542416358 #else
15425 res = PyNumber_Int(x);
15426 #endif
15427 if (res) {
16359 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
16360 res = PyNumber_Int(x);
16361 }
16362 #endif
16363 if (likely(res)) {
1542816364 #if PY_MAJOR_VERSION < 3
15429 if (!PyInt_Check(res) && !PyLong_Check(res)) {
16365 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
1543016366 #else
15431 if (!PyLong_Check(res)) {
15432 #endif
15433 PyErr_Format(PyExc_TypeError,
15434 "__%.4s__ returned non-%.4s (type %.200s)",
15435 name, name, Py_TYPE(res)->tp_name);
15436 Py_DECREF(res);
15437 return NULL;
16367 if (unlikely(!PyLong_CheckExact(res))) {
16368 #endif
16369 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
1543816370 }
1543916371 }
1544016372 else if (!PyErr_Occurred()) {
1550516437 Py_DECREF(x);
1550616438 return ival;
1550716439 }
16440 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
16441 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
16442 }
1550816443 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
1550916444 return PyInt_FromSize_t(ival);
1551016445 }
0 /* Generated by Cython 0.25.2 */
0 /* Generated by Cython 0.28.5 */
11
22 #define PY_SSIZE_T_CLEAN
33 #include "Python.h"
44 #ifndef Py_PYTHON_H
55 #error Python headers needed to compile C extensions, please install development version of Python.
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
7 #error Cython requires Python 2.6+ or Python 3.2+.
8 #else
9 #define CYTHON_ABI "0_25_2"
6 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
7 #error Cython requires Python 2.6+ or Python 3.3+.
8 #else
9 #define CYTHON_ABI "0_28_5"
10 #define CYTHON_FUTURE_DIVISION 1
1011 #include <stddef.h>
1112 #ifndef offsetof
1213 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
2829 #ifndef DL_EXPORT
2930 #define DL_EXPORT(t) t
3031 #endif
32 #define __PYX_COMMA ,
3133 #ifndef HAVE_LONG_LONG
32 #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34 #if PY_VERSION_HEX >= 0x02070000
3335 #define HAVE_LONG_LONG
3436 #endif
3537 #endif
4547 #define CYTHON_COMPILING_IN_CPYTHON 0
4648 #undef CYTHON_USE_TYPE_SLOTS
4749 #define CYTHON_USE_TYPE_SLOTS 0
48 #undef CYTHON_USE_ASYNC_SLOTS
49 #define CYTHON_USE_ASYNC_SLOTS 0
50 #undef CYTHON_USE_PYTYPE_LOOKUP
51 #define CYTHON_USE_PYTYPE_LOOKUP 0
52 #if PY_VERSION_HEX < 0x03050000
53 #undef CYTHON_USE_ASYNC_SLOTS
54 #define CYTHON_USE_ASYNC_SLOTS 0
55 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
56 #define CYTHON_USE_ASYNC_SLOTS 1
57 #endif
5058 #undef CYTHON_USE_PYLIST_INTERNALS
5159 #define CYTHON_USE_PYLIST_INTERNALS 0
5260 #undef CYTHON_USE_UNICODE_INTERNALS
6573 #define CYTHON_FAST_THREAD_STATE 0
6674 #undef CYTHON_FAST_PYCALL
6775 #define CYTHON_FAST_PYCALL 0
76 #undef CYTHON_PEP489_MULTI_PHASE_INIT
77 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
78 #undef CYTHON_USE_TP_FINALIZE
79 #define CYTHON_USE_TP_FINALIZE 0
6880 #elif defined(PYSTON_VERSION)
6981 #define CYTHON_COMPILING_IN_PYPY 0
7082 #define CYTHON_COMPILING_IN_PYSTON 1
7284 #ifndef CYTHON_USE_TYPE_SLOTS
7385 #define CYTHON_USE_TYPE_SLOTS 1
7486 #endif
87 #undef CYTHON_USE_PYTYPE_LOOKUP
88 #define CYTHON_USE_PYTYPE_LOOKUP 0
7589 #undef CYTHON_USE_ASYNC_SLOTS
7690 #define CYTHON_USE_ASYNC_SLOTS 0
7791 #undef CYTHON_USE_PYLIST_INTERNALS
96110 #define CYTHON_FAST_THREAD_STATE 0
97111 #undef CYTHON_FAST_PYCALL
98112 #define CYTHON_FAST_PYCALL 0
113 #undef CYTHON_PEP489_MULTI_PHASE_INIT
114 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
115 #undef CYTHON_USE_TP_FINALIZE
116 #define CYTHON_USE_TP_FINALIZE 0
99117 #else
100118 #define CYTHON_COMPILING_IN_PYPY 0
101119 #define CYTHON_COMPILING_IN_PYSTON 0
102120 #define CYTHON_COMPILING_IN_CPYTHON 1
103121 #ifndef CYTHON_USE_TYPE_SLOTS
104122 #define CYTHON_USE_TYPE_SLOTS 1
123 #endif
124 #if PY_VERSION_HEX < 0x02070000
125 #undef CYTHON_USE_PYTYPE_LOOKUP
126 #define CYTHON_USE_PYTYPE_LOOKUP 0
127 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
128 #define CYTHON_USE_PYTYPE_LOOKUP 1
105129 #endif
106130 #if PY_MAJOR_VERSION < 3
107131 #undef CYTHON_USE_ASYNC_SLOTS
142166 #ifndef CYTHON_FAST_PYCALL
143167 #define CYTHON_FAST_PYCALL 1
144168 #endif
169 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
170 #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
171 #endif
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
174 #endif
145175 #endif
146176 #if !defined(CYTHON_FAST_PYCCALL)
147177 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
152182 #undef BASE
153183 #undef MASK
154184 #endif
185 #ifndef __has_attribute
186 #define __has_attribute(x) 0
187 #endif
188 #ifndef __has_cpp_attribute
189 #define __has_cpp_attribute(x) 0
190 #endif
191 #ifndef CYTHON_RESTRICT
192 #if defined(__GNUC__)
193 #define CYTHON_RESTRICT __restrict__
194 #elif defined(_MSC_VER) && _MSC_VER >= 1400
195 #define CYTHON_RESTRICT __restrict
196 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
197 #define CYTHON_RESTRICT restrict
198 #else
199 #define CYTHON_RESTRICT
200 #endif
201 #endif
202 #ifndef CYTHON_UNUSED
203 # if defined(__GNUC__)
204 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
205 # define CYTHON_UNUSED __attribute__ ((__unused__))
206 # else
207 # define CYTHON_UNUSED
208 # endif
209 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
210 # define CYTHON_UNUSED __attribute__ ((__unused__))
211 # else
212 # define CYTHON_UNUSED
213 # endif
214 #endif
215 #ifndef CYTHON_MAYBE_UNUSED_VAR
216 # if defined(__cplusplus)
217 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
218 # else
219 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
220 # endif
221 #endif
222 #ifndef CYTHON_NCP_UNUSED
223 # if CYTHON_COMPILING_IN_CPYTHON
224 # define CYTHON_NCP_UNUSED
225 # else
226 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
227 # endif
228 #endif
229 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
230 #ifdef _MSC_VER
231 #ifndef _MSC_STDINT_H_
232 #if _MSC_VER < 1300
233 typedef unsigned char uint8_t;
234 typedef unsigned int uint32_t;
235 #else
236 typedef unsigned __int8 uint8_t;
237 typedef unsigned __int32 uint32_t;
238 #endif
239 #endif
240 #else
241 #include <stdint.h>
242 #endif
243 #ifndef CYTHON_FALLTHROUGH
244 #if defined(__cplusplus) && __cplusplus >= 201103L
245 #if __has_cpp_attribute(fallthrough)
246 #define CYTHON_FALLTHROUGH [[fallthrough]]
247 #elif __has_cpp_attribute(clang::fallthrough)
248 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
249 #elif __has_cpp_attribute(gnu::fallthrough)
250 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
251 #endif
252 #endif
253 #ifndef CYTHON_FALLTHROUGH
254 #if __has_attribute(fallthrough)
255 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
256 #else
257 #define CYTHON_FALLTHROUGH
258 #endif
259 #endif
260 #if defined(__clang__ ) && defined(__apple_build_version__)
261 #if __apple_build_version__ < 7000000
262 #undef CYTHON_FALLTHROUGH
263 #define CYTHON_FALLTHROUGH
264 #endif
265 #endif
266 #endif
267
268 #ifndef CYTHON_INLINE
269 #if defined(__clang__)
270 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
271 #elif defined(__GNUC__)
272 #define CYTHON_INLINE __inline__
273 #elif defined(_MSC_VER)
274 #define CYTHON_INLINE __inline
275 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
276 #define CYTHON_INLINE inline
277 #else
278 #define CYTHON_INLINE
279 #endif
280 #endif
281
155282 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
156283 #define Py_OptimizeFlag 0
157284 #endif
180307 #ifndef Py_TPFLAGS_HAVE_FINALIZE
181308 #define Py_TPFLAGS_HAVE_FINALIZE 0
182309 #endif
183 #ifndef METH_FASTCALL
184 #define METH_FASTCALL 0x80
185 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
186 Py_ssize_t nargs, PyObject *kwnames);
310 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
311 #ifndef METH_FASTCALL
312 #define METH_FASTCALL 0x80
313 #endif
314 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
315 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
316 Py_ssize_t nargs, PyObject *kwnames);
187317 #else
188318 #define __Pyx_PyCFunctionFast _PyCFunctionFast
319 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
189320 #endif
190321 #if CYTHON_FAST_PYCCALL
191322 #define __Pyx_PyFastCFunction_Check(func)\
192 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
323 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
193324 #else
194325 #define __Pyx_PyFastCFunction_Check(func) 0
326 #endif
327 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
328 #define PyObject_Malloc(s) PyMem_Malloc(s)
329 #define PyObject_Free(p) PyMem_Free(p)
330 #define PyObject_Realloc(p) PyMem_Realloc(p)
331 #endif
332 #if CYTHON_COMPILING_IN_PYSTON
333 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
334 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
335 #else
336 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
337 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
338 #endif
339 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
340 #define __Pyx_PyThreadState_Current PyThreadState_GET()
341 #elif PY_VERSION_HEX >= 0x03060000
342 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
343 #elif PY_VERSION_HEX >= 0x03000000
344 #define __Pyx_PyThreadState_Current PyThreadState_GET()
345 #else
346 #define __Pyx_PyThreadState_Current _PyThreadState_Current
347 #endif
348 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
349 #include "pythread.h"
350 #define Py_tss_NEEDS_INIT 0
351 typedef int Py_tss_t;
352 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
353 *key = PyThread_create_key();
354 return 0; // PyThread_create_key reports success always
355 }
356 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
357 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
358 *key = Py_tss_NEEDS_INIT;
359 return key;
360 }
361 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
362 PyObject_Free(key);
363 }
364 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
365 return *key != Py_tss_NEEDS_INIT;
366 }
367 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
368 PyThread_delete_key(*key);
369 *key = Py_tss_NEEDS_INIT;
370 }
371 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
372 return PyThread_set_key_value(*key, value);
373 }
374 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
375 return PyThread_get_key_value(*key);
376 }
377 #endif // TSS (Thread Specific Storage) API
378 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
379 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
380 #else
381 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
382 #endif
383 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
384 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
385 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
386 #else
387 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
388 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
389 #endif
390 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
391 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
392 #else
393 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
195394 #endif
196395 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
197396 #define CYTHON_PEP393_ENABLED 1
237436 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
238437 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
239438 #endif
240 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
241 #define PyObject_Malloc(s) PyMem_Malloc(s)
242 #define PyObject_Free(p) PyMem_Free(p)
243 #define PyObject_Realloc(p) PyMem_Realloc(p)
244 #endif
245 #if CYTHON_COMPILING_IN_PYSTON
246 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
247 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
248 #else
249 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
250 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
251 #endif
252439 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
253440 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
254441 #if PY_MAJOR_VERSION >= 3
265452 #define PyString_Type PyUnicode_Type
266453 #define PyString_Check PyUnicode_Check
267454 #define PyString_CheckExact PyUnicode_CheckExact
455 #define PyObject_Unicode PyObject_Str
268456 #endif
269457 #if PY_MAJOR_VERSION >= 3
270458 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
276464 #ifndef PySet_CheckExact
277465 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
278466 #endif
279 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
280 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
467 #if CYTHON_ASSUME_SAFE_MACROS
468 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
469 #else
470 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
471 #endif
281472 #if PY_MAJOR_VERSION >= 3
282473 #define PyIntObject PyLongObject
283474 #define PyInt_Type PyLong_Type
312503 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
313504 #endif
314505 #if PY_MAJOR_VERSION >= 3
315 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
506 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
316507 #else
317508 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
318509 #endif
321512 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
322513 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
323514 #else
515 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
516 #endif
517 #else
518 #define __Pyx_PyType_AsAsync(obj) NULL
519 #endif
520 #ifndef __Pyx_PyAsyncMethodsStruct
324521 typedef struct {
325522 unaryfunc am_await;
326523 unaryfunc am_aiter;
327524 unaryfunc am_anext;
328525 } __Pyx_PyAsyncMethodsStruct;
329 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
330 #endif
331 #else
332 #define __Pyx_PyType_AsAsync(obj) NULL
333 #endif
334 #ifndef CYTHON_RESTRICT
335 #if defined(__GNUC__)
336 #define CYTHON_RESTRICT __restrict__
337 #elif defined(_MSC_VER) && _MSC_VER >= 1400
338 #define CYTHON_RESTRICT __restrict
339 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
340 #define CYTHON_RESTRICT restrict
341 #else
342 #define CYTHON_RESTRICT
343 #endif
344 #endif
345 #ifndef CYTHON_UNUSED
346 # if defined(__GNUC__)
347 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
348 # define CYTHON_UNUSED __attribute__ ((__unused__))
349 # else
350 # define CYTHON_UNUSED
351 # endif
352 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
353 # define CYTHON_UNUSED __attribute__ ((__unused__))
354 # else
355 # define CYTHON_UNUSED
356 # endif
357 #endif
358 #ifndef CYTHON_MAYBE_UNUSED_VAR
359 # if defined(__cplusplus)
360 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
361 # else
362 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
363 # endif
364 #endif
365 #ifndef CYTHON_NCP_UNUSED
366 # if CYTHON_COMPILING_IN_CPYTHON
367 # define CYTHON_NCP_UNUSED
368 # else
369 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
370 # endif
371 #endif
372 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
373
374 #ifndef CYTHON_INLINE
375 #if defined(__clang__)
376 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
377 #elif defined(__GNUC__)
378 #define CYTHON_INLINE __inline__
379 #elif defined(_MSC_VER)
380 #define CYTHON_INLINE __inline
381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
382 #define CYTHON_INLINE inline
383 #else
384 #define CYTHON_INLINE
385 #endif
386526 #endif
387527
388528 #if defined(WIN32) || defined(MS_WINDOWS)
409549 { \
410550 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
411551 }
412
413 #if PY_MAJOR_VERSION >= 3
414 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
415 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
416 #else
417 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
418 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
419 #endif
420552
421553 #ifndef __PYX_EXTERN_C
422554 #ifdef __cplusplus
428560
429561 #define __PYX_HAVE__pygame_sdl2__transform
430562 #define __PYX_HAVE_API__pygame_sdl2__transform
563 /* Early includes */
431564 #include <stdint.h>
432565 #include <string.h>
433566 #include <stdio.h>
439572 #include <omp.h>
440573 #endif /* _OPENMP */
441574
442 #ifdef PYREX_WITHOUT_ASSERTIONS
575 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
443576 #define CYTHON_WITHOUT_ASSERTIONS
444577 #endif
445578
470603 #define __Pyx_sst_abs(value) abs(value)
471604 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
472605 #define __Pyx_sst_abs(value) labs(value)
473 #elif defined (_MSC_VER) && defined (_M_X64)
474 #define __Pyx_sst_abs(value) _abs64(value)
606 #elif defined (_MSC_VER)
607 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
475608 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
476609 #define __Pyx_sst_abs(value) llabs(value)
477610 #elif defined (__GNUC__)
479612 #else
480613 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
481614 #endif
482 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
483 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
615 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
616 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
484617 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
485618 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
486619 #define __Pyx_PyBytes_FromString PyBytes_FromString
493626 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
494627 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
495628 #endif
496 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
497 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
629 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
630 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
634 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
635 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
636 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
638 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
639 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
498640 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
499641 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
500642 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
501643 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
502644 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
503 #if PY_MAJOR_VERSION < 3
504 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
505 {
645 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
506646 const Py_UNICODE *u_end = u;
507647 while (*u_end++) ;
508648 return (size_t)(u_end - u - 1);
509649 }
510 #else
511 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
512 #endif
513650 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
514651 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
515652 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
516653 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
517654 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
518 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
655 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
519656 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
520657 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
658 #define __Pyx_PySequence_Tuple(obj)\
659 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
521660 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
522661 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
523662 #if CYTHON_ASSUME_SAFE_MACROS
616755 #define likely(x) (x)
617756 #define unlikely(x) (x)
618757 #endif /* __GNUC__ */
619
620 static PyObject *__pyx_m;
758 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
759
760 static PyObject *__pyx_m = NULL;
621761 static PyObject *__pyx_d;
622762 static PyObject *__pyx_b;
763 static PyObject *__pyx_cython_runtime = NULL;
623764 static PyObject *__pyx_empty_tuple;
624765 static PyObject *__pyx_empty_bytes;
625766 static PyObject *__pyx_empty_unicode;
633774 "src/pygame_sdl2/transform.pyx",
634775 "src/pygame_sdl2/surface.pxd",
635776 };
777 /* NoFastGil.proto */
778 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
779 #define __Pyx_PyGILState_Release PyGILState_Release
780 #define __Pyx_FastGIL_Remember()
781 #define __Pyx_FastGIL_Forget()
782 #define __Pyx_FastGilFuncInit()
783
784 /* ForceInitThreads.proto */
785 #ifndef __PYX_FORCE_INIT_THREADS
786 #define __PYX_FORCE_INIT_THREADS 0
787 #endif
788
636789
637790 /*--- Type declarations ---*/
638791 struct __pyx_obj_11pygame_sdl2_7surface_Surface;
733886
734887 /* PyObjectGetAttrStr.proto */
735888 #if CYTHON_USE_TYPE_SLOTS
736 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
737 PyTypeObject* tp = Py_TYPE(obj);
738 if (likely(tp->tp_getattro))
739 return tp->tp_getattro(obj, attr_name);
740 #if PY_MAJOR_VERSION < 3
741 if (likely(tp->tp_getattr))
742 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
743 #endif
744 return PyObject_GetAttr(obj, attr_name);
745 }
889 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
746890 #else
747891 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
748892 #endif
763907 const char* function_name);
764908
765909 /* ArgTypeTest.proto */
766 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
767 const char *name, int exact);
910 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
911 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
912 __Pyx__ArgTypeTest(obj, type, name, exact))
913 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
768914
769915 /* PyCFunctionFastCall.proto */
770916 #if CYTHON_FAST_PYCCALL
812958 /* PyThreadStateGet.proto */
813959 #if CYTHON_FAST_THREAD_STATE
814960 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
815 #define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
961 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
962 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
816963 #else
817964 #define __Pyx_PyThreadState_declare
818965 #define __Pyx_PyThreadState_assign
966 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
819967 #endif
820968
821969 /* PyErrFetchRestore.proto */
822970 #if CYTHON_FAST_THREAD_STATE
971 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
823972 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
824973 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
825974 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
826975 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
827976 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
828977 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
829 #else
978 #if CYTHON_COMPILING_IN_CPYTHON
979 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
980 #else
981 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
982 #endif
983 #else
984 #define __Pyx_PyErr_Clear() PyErr_Clear()
985 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
830986 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
831987 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
988 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
989 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
832990 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
833991 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
834992 #endif
835993
836994 /* RaiseException.proto */
837995 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
838
839 /* ForceInitThreads.proto */
840 #ifndef __PYX_FORCE_INIT_THREADS
841 #define __PYX_FORCE_INIT_THREADS 0
842 #endif
843996
844997 /* WriteUnraisableException.proto */
845998 static void __Pyx_WriteUnraisable(const char *name, int clineno,
8761029 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
8771030 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
8781031 int wraparound, int boundscheck);
879 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1032 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
8801033 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
8811034 int is_list, int wraparound, int boundscheck);
8821035
8881041
8891042 /* ImportFrom.proto */
8901043 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1044
1045 /* CLineInTraceback.proto */
1046 #ifdef CYTHON_CLINE_IN_TRACEBACK
1047 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1048 #else
1049 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1050 #endif
8911051
8921052 /* CodeObjectCache.proto */
8931053 typedef struct {
9201080 /* CIntFromPy.proto */
9211081 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
9221082
1083 /* FastTypeChecks.proto */
1084 #if CYTHON_COMPILING_IN_CPYTHON
1085 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1086 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1087 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1088 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1089 #else
1090 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1091 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1092 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1093 #endif
1094 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1095
9231096 /* CheckBinaryVersion.proto */
9241097 static int __Pyx_check_binary_version(void);
9251098
9611134 static uint32_t __pyx_f_11pygame_sdl2_9transform_get_at(SDL_Surface *, int, int); /*proto*/
9621135 static void __pyx_f_11pygame_sdl2_9transform_set_at(SDL_Surface *, int, int, uint32_t); /*proto*/
9631136 #define __Pyx_MODULE_NAME "pygame_sdl2.transform"
1137 extern int __pyx_module_is_main_pygame_sdl2__transform;
9641138 int __pyx_module_is_main_pygame_sdl2__transform = 0;
9651139
9661140 /* Implementation of 'pygame_sdl2.transform' */
10211195 static const char __pyx_k_smoothscale[] = "smoothscale";
10221196 static const char __pyx_k_get_bytesize[] = "get_bytesize";
10231197 static const char __pyx_k_pygame_sdl2_error[] = "pygame_sdl2.error";
1198 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
10241199 static const char __pyx_k_pygame_sdl2_transform[] = "pygame_sdl2.transform";
10251200 static const char __pyx_k_src_pygame_sdl2_transform_pyx[] = "src/pygame_sdl2/transform.pyx";
10261201 static const char __pyx_k_Surface_has_unsupported_bytesize[] = "Surface has unsupported bytesize.";
10301205 static PyObject *__pyx_n_s_angle;
10311206 static PyObject *__pyx_n_s_b;
10321207 static PyObject *__pyx_n_s_c;
1208 static PyObject *__pyx_n_s_cline_in_traceback;
10331209 static PyObject *__pyx_n_s_d;
10341210 static PyObject *__pyx_n_s_dest;
10351211 static PyObject *__pyx_n_s_dest_delta;
11081284 static PyObject *__pyx_codeobj__11;
11091285 static PyObject *__pyx_codeobj__13;
11101286 static PyObject *__pyx_codeobj__15;
1287 /* Late includes */
11111288
11121289 /* "pygame_sdl2/transform.pyx":26
11131290 *
11351312 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11361313 switch (pos_args) {
11371314 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1315 CYTHON_FALLTHROUGH;
11381316 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1317 CYTHON_FALLTHROUGH;
11391318 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1319 CYTHON_FALLTHROUGH;
11401320 case 0: break;
11411321 default: goto __pyx_L5_argtuple_error;
11421322 }
11431323 kw_args = PyDict_Size(__pyx_kwds);
11441324 switch (pos_args) {
11451325 case 0:
1146 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
1326 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
11471327 else goto __pyx_L5_argtuple_error;
1328 CYTHON_FALLTHROUGH;
11481329 case 1:
1149 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xbool)) != 0)) kw_args--;
1330 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xbool)) != 0)) kw_args--;
11501331 else {
11511332 __Pyx_RaiseArgtupleInvalid("flip", 1, 3, 3, 1); __PYX_ERR(0, 26, __pyx_L3_error)
11521333 }
1334 CYTHON_FALLTHROUGH;
11531335 case 2:
1154 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ybool)) != 0)) kw_args--;
1336 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ybool)) != 0)) kw_args--;
11551337 else {
11561338 __Pyx_RaiseArgtupleInvalid("flip", 1, 3, 3, 2); __PYX_ERR(0, 26, __pyx_L3_error)
11571339 }
13051487 #ifdef WITH_THREAD
13061488 PyThreadState *_save;
13071489 Py_UNBLOCK_THREADS
1490 __Pyx_FastGIL_Remember();
13081491 #endif
13091492 /*try:*/ {
13101493
14781661 /*finally:*/ {
14791662 /*normal exit:*/{
14801663 #ifdef WITH_THREAD
1664 __Pyx_FastGIL_Forget();
14811665 Py_BLOCK_THREADS
14821666 #endif
14831667 goto __pyx_L5;
15481732 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15491733 switch (pos_args) {
15501734 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1735 CYTHON_FALLTHROUGH;
15511736 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1737 CYTHON_FALLTHROUGH;
15521738 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1739 CYTHON_FALLTHROUGH;
15531740 case 0: break;
15541741 default: goto __pyx_L5_argtuple_error;
15551742 }
15561743 kw_args = PyDict_Size(__pyx_kwds);
15571744 switch (pos_args) {
15581745 case 0:
1559 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
1746 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
15601747 else goto __pyx_L5_argtuple_error;
1748 CYTHON_FALLTHROUGH;
15611749 case 1:
1562 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
1750 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
15631751 else {
15641752 __Pyx_RaiseArgtupleInvalid("scale", 0, 2, 3, 1); __PYX_ERR(0, 65, __pyx_L3_error)
15651753 }
1754 CYTHON_FALLTHROUGH;
15661755 case 2:
15671756 if (kw_args > 0) {
1568 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_DestSurface);
1757 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_DestSurface);
15691758 if (value) { values[2] = value; kw_args--; }
15701759 }
15711760 }
15751764 } else {
15761765 switch (PyTuple_GET_SIZE(__pyx_args)) {
15771766 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1767 CYTHON_FALLTHROUGH;
15781768 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15791769 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15801770 break;
16961886 #ifdef WITH_THREAD
16971887 PyThreadState *_save;
16981888 Py_UNBLOCK_THREADS
1889 __Pyx_FastGIL_Remember();
16991890 #endif
17001891 /*try:*/ {
17011892
17061897 * err = SDL_UpperBlitScaled(surface.surface, NULL, surf_out.surface, NULL)
17071898 *
17081899 */
1709 SDL_SetSurfaceBlendMode(__pyx_v_surface->surface, SDL_BLENDMODE_NONE);
1900 (void)(SDL_SetSurfaceBlendMode(__pyx_v_surface->surface, SDL_BLENDMODE_NONE));
17101901
17111902 /* "pygame_sdl2/transform.pyx":76
17121903 * with nogil:
17281919 /*finally:*/ {
17291920 /*normal exit:*/{
17301921 #ifdef WITH_THREAD
1922 __Pyx_FastGIL_Forget();
17311923 Py_BLOCK_THREADS
17321924 #endif
17331925 goto __pyx_L6;
17441936 *
17451937 */
17461938 __pyx_t_2 = ((__pyx_v_err != 0) != 0);
1747 if (__pyx_t_2) {
1939 if (unlikely(__pyx_t_2)) {
17481940
17491941 /* "pygame_sdl2/transform.pyx":79
17501942 *
18452037 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18462038 switch (pos_args) {
18472039 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2040 CYTHON_FALLTHROUGH;
18482041 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2042 CYTHON_FALLTHROUGH;
18492043 case 0: break;
18502044 default: goto __pyx_L5_argtuple_error;
18512045 }
18522046 kw_args = PyDict_Size(__pyx_kwds);
18532047 switch (pos_args) {
18542048 case 0:
1855 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
2049 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
18562050 else goto __pyx_L5_argtuple_error;
2051 CYTHON_FALLTHROUGH;
18572052 case 1:
1858 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_angle)) != 0)) kw_args--;
2053 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_angle)) != 0)) kw_args--;
18592054 else {
18602055 __Pyx_RaiseArgtupleInvalid("rotate", 1, 2, 2, 1); __PYX_ERR(0, 83, __pyx_L3_error)
18612056 }
20222217 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20232218 switch (pos_args) {
20242219 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2220 CYTHON_FALLTHROUGH;
20252221 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2222 CYTHON_FALLTHROUGH;
20262223 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2224 CYTHON_FALLTHROUGH;
20272225 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2226 CYTHON_FALLTHROUGH;
20282227 case 0: break;
20292228 default: goto __pyx_L5_argtuple_error;
20302229 }
20312230 kw_args = PyDict_Size(__pyx_kwds);
20322231 switch (pos_args) {
20332232 case 0:
2034 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
2233 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
20352234 else goto __pyx_L5_argtuple_error;
2235 CYTHON_FALLTHROUGH;
20362236 case 1:
2037 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_angle)) != 0)) kw_args--;
2237 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_angle)) != 0)) kw_args--;
20382238 else {
20392239 __Pyx_RaiseArgtupleInvalid("rotozoom", 0, 3, 4, 1); __PYX_ERR(0, 92, __pyx_L3_error)
20402240 }
2241 CYTHON_FALLTHROUGH;
20412242 case 2:
2042 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_scale)) != 0)) kw_args--;
2243 if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_scale)) != 0)) kw_args--;
20432244 else {
20442245 __Pyx_RaiseArgtupleInvalid("rotozoom", 0, 3, 4, 2); __PYX_ERR(0, 92, __pyx_L3_error)
20452246 }
2247 CYTHON_FALLTHROUGH;
20462248 case 3:
20472249 if (kw_args > 0) {
2048 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_smooth);
2250 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_smooth);
20492251 if (value) { values[3] = value; kw_args--; }
20502252 }
20512253 }
20552257 } else {
20562258 switch (PyTuple_GET_SIZE(__pyx_args)) {
20572259 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2260 CYTHON_FALLTHROUGH;
20582261 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20592262 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20602263 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
21222325 #ifdef WITH_THREAD
21232326 PyThreadState *_save;
21242327 Py_UNBLOCK_THREADS
2328 __Pyx_FastGIL_Remember();
21252329 #endif
21262330 /*try:*/ {
21272331
21452349 /*finally:*/ {
21462350 /*normal exit:*/{
21472351 #ifdef WITH_THREAD
2352 __Pyx_FastGIL_Forget();
21482353 Py_BLOCK_THREADS
21492354 #endif
21502355 goto __pyx_L5;
21612366 *
21622367 */
21632368 __pyx_t_1 = ((__pyx_v_rsurf == NULL) != 0);
2164 if (__pyx_t_1) {
2369 if (unlikely(__pyx_t_1)) {
21652370
21662371 /* "pygame_sdl2/transform.pyx":100
21672372 *
24072612 __pyx_t_2 = (sizeof(uint32_t));
24082613 if (unlikely(__pyx_t_2 == 0)) {
24092614 #ifdef WITH_THREAD
2410 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
2615 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
24112616 #endif
24122617 PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
24132618 #ifdef WITH_THREAD
2414 PyGILState_Release(__pyx_gilstate_save);
2619 __Pyx_PyGILState_Release(__pyx_gilstate_save);
24152620 #endif
24162621 __PYX_ERR(0, 118, __pyx_L1_error)
24172622 }
24462651
24472652 /* function exit code */
24482653 __pyx_L1_error:;
2449 __Pyx_WriteUnraisable("pygame_sdl2.transform.get_at", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
2654 __Pyx_WriteUnraisable("pygame_sdl2.transform.get_at", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
24502655 __pyx_r = 0;
24512656 __pyx_L0:;
24522657 return __pyx_r;
24832688 __pyx_t_1 = (sizeof(uint32_t));
24842689 if (unlikely(__pyx_t_1 == 0)) {
24852690 #ifdef WITH_THREAD
2486 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
2691 PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
24872692 #endif
24882693 PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
24892694 #ifdef WITH_THREAD
2490 PyGILState_Release(__pyx_gilstate_save);
2695 __Pyx_PyGILState_Release(__pyx_gilstate_save);
24912696 #endif
24922697 __PYX_ERR(0, 124, __pyx_L1_error)
24932698 }
25222727 /* function exit code */
25232728 goto __pyx_L0;
25242729 __pyx_L1_error:;
2525 __Pyx_WriteUnraisable("pygame_sdl2.transform.set_at", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
2730 __Pyx_WriteUnraisable("pygame_sdl2.transform.set_at", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
25262731 __pyx_L0:;
25272732 }
25282733
25522757 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
25532758 switch (pos_args) {
25542759 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2760 CYTHON_FALLTHROUGH;
25552761 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2762 CYTHON_FALLTHROUGH;
25562763 case 0: break;
25572764 default: goto __pyx_L5_argtuple_error;
25582765 }
25592766 kw_args = PyDict_Size(__pyx_kwds);
25602767 switch (pos_args) {
25612768 case 0:
2562 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
2769 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
25632770 else goto __pyx_L5_argtuple_error;
2771 CYTHON_FALLTHROUGH;
25642772 case 1:
25652773 if (kw_args > 0) {
2566 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_DestSurface);
2774 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_DestSurface);
25672775 if (value) { values[1] = value; kw_args--; }
25682776 }
25692777 }
25732781 } else {
25742782 switch (PyTuple_GET_SIZE(__pyx_args)) {
25752783 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2784 CYTHON_FALLTHROUGH;
25762785 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25772786 break;
25782787 default: goto __pyx_L5_argtuple_error;
26342843 int __pyx_t_9;
26352844 int __pyx_t_10;
26362845 int __pyx_t_11;
2637 uint32_t __pyx_t_12;
2846 int __pyx_t_12;
2847 int __pyx_t_13;
2848 uint32_t __pyx_t_14;
26382849 __Pyx_RefNannySetupContext("scale2x", 0);
26392850
26402851 /* "pygame_sdl2/transform.pyx":134
26682879 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26692880 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 134, __pyx_L1_error)
26702881 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2671 if (__pyx_t_4) {
2882 if (unlikely(__pyx_t_4)) {
26722883
26732884 /* "pygame_sdl2/transform.pyx":135
26742885 *
28913102 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28923103 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
28933104 PyObject* sequence = __pyx_t_1;
2894 #if !CYTHON_COMPILING_IN_PYPY
2895 Py_ssize_t size = Py_SIZE(sequence);
2896 #else
2897 Py_ssize_t size = PySequence_Size(sequence);
2898 #endif
3105 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
28993106 if (unlikely(size != 2)) {
29003107 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
29013108 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
29573164 #ifdef WITH_THREAD
29583165 PyThreadState *_save;
29593166 Py_UNBLOCK_THREADS
3167 __Pyx_FastGIL_Remember();
29603168 #endif
29613169 /*try:*/ {
29623170
29683176 * # Get the surrounding 9 pixels.
29693177 */
29703178 __pyx_t_8 = __pyx_v_width;
2971 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) {
2972 __pyx_v_x = __pyx_t_7;
3179 __pyx_t_7 = __pyx_t_8;
3180 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_7; __pyx_t_9+=1) {
3181 __pyx_v_x = __pyx_t_9;
29733182
29743183 /* "pygame_sdl2/transform.pyx":149
29753184 * with nogil:
29783187 * # Get the surrounding 9 pixels.
29793188 * a = get_at(surface.surface, x - 1, y - 1)
29803189 */
2981 __pyx_t_9 = __pyx_v_height;
2982 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
2983 __pyx_v_y = __pyx_t_10;
3190 __pyx_t_10 = __pyx_v_height;
3191 __pyx_t_11 = __pyx_t_10;
3192 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
3193 __pyx_v_y = __pyx_t_12;
29843194
29853195 /* "pygame_sdl2/transform.pyx":151
29863196 * for y in range(height):
30703280 * e0 = d if d == b else e
30713281 * e1 = f if b == f else e
30723282 */
3073 __pyx_t_11 = ((__pyx_v_b != __pyx_v_h) != 0);
3074 if (__pyx_t_11) {
3283 __pyx_t_13 = ((__pyx_v_b != __pyx_v_h) != 0);
3284 if (__pyx_t_13) {
30753285 } else {
3076 __pyx_t_4 = __pyx_t_11;
3286 __pyx_t_4 = __pyx_t_13;
30773287 goto __pyx_L15_bool_binop_done;
30783288 }
3079 __pyx_t_11 = ((__pyx_v_d != __pyx_v_f) != 0);
3080 __pyx_t_4 = __pyx_t_11;
3289 __pyx_t_13 = ((__pyx_v_d != __pyx_v_f) != 0);
3290 __pyx_t_4 = __pyx_t_13;
30813291 __pyx_L15_bool_binop_done:;
30823292 if (__pyx_t_4) {
30833293
30893299 * e2 = d if d == h else e
30903300 */
30913301 if (((__pyx_v_d == __pyx_v_b) != 0)) {
3092 __pyx_t_12 = __pyx_v_d;
3302 __pyx_t_14 = __pyx_v_d;
30933303 } else {
3094 __pyx_t_12 = __pyx_v_e;
3304 __pyx_t_14 = __pyx_v_e;
30953305 }
3096 __pyx_v_e0 = __pyx_t_12;
3306 __pyx_v_e0 = __pyx_t_14;
30973307
30983308 /* "pygame_sdl2/transform.pyx":166
30993309 * if b != h and d != f:
31033313 * e3 = f if h == f else e
31043314 */
31053315 if (((__pyx_v_b == __pyx_v_f) != 0)) {
3106 __pyx_t_12 = __pyx_v_f;
3316 __pyx_t_14 = __pyx_v_f;
31073317 } else {
3108 __pyx_t_12 = __pyx_v_e;
3318 __pyx_t_14 = __pyx_v_e;
31093319 }
3110 __pyx_v_e1 = __pyx_t_12;
3320 __pyx_v_e1 = __pyx_t_14;
31113321
31123322 /* "pygame_sdl2/transform.pyx":167
31133323 * e0 = d if d == b else e
31173327 * else:
31183328 */
31193329 if (((__pyx_v_d == __pyx_v_h) != 0)) {
3120 __pyx_t_12 = __pyx_v_d;
3330 __pyx_t_14 = __pyx_v_d;
31213331 } else {
3122 __pyx_t_12 = __pyx_v_e;
3332 __pyx_t_14 = __pyx_v_e;
31233333 }
3124 __pyx_v_e2 = __pyx_t_12;
3334 __pyx_v_e2 = __pyx_t_14;
31253335
31263336 /* "pygame_sdl2/transform.pyx":168
31273337 * e1 = f if b == f else e
31313341 * e0 = e1 = e2 = e3 = e
31323342 */
31333343 if (((__pyx_v_h == __pyx_v_f) != 0)) {
3134 __pyx_t_12 = __pyx_v_f;
3344 __pyx_t_14 = __pyx_v_f;
31353345 } else {
3136 __pyx_t_12 = __pyx_v_e;
3346 __pyx_t_14 = __pyx_v_e;
31373347 }
3138 __pyx_v_e3 = __pyx_t_12;
3348 __pyx_v_e3 = __pyx_t_14;
31393349
31403350 /* "pygame_sdl2/transform.pyx":164
31413351 *
32113421 /*finally:*/ {
32123422 /*normal exit:*/{
32133423 #ifdef WITH_THREAD
3424 __Pyx_FastGIL_Forget();
32143425 Py_BLOCK_THREADS
32153426 #endif
32163427 goto __pyx_L9;
33393550 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
33403551 switch (pos_args) {
33413552 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3553 CYTHON_FALLTHROUGH;
33423554 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3555 CYTHON_FALLTHROUGH;
33433556 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3557 CYTHON_FALLTHROUGH;
33443558 case 0: break;
33453559 default: goto __pyx_L5_argtuple_error;
33463560 }
33473561 kw_args = PyDict_Size(__pyx_kwds);
33483562 switch (pos_args) {
33493563 case 0:
3350 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
3564 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_surface)) != 0)) kw_args--;
33513565 else goto __pyx_L5_argtuple_error;
3566 CYTHON_FALLTHROUGH;
33523567 case 1:
3353 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
3568 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_size)) != 0)) kw_args--;
33543569 else {
33553570 __Pyx_RaiseArgtupleInvalid("smoothscale", 0, 2, 3, 1); __PYX_ERR(0, 182, __pyx_L3_error)
33563571 }
3572 CYTHON_FALLTHROUGH;
33573573 case 2:
33583574 if (kw_args > 0) {
3359 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_DestSurface);
3575 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_DestSurface);
33603576 if (value) { values[2] = value; kw_args--; }
33613577 }
33623578 }
33663582 } else {
33673583 switch (PyTuple_GET_SIZE(__pyx_args)) {
33683584 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3585 CYTHON_FALLTHROUGH;
33693586 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
33703587 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
33713588 break;
34693686 #ifdef WITH_THREAD
34703687 PyThreadState *_save;
34713688 Py_UNBLOCK_THREADS
3689 __Pyx_FastGIL_Remember();
34723690 #endif
34733691 /*try:*/ {
34743692
34923710 /*finally:*/ {
34933711 /*normal exit:*/{
34943712 #ifdef WITH_THREAD
3713 __Pyx_FastGIL_Forget();
34953714 Py_BLOCK_THREADS
34963715 #endif
34973716 goto __pyx_L5;
35083727 *
35093728 */
35103729 __pyx_t_5 = ((__pyx_v_rsurf == NULL) != 0);
3511 if (__pyx_t_5) {
3730 if (unlikely(__pyx_t_5)) {
35123731
35133732 /* "pygame_sdl2/transform.pyx":193
35143733 *
35923811 #ifdef WITH_THREAD
35933812 PyThreadState *_save;
35943813 Py_UNBLOCK_THREADS
3814 __Pyx_FastGIL_Remember();
35953815 #endif
35963816 /*try:*/ {
35973817
36023822 * SDL_UpperBlit(rv.surface, NULL, DestSurface.surface, NULL)
36033823 *
36043824 */
3605 SDL_SetSurfaceBlendMode(__pyx_v_rv->surface, SDL_BLENDMODE_NONE);
3825 (void)(SDL_SetSurfaceBlendMode(__pyx_v_rv->surface, SDL_BLENDMODE_NONE));
36063826
36073827 /* "pygame_sdl2/transform.pyx":202
36083828 * with nogil:
36113831 *
36123832 * return rv
36133833 */
3614 SDL_UpperBlit(__pyx_v_rv->surface, NULL, __pyx_v_DestSurface->surface, NULL);
3834 (void)(SDL_UpperBlit(__pyx_v_rv->surface, NULL, __pyx_v_DestSurface->surface, NULL));
36153835 }
36163836
36173837 /* "pygame_sdl2/transform.pyx":200
36243844 /*finally:*/ {
36253845 /*normal exit:*/{
36263846 #ifdef WITH_THREAD
3847 __Pyx_FastGIL_Forget();
36273848 Py_BLOCK_THREADS
36283849 #endif
36293850 goto __pyx_L10;
36783899 };
36793900
36803901 #if PY_MAJOR_VERSION >= 3
3902 #if CYTHON_PEP489_MULTI_PHASE_INIT
3903 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
3904 static int __pyx_pymod_exec_transform(PyObject* module); /*proto*/
3905 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
3906 {Py_mod_create, (void*)__pyx_pymod_create},
3907 {Py_mod_exec, (void*)__pyx_pymod_exec_transform},
3908 {0, NULL}
3909 };
3910 #endif
3911
36813912 static struct PyModuleDef __pyx_moduledef = {
3682 #if PY_VERSION_HEX < 0x03020000
3683 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
3684 #else
36853913 PyModuleDef_HEAD_INIT,
3686 #endif
36873914 "transform",
36883915 0, /* m_doc */
3916 #if CYTHON_PEP489_MULTI_PHASE_INIT
3917 0, /* m_size */
3918 #else
36893919 -1, /* m_size */
3920 #endif
36903921 __pyx_methods /* m_methods */,
3922 #if CYTHON_PEP489_MULTI_PHASE_INIT
3923 __pyx_moduledef_slots, /* m_slots */
3924 #else
36913925 NULL, /* m_reload */
3926 #endif
36923927 NULL, /* m_traverse */
36933928 NULL, /* m_clear */
36943929 NULL /* m_free */
37023937 {&__pyx_n_s_angle, __pyx_k_angle, sizeof(__pyx_k_angle), 0, 0, 1, 1},
37033938 {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
37043939 {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
3940 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
37053941 {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
37063942 {&__pyx_n_s_dest, __pyx_k_dest, sizeof(__pyx_k_dest), 0, 0, 1, 1},
37073943 {&__pyx_n_s_dest_delta, __pyx_k_dest_delta, sizeof(__pyx_k_dest_delta), 0, 0, 1, 1},
38114047 __pyx_tuple__4 = PyTuple_Pack(11, __pyx_n_s_surface, __pyx_n_s_xbool, __pyx_n_s_ybool, __pyx_n_s_rv, __pyx_n_s_src, __pyx_n_s_dest, __pyx_n_s_src_pixel, __pyx_n_s_src_end, __pyx_n_s_dest_pixel, __pyx_n_s_dest_delta, __pyx_n_s_y); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 26, __pyx_L1_error)
38124048 __Pyx_GOTREF(__pyx_tuple__4);
38134049 __Pyx_GIVEREF(__pyx_tuple__4);
3814 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_flip, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 26, __pyx_L1_error)
4050 __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(3, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_flip, 26, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 26, __pyx_L1_error)
38154051
38164052 /* "pygame_sdl2/transform.pyx":65
38174053 *
38234059 __pyx_tuple__6 = PyTuple_Pack(5, __pyx_n_s_surface, __pyx_n_s_size, __pyx_n_s_DestSurface, __pyx_n_s_surf_out, __pyx_n_s_err); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 65, __pyx_L1_error)
38244060 __Pyx_GOTREF(__pyx_tuple__6);
38254061 __Pyx_GIVEREF(__pyx_tuple__6);
3826 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_scale, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 65, __pyx_L1_error)
4062 __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_scale, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 65, __pyx_L1_error)
38274063
38284064 /* "pygame_sdl2/transform.pyx":83
38294065 * return surf_out
38354071 __pyx_tuple__8 = PyTuple_Pack(2, __pyx_n_s_surface, __pyx_n_s_angle); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 83, __pyx_L1_error)
38364072 __Pyx_GOTREF(__pyx_tuple__8);
38374073 __Pyx_GIVEREF(__pyx_tuple__8);
3838 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_rotate, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 83, __pyx_L1_error)
4074 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_rotate, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 83, __pyx_L1_error)
38394075
38404076 /* "pygame_sdl2/transform.pyx":92
38414077 * return rotozoom(surface, angle, 1.0, SMOOTHING_OFF)
38474083 __pyx_tuple__10 = PyTuple_Pack(6, __pyx_n_s_surface, __pyx_n_s_angle, __pyx_n_s_scale, __pyx_n_s_smooth, __pyx_n_s_rsurf, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 92, __pyx_L1_error)
38484084 __Pyx_GOTREF(__pyx_tuple__10);
38494085 __Pyx_GIVEREF(__pyx_tuple__10);
3850 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_rotozoom, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 92, __pyx_L1_error)
4086 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_rotozoom, 92, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 92, __pyx_L1_error)
38514087
38524088 /* "pygame_sdl2/transform.pyx":128
38534089 * p[0] = color
38594095 __pyx_tuple__12 = PyTuple_Pack(20, __pyx_n_s_surface, __pyx_n_s_DestSurface, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_c, __pyx_n_s_d, __pyx_n_s_e, __pyx_n_s_f, __pyx_n_s_g, __pyx_n_s_h, __pyx_n_s_i, __pyx_n_s_e0, __pyx_n_s_e1, __pyx_n_s_e2, __pyx_n_s_e3, __pyx_n_s_surf_out, __pyx_n_s_width, __pyx_n_s_height); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 128, __pyx_L1_error)
38604096 __Pyx_GOTREF(__pyx_tuple__12);
38614097 __Pyx_GIVEREF(__pyx_tuple__12);
3862 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_scale2x, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 128, __pyx_L1_error)
4098 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_scale2x, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 128, __pyx_L1_error)
38634099
38644100 /* "pygame_sdl2/transform.pyx":182
38654101 * return surf_out
38714107 __pyx_tuple__14 = PyTuple_Pack(7, __pyx_n_s_surface, __pyx_n_s_size, __pyx_n_s_DestSurface, __pyx_n_s_scale_x, __pyx_n_s_scale_y, __pyx_n_s_rsurf, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 182, __pyx_L1_error)
38724108 __Pyx_GOTREF(__pyx_tuple__14);
38734109 __Pyx_GIVEREF(__pyx_tuple__14);
3874 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_smoothscale, 182, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 182, __pyx_L1_error)
4110 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_transform_pyx, __pyx_n_s_smoothscale, 182, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 182, __pyx_L1_error)
38754111 __Pyx_RefNannyFinishContext();
38764112 return 0;
38774113 __pyx_L1_error:;
38904126 return -1;
38914127 }
38924128
4129 static int __Pyx_modinit_global_init_code(void); /*proto*/
4130 static int __Pyx_modinit_variable_export_code(void); /*proto*/
4131 static int __Pyx_modinit_function_export_code(void); /*proto*/
4132 static int __Pyx_modinit_type_init_code(void); /*proto*/
4133 static int __Pyx_modinit_type_import_code(void); /*proto*/
4134 static int __Pyx_modinit_variable_import_code(void); /*proto*/
4135 static int __Pyx_modinit_function_import_code(void); /*proto*/
4136
4137 static int __Pyx_modinit_global_init_code(void) {
4138 __Pyx_RefNannyDeclarations
4139 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
4140 /*--- Global init code ---*/
4141 __Pyx_RefNannyFinishContext();
4142 return 0;
4143 }
4144
4145 static int __Pyx_modinit_variable_export_code(void) {
4146 __Pyx_RefNannyDeclarations
4147 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
4148 /*--- Variable export code ---*/
4149 __Pyx_RefNannyFinishContext();
4150 return 0;
4151 }
4152
4153 static int __Pyx_modinit_function_export_code(void) {
4154 __Pyx_RefNannyDeclarations
4155 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
4156 /*--- Function export code ---*/
4157 __Pyx_RefNannyFinishContext();
4158 return 0;
4159 }
4160
4161 static int __Pyx_modinit_type_init_code(void) {
4162 __Pyx_RefNannyDeclarations
4163 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
4164 /*--- Type init code ---*/
4165 __Pyx_RefNannyFinishContext();
4166 return 0;
4167 }
4168
4169 static int __Pyx_modinit_type_import_code(void) {
4170 __Pyx_RefNannyDeclarations
4171 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
4172 /*--- Type import code ---*/
4173 __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
4174 __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
4175 __Pyx_RefNannyFinishContext();
4176 return 0;
4177 __pyx_L1_error:;
4178 __Pyx_RefNannyFinishContext();
4179 return -1;
4180 }
4181
4182 static int __Pyx_modinit_variable_import_code(void) {
4183 __Pyx_RefNannyDeclarations
4184 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
4185 /*--- Variable import code ---*/
4186 __Pyx_RefNannyFinishContext();
4187 return 0;
4188 }
4189
4190 static int __Pyx_modinit_function_import_code(void) {
4191 __Pyx_RefNannyDeclarations
4192 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
4193 /*--- Function import code ---*/
4194 __Pyx_RefNannyFinishContext();
4195 return 0;
4196 }
4197
4198
38934199 #if PY_MAJOR_VERSION < 3
3894 PyMODINIT_FUNC inittransform(void); /*proto*/
3895 PyMODINIT_FUNC inittransform(void)
3896 #else
3897 PyMODINIT_FUNC PyInit_transform(void); /*proto*/
3898 PyMODINIT_FUNC PyInit_transform(void)
4200 #ifdef CYTHON_NO_PYINIT_EXPORT
4201 #define __Pyx_PyMODINIT_FUNC void
4202 #else
4203 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
4204 #endif
4205 #else
4206 #ifdef CYTHON_NO_PYINIT_EXPORT
4207 #define __Pyx_PyMODINIT_FUNC PyObject *
4208 #else
4209 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
4210 #endif
4211 #endif
4212 #ifndef CYTHON_SMALL_CODE
4213 #if defined(__clang__)
4214 #define CYTHON_SMALL_CODE
4215 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
4216 #define CYTHON_SMALL_CODE __attribute__((cold))
4217 #else
4218 #define CYTHON_SMALL_CODE
4219 #endif
4220 #endif
4221
4222
4223 #if PY_MAJOR_VERSION < 3
4224 __Pyx_PyMODINIT_FUNC inittransform(void) CYTHON_SMALL_CODE; /*proto*/
4225 __Pyx_PyMODINIT_FUNC inittransform(void)
4226 #else
4227 __Pyx_PyMODINIT_FUNC PyInit_transform(void) CYTHON_SMALL_CODE; /*proto*/
4228 __Pyx_PyMODINIT_FUNC PyInit_transform(void)
4229 #if CYTHON_PEP489_MULTI_PHASE_INIT
4230 {
4231 return PyModuleDef_Init(&__pyx_moduledef);
4232 }
4233 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
4234 PyObject *value = PyObject_GetAttrString(spec, from_name);
4235 int result = 0;
4236 if (likely(value)) {
4237 result = PyDict_SetItemString(moddict, to_name, value);
4238 Py_DECREF(value);
4239 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
4240 PyErr_Clear();
4241 } else {
4242 result = -1;
4243 }
4244 return result;
4245 }
4246 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
4247 PyObject *module = NULL, *moddict, *modname;
4248 if (__pyx_m)
4249 return __Pyx_NewRef(__pyx_m);
4250 modname = PyObject_GetAttrString(spec, "name");
4251 if (unlikely(!modname)) goto bad;
4252 module = PyModule_NewObject(modname);
4253 Py_DECREF(modname);
4254 if (unlikely(!module)) goto bad;
4255 moddict = PyModule_GetDict(module);
4256 if (unlikely(!moddict)) goto bad;
4257 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
4258 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
4259 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
4260 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
4261 return module;
4262 bad:
4263 Py_XDECREF(module);
4264 return NULL;
4265 }
4266
4267
4268 static int __pyx_pymod_exec_transform(PyObject *__pyx_pyinit_module)
4269 #endif
38994270 #endif
39004271 {
39014272 PyObject *__pyx_t_1 = NULL;
39024273 PyObject *__pyx_t_2 = NULL;
39034274 __Pyx_RefNannyDeclarations
4275 #if CYTHON_PEP489_MULTI_PHASE_INIT
4276 if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
4277 #elif PY_MAJOR_VERSION >= 3
4278 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
4279 #endif
39044280 #if CYTHON_REFNANNY
3905 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
3906 if (!__Pyx_RefNanny) {
3907 PyErr_Clear();
3908 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
3909 if (!__Pyx_RefNanny)
3910 Py_FatalError("failed to import 'refnanny' module");
3911 }
3912 #endif
3913 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_transform(void)", 0);
4281 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
4282 if (!__Pyx_RefNanny) {
4283 PyErr_Clear();
4284 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
4285 if (!__Pyx_RefNanny)
4286 Py_FatalError("failed to import 'refnanny' module");
4287 }
4288 #endif
4289 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_transform(void)", 0);
39144290 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39154291 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
39164292 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
39274303 #ifdef __Pyx_Generator_USED
39284304 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39294305 #endif
4306 #ifdef __Pyx_AsyncGen_USED
4307 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
4308 #endif
39304309 #ifdef __Pyx_StopAsyncIteration_USED
39314310 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39324311 #endif
39384317 #endif
39394318 #endif
39404319 /*--- Module creation code ---*/
4320 #if CYTHON_PEP489_MULTI_PHASE_INIT
4321 __pyx_m = __pyx_pyinit_module;
4322 Py_INCREF(__pyx_m);
4323 #else
39414324 #if PY_MAJOR_VERSION < 3
39424325 __pyx_m = Py_InitModule4("transform", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
39434326 #else
39444327 __pyx_m = PyModule_Create(&__pyx_moduledef);
39454328 #endif
39464329 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
4330 #endif
39474331 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
39484332 Py_INCREF(__pyx_d);
39494333 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
4334 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
39504335 #if CYTHON_COMPILING_IN_PYPY
39514336 Py_INCREF(__pyx_b);
39524337 #endif
39714356 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
39724357 /*--- Constants init code ---*/
39734358 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
3974 /*--- Global init code ---*/
3975 /*--- Variable export code ---*/
3976 /*--- Function export code ---*/
3977 /*--- Type init code ---*/
3978 /*--- Type import code ---*/
3979 __pyx_ptype_11pygame_sdl2_7surface_Surface = __Pyx_ImportType("pygame_sdl2.surface", "Surface", sizeof(struct __pyx_obj_11pygame_sdl2_7surface_Surface), 1); if (unlikely(!__pyx_ptype_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
3980 __pyx_vtabptr_11pygame_sdl2_7surface_Surface = (struct __pyx_vtabstruct_11pygame_sdl2_7surface_Surface*)__Pyx_GetVtable(__pyx_ptype_11pygame_sdl2_7surface_Surface->tp_dict); if (unlikely(!__pyx_vtabptr_11pygame_sdl2_7surface_Surface)) __PYX_ERR(1, 23, __pyx_L1_error)
3981 /*--- Variable import code ---*/
3982 /*--- Function import code ---*/
4359 /*--- Global type/function init code ---*/
4360 (void)__Pyx_modinit_global_init_code();
4361 (void)__Pyx_modinit_variable_export_code();
4362 (void)__Pyx_modinit_function_export_code();
4363 (void)__Pyx_modinit_type_init_code();
4364 if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
4365 (void)__Pyx_modinit_variable_import_code();
4366 (void)__Pyx_modinit_function_import_code();
39834367 /*--- Execution code ---*/
39844368 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
39854369 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
40834467 * # Tom Rothamel <tom@rothamel.us>
40844468 * #
40854469 */
4086 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
4470 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
40874471 __Pyx_GOTREF(__pyx_t_2);
40884472 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
40894473 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
40964480 __Pyx_XDECREF(__pyx_t_2);
40974481 if (__pyx_m) {
40984482 if (__pyx_d) {
4099 __Pyx_AddTraceback("init pygame_sdl2.transform", __pyx_clineno, __pyx_lineno, __pyx_filename);
4483 __Pyx_AddTraceback("init pygame_sdl2.transform", 0, __pyx_lineno, __pyx_filename);
41004484 }
41014485 Py_DECREF(__pyx_m); __pyx_m = 0;
41024486 } else if (!PyErr_Occurred()) {
41044488 }
41054489 __pyx_L0:;
41064490 __Pyx_RefNannyFinishContext();
4107 #if PY_MAJOR_VERSION < 3
4491 #if CYTHON_PEP489_MULTI_PHASE_INIT
4492 return (__pyx_m != NULL) ? 0 : -1;
4493 #elif PY_MAJOR_VERSION >= 3
4494 return __pyx_m;
4495 #else
41084496 return;
4109 #else
4110 return __pyx_m;
41114497 #endif
41124498 }
41134499
41264512 Py_XDECREF(p);
41274513 Py_XDECREF(m);
41284514 return (__Pyx_RefNannyAPIStruct *)r;
4515 }
4516 #endif
4517
4518 /* PyObjectGetAttrStr */
4519 #if CYTHON_USE_TYPE_SLOTS
4520 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
4521 PyTypeObject* tp = Py_TYPE(obj);
4522 if (likely(tp->tp_getattro))
4523 return tp->tp_getattro(obj, attr_name);
4524 #if PY_MAJOR_VERSION < 3
4525 if (likely(tp->tp_getattr))
4526 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
4527 #endif
4528 return PyObject_GetAttr(obj, attr_name);
41294529 }
41304530 #endif
41314531
42864686 }
42874687
42884688 /* ArgTypeTest */
4289 static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
4290 PyErr_Format(PyExc_TypeError,
4291 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
4292 name, type->tp_name, Py_TYPE(obj)->tp_name);
4293 }
4294 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
4295 const char *name, int exact)
4689 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
42964690 {
42974691 if (unlikely(!type)) {
42984692 PyErr_SetString(PyExc_SystemError, "Missing type object");
42994693 return 0;
43004694 }
4301 if (none_allowed && obj == Py_None) return 1;
43024695 else if (exact) {
4303 if (likely(Py_TYPE(obj) == type)) return 1;
43044696 #if PY_MAJOR_VERSION == 2
4305 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
4697 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
43064698 #endif
43074699 }
43084700 else {
4309 if (likely(PyObject_TypeCheck(obj, type))) return 1;
4310 }
4311 __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
4701 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
4702 }
4703 PyErr_Format(PyExc_TypeError,
4704 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
4705 name, type->tp_name, Py_TYPE(obj)->tp_name);
43124706 return 0;
43134707 }
43144708
43184712 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
43194713 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
43204714 PyObject *self = PyCFunction_GET_SELF(func);
4715 int flags = PyCFunction_GET_FLAGS(func);
43214716 assert(PyCFunction_Check(func));
4322 assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
4717 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
43234718 assert(nargs >= 0);
43244719 assert(nargs == 0 || args != NULL);
43254720 /* _PyCFunction_FastCallDict() must not be called with an exception set,
43264721 because it may clear it (directly or indirectly) and so the
43274722 caller loses its exception */
43284723 assert(!PyErr_Occurred());
4329 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
4330 }
4331 #endif // CYTHON_FAST_PYCCALL
4724 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
4725 return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
4726 } else {
4727 return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
4728 }
4729 }
4730 #endif
43324731
43334732 /* PyFunctionFastCall */
43344733 #if CYTHON_FAST_PYCALL
43364735 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
43374736 PyObject *globals) {
43384737 PyFrameObject *f;
4339 PyThreadState *tstate = PyThreadState_GET();
4738 PyThreadState *tstate = __Pyx_PyThreadState_Current;
43404739 PyObject **fastlocals;
43414740 Py_ssize_t i;
43424741 PyObject *result;
44474846 Py_LeaveRecursiveCall();
44484847 return result;
44494848 }
4450 #endif // CPython < 3.6
4451 #endif // CYTHON_FAST_PYCALL
4849 #endif
4850 #endif
44524851
44534852 /* PyObjectCall */
44544853 #if CYTHON_COMPILING_IN_CPYTHON
45084907 return __Pyx_PyFunction_FastCall(func, &arg, 1);
45094908 }
45104909 #endif
4511 #ifdef __Pyx_CyFunction_USED
4512 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
4513 #else
45144910 if (likely(PyCFunction_Check(func))) {
4515 #endif
45164911 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
45174912 return __Pyx_PyObject_CallMethO(func, arg);
45184913 #if CYTHON_FAST_PYCCALL
45354930 #endif
45364931
45374932 /* PyObjectCallNoArg */
4538 #if CYTHON_COMPILING_IN_CPYTHON
4933 #if CYTHON_COMPILING_IN_CPYTHON
45394934 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
45404935 #if CYTHON_FAST_PYCALL
45414936 if (PyFunction_Check(func)) {
45434938 }
45444939 #endif
45454940 #ifdef __Pyx_CyFunction_USED
4546 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
4941 if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
45474942 #else
45484943 if (likely(PyCFunction_Check(func))) {
45494944 #endif
45564951 #endif
45574952
45584953 /* GetModuleGlobalName */
4559 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
4954 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
45604955 PyObject *result;
45614956 #if !CYTHON_AVOID_BORROWED_REFS
4957 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
4958 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
4959 if (likely(result)) {
4960 Py_INCREF(result);
4961 } else if (unlikely(PyErr_Occurred())) {
4962 result = NULL;
4963 } else {
4964 #else
45624965 result = PyDict_GetItem(__pyx_d, name);
45634966 if (likely(result)) {
45644967 Py_INCREF(result);
45654968 } else {
4969 #endif
45664970 #else
45674971 result = PyObject_GetItem(__pyx_d, name);
45684972 if (!result) {
47135117 "raise: exception class must be a subclass of BaseException");
47145118 goto bad;
47155119 }
4716 #if PY_VERSION_HEX >= 0x03030000
47175120 if (cause) {
4718 #else
4719 if (cause && cause != Py_None) {
4720 #endif
47215121 PyObject *fixed_cause;
47225122 if (cause == Py_None) {
47235123 fixed_cause = NULL;
47455145 PyErr_Restore(tmp_type, tmp_value, tb);
47465146 Py_XDECREF(tmp_tb);
47475147 #else
4748 PyThreadState *tstate = PyThreadState_GET();
5148 PyThreadState *tstate = __Pyx_PyThreadState_Current;
47495149 PyObject* tmp_tb = tstate->curexc_traceback;
47505150 if (tb != tmp_tb) {
47515151 Py_INCREF(tb);
47615161 #endif
47625162
47635163 /* WriteUnraisableException */
4764 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
5164 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
47655165 CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
47665166 int full_traceback, CYTHON_UNUSED int nogil) {
47675167 PyObject *old_exc, *old_val, *old_tb;
48035203 }
48045204
48055205 /* RaiseTooManyValuesToUnpack */
4806 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
5206 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
48075207 PyErr_Format(PyExc_ValueError,
48085208 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
48095209 }
48105210
48115211 /* RaiseNeedMoreValuesToUnpack */
4812 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
5212 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
48135213 PyErr_Format(PyExc_ValueError,
48145214 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
48155215 index, (index == 1) ? "" : "s");
48165216 }
48175217
48185218 /* IterFinish */
4819 static CYTHON_INLINE int __Pyx_IterFinish(void) {
5219 static CYTHON_INLINE int __Pyx_IterFinish(void) {
48205220 #if CYTHON_FAST_THREAD_STATE
4821 PyThreadState *tstate = PyThreadState_GET();
5221 PyThreadState *tstate = __Pyx_PyThreadState_Current;
48225222 PyObject* exc_type = tstate->curexc_type;
48235223 if (unlikely(exc_type)) {
4824 if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
5224 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
48255225 PyObject *exc_value, *exc_tb;
48265226 exc_value = tstate->curexc_value;
48275227 exc_tb = tstate->curexc_traceback;
48515251 }
48525252
48535253 /* UnpackItemEndCheck */
4854 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
5254 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
48555255 if (unlikely(retval)) {
48565256 Py_DECREF(retval);
48575257 __Pyx_RaiseTooManyValuesError(expected);
48635263 }
48645264
48655265 /* GetItemInt */
4866 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
5266 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
48675267 PyObject *r;
48685268 if (!j) return NULL;
48695269 r = PyObject_GetItem(o, j);
48745274 CYTHON_NCP_UNUSED int wraparound,
48755275 CYTHON_NCP_UNUSED int boundscheck) {
48765276 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4877 if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
4878 if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
4879 PyObject *r = PyList_GET_ITEM(o, i);
5277 Py_ssize_t wrapped_i = i;
5278 if (wraparound & unlikely(i < 0)) {
5279 wrapped_i += PyList_GET_SIZE(o);
5280 }
5281 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
5282 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
48805283 Py_INCREF(r);
48815284 return r;
48825285 }
48895292 CYTHON_NCP_UNUSED int wraparound,
48905293 CYTHON_NCP_UNUSED int boundscheck) {
48915294 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4892 if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
4893 if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
4894 PyObject *r = PyTuple_GET_ITEM(o, i);
5295 Py_ssize_t wrapped_i = i;
5296 if (wraparound & unlikely(i < 0)) {
5297 wrapped_i += PyTuple_GET_SIZE(o);
5298 }
5299 if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
5300 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
48955301 Py_INCREF(r);
48965302 return r;
48975303 }
49445350 }
49455351
49465352 /* GetVTable */
4947 static void* __Pyx_GetVtable(PyObject *dict) {
5353 static void* __Pyx_GetVtable(PyObject *dict) {
49485354 void* ptr;
49495355 PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
49505356 if (!ob)
49645370 }
49655371
49665372 /* Import */
4967 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
5373 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
49685374 PyObject *empty_list = 0;
49695375 PyObject *module = 0;
49705376 PyObject *global_dict = 0;
49715377 PyObject *empty_dict = 0;
49725378 PyObject *list;
4973 #if PY_VERSION_HEX < 0x03030000
5379 #if PY_MAJOR_VERSION < 3
49745380 PyObject *py_import;
49755381 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
49765382 if (!py_import)
49945400 #if PY_MAJOR_VERSION >= 3
49955401 if (level == -1) {
49965402 if (strchr(__Pyx_MODULE_NAME, '.')) {
4997 #if PY_VERSION_HEX < 0x03030000
4998 PyObject *py_level = PyInt_FromLong(1);
4999 if (!py_level)
5000 goto bad;
5001 module = PyObject_CallFunctionObjArgs(py_import,
5002 name, global_dict, empty_dict, list, py_level, NULL);
5003 Py_DECREF(py_level);
5004 #else
50055403 module = PyImport_ImportModuleLevelObject(
50065404 name, global_dict, empty_dict, list, 1);
5007 #endif
50085405 if (!module) {
50095406 if (!PyErr_ExceptionMatches(PyExc_ImportError))
50105407 goto bad;
50155412 }
50165413 #endif
50175414 if (!module) {
5018 #if PY_VERSION_HEX < 0x03030000
5415 #if PY_MAJOR_VERSION < 3
50195416 PyObject *py_level = PyInt_FromLong(level);
50205417 if (!py_level)
50215418 goto bad;
50295426 }
50305427 }
50315428 bad:
5032 #if PY_VERSION_HEX < 0x03030000
5429 #if PY_MAJOR_VERSION < 3
50335430 Py_XDECREF(py_import);
50345431 #endif
50355432 Py_XDECREF(empty_list);
50385435 }
50395436
50405437 /* ImportFrom */
5041 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
5438 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
50425439 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
50435440 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
50445441 PyErr_Format(PyExc_ImportError,
50515448 return value;
50525449 }
50535450
5451 /* CLineInTraceback */
5452 #ifndef CYTHON_CLINE_IN_TRACEBACK
5453 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
5454 PyObject *use_cline;
5455 PyObject *ptype, *pvalue, *ptraceback;
5456 #if CYTHON_COMPILING_IN_CPYTHON
5457 PyObject **cython_runtime_dict;
5458 #endif
5459 if (unlikely(!__pyx_cython_runtime)) {
5460 return c_line;
5461 }
5462 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
5463 #if CYTHON_COMPILING_IN_CPYTHON
5464 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
5465 if (likely(cython_runtime_dict)) {
5466 use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
5467 } else
5468 #endif
5469 {
5470 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
5471 if (use_cline_obj) {
5472 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
5473 Py_DECREF(use_cline_obj);
5474 } else {
5475 PyErr_Clear();
5476 use_cline = NULL;
5477 }
5478 }
5479 if (!use_cline) {
5480 c_line = 0;
5481 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
5482 }
5483 else if (PyObject_Not(use_cline) != 0) {
5484 c_line = 0;
5485 }
5486 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
5487 return c_line;
5488 }
5489 #endif
5490
50545491 /* CodeObjectCache */
5055 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
5492 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
50565493 int start = 0, mid = 0, end = count - 1;
50575494 if (end >= 0 && code_line > entries[end].code_line) {
50585495 return count;
51325569 }
51335570
51345571 /* AddTraceback */
5135 #include "compile.h"
5572 #include "compile.h"
51365573 #include "frameobject.h"
51375574 #include "traceback.h"
51385575 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
51915628 int py_line, const char *filename) {
51925629 PyCodeObject *py_code = 0;
51935630 PyFrameObject *py_frame = 0;
5194 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
5631 PyThreadState *tstate = __Pyx_PyThreadState_Current;
5632 if (c_line) {
5633 c_line = __Pyx_CLineForTraceback(tstate, c_line);
5634 }
5635 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
51955636 if (!py_code) {
51965637 py_code = __Pyx_CreateCodeObjectForTraceback(
51975638 funcname, c_line, py_line, filename);
51985639 if (!py_code) goto bad;
5199 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
5640 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
52005641 }
52015642 py_frame = PyFrame_New(
5202 PyThreadState_GET(), /*PyThreadState *tstate,*/
5203 py_code, /*PyCodeObject *code,*/
5204 __pyx_d, /*PyObject *globals,*/
5205 0 /*PyObject *locals*/
5643 tstate, /*PyThreadState *tstate,*/
5644 py_code, /*PyCodeObject *code,*/
5645 __pyx_d, /*PyObject *globals,*/
5646 0 /*PyObject *locals*/
52065647 );
52075648 if (!py_frame) goto bad;
52085649 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
52135654 }
52145655
52155656 /* CIntFromPyVerify */
5216 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
5657 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
52175658 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
52185659 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
52195660 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
52355676 }
52365677
52375678 /* CIntToPy */
5238 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
5679 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
52395680 const int neg_one = (int) -1, const_zero = (int) 0;
52405681 const int is_unsigned = neg_one > const_zero;
52415682 if (is_unsigned) {
52665707 }
52675708
52685709 /* CIntToPy */
5269 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
5710 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
52705711 const long neg_one = (long) -1, const_zero = (long) 0;
52715712 const int is_unsigned = neg_one > const_zero;
52725713 if (is_unsigned) {
52975738 }
52985739
52995740 /* CIntFromPy */
5300 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
5741 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
53015742 const int neg_one = (int) -1, const_zero = (int) 0;
53025743 const int is_unsigned = neg_one > const_zero;
53035744 #if PY_MAJOR_VERSION < 3
54865927 }
54875928
54885929 /* CIntFromPy */
5489 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
5930 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
54905931 const long neg_one = (long) -1, const_zero = (long) 0;
54915932 const int is_unsigned = neg_one > const_zero;
54925933 #if PY_MAJOR_VERSION < 3
56746115 return (long) -1;
56756116 }
56766117
6118 /* FastTypeChecks */
6119 #if CYTHON_COMPILING_IN_CPYTHON
6120 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
6121 while (a) {
6122 a = a->tp_base;
6123 if (a == b)
6124 return 1;
6125 }
6126 return b == &PyBaseObject_Type;
6127 }
6128 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
6129 PyObject *mro;
6130 if (a == b) return 1;
6131 mro = a->tp_mro;
6132 if (likely(mro)) {
6133 Py_ssize_t i, n;
6134 n = PyTuple_GET_SIZE(mro);
6135 for (i = 0; i < n; i++) {
6136 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
6137 return 1;
6138 }
6139 return 0;
6140 }
6141 return __Pyx_InBases(a, b);
6142 }
6143 #if PY_MAJOR_VERSION == 2
6144 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
6145 PyObject *exception, *value, *tb;
6146 int res;
6147 __Pyx_PyThreadState_declare
6148 __Pyx_PyThreadState_assign
6149 __Pyx_ErrFetch(&exception, &value, &tb);
6150 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
6151 if (unlikely(res == -1)) {
6152 PyErr_WriteUnraisable(err);
6153 res = 0;
6154 }
6155 if (!res) {
6156 res = PyObject_IsSubclass(err, exc_type2);
6157 if (unlikely(res == -1)) {
6158 PyErr_WriteUnraisable(err);
6159 res = 0;
6160 }
6161 }
6162 __Pyx_ErrRestore(exception, value, tb);
6163 return res;
6164 }
6165 #else
6166 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
6167 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
6168 if (!res) {
6169 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
6170 }
6171 return res;
6172 }
6173 #endif
6174 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
6175 Py_ssize_t i, n;
6176 assert(PyExceptionClass_Check(exc_type));
6177 n = PyTuple_GET_SIZE(tuple);
6178 #if PY_MAJOR_VERSION >= 3
6179 for (i=0; i<n; i++) {
6180 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
6181 }
6182 #endif
6183 for (i=0; i<n; i++) {
6184 PyObject *t = PyTuple_GET_ITEM(tuple, i);
6185 #if PY_MAJOR_VERSION < 3
6186 if (likely(exc_type == t)) return 1;
6187 #endif
6188 if (likely(PyExceptionClass_Check(t))) {
6189 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
6190 } else {
6191 }
6192 }
6193 return 0;
6194 }
6195 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
6196 if (likely(err == exc_type)) return 1;
6197 if (likely(PyExceptionClass_Check(err))) {
6198 if (likely(PyExceptionClass_Check(exc_type))) {
6199 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
6200 } else if (likely(PyTuple_Check(exc_type))) {
6201 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
6202 } else {
6203 }
6204 }
6205 return PyErr_GivenExceptionMatches(err, exc_type);
6206 }
6207 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
6208 assert(PyExceptionClass_Check(exc_type1));
6209 assert(PyExceptionClass_Check(exc_type2));
6210 if (likely(err == exc_type1 || err == exc_type2)) return 1;
6211 if (likely(PyExceptionClass_Check(err))) {
6212 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
6213 }
6214 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
6215 }
6216 #endif
6217
56776218 /* CheckBinaryVersion */
5678 static int __Pyx_check_binary_version(void) {
6219 static int __Pyx_check_binary_version(void) {
56796220 char ctversion[4], rtversion[4];
56806221 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
56816222 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
56916232 }
56926233
56936234 /* ModuleImport */
5694 #ifndef __PYX_HAVE_RT_ImportModule
6235 #ifndef __PYX_HAVE_RT_ImportModule
56956236 #define __PYX_HAVE_RT_ImportModule
56966237 static PyObject *__Pyx_ImportModule(const char *name) {
56976238 PyObject *py_name = 0;
57096250 #endif
57106251
57116252 /* TypeImport */
5712 #ifndef __PYX_HAVE_RT_ImportType
6253 #ifndef __PYX_HAVE_RT_ImportType
57136254 #define __PYX_HAVE_RT_ImportType
57146255 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
57156256 size_t size, int strict)
57746315 #endif
57756316
57766317 /* InitStrings */
5777 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
6318 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
57786319 while (t->p) {
57796320 #if PY_MAJOR_VERSION < 3
57806321 if (t->is_unicode) {
57996340 #endif
58006341 if (!*t->p)
58016342 return -1;
6343 if (PyObject_Hash(*t->p) == -1)
6344 return -1;
58026345 ++t;
58036346 }
58046347 return 0;
58076350 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
58086351 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
58096352 }
5810 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
6353 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
58116354 Py_ssize_t ignore;
58126355 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
58136356 }
5814 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
5815 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
6357 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
6358 #if !CYTHON_PEP393_ENABLED
6359 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6360 char* defenc_c;
6361 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
6362 if (!defenc) return NULL;
6363 defenc_c = PyBytes_AS_STRING(defenc);
6364 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6365 {
6366 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
6367 char* c;
6368 for (c = defenc_c; c < end; c++) {
6369 if ((unsigned char) (*c) >= 128) {
6370 PyUnicode_AsASCIIString(o);
6371 return NULL;
6372 }
6373 }
6374 }
6375 #endif
6376 *length = PyBytes_GET_SIZE(defenc);
6377 return defenc_c;
6378 }
6379 #else
6380 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6381 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
6382 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
6383 if (likely(PyUnicode_IS_ASCII(o))) {
6384 *length = PyUnicode_GET_LENGTH(o);
6385 return PyUnicode_AsUTF8(o);
6386 } else {
6387 PyUnicode_AsASCIIString(o);
6388 return NULL;
6389 }
6390 #else
6391 return PyUnicode_AsUTF8AndSize(o, length);
6392 #endif
6393 }
6394 #endif
6395 #endif
6396 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
6397 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
58166398 if (
58176399 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
58186400 __Pyx_sys_getdefaultencoding_not_ascii &&
58196401 #endif
58206402 PyUnicode_Check(o)) {
5821 #if PY_VERSION_HEX < 0x03030000
5822 char* defenc_c;
5823 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
5824 if (!defenc) return NULL;
5825 defenc_c = PyBytes_AS_STRING(defenc);
5826 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5827 {
5828 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
5829 char* c;
5830 for (c = defenc_c; c < end; c++) {
5831 if ((unsigned char) (*c) >= 128) {
5832 PyUnicode_AsASCIIString(o);
5833 return NULL;
5834 }
5835 }
5836 }
5837 #endif
5838 *length = PyBytes_GET_SIZE(defenc);
5839 return defenc_c;
5840 #else
5841 if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
5842 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
5843 if (PyUnicode_IS_ASCII(o)) {
5844 *length = PyUnicode_GET_LENGTH(o);
5845 return PyUnicode_AsUTF8(o);
5846 } else {
5847 PyUnicode_AsASCIIString(o);
5848 return NULL;
5849 }
5850 #else
5851 return PyUnicode_AsUTF8AndSize(o, length);
5852 #endif
5853 #endif
6403 return __Pyx_PyUnicode_AsStringAndSize(o, length);
58546404 } else
58556405 #endif
58566406 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
58746424 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
58756425 else return PyObject_IsTrue(x);
58766426 }
6427 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
6428 #if PY_MAJOR_VERSION >= 3
6429 if (PyLong_Check(result)) {
6430 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
6431 "__int__ returned non-int (type %.200s). "
6432 "The ability to return an instance of a strict subclass of int "
6433 "is deprecated, and may be removed in a future version of Python.",
6434 Py_TYPE(result)->tp_name)) {
6435 Py_DECREF(result);
6436 return NULL;
6437 }
6438 return result;
6439 }
6440 #endif
6441 PyErr_Format(PyExc_TypeError,
6442 "__%.4s__ returned non-%.4s (type %.200s)",
6443 type_name, type_name, Py_TYPE(result)->tp_name);
6444 Py_DECREF(result);
6445 return NULL;
6446 }
58776447 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
58786448 #if CYTHON_USE_TYPE_SLOTS
58796449 PyNumberMethods *m;
58816451 const char *name = NULL;
58826452 PyObject *res = NULL;
58836453 #if PY_MAJOR_VERSION < 3
5884 if (PyInt_Check(x) || PyLong_Check(x))
5885 #else
5886 if (PyLong_Check(x))
6454 if (likely(PyInt_Check(x) || PyLong_Check(x)))
6455 #else
6456 if (likely(PyLong_Check(x)))
58876457 #endif
58886458 return __Pyx_NewRef(x);
58896459 #if CYTHON_USE_TYPE_SLOTS
58916461 #if PY_MAJOR_VERSION < 3
58926462 if (m && m->nb_int) {
58936463 name = "int";
5894 res = PyNumber_Int(x);
6464 res = m->nb_int(x);
58956465 }
58966466 else if (m && m->nb_long) {
58976467 name = "long";
5898 res = PyNumber_Long(x);
6468 res = m->nb_long(x);
58996469 }
59006470 #else
5901 if (m && m->nb_int) {
6471 if (likely(m && m->nb_int)) {
59026472 name = "int";
5903 res = PyNumber_Long(x);
6473 res = m->nb_int(x);
59046474 }
59056475 #endif
59066476 #else
5907 res = PyNumber_Int(x);
5908 #endif
5909 if (res) {
6477 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
6478 res = PyNumber_Int(x);
6479 }
6480 #endif
6481 if (likely(res)) {
59106482 #if PY_MAJOR_VERSION < 3
5911 if (!PyInt_Check(res) && !PyLong_Check(res)) {
5912 #else
5913 if (!PyLong_Check(res)) {
5914 #endif
5915 PyErr_Format(PyExc_TypeError,
5916 "__%.4s__ returned non-%.4s (type %.200s)",
5917 name, name, Py_TYPE(res)->tp_name);
5918 Py_DECREF(res);
5919 return NULL;
6483 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
6484 #else
6485 if (unlikely(!PyLong_CheckExact(res))) {
6486 #endif
6487 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
59206488 }
59216489 }
59226490 else if (!PyErr_Occurred()) {
59876555 Py_DECREF(x);
59886556 return ival;
59896557 }
6558 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
6559 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
6560 }
59906561 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
59916562 return PyInt_FromSize_t(ival);
59926563 }
00 Metadata-Version: 1.0
11 Name: pygame-sdl2
2 Version: 2.1.0-for-renpy-7.1.0
2 Version: 2.1.0-for-renpy-7.1.1
33 Summary: UNKNOWN
44 Home-page: https://github.com/renpy/pygame_sdl2
55 Author: Tom Rothamel
00 [egg_info]
1 tag_build = -for-renpy-7.1.0
1 tag_build = -for-renpy-7.1.1
22 tag_date = 0
33