diff --git a/bob/learn/misc/gaussian.cpp b/bob/learn/misc/gaussian.cpp index 56d76065932f6666ad40d326ab0ff3739e833219..f1c56407ff18724f9ac70f58b9b929b313fa8551 100644 --- a/bob/learn/misc/gaussian.cpp +++ b/bob/learn/misc/gaussian.cpp @@ -360,8 +360,8 @@ static PyObject* PyBobLearnMiscGaussian_resize(PyBobLearnMiscGaussianObject* sel /* Parses input arguments in a single shot */ char** kwlist = resize.kwlist(0); - Py_ssize_t input = 0; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "n", kwlist, &input)) Py_RETURN_NONE; + int input = 0; + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i", kwlist, &input)) Py_RETURN_NONE; if (input <= 0){ PyErr_Format(PyExc_TypeError, "input must be greater than zero"); Py_RETURN_NONE; diff --git a/bob/learn/misc/gmm_stats.cpp b/bob/learn/misc/gmm_stats.cpp index d9e759295155d50716c8341974cd08027e6a1e18..a5c7e5b9ca92c081464af40903e780da6ad1efa4 100644 --- a/bob/learn/misc/gmm_stats.cpp +++ b/bob/learn/misc/gmm_stats.cpp @@ -272,16 +272,16 @@ int PyBobLearnMiscGMMStats_setT(PyBobLearnMiscGMMStatsObject* self, PyObject* va BOB_TRY if (!PyInt_Check(value)){ - PyErr_Format(PyExc_RuntimeError, "%s %s expects an size_t", Py_TYPE(self)->tp_name, t.name()); + PyErr_Format(PyExc_RuntimeError, "%s %s expects an int", Py_TYPE(self)->tp_name, t.name()); return -1; } - if (PyInt_AsSsize_t(value) < 0){ + if (PyInt_AS_LONG(value) < 0){ PyErr_Format(PyExc_TypeError, "t must be greater than or equal to zero"); return -1; } - self->cxx->T = PyInt_AsSsize_t(value); + self->cxx->T = PyInt_AS_LONG(value); BOB_CATCH_MEMBER("t could not be set", -1) return 0; }