Skip to content

Commit

Permalink
Fix is_array ambiguity with std::is_array in c++11 mode
Browse files Browse the repository at this point in the history
Travis: Fix forcing clang as a compiler in all clang target
  • Loading branch information
vigsterkr committed Aug 7, 2013
1 parent 85677ec commit 8425ef4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
12 changes: 6 additions & 6 deletions .travis.yml
Expand Up @@ -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"
Expand Down
18 changes: 9 additions & 9 deletions src/interfaces/python_modular/swig_typemaps.i
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -402,7 +402,7 @@ static bool string_from_strpy(SGStringList<type>& 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);
Expand Down Expand Up @@ -537,21 +537,21 @@ static bool spmatrix_from_numpy(SGSparseMatrix<type>& 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;
Expand Down

0 comments on commit 8425ef4

Please sign in to comment.