Skip to content

Commit c93746a

Browse files
committed
Drop unused _Py_ADJUST_ERANGE2 macro
1 parent 42391fe commit c93746a

2 files changed

Lines changed: 2 additions & 19 deletions

File tree

Include/internal/pycore_pymath.h

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ extern "C" {
1010

1111

1212
/* _Py_ADJUST_ERANGE1(x)
13-
* _Py_ADJUST_ERANGE2(x, y)
14-
* Set errno to 0 before calling a libm function, and invoke one of these
15-
* macros after, passing the function result(s) (_Py_ADJUST_ERANGE2 is useful
16-
* for functions returning complex results). This makes two kinds of
13+
* Set errno to 0 before calling a libm function, and invoke macro after.
14+
* This makes two kinds of
1715
* adjustments to errno: (A) If it looks like the platform libm set
1816
* errno=ERANGE due to underflow, clear errno. (B) If it looks like the
1917
* platform libm overflowed but didn't set errno, force errno to ERANGE. In
@@ -42,20 +40,6 @@ static inline void _Py_ADJUST_ERANGE1(double x)
4240
}
4341
}
4442

45-
static inline void _Py_ADJUST_ERANGE2(double x, double y)
46-
{
47-
if (x == INFINITY || x == -INFINITY ||
48-
y == INFINITY || y == -INFINITY)
49-
{
50-
if (errno == 0) {
51-
errno = ERANGE;
52-
}
53-
}
54-
else if (errno == ERANGE) {
55-
errno = 0;
56-
}
57-
}
58-
5943

6044
//--- HAVE_PY_SET_53BIT_PRECISION macro ------------------------------------
6145
//

Objects/complexobject.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "pycore_freelist.h" // _Py_FREELIST_FREE(), _Py_FREELIST_POP()
1212
#include "pycore_long.h" // _PyLong_GetZero()
1313
#include "pycore_object.h" // _PyObject_Init()
14-
#include "pycore_pymath.h" // _Py_ADJUST_ERANGE2()
1514

1615

1716
#define _PyComplexObject_CAST(op) ((PyComplexObject *)(op))

0 commit comments

Comments
 (0)