cy_ctest.c (104854B)
1 /* Generated by Cython 0.29 */ 2 3 #define PY_SSIZE_T_CLEAN 4 #include "Python.h" 5 #ifndef Py_PYTHON_H 6 #error Python headers needed to compile C extensions, please install development version of Python. 7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) 8 #error Cython requires Python 2.6+ or Python 3.3+. 9 #else 10 #define CYTHON_ABI "0_29" 11 #define CYTHON_HEX_VERSION 0x001D00F0 12 #define CYTHON_FUTURE_DIVISION 0 13 #include <stddef.h> 14 #ifndef offsetof 15 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) 16 #endif 17 #if !defined(WIN32) && !defined(MS_WINDOWS) 18 #ifndef __stdcall 19 #define __stdcall 20 #endif 21 #ifndef __cdecl 22 #define __cdecl 23 #endif 24 #ifndef __fastcall 25 #define __fastcall 26 #endif 27 #endif 28 #ifndef DL_IMPORT 29 #define DL_IMPORT(t) t 30 #endif 31 #ifndef DL_EXPORT 32 #define DL_EXPORT(t) t 33 #endif 34 #define __PYX_COMMA , 35 #ifndef HAVE_LONG_LONG 36 #if PY_VERSION_HEX >= 0x02070000 37 #define HAVE_LONG_LONG 38 #endif 39 #endif 40 #ifndef PY_LONG_LONG 41 #define PY_LONG_LONG LONG_LONG 42 #endif 43 #ifndef Py_HUGE_VAL 44 #define Py_HUGE_VAL HUGE_VAL 45 #endif 46 #ifdef PYPY_VERSION 47 #define CYTHON_COMPILING_IN_PYPY 1 48 #define CYTHON_COMPILING_IN_PYSTON 0 49 #define CYTHON_COMPILING_IN_CPYTHON 0 50 #undef CYTHON_USE_TYPE_SLOTS 51 #define CYTHON_USE_TYPE_SLOTS 0 52 #undef CYTHON_USE_PYTYPE_LOOKUP 53 #define CYTHON_USE_PYTYPE_LOOKUP 0 54 #if PY_VERSION_HEX < 0x03050000 55 #undef CYTHON_USE_ASYNC_SLOTS 56 #define CYTHON_USE_ASYNC_SLOTS 0 57 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 58 #define CYTHON_USE_ASYNC_SLOTS 1 59 #endif 60 #undef CYTHON_USE_PYLIST_INTERNALS 61 #define CYTHON_USE_PYLIST_INTERNALS 0 62 #undef CYTHON_USE_UNICODE_INTERNALS 63 #define CYTHON_USE_UNICODE_INTERNALS 0 64 #undef CYTHON_USE_UNICODE_WRITER 65 #define CYTHON_USE_UNICODE_WRITER 0 66 #undef CYTHON_USE_PYLONG_INTERNALS 67 #define CYTHON_USE_PYLONG_INTERNALS 0 68 #undef CYTHON_AVOID_BORROWED_REFS 69 #define CYTHON_AVOID_BORROWED_REFS 1 70 #undef CYTHON_ASSUME_SAFE_MACROS 71 #define CYTHON_ASSUME_SAFE_MACROS 0 72 #undef CYTHON_UNPACK_METHODS 73 #define CYTHON_UNPACK_METHODS 0 74 #undef CYTHON_FAST_THREAD_STATE 75 #define CYTHON_FAST_THREAD_STATE 0 76 #undef CYTHON_FAST_PYCALL 77 #define CYTHON_FAST_PYCALL 0 78 #undef CYTHON_PEP489_MULTI_PHASE_INIT 79 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 80 #undef CYTHON_USE_TP_FINALIZE 81 #define CYTHON_USE_TP_FINALIZE 0 82 #undef CYTHON_USE_DICT_VERSIONS 83 #define CYTHON_USE_DICT_VERSIONS 0 84 #undef CYTHON_USE_EXC_INFO_STACK 85 #define CYTHON_USE_EXC_INFO_STACK 0 86 #elif defined(PYSTON_VERSION) 87 #define CYTHON_COMPILING_IN_PYPY 0 88 #define CYTHON_COMPILING_IN_PYSTON 1 89 #define CYTHON_COMPILING_IN_CPYTHON 0 90 #ifndef CYTHON_USE_TYPE_SLOTS 91 #define CYTHON_USE_TYPE_SLOTS 1 92 #endif 93 #undef CYTHON_USE_PYTYPE_LOOKUP 94 #define CYTHON_USE_PYTYPE_LOOKUP 0 95 #undef CYTHON_USE_ASYNC_SLOTS 96 #define CYTHON_USE_ASYNC_SLOTS 0 97 #undef CYTHON_USE_PYLIST_INTERNALS 98 #define CYTHON_USE_PYLIST_INTERNALS 0 99 #ifndef CYTHON_USE_UNICODE_INTERNALS 100 #define CYTHON_USE_UNICODE_INTERNALS 1 101 #endif 102 #undef CYTHON_USE_UNICODE_WRITER 103 #define CYTHON_USE_UNICODE_WRITER 0 104 #undef CYTHON_USE_PYLONG_INTERNALS 105 #define CYTHON_USE_PYLONG_INTERNALS 0 106 #ifndef CYTHON_AVOID_BORROWED_REFS 107 #define CYTHON_AVOID_BORROWED_REFS 0 108 #endif 109 #ifndef CYTHON_ASSUME_SAFE_MACROS 110 #define CYTHON_ASSUME_SAFE_MACROS 1 111 #endif 112 #ifndef CYTHON_UNPACK_METHODS 113 #define CYTHON_UNPACK_METHODS 1 114 #endif 115 #undef CYTHON_FAST_THREAD_STATE 116 #define CYTHON_FAST_THREAD_STATE 0 117 #undef CYTHON_FAST_PYCALL 118 #define CYTHON_FAST_PYCALL 0 119 #undef CYTHON_PEP489_MULTI_PHASE_INIT 120 #define CYTHON_PEP489_MULTI_PHASE_INIT 0 121 #undef CYTHON_USE_TP_FINALIZE 122 #define CYTHON_USE_TP_FINALIZE 0 123 #undef CYTHON_USE_DICT_VERSIONS 124 #define CYTHON_USE_DICT_VERSIONS 0 125 #undef CYTHON_USE_EXC_INFO_STACK 126 #define CYTHON_USE_EXC_INFO_STACK 0 127 #else 128 #define CYTHON_COMPILING_IN_PYPY 0 129 #define CYTHON_COMPILING_IN_PYSTON 0 130 #define CYTHON_COMPILING_IN_CPYTHON 1 131 #ifndef CYTHON_USE_TYPE_SLOTS 132 #define CYTHON_USE_TYPE_SLOTS 1 133 #endif 134 #if PY_VERSION_HEX < 0x02070000 135 #undef CYTHON_USE_PYTYPE_LOOKUP 136 #define CYTHON_USE_PYTYPE_LOOKUP 0 137 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) 138 #define CYTHON_USE_PYTYPE_LOOKUP 1 139 #endif 140 #if PY_MAJOR_VERSION < 3 141 #undef CYTHON_USE_ASYNC_SLOTS 142 #define CYTHON_USE_ASYNC_SLOTS 0 143 #elif !defined(CYTHON_USE_ASYNC_SLOTS) 144 #define CYTHON_USE_ASYNC_SLOTS 1 145 #endif 146 #if PY_VERSION_HEX < 0x02070000 147 #undef CYTHON_USE_PYLONG_INTERNALS 148 #define CYTHON_USE_PYLONG_INTERNALS 0 149 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) 150 #define CYTHON_USE_PYLONG_INTERNALS 1 151 #endif 152 #ifndef CYTHON_USE_PYLIST_INTERNALS 153 #define CYTHON_USE_PYLIST_INTERNALS 1 154 #endif 155 #ifndef CYTHON_USE_UNICODE_INTERNALS 156 #define CYTHON_USE_UNICODE_INTERNALS 1 157 #endif 158 #if PY_VERSION_HEX < 0x030300F0 159 #undef CYTHON_USE_UNICODE_WRITER 160 #define CYTHON_USE_UNICODE_WRITER 0 161 #elif !defined(CYTHON_USE_UNICODE_WRITER) 162 #define CYTHON_USE_UNICODE_WRITER 1 163 #endif 164 #ifndef CYTHON_AVOID_BORROWED_REFS 165 #define CYTHON_AVOID_BORROWED_REFS 0 166 #endif 167 #ifndef CYTHON_ASSUME_SAFE_MACROS 168 #define CYTHON_ASSUME_SAFE_MACROS 1 169 #endif 170 #ifndef CYTHON_UNPACK_METHODS 171 #define CYTHON_UNPACK_METHODS 1 172 #endif 173 #ifndef CYTHON_FAST_THREAD_STATE 174 #define CYTHON_FAST_THREAD_STATE 1 175 #endif 176 #ifndef CYTHON_FAST_PYCALL 177 #define CYTHON_FAST_PYCALL 1 178 #endif 179 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT 180 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) 181 #endif 182 #ifndef CYTHON_USE_TP_FINALIZE 183 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) 184 #endif 185 #ifndef CYTHON_USE_DICT_VERSIONS 186 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) 187 #endif 188 #ifndef CYTHON_USE_EXC_INFO_STACK 189 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) 190 #endif 191 #endif 192 #if !defined(CYTHON_FAST_PYCCALL) 193 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) 194 #endif 195 #if CYTHON_USE_PYLONG_INTERNALS 196 #include "longintrepr.h" 197 #undef SHIFT 198 #undef BASE 199 #undef MASK 200 #endif 201 #ifndef __has_attribute 202 #define __has_attribute(x) 0 203 #endif 204 #ifndef __has_cpp_attribute 205 #define __has_cpp_attribute(x) 0 206 #endif 207 #ifndef CYTHON_RESTRICT 208 #if defined(__GNUC__) 209 #define CYTHON_RESTRICT __restrict__ 210 #elif defined(_MSC_VER) && _MSC_VER >= 1400 211 #define CYTHON_RESTRICT __restrict 212 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 213 #define CYTHON_RESTRICT restrict 214 #else 215 #define CYTHON_RESTRICT 216 #endif 217 #endif 218 #ifndef CYTHON_UNUSED 219 # if defined(__GNUC__) 220 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 221 # define CYTHON_UNUSED __attribute__ ((__unused__)) 222 # else 223 # define CYTHON_UNUSED 224 # endif 225 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) 226 # define CYTHON_UNUSED __attribute__ ((__unused__)) 227 # else 228 # define CYTHON_UNUSED 229 # endif 230 #endif 231 #ifndef CYTHON_MAYBE_UNUSED_VAR 232 # if defined(__cplusplus) 233 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } 234 # else 235 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) 236 # endif 237 #endif 238 #ifndef CYTHON_NCP_UNUSED 239 # if CYTHON_COMPILING_IN_CPYTHON 240 # define CYTHON_NCP_UNUSED 241 # else 242 # define CYTHON_NCP_UNUSED CYTHON_UNUSED 243 # endif 244 #endif 245 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) 246 #ifdef _MSC_VER 247 #ifndef _MSC_STDINT_H_ 248 #if _MSC_VER < 1300 249 typedef unsigned char uint8_t; 250 typedef unsigned int uint32_t; 251 #else 252 typedef unsigned __int8 uint8_t; 253 typedef unsigned __int32 uint32_t; 254 #endif 255 #endif 256 #else 257 #include <stdint.h> 258 #endif 259 #ifndef CYTHON_FALLTHROUGH 260 #if defined(__cplusplus) && __cplusplus >= 201103L 261 #if __has_cpp_attribute(fallthrough) 262 #define CYTHON_FALLTHROUGH [[fallthrough]] 263 #elif __has_cpp_attribute(clang::fallthrough) 264 #define CYTHON_FALLTHROUGH [[clang::fallthrough]] 265 #elif __has_cpp_attribute(gnu::fallthrough) 266 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] 267 #endif 268 #endif 269 #ifndef CYTHON_FALLTHROUGH 270 #if __has_attribute(fallthrough) 271 #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) 272 #else 273 #define CYTHON_FALLTHROUGH 274 #endif 275 #endif 276 #if defined(__clang__ ) && defined(__apple_build_version__) 277 #if __apple_build_version__ < 7000000 278 #undef CYTHON_FALLTHROUGH 279 #define CYTHON_FALLTHROUGH 280 #endif 281 #endif 282 #endif 283 284 #ifndef CYTHON_INLINE 285 #if defined(__clang__) 286 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) 287 #elif defined(__GNUC__) 288 #define CYTHON_INLINE __inline__ 289 #elif defined(_MSC_VER) 290 #define CYTHON_INLINE __inline 291 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 292 #define CYTHON_INLINE inline 293 #else 294 #define CYTHON_INLINE 295 #endif 296 #endif 297 298 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) 299 #define Py_OptimizeFlag 0 300 #endif 301 #define __PYX_BUILD_PY_SSIZE_T "n" 302 #define CYTHON_FORMAT_SSIZE_T "z" 303 #if PY_MAJOR_VERSION < 3 304 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" 305 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 306 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 307 #define __Pyx_DefaultClassType PyClass_Type 308 #else 309 #define __Pyx_BUILTIN_MODULE_NAME "builtins" 310 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ 311 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) 312 #define __Pyx_DefaultClassType PyType_Type 313 #endif 314 #ifndef Py_TPFLAGS_CHECKTYPES 315 #define Py_TPFLAGS_CHECKTYPES 0 316 #endif 317 #ifndef Py_TPFLAGS_HAVE_INDEX 318 #define Py_TPFLAGS_HAVE_INDEX 0 319 #endif 320 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER 321 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 322 #endif 323 #ifndef Py_TPFLAGS_HAVE_FINALIZE 324 #define Py_TPFLAGS_HAVE_FINALIZE 0 325 #endif 326 #ifndef METH_STACKLESS 327 #define METH_STACKLESS 0 328 #endif 329 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) 330 #ifndef METH_FASTCALL 331 #define METH_FASTCALL 0x80 332 #endif 333 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); 334 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, 335 Py_ssize_t nargs, PyObject *kwnames); 336 #else 337 #define __Pyx_PyCFunctionFast _PyCFunctionFast 338 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords 339 #endif 340 #if CYTHON_FAST_PYCCALL 341 #define __Pyx_PyFastCFunction_Check(func)\ 342 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) 343 #else 344 #define __Pyx_PyFastCFunction_Check(func) 0 345 #endif 346 #if CYTHON_USE_DICT_VERSIONS 347 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) 348 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ 349 (version_var) = __PYX_GET_DICT_VERSION(dict);\ 350 (cache_var) = (value); 351 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ 352 static PY_UINT64_T __pyx_dict_version = 0;\ 353 static PyObject *__pyx_dict_cached_value = NULL;\ 354 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ 355 (VAR) = __pyx_dict_cached_value;\ 356 } else {\ 357 (VAR) = __pyx_dict_cached_value = (LOOKUP);\ 358 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ 359 }\ 360 } 361 #else 362 #define __PYX_GET_DICT_VERSION(dict) (0) 363 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) 364 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); 365 #endif 366 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) 367 #define PyObject_Malloc(s) PyMem_Malloc(s) 368 #define PyObject_Free(p) PyMem_Free(p) 369 #define PyObject_Realloc(p) PyMem_Realloc(p) 370 #endif 371 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 372 #define PyMem_RawMalloc(n) PyMem_Malloc(n) 373 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) 374 #define PyMem_RawFree(p) PyMem_Free(p) 375 #endif 376 #if CYTHON_COMPILING_IN_PYSTON 377 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) 378 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) 379 #else 380 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) 381 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) 382 #endif 383 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 384 #define __Pyx_PyThreadState_Current PyThreadState_GET() 385 #elif PY_VERSION_HEX >= 0x03060000 386 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() 387 #elif PY_VERSION_HEX >= 0x03000000 388 #define __Pyx_PyThreadState_Current PyThreadState_GET() 389 #else 390 #define __Pyx_PyThreadState_Current _PyThreadState_Current 391 #endif 392 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) 393 #include "pythread.h" 394 #define Py_tss_NEEDS_INIT 0 395 typedef int Py_tss_t; 396 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { 397 *key = PyThread_create_key(); 398 return 0; // PyThread_create_key reports success always 399 } 400 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { 401 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); 402 *key = Py_tss_NEEDS_INIT; 403 return key; 404 } 405 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { 406 PyObject_Free(key); 407 } 408 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { 409 return *key != Py_tss_NEEDS_INIT; 410 } 411 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { 412 PyThread_delete_key(*key); 413 *key = Py_tss_NEEDS_INIT; 414 } 415 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { 416 return PyThread_set_key_value(*key, value); 417 } 418 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { 419 return PyThread_get_key_value(*key); 420 } 421 #endif // TSS (Thread Specific Storage) API 422 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) 423 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) 424 #else 425 #define __Pyx_PyDict_NewPresized(n) PyDict_New() 426 #endif 427 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION 428 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) 429 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) 430 #else 431 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) 432 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) 433 #endif 434 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS 435 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) 436 #else 437 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) 438 #endif 439 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) 440 #define CYTHON_PEP393_ENABLED 1 441 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 442 0 : _PyUnicode_Ready((PyObject *)(op))) 443 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) 444 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) 445 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) 446 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) 447 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) 448 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) 449 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) 450 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) 451 #else 452 #define CYTHON_PEP393_ENABLED 0 453 #define PyUnicode_1BYTE_KIND 1 454 #define PyUnicode_2BYTE_KIND 2 455 #define PyUnicode_4BYTE_KIND 4 456 #define __Pyx_PyUnicode_READY(op) (0) 457 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) 458 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) 459 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) 460 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) 461 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) 462 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) 463 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) 464 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) 465 #endif 466 #if CYTHON_COMPILING_IN_PYPY 467 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) 468 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) 469 #else 470 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) 471 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ 472 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) 473 #endif 474 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) 475 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) 476 #endif 477 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) 478 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) 479 #endif 480 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) 481 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) 482 #endif 483 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) 484 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) 485 #if PY_MAJOR_VERSION >= 3 486 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) 487 #else 488 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) 489 #endif 490 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) 491 #define PyObject_ASCII(o) PyObject_Repr(o) 492 #endif 493 #if PY_MAJOR_VERSION >= 3 494 #define PyBaseString_Type PyUnicode_Type 495 #define PyStringObject PyUnicodeObject 496 #define PyString_Type PyUnicode_Type 497 #define PyString_Check PyUnicode_Check 498 #define PyString_CheckExact PyUnicode_CheckExact 499 #define PyObject_Unicode PyObject_Str 500 #endif 501 #if PY_MAJOR_VERSION >= 3 502 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) 503 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) 504 #else 505 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) 506 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) 507 #endif 508 #ifndef PySet_CheckExact 509 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) 510 #endif 511 #if CYTHON_ASSUME_SAFE_MACROS 512 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) 513 #else 514 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) 515 #endif 516 #if PY_MAJOR_VERSION >= 3 517 #define PyIntObject PyLongObject 518 #define PyInt_Type PyLong_Type 519 #define PyInt_Check(op) PyLong_Check(op) 520 #define PyInt_CheckExact(op) PyLong_CheckExact(op) 521 #define PyInt_FromString PyLong_FromString 522 #define PyInt_FromUnicode PyLong_FromUnicode 523 #define PyInt_FromLong PyLong_FromLong 524 #define PyInt_FromSize_t PyLong_FromSize_t 525 #define PyInt_FromSsize_t PyLong_FromSsize_t 526 #define PyInt_AsLong PyLong_AsLong 527 #define PyInt_AS_LONG PyLong_AS_LONG 528 #define PyInt_AsSsize_t PyLong_AsSsize_t 529 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask 530 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask 531 #define PyNumber_Int PyNumber_Long 532 #endif 533 #if PY_MAJOR_VERSION >= 3 534 #define PyBoolObject PyLongObject 535 #endif 536 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY 537 #ifndef PyUnicode_InternFromString 538 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) 539 #endif 540 #endif 541 #if PY_VERSION_HEX < 0x030200A4 542 typedef long Py_hash_t; 543 #define __Pyx_PyInt_FromHash_t PyInt_FromLong 544 #define __Pyx_PyInt_AsHash_t PyInt_AsLong 545 #else 546 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t 547 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t 548 #endif 549 #if PY_MAJOR_VERSION >= 3 550 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) 551 #else 552 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) 553 #endif 554 #if CYTHON_USE_ASYNC_SLOTS 555 #if PY_VERSION_HEX >= 0x030500B1 556 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods 557 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) 558 #else 559 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) 560 #endif 561 #else 562 #define __Pyx_PyType_AsAsync(obj) NULL 563 #endif 564 #ifndef __Pyx_PyAsyncMethodsStruct 565 typedef struct { 566 unaryfunc am_await; 567 unaryfunc am_aiter; 568 unaryfunc am_anext; 569 } __Pyx_PyAsyncMethodsStruct; 570 #endif 571 572 #if defined(WIN32) || defined(MS_WINDOWS) 573 #define _USE_MATH_DEFINES 574 #endif 575 #include <math.h> 576 #ifdef NAN 577 #define __PYX_NAN() ((float) NAN) 578 #else 579 static CYTHON_INLINE float __PYX_NAN() { 580 float value; 581 memset(&value, 0xFF, sizeof(value)); 582 return value; 583 } 584 #endif 585 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) 586 #define __Pyx_truncl trunc 587 #else 588 #define __Pyx_truncl truncl 589 #endif 590 591 592 #define __PYX_ERR(f_index, lineno, Ln_error) \ 593 { \ 594 __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ 595 } 596 597 #ifndef __PYX_EXTERN_C 598 #ifdef __cplusplus 599 #define __PYX_EXTERN_C extern "C" 600 #else 601 #define __PYX_EXTERN_C extern 602 #endif 603 #endif 604 605 #define __PYX_HAVE__cy_ctest 606 #define __PYX_HAVE_API__cy_ctest 607 /* Early includes */ 608 #include "lib.h" 609 #ifdef _OPENMP 610 #include <omp.h> 611 #endif /* _OPENMP */ 612 613 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) 614 #define CYTHON_WITHOUT_ASSERTIONS 615 #endif 616 617 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; 618 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; 619 620 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 621 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 622 #define __PYX_DEFAULT_STRING_ENCODING "" 623 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString 624 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 625 #define __Pyx_uchar_cast(c) ((unsigned char)c) 626 #define __Pyx_long_cast(x) ((long)x) 627 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ 628 (sizeof(type) < sizeof(Py_ssize_t)) ||\ 629 (sizeof(type) > sizeof(Py_ssize_t) &&\ 630 likely(v < (type)PY_SSIZE_T_MAX ||\ 631 v == (type)PY_SSIZE_T_MAX) &&\ 632 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ 633 v == (type)PY_SSIZE_T_MIN))) ||\ 634 (sizeof(type) == sizeof(Py_ssize_t) &&\ 635 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ 636 v == (type)PY_SSIZE_T_MAX))) ) 637 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { 638 return (size_t) i < (size_t) limit; 639 } 640 #if defined (__cplusplus) && __cplusplus >= 201103L 641 #include <cstdlib> 642 #define __Pyx_sst_abs(value) std::abs(value) 643 #elif SIZEOF_INT >= SIZEOF_SIZE_T 644 #define __Pyx_sst_abs(value) abs(value) 645 #elif SIZEOF_LONG >= SIZEOF_SIZE_T 646 #define __Pyx_sst_abs(value) labs(value) 647 #elif defined (_MSC_VER) 648 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) 649 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 650 #define __Pyx_sst_abs(value) llabs(value) 651 #elif defined (__GNUC__) 652 #define __Pyx_sst_abs(value) __builtin_llabs(value) 653 #else 654 #define __Pyx_sst_abs(value) ((value<0) ? -value : value) 655 #endif 656 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); 657 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); 658 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) 659 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) 660 #define __Pyx_PyBytes_FromString PyBytes_FromString 661 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize 662 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); 663 #if PY_MAJOR_VERSION < 3 664 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString 665 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize 666 #else 667 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString 668 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize 669 #endif 670 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) 671 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) 672 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) 673 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) 674 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) 675 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) 676 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) 677 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) 678 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) 679 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) 680 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) 681 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) 682 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) 683 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) 684 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) 685 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) 686 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { 687 const Py_UNICODE *u_end = u; 688 while (*u_end++) ; 689 return (size_t)(u_end - u - 1); 690 } 691 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) 692 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode 693 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode 694 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) 695 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) 696 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); 697 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); 698 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); 699 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); 700 #define __Pyx_PySequence_Tuple(obj)\ 701 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) 702 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); 703 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); 704 #if CYTHON_ASSUME_SAFE_MACROS 705 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) 706 #else 707 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) 708 #endif 709 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) 710 #if PY_MAJOR_VERSION >= 3 711 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) 712 #else 713 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) 714 #endif 715 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) 716 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 717 static int __Pyx_sys_getdefaultencoding_not_ascii; 718 static int __Pyx_init_sys_getdefaultencoding_params(void) { 719 PyObject* sys; 720 PyObject* default_encoding = NULL; 721 PyObject* ascii_chars_u = NULL; 722 PyObject* ascii_chars_b = NULL; 723 const char* default_encoding_c; 724 sys = PyImport_ImportModule("sys"); 725 if (!sys) goto bad; 726 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); 727 Py_DECREF(sys); 728 if (!default_encoding) goto bad; 729 default_encoding_c = PyBytes_AsString(default_encoding); 730 if (!default_encoding_c) goto bad; 731 if (strcmp(default_encoding_c, "ascii") == 0) { 732 __Pyx_sys_getdefaultencoding_not_ascii = 0; 733 } else { 734 char ascii_chars[128]; 735 int c; 736 for (c = 0; c < 128; c++) { 737 ascii_chars[c] = c; 738 } 739 __Pyx_sys_getdefaultencoding_not_ascii = 1; 740 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); 741 if (!ascii_chars_u) goto bad; 742 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); 743 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { 744 PyErr_Format( 745 PyExc_ValueError, 746 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", 747 default_encoding_c); 748 goto bad; 749 } 750 Py_DECREF(ascii_chars_u); 751 Py_DECREF(ascii_chars_b); 752 } 753 Py_DECREF(default_encoding); 754 return 0; 755 bad: 756 Py_XDECREF(default_encoding); 757 Py_XDECREF(ascii_chars_u); 758 Py_XDECREF(ascii_chars_b); 759 return -1; 760 } 761 #endif 762 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 763 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) 764 #else 765 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) 766 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 767 static char* __PYX_DEFAULT_STRING_ENCODING; 768 static int __Pyx_init_sys_getdefaultencoding_params(void) { 769 PyObject* sys; 770 PyObject* default_encoding = NULL; 771 char* default_encoding_c; 772 sys = PyImport_ImportModule("sys"); 773 if (!sys) goto bad; 774 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); 775 Py_DECREF(sys); 776 if (!default_encoding) goto bad; 777 default_encoding_c = PyBytes_AsString(default_encoding); 778 if (!default_encoding_c) goto bad; 779 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); 780 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; 781 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); 782 Py_DECREF(default_encoding); 783 return 0; 784 bad: 785 Py_XDECREF(default_encoding); 786 return -1; 787 } 788 #endif 789 #endif 790 791 792 /* Test for GCC > 2.95 */ 793 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) 794 #define likely(x) __builtin_expect(!!(x), 1) 795 #define unlikely(x) __builtin_expect(!!(x), 0) 796 #else /* !__GNUC__ or GCC < 2.95 */ 797 #define likely(x) (x) 798 #define unlikely(x) (x) 799 #endif /* __GNUC__ */ 800 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } 801 802 static PyObject *__pyx_m = NULL; 803 static PyObject *__pyx_d; 804 static PyObject *__pyx_b; 805 static PyObject *__pyx_cython_runtime = NULL; 806 static PyObject *__pyx_empty_tuple; 807 static PyObject *__pyx_empty_bytes; 808 static PyObject *__pyx_empty_unicode; 809 static int __pyx_lineno; 810 static int __pyx_clineno = 0; 811 static const char * __pyx_cfilenm= __FILE__; 812 static const char *__pyx_filename; 813 814 815 static const char *__pyx_f[] = { 816 "cy_ctest.pyx", 817 }; 818 819 /*--- Type declarations ---*/ 820 821 /* --- Runtime support code (head) --- */ 822 /* Refnanny.proto */ 823 #ifndef CYTHON_REFNANNY 824 #define CYTHON_REFNANNY 0 825 #endif 826 #if CYTHON_REFNANNY 827 typedef struct { 828 void (*INCREF)(void*, PyObject*, int); 829 void (*DECREF)(void*, PyObject*, int); 830 void (*GOTREF)(void*, PyObject*, int); 831 void (*GIVEREF)(void*, PyObject*, int); 832 void* (*SetupContext)(const char*, int, const char*); 833 void (*FinishContext)(void**); 834 } __Pyx_RefNannyAPIStruct; 835 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; 836 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); 837 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; 838 #ifdef WITH_THREAD 839 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 840 if (acquire_gil) {\ 841 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ 842 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 843 PyGILState_Release(__pyx_gilstate_save);\ 844 } else {\ 845 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ 846 } 847 #else 848 #define __Pyx_RefNannySetupContext(name, acquire_gil)\ 849 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) 850 #endif 851 #define __Pyx_RefNannyFinishContext()\ 852 __Pyx_RefNanny->FinishContext(&__pyx_refnanny) 853 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 854 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 855 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 856 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) 857 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) 858 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) 859 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) 860 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) 861 #else 862 #define __Pyx_RefNannyDeclarations 863 #define __Pyx_RefNannySetupContext(name, acquire_gil) 864 #define __Pyx_RefNannyFinishContext() 865 #define __Pyx_INCREF(r) Py_INCREF(r) 866 #define __Pyx_DECREF(r) Py_DECREF(r) 867 #define __Pyx_GOTREF(r) 868 #define __Pyx_GIVEREF(r) 869 #define __Pyx_XINCREF(r) Py_XINCREF(r) 870 #define __Pyx_XDECREF(r) Py_XDECREF(r) 871 #define __Pyx_XGOTREF(r) 872 #define __Pyx_XGIVEREF(r) 873 #endif 874 #define __Pyx_XDECREF_SET(r, v) do {\ 875 PyObject *tmp = (PyObject *) r;\ 876 r = v; __Pyx_XDECREF(tmp);\ 877 } while (0) 878 #define __Pyx_DECREF_SET(r, v) do {\ 879 PyObject *tmp = (PyObject *) r;\ 880 r = v; __Pyx_DECREF(tmp);\ 881 } while (0) 882 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) 883 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) 884 885 /* PyObjectGetAttrStr.proto */ 886 #if CYTHON_USE_TYPE_SLOTS 887 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); 888 #else 889 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) 890 #endif 891 892 /* PyThreadStateGet.proto */ 893 #if CYTHON_FAST_THREAD_STATE 894 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; 895 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; 896 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type 897 #else 898 #define __Pyx_PyThreadState_declare 899 #define __Pyx_PyThreadState_assign 900 #define __Pyx_PyErr_Occurred() PyErr_Occurred() 901 #endif 902 903 /* PyErrFetchRestore.proto */ 904 #if CYTHON_FAST_THREAD_STATE 905 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) 906 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) 907 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) 908 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) 909 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) 910 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); 911 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); 912 #if CYTHON_COMPILING_IN_CPYTHON 913 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) 914 #else 915 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 916 #endif 917 #else 918 #define __Pyx_PyErr_Clear() PyErr_Clear() 919 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) 920 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) 921 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) 922 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) 923 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) 924 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) 925 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) 926 #endif 927 928 /* CLineInTraceback.proto */ 929 #ifdef CYTHON_CLINE_IN_TRACEBACK 930 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) 931 #else 932 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); 933 #endif 934 935 /* CodeObjectCache.proto */ 936 typedef struct { 937 PyCodeObject* code_object; 938 int code_line; 939 } __Pyx_CodeObjectCacheEntry; 940 struct __Pyx_CodeObjectCache { 941 int count; 942 int max_count; 943 __Pyx_CodeObjectCacheEntry* entries; 944 }; 945 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; 946 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); 947 static PyCodeObject *__pyx_find_code_object(int code_line); 948 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); 949 950 /* AddTraceback.proto */ 951 static void __Pyx_AddTraceback(const char *funcname, int c_line, 952 int py_line, const char *filename); 953 954 /* Print.proto */ 955 static int __Pyx_Print(PyObject*, PyObject *, int); 956 #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3 957 static PyObject* __pyx_print = 0; 958 static PyObject* __pyx_print_kwargs = 0; 959 #endif 960 961 /* PrintOne.proto */ 962 static int __Pyx_PrintOne(PyObject* stream, PyObject *o); 963 964 /* CIntToPy.proto */ 965 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); 966 967 /* CIntFromPy.proto */ 968 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); 969 970 /* CIntFromPy.proto */ 971 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); 972 973 /* FastTypeChecks.proto */ 974 #if CYTHON_COMPILING_IN_CPYTHON 975 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) 976 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); 977 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); 978 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); 979 #else 980 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) 981 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) 982 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) 983 #endif 984 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) 985 986 /* CheckBinaryVersion.proto */ 987 static int __Pyx_check_binary_version(void); 988 989 /* InitStrings.proto */ 990 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); 991 992 993 /* Module declarations from 'cpython.version' */ 994 995 /* Module declarations from 'cy_ctest' */ 996 #define __Pyx_MODULE_NAME "cy_ctest" 997 extern int __pyx_module_is_main_cy_ctest; 998 int __pyx_module_is_main_cy_ctest = 0; 999 1000 /* Implementation of 'cy_ctest' */ 1001 static const char __pyx_k_end[] = "end"; 1002 static const char __pyx_k_file[] = "file"; 1003 static const char __pyx_k_main[] = "__main__"; 1004 static const char __pyx_k_name[] = "__name__"; 1005 static const char __pyx_k_test[] = "__test__"; 1006 static const char __pyx_k_print[] = "print"; 1007 static const char __pyx_k_pyhello[] = "pyhello"; 1008 static const char __pyx_k_cy_ctest[] = "cy_ctest"; 1009 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; 1010 static const char __pyx_k_Compiled_with_python_version_s[] = "Compiled with python version %s"; 1011 static const char __pyx_k_home_romain_dev_waf_wrapper_waf[] = "/home/romain/dev/waf-wrapper/waf/playground/cython/src/cy_ctest.pyx"; 1012 static PyObject *__pyx_kp_s_Compiled_with_python_version_s; 1013 static PyObject *__pyx_n_s_cline_in_traceback; 1014 static PyObject *__pyx_n_s_cy_ctest; 1015 static PyObject *__pyx_n_s_end; 1016 static PyObject *__pyx_n_s_file; 1017 static PyObject *__pyx_kp_s_home_romain_dev_waf_wrapper_waf; 1018 static PyObject *__pyx_n_s_main; 1019 static PyObject *__pyx_n_s_name; 1020 static PyObject *__pyx_n_s_print; 1021 static PyObject *__pyx_n_s_pyhello; 1022 static PyObject *__pyx_n_s_test; 1023 static PyObject *__pyx_pf_8cy_ctest_pyhello(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ 1024 static PyObject *__pyx_codeobj_; 1025 /* Late includes */ 1026 1027 /* "cy_ctest.pyx":5 1028 * #cimport commented_import 1029 * 1030 * def pyhello(): # <<<<<<<<<<<<<< 1031 * cy_ctest.hello() 1032 * print("Compiled with python version %s" % PY_VERSION) 1033 */ 1034 1035 /* Python wrapper */ 1036 static PyObject *__pyx_pw_8cy_ctest_1pyhello(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ 1037 static PyMethodDef __pyx_mdef_8cy_ctest_1pyhello = {"pyhello", (PyCFunction)__pyx_pw_8cy_ctest_1pyhello, METH_NOARGS, 0}; 1038 static PyObject *__pyx_pw_8cy_ctest_1pyhello(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { 1039 PyObject *__pyx_r = 0; 1040 __Pyx_RefNannyDeclarations 1041 __Pyx_RefNannySetupContext("pyhello (wrapper)", 0); 1042 __pyx_r = __pyx_pf_8cy_ctest_pyhello(__pyx_self); 1043 1044 /* function exit code */ 1045 __Pyx_RefNannyFinishContext(); 1046 return __pyx_r; 1047 } 1048 1049 static PyObject *__pyx_pf_8cy_ctest_pyhello(CYTHON_UNUSED PyObject *__pyx_self) { 1050 PyObject *__pyx_r = NULL; 1051 __Pyx_RefNannyDeclarations 1052 PyObject *__pyx_t_1 = NULL; 1053 PyObject *__pyx_t_2 = NULL; 1054 __Pyx_RefNannySetupContext("pyhello", 0); 1055 1056 /* "cy_ctest.pyx":6 1057 * 1058 * def pyhello(): 1059 * cy_ctest.hello() # <<<<<<<<<<<<<< 1060 * print("Compiled with python version %s" % PY_VERSION) 1061 */ 1062 hello(); 1063 1064 /* "cy_ctest.pyx":7 1065 * def pyhello(): 1066 * cy_ctest.hello() 1067 * print("Compiled with python version %s" % PY_VERSION) # <<<<<<<<<<<<<< 1068 */ 1069 __pyx_t_1 = __Pyx_PyObject_FromString(PY_VERSION); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error) 1070 __Pyx_GOTREF(__pyx_t_1); 1071 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Compiled_with_python_version_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) 1072 __Pyx_GOTREF(__pyx_t_2); 1073 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; 1074 if (__Pyx_PrintOne(0, __pyx_t_2) < 0) __PYX_ERR(0, 7, __pyx_L1_error) 1075 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; 1076 1077 /* "cy_ctest.pyx":5 1078 * #cimport commented_import 1079 * 1080 * def pyhello(): # <<<<<<<<<<<<<< 1081 * cy_ctest.hello() 1082 * print("Compiled with python version %s" % PY_VERSION) 1083 */ 1084 1085 /* function exit code */ 1086 __pyx_r = Py_None; __Pyx_INCREF(Py_None); 1087 goto __pyx_L0; 1088 __pyx_L1_error:; 1089 __Pyx_XDECREF(__pyx_t_1); 1090 __Pyx_XDECREF(__pyx_t_2); 1091 __Pyx_AddTraceback("cy_ctest.pyhello", __pyx_clineno, __pyx_lineno, __pyx_filename); 1092 __pyx_r = NULL; 1093 __pyx_L0:; 1094 __Pyx_XGIVEREF(__pyx_r); 1095 __Pyx_RefNannyFinishContext(); 1096 return __pyx_r; 1097 } 1098 1099 static PyMethodDef __pyx_methods[] = { 1100 {0, 0, 0, 0} 1101 }; 1102 1103 #if PY_MAJOR_VERSION >= 3 1104 #if CYTHON_PEP489_MULTI_PHASE_INIT 1105 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ 1106 static int __pyx_pymod_exec_cy_ctest(PyObject* module); /*proto*/ 1107 static PyModuleDef_Slot __pyx_moduledef_slots[] = { 1108 {Py_mod_create, (void*)__pyx_pymod_create}, 1109 {Py_mod_exec, (void*)__pyx_pymod_exec_cy_ctest}, 1110 {0, NULL} 1111 }; 1112 #endif 1113 1114 static struct PyModuleDef __pyx_moduledef = { 1115 PyModuleDef_HEAD_INIT, 1116 "cy_ctest", 1117 0, /* m_doc */ 1118 #if CYTHON_PEP489_MULTI_PHASE_INIT 1119 0, /* m_size */ 1120 #else 1121 -1, /* m_size */ 1122 #endif 1123 __pyx_methods /* m_methods */, 1124 #if CYTHON_PEP489_MULTI_PHASE_INIT 1125 __pyx_moduledef_slots, /* m_slots */ 1126 #else 1127 NULL, /* m_reload */ 1128 #endif 1129 NULL, /* m_traverse */ 1130 NULL, /* m_clear */ 1131 NULL /* m_free */ 1132 }; 1133 #endif 1134 #ifndef CYTHON_SMALL_CODE 1135 #if defined(__clang__) 1136 #define CYTHON_SMALL_CODE 1137 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) 1138 #define CYTHON_SMALL_CODE __attribute__((cold)) 1139 #else 1140 #define CYTHON_SMALL_CODE 1141 #endif 1142 #endif 1143 1144 static __Pyx_StringTabEntry __pyx_string_tab[] = { 1145 {&__pyx_kp_s_Compiled_with_python_version_s, __pyx_k_Compiled_with_python_version_s, sizeof(__pyx_k_Compiled_with_python_version_s), 0, 0, 1, 0}, 1146 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, 1147 {&__pyx_n_s_cy_ctest, __pyx_k_cy_ctest, sizeof(__pyx_k_cy_ctest), 0, 0, 1, 1}, 1148 {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1}, 1149 {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1}, 1150 {&__pyx_kp_s_home_romain_dev_waf_wrapper_waf, __pyx_k_home_romain_dev_waf_wrapper_waf, sizeof(__pyx_k_home_romain_dev_waf_wrapper_waf), 0, 0, 1, 0}, 1151 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, 1152 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, 1153 {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1}, 1154 {&__pyx_n_s_pyhello, __pyx_k_pyhello, sizeof(__pyx_k_pyhello), 0, 0, 1, 1}, 1155 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, 1156 {0, 0, 0, 0, 0, 0, 0} 1157 }; 1158 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { 1159 return 0; 1160 } 1161 1162 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { 1163 __Pyx_RefNannyDeclarations 1164 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); 1165 1166 /* "cy_ctest.pyx":5 1167 * #cimport commented_import 1168 * 1169 * def pyhello(): # <<<<<<<<<<<<<< 1170 * cy_ctest.hello() 1171 * print("Compiled with python version %s" % PY_VERSION) 1172 */ 1173 __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_home_romain_dev_waf_wrapper_waf, __pyx_n_s_pyhello, 5, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 5, __pyx_L1_error) 1174 __Pyx_RefNannyFinishContext(); 1175 return 0; 1176 __pyx_L1_error:; 1177 __Pyx_RefNannyFinishContext(); 1178 return -1; 1179 } 1180 1181 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { 1182 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); 1183 return 0; 1184 __pyx_L1_error:; 1185 return -1; 1186 } 1187 1188 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ 1189 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ 1190 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ 1191 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ 1192 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ 1193 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ 1194 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ 1195 1196 static int __Pyx_modinit_global_init_code(void) { 1197 __Pyx_RefNannyDeclarations 1198 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); 1199 /*--- Global init code ---*/ 1200 __Pyx_RefNannyFinishContext(); 1201 return 0; 1202 } 1203 1204 static int __Pyx_modinit_variable_export_code(void) { 1205 __Pyx_RefNannyDeclarations 1206 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); 1207 /*--- Variable export code ---*/ 1208 __Pyx_RefNannyFinishContext(); 1209 return 0; 1210 } 1211 1212 static int __Pyx_modinit_function_export_code(void) { 1213 __Pyx_RefNannyDeclarations 1214 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); 1215 /*--- Function export code ---*/ 1216 __Pyx_RefNannyFinishContext(); 1217 return 0; 1218 } 1219 1220 static int __Pyx_modinit_type_init_code(void) { 1221 __Pyx_RefNannyDeclarations 1222 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); 1223 /*--- Type init code ---*/ 1224 __Pyx_RefNannyFinishContext(); 1225 return 0; 1226 } 1227 1228 static int __Pyx_modinit_type_import_code(void) { 1229 __Pyx_RefNannyDeclarations 1230 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); 1231 /*--- Type import code ---*/ 1232 __Pyx_RefNannyFinishContext(); 1233 return 0; 1234 } 1235 1236 static int __Pyx_modinit_variable_import_code(void) { 1237 __Pyx_RefNannyDeclarations 1238 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); 1239 /*--- Variable import code ---*/ 1240 __Pyx_RefNannyFinishContext(); 1241 return 0; 1242 } 1243 1244 static int __Pyx_modinit_function_import_code(void) { 1245 __Pyx_RefNannyDeclarations 1246 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); 1247 /*--- Function import code ---*/ 1248 __Pyx_RefNannyFinishContext(); 1249 return 0; 1250 } 1251 1252 1253 #if PY_MAJOR_VERSION < 3 1254 #ifdef CYTHON_NO_PYINIT_EXPORT 1255 #define __Pyx_PyMODINIT_FUNC void 1256 #else 1257 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC 1258 #endif 1259 #else 1260 #ifdef CYTHON_NO_PYINIT_EXPORT 1261 #define __Pyx_PyMODINIT_FUNC PyObject * 1262 #else 1263 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC 1264 #endif 1265 #endif 1266 1267 1268 #if PY_MAJOR_VERSION < 3 1269 __Pyx_PyMODINIT_FUNC initcy_ctest(void) CYTHON_SMALL_CODE; /*proto*/ 1270 __Pyx_PyMODINIT_FUNC initcy_ctest(void) 1271 #else 1272 __Pyx_PyMODINIT_FUNC PyInit_cy_ctest(void) CYTHON_SMALL_CODE; /*proto*/ 1273 __Pyx_PyMODINIT_FUNC PyInit_cy_ctest(void) 1274 #if CYTHON_PEP489_MULTI_PHASE_INIT 1275 { 1276 return PyModuleDef_Init(&__pyx_moduledef); 1277 } 1278 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { 1279 #if PY_VERSION_HEX >= 0x030700A1 1280 static PY_INT64_T main_interpreter_id = -1; 1281 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); 1282 if (main_interpreter_id == -1) { 1283 main_interpreter_id = current_id; 1284 return (unlikely(current_id == -1)) ? -1 : 0; 1285 } else if (unlikely(main_interpreter_id != current_id)) 1286 #else 1287 static PyInterpreterState *main_interpreter = NULL; 1288 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; 1289 if (!main_interpreter) { 1290 main_interpreter = current_interpreter; 1291 } else if (unlikely(main_interpreter != current_interpreter)) 1292 #endif 1293 { 1294 PyErr_SetString( 1295 PyExc_ImportError, 1296 "Interpreter change detected - this module can only be loaded into one interpreter per process."); 1297 return -1; 1298 } 1299 return 0; 1300 } 1301 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) { 1302 PyObject *value = PyObject_GetAttrString(spec, from_name); 1303 int result = 0; 1304 if (likely(value)) { 1305 result = PyDict_SetItemString(moddict, to_name, value); 1306 Py_DECREF(value); 1307 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { 1308 PyErr_Clear(); 1309 } else { 1310 result = -1; 1311 } 1312 return result; 1313 } 1314 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { 1315 PyObject *module = NULL, *moddict, *modname; 1316 if (__Pyx_check_single_interpreter()) 1317 return NULL; 1318 if (__pyx_m) 1319 return __Pyx_NewRef(__pyx_m); 1320 modname = PyObject_GetAttrString(spec, "name"); 1321 if (unlikely(!modname)) goto bad; 1322 module = PyModule_NewObject(modname); 1323 Py_DECREF(modname); 1324 if (unlikely(!module)) goto bad; 1325 moddict = PyModule_GetDict(module); 1326 if (unlikely(!moddict)) goto bad; 1327 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad; 1328 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad; 1329 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad; 1330 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad; 1331 return module; 1332 bad: 1333 Py_XDECREF(module); 1334 return NULL; 1335 } 1336 1337 1338 static CYTHON_SMALL_CODE int __pyx_pymod_exec_cy_ctest(PyObject *__pyx_pyinit_module) 1339 #endif 1340 #endif 1341 { 1342 PyObject *__pyx_t_1 = NULL; 1343 __Pyx_RefNannyDeclarations 1344 #if CYTHON_PEP489_MULTI_PHASE_INIT 1345 if (__pyx_m) { 1346 if (__pyx_m == __pyx_pyinit_module) return 0; 1347 PyErr_SetString(PyExc_RuntimeError, "Module 'cy_ctest' has already been imported. Re-initialisation is not supported."); 1348 return -1; 1349 } 1350 #elif PY_MAJOR_VERSION >= 3 1351 if (__pyx_m) return __Pyx_NewRef(__pyx_m); 1352 #endif 1353 #if CYTHON_REFNANNY 1354 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); 1355 if (!__Pyx_RefNanny) { 1356 PyErr_Clear(); 1357 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); 1358 if (!__Pyx_RefNanny) 1359 Py_FatalError("failed to import 'refnanny' module"); 1360 } 1361 #endif 1362 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_cy_ctest(void)", 0); 1363 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) 1364 #ifdef __Pxy_PyFrame_Initialize_Offsets 1365 __Pxy_PyFrame_Initialize_Offsets(); 1366 #endif 1367 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) 1368 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) 1369 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) 1370 #ifdef __Pyx_CyFunction_USED 1371 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) 1372 #endif 1373 #ifdef __Pyx_FusedFunction_USED 1374 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) 1375 #endif 1376 #ifdef __Pyx_Coroutine_USED 1377 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) 1378 #endif 1379 #ifdef __Pyx_Generator_USED 1380 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) 1381 #endif 1382 #ifdef __Pyx_AsyncGen_USED 1383 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) 1384 #endif 1385 #ifdef __Pyx_StopAsyncIteration_USED 1386 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) 1387 #endif 1388 /*--- Library function declarations ---*/ 1389 /*--- Threads initialization code ---*/ 1390 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS 1391 #ifdef WITH_THREAD /* Python build with threading support? */ 1392 PyEval_InitThreads(); 1393 #endif 1394 #endif 1395 /*--- Module creation code ---*/ 1396 #if CYTHON_PEP489_MULTI_PHASE_INIT 1397 __pyx_m = __pyx_pyinit_module; 1398 Py_INCREF(__pyx_m); 1399 #else 1400 #if PY_MAJOR_VERSION < 3 1401 __pyx_m = Py_InitModule4("cy_ctest", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); 1402 #else 1403 __pyx_m = PyModule_Create(&__pyx_moduledef); 1404 #endif 1405 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) 1406 #endif 1407 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) 1408 Py_INCREF(__pyx_d); 1409 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) 1410 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) 1411 #if CYTHON_COMPILING_IN_PYPY 1412 Py_INCREF(__pyx_b); 1413 #endif 1414 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); 1415 /*--- Initialize various global constants etc. ---*/ 1416 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) 1417 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) 1418 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) 1419 #endif 1420 if (__pyx_module_is_main_cy_ctest) { 1421 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) 1422 } 1423 #if PY_MAJOR_VERSION >= 3 1424 { 1425 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) 1426 if (!PyDict_GetItemString(modules, "cy_ctest")) { 1427 if (unlikely(PyDict_SetItemString(modules, "cy_ctest", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) 1428 } 1429 } 1430 #endif 1431 /*--- Builtin init code ---*/ 1432 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) 1433 /*--- Constants init code ---*/ 1434 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) 1435 /*--- Global type/function init code ---*/ 1436 (void)__Pyx_modinit_global_init_code(); 1437 (void)__Pyx_modinit_variable_export_code(); 1438 (void)__Pyx_modinit_function_export_code(); 1439 (void)__Pyx_modinit_type_init_code(); 1440 (void)__Pyx_modinit_type_import_code(); 1441 (void)__Pyx_modinit_variable_import_code(); 1442 (void)__Pyx_modinit_function_import_code(); 1443 /*--- Execution code ---*/ 1444 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) 1445 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) 1446 #endif 1447 1448 /* "cy_ctest.pyx":5 1449 * #cimport commented_import 1450 * 1451 * def pyhello(): # <<<<<<<<<<<<<< 1452 * cy_ctest.hello() 1453 * print("Compiled with python version %s" % PY_VERSION) 1454 */ 1455 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8cy_ctest_1pyhello, NULL, __pyx_n_s_cy_ctest); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) 1456 __Pyx_GOTREF(__pyx_t_1); 1457 if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyhello, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error) 1458 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; 1459 1460 /* "cy_ctest.pyx":1 1461 * from cpython.version cimport PY_VERSION # <<<<<<<<<<<<<< 1462 * cimport cy_ctest 1463 * #cimport commented_import 1464 */ 1465 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) 1466 __Pyx_GOTREF(__pyx_t_1); 1467 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) 1468 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; 1469 1470 /*--- Wrapped vars code ---*/ 1471 1472 goto __pyx_L0; 1473 __pyx_L1_error:; 1474 __Pyx_XDECREF(__pyx_t_1); 1475 if (__pyx_m) { 1476 if (__pyx_d) { 1477 __Pyx_AddTraceback("init cy_ctest", __pyx_clineno, __pyx_lineno, __pyx_filename); 1478 } 1479 Py_CLEAR(__pyx_m); 1480 } else if (!PyErr_Occurred()) { 1481 PyErr_SetString(PyExc_ImportError, "init cy_ctest"); 1482 } 1483 __pyx_L0:; 1484 __Pyx_RefNannyFinishContext(); 1485 #if CYTHON_PEP489_MULTI_PHASE_INIT 1486 return (__pyx_m != NULL) ? 0 : -1; 1487 #elif PY_MAJOR_VERSION >= 3 1488 return __pyx_m; 1489 #else 1490 return; 1491 #endif 1492 } 1493 1494 /* --- Runtime support code --- */ 1495 /* Refnanny */ 1496 #if CYTHON_REFNANNY 1497 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { 1498 PyObject *m = NULL, *p = NULL; 1499 void *r = NULL; 1500 m = PyImport_ImportModule(modname); 1501 if (!m) goto end; 1502 p = PyObject_GetAttrString(m, "RefNannyAPI"); 1503 if (!p) goto end; 1504 r = PyLong_AsVoidPtr(p); 1505 end: 1506 Py_XDECREF(p); 1507 Py_XDECREF(m); 1508 return (__Pyx_RefNannyAPIStruct *)r; 1509 } 1510 #endif 1511 1512 /* PyObjectGetAttrStr */ 1513 #if CYTHON_USE_TYPE_SLOTS 1514 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { 1515 PyTypeObject* tp = Py_TYPE(obj); 1516 if (likely(tp->tp_getattro)) 1517 return tp->tp_getattro(obj, attr_name); 1518 #if PY_MAJOR_VERSION < 3 1519 if (likely(tp->tp_getattr)) 1520 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); 1521 #endif 1522 return PyObject_GetAttr(obj, attr_name); 1523 } 1524 #endif 1525 1526 /* PyErrFetchRestore */ 1527 #if CYTHON_FAST_THREAD_STATE 1528 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { 1529 PyObject *tmp_type, *tmp_value, *tmp_tb; 1530 tmp_type = tstate->curexc_type; 1531 tmp_value = tstate->curexc_value; 1532 tmp_tb = tstate->curexc_traceback; 1533 tstate->curexc_type = type; 1534 tstate->curexc_value = value; 1535 tstate->curexc_traceback = tb; 1536 Py_XDECREF(tmp_type); 1537 Py_XDECREF(tmp_value); 1538 Py_XDECREF(tmp_tb); 1539 } 1540 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { 1541 *type = tstate->curexc_type; 1542 *value = tstate->curexc_value; 1543 *tb = tstate->curexc_traceback; 1544 tstate->curexc_type = 0; 1545 tstate->curexc_value = 0; 1546 tstate->curexc_traceback = 0; 1547 } 1548 #endif 1549 1550 /* CLineInTraceback */ 1551 #ifndef CYTHON_CLINE_IN_TRACEBACK 1552 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { 1553 PyObject *use_cline; 1554 PyObject *ptype, *pvalue, *ptraceback; 1555 #if CYTHON_COMPILING_IN_CPYTHON 1556 PyObject **cython_runtime_dict; 1557 #endif 1558 if (unlikely(!__pyx_cython_runtime)) { 1559 return c_line; 1560 } 1561 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); 1562 #if CYTHON_COMPILING_IN_CPYTHON 1563 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); 1564 if (likely(cython_runtime_dict)) { 1565 __PYX_PY_DICT_LOOKUP_IF_MODIFIED( 1566 use_cline, *cython_runtime_dict, 1567 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) 1568 } else 1569 #endif 1570 { 1571 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); 1572 if (use_cline_obj) { 1573 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; 1574 Py_DECREF(use_cline_obj); 1575 } else { 1576 PyErr_Clear(); 1577 use_cline = NULL; 1578 } 1579 } 1580 if (!use_cline) { 1581 c_line = 0; 1582 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); 1583 } 1584 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { 1585 c_line = 0; 1586 } 1587 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); 1588 return c_line; 1589 } 1590 #endif 1591 1592 /* CodeObjectCache */ 1593 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { 1594 int start = 0, mid = 0, end = count - 1; 1595 if (end >= 0 && code_line > entries[end].code_line) { 1596 return count; 1597 } 1598 while (start < end) { 1599 mid = start + (end - start) / 2; 1600 if (code_line < entries[mid].code_line) { 1601 end = mid; 1602 } else if (code_line > entries[mid].code_line) { 1603 start = mid + 1; 1604 } else { 1605 return mid; 1606 } 1607 } 1608 if (code_line <= entries[mid].code_line) { 1609 return mid; 1610 } else { 1611 return mid + 1; 1612 } 1613 } 1614 static PyCodeObject *__pyx_find_code_object(int code_line) { 1615 PyCodeObject* code_object; 1616 int pos; 1617 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { 1618 return NULL; 1619 } 1620 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); 1621 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { 1622 return NULL; 1623 } 1624 code_object = __pyx_code_cache.entries[pos].code_object; 1625 Py_INCREF(code_object); 1626 return code_object; 1627 } 1628 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { 1629 int pos, i; 1630 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; 1631 if (unlikely(!code_line)) { 1632 return; 1633 } 1634 if (unlikely(!entries)) { 1635 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); 1636 if (likely(entries)) { 1637 __pyx_code_cache.entries = entries; 1638 __pyx_code_cache.max_count = 64; 1639 __pyx_code_cache.count = 1; 1640 entries[0].code_line = code_line; 1641 entries[0].code_object = code_object; 1642 Py_INCREF(code_object); 1643 } 1644 return; 1645 } 1646 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); 1647 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { 1648 PyCodeObject* tmp = entries[pos].code_object; 1649 entries[pos].code_object = code_object; 1650 Py_DECREF(tmp); 1651 return; 1652 } 1653 if (__pyx_code_cache.count == __pyx_code_cache.max_count) { 1654 int new_max = __pyx_code_cache.max_count + 64; 1655 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( 1656 __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); 1657 if (unlikely(!entries)) { 1658 return; 1659 } 1660 __pyx_code_cache.entries = entries; 1661 __pyx_code_cache.max_count = new_max; 1662 } 1663 for (i=__pyx_code_cache.count; i>pos; i--) { 1664 entries[i] = entries[i-1]; 1665 } 1666 entries[pos].code_line = code_line; 1667 entries[pos].code_object = code_object; 1668 __pyx_code_cache.count++; 1669 Py_INCREF(code_object); 1670 } 1671 1672 /* AddTraceback */ 1673 #include "compile.h" 1674 #include "frameobject.h" 1675 #include "traceback.h" 1676 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( 1677 const char *funcname, int c_line, 1678 int py_line, const char *filename) { 1679 PyCodeObject *py_code = 0; 1680 PyObject *py_srcfile = 0; 1681 PyObject *py_funcname = 0; 1682 #if PY_MAJOR_VERSION < 3 1683 py_srcfile = PyString_FromString(filename); 1684 #else 1685 py_srcfile = PyUnicode_FromString(filename); 1686 #endif 1687 if (!py_srcfile) goto bad; 1688 if (c_line) { 1689 #if PY_MAJOR_VERSION < 3 1690 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); 1691 #else 1692 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); 1693 #endif 1694 } 1695 else { 1696 #if PY_MAJOR_VERSION < 3 1697 py_funcname = PyString_FromString(funcname); 1698 #else 1699 py_funcname = PyUnicode_FromString(funcname); 1700 #endif 1701 } 1702 if (!py_funcname) goto bad; 1703 py_code = __Pyx_PyCode_New( 1704 0, 1705 0, 1706 0, 1707 0, 1708 0, 1709 __pyx_empty_bytes, /*PyObject *code,*/ 1710 __pyx_empty_tuple, /*PyObject *consts,*/ 1711 __pyx_empty_tuple, /*PyObject *names,*/ 1712 __pyx_empty_tuple, /*PyObject *varnames,*/ 1713 __pyx_empty_tuple, /*PyObject *freevars,*/ 1714 __pyx_empty_tuple, /*PyObject *cellvars,*/ 1715 py_srcfile, /*PyObject *filename,*/ 1716 py_funcname, /*PyObject *name,*/ 1717 py_line, 1718 __pyx_empty_bytes /*PyObject *lnotab*/ 1719 ); 1720 Py_DECREF(py_srcfile); 1721 Py_DECREF(py_funcname); 1722 return py_code; 1723 bad: 1724 Py_XDECREF(py_srcfile); 1725 Py_XDECREF(py_funcname); 1726 return NULL; 1727 } 1728 static void __Pyx_AddTraceback(const char *funcname, int c_line, 1729 int py_line, const char *filename) { 1730 PyCodeObject *py_code = 0; 1731 PyFrameObject *py_frame = 0; 1732 PyThreadState *tstate = __Pyx_PyThreadState_Current; 1733 if (c_line) { 1734 c_line = __Pyx_CLineForTraceback(tstate, c_line); 1735 } 1736 py_code = __pyx_find_code_object(c_line ? -c_line : py_line); 1737 if (!py_code) { 1738 py_code = __Pyx_CreateCodeObjectForTraceback( 1739 funcname, c_line, py_line, filename); 1740 if (!py_code) goto bad; 1741 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); 1742 } 1743 py_frame = PyFrame_New( 1744 tstate, /*PyThreadState *tstate,*/ 1745 py_code, /*PyCodeObject *code,*/ 1746 __pyx_d, /*PyObject *globals,*/ 1747 0 /*PyObject *locals*/ 1748 ); 1749 if (!py_frame) goto bad; 1750 __Pyx_PyFrame_SetLineNumber(py_frame, py_line); 1751 PyTraceBack_Here(py_frame); 1752 bad: 1753 Py_XDECREF(py_code); 1754 Py_XDECREF(py_frame); 1755 } 1756 1757 /* Print */ 1758 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 1759 static PyObject *__Pyx_GetStdout(void) { 1760 PyObject *f = PySys_GetObject((char *)"stdout"); 1761 if (!f) { 1762 PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); 1763 } 1764 return f; 1765 } 1766 static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) { 1767 int i; 1768 if (!f) { 1769 if (!(f = __Pyx_GetStdout())) 1770 return -1; 1771 } 1772 Py_INCREF(f); 1773 for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) { 1774 PyObject* v; 1775 if (PyFile_SoftSpace(f, 1)) { 1776 if (PyFile_WriteString(" ", f) < 0) 1777 goto error; 1778 } 1779 v = PyTuple_GET_ITEM(arg_tuple, i); 1780 if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0) 1781 goto error; 1782 if (PyString_Check(v)) { 1783 char *s = PyString_AsString(v); 1784 Py_ssize_t len = PyString_Size(v); 1785 if (len > 0) { 1786 switch (s[len-1]) { 1787 case ' ': break; 1788 case '\f': case '\r': case '\n': case '\t': case '\v': 1789 PyFile_SoftSpace(f, 0); 1790 break; 1791 default: break; 1792 } 1793 } 1794 } 1795 } 1796 if (newline) { 1797 if (PyFile_WriteString("\n", f) < 0) 1798 goto error; 1799 PyFile_SoftSpace(f, 0); 1800 } 1801 Py_DECREF(f); 1802 return 0; 1803 error: 1804 Py_DECREF(f); 1805 return -1; 1806 } 1807 #else 1808 static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) { 1809 PyObject* kwargs = 0; 1810 PyObject* result = 0; 1811 PyObject* end_string; 1812 if (unlikely(!__pyx_print)) { 1813 __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print); 1814 if (!__pyx_print) 1815 return -1; 1816 } 1817 if (stream) { 1818 kwargs = PyDict_New(); 1819 if (unlikely(!kwargs)) 1820 return -1; 1821 if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0)) 1822 goto bad; 1823 if (!newline) { 1824 end_string = PyUnicode_FromStringAndSize(" ", 1); 1825 if (unlikely(!end_string)) 1826 goto bad; 1827 if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) { 1828 Py_DECREF(end_string); 1829 goto bad; 1830 } 1831 Py_DECREF(end_string); 1832 } 1833 } else if (!newline) { 1834 if (unlikely(!__pyx_print_kwargs)) { 1835 __pyx_print_kwargs = PyDict_New(); 1836 if (unlikely(!__pyx_print_kwargs)) 1837 return -1; 1838 end_string = PyUnicode_FromStringAndSize(" ", 1); 1839 if (unlikely(!end_string)) 1840 return -1; 1841 if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) { 1842 Py_DECREF(end_string); 1843 return -1; 1844 } 1845 Py_DECREF(end_string); 1846 } 1847 kwargs = __pyx_print_kwargs; 1848 } 1849 result = PyObject_Call(__pyx_print, arg_tuple, kwargs); 1850 if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs)) 1851 Py_DECREF(kwargs); 1852 if (!result) 1853 return -1; 1854 Py_DECREF(result); 1855 return 0; 1856 bad: 1857 if (kwargs != __pyx_print_kwargs) 1858 Py_XDECREF(kwargs); 1859 return -1; 1860 } 1861 #endif 1862 1863 /* PrintOne */ 1864 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3 1865 static int __Pyx_PrintOne(PyObject* f, PyObject *o) { 1866 if (!f) { 1867 if (!(f = __Pyx_GetStdout())) 1868 return -1; 1869 } 1870 Py_INCREF(f); 1871 if (PyFile_SoftSpace(f, 0)) { 1872 if (PyFile_WriteString(" ", f) < 0) 1873 goto error; 1874 } 1875 if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0) 1876 goto error; 1877 if (PyFile_WriteString("\n", f) < 0) 1878 goto error; 1879 Py_DECREF(f); 1880 return 0; 1881 error: 1882 Py_DECREF(f); 1883 return -1; 1884 /* the line below is just to avoid C compiler 1885 * warnings about unused functions */ 1886 return __Pyx_Print(f, NULL, 0); 1887 } 1888 #else 1889 static int __Pyx_PrintOne(PyObject* stream, PyObject *o) { 1890 int res; 1891 PyObject* arg_tuple = PyTuple_Pack(1, o); 1892 if (unlikely(!arg_tuple)) 1893 return -1; 1894 res = __Pyx_Print(stream, arg_tuple, 1); 1895 Py_DECREF(arg_tuple); 1896 return res; 1897 } 1898 #endif 1899 1900 /* CIntToPy */ 1901 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { 1902 const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; 1903 const int is_unsigned = neg_one > const_zero; 1904 if (is_unsigned) { 1905 if (sizeof(long) < sizeof(long)) { 1906 return PyInt_FromLong((long) value); 1907 } else if (sizeof(long) <= sizeof(unsigned long)) { 1908 return PyLong_FromUnsignedLong((unsigned long) value); 1909 #ifdef HAVE_LONG_LONG 1910 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { 1911 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); 1912 #endif 1913 } 1914 } else { 1915 if (sizeof(long) <= sizeof(long)) { 1916 return PyInt_FromLong((long) value); 1917 #ifdef HAVE_LONG_LONG 1918 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { 1919 return PyLong_FromLongLong((PY_LONG_LONG) value); 1920 #endif 1921 } 1922 } 1923 { 1924 int one = 1; int little = (int)*(unsigned char *)&one; 1925 unsigned char *bytes = (unsigned char *)&value; 1926 return _PyLong_FromByteArray(bytes, sizeof(long), 1927 little, !is_unsigned); 1928 } 1929 } 1930 1931 /* CIntFromPyVerify */ 1932 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ 1933 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) 1934 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ 1935 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) 1936 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ 1937 {\ 1938 func_type value = func_value;\ 1939 if (sizeof(target_type) < sizeof(func_type)) {\ 1940 if (unlikely(value != (func_type) (target_type) value)) {\ 1941 func_type zero = 0;\ 1942 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ 1943 return (target_type) -1;\ 1944 if (is_unsigned && unlikely(value < zero))\ 1945 goto raise_neg_overflow;\ 1946 else\ 1947 goto raise_overflow;\ 1948 }\ 1949 }\ 1950 return (target_type) value;\ 1951 } 1952 1953 /* CIntFromPy */ 1954 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { 1955 const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0; 1956 const int is_unsigned = neg_one > const_zero; 1957 #if PY_MAJOR_VERSION < 3 1958 if (likely(PyInt_Check(x))) { 1959 if (sizeof(long) < sizeof(long)) { 1960 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) 1961 } else { 1962 long val = PyInt_AS_LONG(x); 1963 if (is_unsigned && unlikely(val < 0)) { 1964 goto raise_neg_overflow; 1965 } 1966 return (long) val; 1967 } 1968 } else 1969 #endif 1970 if (likely(PyLong_Check(x))) { 1971 if (is_unsigned) { 1972 #if CYTHON_USE_PYLONG_INTERNALS 1973 const digit* digits = ((PyLongObject*)x)->ob_digit; 1974 switch (Py_SIZE(x)) { 1975 case 0: return (long) 0; 1976 case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) 1977 case 2: 1978 if (8 * sizeof(long) > 1 * PyLong_SHIFT) { 1979 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { 1980 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) 1981 } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { 1982 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); 1983 } 1984 } 1985 break; 1986 case 3: 1987 if (8 * sizeof(long) > 2 * PyLong_SHIFT) { 1988 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { 1989 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) 1990 } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { 1991 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); 1992 } 1993 } 1994 break; 1995 case 4: 1996 if (8 * sizeof(long) > 3 * PyLong_SHIFT) { 1997 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { 1998 __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]))) 1999 } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { 2000 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); 2001 } 2002 } 2003 break; 2004 } 2005 #endif 2006 #if CYTHON_COMPILING_IN_CPYTHON 2007 if (unlikely(Py_SIZE(x) < 0)) { 2008 goto raise_neg_overflow; 2009 } 2010 #else 2011 { 2012 int result = PyObject_RichCompareBool(x, Py_False, Py_LT); 2013 if (unlikely(result < 0)) 2014 return (long) -1; 2015 if (unlikely(result == 1)) 2016 goto raise_neg_overflow; 2017 } 2018 #endif 2019 if (sizeof(long) <= sizeof(unsigned long)) { 2020 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) 2021 #ifdef HAVE_LONG_LONG 2022 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { 2023 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) 2024 #endif 2025 } 2026 } else { 2027 #if CYTHON_USE_PYLONG_INTERNALS 2028 const digit* digits = ((PyLongObject*)x)->ob_digit; 2029 switch (Py_SIZE(x)) { 2030 case 0: return (long) 0; 2031 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) 2032 case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) 2033 case -2: 2034 if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { 2035 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { 2036 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) 2037 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { 2038 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); 2039 } 2040 } 2041 break; 2042 case 2: 2043 if (8 * sizeof(long) > 1 * PyLong_SHIFT) { 2044 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { 2045 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) 2046 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { 2047 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); 2048 } 2049 } 2050 break; 2051 case -3: 2052 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { 2053 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { 2054 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) 2055 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { 2056 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); 2057 } 2058 } 2059 break; 2060 case 3: 2061 if (8 * sizeof(long) > 2 * PyLong_SHIFT) { 2062 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { 2063 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) 2064 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { 2065 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); 2066 } 2067 } 2068 break; 2069 case -4: 2070 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { 2071 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { 2072 __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]))) 2073 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { 2074 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); 2075 } 2076 } 2077 break; 2078 case 4: 2079 if (8 * sizeof(long) > 3 * PyLong_SHIFT) { 2080 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { 2081 __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]))) 2082 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { 2083 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); 2084 } 2085 } 2086 break; 2087 } 2088 #endif 2089 if (sizeof(long) <= sizeof(long)) { 2090 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) 2091 #ifdef HAVE_LONG_LONG 2092 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { 2093 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) 2094 #endif 2095 } 2096 } 2097 { 2098 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 2099 PyErr_SetString(PyExc_RuntimeError, 2100 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); 2101 #else 2102 long val; 2103 PyObject *v = __Pyx_PyNumber_IntOrLong(x); 2104 #if PY_MAJOR_VERSION < 3 2105 if (likely(v) && !PyLong_Check(v)) { 2106 PyObject *tmp = v; 2107 v = PyNumber_Long(tmp); 2108 Py_DECREF(tmp); 2109 } 2110 #endif 2111 if (likely(v)) { 2112 int one = 1; int is_little = (int)*(unsigned char *)&one; 2113 unsigned char *bytes = (unsigned char *)&val; 2114 int ret = _PyLong_AsByteArray((PyLongObject *)v, 2115 bytes, sizeof(val), 2116 is_little, !is_unsigned); 2117 Py_DECREF(v); 2118 if (likely(!ret)) 2119 return val; 2120 } 2121 #endif 2122 return (long) -1; 2123 } 2124 } else { 2125 long val; 2126 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); 2127 if (!tmp) return (long) -1; 2128 val = __Pyx_PyInt_As_long(tmp); 2129 Py_DECREF(tmp); 2130 return val; 2131 } 2132 raise_overflow: 2133 PyErr_SetString(PyExc_OverflowError, 2134 "value too large to convert to long"); 2135 return (long) -1; 2136 raise_neg_overflow: 2137 PyErr_SetString(PyExc_OverflowError, 2138 "can't convert negative value to long"); 2139 return (long) -1; 2140 } 2141 2142 /* CIntFromPy */ 2143 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { 2144 const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0; 2145 const int is_unsigned = neg_one > const_zero; 2146 #if PY_MAJOR_VERSION < 3 2147 if (likely(PyInt_Check(x))) { 2148 if (sizeof(int) < sizeof(long)) { 2149 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) 2150 } else { 2151 long val = PyInt_AS_LONG(x); 2152 if (is_unsigned && unlikely(val < 0)) { 2153 goto raise_neg_overflow; 2154 } 2155 return (int) val; 2156 } 2157 } else 2158 #endif 2159 if (likely(PyLong_Check(x))) { 2160 if (is_unsigned) { 2161 #if CYTHON_USE_PYLONG_INTERNALS 2162 const digit* digits = ((PyLongObject*)x)->ob_digit; 2163 switch (Py_SIZE(x)) { 2164 case 0: return (int) 0; 2165 case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) 2166 case 2: 2167 if (8 * sizeof(int) > 1 * PyLong_SHIFT) { 2168 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { 2169 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) 2170 } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { 2171 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); 2172 } 2173 } 2174 break; 2175 case 3: 2176 if (8 * sizeof(int) > 2 * PyLong_SHIFT) { 2177 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { 2178 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) 2179 } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { 2180 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); 2181 } 2182 } 2183 break; 2184 case 4: 2185 if (8 * sizeof(int) > 3 * PyLong_SHIFT) { 2186 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { 2187 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) 2188 } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { 2189 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); 2190 } 2191 } 2192 break; 2193 } 2194 #endif 2195 #if CYTHON_COMPILING_IN_CPYTHON 2196 if (unlikely(Py_SIZE(x) < 0)) { 2197 goto raise_neg_overflow; 2198 } 2199 #else 2200 { 2201 int result = PyObject_RichCompareBool(x, Py_False, Py_LT); 2202 if (unlikely(result < 0)) 2203 return (int) -1; 2204 if (unlikely(result == 1)) 2205 goto raise_neg_overflow; 2206 } 2207 #endif 2208 if (sizeof(int) <= sizeof(unsigned long)) { 2209 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) 2210 #ifdef HAVE_LONG_LONG 2211 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { 2212 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) 2213 #endif 2214 } 2215 } else { 2216 #if CYTHON_USE_PYLONG_INTERNALS 2217 const digit* digits = ((PyLongObject*)x)->ob_digit; 2218 switch (Py_SIZE(x)) { 2219 case 0: return (int) 0; 2220 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) 2221 case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) 2222 case -2: 2223 if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { 2224 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { 2225 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) 2226 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { 2227 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); 2228 } 2229 } 2230 break; 2231 case 2: 2232 if (8 * sizeof(int) > 1 * PyLong_SHIFT) { 2233 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { 2234 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) 2235 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { 2236 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); 2237 } 2238 } 2239 break; 2240 case -3: 2241 if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { 2242 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { 2243 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) 2244 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { 2245 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); 2246 } 2247 } 2248 break; 2249 case 3: 2250 if (8 * sizeof(int) > 2 * PyLong_SHIFT) { 2251 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { 2252 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) 2253 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { 2254 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); 2255 } 2256 } 2257 break; 2258 case -4: 2259 if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { 2260 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { 2261 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) 2262 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { 2263 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); 2264 } 2265 } 2266 break; 2267 case 4: 2268 if (8 * sizeof(int) > 3 * PyLong_SHIFT) { 2269 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { 2270 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) 2271 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { 2272 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); 2273 } 2274 } 2275 break; 2276 } 2277 #endif 2278 if (sizeof(int) <= sizeof(long)) { 2279 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) 2280 #ifdef HAVE_LONG_LONG 2281 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { 2282 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) 2283 #endif 2284 } 2285 } 2286 { 2287 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) 2288 PyErr_SetString(PyExc_RuntimeError, 2289 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); 2290 #else 2291 int val; 2292 PyObject *v = __Pyx_PyNumber_IntOrLong(x); 2293 #if PY_MAJOR_VERSION < 3 2294 if (likely(v) && !PyLong_Check(v)) { 2295 PyObject *tmp = v; 2296 v = PyNumber_Long(tmp); 2297 Py_DECREF(tmp); 2298 } 2299 #endif 2300 if (likely(v)) { 2301 int one = 1; int is_little = (int)*(unsigned char *)&one; 2302 unsigned char *bytes = (unsigned char *)&val; 2303 int ret = _PyLong_AsByteArray((PyLongObject *)v, 2304 bytes, sizeof(val), 2305 is_little, !is_unsigned); 2306 Py_DECREF(v); 2307 if (likely(!ret)) 2308 return val; 2309 } 2310 #endif 2311 return (int) -1; 2312 } 2313 } else { 2314 int val; 2315 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); 2316 if (!tmp) return (int) -1; 2317 val = __Pyx_PyInt_As_int(tmp); 2318 Py_DECREF(tmp); 2319 return val; 2320 } 2321 raise_overflow: 2322 PyErr_SetString(PyExc_OverflowError, 2323 "value too large to convert to int"); 2324 return (int) -1; 2325 raise_neg_overflow: 2326 PyErr_SetString(PyExc_OverflowError, 2327 "can't convert negative value to int"); 2328 return (int) -1; 2329 } 2330 2331 /* FastTypeChecks */ 2332 #if CYTHON_COMPILING_IN_CPYTHON 2333 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { 2334 while (a) { 2335 a = a->tp_base; 2336 if (a == b) 2337 return 1; 2338 } 2339 return b == &PyBaseObject_Type; 2340 } 2341 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { 2342 PyObject *mro; 2343 if (a == b) return 1; 2344 mro = a->tp_mro; 2345 if (likely(mro)) { 2346 Py_ssize_t i, n; 2347 n = PyTuple_GET_SIZE(mro); 2348 for (i = 0; i < n; i++) { 2349 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) 2350 return 1; 2351 } 2352 return 0; 2353 } 2354 return __Pyx_InBases(a, b); 2355 } 2356 #if PY_MAJOR_VERSION == 2 2357 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { 2358 PyObject *exception, *value, *tb; 2359 int res; 2360 __Pyx_PyThreadState_declare 2361 __Pyx_PyThreadState_assign 2362 __Pyx_ErrFetch(&exception, &value, &tb); 2363 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; 2364 if (unlikely(res == -1)) { 2365 PyErr_WriteUnraisable(err); 2366 res = 0; 2367 } 2368 if (!res) { 2369 res = PyObject_IsSubclass(err, exc_type2); 2370 if (unlikely(res == -1)) { 2371 PyErr_WriteUnraisable(err); 2372 res = 0; 2373 } 2374 } 2375 __Pyx_ErrRestore(exception, value, tb); 2376 return res; 2377 } 2378 #else 2379 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { 2380 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; 2381 if (!res) { 2382 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); 2383 } 2384 return res; 2385 } 2386 #endif 2387 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { 2388 Py_ssize_t i, n; 2389 assert(PyExceptionClass_Check(exc_type)); 2390 n = PyTuple_GET_SIZE(tuple); 2391 #if PY_MAJOR_VERSION >= 3 2392 for (i=0; i<n; i++) { 2393 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1; 2394 } 2395 #endif 2396 for (i=0; i<n; i++) { 2397 PyObject *t = PyTuple_GET_ITEM(tuple, i); 2398 #if PY_MAJOR_VERSION < 3 2399 if (likely(exc_type == t)) return 1; 2400 #endif 2401 if (likely(PyExceptionClass_Check(t))) { 2402 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1; 2403 } else { 2404 } 2405 } 2406 return 0; 2407 } 2408 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) { 2409 if (likely(err == exc_type)) return 1; 2410 if (likely(PyExceptionClass_Check(err))) { 2411 if (likely(PyExceptionClass_Check(exc_type))) { 2412 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type); 2413 } else if (likely(PyTuple_Check(exc_type))) { 2414 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type); 2415 } else { 2416 } 2417 } 2418 return PyErr_GivenExceptionMatches(err, exc_type); 2419 } 2420 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) { 2421 assert(PyExceptionClass_Check(exc_type1)); 2422 assert(PyExceptionClass_Check(exc_type2)); 2423 if (likely(err == exc_type1 || err == exc_type2)) return 1; 2424 if (likely(PyExceptionClass_Check(err))) { 2425 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2); 2426 } 2427 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2)); 2428 } 2429 #endif 2430 2431 /* CheckBinaryVersion */ 2432 static int __Pyx_check_binary_version(void) { 2433 char ctversion[4], rtversion[4]; 2434 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); 2435 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); 2436 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { 2437 char message[200]; 2438 PyOS_snprintf(message, sizeof(message), 2439 "compiletime version %s of module '%.100s' " 2440 "does not match runtime version %s", 2441 ctversion, __Pyx_MODULE_NAME, rtversion); 2442 return PyErr_WarnEx(NULL, message, 1); 2443 } 2444 return 0; 2445 } 2446 2447 /* InitStrings */ 2448 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { 2449 while (t->p) { 2450 #if PY_MAJOR_VERSION < 3 2451 if (t->is_unicode) { 2452 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); 2453 } else if (t->intern) { 2454 *t->p = PyString_InternFromString(t->s); 2455 } else { 2456 *t->p = PyString_FromStringAndSize(t->s, t->n - 1); 2457 } 2458 #else 2459 if (t->is_unicode | t->is_str) { 2460 if (t->intern) { 2461 *t->p = PyUnicode_InternFromString(t->s); 2462 } else if (t->encoding) { 2463 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); 2464 } else { 2465 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); 2466 } 2467 } else { 2468 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); 2469 } 2470 #endif 2471 if (!*t->p) 2472 return -1; 2473 if (PyObject_Hash(*t->p) == -1) 2474 return -1; 2475 ++t; 2476 } 2477 return 0; 2478 } 2479 2480 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { 2481 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); 2482 } 2483 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { 2484 Py_ssize_t ignore; 2485 return __Pyx_PyObject_AsStringAndSize(o, &ignore); 2486 } 2487 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 2488 #if !CYTHON_PEP393_ENABLED 2489 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { 2490 char* defenc_c; 2491 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); 2492 if (!defenc) return NULL; 2493 defenc_c = PyBytes_AS_STRING(defenc); 2494 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 2495 { 2496 char* end = defenc_c + PyBytes_GET_SIZE(defenc); 2497 char* c; 2498 for (c = defenc_c; c < end; c++) { 2499 if ((unsigned char) (*c) >= 128) { 2500 PyUnicode_AsASCIIString(o); 2501 return NULL; 2502 } 2503 } 2504 } 2505 #endif 2506 *length = PyBytes_GET_SIZE(defenc); 2507 return defenc_c; 2508 } 2509 #else 2510 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { 2511 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; 2512 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 2513 if (likely(PyUnicode_IS_ASCII(o))) { 2514 *length = PyUnicode_GET_LENGTH(o); 2515 return PyUnicode_AsUTF8(o); 2516 } else { 2517 PyUnicode_AsASCIIString(o); 2518 return NULL; 2519 } 2520 #else 2521 return PyUnicode_AsUTF8AndSize(o, length); 2522 #endif 2523 } 2524 #endif 2525 #endif 2526 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { 2527 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 2528 if ( 2529 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 2530 __Pyx_sys_getdefaultencoding_not_ascii && 2531 #endif 2532 PyUnicode_Check(o)) { 2533 return __Pyx_PyUnicode_AsStringAndSize(o, length); 2534 } else 2535 #endif 2536 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) 2537 if (PyByteArray_Check(o)) { 2538 *length = PyByteArray_GET_SIZE(o); 2539 return PyByteArray_AS_STRING(o); 2540 } else 2541 #endif 2542 { 2543 char* result; 2544 int r = PyBytes_AsStringAndSize(o, &result, length); 2545 if (unlikely(r < 0)) { 2546 return NULL; 2547 } else { 2548 return result; 2549 } 2550 } 2551 } 2552 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { 2553 int is_true = x == Py_True; 2554 if (is_true | (x == Py_False) | (x == Py_None)) return is_true; 2555 else return PyObject_IsTrue(x); 2556 } 2557 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { 2558 int retval; 2559 if (unlikely(!x)) return -1; 2560 retval = __Pyx_PyObject_IsTrue(x); 2561 Py_DECREF(x); 2562 return retval; 2563 } 2564 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { 2565 #if PY_MAJOR_VERSION >= 3 2566 if (PyLong_Check(result)) { 2567 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, 2568 "__int__ returned non-int (type %.200s). " 2569 "The ability to return an instance of a strict subclass of int " 2570 "is deprecated, and may be removed in a future version of Python.", 2571 Py_TYPE(result)->tp_name)) { 2572 Py_DECREF(result); 2573 return NULL; 2574 } 2575 return result; 2576 } 2577 #endif 2578 PyErr_Format(PyExc_TypeError, 2579 "__%.4s__ returned non-%.4s (type %.200s)", 2580 type_name, type_name, Py_TYPE(result)->tp_name); 2581 Py_DECREF(result); 2582 return NULL; 2583 } 2584 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { 2585 #if CYTHON_USE_TYPE_SLOTS 2586 PyNumberMethods *m; 2587 #endif 2588 const char *name = NULL; 2589 PyObject *res = NULL; 2590 #if PY_MAJOR_VERSION < 3 2591 if (likely(PyInt_Check(x) || PyLong_Check(x))) 2592 #else 2593 if (likely(PyLong_Check(x))) 2594 #endif 2595 return __Pyx_NewRef(x); 2596 #if CYTHON_USE_TYPE_SLOTS 2597 m = Py_TYPE(x)->tp_as_number; 2598 #if PY_MAJOR_VERSION < 3 2599 if (m && m->nb_int) { 2600 name = "int"; 2601 res = m->nb_int(x); 2602 } 2603 else if (m && m->nb_long) { 2604 name = "long"; 2605 res = m->nb_long(x); 2606 } 2607 #else 2608 if (likely(m && m->nb_int)) { 2609 name = "int"; 2610 res = m->nb_int(x); 2611 } 2612 #endif 2613 #else 2614 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { 2615 res = PyNumber_Int(x); 2616 } 2617 #endif 2618 if (likely(res)) { 2619 #if PY_MAJOR_VERSION < 3 2620 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { 2621 #else 2622 if (unlikely(!PyLong_CheckExact(res))) { 2623 #endif 2624 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); 2625 } 2626 } 2627 else if (!PyErr_Occurred()) { 2628 PyErr_SetString(PyExc_TypeError, 2629 "an integer is required"); 2630 } 2631 return res; 2632 } 2633 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { 2634 Py_ssize_t ival; 2635 PyObject *x; 2636 #if PY_MAJOR_VERSION < 3 2637 if (likely(PyInt_CheckExact(b))) { 2638 if (sizeof(Py_ssize_t) >= sizeof(long)) 2639 return PyInt_AS_LONG(b); 2640 else 2641 return PyInt_AsSsize_t(b); 2642 } 2643 #endif 2644 if (likely(PyLong_CheckExact(b))) { 2645 #if CYTHON_USE_PYLONG_INTERNALS 2646 const digit* digits = ((PyLongObject*)b)->ob_digit; 2647 const Py_ssize_t size = Py_SIZE(b); 2648 if (likely(__Pyx_sst_abs(size) <= 1)) { 2649 ival = likely(size) ? digits[0] : 0; 2650 if (size == -1) ival = -ival; 2651 return ival; 2652 } else { 2653 switch (size) { 2654 case 2: 2655 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { 2656 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); 2657 } 2658 break; 2659 case -2: 2660 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { 2661 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); 2662 } 2663 break; 2664 case 3: 2665 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { 2666 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); 2667 } 2668 break; 2669 case -3: 2670 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { 2671 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); 2672 } 2673 break; 2674 case 4: 2675 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { 2676 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); 2677 } 2678 break; 2679 case -4: 2680 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { 2681 return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); 2682 } 2683 break; 2684 } 2685 } 2686 #endif 2687 return PyLong_AsSsize_t(b); 2688 } 2689 x = PyNumber_Index(b); 2690 if (!x) return -1; 2691 ival = PyInt_AsSsize_t(x); 2692 Py_DECREF(x); 2693 return ival; 2694 } 2695 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { 2696 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); 2697 } 2698 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { 2699 return PyInt_FromSize_t(ival); 2700 } 2701 2702 2703 #endif /* Py_PYTHON_H */