Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-111178: Fix function signatures in longobject.c
* Add _PyLong_CAST() macro.
* Move forward declarations to the top of longobject.c.
* Change long_add(), long_sub(), long_mul(), long_neg(),
  long_lshift(), long_abs() to take PyLongObject* and return
  PyLongObject*. Avoid CHECK_BINOP() test.
* Add long_add_method(), long_sub_method(), long_mul_method(),
  long_neg_method(), long_lshift_method(), and long_abs_method()
  which take PyObject* and return PyObject*. Implement CHECK_BINOP()
  test.
* Add long_lshift_int64() function.
* _PyLong_DivmodNear() calls long_lshift_int64(obj, 1) instead of
  long_lshift_obj(obj, one).
  • Loading branch information
vstinner committed Oct 2, 2024
commit 5dd53137d576906568fb52d13f0033e8f50c036b
3 changes: 3 additions & 0 deletions Include/cpython/longobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# error "this header file must not be included directly"
#endif

#define _PyLong_CAST(op) \
(assert(PyLong_Check(op)), _Py_CAST(PyLongObject*, (op)))

PyAPI_FUNC(PyObject*) PyLong_FromUnicodeObject(PyObject *u, int base);

#define Py_ASNATIVEBYTES_DEFAULTS -1
Expand Down
Loading