diff options
author | David Cournapeau <cournape@gmail.com> | 2009-03-02 13:35:13 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2009-03-02 13:35:13 +0000 |
commit | 646b6dd17325365732df8dfd4d26f0151731202b (patch) | |
tree | 5f0efa20cd43ca286dd31fd90742ae8850cf2be1 /doc/swig | |
parent | 4644a299b408c6f1ef8c7c3112c39c9f359a0aaa (diff) | |
download | numpy-646b6dd17325365732df8dfd4d26f0151731202b.tar.gz |
Update numpy.i to fix const char* return warnings issues with later versions of g++ (from Matthieu Brucher).
Diffstat (limited to 'doc/swig')
-rw-r--r-- | doc/swig/numpy.i | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/swig/numpy.i b/doc/swig/numpy.i index 72fc4f9c4..b9a51ee32 100644 --- a/doc/swig/numpy.i +++ b/doc/swig/numpy.i @@ -97,7 +97,7 @@ { /* Given a PyObject, return a string describing its type. */ - char* pytype_string(PyObject* py_obj) { + const char* pytype_string(PyObject* py_obj) { if (py_obj == NULL ) return "C NULL value"; if (py_obj == Py_None ) return "Python None" ; if (PyCallable_Check(py_obj)) return "callable" ; @@ -116,8 +116,8 @@ /* Given a NumPy typecode, return a string describing the type. */ - char* typecode_string(int typecode) { - static char* type_names[25] = {"bool", "byte", "unsigned byte", + const char* typecode_string(int typecode) { + static const char* type_names[25] = {"bool", "byte", "unsigned byte", "short", "unsigned short", "int", "unsigned int", "long", "unsigned long", "long long", "unsigned long long", @@ -159,8 +159,8 @@ } else if is_array(input) { - char* desired_type = typecode_string(typecode); - char* actual_type = typecode_string(array_type(input)); + const char* desired_type = typecode_string(typecode); + const char* actual_type = typecode_string(array_type(input)); PyErr_Format(PyExc_TypeError, "Array of type '%s' required. Array of type '%s' given", desired_type, actual_type); @@ -168,8 +168,8 @@ } else { - char * desired_type = typecode_string(typecode); - char * actual_type = pytype_string(input); + const char * desired_type = typecode_string(typecode); + const char * actual_type = pytype_string(input); PyErr_Format(PyExc_TypeError, "Array of type '%s' required. A '%s' was given", desired_type, actual_type); |