From ca4360e483c115444864bef0925417f479923a43 Mon Sep 17 00:00:00 2001 From: Viktor Gal Date: Wed, 14 Feb 2018 11:15:03 +0100 Subject: [PATCH] fix #4174 int64_t is different on linux and osx :) --- src/interfaces/python/swig_typemaps.i | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/interfaces/python/swig_typemaps.i b/src/interfaces/python/swig_typemaps.i index 41891691629..bf8e7b48b1a 100644 --- a/src/interfaces/python/swig_typemaps.i +++ b/src/interfaces/python/swig_typemaps.i @@ -386,10 +386,10 @@ static bool string_from_strpy(SGStringList& sg_strings, PyObject* obj, int /* Check if is a list */ if (!list || PyList_Check(list) || PyList_Size(list)==0) { - int64_t size=PyList_Size(list); + Py_ssize_t size=PyList_Size(list); shogun::SGString* strings=SG_MALLOC(shogun::SGString, size); - int64_t max_len=0; + Py_ssize_t max_len=0; for (auto i=0; i& sg_strings, PyObject* obj, int { PyObject *tmp = nullptr; #if PY_VERSION_HEX >= 0x03000000 - int64_t len = -1; + Py_ssize_t len = -1; const char* str = PyUnicode_AsUTF8AndSize(o, &len); #else - int64_t len = -1; + Py_ssize_t len = -1; const char* str = nullptr; if (PyString_Check(o)) { @@ -463,7 +463,7 @@ static bool string_from_strpy(SGStringList& sg_strings, PyObject* obj, int return false; type* str=(type*) PyArray_DATA(array); - int64_t len = PyArray_DIM(array,0); + Py_ssize_t len = PyArray_DIM(array,0); max_len=shogun::CMath::max(len,max_len); strings[i].slen=len;