* check the floating point status * - errmask: mask of status to check * - extobj: ufunc pyvals object * may be null, in which case the thread global one is fetched * - ufunc_name: name of ufunc */
| 301 | * - ufunc_name: name of ufunc |
| 302 | */ |
| 303 | NPY_NO_EXPORT int |
| 304 | _check_ufunc_fperr(int errmask, PyObject *extobj, const char *ufunc_name) { |
| 305 | int fperr; |
| 306 | PyObject *errobj = NULL; |
| 307 | int ret; |
| 308 | int first = 1; |
| 309 | |
| 310 | if (!errmask) { |
| 311 | return 0; |
| 312 | } |
| 313 | fperr = npy_get_floatstatus_barrier((char*)extobj); |
| 314 | if (!fperr) { |
| 315 | return 0; |
| 316 | } |
| 317 | |
| 318 | /* Get error object globals */ |
| 319 | if (extobj == NULL) { |
| 320 | extobj = get_global_ext_obj(); |
| 321 | if (extobj == NULL && PyErr_Occurred()) { |
| 322 | return -1; |
| 323 | } |
| 324 | } |
| 325 | if (_extract_pyvals(extobj, ufunc_name, |
| 326 | NULL, NULL, &errobj) < 0) { |
| 327 | Py_XDECREF(errobj); |
| 328 | return -1; |
| 329 | } |
| 330 | |
| 331 | ret = PyUFunc_handlefperr(errmask, errobj, fperr, &first); |
| 332 | Py_XDECREF(errobj); |
| 333 | |
| 334 | return ret; |
| 335 | } |
| 336 | |
| 337 | |
| 338 | NPY_NO_EXPORT int |
no test coverage detected