| 3826 | |
| 3827 | |
| 3828 | SWIGINTERN int |
| 3829 | SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) |
| 3830 | { |
| 3831 | #if PY_VERSION_HEX < 0x03000000 |
| 3832 | if (PyInt_Check(obj)) { |
| 3833 | long v = PyInt_AsLong(obj); |
| 3834 | if (v >= 0) { |
| 3835 | if (val) *val = v; |
| 3836 | return SWIG_OK; |
| 3837 | } else { |
| 3838 | return SWIG_OverflowError; |
| 3839 | } |
| 3840 | } else |
| 3841 | #endif |
| 3842 | if (PyLong_Check(obj)) { |
| 3843 | unsigned long v = PyLong_AsUnsignedLong(obj); |
| 3844 | if (!PyErr_Occurred()) { |
| 3845 | if (val) *val = v; |
| 3846 | return SWIG_OK; |
| 3847 | } else { |
| 3848 | PyErr_Clear(); |
| 3849 | return SWIG_OverflowError; |
| 3850 | } |
| 3851 | } |
| 3852 | #ifdef SWIG_PYTHON_CAST_MODE |
| 3853 | { |
| 3854 | int dispatch = 0; |
| 3855 | unsigned long v = PyLong_AsUnsignedLong(obj); |
| 3856 | if (!PyErr_Occurred()) { |
| 3857 | if (val) *val = v; |
| 3858 | return SWIG_AddCast(SWIG_OK); |
| 3859 | } else { |
| 3860 | PyErr_Clear(); |
| 3861 | } |
| 3862 | if (!dispatch) { |
| 3863 | double d; |
| 3864 | int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); |
| 3865 | if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { |
| 3866 | if (val) *val = (unsigned long)(d); |
| 3867 | return res; |
| 3868 | } |
| 3869 | } |
| 3870 | } |
| 3871 | #endif |
| 3872 | return SWIG_TypeError; |
| 3873 | } |
| 3874 | |
| 3875 | |
| 3876 | #include <limits.h> |
no test coverage detected