From e46fc864070f12b29227e86f4dc4dd288b3d0b3c Mon Sep 17 00:00:00 2001 From: Tero Pirkkanen Date: Jul 05 2017 08:20:28 +0000 Subject: Use correct python C-API value type for SingleRadioButton value The commit 7cdac0c broke SingleRadioButton select() method on 64 bit machines. The widget_get_radioValue() returns 32bit integer while it is compared to 64 bit key. Use correct python C-API value type for SingleRadioButton value in 64 bit build closes newt#1 --- diff --git a/snack.c b/snack.c index 880a431..3429d81 100644 --- a/snack.c +++ b/snack.c @@ -1096,7 +1096,11 @@ static PyObject * widget_get_radioValue(PyObject *self, void *closure) { snackWidget *w = (snackWidget *)self; +#if SIZEOF_VOID_P <= SIZEOF_LONG return Py_BuildValue("i", newtRadioGetCurrent(w->co)); +#else + return Py_BuildValue("L", newtRadioGetCurrent(w->co)); +#endif } static void widgetDestructor(PyObject * o) {