[PATCH 3/9] BUP_ASSIGN_PYLONG_TO_INTEGRAL: drop INTEGRAL_ASSIGNMENT_FITS

0 views
Skip to first unread message

Rob Browning

unread,
Jun 30, 2026, 2:22:31 PM (4 days ago) Jun 30
to bup-...@googlegroups.com
Just use INT_ADD_OK, (we already include intprops.h). No need for the
extra dependency.

Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---
src/bup/pyutil.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/bup/pyutil.h b/src/bup/pyutil.h
index 8e98e3ed..168ce43e 100644
--- a/src/bup/pyutil.h
+++ b/src/bup/pyutil.h
@@ -29,7 +29,7 @@ int bup_ullong_from_py(unsigned long long *x, PyObject *py, const char *name);
&& PyErr_ExceptionMatches(PyExc_OverflowError)) \
pending_overflow = 2; \
else { \
- if (INTEGRAL_ASSIGNMENT_FITS((dest), tmp)) \
+ if (INT_ADD_OK(tmp, 0, (dest))) \
result = 1; \
else \
pending_overflow = 1; \
@@ -41,7 +41,7 @@ int bup_ullong_from_py(unsigned long long *x, PyObject *py, const char *name);
&& PyErr_ExceptionMatches(PyExc_OverflowError)) \
pending_overflow = 2; \
else { \
- if (INTEGRAL_ASSIGNMENT_FITS((dest), tmp)) \
+ if (INT_ADD_OK(tmp, 0, (dest))) \
result = 1; \
else \
pending_overflow = 1; \
--
2.47.3

Reply all
Reply to author
Forward
0 new messages