From 50ee3b65014978c21c665b72215a9dd90ac3c737 Mon Sep 17 00:00:00 2001 From: Eugene Scherba Date: Thu, 9 Oct 2025 14:16:20 -0700 Subject: [PATCH] compile --- .gitignore | 1 + pip-freeze.txt | 54 +- setup.py | 2 +- src/cityhash.cpp | 5813 ++++++++++++++++++++------------------- src/cityhash.pyx | 2 +- src/cityhashcrc.cpp | 5233 ++++++++++++++++++----------------- src/farmhash.cpp | 6388 ++++++++++++++++++++++--------------------- 7 files changed, 9068 insertions(+), 8425 deletions(-) diff --git a/.gitignore b/.gitignore index 2bb5e7b..bed09a6 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ tags # Exclude these directories bin/ data/ +share/ wheelhouse/ # Distribution / packaging diff --git a/pip-freeze.txt b/pip-freeze.txt index ba31c21..70bf97a 100644 --- a/pip-freeze.txt +++ b/pip-freeze.txt @@ -1,33 +1,29 @@ -attrs==21.4.0 +asttokens==3.0.0 backcall==0.2.0 --e git+ssh://git@github.com/escherba/python-cityhash.git@f2e1b3e636bec1f44a18329b6282d57323a65fca#egg=cityhash -Cython==0.29.28 -decorator==5.1.1 -importlib-metadata==4.8.3 -iniconfig==1.1.1 -ipdb==0.13.9 -ipython==7.16.3 -ipython-genutils==0.2.0 -jedi==0.17.2 -numpy==1.19.5 -packaging==21.3 -parso==0.7.1 -pexpect==4.8.0 +Cython==3.1.4 +decorator==5.2.1 +exceptiongroup==1.3.0 +executing==2.2.1 +iniconfig==2.1.0 +ipdb==0.13.13 +ipython==8.12.3 +jedi==0.19.2 +matplotlib-inline==0.1.7 +numpy==1.24.4 +packaging==25.0 +parso==0.8.5 +pexpect==4.9.0 pickleshare==0.7.5 pkg_resources==0.0.0 -pluggy==1.0.0 -prompt-toolkit==3.0.28 +pluggy==1.5.0 +prompt_toolkit==3.0.52 ptyprocess==0.7.0 -py==1.11.0 -py-cpuinfo==8.0.0 -Pygments==2.11.2 -pyparsing==3.0.7 -pytest==7.0.1 -six==1.16.0 -toml==0.10.2 -tomli==1.2.3 -traitlets==4.3.3 -typing_extensions==4.1.1 -wcwidth==0.2.5 -xxh==0.1.2 -zipp==3.6.0 +pure_eval==0.2.3 +py-cpuinfo==9.0.0 +Pygments==2.19.2 +pytest==8.3.5 +stack-data==0.6.3 +tomli==2.3.0 +traitlets==5.14.3 +typing_extensions==4.13.2 +wcwidth==0.2.14 diff --git a/setup.py b/setup.py index b8d48f1..614a127 100644 --- a/setup.py +++ b/setup.py @@ -127,7 +127,7 @@ def get_system_bits(): ) -VERSION = "0.4.9" +VERSION = "0.4.10" URL = "https://github.com/escherba/python-cityhash" diff --git a/src/cityhash.cpp b/src/cityhash.cpp index 3ff0852..3061826 100644 --- a/src/cityhash.cpp +++ b/src/cityhash.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 3.0.12 */ +/* Generated by Cython 3.1.4 */ /* BEGIN: Cython Metadata { @@ -30,49 +30,21 @@ END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ -#if defined(CYTHON_LIMITED_API) && 0 - #ifndef Py_LIMITED_API - #if CYTHON_LIMITED_API+0 > 0x03030000 - #define Py_LIMITED_API CYTHON_LIMITED_API - #else - #define Py_LIMITED_API 0x03030000 - #endif - #endif +/* InitLimitedAPI */ +#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API) + #define CYTHON_LIMITED_API 1 #endif #include "Python.h" - - #if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj) - #else - #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj, NULL) - #endif - - - #if PY_MAJOR_VERSION <= 2 - #define PyDict_GetItemWithError _PyDict_GetItemWithError - #endif - - - #if (PY_VERSION_HEX < 0x030700b1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600)) && !defined(PyContextVar_Get) - #define PyContextVar_Get(var, d, v) ((d) ? ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) : ((v)[0] = NULL, 0) ) - #endif - #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) - #error Cython requires Python 2.7+ or Python 3.3+. -#else -#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API -#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#elif PY_VERSION_HEX < 0x03080000 + #error Cython requires Python 3.8+. #else -#define __PYX_EXTRA_ABI_MODULE_NAME "" -#endif -#define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME -#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI -#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x03000CF0 +#define __PYX_ABI_VERSION "3_1_4" +#define CYTHON_HEX_VERSION 0x030104F0 #define CYTHON_FUTURE_DIVISION 1 +/* CModulePreamble */ #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -112,19 +84,13 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -135,8 +101,12 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -148,18 +118,22 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 + #define CYTHON_USE_EXC_INFO_STACK 1 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif @@ -170,20 +144,14 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 + #define CYTHON_USE_TYPE_SLOTS 1 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -194,8 +162,13 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -207,7 +180,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT @@ -217,14 +190,19 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00) + #endif + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100) #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 @@ -237,7 +215,7 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS @@ -246,8 +224,6 @@ END: Cython Metadata */ #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -260,8 +236,13 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -269,71 +250,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 1 - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif - #undef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 -#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 1 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #ifndef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #ifndef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 1 - #endif + #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS @@ -345,26 +262,37 @@ END: Cython Metadata */ #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 + #define CYTHON_USE_TP_FINALIZE 0 + #endif + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000) #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 - #endif - #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif + #undef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #ifndef CYTHON_USE_TYPE_SLOTS + #ifdef Py_GIL_DISABLED + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1 + #else + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 + #endif + #if PY_VERSION_HEX < 0x030A0000 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #elif !defined(CYTHON_USE_TYPE_SLOTS) #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS @@ -373,22 +301,19 @@ END: Cython Metadata */ #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif - #if PY_MAJOR_VERSION < 3 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif - #ifndef CYTHON_USE_PYLIST_INTERNALS + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLIST_INTERNALS) #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif - #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) @@ -397,20 +322,32 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 + #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS) + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif - #ifndef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #elif !defined(CYTHON_FAST_GIL) + #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #define CYTHON_METH_FASTCALL 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 @@ -418,51 +355,49 @@ END: Cython Metadata */ #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif - #if PY_VERSION_HEX < 0x030400a1 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #elif !defined(CYTHON_USE_TP_FINALIZE) + #ifndef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1) + #endif + #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif - #if PY_VERSION_HEX < 0x030600B1 + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 1 + #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE) #endif - #if PY_VERSION_HEX < 0x030700A3 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 1 + #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif #endif -#if !defined(CYTHON_FAST_PYCCALL) -#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#ifndef CYTHON_FAST_PYCCALL +#define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL #endif -#if !defined(CYTHON_VECTORCALL) +#ifndef CYTHON_VECTORCALL +#if CYTHON_COMPILING_IN_LIMITED_API +#define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) +#else #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif +#endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS - #if PY_MAJOR_VERSION < 3 - #include "longintrepr.h" - #endif #undef SHIFT #undef BASE #undef MASK @@ -470,6 +405,9 @@ END: Cython Metadata */ enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif +#ifndef CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME + #define CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME 100 +#endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif @@ -522,7 +460,7 @@ END: Cython Metadata */ #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON +# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED @@ -597,6 +535,9 @@ END: Cython Metadata */ #endif #endif #endif +#ifndef Py_UNREACHABLE + #define Py_UNREACHABLE() assert(0); abort() +#endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; @@ -611,6 +552,7 @@ END: Cython Metadata */ #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) +/* CppInitCode */ #ifndef __cplusplus #error "Cython files generated with the C++ option must be compiled with a C++ compiler." #endif @@ -641,109 +583,42 @@ class __Pyx_FakeReference { T *ptr; }; +/* PythonCompatibility */ #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_DefaultClassType PyClass_Type - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_DefaultClassType PyType_Type +#define __Pyx_BUILTIN_MODULE_NAME "builtins" +#define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API - static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyObject *exception_table = NULL; - PyObject *types_module=NULL, *code_type=NULL, *result=NULL; - #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; - PyObject *py_minor_version = NULL; - #endif - long minor_version = 0; - PyObject *type, *value, *traceback; - PyErr_Fetch(&type, &value, &traceback); - #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; - #else - if (!(version_info = PySys_GetObject("version_info"))) goto end; - if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; - minor_version = PyLong_AsLong(py_minor_version); - Py_DECREF(py_minor_version); - if (minor_version == -1 && PyErr_Occurred()) goto end; - #endif - if (!(types_module = PyImport_ImportModule("types"))) goto end; - if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; - if (minor_version <= 7) { - (void)p; - result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else if (minor_version <= 10) { - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else { - if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); - } - end: - Py_XDECREF(code_type); - Py_XDECREF(exception_table); - Py_XDECREF(types_module); - if (type) { - PyErr_Restore(type, value, traceback); - } - return result; - } #ifndef CO_OPTIMIZED - #define CO_OPTIMIZED 0x0001 + static int CO_OPTIMIZED; #endif #ifndef CO_NEWLOCALS - #define CO_NEWLOCALS 0x0002 + static int CO_NEWLOCALS; #endif #ifndef CO_VARARGS - #define CO_VARARGS 0x0004 + static int CO_VARARGS; #endif #ifndef CO_VARKEYWORDS - #define CO_VARKEYWORDS 0x0008 + static int CO_VARKEYWORDS; #endif #ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x0200 + static int CO_ASYNC_GENERATOR; #endif #ifndef CO_GENERATOR - #define CO_GENERATOR 0x0020 + static int CO_GENERATOR; #endif #ifndef CO_COROUTINE - #define CO_COROUTINE 0x0080 + static int CO_COROUTINE; #endif -#elif PY_VERSION_HEX >= 0x030B0000 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); - if (!empty_bytes) return NULL; - result = - #if PY_VERSION_HEX >= 0x030C0000 - PyUnstable_Code_NewWithPosOnlyArgs - #else - PyCode_NewWithPosOnlyArgs - #endif - (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); - Py_DECREF(empty_bytes); - return result; - } -#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 + #endif #endif +static int __Pyx_init_co_variables(void); #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else @@ -775,12 +650,6 @@ class __Pyx_FakeReference { #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif -#ifndef CO_COROUTINE - #define CO_COROUTINE 0x80 -#endif -#ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x200 -#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -802,7 +671,7 @@ class __Pyx_FakeReference { #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif -#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) +#ifndef METH_FASTCALL #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif @@ -840,7 +709,7 @@ class __Pyx_FakeReference { #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif -#if PY_MAJOR_VERSION >= 0x030900B1 +#if PY_VERSION_HEX >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) @@ -857,7 +726,7 @@ static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif -static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { +static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else @@ -865,7 +734,7 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) -#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 +#if __PYX_LIMITED_VERSION_HEX < 0x03090000 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else @@ -881,8 +750,10 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#elif CYTHON_COMPILING_IN_GRAAL + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno)) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) @@ -893,15 +764,11 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() -#elif PY_VERSION_HEX >= 0x03060000 - #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() -#elif PY_VERSION_HEX >= 0x03000000 - #define __Pyx_PyThreadState_Current PyThreadState_GET() #else - #define __Pyx_PyThreadState_Current _PyThreadState_Current + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #endif -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +#if CYTHON_USE_MODULE_STATE +static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); @@ -909,85 +776,43 @@ static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) Py_FatalError("Couldn't find the module state"); return result; } -#endif -#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o) #else - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) -#endif -#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) -#include "pythread.h" -#define Py_tss_NEEDS_INIT 0 -typedef int Py_tss_t; -static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { - *key = PyThread_create_key(); - return 0; -} -static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { - Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); - *key = Py_tss_NEEDS_INIT; - return key; -} -static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { - PyObject_Free(key); -} -static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { - return *key != Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { - PyThread_delete_key(*key); - *key = Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { - return PyThread_set_key_value(*key, value); -} -static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { - return PyThread_get_key_value(*key); -} -#endif -#if PY_MAJOR_VERSION < 3 - #if CYTHON_COMPILING_IN_PYPY - #if PYPY_VERSION_NUM < 0x07030600 - #if defined(__cplusplus) && __cplusplus >= 201402L - [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] - #elif defined(__GNUC__) || defined(__clang__) - __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) - #elif defined(_MSC_VER) - __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) - #endif - static CYTHON_INLINE int PyGILState_Check(void) { - return 0; - } - #else // PYPY_VERSION_NUM < 0x07030600 - #endif // PYPY_VERSION_NUM < 0x07030600 - #else - static CYTHON_INLINE int PyGILState_Check(void) { - PyThreadState * tstate = _PyThreadState_Current; - return tstate && (tstate == PyGILState_GetThisThreadState()); - } - #endif +#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global) #endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype) +#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype) +#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype) +#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype) +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype) + #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL) + #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\ + ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\ + (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\ + __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL) + #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype) + #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype) +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif -#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) +#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } -#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000 #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else @@ -1011,17 +836,11 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) - #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) - #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) -#else - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif +#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ @@ -1033,24 +852,20 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) -#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 +#else #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) @@ -1066,20 +881,6 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif -#else - #define CYTHON_PEP393_ENABLED 0 - #define PyUnicode_1BYTE_KIND 1 - #define PyUnicode_2BYTE_KIND 2 - #define PyUnicode_4BYTE_KIND 4 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) @@ -1093,8 +894,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif - #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) - #undef PyUnicode_Contains + #if !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) @@ -1104,33 +904,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif -#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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#ifndef PyObject_Unicode - #define PyObject_Unicode PyObject_Str -#endif -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) @@ -1147,28 +921,83 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif +#if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) + #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) + #else + #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i) + #endif +#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS + #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) + #else + #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) + #endif +#else + #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) +#endif +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 +#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) +#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyObject_GetItem(dict, key); + if (*result == NULL) { + if (PyErr_ExceptionMatches(PyExc_KeyError)) { + PyErr_Clear(); + return 0; + } + return -1; + } + return 1; +} +#else +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyDict_GetItemWithError(dict, key); + if (*result == NULL) { + return PyErr_Occurred() ? -1 : 0; + } + Py_INCREF(*result); + return 1; +} +#endif +#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST + #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj) +#else + #define __Pyx_VISIT_CONST(obj) +#endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i) +#endif +#if CYTHON_ASSUME_SAFE_SIZE #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o) #else - #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) - #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) - #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) - #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) #endif -#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { @@ -1177,64 +1006,108 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, return module; } #endif -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define __Pyx_Py3Int_Check(op) PyLong_Check(op) - #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#else - #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) - #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t +#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t +#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 + #define __Pyx_PySendResult PySendResult #else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t + typedef enum { + PYGEN_RETURN = 0, + PYGEN_ERROR = -1, + PYGEN_NEXT = 1, + } __Pyx_PySendResult; +#endif +#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3 + typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result); +#else + #define __Pyx_pyiter_sendfunc sendfunc #endif -#if CYTHON_USE_ASYNC_SLOTS - #if PY_VERSION_HEX >= 0x030500B1 - #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods - #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) - #else - #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) - #endif +#if !CYTHON_USE_AM_SEND +#define __PYX_HAS_PY_AM_SEND 0 +#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000 +#define __PYX_HAS_PY_AM_SEND 1 #else - #define __Pyx_PyType_AsAsync(obj) NULL +#define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation #endif -#ifndef __Pyx_PyAsyncMethodsStruct +#if __PYX_HAS_PY_AM_SEND < 2 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods +#else typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; + __Pyx_pyiter_sendfunc am_send; } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s)) +#endif +#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0 + #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21) +#else + #define __Pyx_TPFLAGS_HAVE_AM_SEND (0) +#endif +#if PY_VERSION_HEX >= 0x03090000 +#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get() +#else +#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp +#endif +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000 +#ifdef __cplusplus +extern "C" +#endif +PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize); +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) { + int value; + PyObject *py_value = PyObject_GetAttrString(inspect, name); + if (!py_value) return 0; + value = (int) PyLong_AsLong(py_value); + Py_DECREF(py_value); + *write_to = value; + return value != -1 || !PyErr_Occurred(); +} +static int __Pyx_init_co_variables(void) { + PyObject *inspect; + int result; + inspect = PyImport_ImportModule("inspect"); + result = +#if !defined(CO_OPTIMIZED) + __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) && +#endif +#if !defined(CO_NEWLOCALS) + __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) && +#endif +#if !defined(CO_VARARGS) + __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) && +#endif +#if !defined(CO_VARKEYWORDS) + __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) && +#endif +#if !defined(CO_ASYNC_GENERATOR) + __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) && +#endif +#if !defined(CO_GENERATOR) + __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) && +#endif +#if !defined(CO_COROUTINE) + __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) && +#endif + 1; + Py_DECREF(inspect); + return result ? 0 : -1; +} +#else +static int __Pyx_init_co_variables(void) { + return 0; // It's a limited API-only feature +} #endif +/* MathInitCode */ #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) - #if !defined(_USE_MATH_DEFINES) + #ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES #endif #endif @@ -1254,8 +1127,17 @@ static CYTHON_INLINE float __PYX_NAN() { #define __Pyx_truncl truncl #endif -#define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0 +#endif +#ifndef CYTHON_CLINE_IN_TRACEBACK +#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#endif +#if CYTHON_CLINE_IN_TRACEBACK +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; } +#else +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; } +#endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } @@ -1279,22 +1161,57 @@ static CYTHON_INLINE float __PYX_NAN() { #include "city.h" #include #include -#include -#include "pythread.h" -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + + #if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj) + #else + #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj, NULL) + #endif + +#include + + #if PY_MAJOR_VERSION <= 2 + #define PyDict_GetItemWithError _PyDict_GetItemWithError + #endif + + + #if PY_VERSION_HEX < 0x030d0000 + static CYTHON_INLINE int __Pyx_PyWeakref_GetRef(PyObject *ref, PyObject **pobj) + { + PyObject *obj = PyWeakref_GetObject(ref); + if (obj == NULL) { + // SystemError if ref is NULL + *pobj = NULL; + return -1; + } + if (obj == Py_None) { + *pobj = NULL; + return 0; + } + Py_INCREF(obj); + *pobj = obj; + return 1; + } + #else + #define __Pyx_PyWeakref_GetRef PyWeakref_GetRef + #endif + +#include "pythread.h" + + #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600) && !defined(PyContextVar_Get) + #define PyContextVar_Get(var, d, v) ((d) ? ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) : ((v)[0] = NULL, 0) ) + #endif + +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -1337,19 +1254,23 @@ static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s) +#else + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s) +#endif #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) @@ -1358,32 +1279,44 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef) + return Py_NewRef(obj); +#else + Py_INCREF(obj); + return obj; +#endif +} +static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef) + return Py_XNewRef(obj); +#else + Py_XINCREF(obj); + return obj; +#endif +} +static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b); static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x) #else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x) #endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x)) #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK @@ -1430,81 +1363,12 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -#include -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = (char) c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL) #else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#include -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #endif @@ -1516,29 +1380,196 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) { #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ +/* PretendToInitialize */ +#ifdef __cplusplus +#if __cplusplus > 201103L +#include +#endif +template +static void __Pyx_pretend_to_initialize(T* ptr) { +#if __cplusplus > 201103L + if ((std::is_trivially_default_constructible::value)) +#endif + *ptr = T(); + (void)ptr; +} +#else static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } +#endif + #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; -static const char * __pyx_cfilenm = __FILE__; +static const char * const __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ -static const char *__pyx_f[] = { +static const char* const __pyx_f[] = { "src/cityhash.pyx", - "contextvars.pxd", - "type.pxd", - "bool.pxd", - "complex.pxd", + "cpython/contextvars.pxd", + "cpython/type.pxd", + "cpython/bool.pxd", + "cpython/complex.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ -/* ForceInitThreads.proto */ -#ifndef __PYX_FORCE_INIT_THREADS - #define __PYX_FORCE_INIT_THREADS 0 +/* Atomics.proto */ +#include +#ifndef CYTHON_ATOMICS + #define CYTHON_ATOMICS 1 +#endif +#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS +#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __pyx_atomic_int_type int +#define __pyx_nonatomic_int_type int +#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ + (__STDC_VERSION__ >= 201112L) &&\ + !defined(__STDC_NO_ATOMICS__)) + #include +#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ + (__cplusplus >= 201103L) ||\ + (defined(_MSC_VER) && _MSC_VER >= 1700))) + #include +#endif +#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ + (__STDC_VERSION__ >= 201112L) &&\ + !defined(__STDC_NO_ATOMICS__) &&\ + ATOMIC_INT_LOCK_FREE == 2) + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type atomic_int + #define __pyx_atomic_ptr_type atomic_uintptr_t + #define __pyx_nonatomic_ptr_type uintptr_t + #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed) + #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel) + #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel) + #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg) + #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired) + #define __pyx_atomic_load(value) atomic_load(value) + #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value) + #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed) + #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire) + #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) + #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) + #pragma message ("Using standard C atomics") + #elif defined(__PYX_DEBUG_ATOMICS) + #warning "Using standard C atomics" + #endif +#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ + (__cplusplus >= 201103L) ||\ +\ + (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\ + ATOMIC_INT_LOCK_FREE == 2) + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type std::atomic_int + #define __pyx_atomic_ptr_type std::atomic_uintptr_t + #define __pyx_nonatomic_ptr_type uintptr_t + #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed) + #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel) + #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel) + #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg) + #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired) + #define __pyx_atomic_load(value) std::atomic_load(value) + #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value) + #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed) + #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire) + #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) + #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) + #pragma message ("Using standard C++ atomics") + #elif defined(__PYX_DEBUG_ATOMICS) + #warning "Using standard C++ atomics" + #endif +#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\ + (__GNUC_MINOR__ > 1 ||\ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2)))) + #define __pyx_atomic_ptr_type void* + #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1) + #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1) + #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1) + #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg) + static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { + __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired); + int result = old == *expected; + *expected = old; + return result; + } + #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0) + #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value) + #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0) + #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0) + #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using GNU atomics" + #endif +#elif CYTHON_ATOMICS && defined(_MSC_VER) + #include + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type long + #define __pyx_atomic_ptr_type void* + #undef __pyx_nonatomic_int_type + #define __pyx_nonatomic_int_type long + #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer) + #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1) + #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1) + #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1) + #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg) + static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { + __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected); + int result = old == *expected; + *expected = old; + return result; + } + #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0) + #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value) + #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value + #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0) + #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value) + #ifdef __PYX_DEBUG_ATOMICS + #pragma message ("Using MSVC atomics") + #endif +#else + #undef CYTHON_ATOMICS + #define CYTHON_ATOMICS 0 + #ifdef __PYX_DEBUG_ATOMICS + #warning "Not using atomics" + #endif +#endif +#if CYTHON_ATOMICS + #define __pyx_add_acquisition_count(memview)\ + __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview)) + #define __pyx_sub_acquisition_count(memview)\ + __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview)) +#else + #define __pyx_add_acquisition_count(memview)\ + __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) + #define __pyx_sub_acquisition_count(memview)\ + __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) +#endif + +/* CriticalSections.proto */ +#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __Pyx_PyCriticalSection void* +#define __Pyx_PyCriticalSection2 void* +#define __Pyx_PyCriticalSection_Begin1(cs, arg) (void)cs +#define __Pyx_PyCriticalSection_Begin2(cs, arg1, arg2) (void)cs +#define __Pyx_PyCriticalSection_End1(cs) +#define __Pyx_PyCriticalSection_End2(cs) +#else +#define __Pyx_PyCriticalSection PyCriticalSection +#define __Pyx_PyCriticalSection2 PyCriticalSection2 +#define __Pyx_PyCriticalSection_Begin1 PyCriticalSection_Begin +#define __Pyx_PyCriticalSection_Begin2 PyCriticalSection2_Begin +#define __Pyx_PyCriticalSection_End1 PyCriticalSection_End +#define __Pyx_PyCriticalSection_End2 PyCriticalSection2_End +#endif +#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_BEGIN_CRITICAL_SECTION(o) { +#define __Pyx_END_CRITICAL_SECTION() } +#else +#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION +#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION #endif /* #### Code section: numeric_typedefs ### */ @@ -1549,25 +1580,25 @@ static const char *__pyx_f[] = { struct __pyx_opt_args_7cpython_11contextvars_get_value; struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default; -/* "cpython/contextvars.pxd":112 - * +/* "cpython/contextvars.pxd":116 * + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the default value of the context variable, - */ +*/ struct __pyx_opt_args_7cpython_11contextvars_get_value { int __pyx_n; PyObject *default_value; }; -/* "cpython/contextvars.pxd":129 - * +/* "cpython/contextvars.pxd":134 * + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the provided default value if no such value was found. - */ +*/ struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default { int __pyx_n; PyObject *default_value; @@ -1591,7 +1622,6 @@ struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default { static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ @@ -1605,11 +1635,6 @@ struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default { __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) - #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() -#endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ @@ -1726,7 +1751,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObj #include /* JoinPyUnicode.proto */ -static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, +static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char); /* PyFunctionFastCall.proto */ @@ -1734,7 +1759,7 @@ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_co #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) @@ -1744,12 +1769,6 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" -#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else @@ -1778,14 +1797,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); - -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +#endif +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif @@ -1797,50 +1815,37 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i) #elif CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) -#else - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) -#endif -#if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) - #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i)) #else - #define __Pyx_Arg_NewRef_VARARGS(arg) arg - #define __Pyx_Arg_XDECREF_VARARGS(arg) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i)) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL - #define __Pyx_Arg_FASTCALL(args, i) args[i] - #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i]) + #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif - #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs - to have the same reference counting */ - #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else - #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS + #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS - #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) - #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS -#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) -#else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) +#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start) +#else #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif @@ -1848,10 +1853,65 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, - const char* function_name); +static CYTHON_INLINE int __Pyx_ParseKeywords( + PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[], + PyObject *kwds2, PyObject *values[], + Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); + +/* CallCFunction.proto */ +#define __Pyx_CallCFunction(cfunc, self, args)\ + ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args) +#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\ + ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs) +#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\ + ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs) +#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\ + ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames) + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS + __pyx_atomic_int_type initialized; +#endif + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) { +#if !CYTHON_ATOMICS + return 1; +#else + __pyx_nonatomic_int_type expected = 0; + if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) { + return 0; + } + return expected; +#endif +} +static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) { +#if CYTHON_ATOMICS + __pyx_atomic_store(&cfunc->initialized, 2); +#endif +} +#else +#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2 +#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc) +#endif + +/* CallUnboundCMethod2.proto */ +CYTHON_UNUSED +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); +#else +#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) +#endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, @@ -1870,24 +1930,27 @@ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_12 -#define __PYX_HAVE_RT_ImportType_proto_3_0_12 +#ifndef __PYX_HAVE_RT_ImportType_proto_3_1_4 +#define __PYX_HAVE_RT_ImportType_proto_3_1_4 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) alignof(s) +#define __PYX_GET_STRUCT_ALIGNMENT_3_1_4(s) alignof(s) #else -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) sizeof(void*) +#define __PYX_GET_STRUCT_ALIGNMENT_3_1_4(s) sizeof(void*) #endif -enum __Pyx_ImportType_CheckSize_3_0_12 { - __Pyx_ImportType_CheckSize_Error_3_0_12 = 0, - __Pyx_ImportType_CheckSize_Warn_3_0_12 = 1, - __Pyx_ImportType_CheckSize_Ignore_3_0_12 = 2 +enum __Pyx_ImportType_CheckSize_3_1_4 { + __Pyx_ImportType_CheckSize_Error_3_1_4 = 0, + __Pyx_ImportType_CheckSize_Warn_3_1_4 = 1, + __Pyx_ImportType_CheckSize_Ignore_3_1_4 = 2 }; -static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size); +static PyTypeObject *__Pyx_ImportType_3_1_4(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_4 check_size); #endif +/* ListPack.proto */ +static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...); + /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) @@ -1915,28 +1978,33 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN #endif /* CLineInTraceback.proto */ -#ifdef CYTHON_CLINE_IN_TRACEBACK -#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) -#else +#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#else +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #endif /* CodeObjectCache.proto */ -#if !CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject __Pyx_CachedCodeObjectType; +#else +typedef PyCodeObject __Pyx_CachedCodeObjectType; +#endif typedef struct { - PyCodeObject* code_object; + __Pyx_CachedCodeObjectType* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_int_type accessor_count; + #endif }; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); -#endif +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -1947,39 +2015,58 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #define __Pyx_HAS_GCC_DIAGNOSTIC #endif -/* None.proto */ -#include - /* CIntFromPy.proto */ -static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *); +static CYTHON_INLINE uint64_t __Pyx_PyLong_As_uint64_t(PyObject *); + +/* PyObjectVectorCallKwBuilder.proto */ +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#if CYTHON_VECTORCALL +#if PY_VERSION_HEX >= 0x03090000 +#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall +#endif +#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n) +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict +#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n) +#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value) +#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value) +#endif /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint32_t(uint32_t value); /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value); +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint64_t(uint64_t value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" -static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 +#define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName #else +static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp); +#endif +#else // !LIMITED_API typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" -#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value); /* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON @@ -1993,21 +2080,77 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) -#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) { + return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2); +} #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) +#ifdef PyExceptionInstance_Check + #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj) +#else + #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException) +#endif -/* CheckBinaryVersion.proto */ +/* GetRuntimeVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); + +/* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); +/* MultiPhaseInitModuleState.proto */ +#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE +static PyObject *__Pyx_State_FindModule(void*); +static int __Pyx_State_AddModule(PyObject* module, void*); +static int __Pyx_State_RemoveModule(void*); +#elif CYTHON_USE_MODULE_STATE +#define __Pyx_State_FindModule PyState_FindModule +#define __Pyx_State_AddModule PyState_AddModule +#define __Pyx_State_RemoveModule PyState_RemoveModule +#endif /* #### Code section: module_declarations ### */ +/* CythonABIVersion.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API + #if CYTHON_METH_FASTCALL + #define __PYX_FASTCALL_ABI_SUFFIX "_fastcall" + #else + #define __PYX_FASTCALL_ABI_SUFFIX + #endif + #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX +#else + #define __PYX_LIMITED_ABI_SUFFIX +#endif +#if __PYX_HAS_PY_AM_SEND == 1 + #define __PYX_AM_SEND_ABI_SUFFIX +#elif __PYX_HAS_PY_AM_SEND == 2 + #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport" +#else + #define __PYX_AM_SEND_ABI_SUFFIX "noamsend" +#endif +#ifndef __PYX_MONITORING_ABI_SUFFIX + #define __PYX_MONITORING_ABI_SUFFIX +#endif +#if CYTHON_USE_TP_FINALIZE + #define __PYX_TP_FINALIZE_ABI_SUFFIX +#else + #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize" +#endif +#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED) + #define __PYX_FREELISTS_ABI_SUFFIX +#else + #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists" +#endif +#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." + +#if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/ +#endif +#if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/ +#endif /* Module declarations from "cpython.version" */ @@ -2041,8 +2184,6 @@ static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComp /* Module declarations from "cpython.number" */ -/* Module declarations from "cpython.int" */ - /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.bool" */ @@ -2051,12 +2192,12 @@ static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComp /* Module declarations from "cpython.float" */ +/* Module declarations from "cython" */ + /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.complex" */ -/* Module declarations from "cpython.string" */ - /* Module declarations from "libc.stddef" */ /* Module declarations from "cpython.unicode" */ @@ -2079,10 +2220,6 @@ static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComp /* Module declarations from "cpython.pystate" */ -/* Module declarations from "cpython.cobject" */ - -/* Module declarations from "cpython.oldbuffer" */ - /* Module declarations from "cpython.set" */ /* Module declarations from "cpython.buffer" */ @@ -2107,38 +2244,34 @@ int __pyx_module_is_main_cityhash = 0; /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_TypeError; /* #### Code section: string_decls ### */ -static const char __pyx_k__13[] = "?"; +static const char __pyx_k_[] = "?"; static const char __pyx_k_all[] = "__all__"; -static const char __pyx_k_buf[] = "buf"; static const char __pyx_k_got[] = ", got '"; +static const char __pyx_k_pop[] = "pop"; static const char __pyx_k_data[] = "data"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_seed[] = "seed"; static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_0_4_9[] = "0.4.9"; static const char __pyx_k_email[] = "__email__"; -static const char __pyx_k_first[] = "first"; static const char __pyx_k_seed0[] = "seed0"; static const char __pyx_k_seed1[] = "seed1"; -static const char __pyx_k_tseed[] = "tseed"; +static const char __pyx_k_0_4_10[] = "0.4.10"; static const char __pyx_k_author[] = "__author__"; static const char __pyx_k_buffer[] = "buffer"; -static const char __pyx_k_result[] = "result"; -static const char __pyx_k_second[] = "second"; +static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_instead[] = "' instead"; static const char __pyx_k_version[] = "__version__"; static const char __pyx_k_Argument[] = "Argument '"; +static const char __pyx_k_add_note[] = "add_note"; static const char __pyx_k_cityhash[] = "cityhash"; -static const char __pyx_k_encoding[] = "encoding"; +static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_CityHash32[] = "CityHash32"; static const char __pyx_k_CityHash64[] = "CityHash64"; static const char __pyx_k_basestring[] = "basestring"; static const char __pyx_k_CityHash128[] = "CityHash128"; -static const char __pyx_k_encoding_size[] = "encoding_size"; static const char __pyx_k_Eugene_Scherba[] = "Eugene Scherba"; -static const char __pyx_k_src_cityhash_pyx[] = "src/cityhash.pyx"; static const char __pyx_k_CityHash64WithSeed[] = "CityHash64WithSeed"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_CityHash128WithSeed[] = "CityHash128WithSeed"; @@ -2146,6 +2279,7 @@ static const char __pyx_k_CityHash64WithSeeds[] = "CityHash64WithSeeds"; static const char __pyx_k_Python_wrapper_for_CityHash[] = "\nPython wrapper for CityHash\n"; static const char __pyx_k_escherba_cityhash_gmail_com[] = "escherba+cityhash@gmail.com"; static const char __pyx_k_has_incorrect_type_expected[] = "' has incorrect type: expected "; +static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False."; /* #### Code section: decls ### */ static PyObject *__pyx_pf_8cityhash_CityHash32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_8cityhash_2CityHash64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */ @@ -2155,6 +2289,17 @@ static PyObject *__pyx_pf_8cityhash_8CityHash128(CYTHON_UNUSED PyObject *__pyx_s static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_seed); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ +/* SmallCodeConfig */ +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; @@ -2180,603 +2325,227 @@ typedef struct { #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif PyTypeObject *__pyx_ptype_7cpython_4type_type; - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE + PyTypeObject *__pyx_ptype_7cpython_4bool_bool; + PyTypeObject *__pyx_ptype_7cpython_7complex_complex; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; + PyObject *__pyx_string_tab[35]; + PyObject *__pyx_int_0L; + PyObject *__pyx_int_64L; + PyObject *__pyx_int_0xffffffffffffffffL; +/* #### Code section: module_state_contents ### */ +/* CodeObjectCache.module_state_decls */ +struct __Pyx_CodeObjectCache __pyx_code_cache; + +/* #### Code section: module_state_end ### */ +} __pyx_mstatetype; + +#if CYTHON_USE_MODULE_STATE +#ifdef __cplusplus +namespace { +extern struct PyModuleDef __pyx_moduledef; +} /* anonymous namespace */ +#else +static struct PyModuleDef __pyx_moduledef; +#endif + +#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef))) + +#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef)) +#else +static __pyx_mstatetype __pyx_mstate_global_static = +#ifdef __cplusplus + {}; +#else + {0}; +#endif +static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: constant_name_defines ### */ +#define __pyx_kp_u_ __pyx_string_tab[0] +#define __pyx_kp_u_0_4_10 __pyx_string_tab[1] +#define __pyx_kp_u_Argument __pyx_string_tab[2] +#define __pyx_n_u_CityHash128 __pyx_string_tab[3] +#define __pyx_n_u_CityHash128WithSeed __pyx_string_tab[4] +#define __pyx_n_u_CityHash32 __pyx_string_tab[5] +#define __pyx_n_u_CityHash64 __pyx_string_tab[6] +#define __pyx_n_u_CityHash64WithSeed __pyx_string_tab[7] +#define __pyx_n_u_CityHash64WithSeeds __pyx_string_tab[8] +#define __pyx_kp_u_Eugene_Scherba __pyx_string_tab[9] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[10] +#define __pyx_n_u_TypeError __pyx_string_tab[11] +#define __pyx_kp_u_add_note __pyx_string_tab[12] +#define __pyx_n_u_all __pyx_string_tab[13] +#define __pyx_n_u_author __pyx_string_tab[14] +#define __pyx_n_u_basestring __pyx_string_tab[15] +#define __pyx_n_u_buffer __pyx_string_tab[16] +#define __pyx_n_u_cityhash __pyx_string_tab[17] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[18] +#define __pyx_n_u_data __pyx_string_tab[19] +#define __pyx_n_u_email __pyx_string_tab[20] +#define __pyx_kp_u_escherba_cityhash_gmail_com __pyx_string_tab[21] +#define __pyx_kp_u_got __pyx_string_tab[22] +#define __pyx_kp_u_has_incorrect_type_expected __pyx_string_tab[23] +#define __pyx_kp_u_instead __pyx_string_tab[24] +#define __pyx_n_u_main __pyx_string_tab[25] +#define __pyx_n_u_module __pyx_string_tab[26] +#define __pyx_n_u_name __pyx_string_tab[27] +#define __pyx_n_u_pop __pyx_string_tab[28] +#define __pyx_n_u_qualname __pyx_string_tab[29] +#define __pyx_n_u_seed __pyx_string_tab[30] +#define __pyx_n_u_seed0 __pyx_string_tab[31] +#define __pyx_n_u_seed1 __pyx_string_tab[32] +#define __pyx_n_u_test __pyx_string_tab[33] +#define __pyx_n_u_version __pyx_string_tab[34] +/* #### Code section: module_state_clear ### */ +#if CYTHON_USE_MODULE_STATE +static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { + __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m); + if (!clear_module_state) return 0; + Py_CLEAR(clear_module_state->__pyx_d); + Py_CLEAR(clear_module_state->__pyx_b); + Py_CLEAR(clear_module_state->__pyx_cython_runtime); + Py_CLEAR(clear_module_state->__pyx_empty_tuple); + Py_CLEAR(clear_module_state->__pyx_empty_bytes); + Py_CLEAR(clear_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif - #if CYTHON_USE_MODULE_STATE + #ifdef __Pyx_FusedFunction_USED + Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif - #if CYTHON_USE_MODULE_STATE + #if CYTHON_PEP489_MULTI_PHASE_INIT + __Pyx_State_RemoveModule(NULL); #endif - #if CYTHON_USE_MODULE_STATE + Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); + Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool); + Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex); + for (int i=0; i<35; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + Py_CLEAR(clear_module_state->__pyx_int_0L); + Py_CLEAR(clear_module_state->__pyx_int_64L); + Py_CLEAR(clear_module_state->__pyx_int_0xffffffffffffffffL); + return 0; +} +#endif +/* #### Code section: module_state_traverse ### */ +#if CYTHON_USE_MODULE_STATE +static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m); + if (!traverse_module_state) return 0; + Py_VISIT(traverse_module_state->__pyx_d); + Py_VISIT(traverse_module_state->__pyx_b); + Py_VISIT(traverse_module_state->__pyx_cython_runtime); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - PyTypeObject *__pyx_ptype_7cpython_4bool_bool; - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - PyTypeObject *__pyx_ptype_7cpython_7complex_complex; - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - PyObject *__pyx_kp_u_0_4_9; - PyObject *__pyx_kp_u_Argument; - PyObject *__pyx_n_s_CityHash128; - PyObject *__pyx_n_u_CityHash128; - PyObject *__pyx_n_s_CityHash128WithSeed; - PyObject *__pyx_n_u_CityHash128WithSeed; - PyObject *__pyx_n_s_CityHash32; - PyObject *__pyx_n_u_CityHash32; - PyObject *__pyx_n_s_CityHash64; - PyObject *__pyx_n_u_CityHash64; - PyObject *__pyx_n_s_CityHash64WithSeed; - PyObject *__pyx_n_u_CityHash64WithSeed; - PyObject *__pyx_n_s_CityHash64WithSeeds; - PyObject *__pyx_n_u_CityHash64WithSeeds; - PyObject *__pyx_kp_u_Eugene_Scherba; - PyObject *__pyx_n_s_TypeError; - PyObject *__pyx_n_s__13; - PyObject *__pyx_n_s_all; - PyObject *__pyx_n_s_author; - PyObject *__pyx_n_u_basestring; - PyObject *__pyx_n_s_buf; - PyObject *__pyx_n_u_buffer; - PyObject *__pyx_n_s_cityhash; - PyObject *__pyx_n_s_cline_in_traceback; - PyObject *__pyx_n_s_data; - PyObject *__pyx_n_u_data; - PyObject *__pyx_n_s_email; - PyObject *__pyx_n_s_encoding; - PyObject *__pyx_n_s_encoding_size; - PyObject *__pyx_kp_u_escherba_cityhash_gmail_com; - PyObject *__pyx_n_s_first; - PyObject *__pyx_kp_u_got; - PyObject *__pyx_kp_u_has_incorrect_type_expected; - PyObject *__pyx_kp_u_instead; - PyObject *__pyx_n_s_main; - PyObject *__pyx_n_s_name; - PyObject *__pyx_n_s_result; - PyObject *__pyx_n_s_second; - PyObject *__pyx_n_s_seed; - PyObject *__pyx_n_s_seed0; - PyObject *__pyx_n_s_seed1; - PyObject *__pyx_kp_s_src_cityhash_pyx; - PyObject *__pyx_n_s_test; - PyObject *__pyx_n_s_tseed; - PyObject *__pyx_n_s_version; - PyObject *__pyx_int_0L; - PyObject *__pyx_int_64L; - PyObject *__pyx_int_0xffffffffffffffffL; - PyObject *__pyx_k_; - PyObject *__pyx_tuple__2; - PyObject *__pyx_tuple__5; - PyObject *__pyx_tuple__7; - PyObject *__pyx_tuple__9; - PyObject *__pyx_tuple__11; - PyObject *__pyx_codeobj__3; - PyObject *__pyx_codeobj__4; - PyObject *__pyx_codeobj__6; - PyObject *__pyx_codeobj__8; - PyObject *__pyx_codeobj__10; - PyObject *__pyx_codeobj__12; -} __pyx_mstate; - -#if CYTHON_USE_MODULE_STATE -#ifdef __cplusplus -namespace { - extern struct PyModuleDef __pyx_moduledef; -} /* anonymous namespace */ -#else -static struct PyModuleDef __pyx_moduledef; -#endif - -#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) - -#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) - -#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) -#else -static __pyx_mstate __pyx_mstate_global_static = -#ifdef __cplusplus - {}; -#else - {0}; -#endif -static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; -#endif -/* #### Code section: module_state_clear ### */ -#if CYTHON_USE_MODULE_STATE -static int __pyx_m_clear(PyObject *m) { - __pyx_mstate *clear_module_state = __pyx_mstate(m); - if (!clear_module_state) return 0; - Py_CLEAR(clear_module_state->__pyx_d); - Py_CLEAR(clear_module_state->__pyx_b); - Py_CLEAR(clear_module_state->__pyx_cython_runtime); - Py_CLEAR(clear_module_state->__pyx_empty_tuple); - Py_CLEAR(clear_module_state->__pyx_empty_bytes); - Py_CLEAR(clear_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_CLEAR(clear_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); - #endif - Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); - Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool); - Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex); - Py_CLEAR(clear_module_state->__pyx_kp_u_0_4_9); - Py_CLEAR(clear_module_state->__pyx_kp_u_Argument); - Py_CLEAR(clear_module_state->__pyx_n_s_CityHash128); - Py_CLEAR(clear_module_state->__pyx_n_u_CityHash128); - Py_CLEAR(clear_module_state->__pyx_n_s_CityHash128WithSeed); - Py_CLEAR(clear_module_state->__pyx_n_u_CityHash128WithSeed); - Py_CLEAR(clear_module_state->__pyx_n_s_CityHash32); - Py_CLEAR(clear_module_state->__pyx_n_u_CityHash32); - Py_CLEAR(clear_module_state->__pyx_n_s_CityHash64); - Py_CLEAR(clear_module_state->__pyx_n_u_CityHash64); - Py_CLEAR(clear_module_state->__pyx_n_s_CityHash64WithSeed); - Py_CLEAR(clear_module_state->__pyx_n_u_CityHash64WithSeed); - Py_CLEAR(clear_module_state->__pyx_n_s_CityHash64WithSeeds); - Py_CLEAR(clear_module_state->__pyx_n_u_CityHash64WithSeeds); - Py_CLEAR(clear_module_state->__pyx_kp_u_Eugene_Scherba); - Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); - Py_CLEAR(clear_module_state->__pyx_n_s__13); - Py_CLEAR(clear_module_state->__pyx_n_s_all); - Py_CLEAR(clear_module_state->__pyx_n_s_author); - Py_CLEAR(clear_module_state->__pyx_n_u_basestring); - Py_CLEAR(clear_module_state->__pyx_n_s_buf); - Py_CLEAR(clear_module_state->__pyx_n_u_buffer); - Py_CLEAR(clear_module_state->__pyx_n_s_cityhash); - Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); - Py_CLEAR(clear_module_state->__pyx_n_s_data); - Py_CLEAR(clear_module_state->__pyx_n_u_data); - Py_CLEAR(clear_module_state->__pyx_n_s_email); - Py_CLEAR(clear_module_state->__pyx_n_s_encoding); - Py_CLEAR(clear_module_state->__pyx_n_s_encoding_size); - Py_CLEAR(clear_module_state->__pyx_kp_u_escherba_cityhash_gmail_com); - Py_CLEAR(clear_module_state->__pyx_n_s_first); - Py_CLEAR(clear_module_state->__pyx_kp_u_got); - Py_CLEAR(clear_module_state->__pyx_kp_u_has_incorrect_type_expected); - Py_CLEAR(clear_module_state->__pyx_kp_u_instead); - Py_CLEAR(clear_module_state->__pyx_n_s_main); - Py_CLEAR(clear_module_state->__pyx_n_s_name); - Py_CLEAR(clear_module_state->__pyx_n_s_result); - Py_CLEAR(clear_module_state->__pyx_n_s_second); - Py_CLEAR(clear_module_state->__pyx_n_s_seed); - Py_CLEAR(clear_module_state->__pyx_n_s_seed0); - Py_CLEAR(clear_module_state->__pyx_n_s_seed1); - Py_CLEAR(clear_module_state->__pyx_kp_s_src_cityhash_pyx); - Py_CLEAR(clear_module_state->__pyx_n_s_test); - Py_CLEAR(clear_module_state->__pyx_n_s_tseed); - Py_CLEAR(clear_module_state->__pyx_n_s_version); - Py_CLEAR(clear_module_state->__pyx_int_0L); - Py_CLEAR(clear_module_state->__pyx_int_64L); - Py_CLEAR(clear_module_state->__pyx_int_0xffffffffffffffffL); - Py_CLEAR(clear_module_state->__pyx_k_); - Py_CLEAR(clear_module_state->__pyx_tuple__2); - Py_CLEAR(clear_module_state->__pyx_tuple__5); - Py_CLEAR(clear_module_state->__pyx_tuple__7); - Py_CLEAR(clear_module_state->__pyx_tuple__9); - Py_CLEAR(clear_module_state->__pyx_tuple__11); - Py_CLEAR(clear_module_state->__pyx_codeobj__3); - Py_CLEAR(clear_module_state->__pyx_codeobj__4); - Py_CLEAR(clear_module_state->__pyx_codeobj__6); - Py_CLEAR(clear_module_state->__pyx_codeobj__8); - Py_CLEAR(clear_module_state->__pyx_codeobj__10); - Py_CLEAR(clear_module_state->__pyx_codeobj__12); - return 0; -} -#endif -/* #### Code section: module_state_traverse ### */ -#if CYTHON_USE_MODULE_STATE -static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { - __pyx_mstate *traverse_module_state = __pyx_mstate(m); - if (!traverse_module_state) return 0; - Py_VISIT(traverse_module_state->__pyx_d); - Py_VISIT(traverse_module_state->__pyx_b); - Py_VISIT(traverse_module_state->__pyx_cython_runtime); - Py_VISIT(traverse_module_state->__pyx_empty_tuple); - Py_VISIT(traverse_module_state->__pyx_empty_bytes); - Py_VISIT(traverse_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_VISIT(traverse_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); + #ifdef __Pyx_FusedFunction_USED + Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool); Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex); - Py_VISIT(traverse_module_state->__pyx_kp_u_0_4_9); - Py_VISIT(traverse_module_state->__pyx_kp_u_Argument); - Py_VISIT(traverse_module_state->__pyx_n_s_CityHash128); - Py_VISIT(traverse_module_state->__pyx_n_u_CityHash128); - Py_VISIT(traverse_module_state->__pyx_n_s_CityHash128WithSeed); - Py_VISIT(traverse_module_state->__pyx_n_u_CityHash128WithSeed); - Py_VISIT(traverse_module_state->__pyx_n_s_CityHash32); - Py_VISIT(traverse_module_state->__pyx_n_u_CityHash32); - Py_VISIT(traverse_module_state->__pyx_n_s_CityHash64); - Py_VISIT(traverse_module_state->__pyx_n_u_CityHash64); - Py_VISIT(traverse_module_state->__pyx_n_s_CityHash64WithSeed); - Py_VISIT(traverse_module_state->__pyx_n_u_CityHash64WithSeed); - Py_VISIT(traverse_module_state->__pyx_n_s_CityHash64WithSeeds); - Py_VISIT(traverse_module_state->__pyx_n_u_CityHash64WithSeeds); - Py_VISIT(traverse_module_state->__pyx_kp_u_Eugene_Scherba); - Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); - Py_VISIT(traverse_module_state->__pyx_n_s__13); - Py_VISIT(traverse_module_state->__pyx_n_s_all); - Py_VISIT(traverse_module_state->__pyx_n_s_author); - Py_VISIT(traverse_module_state->__pyx_n_u_basestring); - Py_VISIT(traverse_module_state->__pyx_n_s_buf); - Py_VISIT(traverse_module_state->__pyx_n_u_buffer); - Py_VISIT(traverse_module_state->__pyx_n_s_cityhash); - Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); - Py_VISIT(traverse_module_state->__pyx_n_s_data); - Py_VISIT(traverse_module_state->__pyx_n_u_data); - Py_VISIT(traverse_module_state->__pyx_n_s_email); - Py_VISIT(traverse_module_state->__pyx_n_s_encoding); - Py_VISIT(traverse_module_state->__pyx_n_s_encoding_size); - Py_VISIT(traverse_module_state->__pyx_kp_u_escherba_cityhash_gmail_com); - Py_VISIT(traverse_module_state->__pyx_n_s_first); - Py_VISIT(traverse_module_state->__pyx_kp_u_got); - Py_VISIT(traverse_module_state->__pyx_kp_u_has_incorrect_type_expected); - Py_VISIT(traverse_module_state->__pyx_kp_u_instead); - Py_VISIT(traverse_module_state->__pyx_n_s_main); - Py_VISIT(traverse_module_state->__pyx_n_s_name); - Py_VISIT(traverse_module_state->__pyx_n_s_result); - Py_VISIT(traverse_module_state->__pyx_n_s_second); - Py_VISIT(traverse_module_state->__pyx_n_s_seed); - Py_VISIT(traverse_module_state->__pyx_n_s_seed0); - Py_VISIT(traverse_module_state->__pyx_n_s_seed1); - Py_VISIT(traverse_module_state->__pyx_kp_s_src_cityhash_pyx); - Py_VISIT(traverse_module_state->__pyx_n_s_test); - Py_VISIT(traverse_module_state->__pyx_n_s_tseed); - Py_VISIT(traverse_module_state->__pyx_n_s_version); - Py_VISIT(traverse_module_state->__pyx_int_0L); - Py_VISIT(traverse_module_state->__pyx_int_64L); - Py_VISIT(traverse_module_state->__pyx_int_0xffffffffffffffffL); - Py_VISIT(traverse_module_state->__pyx_k_); - Py_VISIT(traverse_module_state->__pyx_tuple__2); - Py_VISIT(traverse_module_state->__pyx_tuple__5); - Py_VISIT(traverse_module_state->__pyx_tuple__7); - Py_VISIT(traverse_module_state->__pyx_tuple__9); - Py_VISIT(traverse_module_state->__pyx_tuple__11); - Py_VISIT(traverse_module_state->__pyx_codeobj__3); - Py_VISIT(traverse_module_state->__pyx_codeobj__4); - Py_VISIT(traverse_module_state->__pyx_codeobj__6); - Py_VISIT(traverse_module_state->__pyx_codeobj__8); - Py_VISIT(traverse_module_state->__pyx_codeobj__10); - Py_VISIT(traverse_module_state->__pyx_codeobj__12); + for (int i=0; i<35; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0L); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_64L); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0xffffffffffffffffL); return 0; } #endif -/* #### Code section: module_state_defines ### */ -#define __pyx_d __pyx_mstate_global->__pyx_d -#define __pyx_b __pyx_mstate_global->__pyx_b -#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime -#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple -#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes -#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode -#ifdef __Pyx_CyFunction_USED -#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType -#endif -#ifdef __Pyx_FusedFunction_USED -#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType -#endif -#ifdef __Pyx_Generator_USED -#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType -#endif -#ifdef __Pyx_IterableCoroutine_USED -#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_ptype_7cpython_4bool_bool __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_ptype_7cpython_7complex_complex __pyx_mstate_global->__pyx_ptype_7cpython_7complex_complex -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_kp_u_0_4_9 __pyx_mstate_global->__pyx_kp_u_0_4_9 -#define __pyx_kp_u_Argument __pyx_mstate_global->__pyx_kp_u_Argument -#define __pyx_n_s_CityHash128 __pyx_mstate_global->__pyx_n_s_CityHash128 -#define __pyx_n_u_CityHash128 __pyx_mstate_global->__pyx_n_u_CityHash128 -#define __pyx_n_s_CityHash128WithSeed __pyx_mstate_global->__pyx_n_s_CityHash128WithSeed -#define __pyx_n_u_CityHash128WithSeed __pyx_mstate_global->__pyx_n_u_CityHash128WithSeed -#define __pyx_n_s_CityHash32 __pyx_mstate_global->__pyx_n_s_CityHash32 -#define __pyx_n_u_CityHash32 __pyx_mstate_global->__pyx_n_u_CityHash32 -#define __pyx_n_s_CityHash64 __pyx_mstate_global->__pyx_n_s_CityHash64 -#define __pyx_n_u_CityHash64 __pyx_mstate_global->__pyx_n_u_CityHash64 -#define __pyx_n_s_CityHash64WithSeed __pyx_mstate_global->__pyx_n_s_CityHash64WithSeed -#define __pyx_n_u_CityHash64WithSeed __pyx_mstate_global->__pyx_n_u_CityHash64WithSeed -#define __pyx_n_s_CityHash64WithSeeds __pyx_mstate_global->__pyx_n_s_CityHash64WithSeeds -#define __pyx_n_u_CityHash64WithSeeds __pyx_mstate_global->__pyx_n_u_CityHash64WithSeeds -#define __pyx_kp_u_Eugene_Scherba __pyx_mstate_global->__pyx_kp_u_Eugene_Scherba -#define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError -#define __pyx_n_s__13 __pyx_mstate_global->__pyx_n_s__13 -#define __pyx_n_s_all __pyx_mstate_global->__pyx_n_s_all -#define __pyx_n_s_author __pyx_mstate_global->__pyx_n_s_author -#define __pyx_n_u_basestring __pyx_mstate_global->__pyx_n_u_basestring -#define __pyx_n_s_buf __pyx_mstate_global->__pyx_n_s_buf -#define __pyx_n_u_buffer __pyx_mstate_global->__pyx_n_u_buffer -#define __pyx_n_s_cityhash __pyx_mstate_global->__pyx_n_s_cityhash -#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback -#define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data -#define __pyx_n_u_data __pyx_mstate_global->__pyx_n_u_data -#define __pyx_n_s_email __pyx_mstate_global->__pyx_n_s_email -#define __pyx_n_s_encoding __pyx_mstate_global->__pyx_n_s_encoding -#define __pyx_n_s_encoding_size __pyx_mstate_global->__pyx_n_s_encoding_size -#define __pyx_kp_u_escherba_cityhash_gmail_com __pyx_mstate_global->__pyx_kp_u_escherba_cityhash_gmail_com -#define __pyx_n_s_first __pyx_mstate_global->__pyx_n_s_first -#define __pyx_kp_u_got __pyx_mstate_global->__pyx_kp_u_got -#define __pyx_kp_u_has_incorrect_type_expected __pyx_mstate_global->__pyx_kp_u_has_incorrect_type_expected -#define __pyx_kp_u_instead __pyx_mstate_global->__pyx_kp_u_instead -#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main -#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name -#define __pyx_n_s_result __pyx_mstate_global->__pyx_n_s_result -#define __pyx_n_s_second __pyx_mstate_global->__pyx_n_s_second -#define __pyx_n_s_seed __pyx_mstate_global->__pyx_n_s_seed -#define __pyx_n_s_seed0 __pyx_mstate_global->__pyx_n_s_seed0 -#define __pyx_n_s_seed1 __pyx_mstate_global->__pyx_n_s_seed1 -#define __pyx_kp_s_src_cityhash_pyx __pyx_mstate_global->__pyx_kp_s_src_cityhash_pyx -#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test -#define __pyx_n_s_tseed __pyx_mstate_global->__pyx_n_s_tseed -#define __pyx_n_s_version __pyx_mstate_global->__pyx_n_s_version -#define __pyx_int_0L __pyx_mstate_global->__pyx_int_0L -#define __pyx_int_64L __pyx_mstate_global->__pyx_int_64L -#define __pyx_int_0xffffffffffffffffL __pyx_mstate_global->__pyx_int_0xffffffffffffffffL -#define __pyx_k_ __pyx_mstate_global->__pyx_k_ -#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 -#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 -#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7 -#define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9 -#define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11 -#define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 -#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 -#define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 -#define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 -#define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10 -#define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12 /* #### Code section: module_code ### */ -/* "cpython/complex.pxd":19 +/* "cpython/complex.pxd":20 * - * @property - * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<< - * return self.cval.real - * - */ + * # unavailable in limited API + * @property # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") + * cdef inline double real(self) noexcept: +*/ +#if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) { double __pyx_r; - /* "cpython/complex.pxd":20 - * @property + /* "cpython/complex.pxd":23 + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline double real(self) noexcept: * return self.cval.real # <<<<<<<<<<<<<< * - * @property - */ + * # unavailable in limited API +*/ __pyx_r = __pyx_v_self->cval.real; goto __pyx_L0; - /* "cpython/complex.pxd":19 - * - * @property - * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<< - * return self.cval.real + /* "cpython/complex.pxd":20 * - */ + * # unavailable in limited API + * @property # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") + * cdef inline double real(self) noexcept: +*/ /* function exit code */ __pyx_L0:; return __pyx_r; } +#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/ -/* "cpython/complex.pxd":23 - * - * @property - * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<< - * return self.cval.imag +/* "cpython/complex.pxd":26 * - */ + * # unavailable in limited API + * @property # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") + * cdef inline double imag(self) noexcept: +*/ +#if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) { double __pyx_r; - /* "cpython/complex.pxd":24 - * @property + /* "cpython/complex.pxd":29 + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline double imag(self) noexcept: * return self.cval.imag # <<<<<<<<<<<<<< * * # PyTypeObject PyComplex_Type - */ +*/ __pyx_r = __pyx_v_self->cval.imag; goto __pyx_L0; - /* "cpython/complex.pxd":23 - * - * @property - * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<< - * return self.cval.imag + /* "cpython/complex.pxd":26 * - */ + * # unavailable in limited API + * @property # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") + * cdef inline double imag(self) noexcept: +*/ /* function exit code */ __pyx_L0:; return __pyx_r; } +#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/ -/* "cpython/contextvars.pxd":112 +/* "cpython/contextvars.pxd":115 * * - * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") # <<<<<<<<<<<<<< + * cdef inline object get_value(var, default_value=None): * """Return a new reference to the value of the context variable, - * or the default value of the context variable, - */ +*/ +#if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value *__pyx_optional_args) { + + /* "cpython/contextvars.pxd":116 + * + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") + * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< + * """Return a new reference to the value of the context variable, + * or the default value of the context variable, +*/ PyObject *__pyx_v_default_value = ((PyObject *)Py_None); PyObject *__pyx_v_value; PyObject *__pyx_v_pyvalue = NULL; @@ -2788,104 +2557,104 @@ static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("get_value", 1); + __Pyx_RefNannySetupContext("get_value", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default_value = __pyx_optional_args->default_value; } } - /* "cpython/contextvars.pxd":117 + /* "cpython/contextvars.pxd":121 * or None if no such value or default was found. * """ * cdef PyObject *value = NULL # <<<<<<<<<<<<<< * PyContextVar_Get(var, NULL, &value) * if value is NULL: - */ +*/ __pyx_v_value = NULL; - /* "cpython/contextvars.pxd":118 + /* "cpython/contextvars.pxd":122 * """ * cdef PyObject *value = NULL * PyContextVar_Get(var, NULL, &value) # <<<<<<<<<<<<<< * if value is NULL: * # context variable does not have a default - */ - __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 118, __pyx_L1_error) +*/ + __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 122, __pyx_L1_error) - /* "cpython/contextvars.pxd":119 + /* "cpython/contextvars.pxd":123 * cdef PyObject *value = NULL * PyContextVar_Get(var, NULL, &value) * if value is NULL: # <<<<<<<<<<<<<< * # context variable does not have a default * pyvalue = default_value - */ +*/ __pyx_t_2 = (__pyx_v_value == NULL); if (__pyx_t_2) { - /* "cpython/contextvars.pxd":121 + /* "cpython/contextvars.pxd":125 * if value is NULL: * # context variable does not have a default * pyvalue = default_value # <<<<<<<<<<<<<< * else: * # value or default value of context variable - */ +*/ __Pyx_INCREF(__pyx_v_default_value); __pyx_v_pyvalue = __pyx_v_default_value; - /* "cpython/contextvars.pxd":119 + /* "cpython/contextvars.pxd":123 * cdef PyObject *value = NULL * PyContextVar_Get(var, NULL, &value) * if value is NULL: # <<<<<<<<<<<<<< * # context variable does not have a default * pyvalue = default_value - */ +*/ goto __pyx_L3; } - /* "cpython/contextvars.pxd":124 + /* "cpython/contextvars.pxd":128 * else: * # value or default value of context variable * pyvalue = value # <<<<<<<<<<<<<< * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue - */ +*/ /*else*/ { __pyx_t_3 = ((PyObject *)__pyx_v_value); __Pyx_INCREF(__pyx_t_3); __pyx_v_pyvalue = __pyx_t_3; __pyx_t_3 = 0; - /* "cpython/contextvars.pxd":125 + /* "cpython/contextvars.pxd":129 * # value or default value of context variable * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<< * return pyvalue * - */ +*/ Py_XDECREF(__pyx_v_value); } __pyx_L3:; - /* "cpython/contextvars.pxd":126 + /* "cpython/contextvars.pxd":130 * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_pyvalue); __pyx_r = __pyx_v_pyvalue; goto __pyx_L0; - /* "cpython/contextvars.pxd":112 + /* "cpython/contextvars.pxd":115 * * - * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") # <<<<<<<<<<<<<< + * cdef inline object get_value(var, default_value=None): * """Return a new reference to the value of the context variable, - * or the default value of the context variable, - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -2898,16 +2667,26 @@ static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject __Pyx_RefNannyFinishContext(); return __pyx_r; } +#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/ -/* "cpython/contextvars.pxd":129 +/* "cpython/contextvars.pxd":133 * * - * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") # <<<<<<<<<<<<<< + * cdef inline object get_value_no_default(var, default_value=None): * """Return a new reference to the value of the context variable, - * or the provided default value if no such value was found. - */ +*/ +#if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_default(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default *__pyx_optional_args) { + + /* "cpython/contextvars.pxd":134 + * + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") + * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< + * """Return a new reference to the value of the context variable, + * or the provided default value if no such value was found. +*/ PyObject *__pyx_v_default_value = ((PyObject *)Py_None); PyObject *__pyx_v_value; PyObject *__pyx_v_pyvalue = NULL; @@ -2918,68 +2697,68 @@ static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_defau int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("get_value_no_default", 1); + __Pyx_RefNannySetupContext("get_value_no_default", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default_value = __pyx_optional_args->default_value; } } - /* "cpython/contextvars.pxd":135 + /* "cpython/contextvars.pxd":140 * Ignores the default value of the context variable, if any. * """ * cdef PyObject *value = NULL # <<<<<<<<<<<<<< * PyContextVar_Get(var, default_value, &value) * # value of context variable or 'default_value' - */ +*/ __pyx_v_value = NULL; - /* "cpython/contextvars.pxd":136 + /* "cpython/contextvars.pxd":141 * """ * cdef PyObject *value = NULL * PyContextVar_Get(var, default_value, &value) # <<<<<<<<<<<<<< * # value of context variable or 'default_value' * pyvalue = value - */ - __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 136, __pyx_L1_error) +*/ + __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 141, __pyx_L1_error) - /* "cpython/contextvars.pxd":138 + /* "cpython/contextvars.pxd":143 * PyContextVar_Get(var, default_value, &value) * # value of context variable or 'default_value' * pyvalue = value # <<<<<<<<<<<<<< * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue - */ +*/ __pyx_t_2 = ((PyObject *)__pyx_v_value); __Pyx_INCREF(__pyx_t_2); __pyx_v_pyvalue = __pyx_t_2; __pyx_t_2 = 0; - /* "cpython/contextvars.pxd":139 + /* "cpython/contextvars.pxd":144 * # value of context variable or 'default_value' * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<< * return pyvalue - */ +*/ Py_XDECREF(__pyx_v_value); - /* "cpython/contextvars.pxd":140 + /* "cpython/contextvars.pxd":145 * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue # <<<<<<<<<<<<<< - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_pyvalue); __pyx_r = __pyx_v_pyvalue; goto __pyx_L0; - /* "cpython/contextvars.pxd":129 + /* "cpython/contextvars.pxd":133 * * - * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") # <<<<<<<<<<<<<< + * cdef inline object get_value_no_default(var, default_value=None): * """Return a new reference to the value of the context variable, - * or the provided default value if no such value was found. - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -2992,6 +2771,7 @@ static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_defau __Pyx_RefNannyFinishContext(); return __pyx_r; } +#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/ /* "cityhash.pyx":79 * @@ -2999,20 +2779,23 @@ static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_defau * cdef object _type_error(argname: str, expected: object, value: object): # <<<<<<<<<<<<<< * return TypeError( * "Argument '%s' has incorrect type: expected %s, got '%s' instead" % - */ +*/ static PyObject *__pyx_f_8cityhash__type_error(PyObject *__pyx_v_argname, PyObject *__pyx_v_expected, PyObject *__pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - Py_UCS4 __pyx_t_3; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7[7]; + size_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_type_error", 1); + __Pyx_RefNannySetupContext("_type_error", 0); /* "cityhash.pyx":80 * @@ -3020,24 +2803,11 @@ static PyObject *__pyx_f_8cityhash__type_error(PyObject *__pyx_v_argname, PyObje * return TypeError( # <<<<<<<<<<<<<< * "Argument '%s' has incorrect type: expected %s, got '%s' instead" % * (argname, expected, type(value).__name__) - */ +*/ __Pyx_XDECREF(__pyx_r); - - /* "cityhash.pyx":81 - * cdef object _type_error(argname: str, expected: object, value: object): - * return TypeError( - * "Argument '%s' has incorrect type: expected %s, got '%s' instead" % # <<<<<<<<<<<<<< - * (argname, expected, type(value).__name__) - * ) - */ - __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = 0; - __pyx_t_3 = 127; - __Pyx_INCREF(__pyx_kp_u_Argument); - __pyx_t_2 += 10; - __Pyx_GIVEREF(__pyx_kp_u_Argument); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Argument); + __pyx_t_2 = NULL; + __Pyx_INCREF(__pyx_builtin_TypeError); + __pyx_t_3 = __pyx_builtin_TypeError; /* "cityhash.pyx":82 * return TypeError( @@ -3045,41 +2815,21 @@ static PyObject *__pyx_f_8cityhash__type_error(PyObject *__pyx_v_argname, PyObje * (argname, expected, type(value).__name__) # <<<<<<<<<<<<<< * ) * - */ - __Pyx_INCREF(__pyx_v_argname); - __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_argname) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_argname) : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_argname); - __Pyx_GIVEREF(__pyx_v_argname); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_argname); - __Pyx_INCREF(__pyx_kp_u_has_incorrect_type_expected); - __pyx_t_2 += 31; - __Pyx_GIVEREF(__pyx_kp_u_has_incorrect_type_expected); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_has_incorrect_type_expected); - __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_expected), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_kp_u_got); - __pyx_t_2 += 7; - __Pyx_GIVEREF(__pyx_kp_u_got); - PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_got); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_value)), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_expected), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_value)), __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_5); - __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_kp_u_instead); - __pyx_t_2 += 9; - __Pyx_GIVEREF(__pyx_kp_u_instead); - PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u_instead); + __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 82, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_Argument; + __pyx_t_7[1] = __pyx_v_argname; + __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u_has_incorrect_type_expected; + __pyx_t_7[3] = __pyx_t_4; + __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u_got; + __pyx_t_7[5] = __pyx_t_6; + __pyx_t_7[6] = __pyx_mstate_global->__pyx_kp_u_instead; /* "cityhash.pyx":81 * cdef object _type_error(argname: str, expected: object, value: object): @@ -3087,21 +2837,22 @@ static PyObject *__pyx_f_8cityhash__type_error(PyObject *__pyx_v_argname, PyObje * "Argument '%s' has incorrect type: expected %s, got '%s' instead" % # <<<<<<<<<<<<<< * (argname, expected, type(value).__name__) * ) - */ - __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 81, __pyx_L1_error) +*/ + __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_7, 7, 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_v_argname) + 31 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 7 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 9, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_argname) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6)); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "cityhash.pyx":80 - * - * cdef object _type_error(argname: str, expected: object, value: object): - * return TypeError( # <<<<<<<<<<<<<< - * "Argument '%s' has incorrect type: expected %s, got '%s' instead" % - * (argname, expected, type(value).__name__) - */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; @@ -3112,13 +2863,16 @@ static PyObject *__pyx_f_8cityhash__type_error(PyObject *__pyx_v_argname, PyObje * cdef object _type_error(argname: str, expected: object, value: object): # <<<<<<<<<<<<<< * return TypeError( * "Argument '%s' has incorrect type: expected %s, got '%s' instead" % - */ +*/ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("cityhash._type_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; @@ -3133,7 +2887,7 @@ static PyObject *__pyx_f_8cityhash__type_error(PyObject *__pyx_v_argname, PyObje * def CityHash32(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 32-bit hash from input data. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_8cityhash_1CityHash32(PyObject *__pyx_self, @@ -3143,8 +2897,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8cityhash_CityHash32, "CityHash32(data) -> int\nObtain a 32-bit hash from input data.\n\n :param data: input data (string, bytes, or buffer object)\n :return: an integer representing a 32-bit hash of the input\n :raises TypeError: if data is not of one of input types\n :raises ValueError: if input buffer is not C-contiguous\n "); -static PyMethodDef __pyx_mdef_8cityhash_1CityHash32 = {"CityHash32", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cityhash_1CityHash32, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cityhash_CityHash32}; +PyDoc_STRVAR(__pyx_doc_8cityhash_CityHash32, "CityHash32(data) -> int\n\nObtain a 32-bit hash from input data.\n\n:param data: input data (string, bytes, or buffer object)\n:return: an integer representing a 32-bit hash of the input\n:raises TypeError: if data is not of one of input types\n:raises ValueError: if input buffer is not C-contiguous"); +static PyMethodDef __pyx_mdef_8cityhash_1CityHash32 = {"CityHash32", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cityhash_1CityHash32, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cityhash_CityHash32}; static PyObject *__pyx_pw_8cityhash_1CityHash32(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3165,7 +2919,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("CityHash32 (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -3173,33 +2927,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 86, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 86, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 86, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "CityHash32") < 0)) __PYX_ERR(0, 86, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "CityHash32", 0) < 0) __PYX_ERR(0, 86, __pyx_L3_error) + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("CityHash32", 1, 1, 1, i); __PYX_ERR(0, 86, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 86, __pyx_L3_error) } __pyx_v_data = values[0]; } @@ -3209,11 +2958,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("cityhash.CityHash32", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3222,11 +2968,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_8cityhash_CityHash32(__pyx_self, __pyx_v_data); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -3247,7 +2990,7 @@ static PyObject *__pyx_pf_8cityhash_CityHash32(CYTHON_UNUSED PyObject *__pyx_sel int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("CityHash32", 1); + __Pyx_RefNannySetupContext("CityHash32", 0); /* "cityhash.pyx":97 * cdef uint32 result @@ -3255,7 +2998,7 @@ static PyObject *__pyx_pf_8cityhash_CityHash32(CYTHON_UNUSED PyObject *__pyx_sel * cdef Py_ssize_t encoding_size = 0 # <<<<<<<<<<<<<< * * if PyUnicode_Check(data): - */ +*/ __pyx_v_encoding_size = 0; /* "cityhash.pyx":99 @@ -3264,7 +3007,7 @@ static PyObject *__pyx_pf_8cityhash_CityHash32(CYTHON_UNUSED PyObject *__pyx_sel * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash32(encoding, encoding_size) - */ +*/ __pyx_t_1 = PyUnicode_Check(__pyx_v_data); if (__pyx_t_1) { @@ -3274,8 +3017,8 @@ static PyObject *__pyx_pf_8cityhash_CityHash32(CYTHON_UNUSED PyObject *__pyx_sel * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) # <<<<<<<<<<<<<< * result = c_Hash32(encoding, encoding_size) * elif PyBytes_Check(data): - */ - __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(0, 100, __pyx_L1_error) +*/ + __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)0))) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_v_encoding = __pyx_t_2; /* "cityhash.pyx":101 @@ -3284,7 +3027,7 @@ static PyObject *__pyx_pf_8cityhash_CityHash32(CYTHON_UNUSED PyObject *__pyx_sel * result = c_Hash32(encoding, encoding_size) # <<<<<<<<<<<<<< * elif PyBytes_Check(data): * result = c_Hash32( - */ +*/ __pyx_v_result = CityHash32(__pyx_v_encoding, __pyx_v_encoding_size); /* "cityhash.pyx":99 @@ -3293,7 +3036,7 @@ static PyObject *__pyx_pf_8cityhash_CityHash32(CYTHON_UNUSED PyObject *__pyx_sel * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash32(encoding, encoding_size) - */ +*/ goto __pyx_L3; } @@ -3303,7 +3046,7 @@ static PyObject *__pyx_pf_8cityhash_CityHash32(CYTHON_UNUSED PyObject *__pyx_sel * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash32( * PyBytes_AS_STRING(data), - */ +*/ __pyx_t_1 = PyBytes_Check(__pyx_v_data); if (__pyx_t_1) { @@ -3313,7 +3056,7 @@ static PyObject *__pyx_pf_8cityhash_CityHash32(CYTHON_UNUSED PyObject *__pyx_sel * result = c_Hash32( # <<<<<<<<<<<<<< * PyBytes_AS_STRING(data), * PyBytes_GET_SIZE(data)) - */ +*/ __pyx_v_result = CityHash32(((char const *)PyBytes_AS_STRING(__pyx_v_data)), PyBytes_GET_SIZE(__pyx_v_data)); /* "cityhash.pyx":102 @@ -3322,7 +3065,7 @@ static PyObject *__pyx_pf_8cityhash_CityHash32(CYTHON_UNUSED PyObject *__pyx_sel * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash32( * PyBytes_AS_STRING(data), - */ +*/ goto __pyx_L3; } @@ -3332,7 +3075,7 @@ static PyObject *__pyx_pf_8cityhash_CityHash32(CYTHON_UNUSED PyObject *__pyx_sel * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash32(buf.buf, buf.len) - */ +*/ __pyx_t_1 = PyObject_CheckBuffer(__pyx_v_data); if (likely(__pyx_t_1)) { @@ -3342,7 +3085,7 @@ static PyObject *__pyx_pf_8cityhash_CityHash32(CYTHON_UNUSED PyObject *__pyx_sel * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * result = c_Hash32(buf.buf, buf.len) * PyBuffer_Release(&buf) - */ +*/ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 107, __pyx_L1_error) /* "cityhash.pyx":108 @@ -3351,7 +3094,7 @@ static PyObject *__pyx_pf_8cityhash_CityHash32(CYTHON_UNUSED PyObject *__pyx_sel * result = c_Hash32(buf.buf, buf.len) # <<<<<<<<<<<<<< * PyBuffer_Release(&buf) * else: - */ +*/ __pyx_v_result = CityHash32(((char const *)__pyx_v_buf.buf), __pyx_v_buf.len); /* "cityhash.pyx":109 @@ -3360,7 +3103,7 @@ static PyObject *__pyx_pf_8cityhash_CityHash32(CYTHON_UNUSED PyObject *__pyx_sel * PyBuffer_Release(&buf) # <<<<<<<<<<<<<< * else: * raise _type_error("data", ["basestring", "buffer"], data) - */ +*/ PyBuffer_Release((&__pyx_v_buf)); /* "cityhash.pyx":106 @@ -3369,7 +3112,7 @@ static PyObject *__pyx_pf_8cityhash_CityHash32(CYTHON_UNUSED PyObject *__pyx_sel * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash32(buf.buf, buf.len) - */ +*/ goto __pyx_L3; } @@ -3379,17 +3122,17 @@ static PyObject *__pyx_pf_8cityhash_CityHash32(CYTHON_UNUSED PyObject *__pyx_sel * raise _type_error("data", ["basestring", "buffer"], data) # <<<<<<<<<<<<<< * return result * - */ +*/ /*else*/ { __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_u_basestring); - __Pyx_GIVEREF(__pyx_n_u_basestring); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_basestring)) __PYX_ERR(0, 111, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_buffer); - __Pyx_GIVEREF(__pyx_n_u_buffer); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_u_buffer)) __PYX_ERR(0, 111, __pyx_L1_error); - __pyx_t_5 = __pyx_f_8cityhash__type_error(__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_basestring); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_basestring); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_n_u_basestring) != (0)) __PYX_ERR(0, 111, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_buffer); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_buffer); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_n_u_buffer) != (0)) __PYX_ERR(0, 111, __pyx_L1_error); + __pyx_t_5 = __pyx_f_8cityhash__type_error(__pyx_mstate_global->__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); @@ -3404,11 +3147,11 @@ static PyObject *__pyx_pf_8cityhash_CityHash32(CYTHON_UNUSED PyObject *__pyx_sel * return result # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_uint32_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 112, __pyx_L1_error) + if (!(likely(PyLong_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 112, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; @@ -3419,7 +3162,7 @@ static PyObject *__pyx_pf_8cityhash_CityHash32(CYTHON_UNUSED PyObject *__pyx_sel * def CityHash32(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 32-bit hash from input data. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -3439,7 +3182,7 @@ static PyObject *__pyx_pf_8cityhash_CityHash32(CYTHON_UNUSED PyObject *__pyx_sel * def CityHash64(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 64-bit hash from input data. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_8cityhash_3CityHash64(PyObject *__pyx_self, @@ -3449,8 +3192,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8cityhash_2CityHash64, "CityHash64(data) -> int\nObtain a 64-bit hash from input data.\n\n :param data: input data (string, bytes, or buffer object)\n :return: an integer representing a 64-bit hash of the input\n :raises TypeError: if data is not of one of input types\n :raises ValueError: if input buffer is not C-contiguous\n "); -static PyMethodDef __pyx_mdef_8cityhash_3CityHash64 = {"CityHash64", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cityhash_3CityHash64, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cityhash_2CityHash64}; +PyDoc_STRVAR(__pyx_doc_8cityhash_2CityHash64, "CityHash64(data) -> int\n\nObtain a 64-bit hash from input data.\n\n:param data: input data (string, bytes, or buffer object)\n:return: an integer representing a 64-bit hash of the input\n:raises TypeError: if data is not of one of input types\n:raises ValueError: if input buffer is not C-contiguous"); +static PyMethodDef __pyx_mdef_8cityhash_3CityHash64 = {"CityHash64", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cityhash_3CityHash64, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cityhash_2CityHash64}; static PyObject *__pyx_pw_8cityhash_3CityHash64(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3471,7 +3214,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("CityHash64 (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -3479,33 +3222,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 115, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 115, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "CityHash64") < 0)) __PYX_ERR(0, 115, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "CityHash64", 0) < 0) __PYX_ERR(0, 115, __pyx_L3_error) + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("CityHash64", 1, 1, 1, i); __PYX_ERR(0, 115, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 115, __pyx_L3_error) } __pyx_v_data = values[0]; } @@ -3515,11 +3253,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("cityhash.CityHash64", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3528,11 +3263,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_8cityhash_2CityHash64(__pyx_self, __pyx_v_data); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -3553,7 +3285,7 @@ static PyObject *__pyx_pf_8cityhash_2CityHash64(CYTHON_UNUSED PyObject *__pyx_se int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("CityHash64", 1); + __Pyx_RefNannySetupContext("CityHash64", 0); /* "cityhash.pyx":126 * cdef uint64 result @@ -3561,7 +3293,7 @@ static PyObject *__pyx_pf_8cityhash_2CityHash64(CYTHON_UNUSED PyObject *__pyx_se * cdef Py_ssize_t encoding_size = 0 # <<<<<<<<<<<<<< * * if PyUnicode_Check(data): - */ +*/ __pyx_v_encoding_size = 0; /* "cityhash.pyx":128 @@ -3570,7 +3302,7 @@ static PyObject *__pyx_pf_8cityhash_2CityHash64(CYTHON_UNUSED PyObject *__pyx_se * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash64(encoding, encoding_size) - */ +*/ __pyx_t_1 = PyUnicode_Check(__pyx_v_data); if (__pyx_t_1) { @@ -3580,8 +3312,8 @@ static PyObject *__pyx_pf_8cityhash_2CityHash64(CYTHON_UNUSED PyObject *__pyx_se * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) # <<<<<<<<<<<<<< * result = c_Hash64(encoding, encoding_size) * elif PyBytes_Check(data): - */ - __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(0, 129, __pyx_L1_error) +*/ + __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)0))) __PYX_ERR(0, 129, __pyx_L1_error) __pyx_v_encoding = __pyx_t_2; /* "cityhash.pyx":130 @@ -3590,7 +3322,7 @@ static PyObject *__pyx_pf_8cityhash_2CityHash64(CYTHON_UNUSED PyObject *__pyx_se * result = c_Hash64(encoding, encoding_size) # <<<<<<<<<<<<<< * elif PyBytes_Check(data): * result = c_Hash64( - */ +*/ __pyx_v_result = CityHash64(__pyx_v_encoding, __pyx_v_encoding_size); /* "cityhash.pyx":128 @@ -3599,7 +3331,7 @@ static PyObject *__pyx_pf_8cityhash_2CityHash64(CYTHON_UNUSED PyObject *__pyx_se * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash64(encoding, encoding_size) - */ +*/ goto __pyx_L3; } @@ -3609,7 +3341,7 @@ static PyObject *__pyx_pf_8cityhash_2CityHash64(CYTHON_UNUSED PyObject *__pyx_se * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash64( * PyBytes_AS_STRING(data), - */ +*/ __pyx_t_1 = PyBytes_Check(__pyx_v_data); if (__pyx_t_1) { @@ -3619,7 +3351,7 @@ static PyObject *__pyx_pf_8cityhash_2CityHash64(CYTHON_UNUSED PyObject *__pyx_se * result = c_Hash64( # <<<<<<<<<<<<<< * PyBytes_AS_STRING(data), * PyBytes_GET_SIZE(data)) - */ +*/ __pyx_v_result = CityHash64(((char const *)PyBytes_AS_STRING(__pyx_v_data)), PyBytes_GET_SIZE(__pyx_v_data)); /* "cityhash.pyx":131 @@ -3628,7 +3360,7 @@ static PyObject *__pyx_pf_8cityhash_2CityHash64(CYTHON_UNUSED PyObject *__pyx_se * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash64( * PyBytes_AS_STRING(data), - */ +*/ goto __pyx_L3; } @@ -3638,7 +3370,7 @@ static PyObject *__pyx_pf_8cityhash_2CityHash64(CYTHON_UNUSED PyObject *__pyx_se * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash64(buf.buf, buf.len) - */ +*/ __pyx_t_1 = PyObject_CheckBuffer(__pyx_v_data); if (likely(__pyx_t_1)) { @@ -3648,7 +3380,7 @@ static PyObject *__pyx_pf_8cityhash_2CityHash64(CYTHON_UNUSED PyObject *__pyx_se * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * result = c_Hash64(buf.buf, buf.len) * PyBuffer_Release(&buf) - */ +*/ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 136, __pyx_L1_error) /* "cityhash.pyx":137 @@ -3657,7 +3389,7 @@ static PyObject *__pyx_pf_8cityhash_2CityHash64(CYTHON_UNUSED PyObject *__pyx_se * result = c_Hash64(buf.buf, buf.len) # <<<<<<<<<<<<<< * PyBuffer_Release(&buf) * else: - */ +*/ __pyx_v_result = CityHash64(((char const *)__pyx_v_buf.buf), __pyx_v_buf.len); /* "cityhash.pyx":138 @@ -3666,7 +3398,7 @@ static PyObject *__pyx_pf_8cityhash_2CityHash64(CYTHON_UNUSED PyObject *__pyx_se * PyBuffer_Release(&buf) # <<<<<<<<<<<<<< * else: * raise _type_error("data", ["basestring", "buffer"], data) - */ +*/ PyBuffer_Release((&__pyx_v_buf)); /* "cityhash.pyx":135 @@ -3675,7 +3407,7 @@ static PyObject *__pyx_pf_8cityhash_2CityHash64(CYTHON_UNUSED PyObject *__pyx_se * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash64(buf.buf, buf.len) - */ +*/ goto __pyx_L3; } @@ -3685,17 +3417,17 @@ static PyObject *__pyx_pf_8cityhash_2CityHash64(CYTHON_UNUSED PyObject *__pyx_se * raise _type_error("data", ["basestring", "buffer"], data) # <<<<<<<<<<<<<< * return result * - */ +*/ /*else*/ { __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_u_basestring); - __Pyx_GIVEREF(__pyx_n_u_basestring); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_basestring)) __PYX_ERR(0, 140, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_buffer); - __Pyx_GIVEREF(__pyx_n_u_buffer); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_u_buffer)) __PYX_ERR(0, 140, __pyx_L1_error); - __pyx_t_5 = __pyx_f_8cityhash__type_error(__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_basestring); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_basestring); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_n_u_basestring) != (0)) __PYX_ERR(0, 140, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_buffer); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_buffer); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_n_u_buffer) != (0)) __PYX_ERR(0, 140, __pyx_L1_error); + __pyx_t_5 = __pyx_f_8cityhash__type_error(__pyx_mstate_global->__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); @@ -3710,11 +3442,11 @@ static PyObject *__pyx_pf_8cityhash_2CityHash64(CYTHON_UNUSED PyObject *__pyx_se * return result # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_From_uint64_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_uint64_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 141, __pyx_L1_error) + if (!(likely(PyLong_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 141, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; @@ -3725,7 +3457,7 @@ static PyObject *__pyx_pf_8cityhash_2CityHash64(CYTHON_UNUSED PyObject *__pyx_se * def CityHash64(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 64-bit hash from input data. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -3745,7 +3477,7 @@ static PyObject *__pyx_pf_8cityhash_2CityHash64(CYTHON_UNUSED PyObject *__pyx_se * def CityHash64WithSeed(data, uint64 seed=0ULL) -> int: # <<<<<<<<<<<<<< * """Obtain a 64-bit hash using a seed. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_8cityhash_5CityHash64WithSeed(PyObject *__pyx_self, @@ -3755,8 +3487,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8cityhash_4CityHash64WithSeed, "CityHash64WithSeed(data, uint64 seed=0) -> int\nObtain a 64-bit hash using a seed.\n\n :param data: input data (string, bytes, or buffer object)\n :param seed: seed value (a 64-bit integer, defaults to 0)\n :return: an integer representing a 64-bit hash of the input\n :raises TypeError: if data is not of one of input types\n :raises ValueError: if input buffer is not C-contiguous\n :raises OverflowError: if seed cannot be converted to unsigned int64\n "); -static PyMethodDef __pyx_mdef_8cityhash_5CityHash64WithSeed = {"CityHash64WithSeed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cityhash_5CityHash64WithSeed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cityhash_4CityHash64WithSeed}; +PyDoc_STRVAR(__pyx_doc_8cityhash_4CityHash64WithSeed, "CityHash64WithSeed(data, uint64 seed=0) -> int\n\nObtain a 64-bit hash using a seed.\n\n:param data: input data (string, bytes, or buffer object)\n:param seed: seed value (a 64-bit integer, defaults to 0)\n:return: an integer representing a 64-bit hash of the input\n:raises TypeError: if data is not of one of input types\n:raises ValueError: if input buffer is not C-contiguous\n:raises OverflowError: if seed cannot be converted to unsigned int64"); +static PyMethodDef __pyx_mdef_8cityhash_5CityHash64WithSeed = {"CityHash64WithSeed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cityhash_5CityHash64WithSeed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cityhash_4CityHash64WithSeed}; static PyObject *__pyx_pw_8cityhash_5CityHash64WithSeed(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3778,7 +3510,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("CityHash64WithSeed (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -3786,50 +3518,43 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_seed,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,&__pyx_mstate_global->__pyx_n_u_seed,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 144, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 144, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 144, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_seed); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "CityHash64WithSeed") < 0)) __PYX_ERR(0, 144, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "CityHash64WithSeed", 0) < 0) __PYX_ERR(0, 144, __pyx_L3_error) + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("CityHash64WithSeed", 0, 1, 2, i); __PYX_ERR(0, 144, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 144, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 144, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_data = values[0]; if (values[1]) { - __pyx_v_seed = __Pyx_PyInt_As_uint64_t(values[1]); if (unlikely((__pyx_v_seed == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L3_error) + __pyx_v_seed = __Pyx_PyLong_As_uint64_t(values[1]); if (unlikely((__pyx_v_seed == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L3_error) } else { __pyx_v_seed = ((uint64)0ULL); } @@ -3840,11 +3565,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("cityhash.CityHash64WithSeed", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3853,11 +3575,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_8cityhash_4CityHash64WithSeed(__pyx_self, __pyx_v_data, __pyx_v_seed); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -3878,7 +3597,7 @@ static PyObject *__pyx_pf_8cityhash_4CityHash64WithSeed(CYTHON_UNUSED PyObject * int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("CityHash64WithSeed", 1); + __Pyx_RefNannySetupContext("CityHash64WithSeed", 0); /* "cityhash.pyx":157 * cdef uint64 result @@ -3886,7 +3605,7 @@ static PyObject *__pyx_pf_8cityhash_4CityHash64WithSeed(CYTHON_UNUSED PyObject * * cdef Py_ssize_t encoding_size = 0 # <<<<<<<<<<<<<< * * if PyUnicode_Check(data): - */ +*/ __pyx_v_encoding_size = 0; /* "cityhash.pyx":159 @@ -3895,7 +3614,7 @@ static PyObject *__pyx_pf_8cityhash_4CityHash64WithSeed(CYTHON_UNUSED PyObject * * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash64WithSeed(encoding, encoding_size, seed) - */ +*/ __pyx_t_1 = PyUnicode_Check(__pyx_v_data); if (__pyx_t_1) { @@ -3905,8 +3624,8 @@ static PyObject *__pyx_pf_8cityhash_4CityHash64WithSeed(CYTHON_UNUSED PyObject * * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) # <<<<<<<<<<<<<< * result = c_Hash64WithSeed(encoding, encoding_size, seed) * elif PyBytes_Check(data): - */ - __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(0, 160, __pyx_L1_error) +*/ + __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)0))) __PYX_ERR(0, 160, __pyx_L1_error) __pyx_v_encoding = __pyx_t_2; /* "cityhash.pyx":161 @@ -3915,7 +3634,7 @@ static PyObject *__pyx_pf_8cityhash_4CityHash64WithSeed(CYTHON_UNUSED PyObject * * result = c_Hash64WithSeed(encoding, encoding_size, seed) # <<<<<<<<<<<<<< * elif PyBytes_Check(data): * result = c_Hash64WithSeed( - */ +*/ __pyx_v_result = CityHash64WithSeed(__pyx_v_encoding, __pyx_v_encoding_size, __pyx_v_seed); /* "cityhash.pyx":159 @@ -3924,7 +3643,7 @@ static PyObject *__pyx_pf_8cityhash_4CityHash64WithSeed(CYTHON_UNUSED PyObject * * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash64WithSeed(encoding, encoding_size, seed) - */ +*/ goto __pyx_L3; } @@ -3934,7 +3653,7 @@ static PyObject *__pyx_pf_8cityhash_4CityHash64WithSeed(CYTHON_UNUSED PyObject * * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash64WithSeed( * PyBytes_AS_STRING(data), - */ +*/ __pyx_t_1 = PyBytes_Check(__pyx_v_data); if (__pyx_t_1) { @@ -3944,7 +3663,7 @@ static PyObject *__pyx_pf_8cityhash_4CityHash64WithSeed(CYTHON_UNUSED PyObject * * result = c_Hash64WithSeed( # <<<<<<<<<<<<<< * PyBytes_AS_STRING(data), * PyBytes_GET_SIZE(data), seed) - */ +*/ __pyx_v_result = CityHash64WithSeed(((char const *)PyBytes_AS_STRING(__pyx_v_data)), PyBytes_GET_SIZE(__pyx_v_data), __pyx_v_seed); /* "cityhash.pyx":162 @@ -3953,7 +3672,7 @@ static PyObject *__pyx_pf_8cityhash_4CityHash64WithSeed(CYTHON_UNUSED PyObject * * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash64WithSeed( * PyBytes_AS_STRING(data), - */ +*/ goto __pyx_L3; } @@ -3963,7 +3682,7 @@ static PyObject *__pyx_pf_8cityhash_4CityHash64WithSeed(CYTHON_UNUSED PyObject * * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash64WithSeed(buf.buf, buf.len, seed) - */ +*/ __pyx_t_1 = PyObject_CheckBuffer(__pyx_v_data); if (likely(__pyx_t_1)) { @@ -3973,7 +3692,7 @@ static PyObject *__pyx_pf_8cityhash_4CityHash64WithSeed(CYTHON_UNUSED PyObject * * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * result = c_Hash64WithSeed(buf.buf, buf.len, seed) * PyBuffer_Release(&buf) - */ +*/ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 167, __pyx_L1_error) /* "cityhash.pyx":168 @@ -3982,7 +3701,7 @@ static PyObject *__pyx_pf_8cityhash_4CityHash64WithSeed(CYTHON_UNUSED PyObject * * result = c_Hash64WithSeed(buf.buf, buf.len, seed) # <<<<<<<<<<<<<< * PyBuffer_Release(&buf) * else: - */ +*/ __pyx_v_result = CityHash64WithSeed(((char const *)__pyx_v_buf.buf), __pyx_v_buf.len, __pyx_v_seed); /* "cityhash.pyx":169 @@ -3991,7 +3710,7 @@ static PyObject *__pyx_pf_8cityhash_4CityHash64WithSeed(CYTHON_UNUSED PyObject * * PyBuffer_Release(&buf) # <<<<<<<<<<<<<< * else: * raise _type_error("data", ["basestring", "buffer"], data) - */ +*/ PyBuffer_Release((&__pyx_v_buf)); /* "cityhash.pyx":166 @@ -4000,7 +3719,7 @@ static PyObject *__pyx_pf_8cityhash_4CityHash64WithSeed(CYTHON_UNUSED PyObject * * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash64WithSeed(buf.buf, buf.len, seed) - */ +*/ goto __pyx_L3; } @@ -4010,17 +3729,17 @@ static PyObject *__pyx_pf_8cityhash_4CityHash64WithSeed(CYTHON_UNUSED PyObject * * raise _type_error("data", ["basestring", "buffer"], data) # <<<<<<<<<<<<<< * return result * - */ +*/ /*else*/ { __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_u_basestring); - __Pyx_GIVEREF(__pyx_n_u_basestring); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_basestring)) __PYX_ERR(0, 171, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_buffer); - __Pyx_GIVEREF(__pyx_n_u_buffer); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_u_buffer)) __PYX_ERR(0, 171, __pyx_L1_error); - __pyx_t_5 = __pyx_f_8cityhash__type_error(__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_basestring); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_basestring); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_n_u_basestring) != (0)) __PYX_ERR(0, 171, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_buffer); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_buffer); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_n_u_buffer) != (0)) __PYX_ERR(0, 171, __pyx_L1_error); + __pyx_t_5 = __pyx_f_8cityhash__type_error(__pyx_mstate_global->__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); @@ -4035,11 +3754,11 @@ static PyObject *__pyx_pf_8cityhash_4CityHash64WithSeed(CYTHON_UNUSED PyObject * * return result # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_From_uint64_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_uint64_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 172, __pyx_L1_error) + if (!(likely(PyLong_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 172, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; @@ -4050,7 +3769,7 @@ static PyObject *__pyx_pf_8cityhash_4CityHash64WithSeed(CYTHON_UNUSED PyObject * * def CityHash64WithSeed(data, uint64 seed=0ULL) -> int: # <<<<<<<<<<<<<< * """Obtain a 64-bit hash using a seed. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -4070,7 +3789,7 @@ static PyObject *__pyx_pf_8cityhash_4CityHash64WithSeed(CYTHON_UNUSED PyObject * * def CityHash64WithSeeds(data, uint64 seed0=0LL, uint64 seed1=0LL) -> int: # <<<<<<<<<<<<<< * """Obtain a 64-bit hash using two seeds. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_8cityhash_7CityHash64WithSeeds(PyObject *__pyx_self, @@ -4080,8 +3799,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8cityhash_6CityHash64WithSeeds, "CityHash64WithSeeds(data, uint64 seed0=0, uint64 seed1=0) -> int\nObtain a 64-bit hash using two seeds.\n\n :param data: input data (string, bytes, or buffer object)\n :param seed0: first seed (a 64-bit integer, defaults to 0)\n :param seed1: second seed (a 64-bit integer, defaults to 0)\n :return: an integer representing a 64-bit hash of the input\n :raises TypeError: if data is not of one of input types\n :raises ValueError: if input buffer is not C-contiguous\n "); -static PyMethodDef __pyx_mdef_8cityhash_7CityHash64WithSeeds = {"CityHash64WithSeeds", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cityhash_7CityHash64WithSeeds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cityhash_6CityHash64WithSeeds}; +PyDoc_STRVAR(__pyx_doc_8cityhash_6CityHash64WithSeeds, "CityHash64WithSeeds(data, uint64 seed0=0, uint64 seed1=0) -> int\n\nObtain a 64-bit hash using two seeds.\n\n:param data: input data (string, bytes, or buffer object)\n:param seed0: first seed (a 64-bit integer, defaults to 0)\n:param seed1: second seed (a 64-bit integer, defaults to 0)\n:return: an integer representing a 64-bit hash of the input\n:raises TypeError: if data is not of one of input types\n:raises ValueError: if input buffer is not C-contiguous"); +static PyMethodDef __pyx_mdef_8cityhash_7CityHash64WithSeeds = {"CityHash64WithSeeds", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cityhash_7CityHash64WithSeeds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cityhash_6CityHash64WithSeeds}; static PyObject *__pyx_pw_8cityhash_7CityHash64WithSeeds(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4104,7 +3823,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("CityHash64WithSeeds (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -4112,66 +3831,56 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_seed0,&__pyx_n_s_seed1,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,&__pyx_mstate_global->__pyx_n_u_seed0,&__pyx_mstate_global->__pyx_n_u_seed1,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 175, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 175, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 175, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 175, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_seed0); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_seed1); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "CityHash64WithSeeds") < 0)) __PYX_ERR(0, 175, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "CityHash64WithSeeds", 0) < 0) __PYX_ERR(0, 175, __pyx_L3_error) + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("CityHash64WithSeeds", 0, 1, 3, i); __PYX_ERR(0, 175, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 175, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 175, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 175, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_data = values[0]; if (values[1]) { - __pyx_v_seed0 = __Pyx_PyInt_As_uint64_t(values[1]); if (unlikely((__pyx_v_seed0 == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L3_error) + __pyx_v_seed0 = __Pyx_PyLong_As_uint64_t(values[1]); if (unlikely((__pyx_v_seed0 == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L3_error) } else { __pyx_v_seed0 = ((uint64)0LL); } if (values[2]) { - __pyx_v_seed1 = __Pyx_PyInt_As_uint64_t(values[2]); if (unlikely((__pyx_v_seed1 == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L3_error) + __pyx_v_seed1 = __Pyx_PyLong_As_uint64_t(values[2]); if (unlikely((__pyx_v_seed1 == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L3_error) } else { __pyx_v_seed1 = ((uint64)0LL); } @@ -4182,11 +3891,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("cityhash.CityHash64WithSeeds", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4195,11 +3901,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_8cityhash_6CityHash64WithSeeds(__pyx_self, __pyx_v_data, __pyx_v_seed0, __pyx_v_seed1); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -4220,7 +3923,7 @@ static PyObject *__pyx_pf_8cityhash_6CityHash64WithSeeds(CYTHON_UNUSED PyObject int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("CityHash64WithSeeds", 1); + __Pyx_RefNannySetupContext("CityHash64WithSeeds", 0); /* "cityhash.pyx":188 * cdef uint64 result @@ -4228,7 +3931,7 @@ static PyObject *__pyx_pf_8cityhash_6CityHash64WithSeeds(CYTHON_UNUSED PyObject * cdef Py_ssize_t encoding_size = 0 # <<<<<<<<<<<<<< * * if PyUnicode_Check(data): - */ +*/ __pyx_v_encoding_size = 0; /* "cityhash.pyx":190 @@ -4237,7 +3940,7 @@ static PyObject *__pyx_pf_8cityhash_6CityHash64WithSeeds(CYTHON_UNUSED PyObject * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash64WithSeeds(encoding, encoding_size, seed0, seed1) - */ +*/ __pyx_t_1 = PyUnicode_Check(__pyx_v_data); if (__pyx_t_1) { @@ -4247,8 +3950,8 @@ static PyObject *__pyx_pf_8cityhash_6CityHash64WithSeeds(CYTHON_UNUSED PyObject * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) # <<<<<<<<<<<<<< * result = c_Hash64WithSeeds(encoding, encoding_size, seed0, seed1) * elif PyBytes_Check(data): - */ - __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(0, 191, __pyx_L1_error) +*/ + __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)0))) __PYX_ERR(0, 191, __pyx_L1_error) __pyx_v_encoding = __pyx_t_2; /* "cityhash.pyx":192 @@ -4257,7 +3960,7 @@ static PyObject *__pyx_pf_8cityhash_6CityHash64WithSeeds(CYTHON_UNUSED PyObject * result = c_Hash64WithSeeds(encoding, encoding_size, seed0, seed1) # <<<<<<<<<<<<<< * elif PyBytes_Check(data): * result = c_Hash64WithSeeds( - */ +*/ __pyx_v_result = CityHash64WithSeeds(__pyx_v_encoding, __pyx_v_encoding_size, __pyx_v_seed0, __pyx_v_seed1); /* "cityhash.pyx":190 @@ -4266,7 +3969,7 @@ static PyObject *__pyx_pf_8cityhash_6CityHash64WithSeeds(CYTHON_UNUSED PyObject * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash64WithSeeds(encoding, encoding_size, seed0, seed1) - */ +*/ goto __pyx_L3; } @@ -4276,7 +3979,7 @@ static PyObject *__pyx_pf_8cityhash_6CityHash64WithSeeds(CYTHON_UNUSED PyObject * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash64WithSeeds( * PyBytes_AS_STRING(data), - */ +*/ __pyx_t_1 = PyBytes_Check(__pyx_v_data); if (__pyx_t_1) { @@ -4286,7 +3989,7 @@ static PyObject *__pyx_pf_8cityhash_6CityHash64WithSeeds(CYTHON_UNUSED PyObject * result = c_Hash64WithSeeds( # <<<<<<<<<<<<<< * PyBytes_AS_STRING(data), * PyBytes_GET_SIZE(data), seed0, seed1) - */ +*/ __pyx_v_result = CityHash64WithSeeds(((char const *)PyBytes_AS_STRING(__pyx_v_data)), PyBytes_GET_SIZE(__pyx_v_data), __pyx_v_seed0, __pyx_v_seed1); /* "cityhash.pyx":193 @@ -4295,7 +3998,7 @@ static PyObject *__pyx_pf_8cityhash_6CityHash64WithSeeds(CYTHON_UNUSED PyObject * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash64WithSeeds( * PyBytes_AS_STRING(data), - */ +*/ goto __pyx_L3; } @@ -4305,7 +4008,7 @@ static PyObject *__pyx_pf_8cityhash_6CityHash64WithSeeds(CYTHON_UNUSED PyObject * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash64WithSeeds(buf.buf, buf.len, seed0, seed1) - */ +*/ __pyx_t_1 = PyObject_CheckBuffer(__pyx_v_data); if (likely(__pyx_t_1)) { @@ -4315,7 +4018,7 @@ static PyObject *__pyx_pf_8cityhash_6CityHash64WithSeeds(CYTHON_UNUSED PyObject * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * result = c_Hash64WithSeeds(buf.buf, buf.len, seed0, seed1) * PyBuffer_Release(&buf) - */ +*/ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 198, __pyx_L1_error) /* "cityhash.pyx":199 @@ -4324,7 +4027,7 @@ static PyObject *__pyx_pf_8cityhash_6CityHash64WithSeeds(CYTHON_UNUSED PyObject * result = c_Hash64WithSeeds(buf.buf, buf.len, seed0, seed1) # <<<<<<<<<<<<<< * PyBuffer_Release(&buf) * else: - */ +*/ __pyx_v_result = CityHash64WithSeeds(((char const *)__pyx_v_buf.buf), __pyx_v_buf.len, __pyx_v_seed0, __pyx_v_seed1); /* "cityhash.pyx":200 @@ -4333,7 +4036,7 @@ static PyObject *__pyx_pf_8cityhash_6CityHash64WithSeeds(CYTHON_UNUSED PyObject * PyBuffer_Release(&buf) # <<<<<<<<<<<<<< * else: * raise _type_error("data", ["basestring", "buffer"], data) - */ +*/ PyBuffer_Release((&__pyx_v_buf)); /* "cityhash.pyx":197 @@ -4342,7 +4045,7 @@ static PyObject *__pyx_pf_8cityhash_6CityHash64WithSeeds(CYTHON_UNUSED PyObject * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash64WithSeeds(buf.buf, buf.len, seed0, seed1) - */ +*/ goto __pyx_L3; } @@ -4352,17 +4055,17 @@ static PyObject *__pyx_pf_8cityhash_6CityHash64WithSeeds(CYTHON_UNUSED PyObject * raise _type_error("data", ["basestring", "buffer"], data) # <<<<<<<<<<<<<< * return result * - */ +*/ /*else*/ { __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_u_basestring); - __Pyx_GIVEREF(__pyx_n_u_basestring); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_basestring)) __PYX_ERR(0, 202, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_buffer); - __Pyx_GIVEREF(__pyx_n_u_buffer); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_u_buffer)) __PYX_ERR(0, 202, __pyx_L1_error); - __pyx_t_5 = __pyx_f_8cityhash__type_error(__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_basestring); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_basestring); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_n_u_basestring) != (0)) __PYX_ERR(0, 202, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_buffer); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_buffer); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_n_u_buffer) != (0)) __PYX_ERR(0, 202, __pyx_L1_error); + __pyx_t_5 = __pyx_f_8cityhash__type_error(__pyx_mstate_global->__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); @@ -4377,11 +4080,11 @@ static PyObject *__pyx_pf_8cityhash_6CityHash64WithSeeds(CYTHON_UNUSED PyObject * return result # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_From_uint64_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_uint64_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 203, __pyx_L1_error) + if (!(likely(PyLong_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 203, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; @@ -4392,7 +4095,7 @@ static PyObject *__pyx_pf_8cityhash_6CityHash64WithSeeds(CYTHON_UNUSED PyObject * def CityHash64WithSeeds(data, uint64 seed0=0LL, uint64 seed1=0LL) -> int: # <<<<<<<<<<<<<< * """Obtain a 64-bit hash using two seeds. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -4412,7 +4115,7 @@ static PyObject *__pyx_pf_8cityhash_6CityHash64WithSeeds(CYTHON_UNUSED PyObject * def CityHash128(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 128-bit hash from input data. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_8cityhash_9CityHash128(PyObject *__pyx_self, @@ -4422,8 +4125,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8cityhash_8CityHash128, "CityHash128(data) -> int\nObtain a 128-bit hash from input data.\n\n :param data: input data (string, bytes, or buffer object)\n :return: an integer representing a 128-bit hash of the input\n :raises TypeError: if data is not of one of input types\n :raises ValueError: if input buffer is not C-contiguous\n "); -static PyMethodDef __pyx_mdef_8cityhash_9CityHash128 = {"CityHash128", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cityhash_9CityHash128, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cityhash_8CityHash128}; +PyDoc_STRVAR(__pyx_doc_8cityhash_8CityHash128, "CityHash128(data) -> int\n\nObtain a 128-bit hash from input data.\n\n:param data: input data (string, bytes, or buffer object)\n:return: an integer representing a 128-bit hash of the input\n:raises TypeError: if data is not of one of input types\n:raises ValueError: if input buffer is not C-contiguous"); +static PyMethodDef __pyx_mdef_8cityhash_9CityHash128 = {"CityHash128", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cityhash_9CityHash128, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cityhash_8CityHash128}; static PyObject *__pyx_pw_8cityhash_9CityHash128(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4444,7 +4147,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("CityHash128 (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -4452,33 +4155,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 206, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 206, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "CityHash128") < 0)) __PYX_ERR(0, 206, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "CityHash128", 0) < 0) __PYX_ERR(0, 206, __pyx_L3_error) + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("CityHash128", 1, 1, 1, i); __PYX_ERR(0, 206, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 206, __pyx_L3_error) } __pyx_v_data = values[0]; } @@ -4488,11 +4186,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("cityhash.CityHash128", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4501,11 +4196,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_8cityhash_8CityHash128(__pyx_self, __pyx_v_data); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -4528,7 +4220,7 @@ static PyObject *__pyx_pf_8cityhash_8CityHash128(CYTHON_UNUSED PyObject *__pyx_s int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("CityHash128", 1); + __Pyx_RefNannySetupContext("CityHash128", 0); /* "cityhash.pyx":217 * cdef pair[uint64, uint64] result @@ -4536,7 +4228,7 @@ static PyObject *__pyx_pf_8cityhash_8CityHash128(CYTHON_UNUSED PyObject *__pyx_s * cdef Py_ssize_t encoding_size = 0 # <<<<<<<<<<<<<< * * if PyUnicode_Check(data): - */ +*/ __pyx_v_encoding_size = 0; /* "cityhash.pyx":219 @@ -4545,7 +4237,7 @@ static PyObject *__pyx_pf_8cityhash_8CityHash128(CYTHON_UNUSED PyObject *__pyx_s * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash128(encoding, encoding_size) - */ +*/ __pyx_t_1 = PyUnicode_Check(__pyx_v_data); if (__pyx_t_1) { @@ -4555,8 +4247,8 @@ static PyObject *__pyx_pf_8cityhash_8CityHash128(CYTHON_UNUSED PyObject *__pyx_s * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) # <<<<<<<<<<<<<< * result = c_Hash128(encoding, encoding_size) * elif PyBytes_Check(data): - */ - __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(0, 220, __pyx_L1_error) +*/ + __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)0))) __PYX_ERR(0, 220, __pyx_L1_error) __pyx_v_encoding = __pyx_t_2; /* "cityhash.pyx":221 @@ -4565,7 +4257,7 @@ static PyObject *__pyx_pf_8cityhash_8CityHash128(CYTHON_UNUSED PyObject *__pyx_s * result = c_Hash128(encoding, encoding_size) # <<<<<<<<<<<<<< * elif PyBytes_Check(data): * result = c_Hash128( - */ +*/ __pyx_v_result = CityHash128(__pyx_v_encoding, __pyx_v_encoding_size); /* "cityhash.pyx":219 @@ -4574,7 +4266,7 @@ static PyObject *__pyx_pf_8cityhash_8CityHash128(CYTHON_UNUSED PyObject *__pyx_s * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash128(encoding, encoding_size) - */ +*/ goto __pyx_L3; } @@ -4584,7 +4276,7 @@ static PyObject *__pyx_pf_8cityhash_8CityHash128(CYTHON_UNUSED PyObject *__pyx_s * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash128( * PyBytes_AS_STRING(data), - */ +*/ __pyx_t_1 = PyBytes_Check(__pyx_v_data); if (__pyx_t_1) { @@ -4594,7 +4286,7 @@ static PyObject *__pyx_pf_8cityhash_8CityHash128(CYTHON_UNUSED PyObject *__pyx_s * result = c_Hash128( # <<<<<<<<<<<<<< * PyBytes_AS_STRING(data), * PyBytes_GET_SIZE(data)) - */ +*/ __pyx_v_result = CityHash128(((char const *)PyBytes_AS_STRING(__pyx_v_data)), PyBytes_GET_SIZE(__pyx_v_data)); /* "cityhash.pyx":222 @@ -4603,7 +4295,7 @@ static PyObject *__pyx_pf_8cityhash_8CityHash128(CYTHON_UNUSED PyObject *__pyx_s * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash128( * PyBytes_AS_STRING(data), - */ +*/ goto __pyx_L3; } @@ -4613,7 +4305,7 @@ static PyObject *__pyx_pf_8cityhash_8CityHash128(CYTHON_UNUSED PyObject *__pyx_s * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash128(buf.buf, buf.len) - */ +*/ __pyx_t_1 = PyObject_CheckBuffer(__pyx_v_data); if (likely(__pyx_t_1)) { @@ -4623,7 +4315,7 @@ static PyObject *__pyx_pf_8cityhash_8CityHash128(CYTHON_UNUSED PyObject *__pyx_s * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * result = c_Hash128(buf.buf, buf.len) * PyBuffer_Release(&buf) - */ +*/ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 227, __pyx_L1_error) /* "cityhash.pyx":228 @@ -4632,7 +4324,7 @@ static PyObject *__pyx_pf_8cityhash_8CityHash128(CYTHON_UNUSED PyObject *__pyx_s * result = c_Hash128(buf.buf, buf.len) # <<<<<<<<<<<<<< * PyBuffer_Release(&buf) * else: - */ +*/ __pyx_v_result = CityHash128(((char const *)__pyx_v_buf.buf), __pyx_v_buf.len); /* "cityhash.pyx":229 @@ -4641,7 +4333,7 @@ static PyObject *__pyx_pf_8cityhash_8CityHash128(CYTHON_UNUSED PyObject *__pyx_s * PyBuffer_Release(&buf) # <<<<<<<<<<<<<< * else: * raise _type_error("data", ["basestring", "buffer"], data) - */ +*/ PyBuffer_Release((&__pyx_v_buf)); /* "cityhash.pyx":226 @@ -4650,7 +4342,7 @@ static PyObject *__pyx_pf_8cityhash_8CityHash128(CYTHON_UNUSED PyObject *__pyx_s * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash128(buf.buf, buf.len) - */ +*/ goto __pyx_L3; } @@ -4660,17 +4352,17 @@ static PyObject *__pyx_pf_8cityhash_8CityHash128(CYTHON_UNUSED PyObject *__pyx_s * raise _type_error("data", ["basestring", "buffer"], data) # <<<<<<<<<<<<<< * first = PyLong_FromUnsignedLongLong(result.first) * second = PyLong_FromUnsignedLongLong(result.second) - */ +*/ /*else*/ { __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_u_basestring); - __Pyx_GIVEREF(__pyx_n_u_basestring); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_basestring)) __PYX_ERR(0, 231, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_buffer); - __Pyx_GIVEREF(__pyx_n_u_buffer); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_u_buffer)) __PYX_ERR(0, 231, __pyx_L1_error); - __pyx_t_5 = __pyx_f_8cityhash__type_error(__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_basestring); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_basestring); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_n_u_basestring) != (0)) __PYX_ERR(0, 231, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_buffer); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_buffer); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_n_u_buffer) != (0)) __PYX_ERR(0, 231, __pyx_L1_error); + __pyx_t_5 = __pyx_f_8cityhash__type_error(__pyx_mstate_global->__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); @@ -4685,7 +4377,7 @@ static PyObject *__pyx_pf_8cityhash_8CityHash128(CYTHON_UNUSED PyObject *__pyx_s * first = PyLong_FromUnsignedLongLong(result.first) # <<<<<<<<<<<<<< * second = PyLong_FromUnsignedLongLong(result.second) * return (first << 64ULL) + second - */ +*/ __pyx_t_5 = PyLong_FromUnsignedLongLong(__pyx_v_result.first); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_t_5; @@ -4700,7 +4392,7 @@ static PyObject *__pyx_pf_8cityhash_8CityHash128(CYTHON_UNUSED PyObject *__pyx_s * second = PyLong_FromUnsignedLongLong(result.second) # <<<<<<<<<<<<<< * return (first << 64ULL) + second * - */ +*/ __pyx_t_4 = PyLong_FromUnsignedLongLong(__pyx_v_result.second); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_t_4; @@ -4715,14 +4407,14 @@ static PyObject *__pyx_pf_8cityhash_8CityHash128(CYTHON_UNUSED PyObject *__pyx_s * return (first << 64ULL) + second # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyNumber_Lshift(__pyx_v_first, __pyx_int_64L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_5 = PyNumber_Lshift(__pyx_v_first, __pyx_mstate_global->__pyx_int_64L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_v_second); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_4))) __PYX_ERR(0, 234, __pyx_L1_error) + if (!(likely(PyLong_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_4))) __PYX_ERR(0, 234, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; @@ -4733,7 +4425,7 @@ static PyObject *__pyx_pf_8cityhash_8CityHash128(CYTHON_UNUSED PyObject *__pyx_s * def CityHash128(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 128-bit hash from input data. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -4755,7 +4447,7 @@ static PyObject *__pyx_pf_8cityhash_8CityHash128(CYTHON_UNUSED PyObject *__pyx_s * def CityHash128WithSeed(data, seed: int = 0L) -> int: # <<<<<<<<<<<<<< * """Obtain a 128-bit hash using a seed. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_8cityhash_11CityHash128WithSeed(PyObject *__pyx_self, @@ -4765,8 +4457,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8cityhash_10CityHash128WithSeed, "CityHash128WithSeed(data, int seed: int = 0) -> int\nObtain a 128-bit hash using a seed.\n\n :param data: input data (string, bytes, or buffer object)\n :param seed: seed value (defaults to 0)\n :return: an integer representing a 128-bit hash of the input\n :raises TypeError: if data is not of one of input types\n :raises ValueError: if input buffer is not C-contiguous\n "); -static PyMethodDef __pyx_mdef_8cityhash_11CityHash128WithSeed = {"CityHash128WithSeed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cityhash_11CityHash128WithSeed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cityhash_10CityHash128WithSeed}; +PyDoc_STRVAR(__pyx_doc_8cityhash_10CityHash128WithSeed, "CityHash128WithSeed(data, int seed: int = 0) -> int\n\nObtain a 128-bit hash using a seed.\n\n:param data: input data (string, bytes, or buffer object)\n:param seed: seed value (defaults to 0)\n:return: an integer representing a 128-bit hash of the input\n:raises TypeError: if data is not of one of input types\n:raises ValueError: if input buffer is not C-contiguous"); +static PyMethodDef __pyx_mdef_8cityhash_11CityHash128WithSeed = {"CityHash128WithSeed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8cityhash_11CityHash128WithSeed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8cityhash_10CityHash128WithSeed}; static PyObject *__pyx_pw_8cityhash_11CityHash128WithSeed(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4788,7 +4480,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("CityHash128WithSeed (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -4796,47 +4488,41 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_seed,0}; - values[1] = __Pyx_Arg_NewRef_FASTCALL(__pyx_k_); - if (__pyx_kwds) { - Py_ssize_t kw_args; + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,&__pyx_mstate_global->__pyx_n_u_seed,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 237, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 237, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 237, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_seed); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 237, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "CityHash128WithSeed") < 0)) __PYX_ERR(0, 237, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "CityHash128WithSeed", 0) < 0) __PYX_ERR(0, 237, __pyx_L3_error) + if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_int_0L)); + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("CityHash128WithSeed", 0, 1, 2, i); __PYX_ERR(0, 237, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 237, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 237, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } + if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_int_0L)); } __pyx_v_data = values[0]; __pyx_v_seed = ((PyObject*)values[1]); @@ -4847,30 +4533,29 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("cityhash.CityHash128WithSeed", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_seed), (&PyInt_Type), 0, "seed", 1))) __PYX_ERR(0, 237, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_seed), (&PyLong_Type), 0, "seed", 2))) __PYX_ERR(0, 237, __pyx_L1_error) __pyx_r = __pyx_pf_8cityhash_10CityHash128WithSeed(__pyx_self, __pyx_v_data, __pyx_v_seed); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + goto __pyx_L7_cleaned_up; __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } + __pyx_L7_cleaned_up:; __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -4894,7 +4579,7 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("CityHash128WithSeed", 1); + __Pyx_RefNannySetupContext("CityHash128WithSeed", 0); /* "cityhash.pyx":250 * cdef pair[uint64, uint64] tseed @@ -4902,7 +4587,7 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject * cdef Py_ssize_t encoding_size = 0 # <<<<<<<<<<<<<< * * tseed.first = seed >> 64ULL - */ +*/ __pyx_v_encoding_size = 0; /* "cityhash.pyx":252 @@ -4911,10 +4596,10 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject * tseed.first = seed >> 64ULL # <<<<<<<<<<<<<< * tseed.second = seed & ((1ULL << 64ULL) - 1ULL) * - */ - __pyx_t_1 = PyNumber_Rshift(__pyx_v_seed, __pyx_int_64L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) +*/ + __pyx_t_1 = PyNumber_Rshift(__pyx_v_seed, __pyx_mstate_global->__pyx_int_64L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tseed.first = __pyx_t_2; @@ -4924,10 +4609,10 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject * tseed.second = seed & ((1ULL << 64ULL) - 1ULL) # <<<<<<<<<<<<<< * * if PyUnicode_Check(data): - */ - __pyx_t_1 = PyNumber_And(__pyx_v_seed, __pyx_int_0xffffffffffffffffL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) +*/ + __pyx_t_1 = PyNumber_And(__pyx_v_seed, __pyx_mstate_global->__pyx_int_0xffffffffffffffffL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tseed.second = __pyx_t_2; @@ -4937,7 +4622,7 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash128WithSeed(encoding, encoding_size, tseed) - */ +*/ __pyx_t_3 = PyUnicode_Check(__pyx_v_data); if (__pyx_t_3) { @@ -4947,8 +4632,8 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) # <<<<<<<<<<<<<< * result = c_Hash128WithSeed(encoding, encoding_size, tseed) * elif PyBytes_Check(data): - */ - __pyx_t_4 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(0, 256, __pyx_L1_error) +*/ + __pyx_t_4 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_4 == ((char const *)0))) __PYX_ERR(0, 256, __pyx_L1_error) __pyx_v_encoding = __pyx_t_4; /* "cityhash.pyx":257 @@ -4957,7 +4642,7 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject * result = c_Hash128WithSeed(encoding, encoding_size, tseed) # <<<<<<<<<<<<<< * elif PyBytes_Check(data): * result = c_Hash128WithSeed( - */ +*/ __pyx_v_result = CityHash128WithSeed(__pyx_v_encoding, __pyx_v_encoding_size, __pyx_v_tseed); /* "cityhash.pyx":255 @@ -4966,7 +4651,7 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash128WithSeed(encoding, encoding_size, tseed) - */ +*/ goto __pyx_L3; } @@ -4976,7 +4661,7 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash128WithSeed( * PyBytes_AS_STRING(data), - */ +*/ __pyx_t_3 = PyBytes_Check(__pyx_v_data); if (__pyx_t_3) { @@ -4986,7 +4671,7 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject * result = c_Hash128WithSeed( # <<<<<<<<<<<<<< * PyBytes_AS_STRING(data), * PyBytes_GET_SIZE(data), tseed) - */ +*/ __pyx_v_result = CityHash128WithSeed(((char const *)PyBytes_AS_STRING(__pyx_v_data)), PyBytes_GET_SIZE(__pyx_v_data), __pyx_v_tseed); /* "cityhash.pyx":258 @@ -4995,7 +4680,7 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash128WithSeed( * PyBytes_AS_STRING(data), - */ +*/ goto __pyx_L3; } @@ -5005,7 +4690,7 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash128WithSeed(buf.buf, buf.len, tseed) - */ +*/ __pyx_t_3 = PyObject_CheckBuffer(__pyx_v_data); if (likely(__pyx_t_3)) { @@ -5015,7 +4700,7 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * result = c_Hash128WithSeed(buf.buf, buf.len, tseed) * PyBuffer_Release(&buf) - */ +*/ __pyx_t_5 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 263, __pyx_L1_error) /* "cityhash.pyx":264 @@ -5024,7 +4709,7 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject * result = c_Hash128WithSeed(buf.buf, buf.len, tseed) # <<<<<<<<<<<<<< * PyBuffer_Release(&buf) * else: - */ +*/ __pyx_v_result = CityHash128WithSeed(((char const *)__pyx_v_buf.buf), __pyx_v_buf.len, __pyx_v_tseed); /* "cityhash.pyx":265 @@ -5033,7 +4718,7 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject * PyBuffer_Release(&buf) # <<<<<<<<<<<<<< * else: * raise _type_error("data", ["basestring", "buffer"], data) - */ +*/ PyBuffer_Release((&__pyx_v_buf)); /* "cityhash.pyx":262 @@ -5042,7 +4727,7 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash128WithSeed(buf.buf, buf.len, tseed) - */ +*/ goto __pyx_L3; } @@ -5052,17 +4737,17 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject * raise _type_error("data", ["basestring", "buffer"], data) # <<<<<<<<<<<<<< * first = PyLong_FromUnsignedLongLong(result.first) * second = PyLong_FromUnsignedLongLong(result.second) - */ +*/ /*else*/ { __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_n_u_basestring); - __Pyx_GIVEREF(__pyx_n_u_basestring); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_basestring)) __PYX_ERR(0, 267, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_buffer); - __Pyx_GIVEREF(__pyx_n_u_buffer); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_buffer)) __PYX_ERR(0, 267, __pyx_L1_error); - __pyx_t_6 = __pyx_f_8cityhash__type_error(__pyx_n_u_data, __pyx_t_1, __pyx_v_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_basestring); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_basestring); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_n_u_basestring) != (0)) __PYX_ERR(0, 267, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_buffer); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_buffer); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_n_u_buffer) != (0)) __PYX_ERR(0, 267, __pyx_L1_error); + __pyx_t_6 = __pyx_f_8cityhash__type_error(__pyx_mstate_global->__pyx_n_u_data, __pyx_t_1, __pyx_v_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); @@ -5077,7 +4762,7 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject * first = PyLong_FromUnsignedLongLong(result.first) # <<<<<<<<<<<<<< * second = PyLong_FromUnsignedLongLong(result.second) * return (first << 64ULL) + second - */ +*/ __pyx_t_6 = PyLong_FromUnsignedLongLong(__pyx_v_result.first); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __pyx_t_6; @@ -5091,7 +4776,7 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject * first = PyLong_FromUnsignedLongLong(result.first) * second = PyLong_FromUnsignedLongLong(result.second) # <<<<<<<<<<<<<< * return (first << 64ULL) + second - */ +*/ __pyx_t_1 = PyLong_FromUnsignedLongLong(__pyx_v_result.second); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __pyx_t_1; @@ -5104,14 +4789,14 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject * first = PyLong_FromUnsignedLongLong(result.first) * second = PyLong_FromUnsignedLongLong(result.second) * return (first << 64ULL) + second # <<<<<<<<<<<<<< - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = PyNumber_Lshift(__pyx_v_first, __pyx_int_64L); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_6 = PyNumber_Lshift(__pyx_v_first, __pyx_mstate_global->__pyx_int_64L); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_v_second); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_1))) __PYX_ERR(0, 270, __pyx_L1_error) + if (!(likely(PyLong_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_1))) __PYX_ERR(0, 270, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; @@ -5122,7 +4807,7 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject * def CityHash128WithSeed(data, seed: int = 0L) -> int: # <<<<<<<<<<<<<< * """Obtain a 128-bit hash using a seed. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -5137,219 +4822,65 @@ static PyObject *__pyx_pf_8cityhash_10CityHash128WithSeed(CYTHON_UNUSED PyObject __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* #### Code section: module_exttypes ### */ static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; -#ifndef CYTHON_SMALL_CODE -#if defined(__clang__) - #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) -#else - #define CYTHON_SMALL_CODE -#endif -#endif -/* #### Code section: pystring_table ### */ +/* #### Code section: initfunc_declarations ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/ +/* #### Code section: init_module ### */ -static int __Pyx_CreateStringTabAndInitStrings(void) { - __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_u_0_4_9, __pyx_k_0_4_9, sizeof(__pyx_k_0_4_9), 0, 1, 0, 0}, - {&__pyx_kp_u_Argument, __pyx_k_Argument, sizeof(__pyx_k_Argument), 0, 1, 0, 0}, - {&__pyx_n_s_CityHash128, __pyx_k_CityHash128, sizeof(__pyx_k_CityHash128), 0, 0, 1, 1}, - {&__pyx_n_u_CityHash128, __pyx_k_CityHash128, sizeof(__pyx_k_CityHash128), 0, 1, 0, 1}, - {&__pyx_n_s_CityHash128WithSeed, __pyx_k_CityHash128WithSeed, sizeof(__pyx_k_CityHash128WithSeed), 0, 0, 1, 1}, - {&__pyx_n_u_CityHash128WithSeed, __pyx_k_CityHash128WithSeed, sizeof(__pyx_k_CityHash128WithSeed), 0, 1, 0, 1}, - {&__pyx_n_s_CityHash32, __pyx_k_CityHash32, sizeof(__pyx_k_CityHash32), 0, 0, 1, 1}, - {&__pyx_n_u_CityHash32, __pyx_k_CityHash32, sizeof(__pyx_k_CityHash32), 0, 1, 0, 1}, - {&__pyx_n_s_CityHash64, __pyx_k_CityHash64, sizeof(__pyx_k_CityHash64), 0, 0, 1, 1}, - {&__pyx_n_u_CityHash64, __pyx_k_CityHash64, sizeof(__pyx_k_CityHash64), 0, 1, 0, 1}, - {&__pyx_n_s_CityHash64WithSeed, __pyx_k_CityHash64WithSeed, sizeof(__pyx_k_CityHash64WithSeed), 0, 0, 1, 1}, - {&__pyx_n_u_CityHash64WithSeed, __pyx_k_CityHash64WithSeed, sizeof(__pyx_k_CityHash64WithSeed), 0, 1, 0, 1}, - {&__pyx_n_s_CityHash64WithSeeds, __pyx_k_CityHash64WithSeeds, sizeof(__pyx_k_CityHash64WithSeeds), 0, 0, 1, 1}, - {&__pyx_n_u_CityHash64WithSeeds, __pyx_k_CityHash64WithSeeds, sizeof(__pyx_k_CityHash64WithSeeds), 0, 1, 0, 1}, - {&__pyx_kp_u_Eugene_Scherba, __pyx_k_Eugene_Scherba, sizeof(__pyx_k_Eugene_Scherba), 0, 1, 0, 0}, - {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, - {&__pyx_n_s__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 0, 1, 1}, - {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, - {&__pyx_n_s_author, __pyx_k_author, sizeof(__pyx_k_author), 0, 0, 1, 1}, - {&__pyx_n_u_basestring, __pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 1, 0, 1}, - {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1}, - {&__pyx_n_u_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 1, 0, 1}, - {&__pyx_n_s_cityhash, __pyx_k_cityhash, sizeof(__pyx_k_cityhash), 0, 0, 1, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, - {&__pyx_n_u_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 1, 0, 1}, - {&__pyx_n_s_email, __pyx_k_email, sizeof(__pyx_k_email), 0, 0, 1, 1}, - {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, - {&__pyx_n_s_encoding_size, __pyx_k_encoding_size, sizeof(__pyx_k_encoding_size), 0, 0, 1, 1}, - {&__pyx_kp_u_escherba_cityhash_gmail_com, __pyx_k_escherba_cityhash_gmail_com, sizeof(__pyx_k_escherba_cityhash_gmail_com), 0, 1, 0, 0}, - {&__pyx_n_s_first, __pyx_k_first, sizeof(__pyx_k_first), 0, 0, 1, 1}, - {&__pyx_kp_u_got, __pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0, 0}, - {&__pyx_kp_u_has_incorrect_type_expected, __pyx_k_has_incorrect_type_expected, sizeof(__pyx_k_has_incorrect_type_expected), 0, 1, 0, 0}, - {&__pyx_kp_u_instead, __pyx_k_instead, sizeof(__pyx_k_instead), 0, 1, 0, 0}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, - {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1}, - {&__pyx_n_s_seed, __pyx_k_seed, sizeof(__pyx_k_seed), 0, 0, 1, 1}, - {&__pyx_n_s_seed0, __pyx_k_seed0, sizeof(__pyx_k_seed0), 0, 0, 1, 1}, - {&__pyx_n_s_seed1, __pyx_k_seed1, sizeof(__pyx_k_seed1), 0, 0, 1, 1}, - {&__pyx_kp_s_src_cityhash_pyx, __pyx_k_src_cityhash_pyx, sizeof(__pyx_k_src_cityhash_pyx), 0, 0, 1, 0}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_tseed, __pyx_k_tseed, sizeof(__pyx_k_tseed), 0, 0, 1, 1}, - {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} - }; - return __Pyx_InitStrings(__pyx_string_tab); -} -/* #### Code section: cached_builtins ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 80, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: cached_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "cityhash.pyx":86 - * - * - * def CityHash32(data) -> int: # <<<<<<<<<<<<<< - * """Obtain a 32-bit hash from input data. - * - */ - __pyx_tuple__2 = PyTuple_Pack(5, __pyx_n_s_data, __pyx_n_s_buf, __pyx_n_s_result, __pyx_n_s_encoding, __pyx_n_s_encoding_size); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 86, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); - __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cityhash_pyx, __pyx_n_s_CityHash32, 86, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 86, __pyx_L1_error) - - /* "cityhash.pyx":115 - * - * - * def CityHash64(data) -> int: # <<<<<<<<<<<<<< - * """Obtain a 64-bit hash from input data. - * - */ - __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cityhash_pyx, __pyx_n_s_CityHash64, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 115, __pyx_L1_error) - - /* "cityhash.pyx":144 - * - * - * def CityHash64WithSeed(data, uint64 seed=0ULL) -> int: # <<<<<<<<<<<<<< - * """Obtain a 64-bit hash using a seed. - * - */ - __pyx_tuple__5 = PyTuple_Pack(6, __pyx_n_s_data, __pyx_n_s_seed, __pyx_n_s_buf, __pyx_n_s_result, __pyx_n_s_encoding, __pyx_n_s_encoding_size); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cityhash_pyx, __pyx_n_s_CityHash64WithSeed, 144, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 144, __pyx_L1_error) - - /* "cityhash.pyx":175 - * - * - * def CityHash64WithSeeds(data, uint64 seed0=0LL, uint64 seed1=0LL) -> int: # <<<<<<<<<<<<<< - * """Obtain a 64-bit hash using two seeds. - * - */ - __pyx_tuple__7 = PyTuple_Pack(7, __pyx_n_s_data, __pyx_n_s_seed0, __pyx_n_s_seed1, __pyx_n_s_buf, __pyx_n_s_result, __pyx_n_s_encoding, __pyx_n_s_encoding_size); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 175, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__7); - __Pyx_GIVEREF(__pyx_tuple__7); - __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cityhash_pyx, __pyx_n_s_CityHash64WithSeeds, 175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 175, __pyx_L1_error) - - /* "cityhash.pyx":206 - * - * - * def CityHash128(data) -> int: # <<<<<<<<<<<<<< - * """Obtain a 128-bit hash from input data. - * - */ - __pyx_tuple__9 = PyTuple_Pack(7, __pyx_n_s_data, __pyx_n_s_buf, __pyx_n_s_result, __pyx_n_s_encoding, __pyx_n_s_encoding_size, __pyx_n_s_first, __pyx_n_s_second); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__9); - __Pyx_GIVEREF(__pyx_tuple__9); - __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cityhash_pyx, __pyx_n_s_CityHash128, 206, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 206, __pyx_L1_error) - - /* "cityhash.pyx":237 - * - * - * def CityHash128WithSeed(data, seed: int = 0L) -> int: # <<<<<<<<<<<<<< - * """Obtain a 128-bit hash using a seed. - * - */ - __pyx_tuple__11 = PyTuple_Pack(9, __pyx_n_s_data, __pyx_n_s_seed, __pyx_n_s_buf, __pyx_n_s_result, __pyx_n_s_tseed, __pyx_n_s_encoding, __pyx_n_s_encoding_size, __pyx_n_s_first, __pyx_n_s_second); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__11); - __Pyx_GIVEREF(__pyx_tuple__11); - __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cityhash_pyx, __pyx_n_s_CityHash128WithSeed, 237, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} -/* #### Code section: init_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { - if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_int_0L = PyLong_FromString((char *)"0", 0, 0); if (unlikely(!__pyx_int_0L)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_64L = PyLong_FromString((char *)"64", 0, 0); if (unlikely(!__pyx_int_64L)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_0xffffffffffffffffL = PyLong_FromString((char *)"0xffffffffffffffff", 0, 0); if (unlikely(!__pyx_int_0xffffffffffffffffL)) __PYX_ERR(0, 1, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_globals ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - return 0; -} -/* #### Code section: init_module ### */ - -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ - -static int __Pyx_modinit_global_init_code(void) { +static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_variable_export_code(void) { +static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_function_export_code(void) { +static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_type_init_code(void) { +static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_type_import_code(void) { +static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; @@ -5358,23 +4889,39 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_1_4(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyTypeObject), + 0, 0, #else - sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyHeapTypeObject), + sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(PyHeapTypeObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_1_4); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyBoolObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(3, 8, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_1_4(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(PyLongObject), + #elif CYTHON_COMPILING_IN_LIMITED_API + 0, 0, + #else + sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(PyLongObject), + #endif + __Pyx_ImportType_CheckSize_Warn_3_1_4); if (!__pyx_mstate->__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(3, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 15, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyComplexObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(4, 15, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_1_4(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(PyComplexObject), + #elif CYTHON_COMPILING_IN_LIMITED_API + 0, 0, + #else + sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(PyComplexObject), + #endif + __Pyx_ImportType_CheckSize_Warn_3_1_4); if (!__pyx_mstate->__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(4, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -5384,30 +4931,36 @@ static int __Pyx_modinit_type_import_code(void) { return -1; } -static int __Pyx_modinit_variable_import_code(void) { +static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_function_import_code(void) { +static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } - -#if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_cityhash(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_cityhash}, + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + {Py_mod_gil, Py_MOD_GIL_USED}, + #endif + #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE + {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED}, + #endif {0, NULL} }; #endif @@ -5422,12 +4975,10 @@ namespace { PyModuleDef_HEAD_INIT, "cityhash", __pyx_k_Python_wrapper_for_CityHash, /* m_doc */ - #if CYTHON_PEP489_MULTI_PHASE_INIT - 0, /* m_size */ - #elif CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstate), /* m_size */ + #if CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstatetype), /* m_size */ #else - -1, /* m_size */ + (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT @@ -5448,51 +4999,71 @@ namespace { #ifdef __cplusplus } /* anonymous namespace */ #endif -#endif +/* PyModInitFuncType */ #ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#elif PY_MAJOR_VERSION < 3 -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" void -#else -#define __Pyx_PyMODINIT_FUNC void -#endif -#else -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * + #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #else -#define __Pyx_PyMODINIT_FUNC PyObject * -#endif + #ifdef __cplusplus + #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * + #else + #define __Pyx_PyMODINIT_FUNC PyObject * + #endif #endif - -#if PY_MAJOR_VERSION < 3 -__Pyx_PyMODINIT_FUNC initcityhash(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC initcityhash(void) -#else __Pyx_PyMODINIT_FUNC PyInit_cityhash(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_cityhash(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } +/* ModuleCreationPEP489 */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 +static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { + { + PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think + if (!module) { + PyErr_Clear(); // just try the 3.8-3.12 version + module = PyImport_ImportModule("_xxsubinterpreters"); + if (!module) goto bad; + } + PyObject *current = PyObject_CallMethod(module, "get_current", NULL); + Py_DECREF(module); + if (!current) goto bad; + if (PyTuple_Check(current)) { + PyObject *new_current = PySequence_GetItem(current, 0); + Py_DECREF(current); + current = new_current; + if (!new_current) goto bad; + } + long long as_c_int = PyLong_AsLongLong(current); + Py_DECREF(current); + return as_c_int; + } + bad: + PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n"); + return -1; +} +#endif +#if !CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; +#if CYTHON_COMPILING_IN_GRAAL + PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); +#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x03090000 + PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get()); +#elif CYTHON_COMPILING_IN_LIMITED_API + PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId(); +#else PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); +#endif + if (unlikely(current_id == -1)) { + return -1; + } if (main_interpreter_id == -1) { main_interpreter_id = current_id; - return (unlikely(current_id == -1)) ? -1 : 0; - } else if (unlikely(main_interpreter_id != current_id)) - #else - static PyInterpreterState *main_interpreter = NULL; - PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; - if (!main_interpreter) { - main_interpreter = current_interpreter; - } else if (unlikely(main_interpreter != current_interpreter)) - #endif - { + return 0; + } else if (unlikely(main_interpreter_id != current_id)) { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); @@ -5500,21 +5071,14 @@ static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { } return 0; } -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) -#else -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { -#if CYTHON_COMPILING_IN_LIMITED_API - result = PyModule_AddObject(module, to_name, value); -#else result = PyDict_SetItemString(moddict, to_name, value); -#endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { @@ -5527,8 +5091,10 @@ static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); + #if !CYTHON_USE_MODULE_STATE if (__Pyx_check_single_interpreter()) return NULL; + #endif if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); @@ -5536,12 +5102,8 @@ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDe module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; -#if CYTHON_COMPILING_IN_LIMITED_API - moddict = module; -#else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; -#endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; @@ -5555,12 +5117,12 @@ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDe static CYTHON_SMALL_CODE int __pyx_pymod_exec_cityhash(PyObject *__pyx_pyinit_module) #endif -#endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif + __pyx_mstatetype *__pyx_mstate = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; @@ -5573,36 +5135,37 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_cityhash(PyObject *__pyx_pyinit_mo PyErr_SetString(PyExc_RuntimeError, "Module 'cityhash' has already been imported. Re-initialisation is not supported."); return -1; } - #elif PY_MAJOR_VERSION >= 3 + #else if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_m = __pyx_pyinit_module; - Py_INCREF(__pyx_m); + __pyx_t_1 = __pyx_pyinit_module; + Py_INCREF(__pyx_t_1); #else - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("cityhash", __pyx_methods, __pyx_k_Python_wrapper_for_CityHash, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #if CYTHON_USE_MODULE_STATE { - int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "cityhash" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_m = __pyx_t_1; #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED); #endif + __pyx_mstate = __pyx_mstate_global; CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_mstate->__pyx_d); + __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /* ImportRefnannyAPI */ #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { @@ -5612,14 +5175,22 @@ if (!__Pyx_RefNanny) { Py_FatalError("failed to import 'refnanny' module"); } #endif - __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_cityhash(void)", 0); + +__Pyx_RefNannySetupContext("PyInit_cityhash", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + stringtab_initialized = 1; + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if 0 || defined(__Pyx_CyFunction_USED) || defined(__Pyx_FusedFunction_USED) || defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED) || defined(__Pyx_AsyncGen_USED) + if (__pyx_CommonTypesMetaclass_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif @@ -5635,104 +5206,68 @@ if (!__Pyx_RefNanny) { #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - PyEval_InitThreads(); - #endif - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - stringtab_initialized = 1; - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif if (__pyx_module_is_main_cityhash) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } - #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "cityhash")) { if (unlikely((PyDict_SetItemString(modules, "cityhash", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } - #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_CreateCodeObjects(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ - (void)__Pyx_modinit_global_init_code(); - (void)__Pyx_modinit_variable_export_code(); - (void)__Pyx_modinit_function_export_code(); - (void)__Pyx_modinit_type_init_code(); - if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - (void)__Pyx_modinit_variable_import_code(); - (void)__Pyx_modinit_function_import_code(); + (void)__Pyx_modinit_global_init_code(__pyx_mstate); + (void)__Pyx_modinit_variable_export_code(__pyx_mstate); + (void)__Pyx_modinit_function_export_code(__pyx_mstate); + (void)__Pyx_modinit_type_init_code(__pyx_mstate); + if (unlikely((__Pyx_modinit_type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_variable_import_code(__pyx_mstate); + (void)__Pyx_modinit_function_import_code(__pyx_mstate); /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /* "cityhash.pyx":11 * """ * * __author__ = "Eugene Scherba" # <<<<<<<<<<<<<< * __email__ = "escherba+cityhash@gmail.com" - * __version__ = '0.4.9' - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_u_Eugene_Scherba) < 0) __PYX_ERR(0, 11, __pyx_L1_error) + * __version__ = '0.4.10' +*/ + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_author, __pyx_mstate_global->__pyx_kp_u_Eugene_Scherba) < 0) __PYX_ERR(0, 11, __pyx_L1_error) /* "cityhash.pyx":12 * * __author__ = "Eugene Scherba" * __email__ = "escherba+cityhash@gmail.com" # <<<<<<<<<<<<<< - * __version__ = '0.4.9' + * __version__ = '0.4.10' * __all__ = [ - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_email, __pyx_kp_u_escherba_cityhash_gmail_com) < 0) __PYX_ERR(0, 12, __pyx_L1_error) +*/ + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_email, __pyx_mstate_global->__pyx_kp_u_escherba_cityhash_gmail_com) < 0) __PYX_ERR(0, 12, __pyx_L1_error) /* "cityhash.pyx":13 * __author__ = "Eugene Scherba" * __email__ = "escherba+cityhash@gmail.com" - * __version__ = '0.4.9' # <<<<<<<<<<<<<< + * __version__ = '0.4.10' # <<<<<<<<<<<<<< * __all__ = [ * "CityHash32", - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_u_0_4_9) < 0) __PYX_ERR(0, 13, __pyx_L1_error) +*/ + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_version, __pyx_mstate_global->__pyx_kp_u_0_4_10) < 0) __PYX_ERR(0, 13, __pyx_L1_error) /* "cityhash.pyx":14 * __email__ = "escherba+cityhash@gmail.com" - * __version__ = '0.4.9' + * __version__ = '0.4.10' * __all__ = [ # <<<<<<<<<<<<<< * "CityHash32", * "CityHash64", - */ - __pyx_t_2 = PyList_New(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyList_Pack(6, __pyx_mstate_global->__pyx_n_u_CityHash32, __pyx_mstate_global->__pyx_n_u_CityHash64, __pyx_mstate_global->__pyx_n_u_CityHash64WithSeed, __pyx_mstate_global->__pyx_n_u_CityHash64WithSeeds, __pyx_mstate_global->__pyx_n_u_CityHash128, __pyx_mstate_global->__pyx_n_u_CityHash128WithSeed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_u_CityHash32); - __Pyx_GIVEREF(__pyx_n_u_CityHash32); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_CityHash32)) __PYX_ERR(0, 14, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_CityHash64); - __Pyx_GIVEREF(__pyx_n_u_CityHash64); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_u_CityHash64)) __PYX_ERR(0, 14, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_CityHash64WithSeed); - __Pyx_GIVEREF(__pyx_n_u_CityHash64WithSeed); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_u_CityHash64WithSeed)) __PYX_ERR(0, 14, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_CityHash64WithSeeds); - __Pyx_GIVEREF(__pyx_n_u_CityHash64WithSeeds); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_u_CityHash64WithSeeds)) __PYX_ERR(0, 14, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_CityHash128); - __Pyx_GIVEREF(__pyx_n_u_CityHash128); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_u_CityHash128)) __PYX_ERR(0, 14, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_CityHash128WithSeed); - __Pyx_GIVEREF(__pyx_n_u_CityHash128WithSeed); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_u_CityHash128WithSeed)) __PYX_ERR(0, 14, __pyx_L1_error); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_all, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cityhash.pyx":86 @@ -5741,10 +5276,10 @@ if (!__Pyx_RefNanny) { * def CityHash32(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 32-bit hash from input data. * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8cityhash_1CityHash32, NULL, __pyx_n_s_cityhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) +*/ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8cityhash_1CityHash32, NULL, __pyx_mstate_global->__pyx_n_u_cityhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CityHash32, __pyx_t_2) < 0) __PYX_ERR(0, 86, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CityHash32, __pyx_t_2) < 0) __PYX_ERR(0, 86, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cityhash.pyx":115 @@ -5753,10 +5288,10 @@ if (!__Pyx_RefNanny) { * def CityHash64(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 64-bit hash from input data. * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8cityhash_3CityHash64, NULL, __pyx_n_s_cityhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) +*/ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8cityhash_3CityHash64, NULL, __pyx_mstate_global->__pyx_n_u_cityhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CityHash64, __pyx_t_2) < 0) __PYX_ERR(0, 115, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CityHash64, __pyx_t_2) < 0) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cityhash.pyx":144 @@ -5765,10 +5300,10 @@ if (!__Pyx_RefNanny) { * def CityHash64WithSeed(data, uint64 seed=0ULL) -> int: # <<<<<<<<<<<<<< * """Obtain a 64-bit hash using a seed. * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8cityhash_5CityHash64WithSeed, NULL, __pyx_n_s_cityhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) +*/ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8cityhash_5CityHash64WithSeed, NULL, __pyx_mstate_global->__pyx_n_u_cityhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CityHash64WithSeed, __pyx_t_2) < 0) __PYX_ERR(0, 144, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CityHash64WithSeed, __pyx_t_2) < 0) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cityhash.pyx":175 @@ -5777,10 +5312,10 @@ if (!__Pyx_RefNanny) { * def CityHash64WithSeeds(data, uint64 seed0=0LL, uint64 seed1=0LL) -> int: # <<<<<<<<<<<<<< * """Obtain a 64-bit hash using two seeds. * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8cityhash_7CityHash64WithSeeds, NULL, __pyx_n_s_cityhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error) +*/ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8cityhash_7CityHash64WithSeeds, NULL, __pyx_mstate_global->__pyx_n_u_cityhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CityHash64WithSeeds, __pyx_t_2) < 0) __PYX_ERR(0, 175, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CityHash64WithSeeds, __pyx_t_2) < 0) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cityhash.pyx":206 @@ -5789,10 +5324,10 @@ if (!__Pyx_RefNanny) { * def CityHash128(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 128-bit hash from input data. * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8cityhash_9CityHash128, NULL, __pyx_n_s_cityhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error) +*/ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8cityhash_9CityHash128, NULL, __pyx_mstate_global->__pyx_n_u_cityhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CityHash128, __pyx_t_2) < 0) __PYX_ERR(0, 206, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CityHash128, __pyx_t_2) < 0) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cityhash.pyx":237 @@ -5801,24 +5336,20 @@ if (!__Pyx_RefNanny) { * def CityHash128WithSeed(data, seed: int = 0L) -> int: # <<<<<<<<<<<<<< * """Obtain a 128-bit hash using a seed. * - */ - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_0L)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_0L))) __PYX_ERR(0, 237, __pyx_L1_error) - __Pyx_INCREF(__pyx_int_0L); - __pyx_k_ = ((PyObject*)__pyx_int_0L); - __Pyx_GIVEREF(__pyx_int_0L); - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8cityhash_11CityHash128WithSeed, NULL, __pyx_n_s_cityhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) +*/ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8cityhash_11CityHash128WithSeed, NULL, __pyx_mstate_global->__pyx_n_u_cityhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CityHash128WithSeed, __pyx_t_2) < 0) __PYX_ERR(0, 237, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CityHash128WithSeed, __pyx_t_2) < 0) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cityhash.pyx":1 * #cython: infer_types=True # <<<<<<<<<<<<<< * #cython: embedsignature=True * #cython: binding=False - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ @@ -5827,7 +5358,7 @@ if (!__Pyx_RefNanny) { __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { - if (__pyx_d && stringtab_initialized) { + if (__pyx_mstate->__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init cityhash", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE @@ -5848,12 +5379,127 @@ if (!__Pyx_RefNanny) { __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; - #elif PY_MAJOR_VERSION >= 3 - return __pyx_m; #else - return; + return __pyx_m; #endif } +/* #### Code section: pystring_table ### */ + +typedef struct { + const char *s; +#if 179 <= 65535 + const unsigned short n; +#elif 179 / 2 < INT_MAX + const unsigned int n; +#elif 179 / 2 < LONG_MAX + const unsigned long n; +#else + const Py_ssize_t n; +#endif +#if 1 <= 31 + const unsigned int encoding : 5; +#elif 1 <= 255 + const unsigned char encoding; +#elif 1 <= 65535 + const unsigned short encoding; +#else + const Py_ssize_t encoding; +#endif + const unsigned int is_unicode : 1; + const unsigned int intern : 1; +} __Pyx_StringTabEntry; +static const char * const __pyx_string_tab_encodings[] = { 0 }; +static const __Pyx_StringTabEntry __pyx_string_tab[] = { + {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */ + {__pyx_k_0_4_10, sizeof(__pyx_k_0_4_10), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_0_4_10 */ + {__pyx_k_Argument, sizeof(__pyx_k_Argument), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Argument */ + {__pyx_k_CityHash128, sizeof(__pyx_k_CityHash128), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CityHash128 */ + {__pyx_k_CityHash128WithSeed, sizeof(__pyx_k_CityHash128WithSeed), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CityHash128WithSeed */ + {__pyx_k_CityHash32, sizeof(__pyx_k_CityHash32), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CityHash32 */ + {__pyx_k_CityHash64, sizeof(__pyx_k_CityHash64), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CityHash64 */ + {__pyx_k_CityHash64WithSeed, sizeof(__pyx_k_CityHash64WithSeed), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CityHash64WithSeed */ + {__pyx_k_CityHash64WithSeeds, sizeof(__pyx_k_CityHash64WithSeeds), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CityHash64WithSeeds */ + {__pyx_k_Eugene_Scherba, sizeof(__pyx_k_Eugene_Scherba), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Eugene_Scherba */ + {__pyx_k_Note_that_Cython_is_deliberately, sizeof(__pyx_k_Note_that_Cython_is_deliberately), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Note_that_Cython_is_deliberately */ + {__pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TypeError */ + {__pyx_k_add_note, sizeof(__pyx_k_add_note), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_add_note */ + {__pyx_k_all, sizeof(__pyx_k_all), 0, 1, 1}, /* PyObject cname: __pyx_n_u_all */ + {__pyx_k_author, sizeof(__pyx_k_author), 0, 1, 1}, /* PyObject cname: __pyx_n_u_author */ + {__pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 1, 1}, /* PyObject cname: __pyx_n_u_basestring */ + {__pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 1, 1}, /* PyObject cname: __pyx_n_u_buffer */ + {__pyx_k_cityhash, sizeof(__pyx_k_cityhash), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cityhash */ + {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */ + {__pyx_k_data, sizeof(__pyx_k_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_data */ + {__pyx_k_email, sizeof(__pyx_k_email), 0, 1, 1}, /* PyObject cname: __pyx_n_u_email */ + {__pyx_k_escherba_cityhash_gmail_com, sizeof(__pyx_k_escherba_cityhash_gmail_com), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_escherba_cityhash_gmail_com */ + {__pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_got */ + {__pyx_k_has_incorrect_type_expected, sizeof(__pyx_k_has_incorrect_type_expected), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_has_incorrect_type_expected */ + {__pyx_k_instead, sizeof(__pyx_k_instead), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_instead */ + {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */ + {__pyx_k_module, sizeof(__pyx_k_module), 0, 1, 1}, /* PyObject cname: __pyx_n_u_module */ + {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */ + {__pyx_k_pop, sizeof(__pyx_k_pop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pop */ + {__pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_qualname */ + {__pyx_k_seed, sizeof(__pyx_k_seed), 0, 1, 1}, /* PyObject cname: __pyx_n_u_seed */ + {__pyx_k_seed0, sizeof(__pyx_k_seed0), 0, 1, 1}, /* PyObject cname: __pyx_n_u_seed0 */ + {__pyx_k_seed1, sizeof(__pyx_k_seed1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_seed1 */ + {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */ + {__pyx_k_version, sizeof(__pyx_k_version), 0, 1, 1}, /* PyObject cname: __pyx_n_u_version */ + {0, 0, 0, 0, 0} +}; +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names); + +/* #### Code section: cached_builtins ### */ + +static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { + CYTHON_UNUSED_VAR(__pyx_mstate); + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 80, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + __Pyx_RefNannyFinishContext(); + return 0; +} +/* #### Code section: init_constants ### */ + +static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { + CYTHON_UNUSED_VAR(__pyx_mstate); + __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; + if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_mstate->__pyx_int_0L = PyLong_FromString("0", 0, 0); if (unlikely(!__pyx_mstate->__pyx_int_0L)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_int_64L = PyLong_FromString("64", 0, 0); if (unlikely(!__pyx_mstate->__pyx_int_64L)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_int_0xffffffffffffffffL = PyLong_FromString("0xffffffffffffffff", 0, 0); if (unlikely(!__pyx_mstate->__pyx_int_0xffffffffffffffffL)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_codeobjects ### */ + +static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { + CYTHON_UNUSED_VAR(__pyx_mstate); + return 0; +} +/* #### Code section: init_globals ### */ + +static int __Pyx_InitGlobals(void) { + /* PythonCompatibility.init */ + if (likely(__Pyx_init_co_variables() == 0)); else + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + return 0; + __pyx_L1_error:; + return -1; +} /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ @@ -5894,11 +5540,9 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; itp_getattro)) return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ -#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -6016,11 +5656,11 @@ static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; -#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); @@ -6036,14 +5676,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif } return result; } @@ -6052,13 +5688,6 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { if (unlikely(!s)) return NULL; if (likely(PyUnicode_CheckExact(s))) return s; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_CheckExact(s))) { - PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict"); - Py_DECREF(s); - return result; - } - #endif return __Pyx_PyObject_FormatAndDecref(s, f); } static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { @@ -6070,49 +5699,48 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObj } /* JoinPyUnicode */ -static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, +static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char) { #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyObject *result_uval; int result_ukind, kind_shift; Py_ssize_t i, char_pos; void *result_udata; - CYTHON_MAYBE_UNUSED_VAR(max_char); -#if CYTHON_PEP393_ENABLED + if (max_char > 1114111) max_char = 1114111; result_uval = PyUnicode_New(result_ulength, max_char); if (unlikely(!result_uval)) return NULL; result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; result_udata = PyUnicode_DATA(result_uval); -#else - result_uval = PyUnicode_FromUnicode(NULL, result_ulength); - if (unlikely(!result_uval)) return NULL; - result_ukind = sizeof(Py_UNICODE); - kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1; - result_udata = PyUnicode_AS_UNICODE(result_uval); -#endif assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); + if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0)) + goto overflow; char_pos = 0; for (i=0; i < value_count; i++) { int ukind; Py_ssize_t ulength; void *udata; - PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); - if (unlikely(__Pyx_PyUnicode_READY(uval))) + PyObject *uval = values[i]; + #if !CYTHON_COMPILING_IN_LIMITED_API + if (__Pyx_PyUnicode_READY(uval) == (-1)) goto bad; + #endif ulength = __Pyx_PyUnicode_GET_LENGTH(uval); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(ulength < 0)) goto bad; + #endif if (unlikely(!ulength)) continue; if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) goto overflow; ukind = __Pyx_PyUnicode_KIND(uval); udata = __Pyx_PyUnicode_DATA(uval); - if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { + if (ukind == result_ukind) { memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); } else { #if PY_VERSION_HEX >= 0x030d0000 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; - #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) + #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters) _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); #else Py_ssize_t j; @@ -6131,16 +5759,26 @@ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_co Py_DECREF(result_uval); return NULL; #else + Py_ssize_t i; + PyObject *result = NULL; + PyObject *value_tuple = PyTuple_New(value_count); + if (unlikely(!value_tuple)) return NULL; CYTHON_UNUSED_VAR(max_char); CYTHON_UNUSED_VAR(result_ulength); - CYTHON_UNUSED_VAR(value_count); - return PyUnicode_Join(__pyx_empty_unicode, value_tuple); + for (i=0; i__pyx_empty_unicode, value_tuple); +bad: + Py_DECREF(value_tuple); + return result; #endif } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject *const *args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; @@ -6168,14 +5806,12 @@ static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args --tstate->recursion_depth; return result; } -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; -#if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; -#endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; @@ -6183,19 +5819,11 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { - return NULL; - } - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } - #endif if ( -#if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && -#endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { @@ -6232,9 +5860,7 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, k = NULL; } closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); -#endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); @@ -6243,17 +5869,10 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, d = NULL; nd = 0; } -#if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); -#else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, closure); -#endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); @@ -6268,13 +5887,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -6293,13 +5907,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -6313,7 +5922,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API -static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { +static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; @@ -6321,7 +5930,7 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **arg if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); - if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: @@ -6329,7 +5938,32 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **arg return result; } #endif -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { +#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API + #if PY_VERSION_HEX < 0x03090000 + #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable) + #elif CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) { + PyTypeObject *tp = Py_TYPE(callable); + #if defined(__Pyx_CyFunction_USED) + if (__Pyx_CyFunction_CheckExact(callable)) { + return __Pyx_CyFunction_func_vectorcall(callable); + } + #endif + if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) { + return NULL; + } + assert(PyCallable_Check(callable)); + Py_ssize_t offset = tp->tp_vectorcall_offset; + assert(offset > 0); + vectorcallfunc ptr; + memcpy(&ptr, (char *) callable + offset, sizeof(ptr)); + return ptr; +} + #else + #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable) + #endif +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { @@ -6350,12 +5984,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } - #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif - #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); @@ -6363,24 +5995,22 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif #endif if (kwargs == NULL) { - #if CYTHON_VECTORCALL - #if PY_VERSION_HEX < 0x03090000 - vectorcallfunc f = _PyVectorcall_Function(func); - #else - vectorcallfunc f = PyVectorcall_Function(func); - #endif + #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API + vectorcallfunc f = __Pyx_PyVectorcall_Function(func); if (f) { - return f(func, args, (size_t)nargs, NULL); + return f(func, args, _nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); - if (f) return f(func, args, (size_t)nargs, NULL); + if (f) return f(func, args, _nargs, NULL); } + #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL + return PyObject_Vectorcall(func, args, _nargs, NULL); #endif } if (nargs == 0) { - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); @@ -6389,35 +6019,48 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif } -/* PyObjectCallOneArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *args[2] = {NULL, arg}; - return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - /* TupleAndListFromArray */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { - PyObject *v; - Py_ssize_t i; - for (i = 0; i < length; i++) { - v = dest[i] = src[i]; - Py_INCREF(v); - } -} +#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; + Py_ssize_t i; if (n <= 0) { - Py_INCREF(__pyx_empty_tuple); - return __pyx_empty_tuple; + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; - __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); - return res; -} + for (i = 0; i < n; i++) { + if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < 0)) { + Py_DECREF(res); + return NULL; + } + Py_INCREF(src[i]); + } + return res; +} +#elif CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { + PyObject *v; + Py_ssize_t i; + for (i = 0; i < length; i++) { + v = dest[i] = src[i]; + Py_INCREF(v); + } +} +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + if (n <= 0) { + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n); + return res; +} static CYTHON_INLINE PyObject * __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) { @@ -6434,7 +6077,8 @@ __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ + !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { @@ -6481,55 +6125,39 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL return PyObject_RichCompareBool(s1, s2, equals); #else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; + Py_ssize_t length, length2; int kind; void *data1, *data2; + #if !CYTHON_COMPILING_IN_LIMITED_API if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; + #endif length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length < 0)) return -1; + #endif + length2 = __Pyx_PyUnicode_GET_LENGTH(s2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length2 < 0)) return -1; + #endif + if (length != length2) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; - #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; - #else - hash1 = ((PyUnicodeObject*)s1)->hash; - hash2 = ((PyUnicodeObject*)s2)->hash; - #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } @@ -6547,9 +6175,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { @@ -6559,9 +6184,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -6569,14 +6191,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int return result; } return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ); return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_NE); #endif } @@ -6585,14 +6201,25 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { - Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(n == -1)) return NULL; + #endif for (i = 0; i < n; i++) { - if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + if (s == namei) return kwvalues[i]; } for (i = 0; i < n; i++) { - int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; @@ -6600,15 +6227,26 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO } return NULL; } -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { - Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); + Py_ssize_t i, nkwargs; PyObject *dict; +#if !CYTHON_ASSUME_SAFE_SIZE + nkwargs = PyTuple_Size(kwnames); + if (unlikely(nkwargs < 0)) return NULL; +#else + nkwargs = PyTuple_GET_SIZE(kwnames); +#endif dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif } -/* ParseKeywords */ -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); - while (1) { - Py_XDECREF(key); key = NULL; - Py_XDECREF(value); value = NULL; - if (kwds_is_tuple) { - Py_ssize_t size; -#if CYTHON_ASSUME_SAFE_MACROS - size = PyTuple_GET_SIZE(kwds); +/* UnpackUnboundCMethod */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; + PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); + if (unlikely(!selfless_args)) return NULL; + result = PyObject_Call(method, selfless_args, kwargs); + Py_DECREF(selfless_args); + return result; +} +#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000 +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { + return _PyObject_Vectorcall + (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames); +} +#else +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + return +#if PY_VERSION_HEX < 0x03090000 + _PyObject_Vectorcall #else - size = PyTuple_Size(kwds); - if (size < 0) goto bad; + PyObject_Vectorcall #endif - if (pos >= size) break; -#if CYTHON_AVOID_BORROWED_REFS - key = __Pyx_PySequence_ITEM(kwds, pos); - if (!key) goto bad; -#elif CYTHON_ASSUME_SAFE_MACROS - key = PyTuple_GET_ITEM(kwds, pos); + (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames); +} +#endif +static PyMethodDef __Pyx_UnboundCMethod_Def = { + "CythonUnboundCMethod", + __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 + METH_VARARGS | METH_KEYWORDS, +#else + METH_FASTCALL | METH_KEYWORDS, +#endif + NULL +}; +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method, *result=NULL; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + result = method; +#if CYTHON_COMPILING_IN_CPYTHON + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } else +#endif +#if CYTHON_COMPILING_IN_PYPY #else - key = PyTuple_GetItem(kwds, pos); - if (!key) goto bad; + if (PyCFunction_Check(method)) #endif - value = kwvalues[pos]; - pos++; + { + PyObject *self; + int self_found; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + self = PyObject_GetAttrString(method, "__self__"); + if (!self) { + PyErr_Clear(); } - else - { - if (!PyDict_Next(kwds, &pos, &key, &value)) break; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); +#else + self = PyCFunction_GET_SELF(method); +#endif + self_found = (self && self != Py_None); +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + Py_XDECREF(self); #endif + if (self_found) { + PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); + if (unlikely(!unbound_method)) return -1; + Py_DECREF(method); + result = unbound_method; } - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(value); - Py_DECREF(key); + } +#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if (unlikely(target->method)) { + Py_DECREF(result); + } else #endif - key = NULL; - value = NULL; - continue; + target->method = result; + return 0; +} + +/* CallUnboundCMethod2 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { + int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); + if (likely(was_initialized == 2 && cfunc->func)) { + PyObject *args[2] = {arg1, arg2}; + if (cfunc->flag == METH_FASTCALL) { + return __Pyx_CallCFunctionFast(cfunc, self, args, 2); } -#if !CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL); + } +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + else if (unlikely(was_initialized == 1)) { + __Pyx_CachedCFunction tmp_cfunc = { +#ifndef __cplusplus + 0 #endif - Py_INCREF(value); - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; + }; + tmp_cfunc.type = cfunc->type; + tmp_cfunc.method_name = cfunc->method_name; + return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2); + } #endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = ( - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key) - ); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; + PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); + __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); + return result; +} #endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + PyObject *result = NULL; + PyObject *args = PyTuple_New(2); + if (unlikely(!args)) return NULL; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + if (cfunc->flag & METH_KEYWORDS) + result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); + else + result = __Pyx_CallCFunction(cfunc, self, args); + Py_DECREF(args); + return result; + } +#endif + { + PyObject *args[4] = {NULL, self, arg1, arg2}; + return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + } +} + +/* ParseKeywords */ +static int __Pyx_ValidateDuplicatePosArgs( + PyObject *kwds, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + const char* function_name) +{ + PyObject ** const *name = argnames; + while (name != first_kw_arg) { + PyObject *key = **name; + int found = PyDict_Contains(kwds, key); + if (unlikely(found)) { + if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; + } + name++; + } + return 0; +bad: + return -1; +} +#if CYTHON_USE_UNICODE_INTERNALS +static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) { + int kind; + Py_ssize_t len = PyUnicode_GET_LENGTH(s1); + if (len != PyUnicode_GET_LENGTH(s2)) return 0; + kind = PyUnicode_KIND(s1); + if (kind != PyUnicode_KIND(s2)) return 0; + const void *data1 = PyUnicode_DATA(s1); + const void *data2 = PyUnicode_DATA(s2); + return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0); +} +#endif +static int __Pyx_MatchKeywordArg_str( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + PyObject ** const *name; + #if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t key_hash = ((PyASCIIObject*)key)->hash; + if (unlikely(key_hash == -1)) { + key_hash = PyObject_Hash(key); + if (unlikely(key_hash == -1)) + goto bad; + } + #endif + name = first_kw_arg; + while (*name) { + PyObject *name_str = **name; + #if CYTHON_USE_UNICODE_INTERNALS + if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) { + *index_found = (size_t) (name - argnames); + return 1; + } + #else + #if CYTHON_ASSUME_SAFE_SIZE + if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) + #endif + { + int cmp = PyUnicode_Compare(name_str, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + *index_found = (size_t) (name - argnames); + return 1; } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; } + #endif + name++; + } + name = argnames; + while (name != first_kw_arg) { + PyObject *name_str = **name; + #if CYTHON_USE_UNICODE_INTERNALS + if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) { + if (__Pyx_UnicodeKeywordsEqual(name_str, key)) + goto arg_passed_twice; + } + #else + #if CYTHON_ASSUME_SAFE_SIZE + if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) + #endif + { + if (unlikely(name_str == key)) goto arg_passed_twice; + int cmp = PyUnicode_Compare(name_str, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + } + #endif + name++; + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +bad: + return -1; +} +static int __Pyx_MatchKeywordArg_nostr( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + PyObject ** const *name; + if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; + name = first_kw_arg; + while (*name) { + int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); + if (cmp == 1) { + *index_found = (size_t) (name - argnames); + return 1; + } + if (unlikely(cmp == -1)) goto bad; + name++; + } + name = argnames; + while (name != first_kw_arg) { + int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); + if (unlikely(cmp != 0)) { + if (cmp == 1) goto arg_passed_twice; + else goto bad; + } + name++; } - Py_XDECREF(key); - Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); @@ -6774,21 +6542,244 @@ static int __Pyx_ParseOptionalKeywords( PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; -invalid_keyword: - #if PY_MAJOR_VERSION < 3 - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); +bad: + return -1; +} +static CYTHON_INLINE int __Pyx_MatchKeywordArg( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + return likely(PyUnicode_CheckExact(key)) ? + __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) : + __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name); +} +static void __Pyx_RejectUnknownKeyword( + PyObject *kwds, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + const char *function_name) +{ + Py_ssize_t pos = 0; + PyObject *key = NULL; + __Pyx_BEGIN_CRITICAL_SECTION(kwds); + while (PyDict_Next(kwds, &pos, &key, NULL)) { + PyObject** const *name = first_kw_arg; + while (*name && (**name != key)) name++; + if (!*name) { + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); + #endif + size_t index_found = 0; + int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); + if (cmp != 1) { + if (cmp == 0) { + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif + break; + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif + } + } + __Pyx_END_CRITICAL_SECTION(); + assert(PyErr_Occurred()); +} +static int __Pyx_ParseKeywordDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs) +{ + PyObject** const *name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + Py_ssize_t extracted = 0; +#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) + if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; +#endif + name = first_kw_arg; + while (*name && num_kwargs > extracted) { + PyObject * key = **name; + PyObject *value; + int found = 0; + #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + found = PyDict_GetItemRef(kwds, key, &value); + #else + value = PyDict_GetItemWithError(kwds, key); + if (value) { + Py_INCREF(value); + found = 1; + } else { + if (unlikely(PyErr_Occurred())) goto bad; + } + #endif + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + extracted++; + } + name++; + } + if (num_kwargs > extracted) { + if (ignore_unknown_kwargs) { + if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1)) + goto bad; + } else { + __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name); + goto bad; + } + } + return 0; +bad: + return -1; +} +static int __Pyx_ParseKeywordDictToDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject** const *name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + Py_ssize_t len; +#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) + if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; +#endif + if (PyDict_Update(kwds2, kwds) < 0) goto bad; + name = first_kw_arg; + while (*name) { + PyObject *key = **name; + PyObject *value; +#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop)) + int found = PyDict_Pop(kwds2, key, &value); + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + } +#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + int found = PyDict_GetItemRef(kwds2, key, &value); + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad; + } +#else + #if CYTHON_COMPILING_IN_CPYTHON + value = _PyDict_Pop(kwds2, key, kwds2); #else + value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2); + #endif + if (value == kwds2) { + Py_DECREF(value); + } else { + if (unlikely(!value)) goto bad; + values[name-argnames] = value; + } +#endif + name++; + } + len = PyDict_Size(kwds2); + if (len > 0) { + return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name); + } else if (unlikely(len == -1)) { + goto bad; + } + return 0; +bad: + return -1; +} +static int __Pyx_ParseKeywordsTuple( + PyObject *kwds, + PyObject * const *kwvalues, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs) +{ + PyObject *key = NULL; + PyObject** const * name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) { +#if CYTHON_AVOID_BORROWED_REFS + key = __Pyx_PySequence_ITEM(kwds, pos); +#else + key = __Pyx_PyTuple_GET_ITEM(kwds, pos); +#endif +#if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!key)) goto bad; +#endif + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + PyObject *value = kwvalues[pos]; + values[name-argnames] = __Pyx_NewRef(value); + } else { + size_t index_found = 0; + int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); + if (cmp == 1) { + PyObject *value = kwvalues[pos]; + values[index_found] = __Pyx_NewRef(value); + } else { + if (unlikely(cmp == -1)) goto bad; + if (kwds2) { + PyObject *value = kwvalues[pos]; + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else if (!ignore_unknown_kwargs) { + goto invalid_keyword; + } + } + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + key = NULL; + #endif + } + return 0; +invalid_keyword: PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); - #endif + goto bad; bad: + #if CYTHON_AVOID_BORROWED_REFS Py_XDECREF(key); - Py_XDECREF(value); + #endif return -1; } +static int __Pyx_ParseKeywords( + PyObject *kwds, + PyObject * const *kwvalues, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs) +{ + if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) + return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); + else if (kwds2) + return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name); + else + return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); +} /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( @@ -6810,65 +6801,13 @@ static void __Pyx_RaiseArgtupleInvalid( if (exact) { more_or_less = "exactly"; } - PyErr_Format(PyExc_TypeError, - "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -/* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - __Pyx_PyThreadState_declare - CYTHON_UNUSED_VAR(cause); - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); } -#else + +/* RaiseException */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { @@ -6953,9 +6892,9 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { - #if PY_VERSION_HEX >= 0x030C00A6 +#if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); - #elif CYTHON_FAST_THREAD_STATE +#elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -6975,13 +6914,12 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_XDECREF(owned_instance); return; } -#endif /* RaiseUnexpectedTypeError */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) { - __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, expected, obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); @@ -6993,39 +6931,59 @@ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *nam { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; + PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode; + int from_annotation_subclass = 0; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } - else if (exact) { - #if PY_MAJOR_VERSION == 2 - if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { + else if (!exact) { if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } else if (exact == 2) { + if (__Pyx_TypeCheck(obj, type)) { + from_annotation_subclass = 1; + extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately; + } } - type_name = __Pyx_PyType_GetName(type); - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + type_name = __Pyx_PyType_GetFullyQualifiedName(type); + obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME - ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); + ", got " __Pyx_FMT_TYPENAME ")" +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + "%s%U" +#endif + , name, type_name, obj_type_name +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + , (from_annotation_subclass ? ". " : ""), extra_info +#endif + ); +#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + if (exact == 2 && from_annotation_subclass) { + PyObject *res; + PyObject *vargs[2]; + vargs[0] = PyErr_GetRaisedException(); + vargs[1] = extra_info; + res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL); + Py_XDECREF(res); + PyErr_SetRaisedException(vargs[0]); + } +#endif __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* TypeImport */ -#ifndef __PYX_HAVE_RT_ImportType_3_0_12 -#define __PYX_HAVE_RT_ImportType_3_0_12 -static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *module_name, const char *class_name, - size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size) +#ifndef __PYX_HAVE_RT_ImportType_3_1_4 +#define __PYX_HAVE_RT_ImportType_3_1_4 +static PyTypeObject *__Pyx_ImportType_3_1_4(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_4 check_size) { PyObject *result = 0; - char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; -#if CYTHON_COMPILING_IN_LIMITED_API +#ifdef Py_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif @@ -7038,10 +6996,13 @@ static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *modul module_name, class_name); goto bad; } -#if !CYTHON_COMPILING_IN_LIMITED_API +#ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else + if (size == 0) { + return (PyTypeObject *)result; + } py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; @@ -7073,7 +7034,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *modul module_name, class_name, size, basicsize+itemsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_12 && + if (check_size == __Pyx_ImportType_CheckSize_Error_3_1_4 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " @@ -7081,12 +7042,13 @@ static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *modul module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_12 && (size_t)basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility. " - "Expected %zd from C header, got %zd from PyObject", - module_name, class_name, size, basicsize); - if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_1_4 && (size_t)basicsize > size) { + if (PyErr_WarnFormat(NULL, 0, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize) < 0) { + goto bad; + } } return (PyTypeObject *)result; bad: @@ -7095,6 +7057,25 @@ static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *modul } #endif +/* ListPack */ +static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) { + va_list va; + PyObject *l = PyList_New(n); + va_start(va, n); + if (unlikely(!l)) goto end; + for (Py_ssize_t i=0; i__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON - cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_mstate_global->__pyx_cython_runtime); if (likely(cython_runtime_dict)) { + __Pyx_BEGIN_CRITICAL_SECTION(*cython_runtime_dict); __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, - __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback)) + Py_XINCREF(use_cline); + __Pyx_END_CRITICAL_SECTION(); } else #endif { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_INCREF(use_cline); Py_DECREF(use_cline_obj); } else { PyErr_Clear(); @@ -7154,18 +7139,18 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { } if (!use_cline) { c_line = 0; - (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + (void) PyObject_SetAttr(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } + Py_XDECREF(use_cline); __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ -#if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { @@ -7187,64 +7172,103 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co return mid + 1; } } -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; +static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) { + __Pyx_CachedCodeObjectType* code_object; int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + if (unlikely(!code_line) || unlikely(!code_cache->entries)) { return NULL; } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); + if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) { return NULL; } - code_object = __pyx_code_cache.entries[pos].code_object; + code_object = code_cache->entries[pos].code_object; Py_INCREF(code_object); return code_object; } -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) { +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS + (void)__pyx__find_code_object; + return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss. +#else + struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count); + if (old_count < 0) { + __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); + return NULL; + } +#endif + __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line); +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); +#endif + return result; +#endif +} +static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object) +{ int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + __Pyx_CodeObjectCacheEntry* entries = code_cache->entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; + code_cache->entries = entries; + code_cache->max_count = 64; + code_cache->count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; + pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); + if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) { + __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object; entries[pos].code_object = code_object; + Py_INCREF(code_object); Py_DECREF(tmp); return; } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; + if (code_cache->count == code_cache->max_count) { + int new_max = code_cache->max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; + code_cache->entries = entries; + code_cache->max_count = new_max; } - for (i=__pyx_code_cache.count; i>pos; i--) { + for (i=code_cache->count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; - __pyx_code_cache.count++; + code_cache->count++; Py_INCREF(code_object); } +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) { +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS + (void)__pyx__insert_code_object; + return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail. +#else + struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_nonatomic_int_type expected = 0; + if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) { + return; + } +#endif + __pyx__insert_code_object(code_cache, code_line, code_object); +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN); #endif +#endif +} /* AddTraceback */ #include "compile.h" @@ -7264,35 +7288,12 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { - PyObject *result; - result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); - #if __PYX_LIMITED_VERSION_HEX < 0x030780000 - { - PyObject *compiled = NULL, *result = NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; - compiled = Py_CompileString( - "out = type(code)(\n" - " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" - " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" - " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" - " code.co_lnotab)\n", "", Py_file_input); - if (!compiled) return NULL; - result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); - Py_DECREF(compiled); - if (!result) PyErr_Print(); - Py_DECREF(result); - result = PyDict_GetItemString(scratch_dict, "out"); - if (result) Py_INCREF(result); - return result; - } - #else return NULL; - #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { @@ -7305,20 +7306,26 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); - code_object = Py_CompileString("_getframe()", filename, Py_eval_input); - if (unlikely(!code_object)) goto bad; - py_py_line = PyLong_FromLong(py_line); - if (unlikely(!py_py_line)) goto bad; - py_funcname = PyUnicode_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - dict = PyDict_New(); - if (unlikely(!dict)) goto bad; - { - PyObject *old_code_object = code_object; - code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); - Py_DECREF(old_code_object); + code_object = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!code_object) { + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, code_object); + } else { + dict = PyDict_New(); } - if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; @@ -7344,58 +7351,17 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; - #if PY_MAJOR_VERSION < 3 - PyObject *py_srcfile = NULL; - py_srcfile = PyString_FromString(filename); - if (!py_srcfile) goto bad; - #endif if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - if (!py_funcname) goto bad; - #endif } - #if PY_MAJOR_VERSION < 3 - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - #else py_code = PyCode_NewEmpty(filename, funcname, py_line); - #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_srcfile); - #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -7426,7 +7392,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ + __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; @@ -7461,7 +7427,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } /* CIntFromPy */ -static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) { +static CYTHON_INLINE uint64_t __Pyx_PyLong_As_uint64_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -7471,24 +7437,11 @@ static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(uint64_t) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(uint64_t, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (uint64_t) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { uint64_t val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (uint64_t) -1; - val = __Pyx_PyInt_As_uint64_t(tmp); + val = __Pyx_PyLong_As_uint64_t(tmp); Py_DECREF(tmp); return val; } @@ -7727,8 +7680,40 @@ static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) { return (uint64_t) -1; } +/* PyObjectVectorCallKwBuilder */ +#if CYTHON_VECTORCALL +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_PyObject_FastCallDict; + if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; + Py_INCREF(key); + args[n] = value; + return 0; +} +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_VectorcallBuilder_AddArgStr; + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n); +} +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + PyObject *pyKey = PyUnicode_FromString(key); + if (!pyKey) return -1; + return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n); +} +#else // CYTHON_VECTORCALL +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) { + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return PyDict_SetItem(builder, key, value); +} +#endif + /* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint32_t(uint32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -7740,17 +7725,17 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG +#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint32_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); @@ -7771,25 +7756,25 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + PyObject *from_bytes, *result = NULL, *kwds = NULL; + PyObject *py_bytes = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - if (!is_unsigned) { - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + { + PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; + if (!is_unsigned) { + kwds = __Pyx_MakeVectorcallBuilderKwds(1); + if (!kwds) goto limited_bad; + if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; + } + result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } - result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); - Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); @@ -7799,7 +7784,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { } /* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint64_t(uint64_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -7811,17 +7796,17 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint64_t) < sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); } else if (sizeof(uint64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG +#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint64_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); @@ -7842,25 +7827,25 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + PyObject *from_bytes, *result = NULL, *kwds = NULL; + PyObject *py_bytes = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint64_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - if (!is_unsigned) { - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + { + PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; + if (!is_unsigned) { + kwds = __Pyx_MakeVectorcallBuilderKwds(1); + if (!kwds) goto limited_bad; + if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; + } + result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } - result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); - Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); @@ -7870,23 +7855,46 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { } /* FormatTypeName */ -#if CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 static __Pyx_TypeName -__Pyx_PyType_GetName(PyTypeObject* tp) +__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp) { - PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_n_s_name); - if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { - PyErr_Clear(); - Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__13); + PyObject *module = NULL, *name = NULL, *result = NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030b0000 + name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_mstate_global->__pyx_n_u_qualname); + #else + name = PyType_GetQualName(tp); + #endif + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad; + module = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_mstate_global->__pyx_n_u_module); + if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad; + if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) { + result = name; + name = NULL; + goto done; + } + result = PyUnicode_FromFormat("%U.%U", module, name); + if (unlikely(result == NULL)) goto bad; + done: + Py_XDECREF(name); + Py_XDECREF(module); + return result; + bad: + PyErr_Clear(); + if (name) { + result = name; + name = NULL; + } else { + result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_); } - return name; + goto done; } #endif /* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -7898,17 +7906,17 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG +#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); @@ -7929,25 +7937,25 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + PyObject *from_bytes, *result = NULL, *kwds = NULL; + PyObject *py_bytes = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - if (!is_unsigned) { - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + { + PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; + if (!is_unsigned) { + kwds = __Pyx_MakeVectorcallBuilderKwds(1); + if (!kwds) goto limited_bad; + if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; + } + result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } - result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); - Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); @@ -7957,7 +7965,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { } /* CIntFromPy */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -7967,24 +7975,11 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(long) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + val = __Pyx_PyLong_As_long(tmp); Py_DECREF(tmp); return val; } @@ -8224,7 +8219,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { } /* CIntFromPy */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -8234,24 +8229,11 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); + val = __Pyx_PyLong_As_int(tmp); Py_DECREF(tmp); return val; } @@ -8531,29 +8513,6 @@ static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } -#if PY_MAJOR_VERSION == 2 -static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { - PyObject *exception, *value, *tb; - int res; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&exception, &value, &tb); - res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - if (!res) { - res = PyObject_IsSubclass(err, exc_type2); - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - } - __Pyx_ErrRestore(exception, value, tb); - return res; -} -#else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); @@ -8561,21 +8520,15 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } -#endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 +#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 return Py_Version & ~0xFFUL; #else - const char* rt_version = Py_GetVersion(); - unsigned long version = 0; - unsigned long factor = 0x01000000UL; - unsigned int digit = 0; - int i = 0; - while (factor) { - while ('0' <= rt_version[i] && rt_version[i] <= '9') { - digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + static unsigned long __Pyx_cached_runtime_version = 0; + if (__Pyx_cached_runtime_version == 0) { + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; ++i; } - version += factor * digit; - if (rt_version[i] != '.') - break; - digit = 0; - factor >>= 8; - ++i; + __Pyx_cached_runtime_version = version; } - return version; + return __Pyx_cached_runtime_version; #endif } + +/* CheckBinaryVersion */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) @@ -8654,44 +8613,27 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt } /* InitStrings */ -#if PY_MAJOR_VERSION >= 3 -static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { - if (t.is_unicode | t.is_str) { - if (t.intern) { - *str = PyUnicode_InternFromString(t.s); - } else if (t.encoding) { - *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); - } else { - *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); - } - } else { - *str = PyBytes_FromStringAndSize(t.s, t.n - 1); - } - if (!*str) - return -1; - if (PyObject_Hash(*str) == -1) - return -1; - return 0; -} -#endif -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION >= 3 - __Pyx_InitString(*t, t->p); - #else +static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names) { + while (t->s) { + PyObject *str; if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); + if (t->intern) { + str = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + str = PyUnicode_Decode(t->s, t->n - 1, encoding_names[t->encoding], NULL); + } else { + str = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + str = PyBytes_FromStringAndSize(t->s, t->n - 1); } - if (!*t->p) + if (!str) return -1; - if (PyObject_Hash(*t->p) == -1) + *target = str; + if (PyObject_Hash(str) == -1) return -1; - #endif ++t; + ++target; } return 0; } @@ -8719,31 +8661,30 @@ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#if !CYTHON_PEP393_ENABLED -static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } + const char* result; + Py_ssize_t unicode_length; + CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 + if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL; + #else + result = PyUnicode_AsUTF8AndSize(o, length); + #endif + #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + unicode_length = PyUnicode_GetLength(o); + if (unlikely(unicode_length < 0)) return NULL; + if (unlikely(unicode_length != *length)) { + PyUnicode_AsASCIIString(o); + return NULL; } + #endif + return result; } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -} #else -static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); @@ -8755,25 +8696,25 @@ static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py #else return PyUnicode_AsUTF8AndSize(o, length); #endif -} #endif +} #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + if (PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif -#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { +#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))) *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); - } else +#else + *length = PyByteArray_Size(o); + if (*length == -1) return NULL; + return PyByteArray_AsString(o); #endif + } else { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); @@ -8796,9 +8737,8 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { Py_DECREF(x); return retval; } -static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { - __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); -#if PY_MAJOR_VERSION >= 3 +static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result)); if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " @@ -8812,74 +8752,44 @@ static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const __Pyx_DECREF_TypeName(result_type_name); return result; } -#endif PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", - type_name, type_name, result_type_name); + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")", + result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif - const char *name = NULL; PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x) || PyLong_Check(x))) -#else if (likely(PyLong_Check(x))) -#endif - return __Pyx_NewRef(x); + return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; - #if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = m->nb_int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = m->nb_long(x); - } - #else if (likely(m && m->nb_int)) { - name = "int"; - res = m->nb_int(x); + res = m->nb_int(x); } - #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { - res = PyNumber_Int(x); + res = PyNumber_Long(x); } #endif if (likely(res)) { -#if PY_MAJOR_VERSION < 3 - if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { -#else - if (unlikely(!PyLong_CheckExact(res))) { -#endif - return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); - } + if (unlikely(!PyLong_CheckExact(res))) { + return __Pyx_PyNumber_LongWrongResultType(res); + } } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); + PyErr_SetString(PyExc_TypeError, + "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(b); - } -#endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { @@ -8925,35 +8835,350 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { } x = PyNumber_Index(b); if (!x) return -1; - ival = PyInt_AsSsize_t(x); + ival = PyLong_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); -#if PY_MAJOR_VERSION < 3 - } else if (likely(PyInt_CheckExact(o))) { - return PyInt_AS_LONG(o); -#endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; - ival = PyInt_AsLong(x); + ival = PyLong_AsLong(x); Py_DECREF(x); return ival; } } +static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) { + CYTHON_UNUSED_VAR(b); + return __Pyx_NewRef(Py_None); +} static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { + return PyLong_FromSize_t(ival); } +/* MultiPhaseInitModuleState */ +#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE +#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000) + #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1 +#else + #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0 +#endif +#endif +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS +#error "Module state with PEP489 requires atomics. Currently that's one of\ + C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics" +#endif +#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +#define __Pyx_ModuleStateLookup_Lock() +#define __Pyx_ModuleStateLookup_Unlock() +#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000 +static PyMutex __Pyx_ModuleStateLookup_mutex = {0}; +#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(__cplusplus) && __cplusplus >= 201103L +#include +static std::mutex __Pyx_ModuleStateLookup_mutex; +#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock() +#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock() +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__) +#include +static mtx_t __Pyx_ModuleStateLookup_mutex; +static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT; +static void __Pyx_ModuleStateLookup_initialize_mutex(void) { + mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain); +} +#define __Pyx_ModuleStateLookup_Lock()\ + call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\ + mtx_lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(HAVE_PTHREAD_H) +#include +static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER; +#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(_WIN32) +#include // synchapi.h on its own doesn't work +static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT; +#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) +#else +#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\ + Requires C standard >= C11, or C++ standard >= C++11,\ + or pthreads, or the Windows 32 API, or Python >= 3.13." +#endif +typedef struct { + int64_t id; + PyObject *module; +} __Pyx_InterpreterIdAndModule; +typedef struct { + char interpreter_id_as_index; + Py_ssize_t count; + Py_ssize_t allocated; + __Pyx_InterpreterIdAndModule table[1]; +} __Pyx_ModuleStateLookupData; +#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32 +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0; +#endif +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0; +#else +static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL; +#endif +static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound( + __Pyx_InterpreterIdAndModule* table, + Py_ssize_t count, + int64_t interpreterId) { + __Pyx_InterpreterIdAndModule* begin = table; + __Pyx_InterpreterIdAndModule* end = begin + count; + if (begin->id == interpreterId) { + return begin; + } + while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { + __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2; + if (halfway->id == interpreterId) { + return halfway; + } + if (halfway->id < interpreterId) { + begin = halfway; + } else { + end = halfway; + } + } + for (; begin < end; ++begin) { + if (begin->id >= interpreterId) return begin; + } + return begin; +} +static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return NULL; +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); + { + __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); + if (likely(data)) { + __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data); + if (likely(data == new_data)) { + goto read_finished; + } + } + __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); + __Pyx_ModuleStateLookup_Lock(); + __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter); + data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); + __Pyx_ModuleStateLookup_Unlock(); + } + read_finished:; +#else + __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data; +#endif + __Pyx_InterpreterIdAndModule* found = NULL; + if (unlikely(!data)) goto end; + if (data->interpreter_id_as_index) { + if (interpreter_id < data->count) { + found = data->table+interpreter_id; + } + } else { + found = __Pyx_State_FindModuleStateLookupTableLowerBound( + data->table, data->count, interpreter_id); + } + end: + { + PyObject *result=NULL; + if (found && found->id == interpreter_id) { + result = found->module; + } +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); +#endif + return result; + } +} +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) { + while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0); +} +#else +#define __Pyx_ModuleStateLookup_wait_until_no_readers() +#endif +static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) { + Py_ssize_t to_allocate = (*old_data)->allocated; + while (to_allocate <= interpreter_id) { + if (to_allocate == 0) to_allocate = 1; + else to_allocate *= 2; + } + __Pyx_ModuleStateLookupData *new_data = *old_data; + if (to_allocate != (*old_data)->allocated) { + new_data = (__Pyx_ModuleStateLookupData *)realloc( + *old_data, + sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); + if (!new_data) { + PyErr_NoMemory(); + return -1; + } + for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) { + new_data->table[i].id = i; + new_data->table[i].module = NULL; + } + new_data->allocated = to_allocate; + } + new_data->table[interpreter_id].module = module; + if (new_data->count < interpreter_id+1) { + new_data->count = interpreter_id+1; + } + *old_data = new_data; + return 0; +} +static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) { + __Pyx_InterpreterIdAndModule *read = data->table; + __Pyx_InterpreterIdAndModule *write = data->table; + __Pyx_InterpreterIdAndModule *end = read + data->count; + for (; readmodule) { + write->id = read->id; + write->module = read->module; + ++write; + } + } + data->count = write - data->table; + for (; writeid = 0; + write->module = NULL; + } + data->interpreter_id_as_index = 0; +} +static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return -1; + int result = 0; + __Pyx_ModuleStateLookup_Lock(); +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *) + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); +#else + __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data; +#endif + __Pyx_ModuleStateLookupData *new_data = old_data; + if (!new_data) { + new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData)); + if (!new_data) { + result = -1; + PyErr_NoMemory(); + goto end; + } + new_data->allocated = 1; + new_data->interpreter_id_as_index = 1; + } + __Pyx_ModuleStateLookup_wait_until_no_readers(); + if (new_data->interpreter_id_as_index) { + if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { + result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id); + goto end; + } + __Pyx_State_ConvertFromInterpIdAsIndex(new_data); + } + { + Py_ssize_t insert_at = 0; + { + __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( + new_data->table, new_data->count, interpreter_id); + assert(lower_bound); + insert_at = lower_bound - new_data->table; + if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) { + lower_bound->module = module; + goto end; // already in table, nothing more to do + } + } + if (new_data->count+1 >= new_data->allocated) { + Py_ssize_t to_allocate = (new_data->count+1)*2; + new_data = + (__Pyx_ModuleStateLookupData*)realloc( + new_data, + sizeof(__Pyx_ModuleStateLookupData) + + (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); + if (!new_data) { + result = -1; + new_data = old_data; + PyErr_NoMemory(); + goto end; + } + new_data->allocated = to_allocate; + } + ++new_data->count; + int64_t last_id = interpreter_id; + PyObject *last_module = module; + for (Py_ssize_t i=insert_at; icount; ++i) { + int64_t current_id = new_data->table[i].id; + new_data->table[i].id = last_id; + last_id = current_id; + PyObject *current_module = new_data->table[i].module; + new_data->table[i].module = last_module; + last_module = current_module; + } + } + end: +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data); +#else + __Pyx_ModuleStateLookup_data = new_data; +#endif + __Pyx_ModuleStateLookup_Unlock(); + return result; +} +static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return -1; + __Pyx_ModuleStateLookup_Lock(); +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *) + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); +#else + __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data; +#endif + if (data->interpreter_id_as_index) { + if (interpreter_id < data->count) { + data->table[interpreter_id].module = NULL; + } + goto done; + } + { + __Pyx_ModuleStateLookup_wait_until_no_readers(); + __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( + data->table, data->count, interpreter_id); + if (!lower_bound) goto done; + if (lower_bound->id != interpreter_id) goto done; + __Pyx_InterpreterIdAndModule *end = data->table+data->count; + for (;lower_boundid = (lower_bound+1)->id; + lower_bound->module = (lower_bound+1)->module; + } + } + --data->count; + if (data->count == 0) { + free(data); + data = NULL; + } + done: +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data); +#else + __Pyx_ModuleStateLookup_data = data; +#endif + __Pyx_ModuleStateLookup_Unlock(); + return 0; +} +#endif + /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) diff --git a/src/cityhash.pyx b/src/cityhash.pyx index a21f9fb..001caae 100644 --- a/src/cityhash.pyx +++ b/src/cityhash.pyx @@ -10,7 +10,7 @@ Python wrapper for CityHash __author__ = "Eugene Scherba" __email__ = "escherba+cityhash@gmail.com" -__version__ = '0.4.9' +__version__ = '0.4.10' __all__ = [ "CityHash32", "CityHash64", diff --git a/src/cityhashcrc.cpp b/src/cityhashcrc.cpp index 2d3384f..e9db79c 100644 --- a/src/cityhashcrc.cpp +++ b/src/cityhashcrc.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 3.0.12 */ +/* Generated by Cython 3.1.4 */ /* BEGIN: Cython Metadata { @@ -31,49 +31,21 @@ END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ -#if defined(CYTHON_LIMITED_API) && 0 - #ifndef Py_LIMITED_API - #if CYTHON_LIMITED_API+0 > 0x03030000 - #define Py_LIMITED_API CYTHON_LIMITED_API - #else - #define Py_LIMITED_API 0x03030000 - #endif - #endif +/* InitLimitedAPI */ +#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API) + #define CYTHON_LIMITED_API 1 #endif #include "Python.h" - - #if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj) - #else - #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj, NULL) - #endif - - - #if PY_MAJOR_VERSION <= 2 - #define PyDict_GetItemWithError _PyDict_GetItemWithError - #endif - - - #if (PY_VERSION_HEX < 0x030700b1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600)) && !defined(PyContextVar_Get) - #define PyContextVar_Get(var, d, v) ((d) ? ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) : ((v)[0] = NULL, 0) ) - #endif - #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) - #error Cython requires Python 2.7+ or Python 3.3+. -#else -#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API -#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#elif PY_VERSION_HEX < 0x03080000 + #error Cython requires Python 3.8+. #else -#define __PYX_EXTRA_ABI_MODULE_NAME "" -#endif -#define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME -#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI -#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x03000CF0 +#define __PYX_ABI_VERSION "3_1_4" +#define CYTHON_HEX_VERSION 0x030104F0 #define CYTHON_FUTURE_DIVISION 1 +/* CModulePreamble */ #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -113,19 +85,13 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -136,8 +102,12 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -149,18 +119,22 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 + #define CYTHON_USE_EXC_INFO_STACK 1 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif @@ -171,20 +145,14 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 + #define CYTHON_USE_TYPE_SLOTS 1 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -195,8 +163,13 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -208,7 +181,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT @@ -218,14 +191,19 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00) + #endif + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100) #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 @@ -238,7 +216,7 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS @@ -247,8 +225,6 @@ END: Cython Metadata */ #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -261,8 +237,13 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -270,71 +251,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 1 - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif - #undef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 -#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 1 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #ifndef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #ifndef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 1 - #endif + #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS @@ -346,26 +263,37 @@ END: Cython Metadata */ #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 + #define CYTHON_USE_TP_FINALIZE 0 + #endif + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000) #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 - #endif - #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif + #undef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #ifndef CYTHON_USE_TYPE_SLOTS + #ifdef Py_GIL_DISABLED + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1 + #else + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 + #endif + #if PY_VERSION_HEX < 0x030A0000 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #elif !defined(CYTHON_USE_TYPE_SLOTS) #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS @@ -374,22 +302,19 @@ END: Cython Metadata */ #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif - #if PY_MAJOR_VERSION < 3 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif - #ifndef CYTHON_USE_PYLIST_INTERNALS + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLIST_INTERNALS) #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif - #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) @@ -398,20 +323,32 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 + #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS) + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif - #ifndef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #elif !defined(CYTHON_FAST_GIL) + #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #define CYTHON_METH_FASTCALL 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 @@ -419,51 +356,49 @@ END: Cython Metadata */ #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif - #if PY_VERSION_HEX < 0x030400a1 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #elif !defined(CYTHON_USE_TP_FINALIZE) + #ifndef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1) + #endif + #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif - #if PY_VERSION_HEX < 0x030600B1 + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 1 + #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE) #endif - #if PY_VERSION_HEX < 0x030700A3 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 1 + #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif #endif -#if !defined(CYTHON_FAST_PYCCALL) -#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#ifndef CYTHON_FAST_PYCCALL +#define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL #endif -#if !defined(CYTHON_VECTORCALL) +#ifndef CYTHON_VECTORCALL +#if CYTHON_COMPILING_IN_LIMITED_API +#define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) +#else #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif +#endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS - #if PY_MAJOR_VERSION < 3 - #include "longintrepr.h" - #endif #undef SHIFT #undef BASE #undef MASK @@ -471,6 +406,9 @@ END: Cython Metadata */ enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif +#ifndef CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME + #define CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME 100 +#endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif @@ -523,7 +461,7 @@ END: Cython Metadata */ #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON +# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED @@ -598,6 +536,9 @@ END: Cython Metadata */ #endif #endif #endif +#ifndef Py_UNREACHABLE + #define Py_UNREACHABLE() assert(0); abort() +#endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; @@ -612,6 +553,7 @@ END: Cython Metadata */ #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) +/* CppInitCode */ #ifndef __cplusplus #error "Cython files generated with the C++ option must be compiled with a C++ compiler." #endif @@ -642,109 +584,42 @@ class __Pyx_FakeReference { T *ptr; }; +/* PythonCompatibility */ #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_DefaultClassType PyClass_Type - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_DefaultClassType PyType_Type +#define __Pyx_BUILTIN_MODULE_NAME "builtins" +#define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API - static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyObject *exception_table = NULL; - PyObject *types_module=NULL, *code_type=NULL, *result=NULL; - #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; - PyObject *py_minor_version = NULL; - #endif - long minor_version = 0; - PyObject *type, *value, *traceback; - PyErr_Fetch(&type, &value, &traceback); - #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; - #else - if (!(version_info = PySys_GetObject("version_info"))) goto end; - if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; - minor_version = PyLong_AsLong(py_minor_version); - Py_DECREF(py_minor_version); - if (minor_version == -1 && PyErr_Occurred()) goto end; - #endif - if (!(types_module = PyImport_ImportModule("types"))) goto end; - if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; - if (minor_version <= 7) { - (void)p; - result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else if (minor_version <= 10) { - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else { - if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); - } - end: - Py_XDECREF(code_type); - Py_XDECREF(exception_table); - Py_XDECREF(types_module); - if (type) { - PyErr_Restore(type, value, traceback); - } - return result; - } #ifndef CO_OPTIMIZED - #define CO_OPTIMIZED 0x0001 + static int CO_OPTIMIZED; #endif #ifndef CO_NEWLOCALS - #define CO_NEWLOCALS 0x0002 + static int CO_NEWLOCALS; #endif #ifndef CO_VARARGS - #define CO_VARARGS 0x0004 + static int CO_VARARGS; #endif #ifndef CO_VARKEYWORDS - #define CO_VARKEYWORDS 0x0008 + static int CO_VARKEYWORDS; #endif #ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x0200 + static int CO_ASYNC_GENERATOR; #endif #ifndef CO_GENERATOR - #define CO_GENERATOR 0x0020 + static int CO_GENERATOR; #endif #ifndef CO_COROUTINE - #define CO_COROUTINE 0x0080 + static int CO_COROUTINE; #endif -#elif PY_VERSION_HEX >= 0x030B0000 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); - if (!empty_bytes) return NULL; - result = - #if PY_VERSION_HEX >= 0x030C0000 - PyUnstable_Code_NewWithPosOnlyArgs - #else - PyCode_NewWithPosOnlyArgs - #endif - (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); - Py_DECREF(empty_bytes); - return result; - } -#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 + #endif #endif +static int __Pyx_init_co_variables(void); #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else @@ -776,12 +651,6 @@ class __Pyx_FakeReference { #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif -#ifndef CO_COROUTINE - #define CO_COROUTINE 0x80 -#endif -#ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x200 -#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -803,7 +672,7 @@ class __Pyx_FakeReference { #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif -#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) +#ifndef METH_FASTCALL #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif @@ -841,7 +710,7 @@ class __Pyx_FakeReference { #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif -#if PY_MAJOR_VERSION >= 0x030900B1 +#if PY_VERSION_HEX >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) @@ -858,7 +727,7 @@ static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif -static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { +static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else @@ -866,7 +735,7 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) -#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 +#if __PYX_LIMITED_VERSION_HEX < 0x03090000 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else @@ -882,8 +751,10 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#elif CYTHON_COMPILING_IN_GRAAL + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno)) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) @@ -894,15 +765,11 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() -#elif PY_VERSION_HEX >= 0x03060000 - #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() -#elif PY_VERSION_HEX >= 0x03000000 - #define __Pyx_PyThreadState_Current PyThreadState_GET() #else - #define __Pyx_PyThreadState_Current _PyThreadState_Current + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #endif -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +#if CYTHON_USE_MODULE_STATE +static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); @@ -910,85 +777,43 @@ static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) Py_FatalError("Couldn't find the module state"); return result; } -#endif -#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o) #else - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) -#endif -#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) -#include "pythread.h" -#define Py_tss_NEEDS_INIT 0 -typedef int Py_tss_t; -static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { - *key = PyThread_create_key(); - return 0; -} -static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { - Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); - *key = Py_tss_NEEDS_INIT; - return key; -} -static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { - PyObject_Free(key); -} -static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { - return *key != Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { - PyThread_delete_key(*key); - *key = Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { - return PyThread_set_key_value(*key, value); -} -static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { - return PyThread_get_key_value(*key); -} -#endif -#if PY_MAJOR_VERSION < 3 - #if CYTHON_COMPILING_IN_PYPY - #if PYPY_VERSION_NUM < 0x07030600 - #if defined(__cplusplus) && __cplusplus >= 201402L - [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] - #elif defined(__GNUC__) || defined(__clang__) - __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) - #elif defined(_MSC_VER) - __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) - #endif - static CYTHON_INLINE int PyGILState_Check(void) { - return 0; - } - #else // PYPY_VERSION_NUM < 0x07030600 - #endif // PYPY_VERSION_NUM < 0x07030600 - #else - static CYTHON_INLINE int PyGILState_Check(void) { - PyThreadState * tstate = _PyThreadState_Current; - return tstate && (tstate == PyGILState_GetThisThreadState()); - } - #endif +#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global) #endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype) +#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype) +#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype) +#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype) +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype) + #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL) + #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\ + ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\ + (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\ + __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL) + #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype) + #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype) +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif -#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) +#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } -#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000 #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else @@ -1012,17 +837,11 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) - #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) - #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) -#else - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif +#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ @@ -1034,24 +853,20 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) -#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 +#else #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) @@ -1067,20 +882,6 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif -#else - #define CYTHON_PEP393_ENABLED 0 - #define PyUnicode_1BYTE_KIND 1 - #define PyUnicode_2BYTE_KIND 2 - #define PyUnicode_4BYTE_KIND 4 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) @@ -1094,8 +895,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif - #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) - #undef PyUnicode_Contains + #if !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) @@ -1105,33 +905,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif -#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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#ifndef PyObject_Unicode - #define PyObject_Unicode PyObject_Str -#endif -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) @@ -1148,28 +922,83 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif +#if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) + #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) + #else + #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i) + #endif +#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS + #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) + #else + #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) + #endif +#else + #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) +#endif +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 +#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) +#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyObject_GetItem(dict, key); + if (*result == NULL) { + if (PyErr_ExceptionMatches(PyExc_KeyError)) { + PyErr_Clear(); + return 0; + } + return -1; + } + return 1; +} +#else +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyDict_GetItemWithError(dict, key); + if (*result == NULL) { + return PyErr_Occurred() ? -1 : 0; + } + Py_INCREF(*result); + return 1; +} +#endif +#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST + #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj) +#else + #define __Pyx_VISIT_CONST(obj) +#endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i) +#endif +#if CYTHON_ASSUME_SAFE_SIZE #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o) #else - #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) - #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) - #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) - #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) #endif -#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { @@ -1178,64 +1007,108 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, return module; } #endif -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define __Pyx_Py3Int_Check(op) PyLong_Check(op) - #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#else - #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) - #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t +#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t +#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t +#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 + #define __Pyx_PySendResult PySendResult #else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t + typedef enum { + PYGEN_RETURN = 0, + PYGEN_ERROR = -1, + PYGEN_NEXT = 1, + } __Pyx_PySendResult; +#endif +#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3 + typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result); +#else + #define __Pyx_pyiter_sendfunc sendfunc #endif -#if CYTHON_USE_ASYNC_SLOTS - #if PY_VERSION_HEX >= 0x030500B1 - #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods - #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) - #else - #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) - #endif +#if !CYTHON_USE_AM_SEND +#define __PYX_HAS_PY_AM_SEND 0 +#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000 +#define __PYX_HAS_PY_AM_SEND 1 #else - #define __Pyx_PyType_AsAsync(obj) NULL +#define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation #endif -#ifndef __Pyx_PyAsyncMethodsStruct +#if __PYX_HAS_PY_AM_SEND < 2 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods +#else typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; + __Pyx_pyiter_sendfunc am_send; } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s)) +#endif +#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0 + #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21) +#else + #define __Pyx_TPFLAGS_HAVE_AM_SEND (0) +#endif +#if PY_VERSION_HEX >= 0x03090000 +#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get() +#else +#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp +#endif +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000 +#ifdef __cplusplus +extern "C" +#endif +PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize); +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) { + int value; + PyObject *py_value = PyObject_GetAttrString(inspect, name); + if (!py_value) return 0; + value = (int) PyLong_AsLong(py_value); + Py_DECREF(py_value); + *write_to = value; + return value != -1 || !PyErr_Occurred(); +} +static int __Pyx_init_co_variables(void) { + PyObject *inspect; + int result; + inspect = PyImport_ImportModule("inspect"); + result = +#if !defined(CO_OPTIMIZED) + __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) && +#endif +#if !defined(CO_NEWLOCALS) + __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) && +#endif +#if !defined(CO_VARARGS) + __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) && +#endif +#if !defined(CO_VARKEYWORDS) + __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) && +#endif +#if !defined(CO_ASYNC_GENERATOR) + __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) && +#endif +#if !defined(CO_GENERATOR) + __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) && +#endif +#if !defined(CO_COROUTINE) + __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) && +#endif + 1; + Py_DECREF(inspect); + return result ? 0 : -1; +} +#else +static int __Pyx_init_co_variables(void) { + return 0; // It's a limited API-only feature +} #endif +/* MathInitCode */ #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) - #if !defined(_USE_MATH_DEFINES) + #ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES #endif #endif @@ -1255,8 +1128,17 @@ static CYTHON_INLINE float __PYX_NAN() { #define __Pyx_truncl truncl #endif -#define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0 +#endif +#ifndef CYTHON_CLINE_IN_TRACEBACK +#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#endif +#if CYTHON_CLINE_IN_TRACEBACK +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; } +#else +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; } +#endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } @@ -1281,22 +1163,57 @@ static CYTHON_INLINE float __PYX_NAN() { #include "citycrc.h" #include #include -#include -#include "pythread.h" -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + + #if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj) + #else + #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj, NULL) + #endif + +#include + + #if PY_MAJOR_VERSION <= 2 + #define PyDict_GetItemWithError _PyDict_GetItemWithError + #endif + + + #if PY_VERSION_HEX < 0x030d0000 + static CYTHON_INLINE int __Pyx_PyWeakref_GetRef(PyObject *ref, PyObject **pobj) + { + PyObject *obj = PyWeakref_GetObject(ref); + if (obj == NULL) { + // SystemError if ref is NULL + *pobj = NULL; + return -1; + } + if (obj == Py_None) { + *pobj = NULL; + return 0; + } + Py_INCREF(obj); + *pobj = obj; + return 1; + } + #else + #define __Pyx_PyWeakref_GetRef PyWeakref_GetRef + #endif + +#include "pythread.h" + + #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600) && !defined(PyContextVar_Get) + #define PyContextVar_Get(var, d, v) ((d) ? ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) : ((v)[0] = NULL, 0) ) + #endif + +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) +#define CYTHON_WITHOUT_ASSERTIONS +#endif #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -1339,19 +1256,23 @@ static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s) +#else + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s) +#endif #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) @@ -1360,32 +1281,44 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef) + return Py_NewRef(obj); +#else + Py_INCREF(obj); + return obj; +#endif +} +static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef) + return Py_XNewRef(obj); +#else + Py_XINCREF(obj); + return obj; +#endif +} +static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b); static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x) #else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x) #endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x)) #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK @@ -1432,81 +1365,12 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -#include -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = (char) c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL) #else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#include -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #endif @@ -1518,29 +1382,196 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) { #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ +/* PretendToInitialize */ +#ifdef __cplusplus +#if __cplusplus > 201103L +#include +#endif +template +static void __Pyx_pretend_to_initialize(T* ptr) { +#if __cplusplus > 201103L + if ((std::is_trivially_default_constructible::value)) +#endif + *ptr = T(); + (void)ptr; +} +#else static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } +#endif + #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; -static const char * __pyx_cfilenm = __FILE__; +static const char * const __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ -static const char *__pyx_f[] = { +static const char* const __pyx_f[] = { "src/cityhashcrc.pyx", - "contextvars.pxd", - "type.pxd", - "bool.pxd", - "complex.pxd", + "cpython/contextvars.pxd", + "cpython/type.pxd", + "cpython/bool.pxd", + "cpython/complex.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ -/* ForceInitThreads.proto */ -#ifndef __PYX_FORCE_INIT_THREADS - #define __PYX_FORCE_INIT_THREADS 0 +/* Atomics.proto */ +#include +#ifndef CYTHON_ATOMICS + #define CYTHON_ATOMICS 1 +#endif +#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS +#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __pyx_atomic_int_type int +#define __pyx_nonatomic_int_type int +#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ + (__STDC_VERSION__ >= 201112L) &&\ + !defined(__STDC_NO_ATOMICS__)) + #include +#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ + (__cplusplus >= 201103L) ||\ + (defined(_MSC_VER) && _MSC_VER >= 1700))) + #include +#endif +#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ + (__STDC_VERSION__ >= 201112L) &&\ + !defined(__STDC_NO_ATOMICS__) &&\ + ATOMIC_INT_LOCK_FREE == 2) + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type atomic_int + #define __pyx_atomic_ptr_type atomic_uintptr_t + #define __pyx_nonatomic_ptr_type uintptr_t + #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed) + #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel) + #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel) + #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg) + #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired) + #define __pyx_atomic_load(value) atomic_load(value) + #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value) + #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed) + #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire) + #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) + #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) + #pragma message ("Using standard C atomics") + #elif defined(__PYX_DEBUG_ATOMICS) + #warning "Using standard C atomics" + #endif +#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ + (__cplusplus >= 201103L) ||\ +\ + (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\ + ATOMIC_INT_LOCK_FREE == 2) + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type std::atomic_int + #define __pyx_atomic_ptr_type std::atomic_uintptr_t + #define __pyx_nonatomic_ptr_type uintptr_t + #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed) + #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel) + #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel) + #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg) + #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired) + #define __pyx_atomic_load(value) std::atomic_load(value) + #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value) + #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed) + #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire) + #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) + #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) + #pragma message ("Using standard C++ atomics") + #elif defined(__PYX_DEBUG_ATOMICS) + #warning "Using standard C++ atomics" + #endif +#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\ + (__GNUC_MINOR__ > 1 ||\ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2)))) + #define __pyx_atomic_ptr_type void* + #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1) + #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1) + #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1) + #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg) + static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { + __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired); + int result = old == *expected; + *expected = old; + return result; + } + #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0) + #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value) + #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0) + #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0) + #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using GNU atomics" + #endif +#elif CYTHON_ATOMICS && defined(_MSC_VER) + #include + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type long + #define __pyx_atomic_ptr_type void* + #undef __pyx_nonatomic_int_type + #define __pyx_nonatomic_int_type long + #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer) + #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1) + #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1) + #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1) + #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg) + static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { + __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected); + int result = old == *expected; + *expected = old; + return result; + } + #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0) + #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value) + #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value + #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0) + #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value) + #ifdef __PYX_DEBUG_ATOMICS + #pragma message ("Using MSVC atomics") + #endif +#else + #undef CYTHON_ATOMICS + #define CYTHON_ATOMICS 0 + #ifdef __PYX_DEBUG_ATOMICS + #warning "Not using atomics" + #endif +#endif +#if CYTHON_ATOMICS + #define __pyx_add_acquisition_count(memview)\ + __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview)) + #define __pyx_sub_acquisition_count(memview)\ + __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview)) +#else + #define __pyx_add_acquisition_count(memview)\ + __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) + #define __pyx_sub_acquisition_count(memview)\ + __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) +#endif + +/* CriticalSections.proto */ +#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __Pyx_PyCriticalSection void* +#define __Pyx_PyCriticalSection2 void* +#define __Pyx_PyCriticalSection_Begin1(cs, arg) (void)cs +#define __Pyx_PyCriticalSection_Begin2(cs, arg1, arg2) (void)cs +#define __Pyx_PyCriticalSection_End1(cs) +#define __Pyx_PyCriticalSection_End2(cs) +#else +#define __Pyx_PyCriticalSection PyCriticalSection +#define __Pyx_PyCriticalSection2 PyCriticalSection2 +#define __Pyx_PyCriticalSection_Begin1 PyCriticalSection_Begin +#define __Pyx_PyCriticalSection_Begin2 PyCriticalSection2_Begin +#define __Pyx_PyCriticalSection_End1 PyCriticalSection_End +#define __Pyx_PyCriticalSection_End2 PyCriticalSection2_End +#endif +#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_BEGIN_CRITICAL_SECTION(o) { +#define __Pyx_END_CRITICAL_SECTION() } +#else +#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION +#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION #endif /* #### Code section: numeric_typedefs ### */ @@ -1551,25 +1582,25 @@ static const char *__pyx_f[] = { struct __pyx_opt_args_7cpython_11contextvars_get_value; struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default; -/* "cpython/contextvars.pxd":112 - * +/* "cpython/contextvars.pxd":116 * + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the default value of the context variable, - */ +*/ struct __pyx_opt_args_7cpython_11contextvars_get_value { int __pyx_n; PyObject *default_value; }; -/* "cpython/contextvars.pxd":129 - * +/* "cpython/contextvars.pxd":134 * + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the provided default value if no such value was found. - */ +*/ struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default { int __pyx_n; PyObject *default_value; @@ -1593,7 +1624,6 @@ struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default { static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ @@ -1607,11 +1637,6 @@ struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default { __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) - #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() -#endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ @@ -1728,7 +1753,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObj #include /* JoinPyUnicode.proto */ -static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, +static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char); /* PyFunctionFastCall.proto */ @@ -1736,7 +1761,7 @@ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_co #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) @@ -1746,12 +1771,6 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" -#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else @@ -1780,14 +1799,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); - -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +#endif +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif @@ -1799,50 +1817,37 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i) #elif CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) -#else - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) -#endif -#if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) - #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i)) #else - #define __Pyx_Arg_NewRef_VARARGS(arg) arg - #define __Pyx_Arg_XDECREF_VARARGS(arg) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i)) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL - #define __Pyx_Arg_FASTCALL(args, i) args[i] - #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i]) + #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif - #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs - to have the same reference counting */ - #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else - #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS + #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS - #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) - #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS -#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) -#else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) +#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start) +#else #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif @@ -1850,10 +1855,65 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, - const char* function_name); +static CYTHON_INLINE int __Pyx_ParseKeywords( + PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[], + PyObject *kwds2, PyObject *values[], + Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); + +/* CallCFunction.proto */ +#define __Pyx_CallCFunction(cfunc, self, args)\ + ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args) +#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\ + ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs) +#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\ + ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs) +#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\ + ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames) + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS + __pyx_atomic_int_type initialized; +#endif + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) { +#if !CYTHON_ATOMICS + return 1; +#else + __pyx_nonatomic_int_type expected = 0; + if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) { + return 0; + } + return expected; +#endif +} +static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) { +#if CYTHON_ATOMICS + __pyx_atomic_store(&cfunc->initialized, 2); +#endif +} +#else +#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2 +#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc) +#endif + +/* CallUnboundCMethod2.proto */ +CYTHON_UNUSED +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); +#else +#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) +#endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, @@ -1872,24 +1932,27 @@ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_12 -#define __PYX_HAVE_RT_ImportType_proto_3_0_12 +#ifndef __PYX_HAVE_RT_ImportType_proto_3_1_4 +#define __PYX_HAVE_RT_ImportType_proto_3_1_4 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) alignof(s) +#define __PYX_GET_STRUCT_ALIGNMENT_3_1_4(s) alignof(s) #else -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) sizeof(void*) +#define __PYX_GET_STRUCT_ALIGNMENT_3_1_4(s) sizeof(void*) #endif -enum __Pyx_ImportType_CheckSize_3_0_12 { - __Pyx_ImportType_CheckSize_Error_3_0_12 = 0, - __Pyx_ImportType_CheckSize_Warn_3_0_12 = 1, - __Pyx_ImportType_CheckSize_Ignore_3_0_12 = 2 +enum __Pyx_ImportType_CheckSize_3_1_4 { + __Pyx_ImportType_CheckSize_Error_3_1_4 = 0, + __Pyx_ImportType_CheckSize_Warn_3_1_4 = 1, + __Pyx_ImportType_CheckSize_Ignore_3_1_4 = 2 }; -static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size); +static PyTypeObject *__Pyx_ImportType_3_1_4(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_4 check_size); #endif +/* ListPack.proto */ +static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...); + /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) @@ -1917,28 +1980,33 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN #endif /* CLineInTraceback.proto */ -#ifdef CYTHON_CLINE_IN_TRACEBACK -#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) -#else +#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#else +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #endif /* CodeObjectCache.proto */ -#if !CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject __Pyx_CachedCodeObjectType; +#else +typedef PyCodeObject __Pyx_CachedCodeObjectType; +#endif typedef struct { - PyCodeObject* code_object; + __Pyx_CachedCodeObjectType* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_int_type accessor_count; + #endif }; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); -#endif +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -1949,33 +2017,52 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #define __Pyx_HAS_GCC_DIAGNOSTIC #endif -/* None.proto */ -#include - /* CIntFromPy.proto */ -static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *); +static CYTHON_INLINE uint64_t __Pyx_PyLong_As_uint64_t(PyObject *); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" -static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 +#define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName #else +static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp); +#endif +#else // !LIMITED_API typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" -#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif +/* PyObjectVectorCallKwBuilder.proto */ +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#if CYTHON_VECTORCALL +#if PY_VERSION_HEX >= 0x03090000 +#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall +#endif +#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n) +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict +#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n) +#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value) +#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value) +#endif + /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value); /* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON @@ -1989,21 +2076,77 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) -#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) { + return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2); +} #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) +#ifdef PyExceptionInstance_Check + #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj) +#else + #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException) +#endif -/* CheckBinaryVersion.proto */ +/* GetRuntimeVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); + +/* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); +/* MultiPhaseInitModuleState.proto */ +#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE +static PyObject *__Pyx_State_FindModule(void*); +static int __Pyx_State_AddModule(PyObject* module, void*); +static int __Pyx_State_RemoveModule(void*); +#elif CYTHON_USE_MODULE_STATE +#define __Pyx_State_FindModule PyState_FindModule +#define __Pyx_State_AddModule PyState_AddModule +#define __Pyx_State_RemoveModule PyState_RemoveModule +#endif /* #### Code section: module_declarations ### */ +/* CythonABIVersion.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API + #if CYTHON_METH_FASTCALL + #define __PYX_FASTCALL_ABI_SUFFIX "_fastcall" + #else + #define __PYX_FASTCALL_ABI_SUFFIX + #endif + #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX +#else + #define __PYX_LIMITED_ABI_SUFFIX +#endif +#if __PYX_HAS_PY_AM_SEND == 1 + #define __PYX_AM_SEND_ABI_SUFFIX +#elif __PYX_HAS_PY_AM_SEND == 2 + #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport" +#else + #define __PYX_AM_SEND_ABI_SUFFIX "noamsend" +#endif +#ifndef __PYX_MONITORING_ABI_SUFFIX + #define __PYX_MONITORING_ABI_SUFFIX +#endif +#if CYTHON_USE_TP_FINALIZE + #define __PYX_TP_FINALIZE_ABI_SUFFIX +#else + #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize" +#endif +#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED) + #define __PYX_FREELISTS_ABI_SUFFIX +#else + #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists" +#endif +#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." + +#if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/ +#endif +#if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/ +#endif /* Module declarations from "cpython.version" */ @@ -2037,8 +2180,6 @@ static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComp /* Module declarations from "cpython.number" */ -/* Module declarations from "cpython.int" */ - /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.bool" */ @@ -2047,12 +2188,12 @@ static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComp /* Module declarations from "cpython.float" */ +/* Module declarations from "cython" */ + /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.complex" */ -/* Module declarations from "cpython.string" */ - /* Module declarations from "libc.stddef" */ /* Module declarations from "cpython.unicode" */ @@ -2075,10 +2216,6 @@ static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComp /* Module declarations from "cpython.pystate" */ -/* Module declarations from "cpython.cobject" */ - -/* Module declarations from "cpython.oldbuffer" */ - /* Module declarations from "cpython.set" */ /* Module declarations from "cpython.buffer" */ @@ -2103,11 +2240,10 @@ int __pyx_module_is_main_cityhashcrc = 0; /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_TypeError; /* #### Code section: string_decls ### */ -static const char __pyx_k__8[] = "?"; +static const char __pyx_k_[] = "?"; static const char __pyx_k_all[] = "__all__"; -static const char __pyx_k_buf[] = "buf"; static const char __pyx_k_got[] = ", got '"; -static const char __pyx_k_out[] = "out"; +static const char __pyx_k_pop[] = "pop"; static const char __pyx_k_data[] = "data"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; @@ -2115,35 +2251,43 @@ static const char __pyx_k_seed[] = "seed"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_0_4_7[] = "0.4.7"; static const char __pyx_k_email[] = "__email__"; -static const char __pyx_k_first[] = "first"; -static const char __pyx_k_tseed[] = "tseed"; static const char __pyx_k_author[] = "__author__"; static const char __pyx_k_buffer[] = "buffer"; -static const char __pyx_k_result[] = "result"; -static const char __pyx_k_second[] = "second"; +static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_instead[] = "' instead"; static const char __pyx_k_version[] = "__version__"; static const char __pyx_k_Argument[] = "Argument '"; -static const char __pyx_k_encoding[] = "encoding"; +static const char __pyx_k_add_note[] = "add_note"; +static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_basestring[] = "basestring"; static const char __pyx_k_cityhashcrc[] = "cityhashcrc"; -static const char __pyx_k_encoding_size[] = "encoding_size"; static const char __pyx_k_CityHashCrc128[] = "CityHashCrc128"; static const char __pyx_k_Eugene_Scherba[] = "Eugene Scherba"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_CityHashCrc256Bytes[] = "CityHashCrc256Bytes"; -static const char __pyx_k_src_cityhashcrc_pyx[] = "src/cityhashcrc.pyx"; static const char __pyx_k_CityHashCrc128WithSeed[] = "CityHashCrc128WithSeed"; static const char __pyx_k_escherba_cityhash_gmail_com[] = "escherba+cityhash@gmail.com"; static const char __pyx_k_has_incorrect_type_expected[] = "' has incorrect type: expected "; static const char __pyx_k_Python_wrapper_for_CityHash_CRC[] = "\nPython wrapper for CityHash-CRC\n"; +static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False."; /* #### Code section: decls ### */ static PyObject *__pyx_pf_11cityhashcrc_CityHashCrc128(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_11cityhashcrc_2CityHashCrc256Bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_seed); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ +/* SmallCodeConfig */ +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; @@ -2169,555 +2313,222 @@ typedef struct { #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif PyTypeObject *__pyx_ptype_7cpython_4type_type; - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE + PyTypeObject *__pyx_ptype_7cpython_4bool_bool; + PyTypeObject *__pyx_ptype_7cpython_7complex_complex; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; + PyObject *__pyx_string_tab[30]; + PyObject *__pyx_int_0L; + PyObject *__pyx_int_64L; + PyObject *__pyx_int_0xffffffffffffffffL; +/* #### Code section: module_state_contents ### */ +/* CodeObjectCache.module_state_decls */ +struct __Pyx_CodeObjectCache __pyx_code_cache; + +/* #### Code section: module_state_end ### */ +} __pyx_mstatetype; + +#if CYTHON_USE_MODULE_STATE +#ifdef __cplusplus +namespace { +extern struct PyModuleDef __pyx_moduledef; +} /* anonymous namespace */ +#else +static struct PyModuleDef __pyx_moduledef; +#endif + +#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef))) + +#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef)) +#else +static __pyx_mstatetype __pyx_mstate_global_static = +#ifdef __cplusplus + {}; +#else + {0}; +#endif +static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: constant_name_defines ### */ +#define __pyx_kp_u_ __pyx_string_tab[0] +#define __pyx_kp_u_0_4_7 __pyx_string_tab[1] +#define __pyx_kp_u_Argument __pyx_string_tab[2] +#define __pyx_n_u_CityHashCrc128 __pyx_string_tab[3] +#define __pyx_n_u_CityHashCrc128WithSeed __pyx_string_tab[4] +#define __pyx_n_u_CityHashCrc256Bytes __pyx_string_tab[5] +#define __pyx_kp_u_Eugene_Scherba __pyx_string_tab[6] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[7] +#define __pyx_n_u_TypeError __pyx_string_tab[8] +#define __pyx_kp_u_add_note __pyx_string_tab[9] +#define __pyx_n_u_all __pyx_string_tab[10] +#define __pyx_n_u_author __pyx_string_tab[11] +#define __pyx_n_u_basestring __pyx_string_tab[12] +#define __pyx_n_u_buffer __pyx_string_tab[13] +#define __pyx_n_u_cityhashcrc __pyx_string_tab[14] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[15] +#define __pyx_n_u_data __pyx_string_tab[16] +#define __pyx_n_u_email __pyx_string_tab[17] +#define __pyx_kp_u_escherba_cityhash_gmail_com __pyx_string_tab[18] +#define __pyx_kp_u_got __pyx_string_tab[19] +#define __pyx_kp_u_has_incorrect_type_expected __pyx_string_tab[20] +#define __pyx_kp_u_instead __pyx_string_tab[21] +#define __pyx_n_u_main __pyx_string_tab[22] +#define __pyx_n_u_module __pyx_string_tab[23] +#define __pyx_n_u_name __pyx_string_tab[24] +#define __pyx_n_u_pop __pyx_string_tab[25] +#define __pyx_n_u_qualname __pyx_string_tab[26] +#define __pyx_n_u_seed __pyx_string_tab[27] +#define __pyx_n_u_test __pyx_string_tab[28] +#define __pyx_n_u_version __pyx_string_tab[29] +/* #### Code section: module_state_clear ### */ +#if CYTHON_USE_MODULE_STATE +static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { + __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m); + if (!clear_module_state) return 0; + Py_CLEAR(clear_module_state->__pyx_d); + Py_CLEAR(clear_module_state->__pyx_b); + Py_CLEAR(clear_module_state->__pyx_cython_runtime); + Py_CLEAR(clear_module_state->__pyx_empty_tuple); + Py_CLEAR(clear_module_state->__pyx_empty_bytes); + Py_CLEAR(clear_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif - #if CYTHON_USE_MODULE_STATE + #ifdef __Pyx_FusedFunction_USED + Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif - #if CYTHON_USE_MODULE_STATE + #if CYTHON_PEP489_MULTI_PHASE_INIT + __Pyx_State_RemoveModule(NULL); #endif - #if CYTHON_USE_MODULE_STATE + Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); + Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool); + Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex); + for (int i=0; i<30; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + Py_CLEAR(clear_module_state->__pyx_int_0L); + Py_CLEAR(clear_module_state->__pyx_int_64L); + Py_CLEAR(clear_module_state->__pyx_int_0xffffffffffffffffL); + return 0; +} +#endif +/* #### Code section: module_state_traverse ### */ +#if CYTHON_USE_MODULE_STATE +static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m); + if (!traverse_module_state) return 0; + Py_VISIT(traverse_module_state->__pyx_d); + Py_VISIT(traverse_module_state->__pyx_b); + Py_VISIT(traverse_module_state->__pyx_cython_runtime); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - PyTypeObject *__pyx_ptype_7cpython_4bool_bool; - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - PyTypeObject *__pyx_ptype_7cpython_7complex_complex; - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - PyObject *__pyx_kp_u_0_4_7; - PyObject *__pyx_kp_u_Argument; - PyObject *__pyx_n_s_CityHashCrc128; - PyObject *__pyx_n_u_CityHashCrc128; - PyObject *__pyx_n_s_CityHashCrc128WithSeed; - PyObject *__pyx_n_u_CityHashCrc128WithSeed; - PyObject *__pyx_n_s_CityHashCrc256Bytes; - PyObject *__pyx_n_u_CityHashCrc256Bytes; - PyObject *__pyx_kp_u_Eugene_Scherba; - PyObject *__pyx_n_s_TypeError; - PyObject *__pyx_n_s__8; - PyObject *__pyx_n_s_all; - PyObject *__pyx_n_s_author; - PyObject *__pyx_n_u_basestring; - PyObject *__pyx_n_s_buf; - PyObject *__pyx_n_u_buffer; - PyObject *__pyx_n_s_cityhashcrc; - PyObject *__pyx_n_s_cline_in_traceback; - PyObject *__pyx_n_s_data; - PyObject *__pyx_n_u_data; - PyObject *__pyx_n_s_email; - PyObject *__pyx_n_s_encoding; - PyObject *__pyx_n_s_encoding_size; - PyObject *__pyx_kp_u_escherba_cityhash_gmail_com; - PyObject *__pyx_n_s_first; - PyObject *__pyx_kp_u_got; - PyObject *__pyx_kp_u_has_incorrect_type_expected; - PyObject *__pyx_kp_u_instead; - PyObject *__pyx_n_s_main; - PyObject *__pyx_n_s_name; - PyObject *__pyx_n_s_out; - PyObject *__pyx_n_s_result; - PyObject *__pyx_n_s_second; - PyObject *__pyx_n_s_seed; - PyObject *__pyx_kp_s_src_cityhashcrc_pyx; - PyObject *__pyx_n_s_test; - PyObject *__pyx_n_s_tseed; - PyObject *__pyx_n_s_version; - PyObject *__pyx_int_0L; - PyObject *__pyx_int_64L; - PyObject *__pyx_int_0xffffffffffffffffL; - PyObject *__pyx_k_; - PyObject *__pyx_tuple__2; - PyObject *__pyx_tuple__4; - PyObject *__pyx_tuple__6; - PyObject *__pyx_codeobj__3; - PyObject *__pyx_codeobj__5; - PyObject *__pyx_codeobj__7; -} __pyx_mstate; - -#if CYTHON_USE_MODULE_STATE -#ifdef __cplusplus -namespace { - extern struct PyModuleDef __pyx_moduledef; -} /* anonymous namespace */ -#else -static struct PyModuleDef __pyx_moduledef; -#endif - -#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) - -#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) - -#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) -#else -static __pyx_mstate __pyx_mstate_global_static = -#ifdef __cplusplus - {}; -#else - {0}; -#endif -static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; -#endif -/* #### Code section: module_state_clear ### */ -#if CYTHON_USE_MODULE_STATE -static int __pyx_m_clear(PyObject *m) { - __pyx_mstate *clear_module_state = __pyx_mstate(m); - if (!clear_module_state) return 0; - Py_CLEAR(clear_module_state->__pyx_d); - Py_CLEAR(clear_module_state->__pyx_b); - Py_CLEAR(clear_module_state->__pyx_cython_runtime); - Py_CLEAR(clear_module_state->__pyx_empty_tuple); - Py_CLEAR(clear_module_state->__pyx_empty_bytes); - Py_CLEAR(clear_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_CLEAR(clear_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); - #endif - Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); - Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool); - Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex); - Py_CLEAR(clear_module_state->__pyx_kp_u_0_4_7); - Py_CLEAR(clear_module_state->__pyx_kp_u_Argument); - Py_CLEAR(clear_module_state->__pyx_n_s_CityHashCrc128); - Py_CLEAR(clear_module_state->__pyx_n_u_CityHashCrc128); - Py_CLEAR(clear_module_state->__pyx_n_s_CityHashCrc128WithSeed); - Py_CLEAR(clear_module_state->__pyx_n_u_CityHashCrc128WithSeed); - Py_CLEAR(clear_module_state->__pyx_n_s_CityHashCrc256Bytes); - Py_CLEAR(clear_module_state->__pyx_n_u_CityHashCrc256Bytes); - Py_CLEAR(clear_module_state->__pyx_kp_u_Eugene_Scherba); - Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); - Py_CLEAR(clear_module_state->__pyx_n_s__8); - Py_CLEAR(clear_module_state->__pyx_n_s_all); - Py_CLEAR(clear_module_state->__pyx_n_s_author); - Py_CLEAR(clear_module_state->__pyx_n_u_basestring); - Py_CLEAR(clear_module_state->__pyx_n_s_buf); - Py_CLEAR(clear_module_state->__pyx_n_u_buffer); - Py_CLEAR(clear_module_state->__pyx_n_s_cityhashcrc); - Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); - Py_CLEAR(clear_module_state->__pyx_n_s_data); - Py_CLEAR(clear_module_state->__pyx_n_u_data); - Py_CLEAR(clear_module_state->__pyx_n_s_email); - Py_CLEAR(clear_module_state->__pyx_n_s_encoding); - Py_CLEAR(clear_module_state->__pyx_n_s_encoding_size); - Py_CLEAR(clear_module_state->__pyx_kp_u_escherba_cityhash_gmail_com); - Py_CLEAR(clear_module_state->__pyx_n_s_first); - Py_CLEAR(clear_module_state->__pyx_kp_u_got); - Py_CLEAR(clear_module_state->__pyx_kp_u_has_incorrect_type_expected); - Py_CLEAR(clear_module_state->__pyx_kp_u_instead); - Py_CLEAR(clear_module_state->__pyx_n_s_main); - Py_CLEAR(clear_module_state->__pyx_n_s_name); - Py_CLEAR(clear_module_state->__pyx_n_s_out); - Py_CLEAR(clear_module_state->__pyx_n_s_result); - Py_CLEAR(clear_module_state->__pyx_n_s_second); - Py_CLEAR(clear_module_state->__pyx_n_s_seed); - Py_CLEAR(clear_module_state->__pyx_kp_s_src_cityhashcrc_pyx); - Py_CLEAR(clear_module_state->__pyx_n_s_test); - Py_CLEAR(clear_module_state->__pyx_n_s_tseed); - Py_CLEAR(clear_module_state->__pyx_n_s_version); - Py_CLEAR(clear_module_state->__pyx_int_0L); - Py_CLEAR(clear_module_state->__pyx_int_64L); - Py_CLEAR(clear_module_state->__pyx_int_0xffffffffffffffffL); - Py_CLEAR(clear_module_state->__pyx_k_); - Py_CLEAR(clear_module_state->__pyx_tuple__2); - Py_CLEAR(clear_module_state->__pyx_tuple__4); - Py_CLEAR(clear_module_state->__pyx_tuple__6); - Py_CLEAR(clear_module_state->__pyx_codeobj__3); - Py_CLEAR(clear_module_state->__pyx_codeobj__5); - Py_CLEAR(clear_module_state->__pyx_codeobj__7); - return 0; -} -#endif -/* #### Code section: module_state_traverse ### */ -#if CYTHON_USE_MODULE_STATE -static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { - __pyx_mstate *traverse_module_state = __pyx_mstate(m); - if (!traverse_module_state) return 0; - Py_VISIT(traverse_module_state->__pyx_d); - Py_VISIT(traverse_module_state->__pyx_b); - Py_VISIT(traverse_module_state->__pyx_cython_runtime); - Py_VISIT(traverse_module_state->__pyx_empty_tuple); - Py_VISIT(traverse_module_state->__pyx_empty_bytes); - Py_VISIT(traverse_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_VISIT(traverse_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); + #ifdef __Pyx_FusedFunction_USED + Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool); Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex); - Py_VISIT(traverse_module_state->__pyx_kp_u_0_4_7); - Py_VISIT(traverse_module_state->__pyx_kp_u_Argument); - Py_VISIT(traverse_module_state->__pyx_n_s_CityHashCrc128); - Py_VISIT(traverse_module_state->__pyx_n_u_CityHashCrc128); - Py_VISIT(traverse_module_state->__pyx_n_s_CityHashCrc128WithSeed); - Py_VISIT(traverse_module_state->__pyx_n_u_CityHashCrc128WithSeed); - Py_VISIT(traverse_module_state->__pyx_n_s_CityHashCrc256Bytes); - Py_VISIT(traverse_module_state->__pyx_n_u_CityHashCrc256Bytes); - Py_VISIT(traverse_module_state->__pyx_kp_u_Eugene_Scherba); - Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); - Py_VISIT(traverse_module_state->__pyx_n_s__8); - Py_VISIT(traverse_module_state->__pyx_n_s_all); - Py_VISIT(traverse_module_state->__pyx_n_s_author); - Py_VISIT(traverse_module_state->__pyx_n_u_basestring); - Py_VISIT(traverse_module_state->__pyx_n_s_buf); - Py_VISIT(traverse_module_state->__pyx_n_u_buffer); - Py_VISIT(traverse_module_state->__pyx_n_s_cityhashcrc); - Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); - Py_VISIT(traverse_module_state->__pyx_n_s_data); - Py_VISIT(traverse_module_state->__pyx_n_u_data); - Py_VISIT(traverse_module_state->__pyx_n_s_email); - Py_VISIT(traverse_module_state->__pyx_n_s_encoding); - Py_VISIT(traverse_module_state->__pyx_n_s_encoding_size); - Py_VISIT(traverse_module_state->__pyx_kp_u_escherba_cityhash_gmail_com); - Py_VISIT(traverse_module_state->__pyx_n_s_first); - Py_VISIT(traverse_module_state->__pyx_kp_u_got); - Py_VISIT(traverse_module_state->__pyx_kp_u_has_incorrect_type_expected); - Py_VISIT(traverse_module_state->__pyx_kp_u_instead); - Py_VISIT(traverse_module_state->__pyx_n_s_main); - Py_VISIT(traverse_module_state->__pyx_n_s_name); - Py_VISIT(traverse_module_state->__pyx_n_s_out); - Py_VISIT(traverse_module_state->__pyx_n_s_result); - Py_VISIT(traverse_module_state->__pyx_n_s_second); - Py_VISIT(traverse_module_state->__pyx_n_s_seed); - Py_VISIT(traverse_module_state->__pyx_kp_s_src_cityhashcrc_pyx); - Py_VISIT(traverse_module_state->__pyx_n_s_test); - Py_VISIT(traverse_module_state->__pyx_n_s_tseed); - Py_VISIT(traverse_module_state->__pyx_n_s_version); - Py_VISIT(traverse_module_state->__pyx_int_0L); - Py_VISIT(traverse_module_state->__pyx_int_64L); - Py_VISIT(traverse_module_state->__pyx_int_0xffffffffffffffffL); - Py_VISIT(traverse_module_state->__pyx_k_); - Py_VISIT(traverse_module_state->__pyx_tuple__2); - Py_VISIT(traverse_module_state->__pyx_tuple__4); - Py_VISIT(traverse_module_state->__pyx_tuple__6); - Py_VISIT(traverse_module_state->__pyx_codeobj__3); - Py_VISIT(traverse_module_state->__pyx_codeobj__5); - Py_VISIT(traverse_module_state->__pyx_codeobj__7); + for (int i=0; i<30; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0L); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_64L); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0xffffffffffffffffL); return 0; } #endif -/* #### Code section: module_state_defines ### */ -#define __pyx_d __pyx_mstate_global->__pyx_d -#define __pyx_b __pyx_mstate_global->__pyx_b -#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime -#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple -#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes -#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode -#ifdef __Pyx_CyFunction_USED -#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType -#endif -#ifdef __Pyx_FusedFunction_USED -#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType -#endif -#ifdef __Pyx_Generator_USED -#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType -#endif -#ifdef __Pyx_IterableCoroutine_USED -#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_ptype_7cpython_4bool_bool __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_ptype_7cpython_7complex_complex __pyx_mstate_global->__pyx_ptype_7cpython_7complex_complex -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_kp_u_0_4_7 __pyx_mstate_global->__pyx_kp_u_0_4_7 -#define __pyx_kp_u_Argument __pyx_mstate_global->__pyx_kp_u_Argument -#define __pyx_n_s_CityHashCrc128 __pyx_mstate_global->__pyx_n_s_CityHashCrc128 -#define __pyx_n_u_CityHashCrc128 __pyx_mstate_global->__pyx_n_u_CityHashCrc128 -#define __pyx_n_s_CityHashCrc128WithSeed __pyx_mstate_global->__pyx_n_s_CityHashCrc128WithSeed -#define __pyx_n_u_CityHashCrc128WithSeed __pyx_mstate_global->__pyx_n_u_CityHashCrc128WithSeed -#define __pyx_n_s_CityHashCrc256Bytes __pyx_mstate_global->__pyx_n_s_CityHashCrc256Bytes -#define __pyx_n_u_CityHashCrc256Bytes __pyx_mstate_global->__pyx_n_u_CityHashCrc256Bytes -#define __pyx_kp_u_Eugene_Scherba __pyx_mstate_global->__pyx_kp_u_Eugene_Scherba -#define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError -#define __pyx_n_s__8 __pyx_mstate_global->__pyx_n_s__8 -#define __pyx_n_s_all __pyx_mstate_global->__pyx_n_s_all -#define __pyx_n_s_author __pyx_mstate_global->__pyx_n_s_author -#define __pyx_n_u_basestring __pyx_mstate_global->__pyx_n_u_basestring -#define __pyx_n_s_buf __pyx_mstate_global->__pyx_n_s_buf -#define __pyx_n_u_buffer __pyx_mstate_global->__pyx_n_u_buffer -#define __pyx_n_s_cityhashcrc __pyx_mstate_global->__pyx_n_s_cityhashcrc -#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback -#define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data -#define __pyx_n_u_data __pyx_mstate_global->__pyx_n_u_data -#define __pyx_n_s_email __pyx_mstate_global->__pyx_n_s_email -#define __pyx_n_s_encoding __pyx_mstate_global->__pyx_n_s_encoding -#define __pyx_n_s_encoding_size __pyx_mstate_global->__pyx_n_s_encoding_size -#define __pyx_kp_u_escherba_cityhash_gmail_com __pyx_mstate_global->__pyx_kp_u_escherba_cityhash_gmail_com -#define __pyx_n_s_first __pyx_mstate_global->__pyx_n_s_first -#define __pyx_kp_u_got __pyx_mstate_global->__pyx_kp_u_got -#define __pyx_kp_u_has_incorrect_type_expected __pyx_mstate_global->__pyx_kp_u_has_incorrect_type_expected -#define __pyx_kp_u_instead __pyx_mstate_global->__pyx_kp_u_instead -#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main -#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name -#define __pyx_n_s_out __pyx_mstate_global->__pyx_n_s_out -#define __pyx_n_s_result __pyx_mstate_global->__pyx_n_s_result -#define __pyx_n_s_second __pyx_mstate_global->__pyx_n_s_second -#define __pyx_n_s_seed __pyx_mstate_global->__pyx_n_s_seed -#define __pyx_kp_s_src_cityhashcrc_pyx __pyx_mstate_global->__pyx_kp_s_src_cityhashcrc_pyx -#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test -#define __pyx_n_s_tseed __pyx_mstate_global->__pyx_n_s_tseed -#define __pyx_n_s_version __pyx_mstate_global->__pyx_n_s_version -#define __pyx_int_0L __pyx_mstate_global->__pyx_int_0L -#define __pyx_int_64L __pyx_mstate_global->__pyx_int_64L -#define __pyx_int_0xffffffffffffffffL __pyx_mstate_global->__pyx_int_0xffffffffffffffffL -#define __pyx_k_ __pyx_mstate_global->__pyx_k_ -#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 -#define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4 -#define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6 -#define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 -#define __pyx_codeobj__5 __pyx_mstate_global->__pyx_codeobj__5 -#define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 /* #### Code section: module_code ### */ -/* "cpython/complex.pxd":19 +/* "cpython/complex.pxd":20 * - * @property - * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<< - * return self.cval.real - * - */ + * # unavailable in limited API + * @property # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") + * cdef inline double real(self) noexcept: +*/ +#if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) { double __pyx_r; - /* "cpython/complex.pxd":20 - * @property + /* "cpython/complex.pxd":23 + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline double real(self) noexcept: * return self.cval.real # <<<<<<<<<<<<<< * - * @property - */ + * # unavailable in limited API +*/ __pyx_r = __pyx_v_self->cval.real; goto __pyx_L0; - /* "cpython/complex.pxd":19 - * - * @property - * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<< - * return self.cval.real + /* "cpython/complex.pxd":20 * - */ + * # unavailable in limited API + * @property # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") + * cdef inline double real(self) noexcept: +*/ /* function exit code */ __pyx_L0:; return __pyx_r; } +#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/ -/* "cpython/complex.pxd":23 - * - * @property - * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<< - * return self.cval.imag +/* "cpython/complex.pxd":26 * - */ + * # unavailable in limited API + * @property # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") + * cdef inline double imag(self) noexcept: +*/ +#if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) { double __pyx_r; - /* "cpython/complex.pxd":24 - * @property + /* "cpython/complex.pxd":29 + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline double imag(self) noexcept: * return self.cval.imag # <<<<<<<<<<<<<< * * # PyTypeObject PyComplex_Type - */ +*/ __pyx_r = __pyx_v_self->cval.imag; goto __pyx_L0; - /* "cpython/complex.pxd":23 - * - * @property - * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<< - * return self.cval.imag + /* "cpython/complex.pxd":26 * - */ + * # unavailable in limited API + * @property # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") + * cdef inline double imag(self) noexcept: +*/ /* function exit code */ __pyx_L0:; return __pyx_r; } +#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/ -/* "cpython/contextvars.pxd":112 +/* "cpython/contextvars.pxd":115 * * - * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") # <<<<<<<<<<<<<< + * cdef inline object get_value(var, default_value=None): * """Return a new reference to the value of the context variable, - * or the default value of the context variable, - */ +*/ +#if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value *__pyx_optional_args) { + + /* "cpython/contextvars.pxd":116 + * + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") + * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< + * """Return a new reference to the value of the context variable, + * or the default value of the context variable, +*/ PyObject *__pyx_v_default_value = ((PyObject *)Py_None); PyObject *__pyx_v_value; PyObject *__pyx_v_pyvalue = NULL; @@ -2729,104 +2540,104 @@ static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("get_value", 1); + __Pyx_RefNannySetupContext("get_value", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default_value = __pyx_optional_args->default_value; } } - /* "cpython/contextvars.pxd":117 + /* "cpython/contextvars.pxd":121 * or None if no such value or default was found. * """ * cdef PyObject *value = NULL # <<<<<<<<<<<<<< * PyContextVar_Get(var, NULL, &value) * if value is NULL: - */ +*/ __pyx_v_value = NULL; - /* "cpython/contextvars.pxd":118 + /* "cpython/contextvars.pxd":122 * """ * cdef PyObject *value = NULL * PyContextVar_Get(var, NULL, &value) # <<<<<<<<<<<<<< * if value is NULL: * # context variable does not have a default - */ - __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 118, __pyx_L1_error) +*/ + __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 122, __pyx_L1_error) - /* "cpython/contextvars.pxd":119 + /* "cpython/contextvars.pxd":123 * cdef PyObject *value = NULL * PyContextVar_Get(var, NULL, &value) * if value is NULL: # <<<<<<<<<<<<<< * # context variable does not have a default * pyvalue = default_value - */ +*/ __pyx_t_2 = (__pyx_v_value == NULL); if (__pyx_t_2) { - /* "cpython/contextvars.pxd":121 + /* "cpython/contextvars.pxd":125 * if value is NULL: * # context variable does not have a default * pyvalue = default_value # <<<<<<<<<<<<<< * else: * # value or default value of context variable - */ +*/ __Pyx_INCREF(__pyx_v_default_value); __pyx_v_pyvalue = __pyx_v_default_value; - /* "cpython/contextvars.pxd":119 + /* "cpython/contextvars.pxd":123 * cdef PyObject *value = NULL * PyContextVar_Get(var, NULL, &value) * if value is NULL: # <<<<<<<<<<<<<< * # context variable does not have a default * pyvalue = default_value - */ +*/ goto __pyx_L3; } - /* "cpython/contextvars.pxd":124 + /* "cpython/contextvars.pxd":128 * else: * # value or default value of context variable * pyvalue = value # <<<<<<<<<<<<<< * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue - */ +*/ /*else*/ { __pyx_t_3 = ((PyObject *)__pyx_v_value); __Pyx_INCREF(__pyx_t_3); __pyx_v_pyvalue = __pyx_t_3; __pyx_t_3 = 0; - /* "cpython/contextvars.pxd":125 + /* "cpython/contextvars.pxd":129 * # value or default value of context variable * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<< * return pyvalue * - */ +*/ Py_XDECREF(__pyx_v_value); } __pyx_L3:; - /* "cpython/contextvars.pxd":126 + /* "cpython/contextvars.pxd":130 * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_pyvalue); __pyx_r = __pyx_v_pyvalue; goto __pyx_L0; - /* "cpython/contextvars.pxd":112 + /* "cpython/contextvars.pxd":115 * * - * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") # <<<<<<<<<<<<<< + * cdef inline object get_value(var, default_value=None): * """Return a new reference to the value of the context variable, - * or the default value of the context variable, - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -2839,16 +2650,26 @@ static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject __Pyx_RefNannyFinishContext(); return __pyx_r; } +#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/ -/* "cpython/contextvars.pxd":129 +/* "cpython/contextvars.pxd":133 * * - * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") # <<<<<<<<<<<<<< + * cdef inline object get_value_no_default(var, default_value=None): * """Return a new reference to the value of the context variable, - * or the provided default value if no such value was found. - */ +*/ +#if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_default(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default *__pyx_optional_args) { + + /* "cpython/contextvars.pxd":134 + * + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") + * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< + * """Return a new reference to the value of the context variable, + * or the provided default value if no such value was found. +*/ PyObject *__pyx_v_default_value = ((PyObject *)Py_None); PyObject *__pyx_v_value; PyObject *__pyx_v_pyvalue = NULL; @@ -2859,68 +2680,68 @@ static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_defau int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("get_value_no_default", 1); + __Pyx_RefNannySetupContext("get_value_no_default", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default_value = __pyx_optional_args->default_value; } } - /* "cpython/contextvars.pxd":135 + /* "cpython/contextvars.pxd":140 * Ignores the default value of the context variable, if any. * """ * cdef PyObject *value = NULL # <<<<<<<<<<<<<< * PyContextVar_Get(var, default_value, &value) * # value of context variable or 'default_value' - */ +*/ __pyx_v_value = NULL; - /* "cpython/contextvars.pxd":136 + /* "cpython/contextvars.pxd":141 * """ * cdef PyObject *value = NULL * PyContextVar_Get(var, default_value, &value) # <<<<<<<<<<<<<< * # value of context variable or 'default_value' * pyvalue = value - */ - __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 136, __pyx_L1_error) +*/ + __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 141, __pyx_L1_error) - /* "cpython/contextvars.pxd":138 + /* "cpython/contextvars.pxd":143 * PyContextVar_Get(var, default_value, &value) * # value of context variable or 'default_value' * pyvalue = value # <<<<<<<<<<<<<< * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue - */ +*/ __pyx_t_2 = ((PyObject *)__pyx_v_value); __Pyx_INCREF(__pyx_t_2); __pyx_v_pyvalue = __pyx_t_2; __pyx_t_2 = 0; - /* "cpython/contextvars.pxd":139 + /* "cpython/contextvars.pxd":144 * # value of context variable or 'default_value' * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<< * return pyvalue - */ +*/ Py_XDECREF(__pyx_v_value); - /* "cpython/contextvars.pxd":140 + /* "cpython/contextvars.pxd":145 * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue # <<<<<<<<<<<<<< - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_pyvalue); __pyx_r = __pyx_v_pyvalue; goto __pyx_L0; - /* "cpython/contextvars.pxd":129 + /* "cpython/contextvars.pxd":133 * * - * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") # <<<<<<<<<<<<<< + * cdef inline object get_value_no_default(var, default_value=None): * """Return a new reference to the value of the context variable, - * or the provided default value if no such value was found. - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -2933,6 +2754,7 @@ static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_defau __Pyx_RefNannyFinishContext(); return __pyx_r; } +#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/ /* "cityhashcrc.pyx":77 * @@ -2940,20 +2762,23 @@ static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_defau * cdef object _type_error(argname: str, expected: object, value: object): # <<<<<<<<<<<<<< * return TypeError( * "Argument '%s' has incorrect type: expected %s, got '%s' instead" % - */ +*/ static PyObject *__pyx_f_11cityhashcrc__type_error(PyObject *__pyx_v_argname, PyObject *__pyx_v_expected, PyObject *__pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - Py_UCS4 __pyx_t_3; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7[7]; + size_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_type_error", 1); + __Pyx_RefNannySetupContext("_type_error", 0); /* "cityhashcrc.pyx":78 * @@ -2961,24 +2786,11 @@ static PyObject *__pyx_f_11cityhashcrc__type_error(PyObject *__pyx_v_argname, Py * return TypeError( # <<<<<<<<<<<<<< * "Argument '%s' has incorrect type: expected %s, got '%s' instead" % * (argname, expected, type(value).__name__) - */ +*/ __Pyx_XDECREF(__pyx_r); - - /* "cityhashcrc.pyx":79 - * cdef object _type_error(argname: str, expected: object, value: object): - * return TypeError( - * "Argument '%s' has incorrect type: expected %s, got '%s' instead" % # <<<<<<<<<<<<<< - * (argname, expected, type(value).__name__) - * ) - */ - __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = 0; - __pyx_t_3 = 127; - __Pyx_INCREF(__pyx_kp_u_Argument); - __pyx_t_2 += 10; - __Pyx_GIVEREF(__pyx_kp_u_Argument); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Argument); + __pyx_t_2 = NULL; + __Pyx_INCREF(__pyx_builtin_TypeError); + __pyx_t_3 = __pyx_builtin_TypeError; /* "cityhashcrc.pyx":80 * return TypeError( @@ -2986,41 +2798,21 @@ static PyObject *__pyx_f_11cityhashcrc__type_error(PyObject *__pyx_v_argname, Py * (argname, expected, type(value).__name__) # <<<<<<<<<<<<<< * ) * - */ - __Pyx_INCREF(__pyx_v_argname); - __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_argname) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_argname) : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_argname); - __Pyx_GIVEREF(__pyx_v_argname); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_argname); - __Pyx_INCREF(__pyx_kp_u_has_incorrect_type_expected); - __pyx_t_2 += 31; - __Pyx_GIVEREF(__pyx_kp_u_has_incorrect_type_expected); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_has_incorrect_type_expected); - __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_expected), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_kp_u_got); - __pyx_t_2 += 7; - __Pyx_GIVEREF(__pyx_kp_u_got); - PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_got); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_value)), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_expected), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_value)), __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_5); - __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_kp_u_instead); - __pyx_t_2 += 9; - __Pyx_GIVEREF(__pyx_kp_u_instead); - PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u_instead); + __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 80, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_Argument; + __pyx_t_7[1] = __pyx_v_argname; + __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u_has_incorrect_type_expected; + __pyx_t_7[3] = __pyx_t_4; + __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u_got; + __pyx_t_7[5] = __pyx_t_6; + __pyx_t_7[6] = __pyx_mstate_global->__pyx_kp_u_instead; /* "cityhashcrc.pyx":79 * cdef object _type_error(argname: str, expected: object, value: object): @@ -3028,21 +2820,22 @@ static PyObject *__pyx_f_11cityhashcrc__type_error(PyObject *__pyx_v_argname, Py * "Argument '%s' has incorrect type: expected %s, got '%s' instead" % # <<<<<<<<<<<<<< * (argname, expected, type(value).__name__) * ) - */ - __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error) +*/ + __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_7, 7, 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_v_argname) + 31 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 7 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 9, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_argname) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6)); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "cityhashcrc.pyx":78 - * - * cdef object _type_error(argname: str, expected: object, value: object): - * return TypeError( # <<<<<<<<<<<<<< - * "Argument '%s' has incorrect type: expected %s, got '%s' instead" % - * (argname, expected, type(value).__name__) - */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; @@ -3053,13 +2846,16 @@ static PyObject *__pyx_f_11cityhashcrc__type_error(PyObject *__pyx_v_argname, Py * cdef object _type_error(argname: str, expected: object, value: object): # <<<<<<<<<<<<<< * return TypeError( * "Argument '%s' has incorrect type: expected %s, got '%s' instead" % - */ +*/ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("cityhashcrc._type_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; @@ -3074,7 +2870,7 @@ static PyObject *__pyx_f_11cityhashcrc__type_error(PyObject *__pyx_v_argname, Py * def CityHashCrc128(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 128-bit hash from input data. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_11cityhashcrc_1CityHashCrc128(PyObject *__pyx_self, @@ -3084,8 +2880,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_11cityhashcrc_CityHashCrc128, "CityHashCrc128(data) -> int\nObtain a 128-bit hash from input data.\n\n :param data: input data (string, bytes, or buffer object)\n :return: an integer representing a 128-bit hash of the input\n :raises TypeError: if data is not of one of input types\n :raises ValueError: if input buffer is not C-contiguous\n "); -static PyMethodDef __pyx_mdef_11cityhashcrc_1CityHashCrc128 = {"CityHashCrc128", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11cityhashcrc_1CityHashCrc128, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11cityhashcrc_CityHashCrc128}; +PyDoc_STRVAR(__pyx_doc_11cityhashcrc_CityHashCrc128, "CityHashCrc128(data) -> int\n\nObtain a 128-bit hash from input data.\n\n:param data: input data (string, bytes, or buffer object)\n:return: an integer representing a 128-bit hash of the input\n:raises TypeError: if data is not of one of input types\n:raises ValueError: if input buffer is not C-contiguous"); +static PyMethodDef __pyx_mdef_11cityhashcrc_1CityHashCrc128 = {"CityHashCrc128", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11cityhashcrc_1CityHashCrc128, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11cityhashcrc_CityHashCrc128}; static PyObject *__pyx_pw_11cityhashcrc_1CityHashCrc128(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3106,7 +2902,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("CityHashCrc128 (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -3114,33 +2910,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 84, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 84, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 84, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "CityHashCrc128") < 0)) __PYX_ERR(0, 84, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "CityHashCrc128", 0) < 0) __PYX_ERR(0, 84, __pyx_L3_error) + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("CityHashCrc128", 1, 1, 1, i); __PYX_ERR(0, 84, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 84, __pyx_L3_error) } __pyx_v_data = values[0]; } @@ -3150,11 +2941,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("cityhashcrc.CityHashCrc128", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3163,11 +2951,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_11cityhashcrc_CityHashCrc128(__pyx_self, __pyx_v_data); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -3190,7 +2975,7 @@ static PyObject *__pyx_pf_11cityhashcrc_CityHashCrc128(CYTHON_UNUSED PyObject *_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("CityHashCrc128", 1); + __Pyx_RefNannySetupContext("CityHashCrc128", 0); /* "cityhashcrc.pyx":95 * cdef pair[uint64, uint64] result @@ -3198,7 +2983,7 @@ static PyObject *__pyx_pf_11cityhashcrc_CityHashCrc128(CYTHON_UNUSED PyObject *_ * cdef Py_ssize_t encoding_size = 0 # <<<<<<<<<<<<<< * * if PyUnicode_Check(data): - */ +*/ __pyx_v_encoding_size = 0; /* "cityhashcrc.pyx":97 @@ -3207,7 +2992,7 @@ static PyObject *__pyx_pf_11cityhashcrc_CityHashCrc128(CYTHON_UNUSED PyObject *_ * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_HashCrc128(encoding, encoding_size) - */ +*/ __pyx_t_1 = PyUnicode_Check(__pyx_v_data); if (__pyx_t_1) { @@ -3217,8 +3002,8 @@ static PyObject *__pyx_pf_11cityhashcrc_CityHashCrc128(CYTHON_UNUSED PyObject *_ * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) # <<<<<<<<<<<<<< * result = c_HashCrc128(encoding, encoding_size) * elif PyBytes_Check(data): - */ - __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(0, 98, __pyx_L1_error) +*/ + __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)0))) __PYX_ERR(0, 98, __pyx_L1_error) __pyx_v_encoding = __pyx_t_2; /* "cityhashcrc.pyx":99 @@ -3227,7 +3012,7 @@ static PyObject *__pyx_pf_11cityhashcrc_CityHashCrc128(CYTHON_UNUSED PyObject *_ * result = c_HashCrc128(encoding, encoding_size) # <<<<<<<<<<<<<< * elif PyBytes_Check(data): * result = c_HashCrc128( - */ +*/ __pyx_v_result = CityHashCrc128(__pyx_v_encoding, __pyx_v_encoding_size); /* "cityhashcrc.pyx":97 @@ -3236,7 +3021,7 @@ static PyObject *__pyx_pf_11cityhashcrc_CityHashCrc128(CYTHON_UNUSED PyObject *_ * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_HashCrc128(encoding, encoding_size) - */ +*/ goto __pyx_L3; } @@ -3246,7 +3031,7 @@ static PyObject *__pyx_pf_11cityhashcrc_CityHashCrc128(CYTHON_UNUSED PyObject *_ * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_HashCrc128( * PyBytes_AS_STRING(data), - */ +*/ __pyx_t_1 = PyBytes_Check(__pyx_v_data); if (__pyx_t_1) { @@ -3256,7 +3041,7 @@ static PyObject *__pyx_pf_11cityhashcrc_CityHashCrc128(CYTHON_UNUSED PyObject *_ * result = c_HashCrc128( # <<<<<<<<<<<<<< * PyBytes_AS_STRING(data), * PyBytes_GET_SIZE(data)) - */ +*/ __pyx_v_result = CityHashCrc128(((char const *)PyBytes_AS_STRING(__pyx_v_data)), PyBytes_GET_SIZE(__pyx_v_data)); /* "cityhashcrc.pyx":100 @@ -3265,7 +3050,7 @@ static PyObject *__pyx_pf_11cityhashcrc_CityHashCrc128(CYTHON_UNUSED PyObject *_ * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_HashCrc128( * PyBytes_AS_STRING(data), - */ +*/ goto __pyx_L3; } @@ -3275,7 +3060,7 @@ static PyObject *__pyx_pf_11cityhashcrc_CityHashCrc128(CYTHON_UNUSED PyObject *_ * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_HashCrc128(buf.buf, buf.len) - */ +*/ __pyx_t_1 = PyObject_CheckBuffer(__pyx_v_data); if (likely(__pyx_t_1)) { @@ -3285,7 +3070,7 @@ static PyObject *__pyx_pf_11cityhashcrc_CityHashCrc128(CYTHON_UNUSED PyObject *_ * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * result = c_HashCrc128(buf.buf, buf.len) * PyBuffer_Release(&buf) - */ +*/ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 105, __pyx_L1_error) /* "cityhashcrc.pyx":106 @@ -3294,7 +3079,7 @@ static PyObject *__pyx_pf_11cityhashcrc_CityHashCrc128(CYTHON_UNUSED PyObject *_ * result = c_HashCrc128(buf.buf, buf.len) # <<<<<<<<<<<<<< * PyBuffer_Release(&buf) * else: - */ +*/ __pyx_v_result = CityHashCrc128(((char const *)__pyx_v_buf.buf), __pyx_v_buf.len); /* "cityhashcrc.pyx":107 @@ -3303,7 +3088,7 @@ static PyObject *__pyx_pf_11cityhashcrc_CityHashCrc128(CYTHON_UNUSED PyObject *_ * PyBuffer_Release(&buf) # <<<<<<<<<<<<<< * else: * raise _type_error("data", ["basestring", "buffer"], data) - */ +*/ PyBuffer_Release((&__pyx_v_buf)); /* "cityhashcrc.pyx":104 @@ -3312,7 +3097,7 @@ static PyObject *__pyx_pf_11cityhashcrc_CityHashCrc128(CYTHON_UNUSED PyObject *_ * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_HashCrc128(buf.buf, buf.len) - */ +*/ goto __pyx_L3; } @@ -3322,17 +3107,17 @@ static PyObject *__pyx_pf_11cityhashcrc_CityHashCrc128(CYTHON_UNUSED PyObject *_ * raise _type_error("data", ["basestring", "buffer"], data) # <<<<<<<<<<<<<< * first = PyLong_FromUnsignedLongLong(result.first) * second = PyLong_FromUnsignedLongLong(result.second) - */ +*/ /*else*/ { __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_u_basestring); - __Pyx_GIVEREF(__pyx_n_u_basestring); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_basestring)) __PYX_ERR(0, 109, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_buffer); - __Pyx_GIVEREF(__pyx_n_u_buffer); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_u_buffer)) __PYX_ERR(0, 109, __pyx_L1_error); - __pyx_t_5 = __pyx_f_11cityhashcrc__type_error(__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 109, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_basestring); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_basestring); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_n_u_basestring) != (0)) __PYX_ERR(0, 109, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_buffer); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_buffer); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_n_u_buffer) != (0)) __PYX_ERR(0, 109, __pyx_L1_error); + __pyx_t_5 = __pyx_f_11cityhashcrc__type_error(__pyx_mstate_global->__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); @@ -3347,7 +3132,7 @@ static PyObject *__pyx_pf_11cityhashcrc_CityHashCrc128(CYTHON_UNUSED PyObject *_ * first = PyLong_FromUnsignedLongLong(result.first) # <<<<<<<<<<<<<< * second = PyLong_FromUnsignedLongLong(result.second) * return (first << 64ULL) + second - */ +*/ __pyx_t_5 = PyLong_FromUnsignedLongLong(__pyx_v_result.first); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_t_5; @@ -3362,7 +3147,7 @@ static PyObject *__pyx_pf_11cityhashcrc_CityHashCrc128(CYTHON_UNUSED PyObject *_ * second = PyLong_FromUnsignedLongLong(result.second) # <<<<<<<<<<<<<< * return (first << 64ULL) + second * - */ +*/ __pyx_t_4 = PyLong_FromUnsignedLongLong(__pyx_v_result.second); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_t_4; @@ -3377,14 +3162,14 @@ static PyObject *__pyx_pf_11cityhashcrc_CityHashCrc128(CYTHON_UNUSED PyObject *_ * return (first << 64ULL) + second # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyNumber_Lshift(__pyx_v_first, __pyx_int_64L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_5 = PyNumber_Lshift(__pyx_v_first, __pyx_mstate_global->__pyx_int_64L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_v_second); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_4))) __PYX_ERR(0, 112, __pyx_L1_error) + if (!(likely(PyLong_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_4))) __PYX_ERR(0, 112, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; @@ -3395,7 +3180,7 @@ static PyObject *__pyx_pf_11cityhashcrc_CityHashCrc128(CYTHON_UNUSED PyObject *_ * def CityHashCrc128(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 128-bit hash from input data. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -3417,7 +3202,7 @@ static PyObject *__pyx_pf_11cityhashcrc_CityHashCrc128(CYTHON_UNUSED PyObject *_ * def CityHashCrc256Bytes(data) -> bytes: # <<<<<<<<<<<<<< * """Obtain a 128-bit hash from input data. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_11cityhashcrc_3CityHashCrc256Bytes(PyObject *__pyx_self, @@ -3427,8 +3212,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_11cityhashcrc_2CityHashCrc256Bytes, "CityHashCrc256Bytes(data) -> bytes\nObtain a 128-bit hash from input data.\n\n :param data: input data (string, bytes, or buffer object)\n :return: a bytes array representing a 128-bit hash of the input\n :raises TypeError: if data is not of one of input types\n :raises ValueError: if input buffer is not C-contiguous\n "); -static PyMethodDef __pyx_mdef_11cityhashcrc_3CityHashCrc256Bytes = {"CityHashCrc256Bytes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11cityhashcrc_3CityHashCrc256Bytes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11cityhashcrc_2CityHashCrc256Bytes}; +PyDoc_STRVAR(__pyx_doc_11cityhashcrc_2CityHashCrc256Bytes, "CityHashCrc256Bytes(data) -> bytes\n\nObtain a 128-bit hash from input data.\n\n:param data: input data (string, bytes, or buffer object)\n:return: a bytes array representing a 128-bit hash of the input\n:raises TypeError: if data is not of one of input types\n:raises ValueError: if input buffer is not C-contiguous"); +static PyMethodDef __pyx_mdef_11cityhashcrc_3CityHashCrc256Bytes = {"CityHashCrc256Bytes", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11cityhashcrc_3CityHashCrc256Bytes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11cityhashcrc_2CityHashCrc256Bytes}; static PyObject *__pyx_pw_11cityhashcrc_3CityHashCrc256Bytes(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3449,7 +3234,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("CityHashCrc256Bytes (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -3457,33 +3242,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 115, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 115, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "CityHashCrc256Bytes") < 0)) __PYX_ERR(0, 115, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "CityHashCrc256Bytes", 0) < 0) __PYX_ERR(0, 115, __pyx_L3_error) + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("CityHashCrc256Bytes", 1, 1, 1, i); __PYX_ERR(0, 115, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 115, __pyx_L3_error) } __pyx_v_data = values[0]; } @@ -3493,11 +3273,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("cityhashcrc.CityHashCrc256Bytes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3506,11 +3283,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_11cityhashcrc_2CityHashCrc256Bytes(__pyx_self, __pyx_v_data); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -3531,7 +3305,7 @@ static PyObject *__pyx_pf_11cityhashcrc_2CityHashCrc256Bytes(CYTHON_UNUSED PyObj int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("CityHashCrc256Bytes", 1); + __Pyx_RefNannySetupContext("CityHashCrc256Bytes", 0); /* "cityhashcrc.pyx":126 * cdef uint64 out[4] @@ -3539,7 +3313,7 @@ static PyObject *__pyx_pf_11cityhashcrc_2CityHashCrc256Bytes(CYTHON_UNUSED PyObj * cdef Py_ssize_t encoding_size = 0 # <<<<<<<<<<<<<< * * if PyUnicode_Check(data): - */ +*/ __pyx_v_encoding_size = 0; /* "cityhashcrc.pyx":128 @@ -3548,7 +3322,7 @@ static PyObject *__pyx_pf_11cityhashcrc_2CityHashCrc256Bytes(CYTHON_UNUSED PyObj * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * c_HashCrc256(encoding, encoding_size, out) - */ +*/ __pyx_t_1 = PyUnicode_Check(__pyx_v_data); if (__pyx_t_1) { @@ -3558,8 +3332,8 @@ static PyObject *__pyx_pf_11cityhashcrc_2CityHashCrc256Bytes(CYTHON_UNUSED PyObj * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) # <<<<<<<<<<<<<< * c_HashCrc256(encoding, encoding_size, out) * elif PyBytes_Check(data): - */ - __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(0, 129, __pyx_L1_error) +*/ + __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)0))) __PYX_ERR(0, 129, __pyx_L1_error) __pyx_v_encoding = __pyx_t_2; /* "cityhashcrc.pyx":130 @@ -3568,7 +3342,7 @@ static PyObject *__pyx_pf_11cityhashcrc_2CityHashCrc256Bytes(CYTHON_UNUSED PyObj * c_HashCrc256(encoding, encoding_size, out) # <<<<<<<<<<<<<< * elif PyBytes_Check(data): * c_HashCrc256( - */ +*/ CityHashCrc256(__pyx_v_encoding, __pyx_v_encoding_size, __pyx_v_out); /* "cityhashcrc.pyx":128 @@ -3577,7 +3351,7 @@ static PyObject *__pyx_pf_11cityhashcrc_2CityHashCrc256Bytes(CYTHON_UNUSED PyObj * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * c_HashCrc256(encoding, encoding_size, out) - */ +*/ goto __pyx_L3; } @@ -3587,7 +3361,7 @@ static PyObject *__pyx_pf_11cityhashcrc_2CityHashCrc256Bytes(CYTHON_UNUSED PyObj * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * c_HashCrc256( * PyBytes_AS_STRING(data), - */ +*/ __pyx_t_1 = PyBytes_Check(__pyx_v_data); if (__pyx_t_1) { @@ -3597,7 +3371,7 @@ static PyObject *__pyx_pf_11cityhashcrc_2CityHashCrc256Bytes(CYTHON_UNUSED PyObj * c_HashCrc256( # <<<<<<<<<<<<<< * PyBytes_AS_STRING(data), * PyBytes_GET_SIZE(data), out) - */ +*/ CityHashCrc256(((char const *)PyBytes_AS_STRING(__pyx_v_data)), PyBytes_GET_SIZE(__pyx_v_data), __pyx_v_out); /* "cityhashcrc.pyx":131 @@ -3606,7 +3380,7 @@ static PyObject *__pyx_pf_11cityhashcrc_2CityHashCrc256Bytes(CYTHON_UNUSED PyObj * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * c_HashCrc256( * PyBytes_AS_STRING(data), - */ +*/ goto __pyx_L3; } @@ -3616,7 +3390,7 @@ static PyObject *__pyx_pf_11cityhashcrc_2CityHashCrc256Bytes(CYTHON_UNUSED PyObj * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * c_HashCrc256(buf.buf, buf.len, out) - */ +*/ __pyx_t_1 = PyObject_CheckBuffer(__pyx_v_data); if (likely(__pyx_t_1)) { @@ -3626,7 +3400,7 @@ static PyObject *__pyx_pf_11cityhashcrc_2CityHashCrc256Bytes(CYTHON_UNUSED PyObj * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * c_HashCrc256(buf.buf, buf.len, out) * PyBuffer_Release(&buf) - */ +*/ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 136, __pyx_L1_error) /* "cityhashcrc.pyx":137 @@ -3635,7 +3409,7 @@ static PyObject *__pyx_pf_11cityhashcrc_2CityHashCrc256Bytes(CYTHON_UNUSED PyObj * c_HashCrc256(buf.buf, buf.len, out) # <<<<<<<<<<<<<< * PyBuffer_Release(&buf) * else: - */ +*/ CityHashCrc256(((char const *)__pyx_v_buf.buf), __pyx_v_buf.len, __pyx_v_out); /* "cityhashcrc.pyx":138 @@ -3644,7 +3418,7 @@ static PyObject *__pyx_pf_11cityhashcrc_2CityHashCrc256Bytes(CYTHON_UNUSED PyObj * PyBuffer_Release(&buf) # <<<<<<<<<<<<<< * else: * raise _type_error("data", ["basestring", "buffer"], data) - */ +*/ PyBuffer_Release((&__pyx_v_buf)); /* "cityhashcrc.pyx":135 @@ -3653,7 +3427,7 @@ static PyObject *__pyx_pf_11cityhashcrc_2CityHashCrc256Bytes(CYTHON_UNUSED PyObj * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * c_HashCrc256(buf.buf, buf.len, out) - */ +*/ goto __pyx_L3; } @@ -3663,17 +3437,17 @@ static PyObject *__pyx_pf_11cityhashcrc_2CityHashCrc256Bytes(CYTHON_UNUSED PyObj * raise _type_error("data", ["basestring", "buffer"], data) # <<<<<<<<<<<<<< * return PyBytes_FromStringAndSize(out, 32) * - */ +*/ /*else*/ { __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_u_basestring); - __Pyx_GIVEREF(__pyx_n_u_basestring); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_basestring)) __PYX_ERR(0, 140, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_buffer); - __Pyx_GIVEREF(__pyx_n_u_buffer); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_u_buffer)) __PYX_ERR(0, 140, __pyx_L1_error); - __pyx_t_5 = __pyx_f_11cityhashcrc__type_error(__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_basestring); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_basestring); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_n_u_basestring) != (0)) __PYX_ERR(0, 140, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_buffer); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_buffer); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_n_u_buffer) != (0)) __PYX_ERR(0, 140, __pyx_L1_error); + __pyx_t_5 = __pyx_f_11cityhashcrc__type_error(__pyx_mstate_global->__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); @@ -3688,7 +3462,7 @@ static PyObject *__pyx_pf_11cityhashcrc_2CityHashCrc256Bytes(CYTHON_UNUSED PyObj * return PyBytes_FromStringAndSize(out, 32) # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = PyBytes_FromStringAndSize(((char *)__pyx_v_out), 32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); @@ -3702,7 +3476,7 @@ static PyObject *__pyx_pf_11cityhashcrc_2CityHashCrc256Bytes(CYTHON_UNUSED PyObj * def CityHashCrc256Bytes(data) -> bytes: # <<<<<<<<<<<<<< * """Obtain a 128-bit hash from input data. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -3722,7 +3496,7 @@ static PyObject *__pyx_pf_11cityhashcrc_2CityHashCrc256Bytes(CYTHON_UNUSED PyObj * def CityHashCrc128WithSeed(data, seed: int = 0L) -> int: # <<<<<<<<<<<<<< * """Obtain a 128-bit hash using a seed. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_11cityhashcrc_5CityHashCrc128WithSeed(PyObject *__pyx_self, @@ -3732,8 +3506,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_11cityhashcrc_4CityHashCrc128WithSeed, "CityHashCrc128WithSeed(data, int seed: int = 0) -> int\nObtain a 128-bit hash using a seed.\n\n :param data: input data (string, bytes, or buffer object)\n :param seed: seed value (defaults to 0)\n :return: an integer representing a 128-bit hash of the input\n :raises TypeError: if data is not of one of input types\n :raises ValueError: if input buffer is not C-contiguous\n "); -static PyMethodDef __pyx_mdef_11cityhashcrc_5CityHashCrc128WithSeed = {"CityHashCrc128WithSeed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11cityhashcrc_5CityHashCrc128WithSeed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11cityhashcrc_4CityHashCrc128WithSeed}; +PyDoc_STRVAR(__pyx_doc_11cityhashcrc_4CityHashCrc128WithSeed, "CityHashCrc128WithSeed(data, int seed: int = 0) -> int\n\nObtain a 128-bit hash using a seed.\n\n:param data: input data (string, bytes, or buffer object)\n:param seed: seed value (defaults to 0)\n:return: an integer representing a 128-bit hash of the input\n:raises TypeError: if data is not of one of input types\n:raises ValueError: if input buffer is not C-contiguous"); +static PyMethodDef __pyx_mdef_11cityhashcrc_5CityHashCrc128WithSeed = {"CityHashCrc128WithSeed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_11cityhashcrc_5CityHashCrc128WithSeed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_11cityhashcrc_4CityHashCrc128WithSeed}; static PyObject *__pyx_pw_11cityhashcrc_5CityHashCrc128WithSeed(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3755,7 +3529,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("CityHashCrc128WithSeed (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -3763,47 +3537,41 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_seed,0}; - values[1] = __Pyx_Arg_NewRef_FASTCALL(__pyx_k_); - if (__pyx_kwds) { - Py_ssize_t kw_args; + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,&__pyx_mstate_global->__pyx_n_u_seed,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 144, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 144, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 144, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_seed); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 144, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "CityHashCrc128WithSeed") < 0)) __PYX_ERR(0, 144, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "CityHashCrc128WithSeed", 0) < 0) __PYX_ERR(0, 144, __pyx_L3_error) + if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_int_0L)); + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("CityHashCrc128WithSeed", 0, 1, 2, i); __PYX_ERR(0, 144, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 144, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 144, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } + if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_int_0L)); } __pyx_v_data = values[0]; __pyx_v_seed = ((PyObject*)values[1]); @@ -3814,30 +3582,29 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("cityhashcrc.CityHashCrc128WithSeed", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_seed), (&PyInt_Type), 0, "seed", 1))) __PYX_ERR(0, 144, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_seed), (&PyLong_Type), 0, "seed", 2))) __PYX_ERR(0, 144, __pyx_L1_error) __pyx_r = __pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(__pyx_self, __pyx_v_data, __pyx_v_seed); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + goto __pyx_L7_cleaned_up; __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } + __pyx_L7_cleaned_up:; __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -3861,7 +3628,7 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("CityHashCrc128WithSeed", 1); + __Pyx_RefNannySetupContext("CityHashCrc128WithSeed", 0); /* "cityhashcrc.pyx":157 * cdef pair[uint64, uint64] tseed @@ -3869,7 +3636,7 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py * cdef Py_ssize_t encoding_size = 0 # <<<<<<<<<<<<<< * * tseed.first = seed >> 64ULL - */ +*/ __pyx_v_encoding_size = 0; /* "cityhashcrc.pyx":159 @@ -3878,10 +3645,10 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py * tseed.first = seed >> 64ULL # <<<<<<<<<<<<<< * tseed.second = seed & ((1ULL << 64ULL) - 1ULL) * - */ - __pyx_t_1 = PyNumber_Rshift(__pyx_v_seed, __pyx_int_64L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) +*/ + __pyx_t_1 = PyNumber_Rshift(__pyx_v_seed, __pyx_mstate_global->__pyx_int_64L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tseed.first = __pyx_t_2; @@ -3891,10 +3658,10 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py * tseed.second = seed & ((1ULL << 64ULL) - 1ULL) # <<<<<<<<<<<<<< * * if PyUnicode_Check(data): - */ - __pyx_t_1 = PyNumber_And(__pyx_v_seed, __pyx_int_0xffffffffffffffffL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) +*/ + __pyx_t_1 = PyNumber_And(__pyx_v_seed, __pyx_mstate_global->__pyx_int_0xffffffffffffffffL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tseed.second = __pyx_t_2; @@ -3904,7 +3671,7 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_HashCrc128WithSeed(encoding, encoding_size, tseed) - */ +*/ __pyx_t_3 = PyUnicode_Check(__pyx_v_data); if (__pyx_t_3) { @@ -3914,8 +3681,8 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) # <<<<<<<<<<<<<< * result = c_HashCrc128WithSeed(encoding, encoding_size, tseed) * elif PyBytes_Check(data): - */ - __pyx_t_4 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(0, 163, __pyx_L1_error) +*/ + __pyx_t_4 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_4 == ((char const *)0))) __PYX_ERR(0, 163, __pyx_L1_error) __pyx_v_encoding = __pyx_t_4; /* "cityhashcrc.pyx":164 @@ -3924,7 +3691,7 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py * result = c_HashCrc128WithSeed(encoding, encoding_size, tseed) # <<<<<<<<<<<<<< * elif PyBytes_Check(data): * result = c_HashCrc128WithSeed( - */ +*/ __pyx_v_result = CityHashCrc128WithSeed(__pyx_v_encoding, __pyx_v_encoding_size, __pyx_v_tseed); /* "cityhashcrc.pyx":162 @@ -3933,7 +3700,7 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_HashCrc128WithSeed(encoding, encoding_size, tseed) - */ +*/ goto __pyx_L3; } @@ -3943,7 +3710,7 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_HashCrc128WithSeed( * PyBytes_AS_STRING(data), - */ +*/ __pyx_t_3 = PyBytes_Check(__pyx_v_data); if (__pyx_t_3) { @@ -3953,7 +3720,7 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py * result = c_HashCrc128WithSeed( # <<<<<<<<<<<<<< * PyBytes_AS_STRING(data), * PyBytes_GET_SIZE(data), tseed) - */ +*/ __pyx_v_result = CityHashCrc128WithSeed(((char const *)PyBytes_AS_STRING(__pyx_v_data)), PyBytes_GET_SIZE(__pyx_v_data), __pyx_v_tseed); /* "cityhashcrc.pyx":165 @@ -3962,7 +3729,7 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_HashCrc128WithSeed( * PyBytes_AS_STRING(data), - */ +*/ goto __pyx_L3; } @@ -3972,7 +3739,7 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_HashCrc128WithSeed(buf.buf, buf.len, tseed) - */ +*/ __pyx_t_3 = PyObject_CheckBuffer(__pyx_v_data); if (likely(__pyx_t_3)) { @@ -3982,7 +3749,7 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * result = c_HashCrc128WithSeed(buf.buf, buf.len, tseed) * PyBuffer_Release(&buf) - */ +*/ __pyx_t_5 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 170, __pyx_L1_error) /* "cityhashcrc.pyx":171 @@ -3991,7 +3758,7 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py * result = c_HashCrc128WithSeed(buf.buf, buf.len, tseed) # <<<<<<<<<<<<<< * PyBuffer_Release(&buf) * else: - */ +*/ __pyx_v_result = CityHashCrc128WithSeed(((char const *)__pyx_v_buf.buf), __pyx_v_buf.len, __pyx_v_tseed); /* "cityhashcrc.pyx":172 @@ -4000,7 +3767,7 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py * PyBuffer_Release(&buf) # <<<<<<<<<<<<<< * else: * raise _type_error("data", ["basestring", "buffer"], data) - */ +*/ PyBuffer_Release((&__pyx_v_buf)); /* "cityhashcrc.pyx":169 @@ -4009,7 +3776,7 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_HashCrc128WithSeed(buf.buf, buf.len, tseed) - */ +*/ goto __pyx_L3; } @@ -4019,17 +3786,17 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py * raise _type_error("data", ["basestring", "buffer"], data) # <<<<<<<<<<<<<< * first = PyLong_FromUnsignedLongLong(result.first) * second = PyLong_FromUnsignedLongLong(result.second) - */ +*/ /*else*/ { __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_n_u_basestring); - __Pyx_GIVEREF(__pyx_n_u_basestring); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_basestring)) __PYX_ERR(0, 174, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_buffer); - __Pyx_GIVEREF(__pyx_n_u_buffer); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_buffer)) __PYX_ERR(0, 174, __pyx_L1_error); - __pyx_t_6 = __pyx_f_11cityhashcrc__type_error(__pyx_n_u_data, __pyx_t_1, __pyx_v_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_basestring); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_basestring); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_n_u_basestring) != (0)) __PYX_ERR(0, 174, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_buffer); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_buffer); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_n_u_buffer) != (0)) __PYX_ERR(0, 174, __pyx_L1_error); + __pyx_t_6 = __pyx_f_11cityhashcrc__type_error(__pyx_mstate_global->__pyx_n_u_data, __pyx_t_1, __pyx_v_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); @@ -4044,7 +3811,7 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py * first = PyLong_FromUnsignedLongLong(result.first) # <<<<<<<<<<<<<< * second = PyLong_FromUnsignedLongLong(result.second) * return (first << 64ULL) + second - */ +*/ __pyx_t_6 = PyLong_FromUnsignedLongLong(__pyx_v_result.first); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __pyx_t_6; @@ -4058,7 +3825,7 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py * first = PyLong_FromUnsignedLongLong(result.first) * second = PyLong_FromUnsignedLongLong(result.second) # <<<<<<<<<<<<<< * return (first << 64ULL) + second - */ +*/ __pyx_t_1 = PyLong_FromUnsignedLongLong(__pyx_v_result.second); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __pyx_t_1; @@ -4071,14 +3838,14 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py * first = PyLong_FromUnsignedLongLong(result.first) * second = PyLong_FromUnsignedLongLong(result.second) * return (first << 64ULL) + second # <<<<<<<<<<<<<< - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = PyNumber_Lshift(__pyx_v_first, __pyx_int_64L); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error) + __pyx_t_6 = PyNumber_Lshift(__pyx_v_first, __pyx_mstate_global->__pyx_int_64L); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_v_second); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_1))) __PYX_ERR(0, 177, __pyx_L1_error) + if (!(likely(PyLong_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_1))) __PYX_ERR(0, 177, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; @@ -4089,7 +3856,7 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py * def CityHashCrc128WithSeed(data, seed: int = 0L) -> int: # <<<<<<<<<<<<<< * """Obtain a 128-bit hash using a seed. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -4104,179 +3871,65 @@ static PyObject *__pyx_pf_11cityhashcrc_4CityHashCrc128WithSeed(CYTHON_UNUSED Py __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* #### Code section: module_exttypes ### */ static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; -#ifndef CYTHON_SMALL_CODE -#if defined(__clang__) - #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) -#else - #define CYTHON_SMALL_CODE -#endif -#endif -/* #### Code section: pystring_table ### */ - -static int __Pyx_CreateStringTabAndInitStrings(void) { - __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_u_0_4_7, __pyx_k_0_4_7, sizeof(__pyx_k_0_4_7), 0, 1, 0, 0}, - {&__pyx_kp_u_Argument, __pyx_k_Argument, sizeof(__pyx_k_Argument), 0, 1, 0, 0}, - {&__pyx_n_s_CityHashCrc128, __pyx_k_CityHashCrc128, sizeof(__pyx_k_CityHashCrc128), 0, 0, 1, 1}, - {&__pyx_n_u_CityHashCrc128, __pyx_k_CityHashCrc128, sizeof(__pyx_k_CityHashCrc128), 0, 1, 0, 1}, - {&__pyx_n_s_CityHashCrc128WithSeed, __pyx_k_CityHashCrc128WithSeed, sizeof(__pyx_k_CityHashCrc128WithSeed), 0, 0, 1, 1}, - {&__pyx_n_u_CityHashCrc128WithSeed, __pyx_k_CityHashCrc128WithSeed, sizeof(__pyx_k_CityHashCrc128WithSeed), 0, 1, 0, 1}, - {&__pyx_n_s_CityHashCrc256Bytes, __pyx_k_CityHashCrc256Bytes, sizeof(__pyx_k_CityHashCrc256Bytes), 0, 0, 1, 1}, - {&__pyx_n_u_CityHashCrc256Bytes, __pyx_k_CityHashCrc256Bytes, sizeof(__pyx_k_CityHashCrc256Bytes), 0, 1, 0, 1}, - {&__pyx_kp_u_Eugene_Scherba, __pyx_k_Eugene_Scherba, sizeof(__pyx_k_Eugene_Scherba), 0, 1, 0, 0}, - {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, - {&__pyx_n_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 1}, - {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, - {&__pyx_n_s_author, __pyx_k_author, sizeof(__pyx_k_author), 0, 0, 1, 1}, - {&__pyx_n_u_basestring, __pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 1, 0, 1}, - {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1}, - {&__pyx_n_u_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 1, 0, 1}, - {&__pyx_n_s_cityhashcrc, __pyx_k_cityhashcrc, sizeof(__pyx_k_cityhashcrc), 0, 0, 1, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, - {&__pyx_n_u_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 1, 0, 1}, - {&__pyx_n_s_email, __pyx_k_email, sizeof(__pyx_k_email), 0, 0, 1, 1}, - {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, - {&__pyx_n_s_encoding_size, __pyx_k_encoding_size, sizeof(__pyx_k_encoding_size), 0, 0, 1, 1}, - {&__pyx_kp_u_escherba_cityhash_gmail_com, __pyx_k_escherba_cityhash_gmail_com, sizeof(__pyx_k_escherba_cityhash_gmail_com), 0, 1, 0, 0}, - {&__pyx_n_s_first, __pyx_k_first, sizeof(__pyx_k_first), 0, 0, 1, 1}, - {&__pyx_kp_u_got, __pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0, 0}, - {&__pyx_kp_u_has_incorrect_type_expected, __pyx_k_has_incorrect_type_expected, sizeof(__pyx_k_has_incorrect_type_expected), 0, 1, 0, 0}, - {&__pyx_kp_u_instead, __pyx_k_instead, sizeof(__pyx_k_instead), 0, 1, 0, 0}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1}, - {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, - {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1}, - {&__pyx_n_s_seed, __pyx_k_seed, sizeof(__pyx_k_seed), 0, 0, 1, 1}, - {&__pyx_kp_s_src_cityhashcrc_pyx, __pyx_k_src_cityhashcrc_pyx, sizeof(__pyx_k_src_cityhashcrc_pyx), 0, 0, 1, 0}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_tseed, __pyx_k_tseed, sizeof(__pyx_k_tseed), 0, 0, 1, 1}, - {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} - }; - return __Pyx_InitStrings(__pyx_string_tab); -} -/* #### Code section: cached_builtins ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 78, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: cached_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "cityhashcrc.pyx":84 - * - * - * def CityHashCrc128(data) -> int: # <<<<<<<<<<<<<< - * """Obtain a 128-bit hash from input data. - * - */ - __pyx_tuple__2 = PyTuple_Pack(7, __pyx_n_s_data, __pyx_n_s_buf, __pyx_n_s_result, __pyx_n_s_encoding, __pyx_n_s_encoding_size, __pyx_n_s_first, __pyx_n_s_second); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 84, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); - __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cityhashcrc_pyx, __pyx_n_s_CityHashCrc128, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 84, __pyx_L1_error) - - /* "cityhashcrc.pyx":115 - * - * - * def CityHashCrc256Bytes(data) -> bytes: # <<<<<<<<<<<<<< - * """Obtain a 128-bit hash from input data. - * - */ - __pyx_tuple__4 = PyTuple_Pack(5, __pyx_n_s_data, __pyx_n_s_buf, __pyx_n_s_out, __pyx_n_s_encoding, __pyx_n_s_encoding_size); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); - __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cityhashcrc_pyx, __pyx_n_s_CityHashCrc256Bytes, 115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 115, __pyx_L1_error) - - /* "cityhashcrc.pyx":144 - * - * - * def CityHashCrc128WithSeed(data, seed: int = 0L) -> int: # <<<<<<<<<<<<<< - * """Obtain a 128-bit hash using a seed. - * - */ - __pyx_tuple__6 = PyTuple_Pack(9, __pyx_n_s_data, __pyx_n_s_seed, __pyx_n_s_buf, __pyx_n_s_result, __pyx_n_s_tseed, __pyx_n_s_encoding, __pyx_n_s_encoding_size, __pyx_n_s_first, __pyx_n_s_second); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); - __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_cityhashcrc_pyx, __pyx_n_s_CityHashCrc128WithSeed, 144, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} -/* #### Code section: init_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { - if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_int_0L = PyLong_FromString((char *)"0", 0, 0); if (unlikely(!__pyx_int_0L)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_64L = PyLong_FromString((char *)"64", 0, 0); if (unlikely(!__pyx_int_64L)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_0xffffffffffffffffL = PyLong_FromString((char *)"0xffffffffffffffff", 0, 0); if (unlikely(!__pyx_int_0xffffffffffffffffL)) __PYX_ERR(0, 1, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_globals ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - return 0; -} +/* #### Code section: initfunc_declarations ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/ /* #### Code section: init_module ### */ -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ - -static int __Pyx_modinit_global_init_code(void) { +static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_variable_export_code(void) { +static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_function_export_code(void) { +static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_type_init_code(void) { +static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_type_import_code(void) { +static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; @@ -4285,23 +3938,39 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_1_4(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyTypeObject), + 0, 0, #else - sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyHeapTypeObject), + sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(PyHeapTypeObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_1_4); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyBoolObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(3, 8, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_1_4(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(PyLongObject), + #elif CYTHON_COMPILING_IN_LIMITED_API + 0, 0, + #else + sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(PyLongObject), + #endif + __Pyx_ImportType_CheckSize_Warn_3_1_4); if (!__pyx_mstate->__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(3, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 15, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyComplexObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(4, 15, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_1_4(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(PyComplexObject), + #elif CYTHON_COMPILING_IN_LIMITED_API + 0, 0, + #else + sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(PyComplexObject), + #endif + __Pyx_ImportType_CheckSize_Warn_3_1_4); if (!__pyx_mstate->__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(4, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -4311,30 +3980,36 @@ static int __Pyx_modinit_type_import_code(void) { return -1; } -static int __Pyx_modinit_variable_import_code(void) { +static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_function_import_code(void) { +static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } - -#if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_cityhashcrc(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_cityhashcrc}, + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + {Py_mod_gil, Py_MOD_GIL_USED}, + #endif + #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE + {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED}, + #endif {0, NULL} }; #endif @@ -4349,12 +4024,10 @@ namespace { PyModuleDef_HEAD_INIT, "cityhashcrc", __pyx_k_Python_wrapper_for_CityHash_CRC, /* m_doc */ - #if CYTHON_PEP489_MULTI_PHASE_INIT - 0, /* m_size */ - #elif CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstate), /* m_size */ + #if CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstatetype), /* m_size */ #else - -1, /* m_size */ + (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT @@ -4375,51 +4048,71 @@ namespace { #ifdef __cplusplus } /* anonymous namespace */ #endif -#endif +/* PyModInitFuncType */ #ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#elif PY_MAJOR_VERSION < 3 -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" void -#else -#define __Pyx_PyMODINIT_FUNC void -#endif -#else -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * + #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #else -#define __Pyx_PyMODINIT_FUNC PyObject * -#endif + #ifdef __cplusplus + #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * + #else + #define __Pyx_PyMODINIT_FUNC PyObject * + #endif #endif - -#if PY_MAJOR_VERSION < 3 -__Pyx_PyMODINIT_FUNC initcityhashcrc(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC initcityhashcrc(void) -#else __Pyx_PyMODINIT_FUNC PyInit_cityhashcrc(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_cityhashcrc(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } +/* ModuleCreationPEP489 */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 +static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { + { + PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think + if (!module) { + PyErr_Clear(); // just try the 3.8-3.12 version + module = PyImport_ImportModule("_xxsubinterpreters"); + if (!module) goto bad; + } + PyObject *current = PyObject_CallMethod(module, "get_current", NULL); + Py_DECREF(module); + if (!current) goto bad; + if (PyTuple_Check(current)) { + PyObject *new_current = PySequence_GetItem(current, 0); + Py_DECREF(current); + current = new_current; + if (!new_current) goto bad; + } + long long as_c_int = PyLong_AsLongLong(current); + Py_DECREF(current); + return as_c_int; + } + bad: + PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n"); + return -1; +} +#endif +#if !CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; +#if CYTHON_COMPILING_IN_GRAAL + PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); +#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x03090000 + PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get()); +#elif CYTHON_COMPILING_IN_LIMITED_API + PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId(); +#else PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); +#endif + if (unlikely(current_id == -1)) { + return -1; + } if (main_interpreter_id == -1) { main_interpreter_id = current_id; - return (unlikely(current_id == -1)) ? -1 : 0; - } else if (unlikely(main_interpreter_id != current_id)) - #else - static PyInterpreterState *main_interpreter = NULL; - PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; - if (!main_interpreter) { - main_interpreter = current_interpreter; - } else if (unlikely(main_interpreter != current_interpreter)) - #endif - { + return 0; + } else if (unlikely(main_interpreter_id != current_id)) { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); @@ -4427,21 +4120,14 @@ static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { } return 0; } -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) -#else -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { -#if CYTHON_COMPILING_IN_LIMITED_API - result = PyModule_AddObject(module, to_name, value); -#else result = PyDict_SetItemString(moddict, to_name, value); -#endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { @@ -4454,8 +4140,10 @@ static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); + #if !CYTHON_USE_MODULE_STATE if (__Pyx_check_single_interpreter()) return NULL; + #endif if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); @@ -4463,12 +4151,8 @@ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDe module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; -#if CYTHON_COMPILING_IN_LIMITED_API - moddict = module; -#else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; -#endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; @@ -4482,12 +4166,12 @@ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDe static CYTHON_SMALL_CODE int __pyx_pymod_exec_cityhashcrc(PyObject *__pyx_pyinit_module) #endif -#endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif + __pyx_mstatetype *__pyx_mstate = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; @@ -4500,36 +4184,37 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_cityhashcrc(PyObject *__pyx_pyinit PyErr_SetString(PyExc_RuntimeError, "Module 'cityhashcrc' has already been imported. Re-initialisation is not supported."); return -1; } - #elif PY_MAJOR_VERSION >= 3 + #else if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_m = __pyx_pyinit_module; - Py_INCREF(__pyx_m); + __pyx_t_1 = __pyx_pyinit_module; + Py_INCREF(__pyx_t_1); #else - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("cityhashcrc", __pyx_methods, __pyx_k_Python_wrapper_for_CityHash_CRC, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #if CYTHON_USE_MODULE_STATE { - int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "cityhashcrc" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_m = __pyx_t_1; #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED); #endif + __pyx_mstate = __pyx_mstate_global; CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_mstate->__pyx_d); + __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /* ImportRefnannyAPI */ #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { @@ -4539,14 +4224,22 @@ if (!__Pyx_RefNanny) { Py_FatalError("failed to import 'refnanny' module"); } #endif - __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_cityhashcrc(void)", 0); + +__Pyx_RefNannySetupContext("PyInit_cityhashcrc", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + stringtab_initialized = 1; + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if 0 || defined(__Pyx_CyFunction_USED) || defined(__Pyx_FusedFunction_USED) || defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED) || defined(__Pyx_AsyncGen_USED) + if (__pyx_CommonTypesMetaclass_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif @@ -4562,48 +4255,30 @@ if (!__Pyx_RefNanny) { #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - PyEval_InitThreads(); - #endif - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - stringtab_initialized = 1; - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif if (__pyx_module_is_main_cityhashcrc) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } - #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "cityhashcrc")) { if (unlikely((PyDict_SetItemString(modules, "cityhashcrc", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } - #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_CreateCodeObjects(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ - (void)__Pyx_modinit_global_init_code(); - (void)__Pyx_modinit_variable_export_code(); - (void)__Pyx_modinit_function_export_code(); - (void)__Pyx_modinit_type_init_code(); - if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - (void)__Pyx_modinit_variable_import_code(); - (void)__Pyx_modinit_function_import_code(); + (void)__Pyx_modinit_global_init_code(__pyx_mstate); + (void)__Pyx_modinit_variable_export_code(__pyx_mstate); + (void)__Pyx_modinit_function_export_code(__pyx_mstate); + (void)__Pyx_modinit_type_init_code(__pyx_mstate); + if (unlikely((__Pyx_modinit_type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_variable_import_code(__pyx_mstate); + (void)__Pyx_modinit_function_import_code(__pyx_mstate); /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /* "cityhashcrc.pyx":11 * """ @@ -4611,8 +4286,8 @@ if (!__Pyx_RefNanny) { * __author__ = "Eugene Scherba" # <<<<<<<<<<<<<< * __email__ = "escherba+cityhash@gmail.com" * __version__ = '0.4.7' - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_u_Eugene_Scherba) < 0) __PYX_ERR(0, 11, __pyx_L1_error) +*/ + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_author, __pyx_mstate_global->__pyx_kp_u_Eugene_Scherba) < 0) __PYX_ERR(0, 11, __pyx_L1_error) /* "cityhashcrc.pyx":12 * @@ -4620,8 +4295,8 @@ if (!__Pyx_RefNanny) { * __email__ = "escherba+cityhash@gmail.com" # <<<<<<<<<<<<<< * __version__ = '0.4.7' * __all__ = [ - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_email, __pyx_kp_u_escherba_cityhash_gmail_com) < 0) __PYX_ERR(0, 12, __pyx_L1_error) +*/ + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_email, __pyx_mstate_global->__pyx_kp_u_escherba_cityhash_gmail_com) < 0) __PYX_ERR(0, 12, __pyx_L1_error) /* "cityhashcrc.pyx":13 * __author__ = "Eugene Scherba" @@ -4629,8 +4304,8 @@ if (!__Pyx_RefNanny) { * __version__ = '0.4.7' # <<<<<<<<<<<<<< * __all__ = [ * "CityHashCrc128", - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_u_0_4_7) < 0) __PYX_ERR(0, 13, __pyx_L1_error) +*/ + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_version, __pyx_mstate_global->__pyx_kp_u_0_4_7) < 0) __PYX_ERR(0, 13, __pyx_L1_error) /* "cityhashcrc.pyx":14 * __email__ = "escherba+cityhash@gmail.com" @@ -4638,19 +4313,10 @@ if (!__Pyx_RefNanny) { * __all__ = [ # <<<<<<<<<<<<<< * "CityHashCrc128", * "CityHashCrc128WithSeed", - */ - __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyList_Pack(3, __pyx_mstate_global->__pyx_n_u_CityHashCrc128, __pyx_mstate_global->__pyx_n_u_CityHashCrc128WithSeed, __pyx_mstate_global->__pyx_n_u_CityHashCrc256Bytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_u_CityHashCrc128); - __Pyx_GIVEREF(__pyx_n_u_CityHashCrc128); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_CityHashCrc128)) __PYX_ERR(0, 14, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_CityHashCrc128WithSeed); - __Pyx_GIVEREF(__pyx_n_u_CityHashCrc128WithSeed); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_u_CityHashCrc128WithSeed)) __PYX_ERR(0, 14, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_CityHashCrc256Bytes); - __Pyx_GIVEREF(__pyx_n_u_CityHashCrc256Bytes); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_u_CityHashCrc256Bytes)) __PYX_ERR(0, 14, __pyx_L1_error); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_all, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cityhashcrc.pyx":84 @@ -4659,10 +4325,10 @@ if (!__Pyx_RefNanny) { * def CityHashCrc128(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 128-bit hash from input data. * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11cityhashcrc_1CityHashCrc128, NULL, __pyx_n_s_cityhashcrc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) +*/ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11cityhashcrc_1CityHashCrc128, NULL, __pyx_mstate_global->__pyx_n_u_cityhashcrc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CityHashCrc128, __pyx_t_2) < 0) __PYX_ERR(0, 84, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CityHashCrc128, __pyx_t_2) < 0) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cityhashcrc.pyx":115 @@ -4671,10 +4337,10 @@ if (!__Pyx_RefNanny) { * def CityHashCrc256Bytes(data) -> bytes: # <<<<<<<<<<<<<< * """Obtain a 128-bit hash from input data. * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11cityhashcrc_3CityHashCrc256Bytes, NULL, __pyx_n_s_cityhashcrc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) +*/ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11cityhashcrc_3CityHashCrc256Bytes, NULL, __pyx_mstate_global->__pyx_n_u_cityhashcrc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CityHashCrc256Bytes, __pyx_t_2) < 0) __PYX_ERR(0, 115, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CityHashCrc256Bytes, __pyx_t_2) < 0) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cityhashcrc.pyx":144 @@ -4683,24 +4349,20 @@ if (!__Pyx_RefNanny) { * def CityHashCrc128WithSeed(data, seed: int = 0L) -> int: # <<<<<<<<<<<<<< * """Obtain a 128-bit hash using a seed. * - */ - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_0L)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_0L))) __PYX_ERR(0, 144, __pyx_L1_error) - __Pyx_INCREF(__pyx_int_0L); - __pyx_k_ = ((PyObject*)__pyx_int_0L); - __Pyx_GIVEREF(__pyx_int_0L); - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11cityhashcrc_5CityHashCrc128WithSeed, NULL, __pyx_n_s_cityhashcrc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) +*/ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_11cityhashcrc_5CityHashCrc128WithSeed, NULL, __pyx_mstate_global->__pyx_n_u_cityhashcrc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_CityHashCrc128WithSeed, __pyx_t_2) < 0) __PYX_ERR(0, 144, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_CityHashCrc128WithSeed, __pyx_t_2) < 0) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cityhashcrc.pyx":1 * #cython: infer_types=True # <<<<<<<<<<<<<< * #cython: embedsignature=True * #cython: binding=False - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ @@ -4709,7 +4371,7 @@ if (!__Pyx_RefNanny) { __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { - if (__pyx_d && stringtab_initialized) { + if (__pyx_mstate->__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init cityhashcrc", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE @@ -4730,12 +4392,122 @@ if (!__Pyx_RefNanny) { __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; - #elif PY_MAJOR_VERSION >= 3 - return __pyx_m; #else - return; + return __pyx_m; #endif } +/* #### Code section: pystring_table ### */ + +typedef struct { + const char *s; +#if 179 <= 65535 + const unsigned short n; +#elif 179 / 2 < INT_MAX + const unsigned int n; +#elif 179 / 2 < LONG_MAX + const unsigned long n; +#else + const Py_ssize_t n; +#endif +#if 1 <= 31 + const unsigned int encoding : 5; +#elif 1 <= 255 + const unsigned char encoding; +#elif 1 <= 65535 + const unsigned short encoding; +#else + const Py_ssize_t encoding; +#endif + const unsigned int is_unicode : 1; + const unsigned int intern : 1; +} __Pyx_StringTabEntry; +static const char * const __pyx_string_tab_encodings[] = { 0 }; +static const __Pyx_StringTabEntry __pyx_string_tab[] = { + {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */ + {__pyx_k_0_4_7, sizeof(__pyx_k_0_4_7), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_0_4_7 */ + {__pyx_k_Argument, sizeof(__pyx_k_Argument), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Argument */ + {__pyx_k_CityHashCrc128, sizeof(__pyx_k_CityHashCrc128), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CityHashCrc128 */ + {__pyx_k_CityHashCrc128WithSeed, sizeof(__pyx_k_CityHashCrc128WithSeed), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CityHashCrc128WithSeed */ + {__pyx_k_CityHashCrc256Bytes, sizeof(__pyx_k_CityHashCrc256Bytes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CityHashCrc256Bytes */ + {__pyx_k_Eugene_Scherba, sizeof(__pyx_k_Eugene_Scherba), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Eugene_Scherba */ + {__pyx_k_Note_that_Cython_is_deliberately, sizeof(__pyx_k_Note_that_Cython_is_deliberately), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Note_that_Cython_is_deliberately */ + {__pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TypeError */ + {__pyx_k_add_note, sizeof(__pyx_k_add_note), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_add_note */ + {__pyx_k_all, sizeof(__pyx_k_all), 0, 1, 1}, /* PyObject cname: __pyx_n_u_all */ + {__pyx_k_author, sizeof(__pyx_k_author), 0, 1, 1}, /* PyObject cname: __pyx_n_u_author */ + {__pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 1, 1}, /* PyObject cname: __pyx_n_u_basestring */ + {__pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 1, 1}, /* PyObject cname: __pyx_n_u_buffer */ + {__pyx_k_cityhashcrc, sizeof(__pyx_k_cityhashcrc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cityhashcrc */ + {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */ + {__pyx_k_data, sizeof(__pyx_k_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_data */ + {__pyx_k_email, sizeof(__pyx_k_email), 0, 1, 1}, /* PyObject cname: __pyx_n_u_email */ + {__pyx_k_escherba_cityhash_gmail_com, sizeof(__pyx_k_escherba_cityhash_gmail_com), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_escherba_cityhash_gmail_com */ + {__pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_got */ + {__pyx_k_has_incorrect_type_expected, sizeof(__pyx_k_has_incorrect_type_expected), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_has_incorrect_type_expected */ + {__pyx_k_instead, sizeof(__pyx_k_instead), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_instead */ + {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */ + {__pyx_k_module, sizeof(__pyx_k_module), 0, 1, 1}, /* PyObject cname: __pyx_n_u_module */ + {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */ + {__pyx_k_pop, sizeof(__pyx_k_pop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pop */ + {__pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_qualname */ + {__pyx_k_seed, sizeof(__pyx_k_seed), 0, 1, 1}, /* PyObject cname: __pyx_n_u_seed */ + {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */ + {__pyx_k_version, sizeof(__pyx_k_version), 0, 1, 1}, /* PyObject cname: __pyx_n_u_version */ + {0, 0, 0, 0, 0} +}; +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names); + +/* #### Code section: cached_builtins ### */ + +static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { + CYTHON_UNUSED_VAR(__pyx_mstate); + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 78, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + __Pyx_RefNannyFinishContext(); + return 0; +} +/* #### Code section: init_constants ### */ + +static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { + CYTHON_UNUSED_VAR(__pyx_mstate); + __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; + if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_mstate->__pyx_int_0L = PyLong_FromString("0", 0, 0); if (unlikely(!__pyx_mstate->__pyx_int_0L)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_int_64L = PyLong_FromString("64", 0, 0); if (unlikely(!__pyx_mstate->__pyx_int_64L)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_int_0xffffffffffffffffL = PyLong_FromString("0xffffffffffffffff", 0, 0); if (unlikely(!__pyx_mstate->__pyx_int_0xffffffffffffffffL)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_codeobjects ### */ + +static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { + CYTHON_UNUSED_VAR(__pyx_mstate); + return 0; +} +/* #### Code section: init_globals ### */ + +static int __Pyx_InitGlobals(void) { + /* PythonCompatibility.init */ + if (likely(__Pyx_init_co_variables() == 0)); else + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + return 0; + __pyx_L1_error:; + return -1; +} /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ @@ -4776,11 +4548,9 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; itp_getattro)) return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ -#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -4898,11 +4664,11 @@ static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; -#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); @@ -4918,14 +4684,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif } return result; } @@ -4934,13 +4696,6 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { if (unlikely(!s)) return NULL; if (likely(PyUnicode_CheckExact(s))) return s; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_CheckExact(s))) { - PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict"); - Py_DECREF(s); - return result; - } - #endif return __Pyx_PyObject_FormatAndDecref(s, f); } static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { @@ -4952,49 +4707,48 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObj } /* JoinPyUnicode */ -static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, +static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char) { #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyObject *result_uval; int result_ukind, kind_shift; Py_ssize_t i, char_pos; void *result_udata; - CYTHON_MAYBE_UNUSED_VAR(max_char); -#if CYTHON_PEP393_ENABLED + if (max_char > 1114111) max_char = 1114111; result_uval = PyUnicode_New(result_ulength, max_char); if (unlikely(!result_uval)) return NULL; result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; result_udata = PyUnicode_DATA(result_uval); -#else - result_uval = PyUnicode_FromUnicode(NULL, result_ulength); - if (unlikely(!result_uval)) return NULL; - result_ukind = sizeof(Py_UNICODE); - kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1; - result_udata = PyUnicode_AS_UNICODE(result_uval); -#endif assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); + if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0)) + goto overflow; char_pos = 0; for (i=0; i < value_count; i++) { int ukind; Py_ssize_t ulength; void *udata; - PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); - if (unlikely(__Pyx_PyUnicode_READY(uval))) + PyObject *uval = values[i]; + #if !CYTHON_COMPILING_IN_LIMITED_API + if (__Pyx_PyUnicode_READY(uval) == (-1)) goto bad; + #endif ulength = __Pyx_PyUnicode_GET_LENGTH(uval); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(ulength < 0)) goto bad; + #endif if (unlikely(!ulength)) continue; if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) goto overflow; ukind = __Pyx_PyUnicode_KIND(uval); udata = __Pyx_PyUnicode_DATA(uval); - if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { + if (ukind == result_ukind) { memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); } else { #if PY_VERSION_HEX >= 0x030d0000 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; - #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) + #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters) _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); #else Py_ssize_t j; @@ -5013,16 +4767,26 @@ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_co Py_DECREF(result_uval); return NULL; #else + Py_ssize_t i; + PyObject *result = NULL; + PyObject *value_tuple = PyTuple_New(value_count); + if (unlikely(!value_tuple)) return NULL; CYTHON_UNUSED_VAR(max_char); CYTHON_UNUSED_VAR(result_ulength); - CYTHON_UNUSED_VAR(value_count); - return PyUnicode_Join(__pyx_empty_unicode, value_tuple); + for (i=0; i__pyx_empty_unicode, value_tuple); +bad: + Py_DECREF(value_tuple); + return result; #endif } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject *const *args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; @@ -5050,14 +4814,12 @@ static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args --tstate->recursion_depth; return result; } -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; -#if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; -#endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; @@ -5065,19 +4827,11 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { - return NULL; - } - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } - #endif if ( -#if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && -#endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { @@ -5114,9 +4868,7 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, k = NULL; } closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); -#endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); @@ -5125,17 +4877,10 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, d = NULL; nd = 0; } -#if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); -#else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, closure); -#endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); @@ -5150,13 +4895,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -5175,13 +4915,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -5195,7 +4930,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API -static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { +static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; @@ -5203,7 +4938,7 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **arg if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); - if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: @@ -5211,7 +4946,32 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **arg return result; } #endif -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { +#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API + #if PY_VERSION_HEX < 0x03090000 + #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable) + #elif CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) { + PyTypeObject *tp = Py_TYPE(callable); + #if defined(__Pyx_CyFunction_USED) + if (__Pyx_CyFunction_CheckExact(callable)) { + return __Pyx_CyFunction_func_vectorcall(callable); + } + #endif + if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) { + return NULL; + } + assert(PyCallable_Check(callable)); + Py_ssize_t offset = tp->tp_vectorcall_offset; + assert(offset > 0); + vectorcallfunc ptr; + memcpy(&ptr, (char *) callable + offset, sizeof(ptr)); + return ptr; +} + #else + #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable) + #endif +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { @@ -5232,12 +4992,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } - #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif - #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); @@ -5245,24 +5003,22 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif #endif if (kwargs == NULL) { - #if CYTHON_VECTORCALL - #if PY_VERSION_HEX < 0x03090000 - vectorcallfunc f = _PyVectorcall_Function(func); - #else - vectorcallfunc f = PyVectorcall_Function(func); - #endif + #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API + vectorcallfunc f = __Pyx_PyVectorcall_Function(func); if (f) { - return f(func, args, (size_t)nargs, NULL); + return f(func, args, _nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); - if (f) return f(func, args, (size_t)nargs, NULL); + if (f) return f(func, args, _nargs, NULL); } + #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL + return PyObject_Vectorcall(func, args, _nargs, NULL); #endif } if (nargs == 0) { - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); @@ -5271,14 +5027,28 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif } -/* PyObjectCallOneArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *args[2] = {NULL, arg}; - return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - /* TupleAndListFromArray */ -#if CYTHON_COMPILING_IN_CPYTHON +#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + Py_ssize_t i; + if (n <= 0) { + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + for (i = 0; i < n; i++) { + if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < 0)) { + Py_DECREF(res); + return NULL; + } + Py_INCREF(src[i]); + } + return res; +} +#elif CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; @@ -5292,8 +5062,7 @@ __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { - Py_INCREF(__pyx_empty_tuple); - return __pyx_empty_tuple; + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; @@ -5316,7 +5085,8 @@ __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ + !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { @@ -5363,55 +5133,39 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL return PyObject_RichCompareBool(s1, s2, equals); #else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; + Py_ssize_t length, length2; int kind; void *data1, *data2; + #if !CYTHON_COMPILING_IN_LIMITED_API if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; + #endif length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length < 0)) return -1; + #endif + length2 = __Pyx_PyUnicode_GET_LENGTH(s2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length2 < 0)) return -1; + #endif + if (length != length2) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; - #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; - #else - hash1 = ((PyUnicodeObject*)s1)->hash; - hash2 = ((PyUnicodeObject*)s2)->hash; - #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } @@ -5429,9 +5183,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { @@ -5441,9 +5192,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -5451,14 +5199,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int return result; } return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ); return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_NE); #endif } @@ -5467,14 +5209,25 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { - Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(n == -1)) return NULL; + #endif for (i = 0; i < n; i++) { - if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + if (s == namei) return kwvalues[i]; } for (i = 0; i < n; i++) { - int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; @@ -5482,15 +5235,26 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO } return NULL; } -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { - Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); + Py_ssize_t i, nkwargs; PyObject *dict; +#if !CYTHON_ASSUME_SAFE_SIZE + nkwargs = PyTuple_Size(kwnames); + if (unlikely(nkwargs < 0)) return NULL; +#else + nkwargs = PyTuple_GET_SIZE(kwnames); +#endif dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif } -/* ParseKeywords */ -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); - while (1) { - Py_XDECREF(key); key = NULL; - Py_XDECREF(value); value = NULL; - if (kwds_is_tuple) { - Py_ssize_t size; -#if CYTHON_ASSUME_SAFE_MACROS - size = PyTuple_GET_SIZE(kwds); +/* UnpackUnboundCMethod */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; + PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); + if (unlikely(!selfless_args)) return NULL; + result = PyObject_Call(method, selfless_args, kwargs); + Py_DECREF(selfless_args); + return result; +} +#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000 +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { + return _PyObject_Vectorcall + (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames); +} #else - size = PyTuple_Size(kwds); - if (size < 0) goto bad; +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + return +#if PY_VERSION_HEX < 0x03090000 + _PyObject_Vectorcall +#else + PyObject_Vectorcall #endif - if (pos >= size) break; -#if CYTHON_AVOID_BORROWED_REFS - key = __Pyx_PySequence_ITEM(kwds, pos); - if (!key) goto bad; -#elif CYTHON_ASSUME_SAFE_MACROS - key = PyTuple_GET_ITEM(kwds, pos); + (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames); +} +#endif +static PyMethodDef __Pyx_UnboundCMethod_Def = { + "CythonUnboundCMethod", + __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 + METH_VARARGS | METH_KEYWORDS, +#else + METH_FASTCALL | METH_KEYWORDS, +#endif + NULL +}; +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method, *result=NULL; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + result = method; +#if CYTHON_COMPILING_IN_CPYTHON + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } else +#endif +#if CYTHON_COMPILING_IN_PYPY #else - key = PyTuple_GetItem(kwds, pos); - if (!key) goto bad; + if (PyCFunction_Check(method)) #endif - value = kwvalues[pos]; - pos++; + { + PyObject *self; + int self_found; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + self = PyObject_GetAttrString(method, "__self__"); + if (!self) { + PyErr_Clear(); } - else - { - if (!PyDict_Next(kwds, &pos, &key, &value)) break; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); +#else + self = PyCFunction_GET_SELF(method); +#endif + self_found = (self && self != Py_None); +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + Py_XDECREF(self); #endif + if (self_found) { + PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); + if (unlikely(!unbound_method)) return -1; + Py_DECREF(method); + result = unbound_method; } - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(value); - Py_DECREF(key); + } +#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if (unlikely(target->method)) { + Py_DECREF(result); + } else #endif - key = NULL; - value = NULL; - continue; + target->method = result; + return 0; +} + +/* CallUnboundCMethod2 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { + int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); + if (likely(was_initialized == 2 && cfunc->func)) { + PyObject *args[2] = {arg1, arg2}; + if (cfunc->flag == METH_FASTCALL) { + return __Pyx_CallCFunctionFast(cfunc, self, args, 2); } -#if !CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL); + } +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + else if (unlikely(was_initialized == 1)) { + __Pyx_CachedCFunction tmp_cfunc = { +#ifndef __cplusplus + 0 #endif - Py_INCREF(value); - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; + }; + tmp_cfunc.type = cfunc->type; + tmp_cfunc.method_name = cfunc->method_name; + return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2); + } #endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = ( - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key) - ); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; + PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); + __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); + return result; +} #endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + PyObject *result = NULL; + PyObject *args = PyTuple_New(2); + if (unlikely(!args)) return NULL; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + if (cfunc->flag & METH_KEYWORDS) + result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); + else + result = __Pyx_CallCFunction(cfunc, self, args); + Py_DECREF(args); + return result; + } +#endif + { + PyObject *args[4] = {NULL, self, arg1, arg2}; + return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + } +} + +/* ParseKeywords */ +static int __Pyx_ValidateDuplicatePosArgs( + PyObject *kwds, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + const char* function_name) +{ + PyObject ** const *name = argnames; + while (name != first_kw_arg) { + PyObject *key = **name; + int found = PyDict_Contains(kwds, key); + if (unlikely(found)) { + if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; + } + name++; + } + return 0; +bad: + return -1; +} +#if CYTHON_USE_UNICODE_INTERNALS +static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) { + int kind; + Py_ssize_t len = PyUnicode_GET_LENGTH(s1); + if (len != PyUnicode_GET_LENGTH(s2)) return 0; + kind = PyUnicode_KIND(s1); + if (kind != PyUnicode_KIND(s2)) return 0; + const void *data1 = PyUnicode_DATA(s1); + const void *data2 = PyUnicode_DATA(s2); + return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0); +} +#endif +static int __Pyx_MatchKeywordArg_str( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + PyObject ** const *name; + #if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t key_hash = ((PyASCIIObject*)key)->hash; + if (unlikely(key_hash == -1)) { + key_hash = PyObject_Hash(key); + if (unlikely(key_hash == -1)) + goto bad; + } + #endif + name = first_kw_arg; + while (*name) { + PyObject *name_str = **name; + #if CYTHON_USE_UNICODE_INTERNALS + if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) { + *index_found = (size_t) (name - argnames); + return 1; + } + #else + #if CYTHON_ASSUME_SAFE_SIZE + if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) + #endif + { + int cmp = PyUnicode_Compare(name_str, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + *index_found = (size_t) (name - argnames); + return 1; } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; } + #endif + name++; + } + name = argnames; + while (name != first_kw_arg) { + PyObject *name_str = **name; + #if CYTHON_USE_UNICODE_INTERNALS + if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) { + if (__Pyx_UnicodeKeywordsEqual(name_str, key)) + goto arg_passed_twice; + } + #else + #if CYTHON_ASSUME_SAFE_SIZE + if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) + #endif + { + if (unlikely(name_str == key)) goto arg_passed_twice; + int cmp = PyUnicode_Compare(name_str, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + } + #endif + name++; + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +bad: + return -1; +} +static int __Pyx_MatchKeywordArg_nostr( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + PyObject ** const *name; + if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; + name = first_kw_arg; + while (*name) { + int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); + if (cmp == 1) { + *index_found = (size_t) (name - argnames); + return 1; + } + if (unlikely(cmp == -1)) goto bad; + name++; + } + name = argnames; + while (name != first_kw_arg) { + int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); + if (unlikely(cmp != 0)) { + if (cmp == 1) goto arg_passed_twice; + else goto bad; + } + name++; } - Py_XDECREF(key); - Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); @@ -5656,21 +5550,244 @@ static int __Pyx_ParseOptionalKeywords( PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; -invalid_keyword: - #if PY_MAJOR_VERSION < 3 - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); +bad: + return -1; +} +static CYTHON_INLINE int __Pyx_MatchKeywordArg( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + return likely(PyUnicode_CheckExact(key)) ? + __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) : + __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name); +} +static void __Pyx_RejectUnknownKeyword( + PyObject *kwds, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + const char *function_name) +{ + Py_ssize_t pos = 0; + PyObject *key = NULL; + __Pyx_BEGIN_CRITICAL_SECTION(kwds); + while (PyDict_Next(kwds, &pos, &key, NULL)) { + PyObject** const *name = first_kw_arg; + while (*name && (**name != key)) name++; + if (!*name) { + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); + #endif + size_t index_found = 0; + int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); + if (cmp != 1) { + if (cmp == 0) { + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif + break; + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif + } + } + __Pyx_END_CRITICAL_SECTION(); + assert(PyErr_Occurred()); +} +static int __Pyx_ParseKeywordDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs) +{ + PyObject** const *name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + Py_ssize_t extracted = 0; +#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) + if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; +#endif + name = first_kw_arg; + while (*name && num_kwargs > extracted) { + PyObject * key = **name; + PyObject *value; + int found = 0; + #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + found = PyDict_GetItemRef(kwds, key, &value); + #else + value = PyDict_GetItemWithError(kwds, key); + if (value) { + Py_INCREF(value); + found = 1; + } else { + if (unlikely(PyErr_Occurred())) goto bad; + } + #endif + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + extracted++; + } + name++; + } + if (num_kwargs > extracted) { + if (ignore_unknown_kwargs) { + if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1)) + goto bad; + } else { + __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name); + goto bad; + } + } + return 0; +bad: + return -1; +} +static int __Pyx_ParseKeywordDictToDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject** const *name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + Py_ssize_t len; +#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) + if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; +#endif + if (PyDict_Update(kwds2, kwds) < 0) goto bad; + name = first_kw_arg; + while (*name) { + PyObject *key = **name; + PyObject *value; +#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop)) + int found = PyDict_Pop(kwds2, key, &value); + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + } +#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + int found = PyDict_GetItemRef(kwds2, key, &value); + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad; + } +#else + #if CYTHON_COMPILING_IN_CPYTHON + value = _PyDict_Pop(kwds2, key, kwds2); #else + value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2); + #endif + if (value == kwds2) { + Py_DECREF(value); + } else { + if (unlikely(!value)) goto bad; + values[name-argnames] = value; + } +#endif + name++; + } + len = PyDict_Size(kwds2); + if (len > 0) { + return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name); + } else if (unlikely(len == -1)) { + goto bad; + } + return 0; +bad: + return -1; +} +static int __Pyx_ParseKeywordsTuple( + PyObject *kwds, + PyObject * const *kwvalues, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs) +{ + PyObject *key = NULL; + PyObject** const * name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) { +#if CYTHON_AVOID_BORROWED_REFS + key = __Pyx_PySequence_ITEM(kwds, pos); +#else + key = __Pyx_PyTuple_GET_ITEM(kwds, pos); +#endif +#if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!key)) goto bad; +#endif + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + PyObject *value = kwvalues[pos]; + values[name-argnames] = __Pyx_NewRef(value); + } else { + size_t index_found = 0; + int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); + if (cmp == 1) { + PyObject *value = kwvalues[pos]; + values[index_found] = __Pyx_NewRef(value); + } else { + if (unlikely(cmp == -1)) goto bad; + if (kwds2) { + PyObject *value = kwvalues[pos]; + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else if (!ignore_unknown_kwargs) { + goto invalid_keyword; + } + } + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + key = NULL; + #endif + } + return 0; +invalid_keyword: PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); - #endif + goto bad; bad: + #if CYTHON_AVOID_BORROWED_REFS Py_XDECREF(key); - Py_XDECREF(value); + #endif return -1; } +static int __Pyx_ParseKeywords( + PyObject *kwds, + PyObject * const *kwvalues, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs) +{ + if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) + return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); + else if (kwds2) + return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name); + else + return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); +} /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( @@ -5683,74 +5800,22 @@ static void __Pyx_RaiseArgtupleInvalid( Py_ssize_t num_expected; const char *more_or_less; if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - PyErr_Format(PyExc_TypeError, - "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -/* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - __Pyx_PyThreadState_declare - CYTHON_UNUSED_VAR(cause); - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; + if (exact) { + more_or_less = "exactly"; + } + PyErr_Format(PyExc_TypeError, + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); } -#else + +/* RaiseException */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { @@ -5835,9 +5900,9 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { - #if PY_VERSION_HEX >= 0x030C00A6 +#if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); - #elif CYTHON_FAST_THREAD_STATE +#elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -5857,13 +5922,12 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_XDECREF(owned_instance); return; } -#endif /* RaiseUnexpectedTypeError */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) { - __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, expected, obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); @@ -5875,39 +5939,59 @@ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *nam { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; + PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode; + int from_annotation_subclass = 0; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } - else if (exact) { - #if PY_MAJOR_VERSION == 2 - if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { + else if (!exact) { if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } else if (exact == 2) { + if (__Pyx_TypeCheck(obj, type)) { + from_annotation_subclass = 1; + extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately; + } } - type_name = __Pyx_PyType_GetName(type); - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + type_name = __Pyx_PyType_GetFullyQualifiedName(type); + obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME - ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); + ", got " __Pyx_FMT_TYPENAME ")" +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + "%s%U" +#endif + , name, type_name, obj_type_name +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + , (from_annotation_subclass ? ". " : ""), extra_info +#endif + ); +#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + if (exact == 2 && from_annotation_subclass) { + PyObject *res; + PyObject *vargs[2]; + vargs[0] = PyErr_GetRaisedException(); + vargs[1] = extra_info; + res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL); + Py_XDECREF(res); + PyErr_SetRaisedException(vargs[0]); + } +#endif __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* TypeImport */ -#ifndef __PYX_HAVE_RT_ImportType_3_0_12 -#define __PYX_HAVE_RT_ImportType_3_0_12 -static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *module_name, const char *class_name, - size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size) +#ifndef __PYX_HAVE_RT_ImportType_3_1_4 +#define __PYX_HAVE_RT_ImportType_3_1_4 +static PyTypeObject *__Pyx_ImportType_3_1_4(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_4 check_size) { PyObject *result = 0; - char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; -#if CYTHON_COMPILING_IN_LIMITED_API +#ifdef Py_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif @@ -5920,10 +6004,13 @@ static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *modul module_name, class_name); goto bad; } -#if !CYTHON_COMPILING_IN_LIMITED_API +#ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else + if (size == 0) { + return (PyTypeObject *)result; + } py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; @@ -5955,7 +6042,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *modul module_name, class_name, size, basicsize+itemsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_12 && + if (check_size == __Pyx_ImportType_CheckSize_Error_3_1_4 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " @@ -5963,12 +6050,13 @@ static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *modul module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_12 && (size_t)basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility. " - "Expected %zd from C header, got %zd from PyObject", - module_name, class_name, size, basicsize); - if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_1_4 && (size_t)basicsize > size) { + if (PyErr_WarnFormat(NULL, 0, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize) < 0) { + goto bad; + } } return (PyTypeObject *)result; bad: @@ -5977,6 +6065,25 @@ static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *modul } #endif +/* ListPack */ +static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) { + va_list va; + PyObject *l = PyList_New(n); + va_start(va, n); + if (unlikely(!l)) goto end; + for (Py_ssize_t i=0; i__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON - cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_mstate_global->__pyx_cython_runtime); if (likely(cython_runtime_dict)) { + __Pyx_BEGIN_CRITICAL_SECTION(*cython_runtime_dict); __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, - __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback)) + Py_XINCREF(use_cline); + __Pyx_END_CRITICAL_SECTION(); } else #endif { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_INCREF(use_cline); Py_DECREF(use_cline_obj); } else { PyErr_Clear(); @@ -6036,18 +6147,18 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { } if (!use_cline) { c_line = 0; - (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + (void) PyObject_SetAttr(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } + Py_XDECREF(use_cline); __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ -#if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { @@ -6069,64 +6180,103 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co return mid + 1; } } -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; +static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) { + __Pyx_CachedCodeObjectType* code_object; int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + if (unlikely(!code_line) || unlikely(!code_cache->entries)) { return NULL; } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); + if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) { return NULL; } - code_object = __pyx_code_cache.entries[pos].code_object; + code_object = code_cache->entries[pos].code_object; Py_INCREF(code_object); return code_object; } -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) { +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS + (void)__pyx__find_code_object; + return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss. +#else + struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count); + if (old_count < 0) { + __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); + return NULL; + } +#endif + __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line); +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); +#endif + return result; +#endif +} +static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object) +{ int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + __Pyx_CodeObjectCacheEntry* entries = code_cache->entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; + code_cache->entries = entries; + code_cache->max_count = 64; + code_cache->count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; + pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); + if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) { + __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object; entries[pos].code_object = code_object; + Py_INCREF(code_object); Py_DECREF(tmp); return; } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; + if (code_cache->count == code_cache->max_count) { + int new_max = code_cache->max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; + code_cache->entries = entries; + code_cache->max_count = new_max; } - for (i=__pyx_code_cache.count; i>pos; i--) { + for (i=code_cache->count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; - __pyx_code_cache.count++; + code_cache->count++; Py_INCREF(code_object); } +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) { +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS + (void)__pyx__insert_code_object; + return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail. +#else + struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_nonatomic_int_type expected = 0; + if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) { + return; + } +#endif + __pyx__insert_code_object(code_cache, code_line, code_object); +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN); #endif +#endif +} /* AddTraceback */ #include "compile.h" @@ -6146,35 +6296,12 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { - PyObject *result; - result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); - #if __PYX_LIMITED_VERSION_HEX < 0x030780000 - { - PyObject *compiled = NULL, *result = NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; - compiled = Py_CompileString( - "out = type(code)(\n" - " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" - " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" - " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" - " code.co_lnotab)\n", "", Py_file_input); - if (!compiled) return NULL; - result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); - Py_DECREF(compiled); - if (!result) PyErr_Print(); - Py_DECREF(result); - result = PyDict_GetItemString(scratch_dict, "out"); - if (result) Py_INCREF(result); - return result; - } - #else return NULL; - #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { @@ -6187,20 +6314,26 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); - code_object = Py_CompileString("_getframe()", filename, Py_eval_input); - if (unlikely(!code_object)) goto bad; - py_py_line = PyLong_FromLong(py_line); - if (unlikely(!py_py_line)) goto bad; - py_funcname = PyUnicode_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - dict = PyDict_New(); - if (unlikely(!dict)) goto bad; - { - PyObject *old_code_object = code_object; - code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); - Py_DECREF(old_code_object); + code_object = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!code_object) { + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, code_object); + } else { + dict = PyDict_New(); } - if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; @@ -6226,58 +6359,17 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; - #if PY_MAJOR_VERSION < 3 - PyObject *py_srcfile = NULL; - py_srcfile = PyString_FromString(filename); - if (!py_srcfile) goto bad; - #endif if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - if (!py_funcname) goto bad; - #endif } - #if PY_MAJOR_VERSION < 3 - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - #else py_code = PyCode_NewEmpty(filename, funcname, py_line); - #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_srcfile); - #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -6308,7 +6400,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ + __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; @@ -6343,7 +6435,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } /* CIntFromPy */ -static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) { +static CYTHON_INLINE uint64_t __Pyx_PyLong_As_uint64_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -6353,24 +6445,11 @@ static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(uint64_t) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(uint64_t, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (uint64_t) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { uint64_t val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (uint64_t) -1; - val = __Pyx_PyInt_As_uint64_t(tmp); + val = __Pyx_PyLong_As_uint64_t(tmp); Py_DECREF(tmp); return val; } @@ -6610,23 +6689,78 @@ static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) { } /* FormatTypeName */ -#if CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 static __Pyx_TypeName -__Pyx_PyType_GetName(PyTypeObject* tp) +__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp) { - PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_n_s_name); - if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { - PyErr_Clear(); - Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__8); + PyObject *module = NULL, *name = NULL, *result = NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030b0000 + name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_mstate_global->__pyx_n_u_qualname); + #else + name = PyType_GetQualName(tp); + #endif + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad; + module = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_mstate_global->__pyx_n_u_module); + if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad; + if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) { + result = name; + name = NULL; + goto done; + } + result = PyUnicode_FromFormat("%U.%U", module, name); + if (unlikely(result == NULL)) goto bad; + done: + Py_XDECREF(name); + Py_XDECREF(module); + return result; + bad: + PyErr_Clear(); + if (name) { + result = name; + name = NULL; + } else { + result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_); + } + goto done; +} +#endif + +/* PyObjectVectorCallKwBuilder */ +#if CYTHON_VECTORCALL +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_PyObject_FastCallDict; + if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; + Py_INCREF(key); + args[n] = value; + return 0; +} +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_VectorcallBuilder_AddArgStr; + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n); +} +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + PyObject *pyKey = PyUnicode_FromString(key); + if (!pyKey) return -1; + return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n); +} +#else // CYTHON_VECTORCALL +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) { + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; } - return name; + return PyDict_SetItem(builder, key, value); } #endif /* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -6638,17 +6772,17 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG +#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); @@ -6669,25 +6803,25 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + PyObject *from_bytes, *result = NULL, *kwds = NULL; + PyObject *py_bytes = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - if (!is_unsigned) { - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + { + PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; + if (!is_unsigned) { + kwds = __Pyx_MakeVectorcallBuilderKwds(1); + if (!kwds) goto limited_bad; + if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; + } + result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } - result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); - Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); @@ -6697,7 +6831,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { } /* CIntFromPy */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -6707,24 +6841,11 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(long) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + val = __Pyx_PyLong_As_long(tmp); Py_DECREF(tmp); return val; } @@ -6964,7 +7085,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { } /* CIntFromPy */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -6974,24 +7095,11 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); + val = __Pyx_PyLong_As_int(tmp); Py_DECREF(tmp); return val; } @@ -7271,29 +7379,6 @@ static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } -#if PY_MAJOR_VERSION == 2 -static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { - PyObject *exception, *value, *tb; - int res; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&exception, &value, &tb); - res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - if (!res) { - res = PyObject_IsSubclass(err, exc_type2); - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - } - __Pyx_ErrRestore(exception, value, tb); - return res; -} -#else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); @@ -7301,21 +7386,15 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } -#endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 +#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 return Py_Version & ~0xFFUL; #else - const char* rt_version = Py_GetVersion(); - unsigned long version = 0; - unsigned long factor = 0x01000000UL; - unsigned int digit = 0; - int i = 0; - while (factor) { - while ('0' <= rt_version[i] && rt_version[i] <= '9') { - digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + static unsigned long __Pyx_cached_runtime_version = 0; + if (__Pyx_cached_runtime_version == 0) { + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; ++i; } - version += factor * digit; - if (rt_version[i] != '.') - break; - digit = 0; - factor >>= 8; - ++i; + __Pyx_cached_runtime_version = version; } - return version; + return __Pyx_cached_runtime_version; #endif } + +/* CheckBinaryVersion */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) @@ -7394,44 +7479,27 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt } /* InitStrings */ -#if PY_MAJOR_VERSION >= 3 -static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { - if (t.is_unicode | t.is_str) { - if (t.intern) { - *str = PyUnicode_InternFromString(t.s); - } else if (t.encoding) { - *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); - } else { - *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); - } - } else { - *str = PyBytes_FromStringAndSize(t.s, t.n - 1); - } - if (!*str) - return -1; - if (PyObject_Hash(*str) == -1) - return -1; - return 0; -} -#endif -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION >= 3 - __Pyx_InitString(*t, t->p); - #else +static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names) { + while (t->s) { + PyObject *str; if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); + if (t->intern) { + str = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + str = PyUnicode_Decode(t->s, t->n - 1, encoding_names[t->encoding], NULL); + } else { + str = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + str = PyBytes_FromStringAndSize(t->s, t->n - 1); } - if (!*t->p) + if (!str) return -1; - if (PyObject_Hash(*t->p) == -1) + *target = str; + if (PyObject_Hash(str) == -1) return -1; - #endif ++t; + ++target; } return 0; } @@ -7459,31 +7527,30 @@ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#if !CYTHON_PEP393_ENABLED -static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } + const char* result; + Py_ssize_t unicode_length; + CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 + if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL; + #else + result = PyUnicode_AsUTF8AndSize(o, length); + #endif + #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + unicode_length = PyUnicode_GetLength(o); + if (unlikely(unicode_length < 0)) return NULL; + if (unlikely(unicode_length != *length)) { + PyUnicode_AsASCIIString(o); + return NULL; } + #endif + return result; } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -} #else -static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); @@ -7495,25 +7562,25 @@ static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py #else return PyUnicode_AsUTF8AndSize(o, length); #endif -} #endif +} #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + if (PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif -#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { +#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))) *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); - } else +#else + *length = PyByteArray_Size(o); + if (*length == -1) return NULL; + return PyByteArray_AsString(o); #endif + } else { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); @@ -7536,9 +7603,8 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { Py_DECREF(x); return retval; } -static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { - __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); -#if PY_MAJOR_VERSION >= 3 +static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result)); if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " @@ -7552,74 +7618,44 @@ static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const __Pyx_DECREF_TypeName(result_type_name); return result; } -#endif PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", - type_name, type_name, result_type_name); + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")", + result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif - const char *name = NULL; PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x) || PyLong_Check(x))) -#else if (likely(PyLong_Check(x))) -#endif - return __Pyx_NewRef(x); + return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; - #if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = m->nb_int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = m->nb_long(x); - } - #else if (likely(m && m->nb_int)) { - name = "int"; - res = m->nb_int(x); + res = m->nb_int(x); } - #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { - res = PyNumber_Int(x); + res = PyNumber_Long(x); } #endif if (likely(res)) { -#if PY_MAJOR_VERSION < 3 - if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { -#else - if (unlikely(!PyLong_CheckExact(res))) { -#endif - return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); - } + if (unlikely(!PyLong_CheckExact(res))) { + return __Pyx_PyNumber_LongWrongResultType(res); + } } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); + PyErr_SetString(PyExc_TypeError, + "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(b); - } -#endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { @@ -7665,35 +7701,350 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { } x = PyNumber_Index(b); if (!x) return -1; - ival = PyInt_AsSsize_t(x); + ival = PyLong_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); -#if PY_MAJOR_VERSION < 3 - } else if (likely(PyInt_CheckExact(o))) { - return PyInt_AS_LONG(o); -#endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; - ival = PyInt_AsLong(x); + ival = PyLong_AsLong(x); Py_DECREF(x); return ival; } } +static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) { + CYTHON_UNUSED_VAR(b); + return __Pyx_NewRef(Py_None); +} static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { + return PyLong_FromSize_t(ival); } +/* MultiPhaseInitModuleState */ +#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE +#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000) + #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1 +#else + #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0 +#endif +#endif +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS +#error "Module state with PEP489 requires atomics. Currently that's one of\ + C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics" +#endif +#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +#define __Pyx_ModuleStateLookup_Lock() +#define __Pyx_ModuleStateLookup_Unlock() +#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000 +static PyMutex __Pyx_ModuleStateLookup_mutex = {0}; +#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(__cplusplus) && __cplusplus >= 201103L +#include +static std::mutex __Pyx_ModuleStateLookup_mutex; +#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock() +#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock() +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__) +#include +static mtx_t __Pyx_ModuleStateLookup_mutex; +static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT; +static void __Pyx_ModuleStateLookup_initialize_mutex(void) { + mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain); +} +#define __Pyx_ModuleStateLookup_Lock()\ + call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\ + mtx_lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(HAVE_PTHREAD_H) +#include +static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER; +#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(_WIN32) +#include // synchapi.h on its own doesn't work +static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT; +#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) +#else +#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\ + Requires C standard >= C11, or C++ standard >= C++11,\ + or pthreads, or the Windows 32 API, or Python >= 3.13." +#endif +typedef struct { + int64_t id; + PyObject *module; +} __Pyx_InterpreterIdAndModule; +typedef struct { + char interpreter_id_as_index; + Py_ssize_t count; + Py_ssize_t allocated; + __Pyx_InterpreterIdAndModule table[1]; +} __Pyx_ModuleStateLookupData; +#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32 +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0; +#endif +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0; +#else +static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL; +#endif +static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound( + __Pyx_InterpreterIdAndModule* table, + Py_ssize_t count, + int64_t interpreterId) { + __Pyx_InterpreterIdAndModule* begin = table; + __Pyx_InterpreterIdAndModule* end = begin + count; + if (begin->id == interpreterId) { + return begin; + } + while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { + __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2; + if (halfway->id == interpreterId) { + return halfway; + } + if (halfway->id < interpreterId) { + begin = halfway; + } else { + end = halfway; + } + } + for (; begin < end; ++begin) { + if (begin->id >= interpreterId) return begin; + } + return begin; +} +static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return NULL; +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); + { + __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); + if (likely(data)) { + __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data); + if (likely(data == new_data)) { + goto read_finished; + } + } + __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); + __Pyx_ModuleStateLookup_Lock(); + __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter); + data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); + __Pyx_ModuleStateLookup_Unlock(); + } + read_finished:; +#else + __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data; +#endif + __Pyx_InterpreterIdAndModule* found = NULL; + if (unlikely(!data)) goto end; + if (data->interpreter_id_as_index) { + if (interpreter_id < data->count) { + found = data->table+interpreter_id; + } + } else { + found = __Pyx_State_FindModuleStateLookupTableLowerBound( + data->table, data->count, interpreter_id); + } + end: + { + PyObject *result=NULL; + if (found && found->id == interpreter_id) { + result = found->module; + } +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); +#endif + return result; + } +} +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) { + while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0); +} +#else +#define __Pyx_ModuleStateLookup_wait_until_no_readers() +#endif +static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) { + Py_ssize_t to_allocate = (*old_data)->allocated; + while (to_allocate <= interpreter_id) { + if (to_allocate == 0) to_allocate = 1; + else to_allocate *= 2; + } + __Pyx_ModuleStateLookupData *new_data = *old_data; + if (to_allocate != (*old_data)->allocated) { + new_data = (__Pyx_ModuleStateLookupData *)realloc( + *old_data, + sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); + if (!new_data) { + PyErr_NoMemory(); + return -1; + } + for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) { + new_data->table[i].id = i; + new_data->table[i].module = NULL; + } + new_data->allocated = to_allocate; + } + new_data->table[interpreter_id].module = module; + if (new_data->count < interpreter_id+1) { + new_data->count = interpreter_id+1; + } + *old_data = new_data; + return 0; +} +static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) { + __Pyx_InterpreterIdAndModule *read = data->table; + __Pyx_InterpreterIdAndModule *write = data->table; + __Pyx_InterpreterIdAndModule *end = read + data->count; + for (; readmodule) { + write->id = read->id; + write->module = read->module; + ++write; + } + } + data->count = write - data->table; + for (; writeid = 0; + write->module = NULL; + } + data->interpreter_id_as_index = 0; +} +static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return -1; + int result = 0; + __Pyx_ModuleStateLookup_Lock(); +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *) + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); +#else + __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data; +#endif + __Pyx_ModuleStateLookupData *new_data = old_data; + if (!new_data) { + new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData)); + if (!new_data) { + result = -1; + PyErr_NoMemory(); + goto end; + } + new_data->allocated = 1; + new_data->interpreter_id_as_index = 1; + } + __Pyx_ModuleStateLookup_wait_until_no_readers(); + if (new_data->interpreter_id_as_index) { + if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { + result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id); + goto end; + } + __Pyx_State_ConvertFromInterpIdAsIndex(new_data); + } + { + Py_ssize_t insert_at = 0; + { + __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( + new_data->table, new_data->count, interpreter_id); + assert(lower_bound); + insert_at = lower_bound - new_data->table; + if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) { + lower_bound->module = module; + goto end; // already in table, nothing more to do + } + } + if (new_data->count+1 >= new_data->allocated) { + Py_ssize_t to_allocate = (new_data->count+1)*2; + new_data = + (__Pyx_ModuleStateLookupData*)realloc( + new_data, + sizeof(__Pyx_ModuleStateLookupData) + + (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); + if (!new_data) { + result = -1; + new_data = old_data; + PyErr_NoMemory(); + goto end; + } + new_data->allocated = to_allocate; + } + ++new_data->count; + int64_t last_id = interpreter_id; + PyObject *last_module = module; + for (Py_ssize_t i=insert_at; icount; ++i) { + int64_t current_id = new_data->table[i].id; + new_data->table[i].id = last_id; + last_id = current_id; + PyObject *current_module = new_data->table[i].module; + new_data->table[i].module = last_module; + last_module = current_module; + } + } + end: +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data); +#else + __Pyx_ModuleStateLookup_data = new_data; +#endif + __Pyx_ModuleStateLookup_Unlock(); + return result; +} +static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return -1; + __Pyx_ModuleStateLookup_Lock(); +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *) + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); +#else + __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data; +#endif + if (data->interpreter_id_as_index) { + if (interpreter_id < data->count) { + data->table[interpreter_id].module = NULL; + } + goto done; + } + { + __Pyx_ModuleStateLookup_wait_until_no_readers(); + __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( + data->table, data->count, interpreter_id); + if (!lower_bound) goto done; + if (lower_bound->id != interpreter_id) goto done; + __Pyx_InterpreterIdAndModule *end = data->table+data->count; + for (;lower_boundid = (lower_bound+1)->id; + lower_bound->module = (lower_bound+1)->module; + } + } + --data->count; + if (data->count == 0) { + free(data); + data = NULL; + } + done: +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data); +#else + __Pyx_ModuleStateLookup_data = data; +#endif + __Pyx_ModuleStateLookup_Unlock(); + return 0; +} +#endif + /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER #pragma warning( pop ) diff --git a/src/farmhash.cpp b/src/farmhash.cpp index 2dd6e06..50d85b2 100644 --- a/src/farmhash.cpp +++ b/src/farmhash.cpp @@ -1,4 +1,4 @@ -/* Generated by Cython 3.0.12 */ +/* Generated by Cython 3.1.4 */ /* BEGIN: Cython Metadata { @@ -30,49 +30,21 @@ END: Cython Metadata */ #ifndef PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif /* PY_SSIZE_T_CLEAN */ -#if defined(CYTHON_LIMITED_API) && 0 - #ifndef Py_LIMITED_API - #if CYTHON_LIMITED_API+0 > 0x03030000 - #define Py_LIMITED_API CYTHON_LIMITED_API - #else - #define Py_LIMITED_API 0x03030000 - #endif - #endif +/* InitLimitedAPI */ +#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API) + #define CYTHON_LIMITED_API 1 #endif #include "Python.h" - - #if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj) - #else - #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj, NULL) - #endif - - - #if PY_MAJOR_VERSION <= 2 - #define PyDict_GetItemWithError _PyDict_GetItemWithError - #endif - - - #if (PY_VERSION_HEX < 0x030700b1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600)) && !defined(PyContextVar_Get) - #define PyContextVar_Get(var, d, v) ((d) ? ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) : ((v)[0] = NULL, 0) ) - #endif - #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) - #error Cython requires Python 2.7+ or Python 3.3+. -#else -#if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API -#define __PYX_EXTRA_ABI_MODULE_NAME "limited" +#elif PY_VERSION_HEX < 0x03080000 + #error Cython requires Python 3.8+. #else -#define __PYX_EXTRA_ABI_MODULE_NAME "" -#endif -#define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME -#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI -#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x03000CF0 +#define __PYX_ABI_VERSION "3_1_4" +#define CYTHON_HEX_VERSION 0x030104F0 #define CYTHON_FUTURE_DIVISION 1 +/* CModulePreamble */ #include #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) @@ -112,19 +84,13 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 1 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -135,8 +101,12 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -148,18 +118,22 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 + #define CYTHON_USE_EXC_INFO_STACK 1 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif @@ -170,20 +144,14 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 0 + #define CYTHON_USE_TYPE_SLOTS 1 #ifndef CYTHON_USE_TYPE_SPECS #define CYTHON_USE_TYPE_SPECS 0 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -194,8 +162,13 @@ END: Cython Metadata */ #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -207,7 +180,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3) + #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif #if PY_VERSION_HEX < 0x03090000 #undef CYTHON_PEP489_MULTI_PHASE_INIT @@ -217,14 +190,19 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00) + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 + #ifndef CYTHON_USE_TP_FINALIZE + #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00) + #endif + #undef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 + #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100) #endif #undef CYTHON_USE_FREELISTS #define CYTHON_USE_FREELISTS 0 @@ -237,7 +215,7 @@ END: Cython Metadata */ #define CYTHON_COMPILING_IN_CPYTHON 0 #define CYTHON_COMPILING_IN_LIMITED_API 1 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 #undef CYTHON_CLINE_IN_TRACEBACK #define CYTHON_CLINE_IN_TRACEBACK 0 #undef CYTHON_USE_TYPE_SLOTS @@ -246,8 +224,6 @@ END: Cython Metadata */ #define CYTHON_USE_TYPE_SPECS 1 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS @@ -260,8 +236,13 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 + #undef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE @@ -269,71 +250,7 @@ END: Cython Metadata */ #undef CYTHON_FAST_GIL #define CYTHON_FAST_GIL 0 #undef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 0 - #undef CYTHON_FAST_PYCALL - #define CYTHON_FAST_PYCALL 0 - #ifndef CYTHON_PEP487_INIT_SUBCLASS - #define CYTHON_PEP487_INIT_SUBCLASS 1 - #endif - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #undef CYTHON_USE_MODULE_STATE - #define CYTHON_USE_MODULE_STATE 1 - #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #endif - #undef CYTHON_USE_DICT_VERSIONS - #define CYTHON_USE_DICT_VERSIONS 0 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 - #endif - #undef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 -#elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 0 - #define CYTHON_COMPILING_IN_LIMITED_API 0 - #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 1 - #ifndef CYTHON_USE_TYPE_SLOTS - #define CYTHON_USE_TYPE_SLOTS 1 - #endif - #ifndef CYTHON_USE_TYPE_SPECS - #define CYTHON_USE_TYPE_SPECS 0 - #endif - #undef CYTHON_USE_PYTYPE_LOOKUP - #define CYTHON_USE_PYTYPE_LOOKUP 0 - #ifndef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif - #ifndef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 - #endif - #undef CYTHON_USE_PYLIST_INTERNALS - #define CYTHON_USE_PYLIST_INTERNALS 0 - #ifndef CYTHON_USE_UNICODE_INTERNALS - #define CYTHON_USE_UNICODE_INTERNALS 1 - #endif - #undef CYTHON_USE_UNICODE_WRITER - #define CYTHON_USE_UNICODE_WRITER 0 - #ifndef CYTHON_AVOID_BORROWED_REFS - #define CYTHON_AVOID_BORROWED_REFS 0 - #endif - #ifndef CYTHON_ASSUME_SAFE_MACROS - #define CYTHON_ASSUME_SAFE_MACROS 1 - #endif - #ifndef CYTHON_UNPACK_METHODS - #define CYTHON_UNPACK_METHODS 1 - #endif - #undef CYTHON_FAST_THREAD_STATE - #define CYTHON_FAST_THREAD_STATE 0 - #undef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL 0 - #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL 1 - #endif + #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #ifndef CYTHON_PEP487_INIT_SUBCLASS @@ -345,26 +262,37 @@ END: Cython Metadata */ #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif + #undef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING 0 #ifndef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 1 + #define CYTHON_USE_TP_FINALIZE 0 + #endif + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000) #endif #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC - #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 - #endif - #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 0 + #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif + #undef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #define CYTHON_COMPILING_IN_LIMITED_API 0 #define CYTHON_COMPILING_IN_GRAAL 0 - #define CYTHON_COMPILING_IN_NOGIL 0 - #ifndef CYTHON_USE_TYPE_SLOTS + #ifdef Py_GIL_DISABLED + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1 + #else + #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0 + #endif + #if PY_VERSION_HEX < 0x030A0000 + #undef CYTHON_USE_TYPE_SLOTS + #define CYTHON_USE_TYPE_SLOTS 1 + #elif !defined(CYTHON_USE_TYPE_SLOTS) #define CYTHON_USE_TYPE_SLOTS 1 #endif #ifndef CYTHON_USE_TYPE_SPECS @@ -373,22 +301,19 @@ END: Cython Metadata */ #ifndef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif - #if PY_MAJOR_VERSION < 3 - #undef CYTHON_USE_ASYNC_SLOTS - #define CYTHON_USE_ASYNC_SLOTS 0 - #elif !defined(CYTHON_USE_ASYNC_SLOTS) - #define CYTHON_USE_ASYNC_SLOTS 1 - #endif #ifndef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 1 #endif - #ifndef CYTHON_USE_PYLIST_INTERNALS + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_USE_PYLIST_INTERNALS + #define CYTHON_USE_PYLIST_INTERNALS 0 + #elif !defined(CYTHON_USE_PYLIST_INTERNALS) #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif - #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2 + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) @@ -397,20 +322,32 @@ END: Cython Metadata */ #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1 + #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS) + #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0 + #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif + #ifndef CYTHON_ASSUME_SAFE_SIZE + #define CYTHON_ASSUME_SAFE_SIZE 1 + #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif - #ifndef CYTHON_FAST_GIL - #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6) + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #elif !defined(CYTHON_FAST_GIL) + #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6) #endif #ifndef CYTHON_METH_FASTCALL - #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1) + #define CYTHON_METH_FASTCALL 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 @@ -418,51 +355,49 @@ END: Cython Metadata */ #ifndef CYTHON_PEP487_INIT_SUBCLASS #define CYTHON_PEP487_INIT_SUBCLASS 1 #endif - #if PY_VERSION_HEX < 0x03050000 - #undef CYTHON_PEP489_MULTI_PHASE_INIT - #define CYTHON_PEP489_MULTI_PHASE_INIT 0 - #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT) + #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif #ifndef CYTHON_USE_MODULE_STATE #define CYTHON_USE_MODULE_STATE 0 #endif - #if PY_VERSION_HEX < 0x030400a1 - #undef CYTHON_USE_TP_FINALIZE - #define CYTHON_USE_TP_FINALIZE 0 - #elif !defined(CYTHON_USE_TP_FINALIZE) + #ifndef CYTHON_USE_SYS_MONITORING + #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1) + #endif + #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif - #if PY_VERSION_HEX < 0x030600B1 + #ifndef CYTHON_USE_AM_SEND + #define CYTHON_USE_AM_SEND 1 + #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #elif !defined(CYTHON_USE_DICT_VERSIONS) - #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5) + #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE) #endif - #if PY_VERSION_HEX < 0x030700A3 - #undef CYTHON_USE_EXC_INFO_STACK - #define CYTHON_USE_EXC_INFO_STACK 0 - #elif !defined(CYTHON_USE_EXC_INFO_STACK) + #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 1 #endif #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif #ifndef CYTHON_USE_FREELISTS - #define CYTHON_USE_FREELISTS 1 + #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) #endif #endif -#if !defined(CYTHON_FAST_PYCCALL) -#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) +#ifndef CYTHON_FAST_PYCCALL +#define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL #endif -#if !defined(CYTHON_VECTORCALL) +#ifndef CYTHON_VECTORCALL +#if CYTHON_COMPILING_IN_LIMITED_API +#define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000) +#else #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1) #endif +#endif #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1) #if CYTHON_USE_PYLONG_INTERNALS - #if PY_MAJOR_VERSION < 3 - #include "longintrepr.h" - #endif #undef SHIFT #undef BASE #undef MASK @@ -470,6 +405,9 @@ END: Cython Metadata */ enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif +#ifndef CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME + #define CYTHON_LOCK_AND_GIL_DEADLOCK_AVOIDANCE_TIME 100 +#endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif @@ -522,7 +460,7 @@ END: Cython Metadata */ #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x) #endif #ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON +# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED @@ -597,6 +535,9 @@ END: Cython Metadata */ #endif #endif #endif +#ifndef Py_UNREACHABLE + #define Py_UNREACHABLE() assert(0); abort() +#endif #ifdef __cplusplus template struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);}; @@ -611,6 +552,7 @@ END: Cython Metadata */ #endif #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer)) +/* CppInitCode */ #ifndef __cplusplus #error "Cython files generated with the C++ option must be compiled with a C++ compiler." #endif @@ -641,109 +583,42 @@ class __Pyx_FakeReference { T *ptr; }; +/* PythonCompatibility */ #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_DefaultClassType PyClass_Type - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_DefaultClassType PyType_Type +#define __Pyx_BUILTIN_MODULE_NAME "builtins" +#define __Pyx_DefaultClassType PyType_Type #if CYTHON_COMPILING_IN_LIMITED_API - static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyObject *exception_table = NULL; - PyObject *types_module=NULL, *code_type=NULL, *result=NULL; - #if __PYX_LIMITED_VERSION_HEX < 0x030B0000 - PyObject *version_info; - PyObject *py_minor_version = NULL; - #endif - long minor_version = 0; - PyObject *type, *value, *traceback; - PyErr_Fetch(&type, &value, &traceback); - #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000 - minor_version = 11; - #else - if (!(version_info = PySys_GetObject("version_info"))) goto end; - if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end; - minor_version = PyLong_AsLong(py_minor_version); - Py_DECREF(py_minor_version); - if (minor_version == -1 && PyErr_Occurred()) goto end; - #endif - if (!(types_module = PyImport_ImportModule("types"))) goto end; - if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end; - if (minor_version <= 7) { - (void)p; - result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else if (minor_version <= 10) { - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, fline, lnos, fv, cell); - } else { - if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end; - result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code, - c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell); - } - end: - Py_XDECREF(code_type); - Py_XDECREF(exception_table); - Py_XDECREF(types_module); - if (type) { - PyErr_Restore(type, value, traceback); - } - return result; - } #ifndef CO_OPTIMIZED - #define CO_OPTIMIZED 0x0001 + static int CO_OPTIMIZED; #endif #ifndef CO_NEWLOCALS - #define CO_NEWLOCALS 0x0002 + static int CO_NEWLOCALS; #endif #ifndef CO_VARARGS - #define CO_VARARGS 0x0004 + static int CO_VARARGS; #endif #ifndef CO_VARKEYWORDS - #define CO_VARKEYWORDS 0x0008 + static int CO_VARKEYWORDS; #endif #ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x0200 + static int CO_ASYNC_GENERATOR; #endif #ifndef CO_GENERATOR - #define CO_GENERATOR 0x0020 + static int CO_GENERATOR; #endif #ifndef CO_COROUTINE - #define CO_COROUTINE 0x0080 + static int CO_COROUTINE; #endif -#elif PY_VERSION_HEX >= 0x030B0000 - static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f, - PyObject *code, PyObject *c, PyObject* n, PyObject *v, - PyObject *fv, PyObject *cell, PyObject* fn, - PyObject *name, int fline, PyObject *lnos) { - PyCodeObject *result; - PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); - if (!empty_bytes) return NULL; - result = - #if PY_VERSION_HEX >= 0x030C0000 - PyUnstable_Code_NewWithPosOnlyArgs - #else - PyCode_NewWithPosOnlyArgs - #endif - (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes); - Py_DECREF(empty_bytes); - return result; - } -#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else - #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) -#endif + #ifndef CO_COROUTINE + #define CO_COROUTINE 0x80 + #endif + #ifndef CO_ASYNC_GENERATOR + #define CO_ASYNC_GENERATOR 0x200 + #endif #endif +static int __Pyx_init_co_variables(void); #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE) #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type) #else @@ -775,12 +650,6 @@ class __Pyx_FakeReference { #else #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o) #endif -#ifndef CO_COROUTINE - #define CO_COROUTINE 0x80 -#endif -#ifndef CO_ASYNC_GENERATOR - #define CO_ASYNC_GENERATOR 0x200 -#endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif @@ -802,7 +671,7 @@ class __Pyx_FakeReference { #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif -#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) +#ifndef METH_FASTCALL #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif @@ -840,7 +709,7 @@ class __Pyx_FakeReference { #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n)) #endif -#if PY_MAJOR_VERSION >= 0x030900B1 +#if PY_VERSION_HEX >= 0x030900B1 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func) #else #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func) @@ -857,7 +726,7 @@ static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) { return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self; } #endif -static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { +static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) { #if CYTHON_COMPILING_IN_LIMITED_API return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc; #else @@ -865,7 +734,7 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #endif } #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc) -#if __PYX_LIMITED_VERSION_HEX < 0x030900B1 +#if __PYX_LIMITED_VERSION_HEX < 0x03090000 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b)) typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *); #else @@ -881,8 +750,10 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) +#elif CYTHON_COMPILING_IN_GRAAL + #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) + #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno)) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) @@ -893,15 +764,11 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) { #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked() -#elif PY_VERSION_HEX >= 0x03060000 - #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() -#elif PY_VERSION_HEX >= 0x03000000 - #define __Pyx_PyThreadState_Current PyThreadState_GET() #else - #define __Pyx_PyThreadState_Current _PyThreadState_Current + #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #endif -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) +#if CYTHON_USE_MODULE_STATE +static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op) { void *result; result = PyModule_GetState(op); @@ -909,85 +776,43 @@ static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op) Py_FatalError("Couldn't find the module state"); return result; } -#endif -#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype) -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) +#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o) #else - #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) -#endif -#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) -#include "pythread.h" -#define Py_tss_NEEDS_INIT 0 -typedef int Py_tss_t; -static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { - *key = PyThread_create_key(); - return 0; -} -static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { - Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); - *key = Py_tss_NEEDS_INIT; - return key; -} -static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { - PyObject_Free(key); -} -static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { - return *key != Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { - PyThread_delete_key(*key); - *key = Py_tss_NEEDS_INIT; -} -static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { - return PyThread_set_key_value(*key, value); -} -static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { - return PyThread_get_key_value(*key); -} -#endif -#if PY_MAJOR_VERSION < 3 - #if CYTHON_COMPILING_IN_PYPY - #if PYPY_VERSION_NUM < 0x07030600 - #if defined(__cplusplus) && __cplusplus >= 201402L - [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]] - #elif defined(__GNUC__) || defined(__clang__) - __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))) - #elif defined(_MSC_VER) - __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")) - #endif - static CYTHON_INLINE int PyGILState_Check(void) { - return 0; - } - #else // PYPY_VERSION_NUM < 0x07030600 - #endif // PYPY_VERSION_NUM < 0x07030600 - #else - static CYTHON_INLINE int PyGILState_Check(void) { - PyThreadState * tstate = _PyThreadState_Current; - return tstate && (tstate == PyGILState_GetThisThreadState()); - } - #endif +#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global) #endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized) +#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype) +#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype) +#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype) +#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype) +#if CYTHON_USE_TYPE_SLOTS + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype) + #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL) + #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) +#else + #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name)) + #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\ + ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\ + (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\ + __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL) + #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype) + #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype) +#endif +#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif -#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS +#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) +#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) { PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name); if (res == NULL) PyErr_Clear(); return res; } -#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000) +#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000 #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError #define __Pyx_PyDict_GetItemStr PyDict_GetItem #else @@ -1011,17 +836,11 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags) #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0) - #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext) #else #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp)) #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature) - #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next -#endif -#if CYTHON_COMPILING_IN_LIMITED_API - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v) -#else - #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v) #endif +#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc) #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\ PyTypeObject *type = Py_TYPE((PyObject*)obj);\ @@ -1033,24 +852,20 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj) #endif #if CYTHON_COMPILING_IN_LIMITED_API - #define CYTHON_PEP393_ENABLED 1 #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U) #define __Pyx_PyUnicode_KIND(u) ((void)u, (0)) #define __Pyx_PyUnicode_DATA(u) ((void*)u) #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i)) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u)) -#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 +#else #if PY_VERSION_HEX >= 0x030C0000 #define __Pyx_PyUnicode_READY(op) (0) #else #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ 0 : _PyUnicode_Ready((PyObject *)(op))) #endif - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u)) @@ -1066,20 +881,6 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #endif #endif -#else - #define CYTHON_PEP393_ENABLED 0 - #define PyUnicode_1BYTE_KIND 1 - #define PyUnicode_2BYTE_KIND 2 - #define PyUnicode_4BYTE_KIND 4 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U) - #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) @@ -1093,8 +894,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #if !defined(PyUnicode_DecodeUnicodeEscape) #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors) #endif - #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500) - #undef PyUnicode_Contains + #if !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if !defined(PyByteArray_Check) @@ -1104,33 +904,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #endif -#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)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#ifndef PyObject_Unicode - #define PyObject_Unicode PyObject_Str -#endif -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PySequence_ListKeepNew(obj)\ (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj)) @@ -1147,28 +921,83 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt) #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size) #endif +#if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS + #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) + #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) + #else + #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i) + #endif +#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS + #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i) + #else + #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i)) + #endif +#else + #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i)) +#endif +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 +#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result) +#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyObject_GetItem(dict, key); + if (*result == NULL) { + if (PyErr_ExceptionMatches(PyExc_KeyError)) { + PyErr_Clear(); + return 0; + } + return -1; + } + return 1; +} +#else +static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) { + *result = PyDict_GetItemWithError(dict, key); + if (*result == NULL) { + return PyErr_Occurred() ? -1 : 0; + } + Py_INCREF(*result); + return 1; +} +#endif +#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST + #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj) +#else + #define __Pyx_VISIT_CONST(obj) +#endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i) #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i) #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0)) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i) +#else + #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) + #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) + #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) + #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i) + #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) + #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i) +#endif +#if CYTHON_ASSUME_SAFE_SIZE #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o) #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o) #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o) #else - #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i) - #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) - #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v) - #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v) #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o) #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o) #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o) #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) + #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o) #endif -#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { @@ -1177,64 +1006,108 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, return module; } #endif -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define __Pyx_Py3Int_Check(op) PyLong_Check(op) - #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#else - #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op)) - #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op)) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t -#endif -#if CYTHON_USE_ASYNC_SLOTS - #if PY_VERSION_HEX >= 0x030500B1 - #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods - #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) - #else - #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) - #endif +#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString) + #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) +#endif +#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t +#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t +#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000 + #define __Pyx_PySendResult PySendResult +#else + typedef enum { + PYGEN_RETURN = 0, + PYGEN_ERROR = -1, + PYGEN_NEXT = 1, + } __Pyx_PySendResult; +#endif +#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3 + typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result); #else - #define __Pyx_PyType_AsAsync(obj) NULL + #define __Pyx_pyiter_sendfunc sendfunc #endif -#ifndef __Pyx_PyAsyncMethodsStruct +#if !CYTHON_USE_AM_SEND +#define __PYX_HAS_PY_AM_SEND 0 +#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000 +#define __PYX_HAS_PY_AM_SEND 1 +#else +#define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation +#endif +#if __PYX_HAS_PY_AM_SEND < 2 + #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods +#else typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; + __Pyx_pyiter_sendfunc am_send; } __Pyx_PyAsyncMethodsStruct; + #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s)) +#endif +#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0 + #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21) +#else + #define __Pyx_TPFLAGS_HAVE_AM_SEND (0) +#endif +#if PY_VERSION_HEX >= 0x03090000 +#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get() +#else +#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp +#endif +#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000 +#ifdef __cplusplus +extern "C" +#endif +PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize); +#endif +#if CYTHON_COMPILING_IN_LIMITED_API +static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) { + int value; + PyObject *py_value = PyObject_GetAttrString(inspect, name); + if (!py_value) return 0; + value = (int) PyLong_AsLong(py_value); + Py_DECREF(py_value); + *write_to = value; + return value != -1 || !PyErr_Occurred(); +} +static int __Pyx_init_co_variables(void) { + PyObject *inspect; + int result; + inspect = PyImport_ImportModule("inspect"); + result = +#if !defined(CO_OPTIMIZED) + __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) && +#endif +#if !defined(CO_NEWLOCALS) + __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) && +#endif +#if !defined(CO_VARARGS) + __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) && +#endif +#if !defined(CO_VARKEYWORDS) + __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) && +#endif +#if !defined(CO_ASYNC_GENERATOR) + __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) && +#endif +#if !defined(CO_GENERATOR) + __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) && +#endif +#if !defined(CO_COROUTINE) + __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) && +#endif + 1; + Py_DECREF(inspect); + return result ? 0 : -1; +} +#else +static int __Pyx_init_co_variables(void) { + return 0; // It's a limited API-only feature +} #endif +/* MathInitCode */ #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS) - #if !defined(_USE_MATH_DEFINES) + #ifndef _USE_MATH_DEFINES #define _USE_MATH_DEFINES #endif #endif @@ -1254,8 +1127,17 @@ static CYTHON_INLINE float __PYX_NAN() { #define __Pyx_truncl truncl #endif -#define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } +#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0 +#endif +#ifndef CYTHON_CLINE_IN_TRACEBACK +#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME +#endif +#if CYTHON_CLINE_IN_TRACEBACK +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; } +#else +#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; } +#endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } @@ -1279,22 +1161,57 @@ static CYTHON_INLINE float __PYX_NAN() { #include "farm.h" #include #include -#include -#include "pythread.h" -#ifdef _OPENMP -#include -#endif /* _OPENMP */ -#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) + #if PY_MAJOR_VERSION >= 3 + #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj) + #else + #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj, NULL) + #endif + +#include + + #if PY_MAJOR_VERSION <= 2 + #define PyDict_GetItemWithError _PyDict_GetItemWithError + #endif + + + #if PY_VERSION_HEX < 0x030d0000 + static CYTHON_INLINE int __Pyx_PyWeakref_GetRef(PyObject *ref, PyObject **pobj) + { + PyObject *obj = PyWeakref_GetObject(ref); + if (obj == NULL) { + // SystemError if ref is NULL + *pobj = NULL; + return -1; + } + if (obj == Py_None) { + *pobj = NULL; + return 0; + } + Py_INCREF(obj); + *pobj = obj; + return 1; + } + #else + #define __Pyx_PyWeakref_GetRef PyWeakref_GetRef + #endif + +#include "pythread.h" + + #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600) && !defined(PyContextVar_Get) + #define PyContextVar_Get(var, d, v) ((d) ? ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) : ((v)[0] = NULL, 0) ) + #endif + +#ifdef _OPENMP +#include +#endif /* _OPENMP */ + +#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize @@ -1337,19 +1254,23 @@ static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*); #define __Pyx_PyBytes_FromString PyBytes_FromString #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) -#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) +#if CYTHON_ASSUME_SAFE_MACROS + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) + #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s) +#else + #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s)) + #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s)) + #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s) +#endif #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s)) @@ -1358,32 +1279,44 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) +static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef) + return Py_NewRef(obj); +#else + Py_INCREF(obj); + return obj; +#endif +} +static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) { +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef) + return Py_XNewRef(obj); +#else + Py_XINCREF(obj); + return obj; +#endif +} +static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b); static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t); static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #if CYTHON_ASSUME_SAFE_MACROS -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x) #else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) +#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x) #endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 +#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x)) #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif #if CYTHON_USE_PYLONG_INTERNALS #if PY_VERSION_HEX >= 0x030C00A7 #ifndef _PyLong_SIGN_MASK @@ -1430,81 +1363,12 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*); #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit) #endif #endif -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -#include -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = (char) c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) +#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL) #else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#include -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif + #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) #endif @@ -1516,29 +1380,196 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) { #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ +/* PretendToInitialize */ +#ifdef __cplusplus +#if __cplusplus > 201103L +#include +#endif +template +static void __Pyx_pretend_to_initialize(T* ptr) { +#if __cplusplus > 201103L + if ((std::is_trivially_default_constructible::value)) +#endif + *ptr = T(); + (void)ptr; +} +#else static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } +#endif + #if !CYTHON_USE_MODULE_STATE static PyObject *__pyx_m = NULL; #endif static int __pyx_lineno; static int __pyx_clineno = 0; -static const char * __pyx_cfilenm = __FILE__; +static const char * const __pyx_cfilenm = __FILE__; static const char *__pyx_filename; /* #### Code section: filename_table ### */ -static const char *__pyx_f[] = { +static const char* const __pyx_f[] = { "src/farmhash.pyx", - "contextvars.pxd", - "type.pxd", - "bool.pxd", - "complex.pxd", + "cpython/contextvars.pxd", + "cpython/type.pxd", + "cpython/bool.pxd", + "cpython/complex.pxd", }; /* #### Code section: utility_code_proto_before_types ### */ -/* ForceInitThreads.proto */ -#ifndef __PYX_FORCE_INIT_THREADS - #define __PYX_FORCE_INIT_THREADS 0 +/* Atomics.proto */ +#include +#ifndef CYTHON_ATOMICS + #define CYTHON_ATOMICS 1 +#endif +#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS +#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __pyx_atomic_int_type int +#define __pyx_nonatomic_int_type int +#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ + (__STDC_VERSION__ >= 201112L) &&\ + !defined(__STDC_NO_ATOMICS__)) + #include +#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ + (__cplusplus >= 201103L) ||\ + (defined(_MSC_VER) && _MSC_VER >= 1700))) + #include +#endif +#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\ + (__STDC_VERSION__ >= 201112L) &&\ + !defined(__STDC_NO_ATOMICS__) &&\ + ATOMIC_INT_LOCK_FREE == 2) + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type atomic_int + #define __pyx_atomic_ptr_type atomic_uintptr_t + #define __pyx_nonatomic_ptr_type uintptr_t + #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed) + #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel) + #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel) + #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg) + #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired) + #define __pyx_atomic_load(value) atomic_load(value) + #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value) + #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed) + #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire) + #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) + #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) + #pragma message ("Using standard C atomics") + #elif defined(__PYX_DEBUG_ATOMICS) + #warning "Using standard C atomics" + #endif +#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\ + (__cplusplus >= 201103L) ||\ +\ + (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\ + ATOMIC_INT_LOCK_FREE == 2) + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type std::atomic_int + #define __pyx_atomic_ptr_type std::atomic_uintptr_t + #define __pyx_nonatomic_ptr_type uintptr_t + #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed) + #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel) + #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel) + #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg) + #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired) + #define __pyx_atomic_load(value) std::atomic_load(value) + #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value) + #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed) + #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire) + #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value) + #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER) + #pragma message ("Using standard C++ atomics") + #elif defined(__PYX_DEBUG_ATOMICS) + #warning "Using standard C++ atomics" + #endif +#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\ + (__GNUC_MINOR__ > 1 ||\ + (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2)))) + #define __pyx_atomic_ptr_type void* + #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1) + #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1) + #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1) + #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg) + static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { + __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired); + int result = old == *expected; + *expected = old; + return result; + } + #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0) + #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value) + #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0) + #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0) + #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value) + #ifdef __PYX_DEBUG_ATOMICS + #warning "Using GNU atomics" + #endif +#elif CYTHON_ATOMICS && defined(_MSC_VER) + #include + #undef __pyx_atomic_int_type + #define __pyx_atomic_int_type long + #define __pyx_atomic_ptr_type void* + #undef __pyx_nonatomic_int_type + #define __pyx_nonatomic_int_type long + #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer) + #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1) + #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1) + #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1) + #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg) + static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) { + __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected); + int result = old == *expected; + *expected = old; + return result; + } + #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0) + #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value) + #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value + #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0) + #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value) + #ifdef __PYX_DEBUG_ATOMICS + #pragma message ("Using MSVC atomics") + #endif +#else + #undef CYTHON_ATOMICS + #define CYTHON_ATOMICS 0 + #ifdef __PYX_DEBUG_ATOMICS + #warning "Not using atomics" + #endif +#endif +#if CYTHON_ATOMICS + #define __pyx_add_acquisition_count(memview)\ + __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview)) + #define __pyx_sub_acquisition_count(memview)\ + __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview)) +#else + #define __pyx_add_acquisition_count(memview)\ + __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) + #define __pyx_sub_acquisition_count(memview)\ + __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock) +#endif + +/* CriticalSections.proto */ +#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +#define __Pyx_PyCriticalSection void* +#define __Pyx_PyCriticalSection2 void* +#define __Pyx_PyCriticalSection_Begin1(cs, arg) (void)cs +#define __Pyx_PyCriticalSection_Begin2(cs, arg1, arg2) (void)cs +#define __Pyx_PyCriticalSection_End1(cs) +#define __Pyx_PyCriticalSection_End2(cs) +#else +#define __Pyx_PyCriticalSection PyCriticalSection +#define __Pyx_PyCriticalSection2 PyCriticalSection2 +#define __Pyx_PyCriticalSection_Begin1 PyCriticalSection_Begin +#define __Pyx_PyCriticalSection_Begin2 PyCriticalSection2_Begin +#define __Pyx_PyCriticalSection_End1 PyCriticalSection_End +#define __Pyx_PyCriticalSection_End2 PyCriticalSection2_End +#endif +#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API +#define __Pyx_BEGIN_CRITICAL_SECTION(o) { +#define __Pyx_END_CRITICAL_SECTION() } +#else +#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION +#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION #endif /* #### Code section: numeric_typedefs ### */ @@ -1549,25 +1580,25 @@ static const char *__pyx_f[] = { struct __pyx_opt_args_7cpython_11contextvars_get_value; struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default; -/* "cpython/contextvars.pxd":112 - * +/* "cpython/contextvars.pxd":116 * + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the default value of the context variable, - */ +*/ struct __pyx_opt_args_7cpython_11contextvars_get_value { int __pyx_n; PyObject *default_value; }; -/* "cpython/contextvars.pxd":129 - * +/* "cpython/contextvars.pxd":134 * + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< * """Return a new reference to the value of the context variable, * or the provided default value if no such value was found. - */ +*/ struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default { int __pyx_n; PyObject *default_value; @@ -1591,7 +1622,6 @@ struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default { static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD #define __Pyx_RefNannySetupContext(name, acquire_gil)\ if (acquire_gil) {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ @@ -1605,11 +1635,6 @@ struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default { __Pyx_RefNannyFinishContext();\ PyGILState_Release(__pyx_gilstate_save);\ } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__)) - #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext() -#endif #define __Pyx_RefNannyFinishContextNogil() {\ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ __Pyx_RefNannyFinishContext();\ @@ -1726,7 +1751,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObj #include /* JoinPyUnicode.proto */ -static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, +static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char); /* PyFunctionFastCall.proto */ @@ -1734,7 +1759,7 @@ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_co #if !CYTHON_VECTORCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs); #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) @@ -1744,12 +1769,6 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, #if !CYTHON_VECTORCALL #if PY_VERSION_HEX >= 0x03080000 #include "frameobject.h" -#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION) - #ifndef Py_BUILD_CORE - #define Py_BUILD_CORE 1 - #endif - #include "internal/pycore_frame.h" -#endif #define __Pxy_PyFrame_Initialize_Offsets() #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus) #else @@ -1778,14 +1797,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject /* PyObjectFastCall.proto */ #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL) -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs); - -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs); /* TupleAndListFromArray.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n); +#endif +#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n); #endif @@ -1797,50 +1815,37 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int /* fastcall.proto */ #if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i) #elif CYTHON_ASSUME_SAFE_MACROS - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i) -#else - #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i) -#endif -#if CYTHON_AVOID_BORROWED_REFS - #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg) - #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i)) #else - #define __Pyx_Arg_NewRef_VARARGS(arg) arg - #define __Pyx_Arg_XDECREF_VARARGS(arg) + #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i)) #endif #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds) #define __Pyx_KwValues_VARARGS(args, nargs) NULL #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s) #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw) #if CYTHON_METH_FASTCALL - #define __Pyx_Arg_FASTCALL(args, i) args[i] - #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds) + #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i]) + #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds) #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs)) static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s); -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues); #else #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw) #endif - #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs - to have the same reference counting */ - #define __Pyx_Arg_XDECREF_FASTCALL(arg) #else - #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS + #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS - #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg) - #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg) #endif -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS -#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start) -#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start) -#else #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop) +#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) +#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start) +#else #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop) #endif @@ -1848,10 +1853,65 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, - const char* function_name); +static CYTHON_INLINE int __Pyx_ParseKeywords( + PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[], + PyObject *kwds2, PyObject *values[], + Py_ssize_t num_pos_args, Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs +); + +/* CallCFunction.proto */ +#define __Pyx_CallCFunction(cfunc, self, args)\ + ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args) +#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\ + ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs) +#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\ + ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs) +#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\ + ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames) + +/* UnpackUnboundCMethod.proto */ +typedef struct { + PyObject *type; + PyObject **method_name; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS + __pyx_atomic_int_type initialized; +#endif + PyCFunction func; + PyObject *method; + int flag; +} __Pyx_CachedCFunction; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING +static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) { +#if !CYTHON_ATOMICS + return 1; +#else + __pyx_nonatomic_int_type expected = 0; + if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) { + return 0; + } + return expected; +#endif +} +static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) { +#if CYTHON_ATOMICS + __pyx_atomic_store(&cfunc->initialized, 2); +#endif +} +#else +#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2 +#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc) +#endif + +/* CallUnboundCMethod2.proto */ +CYTHON_UNUSED +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); +#else +#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) +#endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, @@ -1870,24 +1930,27 @@ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj); static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* TypeImport.proto */ -#ifndef __PYX_HAVE_RT_ImportType_proto_3_0_12 -#define __PYX_HAVE_RT_ImportType_proto_3_0_12 +#ifndef __PYX_HAVE_RT_ImportType_proto_3_1_4 +#define __PYX_HAVE_RT_ImportType_proto_3_1_4 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #include #endif #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) alignof(s) +#define __PYX_GET_STRUCT_ALIGNMENT_3_1_4(s) alignof(s) #else -#define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) sizeof(void*) +#define __PYX_GET_STRUCT_ALIGNMENT_3_1_4(s) sizeof(void*) #endif -enum __Pyx_ImportType_CheckSize_3_0_12 { - __Pyx_ImportType_CheckSize_Error_3_0_12 = 0, - __Pyx_ImportType_CheckSize_Warn_3_0_12 = 1, - __Pyx_ImportType_CheckSize_Ignore_3_0_12 = 2 +enum __Pyx_ImportType_CheckSize_3_1_4 { + __Pyx_ImportType_CheckSize_Error_3_1_4 = 0, + __Pyx_ImportType_CheckSize_Warn_3_1_4 = 1, + __Pyx_ImportType_CheckSize_Ignore_3_1_4 = 2 }; -static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size); +static PyTypeObject *__Pyx_ImportType_3_1_4(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_4 check_size); #endif +/* ListPack.proto */ +static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...); + /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) @@ -1915,28 +1978,33 @@ static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UIN #endif /* CLineInTraceback.proto */ -#ifdef CYTHON_CLINE_IN_TRACEBACK -#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) -#else +#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); +#else +#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #endif /* CodeObjectCache.proto */ -#if !CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API +typedef PyObject __Pyx_CachedCodeObjectType; +#else +typedef PyCodeObject __Pyx_CachedCodeObjectType; +#endif typedef struct { - PyCodeObject* code_object; + __Pyx_CachedCodeObjectType* code_object; int code_line; } __Pyx_CodeObjectCacheEntry; struct __Pyx_CodeObjectCache { int count; int max_count; __Pyx_CodeObjectCacheEntry* entries; + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_int_type accessor_count; + #endif }; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); -#endif +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line); +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -1947,42 +2015,61 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, #define __Pyx_HAS_GCC_DIAGNOSTIC #endif -/* None.proto */ -#include - /* CIntFromPy.proto */ -static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *); +static CYTHON_INLINE uint32_t __Pyx_PyLong_As_uint32_t(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *); +static CYTHON_INLINE uint64_t __Pyx_PyLong_As_uint64_t(PyObject *); + +/* PyObjectVectorCallKwBuilder.proto */ +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#if CYTHON_VECTORCALL +#if PY_VERSION_HEX >= 0x03090000 +#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall +#endif +#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n) +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n); +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n); +#else +#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict +#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n) +#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value) +#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value) +#endif /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value); +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint32_t(uint32_t value); /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value); +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint64_t(uint64_t value); /* FormatTypeName.proto */ #if CYTHON_COMPILING_IN_LIMITED_API typedef PyObject *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%U" -static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp); #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj) +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 +#define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName #else +static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp); +#endif +#else // !LIMITED_API typedef const char *__Pyx_TypeName; #define __Pyx_FMT_TYPENAME "%.200s" -#define __Pyx_PyType_GetName(tp) ((tp)->tp_name) +#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name) #define __Pyx_DECREF_TypeName(obj) #endif /* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value); /* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *); /* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON @@ -1996,21 +2083,77 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2)) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) -#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) +static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) { + return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2); +} #endif #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2) #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) +#ifdef PyExceptionInstance_Check + #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj) +#else + #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException) +#endif -/* CheckBinaryVersion.proto */ +/* GetRuntimeVersion.proto */ static unsigned long __Pyx_get_runtime_version(void); + +/* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer); -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); +/* MultiPhaseInitModuleState.proto */ +#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE +static PyObject *__Pyx_State_FindModule(void*); +static int __Pyx_State_AddModule(PyObject* module, void*); +static int __Pyx_State_RemoveModule(void*); +#elif CYTHON_USE_MODULE_STATE +#define __Pyx_State_FindModule PyState_FindModule +#define __Pyx_State_AddModule PyState_AddModule +#define __Pyx_State_RemoveModule PyState_RemoveModule +#endif /* #### Code section: module_declarations ### */ +/* CythonABIVersion.proto */ +#if CYTHON_COMPILING_IN_LIMITED_API + #if CYTHON_METH_FASTCALL + #define __PYX_FASTCALL_ABI_SUFFIX "_fastcall" + #else + #define __PYX_FASTCALL_ABI_SUFFIX + #endif + #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX +#else + #define __PYX_LIMITED_ABI_SUFFIX +#endif +#if __PYX_HAS_PY_AM_SEND == 1 + #define __PYX_AM_SEND_ABI_SUFFIX +#elif __PYX_HAS_PY_AM_SEND == 2 + #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport" +#else + #define __PYX_AM_SEND_ABI_SUFFIX "noamsend" +#endif +#ifndef __PYX_MONITORING_ABI_SUFFIX + #define __PYX_MONITORING_ABI_SUFFIX +#endif +#if CYTHON_USE_TP_FINALIZE + #define __PYX_TP_FINALIZE_ABI_SUFFIX +#else + #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize" +#endif +#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED) + #define __PYX_FREELISTS_ABI_SUFFIX +#else + #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists" +#endif +#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX +#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI +#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." + +#if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/ +#endif +#if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/ +#endif /* Module declarations from "cpython.version" */ @@ -2044,8 +2187,6 @@ static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComp /* Module declarations from "cpython.number" */ -/* Module declarations from "cpython.int" */ - /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.bool" */ @@ -2054,12 +2195,12 @@ static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComp /* Module declarations from "cpython.float" */ +/* Module declarations from "cython" */ + /* Module declarations from "__builtin__" */ /* Module declarations from "cpython.complex" */ -/* Module declarations from "cpython.string" */ - /* Module declarations from "libc.stddef" */ /* Module declarations from "cpython.unicode" */ @@ -2082,10 +2223,6 @@ static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComp /* Module declarations from "cpython.pystate" */ -/* Module declarations from "cpython.cobject" */ - -/* Module declarations from "cpython.oldbuffer" */ - /* Module declarations from "cpython.set" */ /* Module declarations from "cpython.buffer" */ @@ -2110,10 +2247,10 @@ int __pyx_module_is_main_farmhash = 0; /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_TypeError; /* #### Code section: string_decls ### */ -static const char __pyx_k__17[] = "?"; +static const char __pyx_k_[] = "?"; static const char __pyx_k_all[] = "__all__"; -static const char __pyx_k_buf[] = "buf"; static const char __pyx_k_got[] = ", got '"; +static const char __pyx_k_pop[] = "pop"; static const char __pyx_k_data[] = "data"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; @@ -2121,19 +2258,17 @@ static const char __pyx_k_seed[] = "seed"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_0_4_7[] = "0.4.7"; static const char __pyx_k_email[] = "__email__"; -static const char __pyx_k_first[] = "first"; static const char __pyx_k_seed0[] = "seed0"; static const char __pyx_k_seed1[] = "seed1"; -static const char __pyx_k_tseed[] = "tseed"; static const char __pyx_k_author[] = "__author__"; static const char __pyx_k_buffer[] = "buffer"; -static const char __pyx_k_result[] = "result"; -static const char __pyx_k_second[] = "second"; +static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_instead[] = "' instead"; static const char __pyx_k_version[] = "__version__"; static const char __pyx_k_Argument[] = "Argument '"; -static const char __pyx_k_encoding[] = "encoding"; +static const char __pyx_k_add_note[] = "add_note"; static const char __pyx_k_farmhash[] = "farmhash"; +static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_FarmHash32[] = "FarmHash32"; static const char __pyx_k_FarmHash64[] = "FarmHash64"; @@ -2141,10 +2276,8 @@ static const char __pyx_k_basestring[] = "basestring"; static const char __pyx_k_FarmHash128[] = "FarmHash128"; static const char __pyx_k_Fingerprint32[] = "Fingerprint32"; static const char __pyx_k_Fingerprint64[] = "Fingerprint64"; -static const char __pyx_k_encoding_size[] = "encoding_size"; static const char __pyx_k_Eugene_Scherba[] = "Eugene Scherba"; static const char __pyx_k_Fingerprint128[] = "Fingerprint128"; -static const char __pyx_k_src_farmhash_pyx[] = "src/farmhash.pyx"; static const char __pyx_k_FarmHash32WithSeed[] = "FarmHash32WithSeed"; static const char __pyx_k_FarmHash64WithSeed[] = "FarmHash64WithSeed"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; @@ -2153,6 +2286,7 @@ static const char __pyx_k_FarmHash64WithSeeds[] = "FarmHash64WithSeeds"; static const char __pyx_k_Python_wrapper_for_FarmHash[] = "\nPython wrapper for FarmHash\n"; static const char __pyx_k_escherba_cityhash_gmail_com[] = "escherba+cityhash@gmail.com"; static const char __pyx_k_has_incorrect_type_expected[] = "' has incorrect type: expected "; +static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False."; /* #### Code section: decls ### */ static PyObject *__pyx_pf_8farmhash_FarmHash32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */ static PyObject *__pyx_pf_8farmhash_2Fingerprint32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */ @@ -2166,6 +2300,17 @@ static PyObject *__pyx_pf_8farmhash_16Fingerprint128(CYTHON_UNUSED PyObject *__p static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_seed); /* proto */ /* #### Code section: late_includes ### */ /* #### Code section: module_state ### */ +/* SmallCodeConfig */ +#ifndef CYTHON_SMALL_CODE +#if defined(__clang__) + #define CYTHON_SMALL_CODE +#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) + #define CYTHON_SMALL_CODE __attribute__((cold)) +#else + #define CYTHON_SMALL_CODE +#endif +#endif + typedef struct { PyObject *__pyx_d; PyObject *__pyx_b; @@ -2191,651 +2336,231 @@ typedef struct { #ifdef __Pyx_Coroutine_USED PyTypeObject *__pyx_CoroutineType; #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif PyTypeObject *__pyx_ptype_7cpython_4type_type; - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE + PyTypeObject *__pyx_ptype_7cpython_4bool_bool; + PyTypeObject *__pyx_ptype_7cpython_7complex_complex; + __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; + PyObject *__pyx_string_tab[39]; + PyObject *__pyx_int_0L; + PyObject *__pyx_int_64L; + PyObject *__pyx_int_0xffffffffffffffffL; +/* #### Code section: module_state_contents ### */ +/* CodeObjectCache.module_state_decls */ +struct __Pyx_CodeObjectCache __pyx_code_cache; + +/* #### Code section: module_state_end ### */ +} __pyx_mstatetype; + +#if CYTHON_USE_MODULE_STATE +#ifdef __cplusplus +namespace { +extern struct PyModuleDef __pyx_moduledef; +} /* anonymous namespace */ +#else +static struct PyModuleDef __pyx_moduledef; +#endif + +#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef))) + +#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef)) +#else +static __pyx_mstatetype __pyx_mstate_global_static = +#ifdef __cplusplus + {}; +#else + {0}; +#endif +static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static; +#endif +/* #### Code section: constant_name_defines ### */ +#define __pyx_kp_u_ __pyx_string_tab[0] +#define __pyx_kp_u_0_4_7 __pyx_string_tab[1] +#define __pyx_kp_u_Argument __pyx_string_tab[2] +#define __pyx_kp_u_Eugene_Scherba __pyx_string_tab[3] +#define __pyx_n_u_FarmHash128 __pyx_string_tab[4] +#define __pyx_n_u_FarmHash128WithSeed __pyx_string_tab[5] +#define __pyx_n_u_FarmHash32 __pyx_string_tab[6] +#define __pyx_n_u_FarmHash32WithSeed __pyx_string_tab[7] +#define __pyx_n_u_FarmHash64 __pyx_string_tab[8] +#define __pyx_n_u_FarmHash64WithSeed __pyx_string_tab[9] +#define __pyx_n_u_FarmHash64WithSeeds __pyx_string_tab[10] +#define __pyx_n_u_Fingerprint128 __pyx_string_tab[11] +#define __pyx_n_u_Fingerprint32 __pyx_string_tab[12] +#define __pyx_n_u_Fingerprint64 __pyx_string_tab[13] +#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[14] +#define __pyx_n_u_TypeError __pyx_string_tab[15] +#define __pyx_kp_u_add_note __pyx_string_tab[16] +#define __pyx_n_u_all __pyx_string_tab[17] +#define __pyx_n_u_author __pyx_string_tab[18] +#define __pyx_n_u_basestring __pyx_string_tab[19] +#define __pyx_n_u_buffer __pyx_string_tab[20] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[21] +#define __pyx_n_u_data __pyx_string_tab[22] +#define __pyx_n_u_email __pyx_string_tab[23] +#define __pyx_kp_u_escherba_cityhash_gmail_com __pyx_string_tab[24] +#define __pyx_n_u_farmhash __pyx_string_tab[25] +#define __pyx_kp_u_got __pyx_string_tab[26] +#define __pyx_kp_u_has_incorrect_type_expected __pyx_string_tab[27] +#define __pyx_kp_u_instead __pyx_string_tab[28] +#define __pyx_n_u_main __pyx_string_tab[29] +#define __pyx_n_u_module __pyx_string_tab[30] +#define __pyx_n_u_name __pyx_string_tab[31] +#define __pyx_n_u_pop __pyx_string_tab[32] +#define __pyx_n_u_qualname __pyx_string_tab[33] +#define __pyx_n_u_seed __pyx_string_tab[34] +#define __pyx_n_u_seed0 __pyx_string_tab[35] +#define __pyx_n_u_seed1 __pyx_string_tab[36] +#define __pyx_n_u_test __pyx_string_tab[37] +#define __pyx_n_u_version __pyx_string_tab[38] +/* #### Code section: module_state_clear ### */ +#if CYTHON_USE_MODULE_STATE +static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { + __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m); + if (!clear_module_state) return 0; + Py_CLEAR(clear_module_state->__pyx_d); + Py_CLEAR(clear_module_state->__pyx_b); + Py_CLEAR(clear_module_state->__pyx_cython_runtime); + Py_CLEAR(clear_module_state->__pyx_empty_tuple); + Py_CLEAR(clear_module_state->__pyx_empty_bytes); + Py_CLEAR(clear_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_CLEAR(clear_module_state->__pyx_CyFunctionType); #endif - #if CYTHON_USE_MODULE_STATE + #ifdef __Pyx_FusedFunction_USED + Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif - #if CYTHON_USE_MODULE_STATE + #if CYTHON_PEP489_MULTI_PHASE_INIT + __Pyx_State_RemoveModule(NULL); #endif - #if CYTHON_USE_MODULE_STATE + Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); + Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool); + Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex); + for (int i=0; i<39; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + Py_CLEAR(clear_module_state->__pyx_int_0L); + Py_CLEAR(clear_module_state->__pyx_int_64L); + Py_CLEAR(clear_module_state->__pyx_int_0xffffffffffffffffL); + return 0; +} +#endif +/* #### Code section: module_state_traverse ### */ +#if CYTHON_USE_MODULE_STATE +static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { + __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m); + if (!traverse_module_state) return 0; + Py_VISIT(traverse_module_state->__pyx_d); + Py_VISIT(traverse_module_state->__pyx_b); + Py_VISIT(traverse_module_state->__pyx_cython_runtime); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode); + #ifdef __Pyx_CyFunction_USED + Py_VISIT(traverse_module_state->__pyx_CyFunctionType); #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - PyTypeObject *__pyx_ptype_7cpython_4bool_bool; - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - PyTypeObject *__pyx_ptype_7cpython_7complex_complex; - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - #if CYTHON_USE_MODULE_STATE - #endif - PyObject *__pyx_kp_u_0_4_7; - PyObject *__pyx_kp_u_Argument; - PyObject *__pyx_kp_u_Eugene_Scherba; - PyObject *__pyx_n_s_FarmHash128; - PyObject *__pyx_n_u_FarmHash128; - PyObject *__pyx_n_s_FarmHash128WithSeed; - PyObject *__pyx_n_u_FarmHash128WithSeed; - PyObject *__pyx_n_s_FarmHash32; - PyObject *__pyx_n_u_FarmHash32; - PyObject *__pyx_n_s_FarmHash32WithSeed; - PyObject *__pyx_n_u_FarmHash32WithSeed; - PyObject *__pyx_n_s_FarmHash64; - PyObject *__pyx_n_u_FarmHash64; - PyObject *__pyx_n_s_FarmHash64WithSeed; - PyObject *__pyx_n_u_FarmHash64WithSeed; - PyObject *__pyx_n_s_FarmHash64WithSeeds; - PyObject *__pyx_n_u_FarmHash64WithSeeds; - PyObject *__pyx_n_s_Fingerprint128; - PyObject *__pyx_n_u_Fingerprint128; - PyObject *__pyx_n_s_Fingerprint32; - PyObject *__pyx_n_u_Fingerprint32; - PyObject *__pyx_n_s_Fingerprint64; - PyObject *__pyx_n_u_Fingerprint64; - PyObject *__pyx_n_s_TypeError; - PyObject *__pyx_n_s__17; - PyObject *__pyx_n_s_all; - PyObject *__pyx_n_s_author; - PyObject *__pyx_n_u_basestring; - PyObject *__pyx_n_s_buf; - PyObject *__pyx_n_u_buffer; - PyObject *__pyx_n_s_cline_in_traceback; - PyObject *__pyx_n_s_data; - PyObject *__pyx_n_u_data; - PyObject *__pyx_n_s_email; - PyObject *__pyx_n_s_encoding; - PyObject *__pyx_n_s_encoding_size; - PyObject *__pyx_kp_u_escherba_cityhash_gmail_com; - PyObject *__pyx_n_s_farmhash; - PyObject *__pyx_n_s_first; - PyObject *__pyx_kp_u_got; - PyObject *__pyx_kp_u_has_incorrect_type_expected; - PyObject *__pyx_kp_u_instead; - PyObject *__pyx_n_s_main; - PyObject *__pyx_n_s_name; - PyObject *__pyx_n_s_result; - PyObject *__pyx_n_s_second; - PyObject *__pyx_n_s_seed; - PyObject *__pyx_n_s_seed0; - PyObject *__pyx_n_s_seed1; - PyObject *__pyx_kp_s_src_farmhash_pyx; - PyObject *__pyx_n_s_test; - PyObject *__pyx_n_s_tseed; - PyObject *__pyx_n_s_version; - PyObject *__pyx_int_0L; - PyObject *__pyx_int_64L; - PyObject *__pyx_int_0xffffffffffffffffL; - PyObject *__pyx_k_; - PyObject *__pyx_tuple__2; - PyObject *__pyx_tuple__5; - PyObject *__pyx_tuple__10; - PyObject *__pyx_tuple__12; - PyObject *__pyx_tuple__15; - PyObject *__pyx_codeobj__3; - PyObject *__pyx_codeobj__4; - PyObject *__pyx_codeobj__6; - PyObject *__pyx_codeobj__7; - PyObject *__pyx_codeobj__8; - PyObject *__pyx_codeobj__9; - PyObject *__pyx_codeobj__11; - PyObject *__pyx_codeobj__13; - PyObject *__pyx_codeobj__14; - PyObject *__pyx_codeobj__16; -} __pyx_mstate; - -#if CYTHON_USE_MODULE_STATE -#ifdef __cplusplus -namespace { - extern struct PyModuleDef __pyx_moduledef; -} /* anonymous namespace */ -#else -static struct PyModuleDef __pyx_moduledef; -#endif - -#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o)) - -#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef))) - -#define __pyx_m (PyState_FindModule(&__pyx_moduledef)) -#else -static __pyx_mstate __pyx_mstate_global_static = -#ifdef __cplusplus - {}; -#else - {0}; -#endif -static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static; -#endif -/* #### Code section: module_state_clear ### */ -#if CYTHON_USE_MODULE_STATE -static int __pyx_m_clear(PyObject *m) { - __pyx_mstate *clear_module_state = __pyx_mstate(m); - if (!clear_module_state) return 0; - Py_CLEAR(clear_module_state->__pyx_d); - Py_CLEAR(clear_module_state->__pyx_b); - Py_CLEAR(clear_module_state->__pyx_cython_runtime); - Py_CLEAR(clear_module_state->__pyx_empty_tuple); - Py_CLEAR(clear_module_state->__pyx_empty_bytes); - Py_CLEAR(clear_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_CLEAR(clear_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); - #endif - Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type); - Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool); - Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex); - Py_CLEAR(clear_module_state->__pyx_kp_u_0_4_7); - Py_CLEAR(clear_module_state->__pyx_kp_u_Argument); - Py_CLEAR(clear_module_state->__pyx_kp_u_Eugene_Scherba); - Py_CLEAR(clear_module_state->__pyx_n_s_FarmHash128); - Py_CLEAR(clear_module_state->__pyx_n_u_FarmHash128); - Py_CLEAR(clear_module_state->__pyx_n_s_FarmHash128WithSeed); - Py_CLEAR(clear_module_state->__pyx_n_u_FarmHash128WithSeed); - Py_CLEAR(clear_module_state->__pyx_n_s_FarmHash32); - Py_CLEAR(clear_module_state->__pyx_n_u_FarmHash32); - Py_CLEAR(clear_module_state->__pyx_n_s_FarmHash32WithSeed); - Py_CLEAR(clear_module_state->__pyx_n_u_FarmHash32WithSeed); - Py_CLEAR(clear_module_state->__pyx_n_s_FarmHash64); - Py_CLEAR(clear_module_state->__pyx_n_u_FarmHash64); - Py_CLEAR(clear_module_state->__pyx_n_s_FarmHash64WithSeed); - Py_CLEAR(clear_module_state->__pyx_n_u_FarmHash64WithSeed); - Py_CLEAR(clear_module_state->__pyx_n_s_FarmHash64WithSeeds); - Py_CLEAR(clear_module_state->__pyx_n_u_FarmHash64WithSeeds); - Py_CLEAR(clear_module_state->__pyx_n_s_Fingerprint128); - Py_CLEAR(clear_module_state->__pyx_n_u_Fingerprint128); - Py_CLEAR(clear_module_state->__pyx_n_s_Fingerprint32); - Py_CLEAR(clear_module_state->__pyx_n_u_Fingerprint32); - Py_CLEAR(clear_module_state->__pyx_n_s_Fingerprint64); - Py_CLEAR(clear_module_state->__pyx_n_u_Fingerprint64); - Py_CLEAR(clear_module_state->__pyx_n_s_TypeError); - Py_CLEAR(clear_module_state->__pyx_n_s__17); - Py_CLEAR(clear_module_state->__pyx_n_s_all); - Py_CLEAR(clear_module_state->__pyx_n_s_author); - Py_CLEAR(clear_module_state->__pyx_n_u_basestring); - Py_CLEAR(clear_module_state->__pyx_n_s_buf); - Py_CLEAR(clear_module_state->__pyx_n_u_buffer); - Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback); - Py_CLEAR(clear_module_state->__pyx_n_s_data); - Py_CLEAR(clear_module_state->__pyx_n_u_data); - Py_CLEAR(clear_module_state->__pyx_n_s_email); - Py_CLEAR(clear_module_state->__pyx_n_s_encoding); - Py_CLEAR(clear_module_state->__pyx_n_s_encoding_size); - Py_CLEAR(clear_module_state->__pyx_kp_u_escherba_cityhash_gmail_com); - Py_CLEAR(clear_module_state->__pyx_n_s_farmhash); - Py_CLEAR(clear_module_state->__pyx_n_s_first); - Py_CLEAR(clear_module_state->__pyx_kp_u_got); - Py_CLEAR(clear_module_state->__pyx_kp_u_has_incorrect_type_expected); - Py_CLEAR(clear_module_state->__pyx_kp_u_instead); - Py_CLEAR(clear_module_state->__pyx_n_s_main); - Py_CLEAR(clear_module_state->__pyx_n_s_name); - Py_CLEAR(clear_module_state->__pyx_n_s_result); - Py_CLEAR(clear_module_state->__pyx_n_s_second); - Py_CLEAR(clear_module_state->__pyx_n_s_seed); - Py_CLEAR(clear_module_state->__pyx_n_s_seed0); - Py_CLEAR(clear_module_state->__pyx_n_s_seed1); - Py_CLEAR(clear_module_state->__pyx_kp_s_src_farmhash_pyx); - Py_CLEAR(clear_module_state->__pyx_n_s_test); - Py_CLEAR(clear_module_state->__pyx_n_s_tseed); - Py_CLEAR(clear_module_state->__pyx_n_s_version); - Py_CLEAR(clear_module_state->__pyx_int_0L); - Py_CLEAR(clear_module_state->__pyx_int_64L); - Py_CLEAR(clear_module_state->__pyx_int_0xffffffffffffffffL); - Py_CLEAR(clear_module_state->__pyx_k_); - Py_CLEAR(clear_module_state->__pyx_tuple__2); - Py_CLEAR(clear_module_state->__pyx_tuple__5); - Py_CLEAR(clear_module_state->__pyx_tuple__10); - Py_CLEAR(clear_module_state->__pyx_tuple__12); - Py_CLEAR(clear_module_state->__pyx_tuple__15); - Py_CLEAR(clear_module_state->__pyx_codeobj__3); - Py_CLEAR(clear_module_state->__pyx_codeobj__4); - Py_CLEAR(clear_module_state->__pyx_codeobj__6); - Py_CLEAR(clear_module_state->__pyx_codeobj__7); - Py_CLEAR(clear_module_state->__pyx_codeobj__8); - Py_CLEAR(clear_module_state->__pyx_codeobj__9); - Py_CLEAR(clear_module_state->__pyx_codeobj__11); - Py_CLEAR(clear_module_state->__pyx_codeobj__13); - Py_CLEAR(clear_module_state->__pyx_codeobj__14); - Py_CLEAR(clear_module_state->__pyx_codeobj__16); - return 0; -} -#endif -/* #### Code section: module_state_traverse ### */ -#if CYTHON_USE_MODULE_STATE -static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { - __pyx_mstate *traverse_module_state = __pyx_mstate(m); - if (!traverse_module_state) return 0; - Py_VISIT(traverse_module_state->__pyx_d); - Py_VISIT(traverse_module_state->__pyx_b); - Py_VISIT(traverse_module_state->__pyx_cython_runtime); - Py_VISIT(traverse_module_state->__pyx_empty_tuple); - Py_VISIT(traverse_module_state->__pyx_empty_bytes); - Py_VISIT(traverse_module_state->__pyx_empty_unicode); - #ifdef __Pyx_CyFunction_USED - Py_VISIT(traverse_module_state->__pyx_CyFunctionType); - #endif - #ifdef __Pyx_FusedFunction_USED - Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); + #ifdef __Pyx_FusedFunction_USED + Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type); Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool); Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex); - Py_VISIT(traverse_module_state->__pyx_kp_u_0_4_7); - Py_VISIT(traverse_module_state->__pyx_kp_u_Argument); - Py_VISIT(traverse_module_state->__pyx_kp_u_Eugene_Scherba); - Py_VISIT(traverse_module_state->__pyx_n_s_FarmHash128); - Py_VISIT(traverse_module_state->__pyx_n_u_FarmHash128); - Py_VISIT(traverse_module_state->__pyx_n_s_FarmHash128WithSeed); - Py_VISIT(traverse_module_state->__pyx_n_u_FarmHash128WithSeed); - Py_VISIT(traverse_module_state->__pyx_n_s_FarmHash32); - Py_VISIT(traverse_module_state->__pyx_n_u_FarmHash32); - Py_VISIT(traverse_module_state->__pyx_n_s_FarmHash32WithSeed); - Py_VISIT(traverse_module_state->__pyx_n_u_FarmHash32WithSeed); - Py_VISIT(traverse_module_state->__pyx_n_s_FarmHash64); - Py_VISIT(traverse_module_state->__pyx_n_u_FarmHash64); - Py_VISIT(traverse_module_state->__pyx_n_s_FarmHash64WithSeed); - Py_VISIT(traverse_module_state->__pyx_n_u_FarmHash64WithSeed); - Py_VISIT(traverse_module_state->__pyx_n_s_FarmHash64WithSeeds); - Py_VISIT(traverse_module_state->__pyx_n_u_FarmHash64WithSeeds); - Py_VISIT(traverse_module_state->__pyx_n_s_Fingerprint128); - Py_VISIT(traverse_module_state->__pyx_n_u_Fingerprint128); - Py_VISIT(traverse_module_state->__pyx_n_s_Fingerprint32); - Py_VISIT(traverse_module_state->__pyx_n_u_Fingerprint32); - Py_VISIT(traverse_module_state->__pyx_n_s_Fingerprint64); - Py_VISIT(traverse_module_state->__pyx_n_u_Fingerprint64); - Py_VISIT(traverse_module_state->__pyx_n_s_TypeError); - Py_VISIT(traverse_module_state->__pyx_n_s__17); - Py_VISIT(traverse_module_state->__pyx_n_s_all); - Py_VISIT(traverse_module_state->__pyx_n_s_author); - Py_VISIT(traverse_module_state->__pyx_n_u_basestring); - Py_VISIT(traverse_module_state->__pyx_n_s_buf); - Py_VISIT(traverse_module_state->__pyx_n_u_buffer); - Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback); - Py_VISIT(traverse_module_state->__pyx_n_s_data); - Py_VISIT(traverse_module_state->__pyx_n_u_data); - Py_VISIT(traverse_module_state->__pyx_n_s_email); - Py_VISIT(traverse_module_state->__pyx_n_s_encoding); - Py_VISIT(traverse_module_state->__pyx_n_s_encoding_size); - Py_VISIT(traverse_module_state->__pyx_kp_u_escherba_cityhash_gmail_com); - Py_VISIT(traverse_module_state->__pyx_n_s_farmhash); - Py_VISIT(traverse_module_state->__pyx_n_s_first); - Py_VISIT(traverse_module_state->__pyx_kp_u_got); - Py_VISIT(traverse_module_state->__pyx_kp_u_has_incorrect_type_expected); - Py_VISIT(traverse_module_state->__pyx_kp_u_instead); - Py_VISIT(traverse_module_state->__pyx_n_s_main); - Py_VISIT(traverse_module_state->__pyx_n_s_name); - Py_VISIT(traverse_module_state->__pyx_n_s_result); - Py_VISIT(traverse_module_state->__pyx_n_s_second); - Py_VISIT(traverse_module_state->__pyx_n_s_seed); - Py_VISIT(traverse_module_state->__pyx_n_s_seed0); - Py_VISIT(traverse_module_state->__pyx_n_s_seed1); - Py_VISIT(traverse_module_state->__pyx_kp_s_src_farmhash_pyx); - Py_VISIT(traverse_module_state->__pyx_n_s_test); - Py_VISIT(traverse_module_state->__pyx_n_s_tseed); - Py_VISIT(traverse_module_state->__pyx_n_s_version); - Py_VISIT(traverse_module_state->__pyx_int_0L); - Py_VISIT(traverse_module_state->__pyx_int_64L); - Py_VISIT(traverse_module_state->__pyx_int_0xffffffffffffffffL); - Py_VISIT(traverse_module_state->__pyx_k_); - Py_VISIT(traverse_module_state->__pyx_tuple__2); - Py_VISIT(traverse_module_state->__pyx_tuple__5); - Py_VISIT(traverse_module_state->__pyx_tuple__10); - Py_VISIT(traverse_module_state->__pyx_tuple__12); - Py_VISIT(traverse_module_state->__pyx_tuple__15); - Py_VISIT(traverse_module_state->__pyx_codeobj__3); - Py_VISIT(traverse_module_state->__pyx_codeobj__4); - Py_VISIT(traverse_module_state->__pyx_codeobj__6); - Py_VISIT(traverse_module_state->__pyx_codeobj__7); - Py_VISIT(traverse_module_state->__pyx_codeobj__8); - Py_VISIT(traverse_module_state->__pyx_codeobj__9); - Py_VISIT(traverse_module_state->__pyx_codeobj__11); - Py_VISIT(traverse_module_state->__pyx_codeobj__13); - Py_VISIT(traverse_module_state->__pyx_codeobj__14); - Py_VISIT(traverse_module_state->__pyx_codeobj__16); + for (int i=0; i<39; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0L); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_64L); + __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0xffffffffffffffffL); return 0; } #endif -/* #### Code section: module_state_defines ### */ -#define __pyx_d __pyx_mstate_global->__pyx_d -#define __pyx_b __pyx_mstate_global->__pyx_b -#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime -#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple -#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes -#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode -#ifdef __Pyx_CyFunction_USED -#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType -#endif -#ifdef __Pyx_FusedFunction_USED -#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType -#endif -#ifdef __Pyx_Generator_USED -#define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType -#endif -#ifdef __Pyx_IterableCoroutine_USED -#define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType -#endif -#ifdef __Pyx_Coroutine_USED -#define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_ptype_7cpython_4bool_bool __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_ptype_7cpython_7complex_complex __pyx_mstate_global->__pyx_ptype_7cpython_7complex_complex -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#if CYTHON_USE_MODULE_STATE -#endif -#define __pyx_kp_u_0_4_7 __pyx_mstate_global->__pyx_kp_u_0_4_7 -#define __pyx_kp_u_Argument __pyx_mstate_global->__pyx_kp_u_Argument -#define __pyx_kp_u_Eugene_Scherba __pyx_mstate_global->__pyx_kp_u_Eugene_Scherba -#define __pyx_n_s_FarmHash128 __pyx_mstate_global->__pyx_n_s_FarmHash128 -#define __pyx_n_u_FarmHash128 __pyx_mstate_global->__pyx_n_u_FarmHash128 -#define __pyx_n_s_FarmHash128WithSeed __pyx_mstate_global->__pyx_n_s_FarmHash128WithSeed -#define __pyx_n_u_FarmHash128WithSeed __pyx_mstate_global->__pyx_n_u_FarmHash128WithSeed -#define __pyx_n_s_FarmHash32 __pyx_mstate_global->__pyx_n_s_FarmHash32 -#define __pyx_n_u_FarmHash32 __pyx_mstate_global->__pyx_n_u_FarmHash32 -#define __pyx_n_s_FarmHash32WithSeed __pyx_mstate_global->__pyx_n_s_FarmHash32WithSeed -#define __pyx_n_u_FarmHash32WithSeed __pyx_mstate_global->__pyx_n_u_FarmHash32WithSeed -#define __pyx_n_s_FarmHash64 __pyx_mstate_global->__pyx_n_s_FarmHash64 -#define __pyx_n_u_FarmHash64 __pyx_mstate_global->__pyx_n_u_FarmHash64 -#define __pyx_n_s_FarmHash64WithSeed __pyx_mstate_global->__pyx_n_s_FarmHash64WithSeed -#define __pyx_n_u_FarmHash64WithSeed __pyx_mstate_global->__pyx_n_u_FarmHash64WithSeed -#define __pyx_n_s_FarmHash64WithSeeds __pyx_mstate_global->__pyx_n_s_FarmHash64WithSeeds -#define __pyx_n_u_FarmHash64WithSeeds __pyx_mstate_global->__pyx_n_u_FarmHash64WithSeeds -#define __pyx_n_s_Fingerprint128 __pyx_mstate_global->__pyx_n_s_Fingerprint128 -#define __pyx_n_u_Fingerprint128 __pyx_mstate_global->__pyx_n_u_Fingerprint128 -#define __pyx_n_s_Fingerprint32 __pyx_mstate_global->__pyx_n_s_Fingerprint32 -#define __pyx_n_u_Fingerprint32 __pyx_mstate_global->__pyx_n_u_Fingerprint32 -#define __pyx_n_s_Fingerprint64 __pyx_mstate_global->__pyx_n_s_Fingerprint64 -#define __pyx_n_u_Fingerprint64 __pyx_mstate_global->__pyx_n_u_Fingerprint64 -#define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError -#define __pyx_n_s__17 __pyx_mstate_global->__pyx_n_s__17 -#define __pyx_n_s_all __pyx_mstate_global->__pyx_n_s_all -#define __pyx_n_s_author __pyx_mstate_global->__pyx_n_s_author -#define __pyx_n_u_basestring __pyx_mstate_global->__pyx_n_u_basestring -#define __pyx_n_s_buf __pyx_mstate_global->__pyx_n_s_buf -#define __pyx_n_u_buffer __pyx_mstate_global->__pyx_n_u_buffer -#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback -#define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data -#define __pyx_n_u_data __pyx_mstate_global->__pyx_n_u_data -#define __pyx_n_s_email __pyx_mstate_global->__pyx_n_s_email -#define __pyx_n_s_encoding __pyx_mstate_global->__pyx_n_s_encoding -#define __pyx_n_s_encoding_size __pyx_mstate_global->__pyx_n_s_encoding_size -#define __pyx_kp_u_escherba_cityhash_gmail_com __pyx_mstate_global->__pyx_kp_u_escherba_cityhash_gmail_com -#define __pyx_n_s_farmhash __pyx_mstate_global->__pyx_n_s_farmhash -#define __pyx_n_s_first __pyx_mstate_global->__pyx_n_s_first -#define __pyx_kp_u_got __pyx_mstate_global->__pyx_kp_u_got -#define __pyx_kp_u_has_incorrect_type_expected __pyx_mstate_global->__pyx_kp_u_has_incorrect_type_expected -#define __pyx_kp_u_instead __pyx_mstate_global->__pyx_kp_u_instead -#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main -#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name -#define __pyx_n_s_result __pyx_mstate_global->__pyx_n_s_result -#define __pyx_n_s_second __pyx_mstate_global->__pyx_n_s_second -#define __pyx_n_s_seed __pyx_mstate_global->__pyx_n_s_seed -#define __pyx_n_s_seed0 __pyx_mstate_global->__pyx_n_s_seed0 -#define __pyx_n_s_seed1 __pyx_mstate_global->__pyx_n_s_seed1 -#define __pyx_kp_s_src_farmhash_pyx __pyx_mstate_global->__pyx_kp_s_src_farmhash_pyx -#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test -#define __pyx_n_s_tseed __pyx_mstate_global->__pyx_n_s_tseed -#define __pyx_n_s_version __pyx_mstate_global->__pyx_n_s_version -#define __pyx_int_0L __pyx_mstate_global->__pyx_int_0L -#define __pyx_int_64L __pyx_mstate_global->__pyx_int_64L -#define __pyx_int_0xffffffffffffffffL __pyx_mstate_global->__pyx_int_0xffffffffffffffffL -#define __pyx_k_ __pyx_mstate_global->__pyx_k_ -#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 -#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5 -#define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 -#define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 -#define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 -#define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3 -#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 -#define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6 -#define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7 -#define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8 -#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 -#define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 -#define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 -#define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 -#define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 /* #### Code section: module_code ### */ -/* "cpython/complex.pxd":19 +/* "cpython/complex.pxd":20 * - * @property - * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<< - * return self.cval.real - * - */ + * # unavailable in limited API + * @property # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") + * cdef inline double real(self) noexcept: +*/ +#if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) { double __pyx_r; - /* "cpython/complex.pxd":20 - * @property + /* "cpython/complex.pxd":23 + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline double real(self) noexcept: * return self.cval.real # <<<<<<<<<<<<<< * - * @property - */ + * # unavailable in limited API +*/ __pyx_r = __pyx_v_self->cval.real; goto __pyx_L0; - /* "cpython/complex.pxd":19 - * - * @property - * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<< - * return self.cval.real + /* "cpython/complex.pxd":20 * - */ + * # unavailable in limited API + * @property # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") + * cdef inline double real(self) noexcept: +*/ /* function exit code */ __pyx_L0:; return __pyx_r; } +#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/ -/* "cpython/complex.pxd":23 - * - * @property - * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<< - * return self.cval.imag +/* "cpython/complex.pxd":26 * - */ + * # unavailable in limited API + * @property # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") + * cdef inline double imag(self) noexcept: +*/ +#if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) { double __pyx_r; - /* "cpython/complex.pxd":24 - * @property + /* "cpython/complex.pxd":29 + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") * cdef inline double imag(self) noexcept: * return self.cval.imag # <<<<<<<<<<<<<< * * # PyTypeObject PyComplex_Type - */ +*/ __pyx_r = __pyx_v_self->cval.imag; goto __pyx_L0; - /* "cpython/complex.pxd":23 - * - * @property - * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<< - * return self.cval.imag + /* "cpython/complex.pxd":26 * - */ + * # unavailable in limited API + * @property # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") + * cdef inline double imag(self) noexcept: +*/ /* function exit code */ __pyx_L0:; return __pyx_r; } +#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/ -/* "cpython/contextvars.pxd":112 +/* "cpython/contextvars.pxd":115 * * - * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") # <<<<<<<<<<<<<< + * cdef inline object get_value(var, default_value=None): * """Return a new reference to the value of the context variable, - * or the default value of the context variable, - */ +*/ +#if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value *__pyx_optional_args) { + + /* "cpython/contextvars.pxd":116 + * + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") + * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< + * """Return a new reference to the value of the context variable, + * or the default value of the context variable, +*/ PyObject *__pyx_v_default_value = ((PyObject *)Py_None); PyObject *__pyx_v_value; PyObject *__pyx_v_pyvalue = NULL; @@ -2847,104 +2572,104 @@ static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("get_value", 1); + __Pyx_RefNannySetupContext("get_value", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default_value = __pyx_optional_args->default_value; } } - /* "cpython/contextvars.pxd":117 + /* "cpython/contextvars.pxd":121 * or None if no such value or default was found. * """ * cdef PyObject *value = NULL # <<<<<<<<<<<<<< * PyContextVar_Get(var, NULL, &value) * if value is NULL: - */ +*/ __pyx_v_value = NULL; - /* "cpython/contextvars.pxd":118 + /* "cpython/contextvars.pxd":122 * """ * cdef PyObject *value = NULL * PyContextVar_Get(var, NULL, &value) # <<<<<<<<<<<<<< * if value is NULL: * # context variable does not have a default - */ - __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 118, __pyx_L1_error) +*/ + __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 122, __pyx_L1_error) - /* "cpython/contextvars.pxd":119 + /* "cpython/contextvars.pxd":123 * cdef PyObject *value = NULL * PyContextVar_Get(var, NULL, &value) * if value is NULL: # <<<<<<<<<<<<<< * # context variable does not have a default * pyvalue = default_value - */ +*/ __pyx_t_2 = (__pyx_v_value == NULL); if (__pyx_t_2) { - /* "cpython/contextvars.pxd":121 + /* "cpython/contextvars.pxd":125 * if value is NULL: * # context variable does not have a default * pyvalue = default_value # <<<<<<<<<<<<<< * else: * # value or default value of context variable - */ +*/ __Pyx_INCREF(__pyx_v_default_value); __pyx_v_pyvalue = __pyx_v_default_value; - /* "cpython/contextvars.pxd":119 + /* "cpython/contextvars.pxd":123 * cdef PyObject *value = NULL * PyContextVar_Get(var, NULL, &value) * if value is NULL: # <<<<<<<<<<<<<< * # context variable does not have a default * pyvalue = default_value - */ +*/ goto __pyx_L3; } - /* "cpython/contextvars.pxd":124 + /* "cpython/contextvars.pxd":128 * else: * # value or default value of context variable * pyvalue = value # <<<<<<<<<<<<<< * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue - */ +*/ /*else*/ { __pyx_t_3 = ((PyObject *)__pyx_v_value); __Pyx_INCREF(__pyx_t_3); __pyx_v_pyvalue = __pyx_t_3; __pyx_t_3 = 0; - /* "cpython/contextvars.pxd":125 + /* "cpython/contextvars.pxd":129 * # value or default value of context variable * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<< * return pyvalue * - */ +*/ Py_XDECREF(__pyx_v_value); } __pyx_L3:; - /* "cpython/contextvars.pxd":126 + /* "cpython/contextvars.pxd":130 * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_pyvalue); __pyx_r = __pyx_v_pyvalue; goto __pyx_L0; - /* "cpython/contextvars.pxd":112 + /* "cpython/contextvars.pxd":115 * * - * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") # <<<<<<<<<<<<<< + * cdef inline object get_value(var, default_value=None): * """Return a new reference to the value of the context variable, - * or the default value of the context variable, - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -2957,16 +2682,26 @@ static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject __Pyx_RefNannyFinishContext(); return __pyx_r; } +#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/ -/* "cpython/contextvars.pxd":129 +/* "cpython/contextvars.pxd":133 * * - * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") # <<<<<<<<<<<<<< + * cdef inline object get_value_no_default(var, default_value=None): * """Return a new reference to the value of the context variable, - * or the provided default value if no such value was found. - */ +*/ +#if !CYTHON_COMPILING_IN_LIMITED_API static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_default(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default *__pyx_optional_args) { + + /* "cpython/contextvars.pxd":134 + * + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") + * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< + * """Return a new reference to the value of the context variable, + * or the provided default value if no such value was found. +*/ PyObject *__pyx_v_default_value = ((PyObject *)Py_None); PyObject *__pyx_v_value; PyObject *__pyx_v_pyvalue = NULL; @@ -2977,68 +2712,68 @@ static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_defau int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("get_value_no_default", 1); + __Pyx_RefNannySetupContext("get_value_no_default", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default_value = __pyx_optional_args->default_value; } } - /* "cpython/contextvars.pxd":135 + /* "cpython/contextvars.pxd":140 * Ignores the default value of the context variable, if any. * """ * cdef PyObject *value = NULL # <<<<<<<<<<<<<< * PyContextVar_Get(var, default_value, &value) * # value of context variable or 'default_value' - */ +*/ __pyx_v_value = NULL; - /* "cpython/contextvars.pxd":136 + /* "cpython/contextvars.pxd":141 * """ * cdef PyObject *value = NULL * PyContextVar_Get(var, default_value, &value) # <<<<<<<<<<<<<< * # value of context variable or 'default_value' * pyvalue = value - */ - __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 136, __pyx_L1_error) +*/ + __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 141, __pyx_L1_error) - /* "cpython/contextvars.pxd":138 + /* "cpython/contextvars.pxd":143 * PyContextVar_Get(var, default_value, &value) * # value of context variable or 'default_value' * pyvalue = value # <<<<<<<<<<<<<< * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue - */ +*/ __pyx_t_2 = ((PyObject *)__pyx_v_value); __Pyx_INCREF(__pyx_t_2); __pyx_v_pyvalue = __pyx_t_2; __pyx_t_2 = 0; - /* "cpython/contextvars.pxd":139 + /* "cpython/contextvars.pxd":144 * # value of context variable or 'default_value' * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<< * return pyvalue - */ +*/ Py_XDECREF(__pyx_v_value); - /* "cpython/contextvars.pxd":140 + /* "cpython/contextvars.pxd":145 * pyvalue = value * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' * return pyvalue # <<<<<<<<<<<<<< - */ +*/ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_pyvalue); __pyx_r = __pyx_v_pyvalue; goto __pyx_L0; - /* "cpython/contextvars.pxd":129 + /* "cpython/contextvars.pxd":133 * * - * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<< + * @_cython.c_compile_guard("!CYTHON_COMPILING_IN_LIMITED_API") # <<<<<<<<<<<<<< + * cdef inline object get_value_no_default(var, default_value=None): * """Return a new reference to the value of the context variable, - * or the provided default value if no such value was found. - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -3051,6 +2786,7 @@ static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_defau __Pyx_RefNannyFinishContext(); return __pyx_r; } +#endif /*!(#if !CYTHON_COMPILING_IN_LIMITED_API)*/ /* "farmhash.pyx":86 * @@ -3058,20 +2794,23 @@ static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_defau * cdef object _type_error(argname: str, expected: object, value: object): # <<<<<<<<<<<<<< * return TypeError( * "Argument '%s' has incorrect type: expected %s, got '%s' instead" % - */ +*/ static PyObject *__pyx_f_8farmhash__type_error(PyObject *__pyx_v_argname, PyObject *__pyx_v_expected, PyObject *__pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - Py_UCS4 __pyx_t_3; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7[7]; + size_t __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_type_error", 1); + __Pyx_RefNannySetupContext("_type_error", 0); /* "farmhash.pyx":87 * @@ -3079,24 +2818,11 @@ static PyObject *__pyx_f_8farmhash__type_error(PyObject *__pyx_v_argname, PyObje * return TypeError( # <<<<<<<<<<<<<< * "Argument '%s' has incorrect type: expected %s, got '%s' instead" % * (argname, expected, type(value).__name__) - */ +*/ __Pyx_XDECREF(__pyx_r); - - /* "farmhash.pyx":88 - * cdef object _type_error(argname: str, expected: object, value: object): - * return TypeError( - * "Argument '%s' has incorrect type: expected %s, got '%s' instead" % # <<<<<<<<<<<<<< - * (argname, expected, type(value).__name__) - * ) - */ - __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = 0; - __pyx_t_3 = 127; - __Pyx_INCREF(__pyx_kp_u_Argument); - __pyx_t_2 += 10; - __Pyx_GIVEREF(__pyx_kp_u_Argument); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Argument); + __pyx_t_2 = NULL; + __Pyx_INCREF(__pyx_builtin_TypeError); + __pyx_t_3 = __pyx_builtin_TypeError; /* "farmhash.pyx":89 * return TypeError( @@ -3104,41 +2830,21 @@ static PyObject *__pyx_f_8farmhash__type_error(PyObject *__pyx_v_argname, PyObje * (argname, expected, type(value).__name__) # <<<<<<<<<<<<<< * ) * - */ - __Pyx_INCREF(__pyx_v_argname); - __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_argname) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_argname) : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_v_argname); - __Pyx_GIVEREF(__pyx_v_argname); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_argname); - __Pyx_INCREF(__pyx_kp_u_has_incorrect_type_expected); - __pyx_t_2 += 31; - __Pyx_GIVEREF(__pyx_kp_u_has_incorrect_type_expected); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_has_incorrect_type_expected); - __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_v_expected), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_kp_u_got); - __pyx_t_2 += 7; - __Pyx_GIVEREF(__pyx_kp_u_got); - PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_got); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_value)), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error) +*/ + __pyx_t_4 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_v_expected), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_value)), __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_5); - __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_kp_u_instead); - __pyx_t_2 += 9; - __Pyx_GIVEREF(__pyx_kp_u_instead); - PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u_instead); + __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_Argument; + __pyx_t_7[1] = __pyx_v_argname; + __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u_has_incorrect_type_expected; + __pyx_t_7[3] = __pyx_t_4; + __pyx_t_7[4] = __pyx_mstate_global->__pyx_kp_u_got; + __pyx_t_7[5] = __pyx_t_6; + __pyx_t_7[6] = __pyx_mstate_global->__pyx_kp_u_instead; /* "farmhash.pyx":88 * cdef object _type_error(argname: str, expected: object, value: object): @@ -3146,21 +2852,22 @@ static PyObject *__pyx_f_8farmhash__type_error(PyObject *__pyx_v_argname, PyObje * "Argument '%s' has incorrect type: expected %s, got '%s' instead" % # <<<<<<<<<<<<<< * (argname, expected, type(value).__name__) * ) - */ - __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error) +*/ + __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_7, 7, 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_v_argname) + 31 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 7 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 9, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_v_argname) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6)); + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "farmhash.pyx":87 - * - * cdef object _type_error(argname: str, expected: object, value: object): - * return TypeError( # <<<<<<<<<<<<<< - * "Argument '%s' has incorrect type: expected %s, got '%s' instead" % - * (argname, expected, type(value).__name__) - */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_8 = 1; + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; @@ -3171,13 +2878,16 @@ static PyObject *__pyx_f_8farmhash__type_error(PyObject *__pyx_v_argname, PyObje * cdef object _type_error(argname: str, expected: object, value: object): # <<<<<<<<<<<<<< * return TypeError( * "Argument '%s' has incorrect type: expected %s, got '%s' instead" % - */ +*/ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("farmhash._type_error", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; @@ -3192,7 +2902,7 @@ static PyObject *__pyx_f_8farmhash__type_error(PyObject *__pyx_v_argname, PyObje * def FarmHash32(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 32-bit hash from input data. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_8farmhash_1FarmHash32(PyObject *__pyx_self, @@ -3202,8 +2912,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8farmhash_FarmHash32, "FarmHash32(data) -> int\nObtain a 32-bit hash from input data.\n\n :param data: input data (string, bytes, or buffer object)\n :return: an integer representing a 32-bit hash of the input\n :raises TypeError: if data is not of one of input types\n :raises ValueError: if input buffer is not C-contiguous\n "); -static PyMethodDef __pyx_mdef_8farmhash_1FarmHash32 = {"FarmHash32", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8farmhash_1FarmHash32, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8farmhash_FarmHash32}; +PyDoc_STRVAR(__pyx_doc_8farmhash_FarmHash32, "FarmHash32(data) -> int\n\nObtain a 32-bit hash from input data.\n\n:param data: input data (string, bytes, or buffer object)\n:return: an integer representing a 32-bit hash of the input\n:raises TypeError: if data is not of one of input types\n:raises ValueError: if input buffer is not C-contiguous"); +static PyMethodDef __pyx_mdef_8farmhash_1FarmHash32 = {"FarmHash32", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8farmhash_1FarmHash32, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8farmhash_FarmHash32}; static PyObject *__pyx_pw_8farmhash_1FarmHash32(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3224,7 +2934,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("FarmHash32 (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -3232,33 +2942,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 93, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 93, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "FarmHash32") < 0)) __PYX_ERR(0, 93, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "FarmHash32", 0) < 0) __PYX_ERR(0, 93, __pyx_L3_error) + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("FarmHash32", 1, 1, 1, i); __PYX_ERR(0, 93, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 93, __pyx_L3_error) } __pyx_v_data = values[0]; } @@ -3268,11 +2973,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("farmhash.FarmHash32", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3281,11 +2983,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_8farmhash_FarmHash32(__pyx_self, __pyx_v_data); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -3306,7 +3005,7 @@ static PyObject *__pyx_pf_8farmhash_FarmHash32(CYTHON_UNUSED PyObject *__pyx_sel int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("FarmHash32", 1); + __Pyx_RefNannySetupContext("FarmHash32", 0); /* "farmhash.pyx":104 * cdef uint32_t result @@ -3314,7 +3013,7 @@ static PyObject *__pyx_pf_8farmhash_FarmHash32(CYTHON_UNUSED PyObject *__pyx_sel * cdef Py_ssize_t encoding_size = 0 # <<<<<<<<<<<<<< * * if PyUnicode_Check(data): - */ +*/ __pyx_v_encoding_size = 0; /* "farmhash.pyx":106 @@ -3323,7 +3022,7 @@ static PyObject *__pyx_pf_8farmhash_FarmHash32(CYTHON_UNUSED PyObject *__pyx_sel * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash32(encoding, encoding_size) - */ +*/ __pyx_t_1 = PyUnicode_Check(__pyx_v_data); if (__pyx_t_1) { @@ -3333,8 +3032,8 @@ static PyObject *__pyx_pf_8farmhash_FarmHash32(CYTHON_UNUSED PyObject *__pyx_sel * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) # <<<<<<<<<<<<<< * result = c_Hash32(encoding, encoding_size) * elif PyBytes_Check(data): - */ - __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(0, 107, __pyx_L1_error) +*/ + __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)0))) __PYX_ERR(0, 107, __pyx_L1_error) __pyx_v_encoding = __pyx_t_2; /* "farmhash.pyx":108 @@ -3343,7 +3042,7 @@ static PyObject *__pyx_pf_8farmhash_FarmHash32(CYTHON_UNUSED PyObject *__pyx_sel * result = c_Hash32(encoding, encoding_size) # <<<<<<<<<<<<<< * elif PyBytes_Check(data): * result = c_Hash32( - */ +*/ __pyx_v_result = util::Hash32(__pyx_v_encoding, __pyx_v_encoding_size); /* "farmhash.pyx":106 @@ -3352,7 +3051,7 @@ static PyObject *__pyx_pf_8farmhash_FarmHash32(CYTHON_UNUSED PyObject *__pyx_sel * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash32(encoding, encoding_size) - */ +*/ goto __pyx_L3; } @@ -3362,7 +3061,7 @@ static PyObject *__pyx_pf_8farmhash_FarmHash32(CYTHON_UNUSED PyObject *__pyx_sel * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash32( * PyBytes_AS_STRING(data), - */ +*/ __pyx_t_1 = PyBytes_Check(__pyx_v_data); if (__pyx_t_1) { @@ -3372,7 +3071,7 @@ static PyObject *__pyx_pf_8farmhash_FarmHash32(CYTHON_UNUSED PyObject *__pyx_sel * result = c_Hash32( # <<<<<<<<<<<<<< * PyBytes_AS_STRING(data), * PyBytes_GET_SIZE(data)) - */ +*/ __pyx_v_result = util::Hash32(((char const *)PyBytes_AS_STRING(__pyx_v_data)), PyBytes_GET_SIZE(__pyx_v_data)); /* "farmhash.pyx":109 @@ -3381,7 +3080,7 @@ static PyObject *__pyx_pf_8farmhash_FarmHash32(CYTHON_UNUSED PyObject *__pyx_sel * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash32( * PyBytes_AS_STRING(data), - */ +*/ goto __pyx_L3; } @@ -3391,7 +3090,7 @@ static PyObject *__pyx_pf_8farmhash_FarmHash32(CYTHON_UNUSED PyObject *__pyx_sel * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash32(buf.buf, buf.len) - */ +*/ __pyx_t_1 = PyObject_CheckBuffer(__pyx_v_data); if (likely(__pyx_t_1)) { @@ -3401,7 +3100,7 @@ static PyObject *__pyx_pf_8farmhash_FarmHash32(CYTHON_UNUSED PyObject *__pyx_sel * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * result = c_Hash32(buf.buf, buf.len) * PyBuffer_Release(&buf) - */ +*/ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 114, __pyx_L1_error) /* "farmhash.pyx":115 @@ -3410,7 +3109,7 @@ static PyObject *__pyx_pf_8farmhash_FarmHash32(CYTHON_UNUSED PyObject *__pyx_sel * result = c_Hash32(buf.buf, buf.len) # <<<<<<<<<<<<<< * PyBuffer_Release(&buf) * else: - */ +*/ __pyx_v_result = util::Hash32(((char const *)__pyx_v_buf.buf), __pyx_v_buf.len); /* "farmhash.pyx":116 @@ -3419,7 +3118,7 @@ static PyObject *__pyx_pf_8farmhash_FarmHash32(CYTHON_UNUSED PyObject *__pyx_sel * PyBuffer_Release(&buf) # <<<<<<<<<<<<<< * else: * raise _type_error("data", ["basestring", "buffer"], data) - */ +*/ PyBuffer_Release((&__pyx_v_buf)); /* "farmhash.pyx":113 @@ -3428,7 +3127,7 @@ static PyObject *__pyx_pf_8farmhash_FarmHash32(CYTHON_UNUSED PyObject *__pyx_sel * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash32(buf.buf, buf.len) - */ +*/ goto __pyx_L3; } @@ -3438,17 +3137,17 @@ static PyObject *__pyx_pf_8farmhash_FarmHash32(CYTHON_UNUSED PyObject *__pyx_sel * raise _type_error("data", ["basestring", "buffer"], data) # <<<<<<<<<<<<<< * return result * - */ +*/ /*else*/ { __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_u_basestring); - __Pyx_GIVEREF(__pyx_n_u_basestring); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_basestring)) __PYX_ERR(0, 118, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_buffer); - __Pyx_GIVEREF(__pyx_n_u_buffer); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_u_buffer)) __PYX_ERR(0, 118, __pyx_L1_error); - __pyx_t_5 = __pyx_f_8farmhash__type_error(__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_basestring); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_basestring); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_n_u_basestring) != (0)) __PYX_ERR(0, 118, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_buffer); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_buffer); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_n_u_buffer) != (0)) __PYX_ERR(0, 118, __pyx_L1_error); + __pyx_t_5 = __pyx_f_8farmhash__type_error(__pyx_mstate_global->__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); @@ -3463,11 +3162,11 @@ static PyObject *__pyx_pf_8farmhash_FarmHash32(CYTHON_UNUSED PyObject *__pyx_sel * return result # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_uint32_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 119, __pyx_L1_error) + if (!(likely(PyLong_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 119, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; @@ -3478,7 +3177,7 @@ static PyObject *__pyx_pf_8farmhash_FarmHash32(CYTHON_UNUSED PyObject *__pyx_sel * def FarmHash32(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 32-bit hash from input data. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -3498,7 +3197,7 @@ static PyObject *__pyx_pf_8farmhash_FarmHash32(CYTHON_UNUSED PyObject *__pyx_sel * def Fingerprint32(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 32-bit hardware-independent fingerprint. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_8farmhash_3Fingerprint32(PyObject *__pyx_self, @@ -3508,8 +3207,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8farmhash_2Fingerprint32, "Fingerprint32(data) -> int\nObtain a 32-bit hardware-independent fingerprint.\n\n :param data: input data (string, bytes, or buffer object)\n :return: an integer representing a 32-bit hash of the input\n :raises TypeError: if data is not of one of input types\n :raises ValueError: if input buffer is not C-contiguous\n "); -static PyMethodDef __pyx_mdef_8farmhash_3Fingerprint32 = {"Fingerprint32", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8farmhash_3Fingerprint32, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8farmhash_2Fingerprint32}; +PyDoc_STRVAR(__pyx_doc_8farmhash_2Fingerprint32, "Fingerprint32(data) -> int\n\nObtain a 32-bit hardware-independent fingerprint.\n\n:param data: input data (string, bytes, or buffer object)\n:return: an integer representing a 32-bit hash of the input\n:raises TypeError: if data is not of one of input types\n:raises ValueError: if input buffer is not C-contiguous"); +static PyMethodDef __pyx_mdef_8farmhash_3Fingerprint32 = {"Fingerprint32", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8farmhash_3Fingerprint32, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8farmhash_2Fingerprint32}; static PyObject *__pyx_pw_8farmhash_3Fingerprint32(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3530,7 +3229,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("Fingerprint32 (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -3538,33 +3237,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 122, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 122, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "Fingerprint32") < 0)) __PYX_ERR(0, 122, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Fingerprint32", 0) < 0) __PYX_ERR(0, 122, __pyx_L3_error) + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Fingerprint32", 1, 1, 1, i); __PYX_ERR(0, 122, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 122, __pyx_L3_error) } __pyx_v_data = values[0]; } @@ -3574,11 +3268,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("farmhash.Fingerprint32", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3587,11 +3278,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_8farmhash_2Fingerprint32(__pyx_self, __pyx_v_data); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -3612,7 +3300,7 @@ static PyObject *__pyx_pf_8farmhash_2Fingerprint32(CYTHON_UNUSED PyObject *__pyx int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("Fingerprint32", 1); + __Pyx_RefNannySetupContext("Fingerprint32", 0); /* "farmhash.pyx":133 * cdef uint32_t result @@ -3620,7 +3308,7 @@ static PyObject *__pyx_pf_8farmhash_2Fingerprint32(CYTHON_UNUSED PyObject *__pyx * cdef Py_ssize_t encoding_size = 0 # <<<<<<<<<<<<<< * * if PyUnicode_Check(data): - */ +*/ __pyx_v_encoding_size = 0; /* "farmhash.pyx":135 @@ -3629,7 +3317,7 @@ static PyObject *__pyx_pf_8farmhash_2Fingerprint32(CYTHON_UNUSED PyObject *__pyx * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Fingerprint32(encoding, encoding_size) - */ +*/ __pyx_t_1 = PyUnicode_Check(__pyx_v_data); if (__pyx_t_1) { @@ -3639,8 +3327,8 @@ static PyObject *__pyx_pf_8farmhash_2Fingerprint32(CYTHON_UNUSED PyObject *__pyx * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) # <<<<<<<<<<<<<< * result = c_Fingerprint32(encoding, encoding_size) * elif PyBytes_Check(data): - */ - __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(0, 136, __pyx_L1_error) +*/ + __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)0))) __PYX_ERR(0, 136, __pyx_L1_error) __pyx_v_encoding = __pyx_t_2; /* "farmhash.pyx":137 @@ -3649,7 +3337,7 @@ static PyObject *__pyx_pf_8farmhash_2Fingerprint32(CYTHON_UNUSED PyObject *__pyx * result = c_Fingerprint32(encoding, encoding_size) # <<<<<<<<<<<<<< * elif PyBytes_Check(data): * result = c_Fingerprint32( - */ +*/ __pyx_v_result = util::Fingerprint32(__pyx_v_encoding, __pyx_v_encoding_size); /* "farmhash.pyx":135 @@ -3658,7 +3346,7 @@ static PyObject *__pyx_pf_8farmhash_2Fingerprint32(CYTHON_UNUSED PyObject *__pyx * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Fingerprint32(encoding, encoding_size) - */ +*/ goto __pyx_L3; } @@ -3668,7 +3356,7 @@ static PyObject *__pyx_pf_8farmhash_2Fingerprint32(CYTHON_UNUSED PyObject *__pyx * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Fingerprint32( * PyBytes_AS_STRING(data), - */ +*/ __pyx_t_1 = PyBytes_Check(__pyx_v_data); if (__pyx_t_1) { @@ -3678,7 +3366,7 @@ static PyObject *__pyx_pf_8farmhash_2Fingerprint32(CYTHON_UNUSED PyObject *__pyx * result = c_Fingerprint32( # <<<<<<<<<<<<<< * PyBytes_AS_STRING(data), * PyBytes_GET_SIZE(data)) - */ +*/ __pyx_v_result = util::Fingerprint32(((char const *)PyBytes_AS_STRING(__pyx_v_data)), PyBytes_GET_SIZE(__pyx_v_data)); /* "farmhash.pyx":138 @@ -3687,7 +3375,7 @@ static PyObject *__pyx_pf_8farmhash_2Fingerprint32(CYTHON_UNUSED PyObject *__pyx * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Fingerprint32( * PyBytes_AS_STRING(data), - */ +*/ goto __pyx_L3; } @@ -3697,7 +3385,7 @@ static PyObject *__pyx_pf_8farmhash_2Fingerprint32(CYTHON_UNUSED PyObject *__pyx * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Fingerprint32(buf.buf, buf.len) - */ +*/ __pyx_t_1 = PyObject_CheckBuffer(__pyx_v_data); if (likely(__pyx_t_1)) { @@ -3707,7 +3395,7 @@ static PyObject *__pyx_pf_8farmhash_2Fingerprint32(CYTHON_UNUSED PyObject *__pyx * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * result = c_Fingerprint32(buf.buf, buf.len) * PyBuffer_Release(&buf) - */ +*/ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 143, __pyx_L1_error) /* "farmhash.pyx":144 @@ -3716,7 +3404,7 @@ static PyObject *__pyx_pf_8farmhash_2Fingerprint32(CYTHON_UNUSED PyObject *__pyx * result = c_Fingerprint32(buf.buf, buf.len) # <<<<<<<<<<<<<< * PyBuffer_Release(&buf) * else: - */ +*/ __pyx_v_result = util::Fingerprint32(((char const *)__pyx_v_buf.buf), __pyx_v_buf.len); /* "farmhash.pyx":145 @@ -3725,7 +3413,7 @@ static PyObject *__pyx_pf_8farmhash_2Fingerprint32(CYTHON_UNUSED PyObject *__pyx * PyBuffer_Release(&buf) # <<<<<<<<<<<<<< * else: * raise _type_error("data", ["basestring", "buffer"], data) - */ +*/ PyBuffer_Release((&__pyx_v_buf)); /* "farmhash.pyx":142 @@ -3734,7 +3422,7 @@ static PyObject *__pyx_pf_8farmhash_2Fingerprint32(CYTHON_UNUSED PyObject *__pyx * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Fingerprint32(buf.buf, buf.len) - */ +*/ goto __pyx_L3; } @@ -3744,17 +3432,17 @@ static PyObject *__pyx_pf_8farmhash_2Fingerprint32(CYTHON_UNUSED PyObject *__pyx * raise _type_error("data", ["basestring", "buffer"], data) # <<<<<<<<<<<<<< * return result * - */ +*/ /*else*/ { __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_u_basestring); - __Pyx_GIVEREF(__pyx_n_u_basestring); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_basestring)) __PYX_ERR(0, 147, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_buffer); - __Pyx_GIVEREF(__pyx_n_u_buffer); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_u_buffer)) __PYX_ERR(0, 147, __pyx_L1_error); - __pyx_t_5 = __pyx_f_8farmhash__type_error(__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_basestring); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_basestring); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_n_u_basestring) != (0)) __PYX_ERR(0, 147, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_buffer); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_buffer); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_n_u_buffer) != (0)) __PYX_ERR(0, 147, __pyx_L1_error); + __pyx_t_5 = __pyx_f_8farmhash__type_error(__pyx_mstate_global->__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); @@ -3769,11 +3457,11 @@ static PyObject *__pyx_pf_8farmhash_2Fingerprint32(CYTHON_UNUSED PyObject *__pyx * return result # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_uint32_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 148, __pyx_L1_error) + if (!(likely(PyLong_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 148, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; @@ -3784,7 +3472,7 @@ static PyObject *__pyx_pf_8farmhash_2Fingerprint32(CYTHON_UNUSED PyObject *__pyx * def Fingerprint32(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 32-bit hardware-independent fingerprint. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -3804,7 +3492,7 @@ static PyObject *__pyx_pf_8farmhash_2Fingerprint32(CYTHON_UNUSED PyObject *__pyx * def FarmHash32WithSeed(data, uint32_t seed=0U) -> int: # <<<<<<<<<<<<<< * """Obtain a 32-bit hash using a seed. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_8farmhash_5FarmHash32WithSeed(PyObject *__pyx_self, @@ -3814,8 +3502,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8farmhash_4FarmHash32WithSeed, "FarmHash32WithSeed(data, uint32_t seed=0) -> int\nObtain a 32-bit hash using a seed.\n\n :param data: input data (string, bytes, or buffer object)\n :param seed: seed value (a 32-bit integer, defaults to 0)\n :return: an integer representing a 32-bit hash of the input\n :raises TypeError: if data is not of one of input types\n :raises ValueError: if input buffer is not C-contiguous\n :raises OverflowError: if seed cannot be converted to unsigned int32\n "); -static PyMethodDef __pyx_mdef_8farmhash_5FarmHash32WithSeed = {"FarmHash32WithSeed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8farmhash_5FarmHash32WithSeed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8farmhash_4FarmHash32WithSeed}; +PyDoc_STRVAR(__pyx_doc_8farmhash_4FarmHash32WithSeed, "FarmHash32WithSeed(data, uint32_t seed=0) -> int\n\nObtain a 32-bit hash using a seed.\n\n:param data: input data (string, bytes, or buffer object)\n:param seed: seed value (a 32-bit integer, defaults to 0)\n:return: an integer representing a 32-bit hash of the input\n:raises TypeError: if data is not of one of input types\n:raises ValueError: if input buffer is not C-contiguous\n:raises OverflowError: if seed cannot be converted to unsigned int32"); +static PyMethodDef __pyx_mdef_8farmhash_5FarmHash32WithSeed = {"FarmHash32WithSeed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8farmhash_5FarmHash32WithSeed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8farmhash_4FarmHash32WithSeed}; static PyObject *__pyx_pw_8farmhash_5FarmHash32WithSeed(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -3837,7 +3525,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("FarmHash32WithSeed (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -3845,50 +3533,43 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_seed,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,&__pyx_mstate_global->__pyx_n_u_seed,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 151, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 151, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 151, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_seed); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "FarmHash32WithSeed") < 0)) __PYX_ERR(0, 151, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "FarmHash32WithSeed", 0) < 0) __PYX_ERR(0, 151, __pyx_L3_error) + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("FarmHash32WithSeed", 0, 1, 2, i); __PYX_ERR(0, 151, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 151, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 151, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_data = values[0]; if (values[1]) { - __pyx_v_seed = __Pyx_PyInt_As_uint32_t(values[1]); if (unlikely((__pyx_v_seed == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L3_error) + __pyx_v_seed = __Pyx_PyLong_As_uint32_t(values[1]); if (unlikely((__pyx_v_seed == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L3_error) } else { __pyx_v_seed = ((uint32_t)0U); } @@ -3899,11 +3580,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("farmhash.FarmHash32WithSeed", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -3912,11 +3590,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_8farmhash_4FarmHash32WithSeed(__pyx_self, __pyx_v_data, __pyx_v_seed); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -3937,7 +3612,7 @@ static PyObject *__pyx_pf_8farmhash_4FarmHash32WithSeed(CYTHON_UNUSED PyObject * int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("FarmHash32WithSeed", 1); + __Pyx_RefNannySetupContext("FarmHash32WithSeed", 0); /* "farmhash.pyx":165 * cdef uint32_t result @@ -3945,7 +3620,7 @@ static PyObject *__pyx_pf_8farmhash_4FarmHash32WithSeed(CYTHON_UNUSED PyObject * * cdef Py_ssize_t encoding_size = 0 # <<<<<<<<<<<<<< * * if PyUnicode_Check(data): - */ +*/ __pyx_v_encoding_size = 0; /* "farmhash.pyx":167 @@ -3954,7 +3629,7 @@ static PyObject *__pyx_pf_8farmhash_4FarmHash32WithSeed(CYTHON_UNUSED PyObject * * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash32WithSeed(encoding, encoding_size, seed) - */ +*/ __pyx_t_1 = PyUnicode_Check(__pyx_v_data); if (__pyx_t_1) { @@ -3964,8 +3639,8 @@ static PyObject *__pyx_pf_8farmhash_4FarmHash32WithSeed(CYTHON_UNUSED PyObject * * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) # <<<<<<<<<<<<<< * result = c_Hash32WithSeed(encoding, encoding_size, seed) * elif PyBytes_Check(data): - */ - __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(0, 168, __pyx_L1_error) +*/ + __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)0))) __PYX_ERR(0, 168, __pyx_L1_error) __pyx_v_encoding = __pyx_t_2; /* "farmhash.pyx":169 @@ -3974,7 +3649,7 @@ static PyObject *__pyx_pf_8farmhash_4FarmHash32WithSeed(CYTHON_UNUSED PyObject * * result = c_Hash32WithSeed(encoding, encoding_size, seed) # <<<<<<<<<<<<<< * elif PyBytes_Check(data): * result = c_Hash32WithSeed( - */ +*/ __pyx_v_result = util::Hash32WithSeed(__pyx_v_encoding, __pyx_v_encoding_size, __pyx_v_seed); /* "farmhash.pyx":167 @@ -3983,7 +3658,7 @@ static PyObject *__pyx_pf_8farmhash_4FarmHash32WithSeed(CYTHON_UNUSED PyObject * * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash32WithSeed(encoding, encoding_size, seed) - */ +*/ goto __pyx_L3; } @@ -3993,7 +3668,7 @@ static PyObject *__pyx_pf_8farmhash_4FarmHash32WithSeed(CYTHON_UNUSED PyObject * * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash32WithSeed( * PyBytes_AS_STRING(data), - */ +*/ __pyx_t_1 = PyBytes_Check(__pyx_v_data); if (__pyx_t_1) { @@ -4003,7 +3678,7 @@ static PyObject *__pyx_pf_8farmhash_4FarmHash32WithSeed(CYTHON_UNUSED PyObject * * result = c_Hash32WithSeed( # <<<<<<<<<<<<<< * PyBytes_AS_STRING(data), * PyBytes_GET_SIZE(data), seed) - */ +*/ __pyx_v_result = util::Hash32WithSeed(((char const *)PyBytes_AS_STRING(__pyx_v_data)), PyBytes_GET_SIZE(__pyx_v_data), __pyx_v_seed); /* "farmhash.pyx":170 @@ -4012,7 +3687,7 @@ static PyObject *__pyx_pf_8farmhash_4FarmHash32WithSeed(CYTHON_UNUSED PyObject * * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash32WithSeed( * PyBytes_AS_STRING(data), - */ +*/ goto __pyx_L3; } @@ -4022,7 +3697,7 @@ static PyObject *__pyx_pf_8farmhash_4FarmHash32WithSeed(CYTHON_UNUSED PyObject * * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash32WithSeed(buf.buf, buf.len, seed) - */ +*/ __pyx_t_1 = PyObject_CheckBuffer(__pyx_v_data); if (likely(__pyx_t_1)) { @@ -4032,7 +3707,7 @@ static PyObject *__pyx_pf_8farmhash_4FarmHash32WithSeed(CYTHON_UNUSED PyObject * * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * result = c_Hash32WithSeed(buf.buf, buf.len, seed) * PyBuffer_Release(&buf) - */ +*/ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 175, __pyx_L1_error) /* "farmhash.pyx":176 @@ -4041,7 +3716,7 @@ static PyObject *__pyx_pf_8farmhash_4FarmHash32WithSeed(CYTHON_UNUSED PyObject * * result = c_Hash32WithSeed(buf.buf, buf.len, seed) # <<<<<<<<<<<<<< * PyBuffer_Release(&buf) * else: - */ +*/ __pyx_v_result = util::Hash32WithSeed(((char const *)__pyx_v_buf.buf), __pyx_v_buf.len, __pyx_v_seed); /* "farmhash.pyx":177 @@ -4050,7 +3725,7 @@ static PyObject *__pyx_pf_8farmhash_4FarmHash32WithSeed(CYTHON_UNUSED PyObject * * PyBuffer_Release(&buf) # <<<<<<<<<<<<<< * else: * raise _type_error("data", ["basestring", "buffer"], data) - */ +*/ PyBuffer_Release((&__pyx_v_buf)); /* "farmhash.pyx":174 @@ -4059,7 +3734,7 @@ static PyObject *__pyx_pf_8farmhash_4FarmHash32WithSeed(CYTHON_UNUSED PyObject * * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash32WithSeed(buf.buf, buf.len, seed) - */ +*/ goto __pyx_L3; } @@ -4069,17 +3744,17 @@ static PyObject *__pyx_pf_8farmhash_4FarmHash32WithSeed(CYTHON_UNUSED PyObject * * raise _type_error("data", ["basestring", "buffer"], data) # <<<<<<<<<<<<<< * return result * - */ +*/ /*else*/ { __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_u_basestring); - __Pyx_GIVEREF(__pyx_n_u_basestring); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_basestring)) __PYX_ERR(0, 179, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_buffer); - __Pyx_GIVEREF(__pyx_n_u_buffer); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_u_buffer)) __PYX_ERR(0, 179, __pyx_L1_error); - __pyx_t_5 = __pyx_f_8farmhash__type_error(__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_basestring); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_basestring); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_n_u_basestring) != (0)) __PYX_ERR(0, 179, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_buffer); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_buffer); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_n_u_buffer) != (0)) __PYX_ERR(0, 179, __pyx_L1_error); + __pyx_t_5 = __pyx_f_8farmhash__type_error(__pyx_mstate_global->__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); @@ -4094,11 +3769,11 @@ static PyObject *__pyx_pf_8farmhash_4FarmHash32WithSeed(CYTHON_UNUSED PyObject * * return result # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_From_uint32_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_uint32_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 180, __pyx_L1_error) + if (!(likely(PyLong_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 180, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; @@ -4109,7 +3784,7 @@ static PyObject *__pyx_pf_8farmhash_4FarmHash32WithSeed(CYTHON_UNUSED PyObject * * def FarmHash32WithSeed(data, uint32_t seed=0U) -> int: # <<<<<<<<<<<<<< * """Obtain a 32-bit hash using a seed. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -4129,7 +3804,7 @@ static PyObject *__pyx_pf_8farmhash_4FarmHash32WithSeed(CYTHON_UNUSED PyObject * * def FarmHash64(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 64-bit hash from input data. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_8farmhash_7FarmHash64(PyObject *__pyx_self, @@ -4139,8 +3814,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8farmhash_6FarmHash64, "FarmHash64(data) -> int\nObtain a 64-bit hash from input data.\n\n :param data: input data (string, bytes, or buffer object)\n :return: an integer representing a 64-bit hash of the input\n :raises TypeError: if data is not of one of input types\n :raises ValueError: if input buffer is not C-contiguous\n "); -static PyMethodDef __pyx_mdef_8farmhash_7FarmHash64 = {"FarmHash64", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8farmhash_7FarmHash64, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8farmhash_6FarmHash64}; +PyDoc_STRVAR(__pyx_doc_8farmhash_6FarmHash64, "FarmHash64(data) -> int\n\nObtain a 64-bit hash from input data.\n\n:param data: input data (string, bytes, or buffer object)\n:return: an integer representing a 64-bit hash of the input\n:raises TypeError: if data is not of one of input types\n:raises ValueError: if input buffer is not C-contiguous"); +static PyMethodDef __pyx_mdef_8farmhash_7FarmHash64 = {"FarmHash64", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8farmhash_7FarmHash64, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8farmhash_6FarmHash64}; static PyObject *__pyx_pw_8farmhash_7FarmHash64(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4161,7 +3836,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("FarmHash64 (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -4169,33 +3844,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 183, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 183, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "FarmHash64") < 0)) __PYX_ERR(0, 183, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "FarmHash64", 0) < 0) __PYX_ERR(0, 183, __pyx_L3_error) + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("FarmHash64", 1, 1, 1, i); __PYX_ERR(0, 183, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 183, __pyx_L3_error) } __pyx_v_data = values[0]; } @@ -4205,11 +3875,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("farmhash.FarmHash64", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4218,11 +3885,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_8farmhash_6FarmHash64(__pyx_self, __pyx_v_data); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -4243,7 +3907,7 @@ static PyObject *__pyx_pf_8farmhash_6FarmHash64(CYTHON_UNUSED PyObject *__pyx_se int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("FarmHash64", 1); + __Pyx_RefNannySetupContext("FarmHash64", 0); /* "farmhash.pyx":194 * cdef uint64_t result @@ -4251,7 +3915,7 @@ static PyObject *__pyx_pf_8farmhash_6FarmHash64(CYTHON_UNUSED PyObject *__pyx_se * cdef Py_ssize_t encoding_size = 0 # <<<<<<<<<<<<<< * * if PyUnicode_Check(data): - */ +*/ __pyx_v_encoding_size = 0; /* "farmhash.pyx":196 @@ -4260,7 +3924,7 @@ static PyObject *__pyx_pf_8farmhash_6FarmHash64(CYTHON_UNUSED PyObject *__pyx_se * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash64(encoding, encoding_size) - */ +*/ __pyx_t_1 = PyUnicode_Check(__pyx_v_data); if (__pyx_t_1) { @@ -4270,8 +3934,8 @@ static PyObject *__pyx_pf_8farmhash_6FarmHash64(CYTHON_UNUSED PyObject *__pyx_se * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) # <<<<<<<<<<<<<< * result = c_Hash64(encoding, encoding_size) * elif PyBytes_Check(data): - */ - __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(0, 197, __pyx_L1_error) +*/ + __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)0))) __PYX_ERR(0, 197, __pyx_L1_error) __pyx_v_encoding = __pyx_t_2; /* "farmhash.pyx":198 @@ -4280,7 +3944,7 @@ static PyObject *__pyx_pf_8farmhash_6FarmHash64(CYTHON_UNUSED PyObject *__pyx_se * result = c_Hash64(encoding, encoding_size) # <<<<<<<<<<<<<< * elif PyBytes_Check(data): * result = c_Hash64( - */ +*/ __pyx_v_result = util::Hash64(__pyx_v_encoding, __pyx_v_encoding_size); /* "farmhash.pyx":196 @@ -4289,7 +3953,7 @@ static PyObject *__pyx_pf_8farmhash_6FarmHash64(CYTHON_UNUSED PyObject *__pyx_se * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash64(encoding, encoding_size) - */ +*/ goto __pyx_L3; } @@ -4299,7 +3963,7 @@ static PyObject *__pyx_pf_8farmhash_6FarmHash64(CYTHON_UNUSED PyObject *__pyx_se * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash64( * PyBytes_AS_STRING(data), - */ +*/ __pyx_t_1 = PyBytes_Check(__pyx_v_data); if (__pyx_t_1) { @@ -4309,7 +3973,7 @@ static PyObject *__pyx_pf_8farmhash_6FarmHash64(CYTHON_UNUSED PyObject *__pyx_se * result = c_Hash64( # <<<<<<<<<<<<<< * PyBytes_AS_STRING(data), * PyBytes_GET_SIZE(data)) - */ +*/ __pyx_v_result = util::Hash64(((char const *)PyBytes_AS_STRING(__pyx_v_data)), PyBytes_GET_SIZE(__pyx_v_data)); /* "farmhash.pyx":199 @@ -4318,7 +3982,7 @@ static PyObject *__pyx_pf_8farmhash_6FarmHash64(CYTHON_UNUSED PyObject *__pyx_se * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash64( * PyBytes_AS_STRING(data), - */ +*/ goto __pyx_L3; } @@ -4328,7 +3992,7 @@ static PyObject *__pyx_pf_8farmhash_6FarmHash64(CYTHON_UNUSED PyObject *__pyx_se * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash64(buf.buf, buf.len) - */ +*/ __pyx_t_1 = PyObject_CheckBuffer(__pyx_v_data); if (likely(__pyx_t_1)) { @@ -4338,7 +4002,7 @@ static PyObject *__pyx_pf_8farmhash_6FarmHash64(CYTHON_UNUSED PyObject *__pyx_se * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * result = c_Hash64(buf.buf, buf.len) * PyBuffer_Release(&buf) - */ +*/ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 204, __pyx_L1_error) /* "farmhash.pyx":205 @@ -4347,7 +4011,7 @@ static PyObject *__pyx_pf_8farmhash_6FarmHash64(CYTHON_UNUSED PyObject *__pyx_se * result = c_Hash64(buf.buf, buf.len) # <<<<<<<<<<<<<< * PyBuffer_Release(&buf) * else: - */ +*/ __pyx_v_result = util::Hash64(((char const *)__pyx_v_buf.buf), __pyx_v_buf.len); /* "farmhash.pyx":206 @@ -4356,7 +4020,7 @@ static PyObject *__pyx_pf_8farmhash_6FarmHash64(CYTHON_UNUSED PyObject *__pyx_se * PyBuffer_Release(&buf) # <<<<<<<<<<<<<< * else: * raise _type_error("data", ["basestring", "buffer"], data) - */ +*/ PyBuffer_Release((&__pyx_v_buf)); /* "farmhash.pyx":203 @@ -4365,7 +4029,7 @@ static PyObject *__pyx_pf_8farmhash_6FarmHash64(CYTHON_UNUSED PyObject *__pyx_se * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash64(buf.buf, buf.len) - */ +*/ goto __pyx_L3; } @@ -4375,17 +4039,17 @@ static PyObject *__pyx_pf_8farmhash_6FarmHash64(CYTHON_UNUSED PyObject *__pyx_se * raise _type_error("data", ["basestring", "buffer"], data) # <<<<<<<<<<<<<< * return result * - */ +*/ /*else*/ { __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_u_basestring); - __Pyx_GIVEREF(__pyx_n_u_basestring); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_basestring)) __PYX_ERR(0, 208, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_buffer); - __Pyx_GIVEREF(__pyx_n_u_buffer); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_u_buffer)) __PYX_ERR(0, 208, __pyx_L1_error); - __pyx_t_5 = __pyx_f_8farmhash__type_error(__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_basestring); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_basestring); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_n_u_basestring) != (0)) __PYX_ERR(0, 208, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_buffer); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_buffer); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_n_u_buffer) != (0)) __PYX_ERR(0, 208, __pyx_L1_error); + __pyx_t_5 = __pyx_f_8farmhash__type_error(__pyx_mstate_global->__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); @@ -4400,11 +4064,11 @@ static PyObject *__pyx_pf_8farmhash_6FarmHash64(CYTHON_UNUSED PyObject *__pyx_se * return result # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_From_uint64_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_uint64_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 209, __pyx_L1_error) + if (!(likely(PyLong_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 209, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; @@ -4415,7 +4079,7 @@ static PyObject *__pyx_pf_8farmhash_6FarmHash64(CYTHON_UNUSED PyObject *__pyx_se * def FarmHash64(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 64-bit hash from input data. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -4435,7 +4099,7 @@ static PyObject *__pyx_pf_8farmhash_6FarmHash64(CYTHON_UNUSED PyObject *__pyx_se * def Fingerprint64(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 64-bit hardware-independent fingerprint. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_8farmhash_9Fingerprint64(PyObject *__pyx_self, @@ -4445,8 +4109,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8farmhash_8Fingerprint64, "Fingerprint64(data) -> int\nObtain a 64-bit hardware-independent fingerprint.\n\n :param data: input data (string, bytes, or buffer object)\n :return: an integer representing a 64-bit hash of the input\n :raises TypeError: if data is not of one of input types\n :raises ValueError: if input buffer is not C-contiguous\n "); -static PyMethodDef __pyx_mdef_8farmhash_9Fingerprint64 = {"Fingerprint64", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8farmhash_9Fingerprint64, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8farmhash_8Fingerprint64}; +PyDoc_STRVAR(__pyx_doc_8farmhash_8Fingerprint64, "Fingerprint64(data) -> int\n\nObtain a 64-bit hardware-independent fingerprint.\n\n:param data: input data (string, bytes, or buffer object)\n:return: an integer representing a 64-bit hash of the input\n:raises TypeError: if data is not of one of input types\n:raises ValueError: if input buffer is not C-contiguous"); +static PyMethodDef __pyx_mdef_8farmhash_9Fingerprint64 = {"Fingerprint64", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8farmhash_9Fingerprint64, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8farmhash_8Fingerprint64}; static PyObject *__pyx_pw_8farmhash_9Fingerprint64(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4467,7 +4131,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("Fingerprint64 (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -4475,33 +4139,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 212, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 212, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "Fingerprint64") < 0)) __PYX_ERR(0, 212, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Fingerprint64", 0) < 0) __PYX_ERR(0, 212, __pyx_L3_error) + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Fingerprint64", 1, 1, 1, i); __PYX_ERR(0, 212, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 212, __pyx_L3_error) } __pyx_v_data = values[0]; } @@ -4511,11 +4170,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("farmhash.Fingerprint64", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4524,11 +4180,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_8farmhash_8Fingerprint64(__pyx_self, __pyx_v_data); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -4549,7 +4202,7 @@ static PyObject *__pyx_pf_8farmhash_8Fingerprint64(CYTHON_UNUSED PyObject *__pyx int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("Fingerprint64", 1); + __Pyx_RefNannySetupContext("Fingerprint64", 0); /* "farmhash.pyx":223 * cdef uint64_t result @@ -4557,7 +4210,7 @@ static PyObject *__pyx_pf_8farmhash_8Fingerprint64(CYTHON_UNUSED PyObject *__pyx * cdef Py_ssize_t encoding_size = 0 # <<<<<<<<<<<<<< * * if PyUnicode_Check(data): - */ +*/ __pyx_v_encoding_size = 0; /* "farmhash.pyx":225 @@ -4566,7 +4219,7 @@ static PyObject *__pyx_pf_8farmhash_8Fingerprint64(CYTHON_UNUSED PyObject *__pyx * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Fingerprint64(encoding, encoding_size) - */ +*/ __pyx_t_1 = PyUnicode_Check(__pyx_v_data); if (__pyx_t_1) { @@ -4576,8 +4229,8 @@ static PyObject *__pyx_pf_8farmhash_8Fingerprint64(CYTHON_UNUSED PyObject *__pyx * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) # <<<<<<<<<<<<<< * result = c_Fingerprint64(encoding, encoding_size) * elif PyBytes_Check(data): - */ - __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(0, 226, __pyx_L1_error) +*/ + __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)0))) __PYX_ERR(0, 226, __pyx_L1_error) __pyx_v_encoding = __pyx_t_2; /* "farmhash.pyx":227 @@ -4586,7 +4239,7 @@ static PyObject *__pyx_pf_8farmhash_8Fingerprint64(CYTHON_UNUSED PyObject *__pyx * result = c_Fingerprint64(encoding, encoding_size) # <<<<<<<<<<<<<< * elif PyBytes_Check(data): * result = c_Fingerprint64(PyBytes_AS_STRING(data), - */ +*/ __pyx_v_result = util::Fingerprint64(__pyx_v_encoding, __pyx_v_encoding_size); /* "farmhash.pyx":225 @@ -4595,7 +4248,7 @@ static PyObject *__pyx_pf_8farmhash_8Fingerprint64(CYTHON_UNUSED PyObject *__pyx * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Fingerprint64(encoding, encoding_size) - */ +*/ goto __pyx_L3; } @@ -4605,7 +4258,7 @@ static PyObject *__pyx_pf_8farmhash_8Fingerprint64(CYTHON_UNUSED PyObject *__pyx * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Fingerprint64(PyBytes_AS_STRING(data), * PyBytes_GET_SIZE(data)) - */ +*/ __pyx_t_1 = PyBytes_Check(__pyx_v_data); if (__pyx_t_1) { @@ -4615,7 +4268,7 @@ static PyObject *__pyx_pf_8farmhash_8Fingerprint64(CYTHON_UNUSED PyObject *__pyx * result = c_Fingerprint64(PyBytes_AS_STRING(data), # <<<<<<<<<<<<<< * PyBytes_GET_SIZE(data)) * elif PyObject_CheckBuffer(data): - */ +*/ __pyx_v_result = util::Fingerprint64(((char const *)PyBytes_AS_STRING(__pyx_v_data)), PyBytes_GET_SIZE(__pyx_v_data)); /* "farmhash.pyx":228 @@ -4624,7 +4277,7 @@ static PyObject *__pyx_pf_8farmhash_8Fingerprint64(CYTHON_UNUSED PyObject *__pyx * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Fingerprint64(PyBytes_AS_STRING(data), * PyBytes_GET_SIZE(data)) - */ +*/ goto __pyx_L3; } @@ -4634,7 +4287,7 @@ static PyObject *__pyx_pf_8farmhash_8Fingerprint64(CYTHON_UNUSED PyObject *__pyx * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Fingerprint64(buf.buf, buf.len) - */ +*/ __pyx_t_1 = PyObject_CheckBuffer(__pyx_v_data); if (likely(__pyx_t_1)) { @@ -4644,7 +4297,7 @@ static PyObject *__pyx_pf_8farmhash_8Fingerprint64(CYTHON_UNUSED PyObject *__pyx * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * result = c_Fingerprint64(buf.buf, buf.len) * PyBuffer_Release(&buf) - */ +*/ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 232, __pyx_L1_error) /* "farmhash.pyx":233 @@ -4653,7 +4306,7 @@ static PyObject *__pyx_pf_8farmhash_8Fingerprint64(CYTHON_UNUSED PyObject *__pyx * result = c_Fingerprint64(buf.buf, buf.len) # <<<<<<<<<<<<<< * PyBuffer_Release(&buf) * else: - */ +*/ __pyx_v_result = util::Fingerprint64(((char const *)__pyx_v_buf.buf), __pyx_v_buf.len); /* "farmhash.pyx":234 @@ -4662,7 +4315,7 @@ static PyObject *__pyx_pf_8farmhash_8Fingerprint64(CYTHON_UNUSED PyObject *__pyx * PyBuffer_Release(&buf) # <<<<<<<<<<<<<< * else: * raise _type_error("data", ["basestring", "buffer"], data) - */ +*/ PyBuffer_Release((&__pyx_v_buf)); /* "farmhash.pyx":231 @@ -4671,7 +4324,7 @@ static PyObject *__pyx_pf_8farmhash_8Fingerprint64(CYTHON_UNUSED PyObject *__pyx * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Fingerprint64(buf.buf, buf.len) - */ +*/ goto __pyx_L3; } @@ -4681,17 +4334,17 @@ static PyObject *__pyx_pf_8farmhash_8Fingerprint64(CYTHON_UNUSED PyObject *__pyx * raise _type_error("data", ["basestring", "buffer"], data) # <<<<<<<<<<<<<< * return result * - */ +*/ /*else*/ { __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_u_basestring); - __Pyx_GIVEREF(__pyx_n_u_basestring); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_basestring)) __PYX_ERR(0, 236, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_buffer); - __Pyx_GIVEREF(__pyx_n_u_buffer); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_u_buffer)) __PYX_ERR(0, 236, __pyx_L1_error); - __pyx_t_5 = __pyx_f_8farmhash__type_error(__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_basestring); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_basestring); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_n_u_basestring) != (0)) __PYX_ERR(0, 236, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_buffer); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_buffer); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_n_u_buffer) != (0)) __PYX_ERR(0, 236, __pyx_L1_error); + __pyx_t_5 = __pyx_f_8farmhash__type_error(__pyx_mstate_global->__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); @@ -4706,11 +4359,11 @@ static PyObject *__pyx_pf_8farmhash_8Fingerprint64(CYTHON_UNUSED PyObject *__pyx * return result # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_From_uint64_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_uint64_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 237, __pyx_L1_error) + if (!(likely(PyLong_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 237, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; @@ -4721,7 +4374,7 @@ static PyObject *__pyx_pf_8farmhash_8Fingerprint64(CYTHON_UNUSED PyObject *__pyx * def Fingerprint64(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 64-bit hardware-independent fingerprint. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -4741,7 +4394,7 @@ static PyObject *__pyx_pf_8farmhash_8Fingerprint64(CYTHON_UNUSED PyObject *__pyx * def FarmHash64WithSeed(data, uint64_t seed=0ULL) -> int: # <<<<<<<<<<<<<< * """Obtain a 64-bit hash using a seed. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_8farmhash_11FarmHash64WithSeed(PyObject *__pyx_self, @@ -4751,8 +4404,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8farmhash_10FarmHash64WithSeed, "FarmHash64WithSeed(data, uint64_t seed=0) -> int\nObtain a 64-bit hash using a seed.\n\n :param data: input data (string, bytes, or buffer object)\n :param seed: seed value (a 64-bit integer, defaults to 0)\n :return: an integer representing a 64-bit hash of the input\n :raises TypeError: if data is not of one of input types\n :raises ValueError: if input buffer is not C-contiguous\n :raises OverflowError: if seed cannot be converted to unsigned int64\n "); -static PyMethodDef __pyx_mdef_8farmhash_11FarmHash64WithSeed = {"FarmHash64WithSeed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8farmhash_11FarmHash64WithSeed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8farmhash_10FarmHash64WithSeed}; +PyDoc_STRVAR(__pyx_doc_8farmhash_10FarmHash64WithSeed, "FarmHash64WithSeed(data, uint64_t seed=0) -> int\n\nObtain a 64-bit hash using a seed.\n\n:param data: input data (string, bytes, or buffer object)\n:param seed: seed value (a 64-bit integer, defaults to 0)\n:return: an integer representing a 64-bit hash of the input\n:raises TypeError: if data is not of one of input types\n:raises ValueError: if input buffer is not C-contiguous\n:raises OverflowError: if seed cannot be converted to unsigned int64"); +static PyMethodDef __pyx_mdef_8farmhash_11FarmHash64WithSeed = {"FarmHash64WithSeed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8farmhash_11FarmHash64WithSeed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8farmhash_10FarmHash64WithSeed}; static PyObject *__pyx_pw_8farmhash_11FarmHash64WithSeed(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -4774,7 +4427,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("FarmHash64WithSeed (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -4782,50 +4435,43 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_seed,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,&__pyx_mstate_global->__pyx_n_u_seed,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 240, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 240, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 240, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_seed); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "FarmHash64WithSeed") < 0)) __PYX_ERR(0, 240, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "FarmHash64WithSeed", 0) < 0) __PYX_ERR(0, 240, __pyx_L3_error) + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("FarmHash64WithSeed", 0, 1, 2, i); __PYX_ERR(0, 240, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 240, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 240, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_data = values[0]; if (values[1]) { - __pyx_v_seed = __Pyx_PyInt_As_uint64_t(values[1]); if (unlikely((__pyx_v_seed == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L3_error) + __pyx_v_seed = __Pyx_PyLong_As_uint64_t(values[1]); if (unlikely((__pyx_v_seed == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L3_error) } else { __pyx_v_seed = ((uint64_t)0ULL); } @@ -4836,11 +4482,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("farmhash.FarmHash64WithSeed", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -4849,11 +4492,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_8farmhash_10FarmHash64WithSeed(__pyx_self, __pyx_v_data, __pyx_v_seed); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -4874,7 +4514,7 @@ static PyObject *__pyx_pf_8farmhash_10FarmHash64WithSeed(CYTHON_UNUSED PyObject int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("FarmHash64WithSeed", 1); + __Pyx_RefNannySetupContext("FarmHash64WithSeed", 0); /* "farmhash.pyx":253 * cdef uint64_t result @@ -4882,7 +4522,7 @@ static PyObject *__pyx_pf_8farmhash_10FarmHash64WithSeed(CYTHON_UNUSED PyObject * cdef Py_ssize_t encoding_size = 0 # <<<<<<<<<<<<<< * * if PyUnicode_Check(data): - */ +*/ __pyx_v_encoding_size = 0; /* "farmhash.pyx":255 @@ -4891,7 +4531,7 @@ static PyObject *__pyx_pf_8farmhash_10FarmHash64WithSeed(CYTHON_UNUSED PyObject * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash64WithSeed(encoding, encoding_size, seed) - */ +*/ __pyx_t_1 = PyUnicode_Check(__pyx_v_data); if (__pyx_t_1) { @@ -4901,8 +4541,8 @@ static PyObject *__pyx_pf_8farmhash_10FarmHash64WithSeed(CYTHON_UNUSED PyObject * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) # <<<<<<<<<<<<<< * result = c_Hash64WithSeed(encoding, encoding_size, seed) * elif PyBytes_Check(data): - */ - __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(0, 256, __pyx_L1_error) +*/ + __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)0))) __PYX_ERR(0, 256, __pyx_L1_error) __pyx_v_encoding = __pyx_t_2; /* "farmhash.pyx":257 @@ -4911,7 +4551,7 @@ static PyObject *__pyx_pf_8farmhash_10FarmHash64WithSeed(CYTHON_UNUSED PyObject * result = c_Hash64WithSeed(encoding, encoding_size, seed) # <<<<<<<<<<<<<< * elif PyBytes_Check(data): * result = c_Hash64WithSeed( - */ +*/ __pyx_v_result = util::Hash64WithSeed(__pyx_v_encoding, __pyx_v_encoding_size, __pyx_v_seed); /* "farmhash.pyx":255 @@ -4920,7 +4560,7 @@ static PyObject *__pyx_pf_8farmhash_10FarmHash64WithSeed(CYTHON_UNUSED PyObject * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash64WithSeed(encoding, encoding_size, seed) - */ +*/ goto __pyx_L3; } @@ -4930,7 +4570,7 @@ static PyObject *__pyx_pf_8farmhash_10FarmHash64WithSeed(CYTHON_UNUSED PyObject * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash64WithSeed( * PyBytes_AS_STRING(data), - */ +*/ __pyx_t_1 = PyBytes_Check(__pyx_v_data); if (__pyx_t_1) { @@ -4940,7 +4580,7 @@ static PyObject *__pyx_pf_8farmhash_10FarmHash64WithSeed(CYTHON_UNUSED PyObject * result = c_Hash64WithSeed( # <<<<<<<<<<<<<< * PyBytes_AS_STRING(data), * PyBytes_GET_SIZE(data), seed) - */ +*/ __pyx_v_result = util::Hash64WithSeed(((char const *)PyBytes_AS_STRING(__pyx_v_data)), PyBytes_GET_SIZE(__pyx_v_data), __pyx_v_seed); /* "farmhash.pyx":258 @@ -4949,7 +4589,7 @@ static PyObject *__pyx_pf_8farmhash_10FarmHash64WithSeed(CYTHON_UNUSED PyObject * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash64WithSeed( * PyBytes_AS_STRING(data), - */ +*/ goto __pyx_L3; } @@ -4959,7 +4599,7 @@ static PyObject *__pyx_pf_8farmhash_10FarmHash64WithSeed(CYTHON_UNUSED PyObject * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash64WithSeed(buf.buf, buf.len, seed) - */ +*/ __pyx_t_1 = PyObject_CheckBuffer(__pyx_v_data); if (likely(__pyx_t_1)) { @@ -4969,7 +4609,7 @@ static PyObject *__pyx_pf_8farmhash_10FarmHash64WithSeed(CYTHON_UNUSED PyObject * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * result = c_Hash64WithSeed(buf.buf, buf.len, seed) * PyBuffer_Release(&buf) - */ +*/ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 263, __pyx_L1_error) /* "farmhash.pyx":264 @@ -4978,7 +4618,7 @@ static PyObject *__pyx_pf_8farmhash_10FarmHash64WithSeed(CYTHON_UNUSED PyObject * result = c_Hash64WithSeed(buf.buf, buf.len, seed) # <<<<<<<<<<<<<< * PyBuffer_Release(&buf) * else: - */ +*/ __pyx_v_result = util::Hash64WithSeed(((char const *)__pyx_v_buf.buf), __pyx_v_buf.len, __pyx_v_seed); /* "farmhash.pyx":265 @@ -4987,7 +4627,7 @@ static PyObject *__pyx_pf_8farmhash_10FarmHash64WithSeed(CYTHON_UNUSED PyObject * PyBuffer_Release(&buf) # <<<<<<<<<<<<<< * else: * raise _type_error("data", ["basestring", "buffer"], data) - */ +*/ PyBuffer_Release((&__pyx_v_buf)); /* "farmhash.pyx":262 @@ -4996,7 +4636,7 @@ static PyObject *__pyx_pf_8farmhash_10FarmHash64WithSeed(CYTHON_UNUSED PyObject * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash64WithSeed(buf.buf, buf.len, seed) - */ +*/ goto __pyx_L3; } @@ -5006,17 +4646,17 @@ static PyObject *__pyx_pf_8farmhash_10FarmHash64WithSeed(CYTHON_UNUSED PyObject * raise _type_error("data", ["basestring", "buffer"], data) # <<<<<<<<<<<<<< * return result * - */ +*/ /*else*/ { __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_u_basestring); - __Pyx_GIVEREF(__pyx_n_u_basestring); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_basestring)) __PYX_ERR(0, 267, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_buffer); - __Pyx_GIVEREF(__pyx_n_u_buffer); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_u_buffer)) __PYX_ERR(0, 267, __pyx_L1_error); - __pyx_t_5 = __pyx_f_8farmhash__type_error(__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 267, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_basestring); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_basestring); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_n_u_basestring) != (0)) __PYX_ERR(0, 267, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_buffer); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_buffer); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_n_u_buffer) != (0)) __PYX_ERR(0, 267, __pyx_L1_error); + __pyx_t_5 = __pyx_f_8farmhash__type_error(__pyx_mstate_global->__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); @@ -5031,11 +4671,11 @@ static PyObject *__pyx_pf_8farmhash_10FarmHash64WithSeed(CYTHON_UNUSED PyObject * return result # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_From_uint64_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_uint64_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 268, __pyx_L1_error) + if (!(likely(PyLong_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 268, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; @@ -5046,7 +4686,7 @@ static PyObject *__pyx_pf_8farmhash_10FarmHash64WithSeed(CYTHON_UNUSED PyObject * def FarmHash64WithSeed(data, uint64_t seed=0ULL) -> int: # <<<<<<<<<<<<<< * """Obtain a 64-bit hash using a seed. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -5066,7 +4706,7 @@ static PyObject *__pyx_pf_8farmhash_10FarmHash64WithSeed(CYTHON_UNUSED PyObject * def FarmHash64WithSeeds(data, uint64_t seed0=0LL, uint64_t seed1=0LL) -> int: # <<<<<<<<<<<<<< * """Obtain a 64-bit hash using two seeds. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_8farmhash_13FarmHash64WithSeeds(PyObject *__pyx_self, @@ -5076,8 +4716,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8farmhash_12FarmHash64WithSeeds, "FarmHash64WithSeeds(data, uint64_t seed0=0, uint64_t seed1=0) -> int\nObtain a 64-bit hash using two seeds.\n\n :param data: input data (string, bytes, or buffer object)\n :param seed0: first seed (a 64-bit integer, defaults to 0)\n :param seed1: second seed (a 64-bit integer, defaults to 0)\n :return: an integer representing a 64-bit hash of the input\n :raises TypeError: if data is not of one of input types\n :raises ValueError: if input buffer is not C-contiguous\n :raises OverflowError: if seed cannot be converted to unsigned int64\n "); -static PyMethodDef __pyx_mdef_8farmhash_13FarmHash64WithSeeds = {"FarmHash64WithSeeds", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8farmhash_13FarmHash64WithSeeds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8farmhash_12FarmHash64WithSeeds}; +PyDoc_STRVAR(__pyx_doc_8farmhash_12FarmHash64WithSeeds, "FarmHash64WithSeeds(data, uint64_t seed0=0, uint64_t seed1=0) -> int\n\nObtain a 64-bit hash using two seeds.\n\n:param data: input data (string, bytes, or buffer object)\n:param seed0: first seed (a 64-bit integer, defaults to 0)\n:param seed1: second seed (a 64-bit integer, defaults to 0)\n:return: an integer representing a 64-bit hash of the input\n:raises TypeError: if data is not of one of input types\n:raises ValueError: if input buffer is not C-contiguous\n:raises OverflowError: if seed cannot be converted to unsigned int64"); +static PyMethodDef __pyx_mdef_8farmhash_13FarmHash64WithSeeds = {"FarmHash64WithSeeds", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8farmhash_13FarmHash64WithSeeds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8farmhash_12FarmHash64WithSeeds}; static PyObject *__pyx_pw_8farmhash_13FarmHash64WithSeeds(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -5100,7 +4740,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("FarmHash64WithSeeds (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -5108,66 +4748,56 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_seed0,&__pyx_n_s_seed1,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,&__pyx_mstate_global->__pyx_n_u_seed0,&__pyx_mstate_global->__pyx_n_u_seed1,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 271, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 271, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 271, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 271, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_seed0); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_seed1); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "FarmHash64WithSeeds") < 0)) __PYX_ERR(0, 271, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "FarmHash64WithSeeds", 0) < 0) __PYX_ERR(0, 271, __pyx_L3_error) + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("FarmHash64WithSeeds", 0, 1, 3, i); __PYX_ERR(0, 271, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + case 3: + values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 271, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 271, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 271, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_data = values[0]; if (values[1]) { - __pyx_v_seed0 = __Pyx_PyInt_As_uint64_t(values[1]); if (unlikely((__pyx_v_seed0 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error) + __pyx_v_seed0 = __Pyx_PyLong_As_uint64_t(values[1]); if (unlikely((__pyx_v_seed0 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error) } else { __pyx_v_seed0 = ((uint64_t)0LL); } if (values[2]) { - __pyx_v_seed1 = __Pyx_PyInt_As_uint64_t(values[2]); if (unlikely((__pyx_v_seed1 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error) + __pyx_v_seed1 = __Pyx_PyLong_As_uint64_t(values[2]); if (unlikely((__pyx_v_seed1 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error) } else { __pyx_v_seed1 = ((uint64_t)0LL); } @@ -5178,11 +4808,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("farmhash.FarmHash64WithSeeds", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5191,11 +4818,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_8farmhash_12FarmHash64WithSeeds(__pyx_self, __pyx_v_data, __pyx_v_seed0, __pyx_v_seed1); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -5216,7 +4840,7 @@ static PyObject *__pyx_pf_8farmhash_12FarmHash64WithSeeds(CYTHON_UNUSED PyObject int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("FarmHash64WithSeeds", 1); + __Pyx_RefNannySetupContext("FarmHash64WithSeeds", 0); /* "farmhash.pyx":285 * cdef uint64_t result @@ -5224,7 +4848,7 @@ static PyObject *__pyx_pf_8farmhash_12FarmHash64WithSeeds(CYTHON_UNUSED PyObject * cdef Py_ssize_t encoding_size = 0 # <<<<<<<<<<<<<< * * if PyUnicode_Check(data): - */ +*/ __pyx_v_encoding_size = 0; /* "farmhash.pyx":287 @@ -5233,7 +4857,7 @@ static PyObject *__pyx_pf_8farmhash_12FarmHash64WithSeeds(CYTHON_UNUSED PyObject * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash64WithSeeds(encoding, encoding_size, seed0, seed1) - */ +*/ __pyx_t_1 = PyUnicode_Check(__pyx_v_data); if (__pyx_t_1) { @@ -5243,8 +4867,8 @@ static PyObject *__pyx_pf_8farmhash_12FarmHash64WithSeeds(CYTHON_UNUSED PyObject * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) # <<<<<<<<<<<<<< * result = c_Hash64WithSeeds(encoding, encoding_size, seed0, seed1) * elif PyBytes_Check(data): - */ - __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(0, 288, __pyx_L1_error) +*/ + __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)0))) __PYX_ERR(0, 288, __pyx_L1_error) __pyx_v_encoding = __pyx_t_2; /* "farmhash.pyx":289 @@ -5253,7 +4877,7 @@ static PyObject *__pyx_pf_8farmhash_12FarmHash64WithSeeds(CYTHON_UNUSED PyObject * result = c_Hash64WithSeeds(encoding, encoding_size, seed0, seed1) # <<<<<<<<<<<<<< * elif PyBytes_Check(data): * result = c_Hash64WithSeeds( - */ +*/ __pyx_v_result = util::Hash64WithSeeds(__pyx_v_encoding, __pyx_v_encoding_size, __pyx_v_seed0, __pyx_v_seed1); /* "farmhash.pyx":287 @@ -5262,7 +4886,7 @@ static PyObject *__pyx_pf_8farmhash_12FarmHash64WithSeeds(CYTHON_UNUSED PyObject * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash64WithSeeds(encoding, encoding_size, seed0, seed1) - */ +*/ goto __pyx_L3; } @@ -5272,7 +4896,7 @@ static PyObject *__pyx_pf_8farmhash_12FarmHash64WithSeeds(CYTHON_UNUSED PyObject * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash64WithSeeds( * PyBytes_AS_STRING(data), - */ +*/ __pyx_t_1 = PyBytes_Check(__pyx_v_data); if (__pyx_t_1) { @@ -5282,7 +4906,7 @@ static PyObject *__pyx_pf_8farmhash_12FarmHash64WithSeeds(CYTHON_UNUSED PyObject * result = c_Hash64WithSeeds( # <<<<<<<<<<<<<< * PyBytes_AS_STRING(data), * PyBytes_GET_SIZE(data), seed0, seed1) - */ +*/ __pyx_v_result = util::Hash64WithSeeds(((char const *)PyBytes_AS_STRING(__pyx_v_data)), PyBytes_GET_SIZE(__pyx_v_data), __pyx_v_seed0, __pyx_v_seed1); /* "farmhash.pyx":290 @@ -5291,7 +4915,7 @@ static PyObject *__pyx_pf_8farmhash_12FarmHash64WithSeeds(CYTHON_UNUSED PyObject * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash64WithSeeds( * PyBytes_AS_STRING(data), - */ +*/ goto __pyx_L3; } @@ -5301,7 +4925,7 @@ static PyObject *__pyx_pf_8farmhash_12FarmHash64WithSeeds(CYTHON_UNUSED PyObject * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash64WithSeeds(buf.buf, buf.len, seed0, seed1) - */ +*/ __pyx_t_1 = PyObject_CheckBuffer(__pyx_v_data); if (likely(__pyx_t_1)) { @@ -5311,7 +4935,7 @@ static PyObject *__pyx_pf_8farmhash_12FarmHash64WithSeeds(CYTHON_UNUSED PyObject * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * result = c_Hash64WithSeeds(buf.buf, buf.len, seed0, seed1) * PyBuffer_Release(&buf) - */ +*/ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 295, __pyx_L1_error) /* "farmhash.pyx":296 @@ -5320,7 +4944,7 @@ static PyObject *__pyx_pf_8farmhash_12FarmHash64WithSeeds(CYTHON_UNUSED PyObject * result = c_Hash64WithSeeds(buf.buf, buf.len, seed0, seed1) # <<<<<<<<<<<<<< * PyBuffer_Release(&buf) * else: - */ +*/ __pyx_v_result = util::Hash64WithSeeds(((char const *)__pyx_v_buf.buf), __pyx_v_buf.len, __pyx_v_seed0, __pyx_v_seed1); /* "farmhash.pyx":297 @@ -5329,7 +4953,7 @@ static PyObject *__pyx_pf_8farmhash_12FarmHash64WithSeeds(CYTHON_UNUSED PyObject * PyBuffer_Release(&buf) # <<<<<<<<<<<<<< * else: * raise _type_error("data", ["basestring", "buffer"], data) - */ +*/ PyBuffer_Release((&__pyx_v_buf)); /* "farmhash.pyx":294 @@ -5338,7 +4962,7 @@ static PyObject *__pyx_pf_8farmhash_12FarmHash64WithSeeds(CYTHON_UNUSED PyObject * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash64WithSeeds(buf.buf, buf.len, seed0, seed1) - */ +*/ goto __pyx_L3; } @@ -5348,17 +4972,17 @@ static PyObject *__pyx_pf_8farmhash_12FarmHash64WithSeeds(CYTHON_UNUSED PyObject * raise _type_error("data", ["basestring", "buffer"], data) # <<<<<<<<<<<<<< * return result * - */ +*/ /*else*/ { __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_u_basestring); - __Pyx_GIVEREF(__pyx_n_u_basestring); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_basestring)) __PYX_ERR(0, 299, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_buffer); - __Pyx_GIVEREF(__pyx_n_u_buffer); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_u_buffer)) __PYX_ERR(0, 299, __pyx_L1_error); - __pyx_t_5 = __pyx_f_8farmhash__type_error(__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 299, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_basestring); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_basestring); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_n_u_basestring) != (0)) __PYX_ERR(0, 299, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_buffer); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_buffer); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_n_u_buffer) != (0)) __PYX_ERR(0, 299, __pyx_L1_error); + __pyx_t_5 = __pyx_f_8farmhash__type_error(__pyx_mstate_global->__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); @@ -5373,11 +4997,11 @@ static PyObject *__pyx_pf_8farmhash_12FarmHash64WithSeeds(CYTHON_UNUSED PyObject * return result # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_From_uint64_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_From_uint64_t(__pyx_v_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 300, __pyx_L1_error) + if (!(likely(PyLong_CheckExact(__pyx_t_5)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_5))) __PYX_ERR(0, 300, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; @@ -5388,7 +5012,7 @@ static PyObject *__pyx_pf_8farmhash_12FarmHash64WithSeeds(CYTHON_UNUSED PyObject * def FarmHash64WithSeeds(data, uint64_t seed0=0LL, uint64_t seed1=0LL) -> int: # <<<<<<<<<<<<<< * """Obtain a 64-bit hash using two seeds. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -5408,7 +5032,7 @@ static PyObject *__pyx_pf_8farmhash_12FarmHash64WithSeeds(CYTHON_UNUSED PyObject * def FarmHash128(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 128-bit hash from input data. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_8farmhash_15FarmHash128(PyObject *__pyx_self, @@ -5418,8 +5042,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8farmhash_14FarmHash128, "FarmHash128(data) -> int\nObtain a 128-bit hash from input data.\n\n :param data: input data (string, bytes, or buffer object)\n :return: an integer representing a 128-bit hash of the input\n :raises TypeError: if data is not of one of input types\n :raises ValueError: if input buffer is not C-contiguous\n "); -static PyMethodDef __pyx_mdef_8farmhash_15FarmHash128 = {"FarmHash128", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8farmhash_15FarmHash128, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8farmhash_14FarmHash128}; +PyDoc_STRVAR(__pyx_doc_8farmhash_14FarmHash128, "FarmHash128(data) -> int\n\nObtain a 128-bit hash from input data.\n\n:param data: input data (string, bytes, or buffer object)\n:return: an integer representing a 128-bit hash of the input\n:raises TypeError: if data is not of one of input types\n:raises ValueError: if input buffer is not C-contiguous"); +static PyMethodDef __pyx_mdef_8farmhash_15FarmHash128 = {"FarmHash128", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8farmhash_15FarmHash128, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8farmhash_14FarmHash128}; static PyObject *__pyx_pw_8farmhash_15FarmHash128(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -5440,7 +5064,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("FarmHash128 (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -5448,33 +5072,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 303, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 303, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "FarmHash128") < 0)) __PYX_ERR(0, 303, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "FarmHash128", 0) < 0) __PYX_ERR(0, 303, __pyx_L3_error) + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("FarmHash128", 1, 1, 1, i); __PYX_ERR(0, 303, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 303, __pyx_L3_error) } __pyx_v_data = values[0]; } @@ -5484,11 +5103,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("farmhash.FarmHash128", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5497,11 +5113,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_8farmhash_14FarmHash128(__pyx_self, __pyx_v_data); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -5524,7 +5137,7 @@ static PyObject *__pyx_pf_8farmhash_14FarmHash128(CYTHON_UNUSED PyObject *__pyx_ int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("FarmHash128", 1); + __Pyx_RefNannySetupContext("FarmHash128", 0); /* "farmhash.pyx":314 * cdef pair[uint64_t, uint64_t] result @@ -5532,7 +5145,7 @@ static PyObject *__pyx_pf_8farmhash_14FarmHash128(CYTHON_UNUSED PyObject *__pyx_ * cdef Py_ssize_t encoding_size = 0 # <<<<<<<<<<<<<< * * if PyUnicode_Check(data): - */ +*/ __pyx_v_encoding_size = 0; /* "farmhash.pyx":316 @@ -5541,7 +5154,7 @@ static PyObject *__pyx_pf_8farmhash_14FarmHash128(CYTHON_UNUSED PyObject *__pyx_ * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash128(encoding, encoding_size) - */ +*/ __pyx_t_1 = PyUnicode_Check(__pyx_v_data); if (__pyx_t_1) { @@ -5551,8 +5164,8 @@ static PyObject *__pyx_pf_8farmhash_14FarmHash128(CYTHON_UNUSED PyObject *__pyx_ * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) # <<<<<<<<<<<<<< * result = c_Hash128(encoding, encoding_size) * elif PyBytes_Check(data): - */ - __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(0, 317, __pyx_L1_error) +*/ + __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)0))) __PYX_ERR(0, 317, __pyx_L1_error) __pyx_v_encoding = __pyx_t_2; /* "farmhash.pyx":318 @@ -5561,7 +5174,7 @@ static PyObject *__pyx_pf_8farmhash_14FarmHash128(CYTHON_UNUSED PyObject *__pyx_ * result = c_Hash128(encoding, encoding_size) # <<<<<<<<<<<<<< * elif PyBytes_Check(data): * result = c_Hash128( - */ +*/ __pyx_v_result = util::Hash128(__pyx_v_encoding, __pyx_v_encoding_size); /* "farmhash.pyx":316 @@ -5570,7 +5183,7 @@ static PyObject *__pyx_pf_8farmhash_14FarmHash128(CYTHON_UNUSED PyObject *__pyx_ * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash128(encoding, encoding_size) - */ +*/ goto __pyx_L3; } @@ -5580,7 +5193,7 @@ static PyObject *__pyx_pf_8farmhash_14FarmHash128(CYTHON_UNUSED PyObject *__pyx_ * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash128( * PyBytes_AS_STRING(data), - */ +*/ __pyx_t_1 = PyBytes_Check(__pyx_v_data); if (__pyx_t_1) { @@ -5590,7 +5203,7 @@ static PyObject *__pyx_pf_8farmhash_14FarmHash128(CYTHON_UNUSED PyObject *__pyx_ * result = c_Hash128( # <<<<<<<<<<<<<< * PyBytes_AS_STRING(data), * PyBytes_GET_SIZE(data)) - */ +*/ __pyx_v_result = util::Hash128(((char const *)PyBytes_AS_STRING(__pyx_v_data)), PyBytes_GET_SIZE(__pyx_v_data)); /* "farmhash.pyx":319 @@ -5599,7 +5212,7 @@ static PyObject *__pyx_pf_8farmhash_14FarmHash128(CYTHON_UNUSED PyObject *__pyx_ * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash128( * PyBytes_AS_STRING(data), - */ +*/ goto __pyx_L3; } @@ -5609,7 +5222,7 @@ static PyObject *__pyx_pf_8farmhash_14FarmHash128(CYTHON_UNUSED PyObject *__pyx_ * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash128(buf.buf, buf.len) - */ +*/ __pyx_t_1 = PyObject_CheckBuffer(__pyx_v_data); if (likely(__pyx_t_1)) { @@ -5619,7 +5232,7 @@ static PyObject *__pyx_pf_8farmhash_14FarmHash128(CYTHON_UNUSED PyObject *__pyx_ * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * result = c_Hash128(buf.buf, buf.len) * PyBuffer_Release(&buf) - */ +*/ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 324, __pyx_L1_error) /* "farmhash.pyx":325 @@ -5628,7 +5241,7 @@ static PyObject *__pyx_pf_8farmhash_14FarmHash128(CYTHON_UNUSED PyObject *__pyx_ * result = c_Hash128(buf.buf, buf.len) # <<<<<<<<<<<<<< * PyBuffer_Release(&buf) * else: - */ +*/ __pyx_v_result = util::Hash128(((char const *)__pyx_v_buf.buf), __pyx_v_buf.len); /* "farmhash.pyx":326 @@ -5637,7 +5250,7 @@ static PyObject *__pyx_pf_8farmhash_14FarmHash128(CYTHON_UNUSED PyObject *__pyx_ * PyBuffer_Release(&buf) # <<<<<<<<<<<<<< * else: * raise _type_error("data", ["basestring", "buffer"], data) - */ +*/ PyBuffer_Release((&__pyx_v_buf)); /* "farmhash.pyx":323 @@ -5646,7 +5259,7 @@ static PyObject *__pyx_pf_8farmhash_14FarmHash128(CYTHON_UNUSED PyObject *__pyx_ * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash128(buf.buf, buf.len) - */ +*/ goto __pyx_L3; } @@ -5656,17 +5269,17 @@ static PyObject *__pyx_pf_8farmhash_14FarmHash128(CYTHON_UNUSED PyObject *__pyx_ * raise _type_error("data", ["basestring", "buffer"], data) # <<<<<<<<<<<<<< * first = PyLong_FromUnsignedLongLong(result.first) * second = PyLong_FromUnsignedLongLong(result.second) - */ +*/ /*else*/ { __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_u_basestring); - __Pyx_GIVEREF(__pyx_n_u_basestring); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_basestring)) __PYX_ERR(0, 328, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_buffer); - __Pyx_GIVEREF(__pyx_n_u_buffer); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_u_buffer)) __PYX_ERR(0, 328, __pyx_L1_error); - __pyx_t_5 = __pyx_f_8farmhash__type_error(__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_basestring); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_basestring); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_n_u_basestring) != (0)) __PYX_ERR(0, 328, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_buffer); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_buffer); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_n_u_buffer) != (0)) __PYX_ERR(0, 328, __pyx_L1_error); + __pyx_t_5 = __pyx_f_8farmhash__type_error(__pyx_mstate_global->__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); @@ -5681,7 +5294,7 @@ static PyObject *__pyx_pf_8farmhash_14FarmHash128(CYTHON_UNUSED PyObject *__pyx_ * first = PyLong_FromUnsignedLongLong(result.first) # <<<<<<<<<<<<<< * second = PyLong_FromUnsignedLongLong(result.second) * return (first << 64ULL) + second - */ +*/ __pyx_t_5 = PyLong_FromUnsignedLongLong(__pyx_v_result.first); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_t_5; @@ -5696,7 +5309,7 @@ static PyObject *__pyx_pf_8farmhash_14FarmHash128(CYTHON_UNUSED PyObject *__pyx_ * second = PyLong_FromUnsignedLongLong(result.second) # <<<<<<<<<<<<<< * return (first << 64ULL) + second * - */ +*/ __pyx_t_4 = PyLong_FromUnsignedLongLong(__pyx_v_result.second); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_t_4; @@ -5711,14 +5324,14 @@ static PyObject *__pyx_pf_8farmhash_14FarmHash128(CYTHON_UNUSED PyObject *__pyx_ * return (first << 64ULL) + second # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyNumber_Lshift(__pyx_v_first, __pyx_int_64L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_5 = PyNumber_Lshift(__pyx_v_first, __pyx_mstate_global->__pyx_int_64L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_v_second); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_4))) __PYX_ERR(0, 331, __pyx_L1_error) + if (!(likely(PyLong_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_4))) __PYX_ERR(0, 331, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; @@ -5729,7 +5342,7 @@ static PyObject *__pyx_pf_8farmhash_14FarmHash128(CYTHON_UNUSED PyObject *__pyx_ * def FarmHash128(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 128-bit hash from input data. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -5751,7 +5364,7 @@ static PyObject *__pyx_pf_8farmhash_14FarmHash128(CYTHON_UNUSED PyObject *__pyx_ * def Fingerprint128(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 128-bit hardware-independent fingerprint. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_8farmhash_17Fingerprint128(PyObject *__pyx_self, @@ -5761,8 +5374,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8farmhash_16Fingerprint128, "Fingerprint128(data) -> int\nObtain a 128-bit hardware-independent fingerprint.\n\n :param data: input data (string, bytes, or buffer object)\n :return: an integer representing a 128-bit hash of the input\n :raises TypeError: if data is not of one of input types\n :raises ValueError: if input buffer is not C-contiguous\n "); -static PyMethodDef __pyx_mdef_8farmhash_17Fingerprint128 = {"Fingerprint128", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8farmhash_17Fingerprint128, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8farmhash_16Fingerprint128}; +PyDoc_STRVAR(__pyx_doc_8farmhash_16Fingerprint128, "Fingerprint128(data) -> int\n\nObtain a 128-bit hardware-independent fingerprint.\n\n:param data: input data (string, bytes, or buffer object)\n:return: an integer representing a 128-bit hash of the input\n:raises TypeError: if data is not of one of input types\n:raises ValueError: if input buffer is not C-contiguous"); +static PyMethodDef __pyx_mdef_8farmhash_17Fingerprint128 = {"Fingerprint128", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8farmhash_17Fingerprint128, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8farmhash_16Fingerprint128}; static PyObject *__pyx_pw_8farmhash_17Fingerprint128(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -5783,7 +5396,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("Fingerprint128 (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -5791,33 +5404,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 334, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 334, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 334, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "Fingerprint128") < 0)) __PYX_ERR(0, 334, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "Fingerprint128", 0) < 0) __PYX_ERR(0, 334, __pyx_L3_error) + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("Fingerprint128", 1, 1, 1, i); __PYX_ERR(0, 334, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 334, __pyx_L3_error) } __pyx_v_data = values[0]; } @@ -5827,11 +5435,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("farmhash.Fingerprint128", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5840,11 +5445,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_r = __pyx_pf_8farmhash_16Fingerprint128(__pyx_self, __pyx_v_data); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_RefNannyFinishContext(); return __pyx_r; @@ -5867,7 +5469,7 @@ static PyObject *__pyx_pf_8farmhash_16Fingerprint128(CYTHON_UNUSED PyObject *__p int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("Fingerprint128", 1); + __Pyx_RefNannySetupContext("Fingerprint128", 0); /* "farmhash.pyx":345 * cdef pair[uint64_t, uint64_t] result @@ -5875,7 +5477,7 @@ static PyObject *__pyx_pf_8farmhash_16Fingerprint128(CYTHON_UNUSED PyObject *__p * cdef Py_ssize_t encoding_size = 0 # <<<<<<<<<<<<<< * * if PyUnicode_Check(data): - */ +*/ __pyx_v_encoding_size = 0; /* "farmhash.pyx":347 @@ -5884,7 +5486,7 @@ static PyObject *__pyx_pf_8farmhash_16Fingerprint128(CYTHON_UNUSED PyObject *__p * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Fingerprint128(encoding, encoding_size) - */ +*/ __pyx_t_1 = PyUnicode_Check(__pyx_v_data); if (__pyx_t_1) { @@ -5894,8 +5496,8 @@ static PyObject *__pyx_pf_8farmhash_16Fingerprint128(CYTHON_UNUSED PyObject *__p * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) # <<<<<<<<<<<<<< * result = c_Fingerprint128(encoding, encoding_size) * elif PyBytes_Check(data): - */ - __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)NULL))) __PYX_ERR(0, 348, __pyx_L1_error) +*/ + __pyx_t_2 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_2 == ((char const *)0))) __PYX_ERR(0, 348, __pyx_L1_error) __pyx_v_encoding = __pyx_t_2; /* "farmhash.pyx":349 @@ -5904,7 +5506,7 @@ static PyObject *__pyx_pf_8farmhash_16Fingerprint128(CYTHON_UNUSED PyObject *__p * result = c_Fingerprint128(encoding, encoding_size) # <<<<<<<<<<<<<< * elif PyBytes_Check(data): * result = c_Fingerprint128( - */ +*/ __pyx_v_result = util::Fingerprint128(__pyx_v_encoding, __pyx_v_encoding_size); /* "farmhash.pyx":347 @@ -5913,7 +5515,7 @@ static PyObject *__pyx_pf_8farmhash_16Fingerprint128(CYTHON_UNUSED PyObject *__p * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Fingerprint128(encoding, encoding_size) - */ +*/ goto __pyx_L3; } @@ -5923,7 +5525,7 @@ static PyObject *__pyx_pf_8farmhash_16Fingerprint128(CYTHON_UNUSED PyObject *__p * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Fingerprint128( * PyBytes_AS_STRING(data), - */ +*/ __pyx_t_1 = PyBytes_Check(__pyx_v_data); if (__pyx_t_1) { @@ -5933,7 +5535,7 @@ static PyObject *__pyx_pf_8farmhash_16Fingerprint128(CYTHON_UNUSED PyObject *__p * result = c_Fingerprint128( # <<<<<<<<<<<<<< * PyBytes_AS_STRING(data), * PyBytes_GET_SIZE(data)) - */ +*/ __pyx_v_result = util::Fingerprint128(((char const *)PyBytes_AS_STRING(__pyx_v_data)), PyBytes_GET_SIZE(__pyx_v_data)); /* "farmhash.pyx":350 @@ -5942,7 +5544,7 @@ static PyObject *__pyx_pf_8farmhash_16Fingerprint128(CYTHON_UNUSED PyObject *__p * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Fingerprint128( * PyBytes_AS_STRING(data), - */ +*/ goto __pyx_L3; } @@ -5952,7 +5554,7 @@ static PyObject *__pyx_pf_8farmhash_16Fingerprint128(CYTHON_UNUSED PyObject *__p * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Fingerprint128(buf.buf, buf.len) - */ +*/ __pyx_t_1 = PyObject_CheckBuffer(__pyx_v_data); if (likely(__pyx_t_1)) { @@ -5962,7 +5564,7 @@ static PyObject *__pyx_pf_8farmhash_16Fingerprint128(CYTHON_UNUSED PyObject *__p * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * result = c_Fingerprint128(buf.buf, buf.len) * PyBuffer_Release(&buf) - */ +*/ __pyx_t_3 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 355, __pyx_L1_error) /* "farmhash.pyx":356 @@ -5971,7 +5573,7 @@ static PyObject *__pyx_pf_8farmhash_16Fingerprint128(CYTHON_UNUSED PyObject *__p * result = c_Fingerprint128(buf.buf, buf.len) # <<<<<<<<<<<<<< * PyBuffer_Release(&buf) * else: - */ +*/ __pyx_v_result = util::Fingerprint128(((char const *)__pyx_v_buf.buf), __pyx_v_buf.len); /* "farmhash.pyx":357 @@ -5980,7 +5582,7 @@ static PyObject *__pyx_pf_8farmhash_16Fingerprint128(CYTHON_UNUSED PyObject *__p * PyBuffer_Release(&buf) # <<<<<<<<<<<<<< * else: * raise _type_error("data", ["basestring", "buffer"], data) - */ +*/ PyBuffer_Release((&__pyx_v_buf)); /* "farmhash.pyx":354 @@ -5989,7 +5591,7 @@ static PyObject *__pyx_pf_8farmhash_16Fingerprint128(CYTHON_UNUSED PyObject *__p * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Fingerprint128(buf.buf, buf.len) - */ +*/ goto __pyx_L3; } @@ -5999,17 +5601,17 @@ static PyObject *__pyx_pf_8farmhash_16Fingerprint128(CYTHON_UNUSED PyObject *__p * raise _type_error("data", ["basestring", "buffer"], data) # <<<<<<<<<<<<<< * first = PyLong_FromUnsignedLongLong(result.first) * second = PyLong_FromUnsignedLongLong(result.second) - */ +*/ /*else*/ { __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_n_u_basestring); - __Pyx_GIVEREF(__pyx_n_u_basestring); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_u_basestring)) __PYX_ERR(0, 359, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_buffer); - __Pyx_GIVEREF(__pyx_n_u_buffer); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_n_u_buffer)) __PYX_ERR(0, 359, __pyx_L1_error); - __pyx_t_5 = __pyx_f_8farmhash__type_error(__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_basestring); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_basestring); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_mstate_global->__pyx_n_u_basestring) != (0)) __PYX_ERR(0, 359, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_buffer); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_buffer); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_mstate_global->__pyx_n_u_buffer) != (0)) __PYX_ERR(0, 359, __pyx_L1_error); + __pyx_t_5 = __pyx_f_8farmhash__type_error(__pyx_mstate_global->__pyx_n_u_data, __pyx_t_4, __pyx_v_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0, 0); @@ -6024,7 +5626,7 @@ static PyObject *__pyx_pf_8farmhash_16Fingerprint128(CYTHON_UNUSED PyObject *__p * first = PyLong_FromUnsignedLongLong(result.first) # <<<<<<<<<<<<<< * second = PyLong_FromUnsignedLongLong(result.second) * return (first << 64ULL) + second - */ +*/ __pyx_t_5 = PyLong_FromUnsignedLongLong(__pyx_v_result.first); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = __pyx_t_5; @@ -6039,7 +5641,7 @@ static PyObject *__pyx_pf_8farmhash_16Fingerprint128(CYTHON_UNUSED PyObject *__p * second = PyLong_FromUnsignedLongLong(result.second) # <<<<<<<<<<<<<< * return (first << 64ULL) + second * - */ +*/ __pyx_t_4 = PyLong_FromUnsignedLongLong(__pyx_v_result.second); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_t_4; @@ -6054,14 +5656,14 @@ static PyObject *__pyx_pf_8farmhash_16Fingerprint128(CYTHON_UNUSED PyObject *__p * return (first << 64ULL) + second # <<<<<<<<<<<<<< * * - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyNumber_Lshift(__pyx_v_first, __pyx_int_64L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 362, __pyx_L1_error) + __pyx_t_5 = PyNumber_Lshift(__pyx_v_first, __pyx_mstate_global->__pyx_int_64L); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_v_second); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_4))) __PYX_ERR(0, 362, __pyx_L1_error) + if (!(likely(PyLong_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_4))) __PYX_ERR(0, 362, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; @@ -6072,7 +5674,7 @@ static PyObject *__pyx_pf_8farmhash_16Fingerprint128(CYTHON_UNUSED PyObject *__p * def Fingerprint128(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 128-bit hardware-independent fingerprint. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -6094,7 +5696,7 @@ static PyObject *__pyx_pf_8farmhash_16Fingerprint128(CYTHON_UNUSED PyObject *__p * def FarmHash128WithSeed(data, seed: int = 0L) -> int: # <<<<<<<<<<<<<< * """Obtain a 128-bit hash using a seed. * - */ +*/ /* Python wrapper */ static PyObject *__pyx_pw_8farmhash_19FarmHash128WithSeed(PyObject *__pyx_self, @@ -6104,8 +5706,8 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_8farmhash_18FarmHash128WithSeed, "FarmHash128WithSeed(data, int seed: int = 0) -> int\nObtain a 128-bit hash using a seed.\n\n :param data: input data (string, bytes, or buffer object)\n :param seed: seed value (defaults to 0)\n :return: an integer representing a 128-bit hash of the input\n :raises TypeError: if data is not of one of input types\n :raises ValueError: if input buffer is not C-contiguous\n "); -static PyMethodDef __pyx_mdef_8farmhash_19FarmHash128WithSeed = {"FarmHash128WithSeed", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8farmhash_19FarmHash128WithSeed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8farmhash_18FarmHash128WithSeed}; +PyDoc_STRVAR(__pyx_doc_8farmhash_18FarmHash128WithSeed, "FarmHash128WithSeed(data, int seed: int = 0) -> int\n\nObtain a 128-bit hash using a seed.\n\n:param data: input data (string, bytes, or buffer object)\n:param seed: seed value (defaults to 0)\n:return: an integer representing a 128-bit hash of the input\n:raises TypeError: if data is not of one of input types\n:raises ValueError: if input buffer is not C-contiguous"); +static PyMethodDef __pyx_mdef_8farmhash_19FarmHash128WithSeed = {"FarmHash128WithSeed", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_8farmhash_19FarmHash128WithSeed, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_8farmhash_18FarmHash128WithSeed}; static PyObject *__pyx_pw_8farmhash_19FarmHash128WithSeed(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds @@ -6127,7 +5729,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("FarmHash128WithSeed (wrapper)", 0); #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS + #if CYTHON_ASSUME_SAFE_SIZE __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); #else __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; @@ -6135,47 +5737,41 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_seed,0}; - values[1] = __Pyx_Arg_NewRef_FASTCALL(__pyx_k_); - if (__pyx_kwds) { - Py_ssize_t kw_args; + PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,&__pyx_mstate_global->__pyx_n_u_seed,0}; + const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 365, __pyx_L3_error) + if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 365, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 365, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_data)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_seed); - if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "FarmHash128WithSeed") < 0)) __PYX_ERR(0, 365, __pyx_L3_error) + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "FarmHash128WithSeed", 0) < 0) __PYX_ERR(0, 365, __pyx_L3_error) + if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_int_0L)); + for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("FarmHash128WithSeed", 0, 1, 2, i); __PYX_ERR(0, 365, __pyx_L3_error) } } } else { switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + case 2: + values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 365, __pyx_L3_error) CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + case 1: + values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 365, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } + if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_int_0L)); } __pyx_v_data = values[0]; __pyx_v_seed = ((PyObject*)values[1]); @@ -6186,30 +5782,29 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } __Pyx_AddTraceback("farmhash.FarmHash128WithSeed", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_seed), (&PyInt_Type), 0, "seed", 1))) __PYX_ERR(0, 365, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_seed), (&PyLong_Type), 0, "seed", 2))) __PYX_ERR(0, 365, __pyx_L1_error) __pyx_r = __pyx_pf_8farmhash_18FarmHash128WithSeed(__pyx_self, __pyx_v_data, __pyx_v_seed); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = NULL; + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); + } + goto __pyx_L7_cleaned_up; __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + Py_XDECREF(values[__pyx_temp]); } + __pyx_L7_cleaned_up:; __Pyx_RefNannyFinishContext(); return __pyx_r; } @@ -6233,7 +5828,7 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("FarmHash128WithSeed", 1); + __Pyx_RefNannySetupContext("FarmHash128WithSeed", 0); /* "farmhash.pyx":378 * cdef pair[uint64_t, uint64_t] tseed @@ -6241,7 +5836,7 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject * cdef Py_ssize_t encoding_size = 0 # <<<<<<<<<<<<<< * * tseed.first = seed >> 64ULL - */ +*/ __pyx_v_encoding_size = 0; /* "farmhash.pyx":380 @@ -6250,10 +5845,10 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject * tseed.first = seed >> 64ULL # <<<<<<<<<<<<<< * tseed.second = seed & ((1ULL << 64ULL) - 1ULL) * - */ - __pyx_t_1 = PyNumber_Rshift(__pyx_v_seed, __pyx_int_64L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) +*/ + __pyx_t_1 = PyNumber_Rshift(__pyx_v_seed, __pyx_mstate_global->__pyx_int_64L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tseed.first = __pyx_t_2; @@ -6263,10 +5858,10 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject * tseed.second = seed & ((1ULL << 64ULL) - 1ULL) # <<<<<<<<<<<<<< * * if PyUnicode_Check(data): - */ - __pyx_t_1 = PyNumber_And(__pyx_v_seed, __pyx_int_0xffffffffffffffffL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) +*/ + __pyx_t_1 = PyNumber_And(__pyx_v_seed, __pyx_mstate_global->__pyx_int_0xffffffffffffffffL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 381, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tseed.second = __pyx_t_2; @@ -6276,7 +5871,7 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash128WithSeed(encoding, encoding_size, tseed) - */ +*/ __pyx_t_3 = PyUnicode_Check(__pyx_v_data); if (__pyx_t_3) { @@ -6286,8 +5881,8 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) # <<<<<<<<<<<<<< * result = c_Hash128WithSeed(encoding, encoding_size, tseed) * elif PyBytes_Check(data): - */ - __pyx_t_4 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_4 == ((char const *)NULL))) __PYX_ERR(0, 384, __pyx_L1_error) +*/ + __pyx_t_4 = PyUnicode_AsUTF8AndSize(__pyx_v_data, (&__pyx_v_encoding_size)); if (unlikely(__pyx_t_4 == ((char const *)0))) __PYX_ERR(0, 384, __pyx_L1_error) __pyx_v_encoding = __pyx_t_4; /* "farmhash.pyx":385 @@ -6296,7 +5891,7 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject * result = c_Hash128WithSeed(encoding, encoding_size, tseed) # <<<<<<<<<<<<<< * elif PyBytes_Check(data): * result = c_Hash128WithSeed( - */ +*/ __pyx_v_result = util::Hash128WithSeed(__pyx_v_encoding, __pyx_v_encoding_size, __pyx_v_tseed); /* "farmhash.pyx":383 @@ -6305,7 +5900,7 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject * if PyUnicode_Check(data): # <<<<<<<<<<<<<< * encoding = PyUnicode_AsUTF8AndSize(data, &encoding_size) * result = c_Hash128WithSeed(encoding, encoding_size, tseed) - */ +*/ goto __pyx_L3; } @@ -6315,7 +5910,7 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash128WithSeed( * PyBytes_AS_STRING(data), - */ +*/ __pyx_t_3 = PyBytes_Check(__pyx_v_data); if (__pyx_t_3) { @@ -6325,7 +5920,7 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject * result = c_Hash128WithSeed( # <<<<<<<<<<<<<< * PyBytes_AS_STRING(data), * PyBytes_GET_SIZE(data), tseed) - */ +*/ __pyx_v_result = util::Hash128WithSeed(((char const *)PyBytes_AS_STRING(__pyx_v_data)), PyBytes_GET_SIZE(__pyx_v_data), __pyx_v_tseed); /* "farmhash.pyx":386 @@ -6334,7 +5929,7 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject * elif PyBytes_Check(data): # <<<<<<<<<<<<<< * result = c_Hash128WithSeed( * PyBytes_AS_STRING(data), - */ +*/ goto __pyx_L3; } @@ -6344,7 +5939,7 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash128WithSeed(buf.buf, buf.len, tseed) - */ +*/ __pyx_t_3 = PyObject_CheckBuffer(__pyx_v_data); if (likely(__pyx_t_3)) { @@ -6354,7 +5949,7 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) # <<<<<<<<<<<<<< * result = c_Hash128WithSeed(buf.buf, buf.len, tseed) * PyBuffer_Release(&buf) - */ +*/ __pyx_t_5 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 391, __pyx_L1_error) /* "farmhash.pyx":392 @@ -6363,7 +5958,7 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject * result = c_Hash128WithSeed(buf.buf, buf.len, tseed) # <<<<<<<<<<<<<< * PyBuffer_Release(&buf) * else: - */ +*/ __pyx_v_result = util::Hash128WithSeed(((char const *)__pyx_v_buf.buf), __pyx_v_buf.len, __pyx_v_tseed); /* "farmhash.pyx":393 @@ -6372,7 +5967,7 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject * PyBuffer_Release(&buf) # <<<<<<<<<<<<<< * else: * raise _type_error("data", ["basestring", "buffer"], data) - */ +*/ PyBuffer_Release((&__pyx_v_buf)); /* "farmhash.pyx":390 @@ -6381,7 +5976,7 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject * elif PyObject_CheckBuffer(data): # <<<<<<<<<<<<<< * PyObject_GetBuffer(data, &buf, PyBUF_SIMPLE) * result = c_Hash128WithSeed(buf.buf, buf.len, tseed) - */ +*/ goto __pyx_L3; } @@ -6391,17 +5986,17 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject * raise _type_error("data", ["basestring", "buffer"], data) # <<<<<<<<<<<<<< * first = PyLong_FromUnsignedLongLong(result.first) * second = PyLong_FromUnsignedLongLong(result.second) - */ +*/ /*else*/ { __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_n_u_basestring); - __Pyx_GIVEREF(__pyx_n_u_basestring); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_basestring)) __PYX_ERR(0, 395, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_buffer); - __Pyx_GIVEREF(__pyx_n_u_buffer); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_u_buffer)) __PYX_ERR(0, 395, __pyx_L1_error); - __pyx_t_6 = __pyx_f_8farmhash__type_error(__pyx_n_u_data, __pyx_t_1, __pyx_v_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_basestring); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_basestring); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_n_u_basestring) != (0)) __PYX_ERR(0, 395, __pyx_L1_error); + __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_buffer); + __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_buffer); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_mstate_global->__pyx_n_u_buffer) != (0)) __PYX_ERR(0, 395, __pyx_L1_error); + __pyx_t_6 = __pyx_f_8farmhash__type_error(__pyx_mstate_global->__pyx_n_u_data, __pyx_t_1, __pyx_v_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_6, 0, 0, 0); @@ -6416,7 +6011,7 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject * first = PyLong_FromUnsignedLongLong(result.first) # <<<<<<<<<<<<<< * second = PyLong_FromUnsignedLongLong(result.second) * return (first << 64ULL) + second - */ +*/ __pyx_t_6 = PyLong_FromUnsignedLongLong(__pyx_v_result.first); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __pyx_t_6; @@ -6430,7 +6025,7 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject * first = PyLong_FromUnsignedLongLong(result.first) * second = PyLong_FromUnsignedLongLong(result.second) # <<<<<<<<<<<<<< * return (first << 64ULL) + second - */ +*/ __pyx_t_1 = PyLong_FromUnsignedLongLong(__pyx_v_result.second); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __pyx_t_1; @@ -6443,14 +6038,14 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject * first = PyLong_FromUnsignedLongLong(result.first) * second = PyLong_FromUnsignedLongLong(result.second) * return (first << 64ULL) + second # <<<<<<<<<<<<<< - */ +*/ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = PyNumber_Lshift(__pyx_v_first, __pyx_int_64L); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_6 = PyNumber_Lshift(__pyx_v_first, __pyx_mstate_global->__pyx_int_64L); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_v_second); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_1))) __PYX_ERR(0, 398, __pyx_L1_error) + if (!(likely(PyLong_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_1))) __PYX_ERR(0, 398, __pyx_L1_error) __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; @@ -6461,7 +6056,7 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject * def FarmHash128WithSeed(data, seed: int = 0L) -> int: # <<<<<<<<<<<<<< * """Obtain a 128-bit hash using a seed. * - */ +*/ /* function exit code */ __pyx_L1_error:; @@ -6476,263 +6071,65 @@ static PyObject *__pyx_pf_8farmhash_18FarmHash128WithSeed(CYTHON_UNUSED PyObject __Pyx_RefNannyFinishContext(); return __pyx_r; } +/* #### Code section: module_exttypes ### */ static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; -#ifndef CYTHON_SMALL_CODE -#if defined(__clang__) - #define CYTHON_SMALL_CODE -#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) - #define CYTHON_SMALL_CODE __attribute__((cold)) -#else - #define CYTHON_SMALL_CODE -#endif -#endif -/* #### Code section: pystring_table ### */ - -static int __Pyx_CreateStringTabAndInitStrings(void) { - __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_u_0_4_7, __pyx_k_0_4_7, sizeof(__pyx_k_0_4_7), 0, 1, 0, 0}, - {&__pyx_kp_u_Argument, __pyx_k_Argument, sizeof(__pyx_k_Argument), 0, 1, 0, 0}, - {&__pyx_kp_u_Eugene_Scherba, __pyx_k_Eugene_Scherba, sizeof(__pyx_k_Eugene_Scherba), 0, 1, 0, 0}, - {&__pyx_n_s_FarmHash128, __pyx_k_FarmHash128, sizeof(__pyx_k_FarmHash128), 0, 0, 1, 1}, - {&__pyx_n_u_FarmHash128, __pyx_k_FarmHash128, sizeof(__pyx_k_FarmHash128), 0, 1, 0, 1}, - {&__pyx_n_s_FarmHash128WithSeed, __pyx_k_FarmHash128WithSeed, sizeof(__pyx_k_FarmHash128WithSeed), 0, 0, 1, 1}, - {&__pyx_n_u_FarmHash128WithSeed, __pyx_k_FarmHash128WithSeed, sizeof(__pyx_k_FarmHash128WithSeed), 0, 1, 0, 1}, - {&__pyx_n_s_FarmHash32, __pyx_k_FarmHash32, sizeof(__pyx_k_FarmHash32), 0, 0, 1, 1}, - {&__pyx_n_u_FarmHash32, __pyx_k_FarmHash32, sizeof(__pyx_k_FarmHash32), 0, 1, 0, 1}, - {&__pyx_n_s_FarmHash32WithSeed, __pyx_k_FarmHash32WithSeed, sizeof(__pyx_k_FarmHash32WithSeed), 0, 0, 1, 1}, - {&__pyx_n_u_FarmHash32WithSeed, __pyx_k_FarmHash32WithSeed, sizeof(__pyx_k_FarmHash32WithSeed), 0, 1, 0, 1}, - {&__pyx_n_s_FarmHash64, __pyx_k_FarmHash64, sizeof(__pyx_k_FarmHash64), 0, 0, 1, 1}, - {&__pyx_n_u_FarmHash64, __pyx_k_FarmHash64, sizeof(__pyx_k_FarmHash64), 0, 1, 0, 1}, - {&__pyx_n_s_FarmHash64WithSeed, __pyx_k_FarmHash64WithSeed, sizeof(__pyx_k_FarmHash64WithSeed), 0, 0, 1, 1}, - {&__pyx_n_u_FarmHash64WithSeed, __pyx_k_FarmHash64WithSeed, sizeof(__pyx_k_FarmHash64WithSeed), 0, 1, 0, 1}, - {&__pyx_n_s_FarmHash64WithSeeds, __pyx_k_FarmHash64WithSeeds, sizeof(__pyx_k_FarmHash64WithSeeds), 0, 0, 1, 1}, - {&__pyx_n_u_FarmHash64WithSeeds, __pyx_k_FarmHash64WithSeeds, sizeof(__pyx_k_FarmHash64WithSeeds), 0, 1, 0, 1}, - {&__pyx_n_s_Fingerprint128, __pyx_k_Fingerprint128, sizeof(__pyx_k_Fingerprint128), 0, 0, 1, 1}, - {&__pyx_n_u_Fingerprint128, __pyx_k_Fingerprint128, sizeof(__pyx_k_Fingerprint128), 0, 1, 0, 1}, - {&__pyx_n_s_Fingerprint32, __pyx_k_Fingerprint32, sizeof(__pyx_k_Fingerprint32), 0, 0, 1, 1}, - {&__pyx_n_u_Fingerprint32, __pyx_k_Fingerprint32, sizeof(__pyx_k_Fingerprint32), 0, 1, 0, 1}, - {&__pyx_n_s_Fingerprint64, __pyx_k_Fingerprint64, sizeof(__pyx_k_Fingerprint64), 0, 0, 1, 1}, - {&__pyx_n_u_Fingerprint64, __pyx_k_Fingerprint64, sizeof(__pyx_k_Fingerprint64), 0, 1, 0, 1}, - {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, - {&__pyx_n_s__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 0, 1, 1}, - {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, - {&__pyx_n_s_author, __pyx_k_author, sizeof(__pyx_k_author), 0, 0, 1, 1}, - {&__pyx_n_u_basestring, __pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 1, 0, 1}, - {&__pyx_n_s_buf, __pyx_k_buf, sizeof(__pyx_k_buf), 0, 0, 1, 1}, - {&__pyx_n_u_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 1, 0, 1}, - {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, - {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, - {&__pyx_n_u_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 1, 0, 1}, - {&__pyx_n_s_email, __pyx_k_email, sizeof(__pyx_k_email), 0, 0, 1, 1}, - {&__pyx_n_s_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 0, 0, 1, 1}, - {&__pyx_n_s_encoding_size, __pyx_k_encoding_size, sizeof(__pyx_k_encoding_size), 0, 0, 1, 1}, - {&__pyx_kp_u_escherba_cityhash_gmail_com, __pyx_k_escherba_cityhash_gmail_com, sizeof(__pyx_k_escherba_cityhash_gmail_com), 0, 1, 0, 0}, - {&__pyx_n_s_farmhash, __pyx_k_farmhash, sizeof(__pyx_k_farmhash), 0, 0, 1, 1}, - {&__pyx_n_s_first, __pyx_k_first, sizeof(__pyx_k_first), 0, 0, 1, 1}, - {&__pyx_kp_u_got, __pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0, 0}, - {&__pyx_kp_u_has_incorrect_type_expected, __pyx_k_has_incorrect_type_expected, sizeof(__pyx_k_has_incorrect_type_expected), 0, 1, 0, 0}, - {&__pyx_kp_u_instead, __pyx_k_instead, sizeof(__pyx_k_instead), 0, 1, 0, 0}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1}, - {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1}, - {&__pyx_n_s_seed, __pyx_k_seed, sizeof(__pyx_k_seed), 0, 0, 1, 1}, - {&__pyx_n_s_seed0, __pyx_k_seed0, sizeof(__pyx_k_seed0), 0, 0, 1, 1}, - {&__pyx_n_s_seed1, __pyx_k_seed1, sizeof(__pyx_k_seed1), 0, 0, 1, 1}, - {&__pyx_kp_s_src_farmhash_pyx, __pyx_k_src_farmhash_pyx, sizeof(__pyx_k_src_farmhash_pyx), 0, 0, 1, 0}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_tseed, __pyx_k_tseed, sizeof(__pyx_k_tseed), 0, 0, 1, 1}, - {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} - }; - return __Pyx_InitStrings(__pyx_string_tab); -} -/* #### Code section: cached_builtins ### */ -static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 87, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: cached_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "farmhash.pyx":93 - * - * - * def FarmHash32(data) -> int: # <<<<<<<<<<<<<< - * """Obtain a 32-bit hash from input data. - * - */ - __pyx_tuple__2 = PyTuple_Pack(5, __pyx_n_s_data, __pyx_n_s_buf, __pyx_n_s_result, __pyx_n_s_encoding, __pyx_n_s_encoding_size); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 93, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); - __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_farmhash_pyx, __pyx_n_s_FarmHash32, 93, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 93, __pyx_L1_error) - - /* "farmhash.pyx":122 - * - * - * def Fingerprint32(data) -> int: # <<<<<<<<<<<<<< - * """Obtain a 32-bit hardware-independent fingerprint. - * - */ - __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_farmhash_pyx, __pyx_n_s_Fingerprint32, 122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 122, __pyx_L1_error) - - /* "farmhash.pyx":151 - * - * - * def FarmHash32WithSeed(data, uint32_t seed=0U) -> int: # <<<<<<<<<<<<<< - * """Obtain a 32-bit hash using a seed. - * - */ - __pyx_tuple__5 = PyTuple_Pack(6, __pyx_n_s_data, __pyx_n_s_seed, __pyx_n_s_buf, __pyx_n_s_result, __pyx_n_s_encoding, __pyx_n_s_encoding_size); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 151, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_farmhash_pyx, __pyx_n_s_FarmHash32WithSeed, 151, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 151, __pyx_L1_error) - - /* "farmhash.pyx":183 - * - * - * def FarmHash64(data) -> int: # <<<<<<<<<<<<<< - * """Obtain a 64-bit hash from input data. - * - */ - __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_farmhash_pyx, __pyx_n_s_FarmHash64, 183, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 183, __pyx_L1_error) - - /* "farmhash.pyx":212 - * - * - * def Fingerprint64(data) -> int: # <<<<<<<<<<<<<< - * """Obtain a 64-bit hardware-independent fingerprint. - * - */ - __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_farmhash_pyx, __pyx_n_s_Fingerprint64, 212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 212, __pyx_L1_error) - - /* "farmhash.pyx":240 - * - * - * def FarmHash64WithSeed(data, uint64_t seed=0ULL) -> int: # <<<<<<<<<<<<<< - * """Obtain a 64-bit hash using a seed. - * - */ - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_farmhash_pyx, __pyx_n_s_FarmHash64WithSeed, 240, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 240, __pyx_L1_error) - - /* "farmhash.pyx":271 - * - * - * def FarmHash64WithSeeds(data, uint64_t seed0=0LL, uint64_t seed1=0LL) -> int: # <<<<<<<<<<<<<< - * """Obtain a 64-bit hash using two seeds. - * - */ - __pyx_tuple__10 = PyTuple_Pack(7, __pyx_n_s_data, __pyx_n_s_seed0, __pyx_n_s_seed1, __pyx_n_s_buf, __pyx_n_s_result, __pyx_n_s_encoding, __pyx_n_s_encoding_size); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 271, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_farmhash_pyx, __pyx_n_s_FarmHash64WithSeeds, 271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 271, __pyx_L1_error) - - /* "farmhash.pyx":303 - * - * - * def FarmHash128(data) -> int: # <<<<<<<<<<<<<< - * """Obtain a 128-bit hash from input data. - * - */ - __pyx_tuple__12 = PyTuple_Pack(7, __pyx_n_s_data, __pyx_n_s_buf, __pyx_n_s_result, __pyx_n_s_encoding, __pyx_n_s_encoding_size, __pyx_n_s_first, __pyx_n_s_second); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 303, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_farmhash_pyx, __pyx_n_s_FarmHash128, 303, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 303, __pyx_L1_error) - - /* "farmhash.pyx":334 - * - * - * def Fingerprint128(data) -> int: # <<<<<<<<<<<<<< - * """Obtain a 128-bit hardware-independent fingerprint. - * - */ - __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_farmhash_pyx, __pyx_n_s_Fingerprint128, 334, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 334, __pyx_L1_error) - - /* "farmhash.pyx":365 - * - * - * def FarmHash128WithSeed(data, seed: int = 0L) -> int: # <<<<<<<<<<<<<< - * """Obtain a 128-bit hash using a seed. - * - */ - __pyx_tuple__15 = PyTuple_Pack(9, __pyx_n_s_data, __pyx_n_s_seed, __pyx_n_s_buf, __pyx_n_s_result, __pyx_n_s_tseed, __pyx_n_s_encoding, __pyx_n_s_encoding_size, __pyx_n_s_first, __pyx_n_s_second); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 365, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); - __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_farmhash_pyx, __pyx_n_s_FarmHash128WithSeed, 365, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 365, __pyx_L1_error) - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} -/* #### Code section: init_constants ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { - if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error); - __pyx_int_0L = PyLong_FromString((char *)"0", 0, 0); if (unlikely(!__pyx_int_0L)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_64L = PyLong_FromString((char *)"64", 0, 0); if (unlikely(!__pyx_int_64L)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_int_0xffffffffffffffffL = PyLong_FromString((char *)"0xffffffffffffffff", 0, 0); if (unlikely(!__pyx_int_0xffffffffffffffffL)) __PYX_ERR(0, 1, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} -/* #### Code section: init_globals ### */ - -static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { - return 0; -} +/* #### Code section: initfunc_declarations ### */ +static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/ +static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/ /* #### Code section: init_module ### */ -static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ -static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ - -static int __Pyx_modinit_global_init_code(void) { +static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_variable_export_code(void) { +static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_function_export_code(void) { +static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_type_init_code(void) { +static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_type_import_code(void) { +static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); PyObject *__pyx_t_1 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; @@ -6741,23 +6138,39 @@ static int __Pyx_modinit_type_import_code(void) { /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", + __pyx_mstate->__pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_1_4(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyTypeObject), + sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(PyTypeObject), #elif CYTHON_COMPILING_IN_LIMITED_API - sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyTypeObject), + 0, 0, #else - sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyHeapTypeObject), + sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(PyHeapTypeObject), #endif - __Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) + __Pyx_ImportType_CheckSize_Warn_3_1_4); if (!__pyx_mstate->__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyBoolObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(3, 8, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_1_4(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(PyLongObject), + #elif CYTHON_COMPILING_IN_LIMITED_API + 0, 0, + #else + sizeof(PyLongObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(PyLongObject), + #endif + __Pyx_ImportType_CheckSize_Warn_3_1_4); if (!__pyx_mstate->__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(3, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 15, __pyx_L1_error) + __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_0_12(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(PyComplexObject),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(4, 15, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_1_4(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", + #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 + sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(PyComplexObject), + #elif CYTHON_COMPILING_IN_LIMITED_API + 0, 0, + #else + sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_1_4(PyComplexObject), + #endif + __Pyx_ImportType_CheckSize_Warn_3_1_4); if (!__pyx_mstate->__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(4, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; @@ -6767,30 +6180,36 @@ static int __Pyx_modinit_type_import_code(void) { return -1; } -static int __Pyx_modinit_variable_import_code(void) { +static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } -static int __Pyx_modinit_function_import_code(void) { +static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) { __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } - -#if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_farmhash(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_farmhash}, + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + {Py_mod_gil, Py_MOD_GIL_USED}, + #endif + #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE + {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED}, + #endif {0, NULL} }; #endif @@ -6805,12 +6224,10 @@ namespace { PyModuleDef_HEAD_INIT, "farmhash", __pyx_k_Python_wrapper_for_FarmHash, /* m_doc */ - #if CYTHON_PEP489_MULTI_PHASE_INIT - 0, /* m_size */ - #elif CYTHON_USE_MODULE_STATE - sizeof(__pyx_mstate), /* m_size */ + #if CYTHON_USE_MODULE_STATE + sizeof(__pyx_mstatetype), /* m_size */ #else - -1, /* m_size */ + (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT @@ -6831,51 +6248,71 @@ namespace { #ifdef __cplusplus } /* anonymous namespace */ #endif -#endif +/* PyModInitFuncType */ #ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC -#elif PY_MAJOR_VERSION < 3 -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" void -#else -#define __Pyx_PyMODINIT_FUNC void -#endif -#else -#ifdef __cplusplus -#define __Pyx_PyMODINIT_FUNC extern "C" PyObject * + #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #else -#define __Pyx_PyMODINIT_FUNC PyObject * -#endif + #ifdef __cplusplus + #define __Pyx_PyMODINIT_FUNC extern "C" PyObject * + #else + #define __Pyx_PyMODINIT_FUNC PyObject * + #endif #endif - -#if PY_MAJOR_VERSION < 3 -__Pyx_PyMODINIT_FUNC initfarmhash(void) CYTHON_SMALL_CODE; /*proto*/ -__Pyx_PyMODINIT_FUNC initfarmhash(void) -#else __Pyx_PyMODINIT_FUNC PyInit_farmhash(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_farmhash(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } +/* ModuleCreationPEP489 */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000 +static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) { + { + PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think + if (!module) { + PyErr_Clear(); // just try the 3.8-3.12 version + module = PyImport_ImportModule("_xxsubinterpreters"); + if (!module) goto bad; + } + PyObject *current = PyObject_CallMethod(module, "get_current", NULL); + Py_DECREF(module); + if (!current) goto bad; + if (PyTuple_Check(current)) { + PyObject *new_current = PySequence_GetItem(current, 0); + Py_DECREF(current); + current = new_current; + if (!new_current) goto bad; + } + long long as_c_int = PyLong_AsLongLong(current); + Py_DECREF(current); + return as_c_int; + } + bad: + PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n"); + return -1; +} +#endif +#if !CYTHON_USE_MODULE_STATE static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { - #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; +#if CYTHON_COMPILING_IN_GRAAL + PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get()); +#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x03090000 + PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get()); +#elif CYTHON_COMPILING_IN_LIMITED_API + PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId(); +#else PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); +#endif + if (unlikely(current_id == -1)) { + return -1; + } if (main_interpreter_id == -1) { main_interpreter_id = current_id; - return (unlikely(current_id == -1)) ? -1 : 0; - } else if (unlikely(main_interpreter_id != current_id)) - #else - static PyInterpreterState *main_interpreter = NULL; - PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; - if (!main_interpreter) { - main_interpreter = current_interpreter; - } else if (unlikely(main_interpreter != current_interpreter)) - #endif - { + return 0; + } else if (unlikely(main_interpreter_id != current_id)) { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); @@ -6883,21 +6320,14 @@ static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { } return 0; } -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none) -#else -static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) #endif +static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { -#if CYTHON_COMPILING_IN_LIMITED_API - result = PyModule_AddObject(module, to_name, value); -#else result = PyDict_SetItemString(moddict, to_name, value); -#endif } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { @@ -6910,8 +6340,10 @@ static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; CYTHON_UNUSED_VAR(def); + #if !CYTHON_USE_MODULE_STATE if (__Pyx_check_single_interpreter()) return NULL; + #endif if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); @@ -6919,12 +6351,8 @@ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDe module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; -#if CYTHON_COMPILING_IN_LIMITED_API - moddict = module; -#else moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; -#endif if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; @@ -6938,12 +6366,12 @@ static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDe static CYTHON_SMALL_CODE int __pyx_pymod_exec_farmhash(PyObject *__pyx_pyinit_module) #endif -#endif { int stringtab_initialized = 0; #if CYTHON_USE_MODULE_STATE int pystate_addmodule_run = 0; #endif + __pyx_mstatetype *__pyx_mstate = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; @@ -6956,36 +6384,37 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_farmhash(PyObject *__pyx_pyinit_mo PyErr_SetString(PyExc_RuntimeError, "Module 'farmhash' has already been imported. Re-initialisation is not supported."); return -1; } - #elif PY_MAJOR_VERSION >= 3 + #else if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif /*--- Module creation code ---*/ #if CYTHON_PEP489_MULTI_PHASE_INIT - __pyx_m = __pyx_pyinit_module; - Py_INCREF(__pyx_m); + __pyx_t_1 = __pyx_pyinit_module; + Py_INCREF(__pyx_t_1); #else - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("farmhash", __pyx_methods, __pyx_k_Python_wrapper_for_FarmHash, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - #elif CYTHON_USE_MODULE_STATE __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #if CYTHON_USE_MODULE_STATE { - int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef); + int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef); __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "farmhash" pseudovariable */ if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error) pystate_addmodule_run = 1; } #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_m = __pyx_t_1; #endif + #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED); #endif + __pyx_mstate = __pyx_mstate_global; CYTHON_UNUSED_VAR(__pyx_t_1); - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_mstate->__pyx_d); + __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /* ImportRefnannyAPI */ #if CYTHON_REFNANNY __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { @@ -6995,14 +6424,22 @@ if (!__Pyx_RefNanny) { Py_FatalError("failed to import 'refnanny' module"); } #endif - __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_farmhash(void)", 0); + +__Pyx_RefNannySetupContext("PyInit_farmhash", 0); if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Initialize various global constants etc. ---*/ + if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + stringtab_initialized = 1; + if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if 0 || defined(__Pyx_CyFunction_USED) || defined(__Pyx_FusedFunction_USED) || defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED) || defined(__Pyx_AsyncGen_USED) + if (__pyx_CommonTypesMetaclass_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif @@ -7018,48 +6455,30 @@ if (!__Pyx_RefNanny) { #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - PyEval_InitThreads(); - #endif - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - stringtab_initialized = 1; - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif if (__pyx_module_is_main_farmhash) { - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } - #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "farmhash")) { if (unlikely((PyDict_SetItemString(modules, "farmhash", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } - #endif /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedBuiltins(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_InitCachedConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (__Pyx_CreateCodeObjects(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error) /*--- Global type/function init code ---*/ - (void)__Pyx_modinit_global_init_code(); - (void)__Pyx_modinit_variable_export_code(); - (void)__Pyx_modinit_function_export_code(); - (void)__Pyx_modinit_type_init_code(); - if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error) - (void)__Pyx_modinit_variable_import_code(); - (void)__Pyx_modinit_function_import_code(); + (void)__Pyx_modinit_global_init_code(__pyx_mstate); + (void)__Pyx_modinit_variable_export_code(__pyx_mstate); + (void)__Pyx_modinit_function_export_code(__pyx_mstate); + (void)__Pyx_modinit_type_init_code(__pyx_mstate); + if (unlikely((__Pyx_modinit_type_import_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + (void)__Pyx_modinit_variable_import_code(__pyx_mstate); + (void)__Pyx_modinit_function_import_code(__pyx_mstate); /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif /* "farmhash.pyx":11 * """ @@ -7067,8 +6486,8 @@ if (!__Pyx_RefNanny) { * __author__ = "Eugene Scherba" # <<<<<<<<<<<<<< * __email__ = "escherba+cityhash@gmail.com" * __version__ = '0.4.7' - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_author, __pyx_kp_u_Eugene_Scherba) < 0) __PYX_ERR(0, 11, __pyx_L1_error) +*/ + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_author, __pyx_mstate_global->__pyx_kp_u_Eugene_Scherba) < 0) __PYX_ERR(0, 11, __pyx_L1_error) /* "farmhash.pyx":12 * @@ -7076,8 +6495,8 @@ if (!__Pyx_RefNanny) { * __email__ = "escherba+cityhash@gmail.com" # <<<<<<<<<<<<<< * __version__ = '0.4.7' * __all__ = [ - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_email, __pyx_kp_u_escherba_cityhash_gmail_com) < 0) __PYX_ERR(0, 12, __pyx_L1_error) +*/ + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_email, __pyx_mstate_global->__pyx_kp_u_escherba_cityhash_gmail_com) < 0) __PYX_ERR(0, 12, __pyx_L1_error) /* "farmhash.pyx":13 * __author__ = "Eugene Scherba" @@ -7085,8 +6504,8 @@ if (!__Pyx_RefNanny) { * __version__ = '0.4.7' # <<<<<<<<<<<<<< * __all__ = [ * "FarmHash32", - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_u_0_4_7) < 0) __PYX_ERR(0, 13, __pyx_L1_error) +*/ + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_version, __pyx_mstate_global->__pyx_kp_u_0_4_7) < 0) __PYX_ERR(0, 13, __pyx_L1_error) /* "farmhash.pyx":14 * __email__ = "escherba+cityhash@gmail.com" @@ -7094,40 +6513,10 @@ if (!__Pyx_RefNanny) { * __all__ = [ # <<<<<<<<<<<<<< * "FarmHash32", * "FarmHash32WithSeed", - */ - __pyx_t_2 = PyList_New(10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) +*/ + __pyx_t_2 = __Pyx_PyList_Pack(10, __pyx_mstate_global->__pyx_n_u_FarmHash32, __pyx_mstate_global->__pyx_n_u_FarmHash32WithSeed, __pyx_mstate_global->__pyx_n_u_Fingerprint32, __pyx_mstate_global->__pyx_n_u_FarmHash64, __pyx_mstate_global->__pyx_n_u_FarmHash64WithSeed, __pyx_mstate_global->__pyx_n_u_FarmHash64WithSeeds, __pyx_mstate_global->__pyx_n_u_Fingerprint64, __pyx_mstate_global->__pyx_n_u_FarmHash128, __pyx_mstate_global->__pyx_n_u_FarmHash128WithSeed, __pyx_mstate_global->__pyx_n_u_Fingerprint128); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_u_FarmHash32); - __Pyx_GIVEREF(__pyx_n_u_FarmHash32); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_FarmHash32)) __PYX_ERR(0, 14, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_FarmHash32WithSeed); - __Pyx_GIVEREF(__pyx_n_u_FarmHash32WithSeed); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_u_FarmHash32WithSeed)) __PYX_ERR(0, 14, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_Fingerprint32); - __Pyx_GIVEREF(__pyx_n_u_Fingerprint32); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_u_Fingerprint32)) __PYX_ERR(0, 14, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_FarmHash64); - __Pyx_GIVEREF(__pyx_n_u_FarmHash64); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_u_FarmHash64)) __PYX_ERR(0, 14, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_FarmHash64WithSeed); - __Pyx_GIVEREF(__pyx_n_u_FarmHash64WithSeed); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_u_FarmHash64WithSeed)) __PYX_ERR(0, 14, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_FarmHash64WithSeeds); - __Pyx_GIVEREF(__pyx_n_u_FarmHash64WithSeeds); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_u_FarmHash64WithSeeds)) __PYX_ERR(0, 14, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_Fingerprint64); - __Pyx_GIVEREF(__pyx_n_u_Fingerprint64); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 6, __pyx_n_u_Fingerprint64)) __PYX_ERR(0, 14, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_FarmHash128); - __Pyx_GIVEREF(__pyx_n_u_FarmHash128); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 7, __pyx_n_u_FarmHash128)) __PYX_ERR(0, 14, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_FarmHash128WithSeed); - __Pyx_GIVEREF(__pyx_n_u_FarmHash128WithSeed); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 8, __pyx_n_u_FarmHash128WithSeed)) __PYX_ERR(0, 14, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_u_Fingerprint128); - __Pyx_GIVEREF(__pyx_n_u_Fingerprint128); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 9, __pyx_n_u_Fingerprint128)) __PYX_ERR(0, 14, __pyx_L1_error); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_all, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "farmhash.pyx":93 @@ -7136,10 +6525,10 @@ if (!__Pyx_RefNanny) { * def FarmHash32(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 32-bit hash from input data. * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8farmhash_1FarmHash32, NULL, __pyx_n_s_farmhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) +*/ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8farmhash_1FarmHash32, NULL, __pyx_mstate_global->__pyx_n_u_farmhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FarmHash32, __pyx_t_2) < 0) __PYX_ERR(0, 93, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FarmHash32, __pyx_t_2) < 0) __PYX_ERR(0, 93, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "farmhash.pyx":122 @@ -7148,10 +6537,10 @@ if (!__Pyx_RefNanny) { * def Fingerprint32(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 32-bit hardware-independent fingerprint. * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8farmhash_3Fingerprint32, NULL, __pyx_n_s_farmhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) +*/ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8farmhash_3Fingerprint32, NULL, __pyx_mstate_global->__pyx_n_u_farmhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Fingerprint32, __pyx_t_2) < 0) __PYX_ERR(0, 122, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Fingerprint32, __pyx_t_2) < 0) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "farmhash.pyx":151 @@ -7160,10 +6549,10 @@ if (!__Pyx_RefNanny) { * def FarmHash32WithSeed(data, uint32_t seed=0U) -> int: # <<<<<<<<<<<<<< * """Obtain a 32-bit hash using a seed. * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8farmhash_5FarmHash32WithSeed, NULL, __pyx_n_s_farmhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) +*/ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8farmhash_5FarmHash32WithSeed, NULL, __pyx_mstate_global->__pyx_n_u_farmhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FarmHash32WithSeed, __pyx_t_2) < 0) __PYX_ERR(0, 151, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FarmHash32WithSeed, __pyx_t_2) < 0) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "farmhash.pyx":183 @@ -7172,10 +6561,10 @@ if (!__Pyx_RefNanny) { * def FarmHash64(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 64-bit hash from input data. * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8farmhash_7FarmHash64, NULL, __pyx_n_s_farmhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) +*/ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8farmhash_7FarmHash64, NULL, __pyx_mstate_global->__pyx_n_u_farmhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FarmHash64, __pyx_t_2) < 0) __PYX_ERR(0, 183, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FarmHash64, __pyx_t_2) < 0) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "farmhash.pyx":212 @@ -7184,10 +6573,10 @@ if (!__Pyx_RefNanny) { * def Fingerprint64(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 64-bit hardware-independent fingerprint. * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8farmhash_9Fingerprint64, NULL, __pyx_n_s_farmhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) +*/ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8farmhash_9Fingerprint64, NULL, __pyx_mstate_global->__pyx_n_u_farmhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Fingerprint64, __pyx_t_2) < 0) __PYX_ERR(0, 212, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Fingerprint64, __pyx_t_2) < 0) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "farmhash.pyx":240 @@ -7196,10 +6585,10 @@ if (!__Pyx_RefNanny) { * def FarmHash64WithSeed(data, uint64_t seed=0ULL) -> int: # <<<<<<<<<<<<<< * """Obtain a 64-bit hash using a seed. * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8farmhash_11FarmHash64WithSeed, NULL, __pyx_n_s_farmhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) +*/ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8farmhash_11FarmHash64WithSeed, NULL, __pyx_mstate_global->__pyx_n_u_farmhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FarmHash64WithSeed, __pyx_t_2) < 0) __PYX_ERR(0, 240, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FarmHash64WithSeed, __pyx_t_2) < 0) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "farmhash.pyx":271 @@ -7208,10 +6597,10 @@ if (!__Pyx_RefNanny) { * def FarmHash64WithSeeds(data, uint64_t seed0=0LL, uint64_t seed1=0LL) -> int: # <<<<<<<<<<<<<< * """Obtain a 64-bit hash using two seeds. * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8farmhash_13FarmHash64WithSeeds, NULL, __pyx_n_s_farmhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) +*/ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8farmhash_13FarmHash64WithSeeds, NULL, __pyx_mstate_global->__pyx_n_u_farmhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FarmHash64WithSeeds, __pyx_t_2) < 0) __PYX_ERR(0, 271, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FarmHash64WithSeeds, __pyx_t_2) < 0) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "farmhash.pyx":303 @@ -7220,10 +6609,10 @@ if (!__Pyx_RefNanny) { * def FarmHash128(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 128-bit hash from input data. * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8farmhash_15FarmHash128, NULL, __pyx_n_s_farmhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error) +*/ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8farmhash_15FarmHash128, NULL, __pyx_mstate_global->__pyx_n_u_farmhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FarmHash128, __pyx_t_2) < 0) __PYX_ERR(0, 303, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FarmHash128, __pyx_t_2) < 0) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "farmhash.pyx":334 @@ -7232,10 +6621,10 @@ if (!__Pyx_RefNanny) { * def Fingerprint128(data) -> int: # <<<<<<<<<<<<<< * """Obtain a 128-bit hardware-independent fingerprint. * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8farmhash_17Fingerprint128, NULL, __pyx_n_s_farmhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) +*/ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8farmhash_17Fingerprint128, NULL, __pyx_mstate_global->__pyx_n_u_farmhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Fingerprint128, __pyx_t_2) < 0) __PYX_ERR(0, 334, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_Fingerprint128, __pyx_t_2) < 0) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "farmhash.pyx":365 @@ -7244,24 +6633,20 @@ if (!__Pyx_RefNanny) { * def FarmHash128WithSeed(data, seed: int = 0L) -> int: # <<<<<<<<<<<<<< * """Obtain a 128-bit hash using a seed. * - */ - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_0L)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_0L))) __PYX_ERR(0, 365, __pyx_L1_error) - __Pyx_INCREF(__pyx_int_0L); - __pyx_k_ = ((PyObject*)__pyx_int_0L); - __Pyx_GIVEREF(__pyx_int_0L); - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8farmhash_19FarmHash128WithSeed, NULL, __pyx_n_s_farmhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error) +*/ + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8farmhash_19FarmHash128WithSeed, NULL, __pyx_mstate_global->__pyx_n_u_farmhash); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_FarmHash128WithSeed, __pyx_t_2) < 0) __PYX_ERR(0, 365, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FarmHash128WithSeed, __pyx_t_2) < 0) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "farmhash.pyx":1 * #cython: infer_types=True # <<<<<<<<<<<<<< * #cython: embedsignature=True * #cython: binding=False - */ +*/ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ @@ -7270,7 +6655,7 @@ if (!__Pyx_RefNanny) { __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { - if (__pyx_d && stringtab_initialized) { + if (__pyx_mstate->__pyx_d && stringtab_initialized) { __Pyx_AddTraceback("init farmhash", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE @@ -7291,12 +6676,131 @@ if (!__Pyx_RefNanny) { __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; - #elif PY_MAJOR_VERSION >= 3 - return __pyx_m; #else - return; + return __pyx_m; #endif } +/* #### Code section: pystring_table ### */ + +typedef struct { + const char *s; +#if 179 <= 65535 + const unsigned short n; +#elif 179 / 2 < INT_MAX + const unsigned int n; +#elif 179 / 2 < LONG_MAX + const unsigned long n; +#else + const Py_ssize_t n; +#endif +#if 1 <= 31 + const unsigned int encoding : 5; +#elif 1 <= 255 + const unsigned char encoding; +#elif 1 <= 65535 + const unsigned short encoding; +#else + const Py_ssize_t encoding; +#endif + const unsigned int is_unicode : 1; + const unsigned int intern : 1; +} __Pyx_StringTabEntry; +static const char * const __pyx_string_tab_encodings[] = { 0 }; +static const __Pyx_StringTabEntry __pyx_string_tab[] = { + {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */ + {__pyx_k_0_4_7, sizeof(__pyx_k_0_4_7), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_0_4_7 */ + {__pyx_k_Argument, sizeof(__pyx_k_Argument), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Argument */ + {__pyx_k_Eugene_Scherba, sizeof(__pyx_k_Eugene_Scherba), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Eugene_Scherba */ + {__pyx_k_FarmHash128, sizeof(__pyx_k_FarmHash128), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarmHash128 */ + {__pyx_k_FarmHash128WithSeed, sizeof(__pyx_k_FarmHash128WithSeed), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarmHash128WithSeed */ + {__pyx_k_FarmHash32, sizeof(__pyx_k_FarmHash32), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarmHash32 */ + {__pyx_k_FarmHash32WithSeed, sizeof(__pyx_k_FarmHash32WithSeed), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarmHash32WithSeed */ + {__pyx_k_FarmHash64, sizeof(__pyx_k_FarmHash64), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarmHash64 */ + {__pyx_k_FarmHash64WithSeed, sizeof(__pyx_k_FarmHash64WithSeed), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarmHash64WithSeed */ + {__pyx_k_FarmHash64WithSeeds, sizeof(__pyx_k_FarmHash64WithSeeds), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarmHash64WithSeeds */ + {__pyx_k_Fingerprint128, sizeof(__pyx_k_Fingerprint128), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fingerprint128 */ + {__pyx_k_Fingerprint32, sizeof(__pyx_k_Fingerprint32), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fingerprint32 */ + {__pyx_k_Fingerprint64, sizeof(__pyx_k_Fingerprint64), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fingerprint64 */ + {__pyx_k_Note_that_Cython_is_deliberately, sizeof(__pyx_k_Note_that_Cython_is_deliberately), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Note_that_Cython_is_deliberately */ + {__pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TypeError */ + {__pyx_k_add_note, sizeof(__pyx_k_add_note), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_add_note */ + {__pyx_k_all, sizeof(__pyx_k_all), 0, 1, 1}, /* PyObject cname: __pyx_n_u_all */ + {__pyx_k_author, sizeof(__pyx_k_author), 0, 1, 1}, /* PyObject cname: __pyx_n_u_author */ + {__pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 1, 1}, /* PyObject cname: __pyx_n_u_basestring */ + {__pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 1, 1}, /* PyObject cname: __pyx_n_u_buffer */ + {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */ + {__pyx_k_data, sizeof(__pyx_k_data), 0, 1, 1}, /* PyObject cname: __pyx_n_u_data */ + {__pyx_k_email, sizeof(__pyx_k_email), 0, 1, 1}, /* PyObject cname: __pyx_n_u_email */ + {__pyx_k_escherba_cityhash_gmail_com, sizeof(__pyx_k_escherba_cityhash_gmail_com), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_escherba_cityhash_gmail_com */ + {__pyx_k_farmhash, sizeof(__pyx_k_farmhash), 0, 1, 1}, /* PyObject cname: __pyx_n_u_farmhash */ + {__pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_got */ + {__pyx_k_has_incorrect_type_expected, sizeof(__pyx_k_has_incorrect_type_expected), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_has_incorrect_type_expected */ + {__pyx_k_instead, sizeof(__pyx_k_instead), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_instead */ + {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */ + {__pyx_k_module, sizeof(__pyx_k_module), 0, 1, 1}, /* PyObject cname: __pyx_n_u_module */ + {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */ + {__pyx_k_pop, sizeof(__pyx_k_pop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pop */ + {__pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_qualname */ + {__pyx_k_seed, sizeof(__pyx_k_seed), 0, 1, 1}, /* PyObject cname: __pyx_n_u_seed */ + {__pyx_k_seed0, sizeof(__pyx_k_seed0), 0, 1, 1}, /* PyObject cname: __pyx_n_u_seed0 */ + {__pyx_k_seed1, sizeof(__pyx_k_seed1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_seed1 */ + {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */ + {__pyx_k_version, sizeof(__pyx_k_version), 0, 1, 1}, /* PyObject cname: __pyx_n_u_version */ + {0, 0, 0, 0, 0} +}; +/* InitStrings.proto */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names); + +/* #### Code section: cached_builtins ### */ + +static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { + CYTHON_UNUSED_VAR(__pyx_mstate); + __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 87, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: cached_constants ### */ + +static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { + __Pyx_RefNannyDeclarations + CYTHON_UNUSED_VAR(__pyx_mstate); + __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); + __Pyx_RefNannyFinishContext(); + return 0; +} +/* #### Code section: init_constants ### */ + +static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { + CYTHON_UNUSED_VAR(__pyx_mstate); + __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type; + __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop; + if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + __pyx_mstate->__pyx_int_0L = PyLong_FromString("0", 0, 0); if (unlikely(!__pyx_mstate->__pyx_int_0L)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_int_64L = PyLong_FromString("64", 0, 0); if (unlikely(!__pyx_mstate->__pyx_int_64L)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_mstate->__pyx_int_0xffffffffffffffffL = PyLong_FromString("0xffffffffffffffff", 0, 0); if (unlikely(!__pyx_mstate->__pyx_int_0xffffffffffffffffL)) __PYX_ERR(0, 1, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +} +/* #### Code section: init_codeobjects ### */ + +static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { + CYTHON_UNUSED_VAR(__pyx_mstate); + return 0; +} +/* #### Code section: init_globals ### */ + +static int __Pyx_InitGlobals(void) { + /* PythonCompatibility.init */ + if (likely(__Pyx_init_co_variables() == 0)); else + +if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error) + + return 0; + __pyx_L1_error:; + return -1; +} /* #### Code section: cleanup_globals ### */ /* #### Code section: cleanup_module ### */ /* #### Code section: main_method ### */ @@ -7337,11 +6841,9 @@ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; itp_getattro)) return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif return PyObject_GetAttr(obj, attr_name); } #endif /* PyObjectGetAttrStrNoError */ -#if __PYX_LIMITED_VERSION_HEX < 0x030d00A1 +#if __PYX_LIMITED_VERSION_HEX < 0x030d0000 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign @@ -7459,11 +6957,11 @@ static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) { #endif static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) { PyObject *result; -#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 +#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 (void) PyObject_GetOptionalAttr(obj, attr_name, &result); return result; #else -#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1 +#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS PyTypeObject* tp = Py_TYPE(obj); if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) { return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1); @@ -7479,14 +6977,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P /* GetBuiltinName */ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name); + PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name); if (unlikely(!result) && !PyErr_Occurred()) { PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif } return result; } @@ -7495,13 +6989,6 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) { static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) { if (unlikely(!s)) return NULL; if (likely(PyUnicode_CheckExact(s))) return s; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_CheckExact(s))) { - PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict"); - Py_DECREF(s); - return result; - } - #endif return __Pyx_PyObject_FormatAndDecref(s, f); } static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) { @@ -7513,49 +7000,48 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObj } /* JoinPyUnicode */ -static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, +static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength, Py_UCS4 max_char) { #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS PyObject *result_uval; int result_ukind, kind_shift; Py_ssize_t i, char_pos; void *result_udata; - CYTHON_MAYBE_UNUSED_VAR(max_char); -#if CYTHON_PEP393_ENABLED + if (max_char > 1114111) max_char = 1114111; result_uval = PyUnicode_New(result_ulength, max_char); if (unlikely(!result_uval)) return NULL; result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; result_udata = PyUnicode_DATA(result_uval); -#else - result_uval = PyUnicode_FromUnicode(NULL, result_ulength); - if (unlikely(!result_uval)) return NULL; - result_ukind = sizeof(Py_UNICODE); - kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1; - result_udata = PyUnicode_AS_UNICODE(result_uval); -#endif assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); + if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0)) + goto overflow; char_pos = 0; for (i=0; i < value_count; i++) { int ukind; Py_ssize_t ulength; void *udata; - PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); - if (unlikely(__Pyx_PyUnicode_READY(uval))) + PyObject *uval = values[i]; + #if !CYTHON_COMPILING_IN_LIMITED_API + if (__Pyx_PyUnicode_READY(uval) == (-1)) goto bad; + #endif ulength = __Pyx_PyUnicode_GET_LENGTH(uval); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(ulength < 0)) goto bad; + #endif if (unlikely(!ulength)) continue; if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) goto overflow; ukind = __Pyx_PyUnicode_KIND(uval); udata = __Pyx_PyUnicode_DATA(uval); - if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { + if (ukind == result_ukind) { memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); } else { #if PY_VERSION_HEX >= 0x030d0000 if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; - #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) + #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters) _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); #else Py_ssize_t j; @@ -7574,16 +7060,26 @@ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_co Py_DECREF(result_uval); return NULL; #else + Py_ssize_t i; + PyObject *result = NULL; + PyObject *value_tuple = PyTuple_New(value_count); + if (unlikely(!value_tuple)) return NULL; CYTHON_UNUSED_VAR(max_char); CYTHON_UNUSED_VAR(result_ulength); - CYTHON_UNUSED_VAR(value_count); - return PyUnicode_Join(__pyx_empty_unicode, value_tuple); + for (i=0; i__pyx_empty_unicode, value_tuple); +bad: + Py_DECREF(value_tuple); + return result; #endif } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL -static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, +static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject *const *args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; @@ -7611,14 +7107,12 @@ static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args --tstate->recursion_depth; return result; } -static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { +static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; -#if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; -#endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; @@ -7626,19 +7120,11 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) { - return NULL; - } - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) { return NULL; } - #endif if ( -#if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && -#endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { @@ -7675,9 +7161,7 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, k = NULL; } closure = PyFunction_GET_CLOSURE(func); -#if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); -#endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); @@ -7686,17 +7170,10 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, d = NULL; nd = 0; } -#if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); -#else - result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, - args, (int)nargs, - k, (int)nk, - d, (int)nd, closure); -#endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); @@ -7711,13 +7188,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg ternaryfunc call = Py_TYPE(func)->tp_call; if (unlikely(!call)) return PyObject_Call(func, arg, kw); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -7736,13 +7208,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject PyCFunction cfunc; cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func); self = __Pyx_CyOrPyCFunction_GET_SELF(func); - #if PY_MAJOR_VERSION < 3 - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - #else if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) return NULL; - #endif result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { @@ -7756,7 +7223,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject /* PyObjectFastCall */ #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API -static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) { +static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) { PyObject *argstuple; PyObject *result = 0; size_t i; @@ -7764,7 +7231,7 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **arg if (unlikely(!argstuple)) return NULL; for (i = 0; i < nargs; i++) { Py_INCREF(args[i]); - if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad; + if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad; } result = __Pyx_PyObject_Call(func, argstuple, kwargs); bad: @@ -7772,7 +7239,32 @@ static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **arg return result; } #endif -static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) { +#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API + #if PY_VERSION_HEX < 0x03090000 + #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable) + #elif CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) { + PyTypeObject *tp = Py_TYPE(callable); + #if defined(__Pyx_CyFunction_USED) + if (__Pyx_CyFunction_CheckExact(callable)) { + return __Pyx_CyFunction_func_vectorcall(callable); + } + #endif + if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) { + return NULL; + } + assert(PyCallable_Check(callable)); + Py_ssize_t offset = tp->tp_vectorcall_offset; + assert(offset > 0); + vectorcallfunc ptr; + memcpy(&ptr, (char *) callable + offset, sizeof(ptr)); + return ptr; +} + #else + #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable) + #endif +#endif +static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) { Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs); #if CYTHON_COMPILING_IN_CPYTHON if (nargs == 0 && kwargs == NULL) { @@ -7793,12 +7285,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj return _PyCFunction_FastCallKeywords(func, args, nargs, NULL); } } - #if PY_VERSION_HEX >= 0x030700A1 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) { return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL); } #endif - #endif #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs); @@ -7806,24 +7296,22 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif #endif if (kwargs == NULL) { - #if CYTHON_VECTORCALL - #if PY_VERSION_HEX < 0x03090000 - vectorcallfunc f = _PyVectorcall_Function(func); - #else - vectorcallfunc f = PyVectorcall_Function(func); - #endif + #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API + vectorcallfunc f = __Pyx_PyVectorcall_Function(func); if (f) { - return f(func, args, (size_t)nargs, NULL); + return f(func, args, _nargs, NULL); } #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL if (__Pyx_CyFunction_CheckExact(func)) { __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); - if (f) return f(func, args, (size_t)nargs, NULL); + if (f) return f(func, args, _nargs, NULL); } + #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL + return PyObject_Vectorcall(func, args, _nargs, NULL); #endif } if (nargs == 0) { - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs); + return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs); } #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs); @@ -7832,14 +7320,28 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj #endif } -/* PyObjectCallOneArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *args[2] = {NULL, arg}; - return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - /* TupleAndListFromArray */ -#if CYTHON_COMPILING_IN_CPYTHON +#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL +static CYTHON_INLINE PyObject * +__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) +{ + PyObject *res; + Py_ssize_t i; + if (n <= 0) { + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); + } + res = PyTuple_New(n); + if (unlikely(res == NULL)) return NULL; + for (i = 0; i < n; i++) { + if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < 0)) { + Py_DECREF(res); + return NULL; + } + Py_INCREF(src[i]); + } + return res; +} +#elif CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) { PyObject *v; Py_ssize_t i; @@ -7853,8 +7355,7 @@ __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n) { PyObject *res; if (n <= 0) { - Py_INCREF(__pyx_empty_tuple); - return __pyx_empty_tuple; + return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple); } res = PyTuple_New(n); if (unlikely(res == NULL)) return NULL; @@ -7877,7 +7378,8 @@ __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n) /* BytesEquals */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\ + !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) return PyObject_RichCompareBool(s1, s2, equals); #else if (s1 == s2) { @@ -7924,55 +7426,39 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq /* UnicodeEquals */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL return PyObject_RichCompareBool(s1, s2, equals); #else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif int s1_is_unicode, s2_is_unicode; if (s1 == s2) { goto return_eq; } s1_is_unicode = PyUnicode_CheckExact(s1); s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; + Py_ssize_t length, length2; int kind; void *data1, *data2; + #if !CYTHON_COMPILING_IN_LIMITED_API if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; + #endif length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length < 0)) return -1; + #endif + length2 = __Pyx_PyUnicode_GET_LENGTH(s2); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(length2 < 0)) return -1; + #endif + if (length != length2) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; - #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; - #else - hash1 = ((PyUnicodeObject*)s1)->hash; - hash2 = ((PyUnicodeObject*)s2)->hash; - #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } @@ -7990,9 +7476,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int goto return_eq; } else { int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ) ? (result == 0) : (result != 0); } } else if ((s1 == Py_None) & s2_is_unicode) { @@ -8002,9 +7485,6 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int } else { int result; PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif if (!py_result) return -1; result = __Pyx_PyObject_IsTrue(py_result); @@ -8012,14 +7492,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int return result; } return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_EQ); return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif return (equals == Py_NE); #endif } @@ -8028,14 +7502,25 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int #if CYTHON_METH_FASTCALL static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s) { - Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames); + Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames); + #if !CYTHON_ASSUME_SAFE_SIZE + if (unlikely(n == -1)) return NULL; + #endif for (i = 0; i < n; i++) { - if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i]; + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + if (s == namei) return kwvalues[i]; } for (i = 0; i < n; i++) { - int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ); + PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!namei)) return NULL; + #endif + int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ); if (unlikely(eq != 0)) { if (unlikely(eq < 0)) return NULL; return kwvalues[i]; @@ -8043,15 +7528,26 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO } return NULL; } -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) { - Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames); + Py_ssize_t i, nkwargs; PyObject *dict; +#if !CYTHON_ASSUME_SAFE_SIZE + nkwargs = PyTuple_Size(kwnames); + if (unlikely(nkwargs < 0)) return NULL; +#else + nkwargs = PyTuple_GET_SIZE(kwnames); +#endif dict = PyDict_New(); if (unlikely(!dict)) return NULL; for (i=0; i= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AsString(kw_name)); - #endif } -/* ParseKeywords */ -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject *const *kwvalues, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)); - while (1) { - Py_XDECREF(key); key = NULL; - Py_XDECREF(value); value = NULL; - if (kwds_is_tuple) { - Py_ssize_t size; -#if CYTHON_ASSUME_SAFE_MACROS - size = PyTuple_GET_SIZE(kwds); +/* UnpackUnboundCMethod */ +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) { + PyObject *result; + PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args)); + if (unlikely(!selfless_args)) return NULL; + result = PyObject_Call(method, selfless_args, kwargs); + Py_DECREF(selfless_args); + return result; +} +#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000 +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { + return _PyObject_Vectorcall + (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames); +} +#else +static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { + return +#if PY_VERSION_HEX < 0x03090000 + _PyObject_Vectorcall #else - size = PyTuple_Size(kwds); - if (size < 0) goto bad; + PyObject_Vectorcall #endif - if (pos >= size) break; -#if CYTHON_AVOID_BORROWED_REFS - key = __Pyx_PySequence_ITEM(kwds, pos); - if (!key) goto bad; -#elif CYTHON_ASSUME_SAFE_MACROS - key = PyTuple_GET_ITEM(kwds, pos); + (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames); +} +#endif +static PyMethodDef __Pyx_UnboundCMethod_Def = { + "CythonUnboundCMethod", + __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall), +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000 + METH_VARARGS | METH_KEYWORDS, #else - key = PyTuple_GetItem(kwds, pos); - if (!key) goto bad; + METH_FASTCALL | METH_KEYWORDS, #endif - value = kwvalues[pos]; - pos++; - } - else - { - if (!PyDict_Next(kwds, &pos, &key, &value)) break; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); + NULL +}; +static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { + PyObject *method, *result=NULL; + method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); + if (unlikely(!method)) + return -1; + result = method; +#if CYTHON_COMPILING_IN_CPYTHON + if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) + { + PyMethodDescrObject *descr = (PyMethodDescrObject*) method; + target->func = descr->d_method->ml_meth; + target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); + } else #endif +#if CYTHON_COMPILING_IN_PYPY +#else + if (PyCFunction_Check(method)) +#endif + { + PyObject *self; + int self_found; +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + self = PyObject_GetAttrString(method, "__self__"); + if (!self) { + PyErr_Clear(); } - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - Py_INCREF(value); - Py_DECREF(key); +#else + self = PyCFunction_GET_SELF(method); #endif - key = NULL; - value = NULL; - continue; + self_found = (self && self != Py_None); +#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY + Py_XDECREF(self); +#endif + if (self_found) { + PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method); + if (unlikely(!unbound_method)) return -1; + Py_DECREF(method); + result = unbound_method; } -#if !CYTHON_AVOID_BORROWED_REFS - Py_INCREF(key); + } +#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + if (unlikely(target->method)) { + Py_DECREF(result); + } else #endif - Py_INCREF(value); - name = first_kw_arg; - #if PY_MAJOR_VERSION < 3 - if (likely(PyString_Check(key))) { - while (*name) { - if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) - && _PyString_Eq(**name, key)) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; + target->method = result; + return 0; +} + +/* CallUnboundCMethod2 */ +#if CYTHON_COMPILING_IN_CPYTHON +static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { + int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc); + if (likely(was_initialized == 2 && cfunc->func)) { + PyObject *args[2] = {arg1, arg2}; + if (cfunc->flag == METH_FASTCALL) { + return __Pyx_CallCFunctionFast(cfunc, self, args, 2); + } + if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) + return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL); + } +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + else if (unlikely(was_initialized == 1)) { + __Pyx_CachedCFunction tmp_cfunc = { +#ifndef __cplusplus + 0 #endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - if ((**argname == key) || ( - (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) - && _PyString_Eq(**argname, key))) { - goto arg_passed_twice; - } - argname++; - } - } - } else - #endif - if (likely(PyUnicode_Check(key))) { - while (*name) { - int cmp = ( - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**name, key) - ); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) { - values[name-argnames] = value; -#if CYTHON_AVOID_BORROWED_REFS - value = NULL; + }; + tmp_cfunc.type = cfunc->type; + tmp_cfunc.method_name = cfunc->method_name; + return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2); + } #endif - break; - } - name++; - } - if (*name) continue; - else { - PyObject*** argname = argnames; - while (argname != first_kw_arg) { - int cmp = (**argname == key) ? 0 : - #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 - (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 : - #endif - PyUnicode_Compare(**argname, key); - if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; - if (cmp == 0) goto arg_passed_twice; - argname++; - } + PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); + __Pyx_CachedCFunction_SetFinishedInitializing(cfunc); + return result; +} +#endif +static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ + if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; +#if CYTHON_COMPILING_IN_CPYTHON + if (cfunc->func && (cfunc->flag & METH_VARARGS)) { + PyObject *result = NULL; + PyObject *args = PyTuple_New(2); + if (unlikely(!args)) return NULL; + Py_INCREF(arg1); + PyTuple_SET_ITEM(args, 0, arg1); + Py_INCREF(arg2); + PyTuple_SET_ITEM(args, 1, arg2); + if (cfunc->flag & METH_KEYWORDS) + result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL); + else + result = __Pyx_CallCFunction(cfunc, self, args); + Py_DECREF(args); + return result; + } +#endif + { + PyObject *args[4] = {NULL, self, arg1, arg2}; + return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); + } +} + +/* ParseKeywords */ +static int __Pyx_ValidateDuplicatePosArgs( + PyObject *kwds, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + const char* function_name) +{ + PyObject ** const *name = argnames; + while (name != first_kw_arg) { + PyObject *key = **name; + int found = PyDict_Contains(kwds, key); + if (unlikely(found)) { + if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; + } + name++; + } + return 0; +bad: + return -1; +} +#if CYTHON_USE_UNICODE_INTERNALS +static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) { + int kind; + Py_ssize_t len = PyUnicode_GET_LENGTH(s1); + if (len != PyUnicode_GET_LENGTH(s2)) return 0; + kind = PyUnicode_KIND(s1); + if (kind != PyUnicode_KIND(s2)) return 0; + const void *data1 = PyUnicode_DATA(s1); + const void *data2 = PyUnicode_DATA(s2); + return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0); +} +#endif +static int __Pyx_MatchKeywordArg_str( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + PyObject ** const *name; + #if CYTHON_USE_UNICODE_INTERNALS + Py_hash_t key_hash = ((PyASCIIObject*)key)->hash; + if (unlikely(key_hash == -1)) { + key_hash = PyObject_Hash(key); + if (unlikely(key_hash == -1)) + goto bad; + } + #endif + name = first_kw_arg; + while (*name) { + PyObject *name_str = **name; + #if CYTHON_USE_UNICODE_INTERNALS + if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) { + *index_found = (size_t) (name - argnames); + return 1; + } + #else + #if CYTHON_ASSUME_SAFE_SIZE + if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) + #endif + { + int cmp = PyUnicode_Compare(name_str, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) { + *index_found = (size_t) (name - argnames); + return 1; } - } else - goto invalid_keyword_type; - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; } + #endif + name++; + } + name = argnames; + while (name != first_kw_arg) { + PyObject *name_str = **name; + #if CYTHON_USE_UNICODE_INTERNALS + if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) { + if (__Pyx_UnicodeKeywordsEqual(name_str, key)) + goto arg_passed_twice; + } + #else + #if CYTHON_ASSUME_SAFE_SIZE + if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key)) + #endif + { + if (unlikely(name_str == key)) goto arg_passed_twice; + int cmp = PyUnicode_Compare(name_str, key); + if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; + if (cmp == 0) goto arg_passed_twice; + } + #endif + name++; + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, key); + goto bad; +bad: + return -1; +} +static int __Pyx_MatchKeywordArg_nostr( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + PyObject ** const *name; + if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type; + name = first_kw_arg; + while (*name) { + int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); + if (cmp == 1) { + *index_found = (size_t) (name - argnames); + return 1; + } + if (unlikely(cmp == -1)) goto bad; + name++; + } + name = argnames; + while (name != first_kw_arg) { + int cmp = PyObject_RichCompareBool(**name, key, Py_EQ); + if (unlikely(cmp != 0)) { + if (cmp == 1) goto arg_passed_twice; + else goto bad; + } + name++; } - Py_XDECREF(key); - Py_XDECREF(value); return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, key); @@ -8217,21 +7843,244 @@ static int __Pyx_ParseOptionalKeywords( PyErr_Format(PyExc_TypeError, "%.200s() keywords must be strings", function_name); goto bad; -invalid_keyword: - #if PY_MAJOR_VERSION < 3 - PyErr_Format(PyExc_TypeError, - "%.200s() got an unexpected keyword argument '%.200s'", - function_name, PyString_AsString(key)); +bad: + return -1; +} +static CYTHON_INLINE int __Pyx_MatchKeywordArg( + PyObject *key, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + size_t *index_found, + const char *function_name) +{ + return likely(PyUnicode_CheckExact(key)) ? + __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) : + __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name); +} +static void __Pyx_RejectUnknownKeyword( + PyObject *kwds, + PyObject ** const argnames[], + PyObject ** const *first_kw_arg, + const char *function_name) +{ + Py_ssize_t pos = 0; + PyObject *key = NULL; + __Pyx_BEGIN_CRITICAL_SECTION(kwds); + while (PyDict_Next(kwds, &pos, &key, NULL)) { + PyObject** const *name = first_kw_arg; + while (*name && (**name != key)) name++; + if (!*name) { + #if CYTHON_AVOID_BORROWED_REFS + Py_INCREF(key); + #endif + size_t index_found = 0; + int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); + if (cmp != 1) { + if (cmp == 0) { + PyErr_Format(PyExc_TypeError, + "%s() got an unexpected keyword argument '%U'", + function_name, key); + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif + break; + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + #endif + } + } + __Pyx_END_CRITICAL_SECTION(); + assert(PyErr_Occurred()); +} +static int __Pyx_ParseKeywordDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs) +{ + PyObject** const *name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + Py_ssize_t extracted = 0; +#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) + if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; +#endif + name = first_kw_arg; + while (*name && num_kwargs > extracted) { + PyObject * key = **name; + PyObject *value; + int found = 0; + #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + found = PyDict_GetItemRef(kwds, key, &value); + #else + value = PyDict_GetItemWithError(kwds, key); + if (value) { + Py_INCREF(value); + found = 1; + } else { + if (unlikely(PyErr_Occurred())) goto bad; + } + #endif + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + extracted++; + } + name++; + } + if (num_kwargs > extracted) { + if (ignore_unknown_kwargs) { + if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1)) + goto bad; + } else { + __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name); + goto bad; + } + } + return 0; +bad: + return -1; +} +static int __Pyx_ParseKeywordDictToDict( + PyObject *kwds, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject** const *name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + Py_ssize_t len; +#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments) + if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1; +#endif + if (PyDict_Update(kwds2, kwds) < 0) goto bad; + name = first_kw_arg; + while (*name) { + PyObject *key = **name; + PyObject *value; +#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop)) + int found = PyDict_Pop(kwds2, key, &value); + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + } +#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000 + int found = PyDict_GetItemRef(kwds2, key, &value); + if (found) { + if (unlikely(found < 0)) goto bad; + values[name-argnames] = value; + if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad; + } +#else + #if CYTHON_COMPILING_IN_CPYTHON + value = _PyDict_Pop(kwds2, key, kwds2); #else + value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2); + #endif + if (value == kwds2) { + Py_DECREF(value); + } else { + if (unlikely(!value)) goto bad; + values[name-argnames] = value; + } +#endif + name++; + } + len = PyDict_Size(kwds2); + if (len > 0) { + return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name); + } else if (unlikely(len == -1)) { + goto bad; + } + return 0; +bad: + return -1; +} +static int __Pyx_ParseKeywordsTuple( + PyObject *kwds, + PyObject * const *kwvalues, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs) +{ + PyObject *key = NULL; + PyObject** const * name; + PyObject** const *first_kw_arg = argnames + num_pos_args; + for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) { +#if CYTHON_AVOID_BORROWED_REFS + key = __Pyx_PySequence_ITEM(kwds, pos); +#else + key = __Pyx_PyTuple_GET_ITEM(kwds, pos); +#endif +#if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely(!key)) goto bad; +#endif + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + PyObject *value = kwvalues[pos]; + values[name-argnames] = __Pyx_NewRef(value); + } else { + size_t index_found = 0; + int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name); + if (cmp == 1) { + PyObject *value = kwvalues[pos]; + values[index_found] = __Pyx_NewRef(value); + } else { + if (unlikely(cmp == -1)) goto bad; + if (kwds2) { + PyObject *value = kwvalues[pos]; + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else if (!ignore_unknown_kwargs) { + goto invalid_keyword; + } + } + } + #if CYTHON_AVOID_BORROWED_REFS + Py_DECREF(key); + key = NULL; + #endif + } + return 0; +invalid_keyword: PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument '%U'", function_name, key); - #endif + goto bad; bad: + #if CYTHON_AVOID_BORROWED_REFS Py_XDECREF(key); - Py_XDECREF(value); + #endif return -1; } +static int __Pyx_ParseKeywords( + PyObject *kwds, + PyObject * const *kwvalues, + PyObject ** const argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + Py_ssize_t num_kwargs, + const char* function_name, + int ignore_unknown_kwargs) +{ + if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) + return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); + else if (kwds2) + return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name); + else + return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs); +} /* RaiseArgTupleInvalid */ static void __Pyx_RaiseArgtupleInvalid( @@ -8254,64 +8103,12 @@ static void __Pyx_RaiseArgtupleInvalid( more_or_less = "exactly"; } PyErr_Format(PyExc_TypeError, - "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", - func_name, more_or_less, num_expected, - (num_expected == 1) ? "" : "s", num_found); -} - -/* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - __Pyx_PyThreadState_declare - CYTHON_UNUSED_VAR(cause); - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; + "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", + func_name, more_or_less, num_expected, + (num_expected == 1) ? "" : "s", num_found); } -#else + +/* RaiseException */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { PyObject* owned_instance = NULL; if (tb == Py_None) { @@ -8396,9 +8193,9 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject } PyErr_SetObject(type, value); if (tb) { - #if PY_VERSION_HEX >= 0x030C00A6 +#if PY_VERSION_HEX >= 0x030C00A6 PyException_SetTraceback(value, tb); - #elif CYTHON_FAST_THREAD_STATE +#elif CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { @@ -8418,13 +8215,12 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject Py_XDECREF(owned_instance); return; } -#endif /* RaiseUnexpectedTypeError */ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj) { - __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME, expected, obj_type_name); __Pyx_DECREF_TypeName(obj_type_name); @@ -8436,39 +8232,59 @@ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *nam { __Pyx_TypeName type_name; __Pyx_TypeName obj_type_name; + PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode; + int from_annotation_subclass = 0; if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } - else if (exact) { - #if PY_MAJOR_VERSION == 2 - if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; - #endif - } - else { + else if (!exact) { if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } else if (exact == 2) { + if (__Pyx_TypeCheck(obj, type)) { + from_annotation_subclass = 1; + extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately; + } } - type_name = __Pyx_PyType_GetName(type); - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + type_name = __Pyx_PyType_GetFullyQualifiedName(type); + obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj)); PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME - ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name); + ", got " __Pyx_FMT_TYPENAME ")" +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + "%s%U" +#endif + , name, type_name, obj_type_name +#if __PYX_LIMITED_VERSION_HEX < 0x030C0000 + , (from_annotation_subclass ? ". " : ""), extra_info +#endif + ); +#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000 + if (exact == 2 && from_annotation_subclass) { + PyObject *res; + PyObject *vargs[2]; + vargs[0] = PyErr_GetRaisedException(); + vargs[1] = extra_info; + res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL); + Py_XDECREF(res); + PyErr_SetRaisedException(vargs[0]); + } +#endif __Pyx_DECREF_TypeName(type_name); __Pyx_DECREF_TypeName(obj_type_name); return 0; } /* TypeImport */ -#ifndef __PYX_HAVE_RT_ImportType_3_0_12 -#define __PYX_HAVE_RT_ImportType_3_0_12 -static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *module_name, const char *class_name, - size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size) +#ifndef __PYX_HAVE_RT_ImportType_3_1_4 +#define __PYX_HAVE_RT_ImportType_3_1_4 +static PyTypeObject *__Pyx_ImportType_3_1_4(PyObject *module, const char *module_name, const char *class_name, + size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_4 check_size) { PyObject *result = 0; - char warning[200]; Py_ssize_t basicsize; Py_ssize_t itemsize; -#if CYTHON_COMPILING_IN_LIMITED_API +#ifdef Py_LIMITED_API PyObject *py_basicsize; PyObject *py_itemsize; #endif @@ -8481,10 +8297,13 @@ static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *modul module_name, class_name); goto bad; } -#if !CYTHON_COMPILING_IN_LIMITED_API +#ifndef Py_LIMITED_API basicsize = ((PyTypeObject *)result)->tp_basicsize; itemsize = ((PyTypeObject *)result)->tp_itemsize; #else + if (size == 0) { + return (PyTypeObject *)result; + } py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); if (!py_basicsize) goto bad; @@ -8516,7 +8335,7 @@ static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *modul module_name, class_name, size, basicsize+itemsize); goto bad; } - if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_12 && + if (check_size == __Pyx_ImportType_CheckSize_Error_3_1_4 && ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " @@ -8524,12 +8343,13 @@ static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *modul module_name, class_name, size, basicsize, basicsize+itemsize); goto bad; } - else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_12 && (size_t)basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility. " - "Expected %zd from C header, got %zd from PyObject", - module_name, class_name, size, basicsize); - if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_1_4 && (size_t)basicsize > size) { + if (PyErr_WarnFormat(NULL, 0, + "%.200s.%.200s size changed, may indicate binary incompatibility. " + "Expected %zd from C header, got %zd from PyObject", + module_name, class_name, size, basicsize) < 0) { + goto bad; + } } return (PyTypeObject *)result; bad: @@ -8538,6 +8358,25 @@ static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *modul } #endif +/* ListPack */ +static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) { + va_list va; + PyObject *l = PyList_New(n); + va_start(va, n); + if (unlikely(!l)) goto end; + for (Py_ssize_t i=0; i__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON - cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); + cython_runtime_dict = _PyObject_GetDictPtr(__pyx_mstate_global->__pyx_cython_runtime); if (likely(cython_runtime_dict)) { + __Pyx_BEGIN_CRITICAL_SECTION(*cython_runtime_dict); __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, - __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) + __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback)) + Py_XINCREF(use_cline); + __Pyx_END_CRITICAL_SECTION(); } else #endif { - PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); + PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; + Py_INCREF(use_cline); Py_DECREF(use_cline_obj); } else { PyErr_Clear(); @@ -8597,18 +8440,18 @@ static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { } if (!use_cline) { c_line = 0; - (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); + (void) PyObject_SetAttr(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } + Py_XDECREF(use_cline); __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ -#if !CYTHON_COMPILING_IN_LIMITED_API static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { int start = 0, mid = 0, end = count - 1; if (end >= 0 && code_line > entries[end].code_line) { @@ -8630,64 +8473,103 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co return mid + 1; } } -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; +static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) { + __Pyx_CachedCodeObjectType* code_object; int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { + if (unlikely(!code_line) || unlikely(!code_cache->entries)) { return NULL; } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { + pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); + if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) { return NULL; } - code_object = __pyx_code_cache.entries[pos].code_object; + code_object = code_cache->entries[pos].code_object; Py_INCREF(code_object); return code_object; } -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { +static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) { +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS + (void)__pyx__find_code_object; + return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss. +#else + struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count); + if (old_count < 0) { + __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); + return NULL; + } +#endif + __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line); +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_decr_acq_rel(&code_cache->accessor_count); +#endif + return result; +#endif +} +static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object) +{ int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; + __Pyx_CodeObjectCacheEntry* entries = code_cache->entries; if (unlikely(!code_line)) { return; } if (unlikely(!entries)) { entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; + code_cache->entries = entries; + code_cache->max_count = 64; + code_cache->count = 1; entries[0].code_line = code_line; entries[0].code_object = code_object; Py_INCREF(code_object); } return; } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; + pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line); + if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) { + __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object; entries[pos].code_object = code_object; + Py_INCREF(code_object); Py_DECREF(tmp); return; } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; + if (code_cache->count == code_cache->max_count) { + int new_max = code_cache->max_count + 64; entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); + code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry)); if (unlikely(!entries)) { return; } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; + code_cache->entries = entries; + code_cache->max_count = new_max; } - for (i=__pyx_code_cache.count; i>pos; i--) { + for (i=code_cache->count; i>pos; i--) { entries[i] = entries[i-1]; } entries[pos].code_line = code_line; entries[pos].code_object = code_object; - __pyx_code_cache.count++; + code_cache->count++; Py_INCREF(code_object); } +static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) { +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS + (void)__pyx__insert_code_object; + return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail. +#else + struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache; +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_nonatomic_int_type expected = 0; + if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) { + return; + } +#endif + __pyx__insert_code_object(code_cache, code_line, code_object); +#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING + __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN); #endif +#endif +} /* AddTraceback */ #include "compile.h" @@ -8707,35 +8589,12 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL; replace = PyObject_GetAttrString(code, "replace"); if (likely(replace)) { - PyObject *result; - result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict); + PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict); Py_DECREF(replace); return result; } PyErr_Clear(); - #if __PYX_LIMITED_VERSION_HEX < 0x030780000 - { - PyObject *compiled = NULL, *result = NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL; - if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL; - compiled = Py_CompileString( - "out = type(code)(\n" - " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n" - " code.co_flags, code.co_code, code.co_consts, code.co_names,\n" - " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n" - " code.co_lnotab)\n", "", Py_file_input); - if (!compiled) return NULL; - result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict); - Py_DECREF(compiled); - if (!result) PyErr_Print(); - Py_DECREF(result); - result = PyDict_GetItemString(scratch_dict, "out"); - if (result) Py_INCREF(result); - return result; - } - #else return NULL; - #endif } static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename) { @@ -8748,20 +8607,26 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line); } PyErr_Fetch(&exc_type, &exc_value, &exc_traceback); - code_object = Py_CompileString("_getframe()", filename, Py_eval_input); - if (unlikely(!code_object)) goto bad; - py_py_line = PyLong_FromLong(py_line); - if (unlikely(!py_py_line)) goto bad; - py_funcname = PyUnicode_FromString(funcname); - if (unlikely(!py_funcname)) goto bad; - dict = PyDict_New(); - if (unlikely(!dict)) goto bad; - { - PyObject *old_code_object = code_object; - code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); - Py_DECREF(old_code_object); + code_object = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!code_object) { + code_object = Py_CompileString("_getframe()", filename, Py_eval_input); + if (unlikely(!code_object)) goto bad; + py_py_line = PyLong_FromLong(py_line); + if (unlikely(!py_py_line)) goto bad; + py_funcname = PyUnicode_FromString(funcname); + if (unlikely(!py_funcname)) goto bad; + dict = PyDict_New(); + if (unlikely(!dict)) goto bad; + { + PyObject *old_code_object = code_object; + code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname); + Py_DECREF(old_code_object); + } + if (unlikely(!code_object)) goto bad; + __pyx_insert_code_object(c_line ? -c_line : py_line, code_object); + } else { + dict = PyDict_New(); } - if (unlikely(!code_object)) goto bad; getframe = PySys_GetObject("_getframe"); if (unlikely(!getframe)) goto bad; if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad; @@ -8787,58 +8652,17 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( int py_line, const char *filename) { PyCodeObject *py_code = NULL; PyObject *py_funcname = NULL; - #if PY_MAJOR_VERSION < 3 - PyObject *py_srcfile = NULL; - py_srcfile = PyString_FromString(filename); - if (!py_srcfile) goto bad; - #endif if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - if (!py_funcname) goto bad; - #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); if (!py_funcname) goto bad; funcname = PyUnicode_AsUTF8(py_funcname); if (!funcname) goto bad; - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - if (!py_funcname) goto bad; - #endif } - #if PY_MAJOR_VERSION < 3 - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - #else py_code = PyCode_NewEmpty(filename, funcname, py_line); - #endif Py_XDECREF(py_funcname); return py_code; bad: Py_XDECREF(py_funcname); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(py_srcfile); - #endif return NULL; } static void __Pyx_AddTraceback(const char *funcname, int c_line, @@ -8869,7 +8693,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, py_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ + __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; @@ -8904,7 +8728,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line, } /* CIntFromPy */ -static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { +static CYTHON_INLINE uint32_t __Pyx_PyLong_As_uint32_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -8914,24 +8738,11 @@ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(uint32_t) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (uint32_t) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { uint32_t val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (uint32_t) -1; - val = __Pyx_PyInt_As_uint32_t(tmp); + val = __Pyx_PyLong_As_uint32_t(tmp); Py_DECREF(tmp); return val; } @@ -9171,7 +8982,7 @@ static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) { } /* CIntFromPy */ -static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) { +static CYTHON_INLINE uint64_t __Pyx_PyLong_As_uint64_t(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -9181,24 +8992,11 @@ static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(uint64_t) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(uint64_t, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (uint64_t) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { uint64_t val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (uint64_t) -1; - val = __Pyx_PyInt_As_uint64_t(tmp); + val = __Pyx_PyLong_As_uint64_t(tmp); Py_DECREF(tmp); return val; } @@ -9437,8 +9235,40 @@ static CYTHON_INLINE uint64_t __Pyx_PyInt_As_uint64_t(PyObject *x) { return (uint64_t) -1; } +/* PyObjectVectorCallKwBuilder */ +#if CYTHON_VECTORCALL +static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_PyObject_FastCallDict; + if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1; + Py_INCREF(key); + args[n] = value; + return 0; +} +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + (void)__Pyx_VectorcallBuilder_AddArgStr; + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n); +} +static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) { + PyObject *pyKey = PyUnicode_FromString(key); + if (!pyKey) return -1; + return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n); +} +#else // CYTHON_VECTORCALL +CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) { + if (unlikely(!PyUnicode_Check(key))) { + PyErr_SetString(PyExc_TypeError, "keywords must be strings"); + return -1; + } + return PyDict_SetItem(builder, key, value); +} +#endif + /* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint32_t(uint32_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -9450,17 +9280,17 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint32_t) < sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); } else if (sizeof(uint32_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG +#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint32_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); @@ -9481,25 +9311,25 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + PyObject *from_bytes, *result = NULL, *kwds = NULL; + PyObject *py_bytes = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint32_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - if (!is_unsigned) { - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + { + PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; + if (!is_unsigned) { + kwds = __Pyx_MakeVectorcallBuilderKwds(1); + if (!kwds) goto limited_bad; + if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; + } + result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } - result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); - Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); @@ -9509,7 +9339,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) { } /* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint64_t(uint64_t value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -9521,17 +9351,17 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(uint64_t) < sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); } else if (sizeof(uint64_t) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG +#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY } else if (sizeof(uint64_t) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(uint64_t) <= sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); @@ -9552,25 +9382,25 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + PyObject *from_bytes, *result = NULL, *kwds = NULL; + PyObject *py_bytes = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint64_t)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - if (!is_unsigned) { - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + { + PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; + if (!is_unsigned) { + kwds = __Pyx_MakeVectorcallBuilderKwds(1); + if (!kwds) goto limited_bad; + if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; + } + result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } - result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); - Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); @@ -9580,23 +9410,46 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint64_t(uint64_t value) { } /* FormatTypeName */ -#if CYTHON_COMPILING_IN_LIMITED_API +#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000 static __Pyx_TypeName -__Pyx_PyType_GetName(PyTypeObject* tp) +__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp) { - PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, - __pyx_n_s_name); - if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { - PyErr_Clear(); - Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__17); + PyObject *module = NULL, *name = NULL, *result = NULL; + #if __PYX_LIMITED_VERSION_HEX < 0x030b0000 + name = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_mstate_global->__pyx_n_u_qualname); + #else + name = PyType_GetQualName(tp); + #endif + if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad; + module = __Pyx_PyObject_GetAttrStr((PyObject *)tp, + __pyx_mstate_global->__pyx_n_u_module); + if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad; + if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) { + result = name; + name = NULL; + goto done; + } + result = PyUnicode_FromFormat("%U.%U", module, name); + if (unlikely(result == NULL)) goto bad; + done: + Py_XDECREF(name); + Py_XDECREF(module); + return result; + bad: + PyErr_Clear(); + if (name) { + result = name; + name = NULL; + } else { + result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_); } - return name; + goto done; } #endif /* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { +static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -9608,17 +9461,17 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const int is_unsigned = neg_one > const_zero; if (is_unsigned) { if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); } else if (sizeof(long) <= sizeof(unsigned long)) { return PyLong_FromUnsignedLong((unsigned long) value); -#ifdef HAVE_LONG_LONG +#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); + return PyLong_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); @@ -9639,25 +9492,25 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { little, !is_unsigned); #else int one = 1; int little = (int)*(unsigned char *)&one; - PyObject *from_bytes, *result = NULL; - PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL; + PyObject *from_bytes, *result = NULL, *kwds = NULL; + PyObject *py_bytes = NULL, *order_str = NULL; from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes"); if (!from_bytes) return NULL; py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long)); if (!py_bytes) goto limited_bad; order_str = PyUnicode_FromString(little ? "little" : "big"); if (!order_str) goto limited_bad; - arg_tuple = PyTuple_Pack(2, py_bytes, order_str); - if (!arg_tuple) goto limited_bad; - if (!is_unsigned) { - kwds = PyDict_New(); - if (!kwds) goto limited_bad; - if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad; + { + PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str }; + if (!is_unsigned) { + kwds = __Pyx_MakeVectorcallBuilderKwds(1); + if (!kwds) goto limited_bad; + if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad; + } + result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds); } - result = PyObject_Call(from_bytes, arg_tuple, kwds); limited_bad: Py_XDECREF(kwds); - Py_XDECREF(arg_tuple); Py_XDECREF(order_str); Py_XDECREF(py_bytes); Py_XDECREF(from_bytes); @@ -9667,7 +9520,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { } /* CIntFromPy */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { +static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -9677,24 +9530,11 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(long) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); + val = __Pyx_PyLong_As_long(tmp); Py_DECREF(tmp); return val; } @@ -9934,7 +9774,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { } /* CIntFromPy */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { +static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) { #ifdef __Pyx_HAS_GCC_DIAGNOSTIC #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wconversion" @@ -9944,24 +9784,11 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { #pragma GCC diagnostic pop #endif const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if ((sizeof(int) < sizeof(long))) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } -#endif if (unlikely(!PyLong_Check(x))) { int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + PyObject *tmp = __Pyx_PyNumber_Long(x); if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); + val = __Pyx_PyLong_As_int(tmp); Py_DECREF(tmp); return val; } @@ -10241,29 +10068,6 @@ static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, } return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b); } -#if PY_MAJOR_VERSION == 2 -static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { - PyObject *exception, *value, *tb; - int res; - __Pyx_PyThreadState_declare - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&exception, &value, &tb); - res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - if (!res) { - res = PyObject_IsSubclass(err, exc_type2); - if (unlikely(res == -1)) { - PyErr_WriteUnraisable(err); - res = 0; - } - } - __Pyx_ErrRestore(exception, value, tb); - return res; -} -#else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { if (exc_type1) { return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2); @@ -10271,21 +10075,15 @@ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } } -#endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); -#if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x030B00A4 +#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000 return Py_Version & ~0xFFUL; #else - const char* rt_version = Py_GetVersion(); - unsigned long version = 0; - unsigned long factor = 0x01000000UL; - unsigned int digit = 0; - int i = 0; - while (factor) { - while ('0' <= rt_version[i] && rt_version[i] <= '9') { - digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + static unsigned long __Pyx_cached_runtime_version = 0; + if (__Pyx_cached_runtime_version == 0) { + const char* rt_version = Py_GetVersion(); + unsigned long version = 0; + unsigned long factor = 0x01000000UL; + unsigned int digit = 0; + int i = 0; + while (factor) { + while ('0' <= rt_version[i] && rt_version[i] <= '9') { + digit = digit * 10 + (unsigned int) (rt_version[i] - '0'); + ++i; + } + version += factor * digit; + if (rt_version[i] != '.') + break; + digit = 0; + factor >>= 8; ++i; } - version += factor * digit; - if (rt_version[i] != '.') - break; - digit = 0; - factor >>= 8; - ++i; + __Pyx_cached_runtime_version = version; } - return version; + return __Pyx_cached_runtime_version; #endif } + +/* CheckBinaryVersion */ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) { const unsigned long MAJOR_MINOR = 0xFFFF0000UL; if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR)) @@ -10364,44 +10168,27 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt } /* InitStrings */ -#if PY_MAJOR_VERSION >= 3 -static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) { - if (t.is_unicode | t.is_str) { - if (t.intern) { - *str = PyUnicode_InternFromString(t.s); - } else if (t.encoding) { - *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL); - } else { - *str = PyUnicode_FromStringAndSize(t.s, t.n - 1); - } - } else { - *str = PyBytes_FromStringAndSize(t.s, t.n - 1); - } - if (!*str) - return -1; - if (PyObject_Hash(*str) == -1) - return -1; - return 0; -} -#endif -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION >= 3 - __Pyx_InitString(*t, t->p); - #else +static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names) { + while (t->s) { + PyObject *str; if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); + if (t->intern) { + str = PyUnicode_InternFromString(t->s); + } else if (t->encoding) { + str = PyUnicode_Decode(t->s, t->n - 1, encoding_names[t->encoding], NULL); + } else { + str = PyUnicode_FromStringAndSize(t->s, t->n - 1); + } } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + str = PyBytes_FromStringAndSize(t->s, t->n - 1); } - if (!*t->p) + if (!str) return -1; - if (PyObject_Hash(*t->p) == -1) + *target = str; + if (PyObject_Hash(str) == -1) return -1; - #endif ++t; + ++target; } return 0; } @@ -10429,31 +10216,30 @@ static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -#if !CYTHON_PEP393_ENABLED -static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 +static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { + if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; +#if CYTHON_COMPILING_IN_LIMITED_API { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } + const char* result; + Py_ssize_t unicode_length; + CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + #if __PYX_LIMITED_VERSION_HEX < 0x030A0000 + if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL; + #else + result = PyUnicode_AsUTF8AndSize(o, length); + #endif + #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + unicode_length = PyUnicode_GetLength(o); + if (unlikely(unicode_length < 0)) return NULL; + if (unlikely(unicode_length != *length)) { + PyUnicode_AsASCIIString(o); + return NULL; } + #endif + return result; } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -} #else -static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { - if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); @@ -10465,25 +10251,25 @@ static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py #else return PyUnicode_AsUTF8AndSize(o, length); #endif -} #endif +} #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { +#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 + if (PyUnicode_Check(o)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif -#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { +#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))) *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); - } else +#else + *length = PyByteArray_Size(o); + if (*length == -1) return NULL; + return PyByteArray_AsString(o); #endif + } else { char* result; int r = PyBytes_AsStringAndSize(o, &result, length); @@ -10506,9 +10292,8 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { Py_DECREF(x); return retval; } -static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { - __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result)); -#if PY_MAJOR_VERSION >= 3 +static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) { + __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result)); if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). " @@ -10522,74 +10307,44 @@ static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const __Pyx_DECREF_TypeName(result_type_name); return result; } -#endif PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")", - type_name, type_name, result_type_name); + "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")", + result_type_name); __Pyx_DECREF_TypeName(result_type_name); Py_DECREF(result); return NULL; } -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { +static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif - const char *name = NULL; PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x) || PyLong_Check(x))) -#else if (likely(PyLong_Check(x))) -#endif - return __Pyx_NewRef(x); + return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; - #if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = m->nb_int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = m->nb_long(x); - } - #else if (likely(m && m->nb_int)) { - name = "int"; - res = m->nb_int(x); + res = m->nb_int(x); } - #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { - res = PyNumber_Int(x); + res = PyNumber_Long(x); } #endif if (likely(res)) { -#if PY_MAJOR_VERSION < 3 - if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { -#else - if (unlikely(!PyLong_CheckExact(res))) { -#endif - return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); - } + if (unlikely(!PyLong_CheckExact(res))) { + return __Pyx_PyNumber_LongWrongResultType(res); + } } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); + PyErr_SetString(PyExc_TypeError, + "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(b); - } -#endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS if (likely(__Pyx_PyLong_IsCompact(b))) { @@ -10635,34 +10390,349 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { } x = PyNumber_Index(b); if (!x) return -1; - ival = PyInt_AsSsize_t(x); + ival = PyLong_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) { if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) { return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o); -#if PY_MAJOR_VERSION < 3 - } else if (likely(PyInt_CheckExact(o))) { - return PyInt_AS_LONG(o); -#endif } else { Py_ssize_t ival; PyObject *x; x = PyNumber_Index(o); if (!x) return -1; - ival = PyInt_AsLong(x); + ival = PyLong_AsLong(x); Py_DECREF(x); return ival; } } +static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) { + CYTHON_UNUSED_VAR(b); + return __Pyx_NewRef(Py_None); +} static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); +static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) { + return PyLong_FromSize_t(ival); +} + + +/* MultiPhaseInitModuleState */ +#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE +#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000) + #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1 +#else + #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0 +#endif +#endif +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS +#error "Module state with PEP489 requires atomics. Currently that's one of\ + C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics" +#endif +#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +#define __Pyx_ModuleStateLookup_Lock() +#define __Pyx_ModuleStateLookup_Unlock() +#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000 +static PyMutex __Pyx_ModuleStateLookup_mutex = {0}; +#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(__cplusplus) && __cplusplus >= 201103L +#include +static std::mutex __Pyx_ModuleStateLookup_mutex; +#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock() +#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock() +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__) +#include +static mtx_t __Pyx_ModuleStateLookup_mutex; +static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT; +static void __Pyx_ModuleStateLookup_initialize_mutex(void) { + mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain); +} +#define __Pyx_ModuleStateLookup_Lock()\ + call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\ + mtx_lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(HAVE_PTHREAD_H) +#include +static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER; +#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex) +#elif defined(_WIN32) +#include // synchapi.h on its own doesn't work +static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT; +#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) +#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex) +#else +#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\ + Requires C standard >= C11, or C++ standard >= C++11,\ + or pthreads, or the Windows 32 API, or Python >= 3.13." +#endif +typedef struct { + int64_t id; + PyObject *module; +} __Pyx_InterpreterIdAndModule; +typedef struct { + char interpreter_id_as_index; + Py_ssize_t count; + Py_ssize_t allocated; + __Pyx_InterpreterIdAndModule table[1]; +} __Pyx_ModuleStateLookupData; +#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32 +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0; +#endif +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0; +#else +static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL; +#endif +static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound( + __Pyx_InterpreterIdAndModule* table, + Py_ssize_t count, + int64_t interpreterId) { + __Pyx_InterpreterIdAndModule* begin = table; + __Pyx_InterpreterIdAndModule* end = begin + count; + if (begin->id == interpreterId) { + return begin; + } + while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { + __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2; + if (halfway->id == interpreterId) { + return halfway; + } + if (halfway->id < interpreterId) { + begin = halfway; + } else { + end = halfway; + } + } + for (; begin < end; ++begin) { + if (begin->id >= interpreterId) return begin; + } + return begin; +} +static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return NULL; +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); + { + __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); + if (likely(data)) { + __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data); + if (likely(data == new_data)) { + goto read_finished; + } + } + __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); + __Pyx_ModuleStateLookup_Lock(); + __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter); + data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data); + __Pyx_ModuleStateLookup_Unlock(); + } + read_finished:; +#else + __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data; +#endif + __Pyx_InterpreterIdAndModule* found = NULL; + if (unlikely(!data)) goto end; + if (data->interpreter_id_as_index) { + if (interpreter_id < data->count) { + found = data->table+interpreter_id; + } + } else { + found = __Pyx_State_FindModuleStateLookupTableLowerBound( + data->table, data->count, interpreter_id); + } + end: + { + PyObject *result=NULL; + if (found && found->id == interpreter_id) { + result = found->module; + } +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter); +#endif + return result; + } +} +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE +static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) { + while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0); } - +#else +#define __Pyx_ModuleStateLookup_wait_until_no_readers() +#endif +static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) { + Py_ssize_t to_allocate = (*old_data)->allocated; + while (to_allocate <= interpreter_id) { + if (to_allocate == 0) to_allocate = 1; + else to_allocate *= 2; + } + __Pyx_ModuleStateLookupData *new_data = *old_data; + if (to_allocate != (*old_data)->allocated) { + new_data = (__Pyx_ModuleStateLookupData *)realloc( + *old_data, + sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); + if (!new_data) { + PyErr_NoMemory(); + return -1; + } + for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) { + new_data->table[i].id = i; + new_data->table[i].module = NULL; + } + new_data->allocated = to_allocate; + } + new_data->table[interpreter_id].module = module; + if (new_data->count < interpreter_id+1) { + new_data->count = interpreter_id+1; + } + *old_data = new_data; + return 0; +} +static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) { + __Pyx_InterpreterIdAndModule *read = data->table; + __Pyx_InterpreterIdAndModule *write = data->table; + __Pyx_InterpreterIdAndModule *end = read + data->count; + for (; readmodule) { + write->id = read->id; + write->module = read->module; + ++write; + } + } + data->count = write - data->table; + for (; writeid = 0; + write->module = NULL; + } + data->interpreter_id_as_index = 0; +} +static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return -1; + int result = 0; + __Pyx_ModuleStateLookup_Lock(); +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *) + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); +#else + __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data; +#endif + __Pyx_ModuleStateLookupData *new_data = old_data; + if (!new_data) { + new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData)); + if (!new_data) { + result = -1; + PyErr_NoMemory(); + goto end; + } + new_data->allocated = 1; + new_data->interpreter_id_as_index = 1; + } + __Pyx_ModuleStateLookup_wait_until_no_readers(); + if (new_data->interpreter_id_as_index) { + if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) { + result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id); + goto end; + } + __Pyx_State_ConvertFromInterpIdAsIndex(new_data); + } + { + Py_ssize_t insert_at = 0; + { + __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( + new_data->table, new_data->count, interpreter_id); + assert(lower_bound); + insert_at = lower_bound - new_data->table; + if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) { + lower_bound->module = module; + goto end; // already in table, nothing more to do + } + } + if (new_data->count+1 >= new_data->allocated) { + Py_ssize_t to_allocate = (new_data->count+1)*2; + new_data = + (__Pyx_ModuleStateLookupData*)realloc( + new_data, + sizeof(__Pyx_ModuleStateLookupData) + + (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule)); + if (!new_data) { + result = -1; + new_data = old_data; + PyErr_NoMemory(); + goto end; + } + new_data->allocated = to_allocate; + } + ++new_data->count; + int64_t last_id = interpreter_id; + PyObject *last_module = module; + for (Py_ssize_t i=insert_at; icount; ++i) { + int64_t current_id = new_data->table[i].id; + new_data->table[i].id = last_id; + last_id = current_id; + PyObject *current_module = new_data->table[i].module; + new_data->table[i].module = last_module; + last_module = current_module; + } + } + end: +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data); +#else + __Pyx_ModuleStateLookup_data = new_data; +#endif + __Pyx_ModuleStateLookup_Unlock(); + return result; +} +static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) { + int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get()); + if (interpreter_id == -1) return -1; + __Pyx_ModuleStateLookup_Lock(); +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *) + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0); +#else + __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data; +#endif + if (data->interpreter_id_as_index) { + if (interpreter_id < data->count) { + data->table[interpreter_id].module = NULL; + } + goto done; + } + { + __Pyx_ModuleStateLookup_wait_until_no_readers(); + __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound( + data->table, data->count, interpreter_id); + if (!lower_bound) goto done; + if (lower_bound->id != interpreter_id) goto done; + __Pyx_InterpreterIdAndModule *end = data->table+data->count; + for (;lower_boundid = (lower_bound+1)->id; + lower_bound->module = (lower_bound+1)->module; + } + } + --data->count; + if (data->count == 0) { + free(data); + data = NULL; + } + done: +#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE + __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data); +#else + __Pyx_ModuleStateLookup_data = data; +#endif + __Pyx_ModuleStateLookup_Unlock(); + return 0; +} +#endif /* #### Code section: utility_code_pragmas_end ### */ #ifdef _MSC_VER