diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2015-01-01 15:37:07 +0100 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2015-01-01 15:37:07 +0100 |
commit | 5a6e79fd0ec0023b88a313c0a8755ac7c3db06ea (patch) | |
tree | 236ffe70f00796d136ddeb9ef7d3ee566425a5e0 /Cython/Compiler/ModuleNode.py | |
parent | 375d0845a74de97fa3519c035298335e348a384a (diff) | |
download | cython-5a6e79fd0ec0023b88a313c0a8755ac7c3db06ea.tar.gz |
fix warning about C++ char* literal conversion
Diffstat (limited to 'Cython/Compiler/ModuleNode.py')
-rw-r--r-- | Cython/Compiler/ModuleNode.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 5edc321ff..72817a235 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -1961,7 +1961,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): def generate_import_star(self, env, code): env.use_utility_code(streq_utility_code) code.putln() - code.putln("static char* %s_type_names[] = {" % Naming.import_star) + code.putln("static const char* %s_type_names[] = {" % Naming.import_star) for name, entry in sorted(env.entries.items()): if entry.is_type: code.putln('"%s",' % name) @@ -1970,7 +1970,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): code.putln() code.enter_cfunc_scope() # as we need labels code.putln("static int %s(PyObject *o, PyObject* py_name, char *name) {" % Naming.import_star_set) - code.putln("char** type_name = %s_type_names;" % Naming.import_star) + code.putln("const char** type_name = %s_type_names;" % Naming.import_star) code.putln("while (*type_name) {") code.putln("if (__Pyx_StrEq(name, *type_name)) {") code.putln('PyErr_Format(PyExc_TypeError, "Cannot overwrite C type %s", name);') |