| 133 | |
| 134 | |
| 135 | NPY_NO_EXPORT int |
| 136 | npy_to_double(PyArray_Descr *descr, |
| 137 | const Py_UCS4 *str, const Py_UCS4 *end, char *dataptr, |
| 138 | parser_config *NPY_UNUSED(pconfig)) |
| 139 | { |
| 140 | double val; |
| 141 | const Py_UCS4 *p_end; |
| 142 | if (double_from_ucs4(str, end, true, &val, &p_end) < 0) { |
| 143 | return -1; |
| 144 | } |
| 145 | if (p_end != end) { |
| 146 | return -1; |
| 147 | } |
| 148 | |
| 149 | memcpy(dataptr, &val, sizeof(double)); |
| 150 | if (!PyArray_ISNBO(descr->byteorder)) { |
| 151 | npy_bswap8_unaligned(dataptr); |
| 152 | } |
| 153 | return 0; |
| 154 | } |
| 155 | |
| 156 | |
| 157 | static bool |
no test coverage detected