From 7c592684f65d6f4b5cfed5322273e2ef8ecad7e3 Mon Sep 17 00:00:00 2001
From: Tiago Freitas Pereira <tiagofrepereira@gmail.com>
Date: Tue, 9 Dec 2014 17:17:00 +0100
Subject: [PATCH] Change the size_t cast to int cast

---
 bob/learn/misc/gaussian.cpp  | 4 ++--
 bob/learn/misc/gmm_stats.cpp | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/bob/learn/misc/gaussian.cpp b/bob/learn/misc/gaussian.cpp
index 56d7606..f1c5640 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 d9e7592..a5c7e5b 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;
 }
-- 
GitLab