* Coercion to boolean is done via integer right now. */
| 19 | * Coercion to boolean is done via integer right now. |
| 20 | */ |
| 21 | NPY_NO_EXPORT int |
| 22 | npy_to_bool(PyArray_Descr *NPY_UNUSED(descr), |
| 23 | const Py_UCS4 *str, const Py_UCS4 *end, char *dataptr, |
| 24 | parser_config *NPY_UNUSED(pconfig)) |
| 25 | { |
| 26 | int64_t res; |
| 27 | if (str_to_int64(str, end, INT64_MIN, INT64_MAX, &res) < 0) { |
| 28 | return -1; |
| 29 | } |
| 30 | *dataptr = (char)(res != 0); |
| 31 | return 0; |
| 32 | } |
| 33 | |
| 34 | |
| 35 | /* |
nothing calls this directly
no test coverage detected