File tree 1 file changed +3
-13
lines changed 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -222,25 +222,15 @@ PyAPI_FUNC(int) _PyLong_Size_t_Converter(PyObject *, void *);
222
222
* 2: Reserved for immortality bit
223
223
* 3+ Unsigned digit count
224
224
*/
225
- #define SIGN_MASK 3
225
+ #define SIGN_MASK _PyLong_SIGN_MASK
226
226
#define SIGN_ZERO 1
227
227
#define SIGN_NEGATIVE 2
228
- #define NON_SIZE_BITS 3
228
+ #define NON_SIZE_BITS _PyLong_NON_SIZE_BITS
229
229
230
- /* The functions _PyLong_IsCompact and _PyLong_CompactValue are defined
231
- * in Include/cpython/longobject.h, since they need to be inline.
232
- *
233
- * "Compact" values have at least one bit to spare,
230
+ /* "Compact" values have at least one bit to spare,
234
231
* so that addition and subtraction can be performed on the values
235
232
* without risk of overflow.
236
- *
237
- * The inline functions need tag bits.
238
- * For readability, rather than do `#define SIGN_MASK _PyLong_SIGN_MASK`
239
- * we define them to the numbers in both places and then assert that
240
- * they're the same.
241
233
*/
242
- static_assert (SIGN_MASK == _PyLong_SIGN_MASK , "SIGN_MASK does not match _PyLong_SIGN_MASK" );
243
- static_assert (NON_SIZE_BITS == _PyLong_NON_SIZE_BITS , "NON_SIZE_BITS does not match _PyLong_NON_SIZE_BITS" );
244
234
245
235
/* All *compact" values are guaranteed to fit into
246
236
* a Py_ssize_t with at least one bit to spare.
You can’t perform that action at this time.
0 commit comments