[python] long_as_ulong

pull/2401/head
nick black 3 years ago
parent 8d0e452c9c
commit 7b4ff301eb
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -99,22 +99,22 @@ Notcurses_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
if (NULL != margin_top)
{
options.margin_t = GNU_PY_ULONG_CHECK(margin_top);
options.margin_t = GNU_PY_CHECK_UINT(margin_top);
}
if (NULL != margin_right)
{
options.margin_r = GNU_PY_ULONG_CHECK(margin_right);
options.margin_r = GNU_PY_CHECK_UINT(margin_right);
}
if (NULL != margin_bottom)
{
options.margin_b = GNU_PY_ULONG_CHECK(margin_bottom);
options.margin_b = GNU_PY_CHECK_UINT(margin_bottom);
}
if (NULL != margin_left)
{
options.margin_l = GNU_PY_ULONG_CHECK(margin_left);
options.margin_l = GNU_PY_CHECK_UINT(margin_left);
}
options.flags = (uint64_t)flags;

@ -196,6 +196,12 @@ static inline void PyObject_cleanup(PyObject **object)
return_value; \
})
#define GNU_PY_CHECK_UINT(py_function) \
({ \
unsigned return_value = py_function; \
return_value; \
})
#define GNU_PY_CHECK_BOOL(py_function) \
({ \
int return_value = py_function; \

Loading…
Cancel
Save