mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 09:09:03 -04:00
[python] sigh
This commit is contained in:
parent
17994e422f
commit
5ab251e8d8
@ -99,22 +99,22 @@ Notcurses_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
|
||||
|
||||
if (NULL != margin_top)
|
||||
{
|
||||
options.margin_t = GNU_PY_CHECK_UINT(margin_top);
|
||||
options.margin_t = GNU_PY_UINT_CHECK(margin_top);
|
||||
}
|
||||
|
||||
if (NULL != margin_right)
|
||||
{
|
||||
options.margin_r = GNU_PY_CHECK_UINT(margin_right);
|
||||
options.margin_r = GNU_PY_UINT_CHECK(margin_right);
|
||||
}
|
||||
|
||||
if (NULL != margin_bottom)
|
||||
{
|
||||
options.margin_b = GNU_PY_CHECK_UINT(margin_bottom);
|
||||
options.margin_b = GNU_PY_UINT_CHECK(margin_bottom);
|
||||
}
|
||||
|
||||
if (NULL != margin_left)
|
||||
{
|
||||
options.margin_l = GNU_PY_CHECK_UINT(margin_left);
|
||||
options.margin_l = GNU_PY_UINT_CHECK(margin_left);
|
||||
}
|
||||
|
||||
options.flags = (uint64_t)flags;
|
||||
|
@ -196,12 +196,6 @@ static inline void PyObject_cleanup(PyObject **object)
|
||||
return_value; \
|
||||
})
|
||||
|
||||
#define GNU_PY_CHECK_UINT(py_function) \
|
||||
({ \
|
||||
unsigned return_value = (unsigned)py_function; \
|
||||
return_value; \
|
||||
})
|
||||
|
||||
#define GNU_PY_CHECK_BOOL(py_function) \
|
||||
({ \
|
||||
int return_value = py_function; \
|
||||
@ -244,14 +238,14 @@ static inline void PyObject_cleanup(PyObject **object)
|
||||
return_ptr; \
|
||||
})
|
||||
|
||||
#define GNU_PY_ULONG_CHECK(py_ulong) \
|
||||
({ \
|
||||
unsigned long new_long = PyLong_AsUnsignedLong(py_ulong); \
|
||||
if (PyErr_Occurred()) \
|
||||
{ \
|
||||
return NULL; \
|
||||
} \
|
||||
new_long; \
|
||||
#define GNU_PY_UINT_CHECK(py_ulong) \
|
||||
({ \
|
||||
unsigned new_long = PyLong_AsUnsignedLong(py_ulong); \
|
||||
if (PyErr_Occurred()) \
|
||||
{ \
|
||||
return NULL; \
|
||||
} \
|
||||
new_long; \
|
||||
})
|
||||
|
||||
#define GNU_PY_LONG_CHECK(py_long) \
|
||||
|
Loading…
x
Reference in New Issue
Block a user