summaryrefslogtreecommitdiff
path: root/doc/swig/numpy.i
diff options
context:
space:
mode:
Diffstat (limited to 'doc/swig/numpy.i')
-rw-r--r--doc/swig/numpy.i14
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);