mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
bpo-45412: Remove Py_SET_ERRNO_ON_MATH_ERROR() macro (GH-28820)
Remove the following math macros using the errno variable: * Py_ADJUST_ERANGE1() * Py_ADJUST_ERANGE2() * Py_OVERFLOWED() * Py_SET_ERANGE_IF_OVERFLOW() * Py_SET_ERRNO_ON_MATH_ERROR() Create pycore_pymath.h internal header file. Rename Py_ADJUST_ERANGE1() and Py_ADJUST_ERANGE2() to _Py_ADJUST_ERANGE1() and _Py_ADJUST_ERANGE2(), and convert these macros to static inline functions. Move the following macros to pycore_pymath.h: * _Py_IntegralTypeSigned() * _Py_IntegralTypeMax() * _Py_IntegralTypeMin() * _Py_InIntegralTypeRange()
This commit is contained in:
parent
659812b451
commit
2f92e2a590
8 changed files with 99 additions and 113 deletions
|
|
@ -8,6 +8,7 @@
|
|||
#include "pycore_interp.h" // _PyInterpreterState.float_state
|
||||
#include "pycore_long.h" // _PyLong_GetOne()
|
||||
#include "pycore_object.h" // _PyObject_Init()
|
||||
#include "pycore_pymath.h" // _Py_ADJUST_ERANGE1()
|
||||
#include "pycore_pystate.h" // _PyInterpreterState_GET()
|
||||
|
||||
#include <ctype.h>
|
||||
|
|
@ -809,7 +810,7 @@ float_pow(PyObject *v, PyObject *w, PyObject *z)
|
|||
*/
|
||||
errno = 0;
|
||||
ix = pow(iv, iw);
|
||||
Py_ADJUST_ERANGE1(ix);
|
||||
_Py_ADJUST_ERANGE1(ix);
|
||||
if (negate_result)
|
||||
ix = -ix;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue