Skip to content

Commit 37a83e2

Browse files
committed
move macro to pycore_long.h
1 parent 189ec83 commit 37a83e2

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Include/internal/pycore_long.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ static inline PyObject* _PyLong_FromUnsignedChar(unsigned char i)
7878
return Py_NewRef((PyObject *)&_PyLong_SMALL_INTS[_PY_NSMALLNEGINTS+i]);
7979
}
8080

81+
/// Return 0 for nonnegative, zero-or-one-digit ints, 1 otherwise
82+
static inline int
83+
negative_or_multi_digit_int(PyObject* sub) {
84+
assert(PyLong_CheckExact(sub));
85+
Py_ssize_t signed_magnitude = Py_SIZE(sub);
86+
return ((size_t)signed_magnitude) > 1;
87+
}
88+
8189
PyObject *_PyLong_Add(PyLongObject *left, PyLongObject *right);
8290
PyObject *_PyLong_Multiply(PyLongObject *left, PyLongObject *right);
8391
PyObject *_PyLong_Subtract(PyLongObject *left, PyLongObject *right);

Python/bytecodes.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@
3636
void _PyFloat_ExactDealloc(PyObject *);
3737
void _PyUnicode_ExactDealloc(PyObject *);
3838

39-
/// Return 0 for nonnegative, zero-or-one-digit ints, 1 otherwise
40-
static inline int negative_or_multi_digit_int(const PyObject *sub) {
41-
assert(PyLong_CheckExact(sub));
42-
Py_ssize_t signed_magnitude = Py_SIZE(sub)
43-
return ((size_t)signed_magnitude) > 1;
44-
}
45-
4639
/* Stack effect macros
4740
* These will be mostly replaced by stack effect descriptions,
4841
* but the tooling need to recognize them.

0 commit comments

Comments
 (0)