From 8425ef4ceb8d5ec56fb04de164d7767d17c53a7f Mon Sep 17 00:00:00 2001 From: Viktor Gal Date: Wed, 7 Aug 2013 10:18:53 +0200 Subject: [PATCH] Fix is_array ambiguity with std::is_array in c++11 mode Travis: Fix forcing clang as a compiler in all clang target --- .travis.yml | 12 ++++++------ src/interfaces/python_modular/swig_typemaps.i | 18 +++++++++--------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 38ade44bb98..330a5bf9ac9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,23 +20,23 @@ matrix: - compiler: clang python: 3.3 language: python - env: CMAKE_OPTIONS="-DPythonModular=ON" EXTRA_PACKAGES="python3-scipy swig2.0" + env: CMAKE_OPTIONS="-DPythonModular=ON" EXTRA_PACKAGES="python3-scipy swig2.0" CC=clang CXX=clang++ - compiler: clang rvm: 1.8.7 language: ruby - env: CMAKE_OPTIONS="-DRubyModular=ON" CUSTOM_PKG="gem install narray" EXTRA_PACKAGES="swig2.0" + env: CMAKE_OPTIONS="-DRubyModular=ON" CUSTOM_PKG="gem install narray" EXTRA_PACKAGES="swig2.0" CC=clang CXX=clang++ - compiler: clang jdk: oraclejdk7 language: java - env: CMAKE_OPTIONS="-DJavaModular=ON" EXTRA_PACKAGES="jblas swig2.0" + env: CMAKE_OPTIONS="-DJavaModular=ON" EXTRA_PACKAGES="jblas swig2.0" CC=clang CXX=clang++ - compiler: clang - env: CMAKE_OPTIONS="-DCSharpModular=ON" EXTRA_PACKAGES="mono-devel mono-gmcs cli-common-dev swig2.0" + env: CMAKE_OPTIONS="-DCSharpModular=ON" EXTRA_PACKAGES="mono-devel mono-gmcs cli-common-dev swig2.0" CC=clang CXX=clang++ - compiler: clang - env: CMAKE_OPTIONS="-DLuaModular=ON" EXTRA_PACKAGES="lua5.1 liblua5.1-0-dev swig2.0" + env: CMAKE_OPTIONS="-DLuaModular=ON" EXTRA_PACKAGES="lua5.1 liblua5.1-0-dev swig2.0" CC=clang CXX=clang++ - compiler: gcc env: CMAKE_OPTIONS="-DOctaveModular=ON" EXTRA_PACKAGES="octave octave3.2-headers swig2.0" - compiler: clang - env: CMAKE_OPTIONS="-DRModular=ON" EXTRA_PACKAGES="r-base-core swig2.0" + env: CMAKE_OPTIONS="-DRModular=ON" EXTRA_PACKAGES="r-base-core swig2.0" CC=clang CXX=clang++ allow_failures: - compiler: clang env: CMAKE_OPTIONS="-DRModular=ON" EXTRA_PACKAGES="r-base-core swig2.0" diff --git a/src/interfaces/python_modular/swig_typemaps.i b/src/interfaces/python_modular/swig_typemaps.i index b5ac57e381b..cc112d358bc 100644 --- a/src/interfaces/python_modular/swig_typemaps.i +++ b/src/interfaces/python_modular/swig_typemaps.i @@ -118,7 +118,7 @@ static PyObject* make_contiguous(PyObject* ary, int* is_new_object, return NULL; } - if (!is_array(array)) + if (!::is_array(array)) { PyErr_SetString(PyExc_TypeError, "Object not an Array"); *is_new_object=0; @@ -160,7 +160,7 @@ static int is_pyvector(PyObject* obj, int typecode) { return ((obj && !PyList_Check(obj)) && ( - is_array(obj) && + ::is_array(obj) && array_dimensions(obj)==1 && (array_type(obj) == typecode || PyArray_EquivTypenums(array_type(obj), typecode)) )) ? 1 : 0; @@ -170,7 +170,7 @@ static int is_pymatrix(PyObject* obj, int typecode) { return ((obj && !PyList_Check(obj)) && ( - is_array(obj) && + ::is_array(obj) && array_dimensions(obj)==2 && (array_type(obj) == typecode || PyArray_EquivTypenums(array_type(obj), typecode)) )) ? 1 : 0; @@ -180,7 +180,7 @@ static int is_pyarray(PyObject* obj, int typecode) { return ((obj && !PyList_Check(obj)) && ( - is_array(obj) && + ::is_array(obj) && (array_type(obj) == typecode || PyArray_EquivTypenums(array_type(obj), typecode)) )) ? 1 : 0; } @@ -221,7 +221,7 @@ static int is_pystring_list(PyObject* obj, int typecode) } else { - if (!is_array(o) || array_dimensions(o)!=1 || array_type(o) != typecode) + if (!::is_array(o) || array_dimensions(o)!=1 || array_type(o) != typecode) { result=0; break; @@ -402,7 +402,7 @@ static bool string_from_strpy(SGStringList& sg_strings, PyObject* obj, int } else { - if (is_array(o) && array_dimensions(o)==1 && array_type(o) == typecode) + if (::is_array(o) && array_dimensions(o)==1 && array_type(o) == typecode) { int is_new_object=0; PyObject* array = make_contiguous(o, &is_new_object, 1, typecode); @@ -537,21 +537,21 @@ static bool spmatrix_from_numpy(SGSparseMatrix& sg_matrix, PyObject* obj, PyObject* shape = PyObject_GetAttrString(o, "shape"); /* check that types are OK */ - if ((!is_array(indptr)) || (array_dimensions(indptr)!=1) || + if ((!::is_array(indptr)) || (array_dimensions(indptr)!=1) || (array_type(indptr)!=NPY_INT && array_type(indptr)!=NPY_LONG)) { PyErr_SetString(PyExc_TypeError,"indptr array should be 1d int's"); return false; } - if (!is_array(indices) || array_dimensions(indices)!=1 || + if (!::is_array(indices) || array_dimensions(indices)!=1 || (array_type(indices)!=NPY_INT && array_type(indices)!=NPY_LONG)) { PyErr_SetString(PyExc_TypeError,"indices array should be 1d int's"); return false; } - if (!is_array(data) || array_dimensions(data)!=1 || array_type(data) != typecode) + if (!::is_array(data) || array_dimensions(data)!=1 || array_type(data) != typecode) { PyErr_SetString(PyExc_TypeError,"data array should be 1d and match datatype"); return false;