| 1912 | // unsigned type: (A)-1 != (B)-1 when A and B are unsigned types of different sizes). |
| 1913 | template <typename Unsigned> |
| 1914 | Unsigned as_unsigned(PyObject *o) { |
| 1915 | if (sizeof(Unsigned) <= sizeof(unsigned long)) { |
| 1916 | unsigned long v = PyLong_AsUnsignedLong(o); |
| 1917 | return v == static_cast<unsigned long>(-1) && PyErr_Occurred() ? (Unsigned) -1 |
| 1918 | : (Unsigned) v; |
| 1919 | } |
| 1920 | unsigned long long v = PyLong_AsUnsignedLongLong(o); |
| 1921 | return v == static_cast<unsigned long long>(-1) && PyErr_Occurred() ? (Unsigned) -1 |
| 1922 | : (Unsigned) v; |
| 1923 | } |
| 1924 | PYBIND11_NAMESPACE_END(detail) |
| 1925 | |
| 1926 | class int_ : public object { |
nothing calls this directly
no outgoing calls
no test coverage detected