code.putln('static PyObject *%s;' % Naming.preimport_cname)
code.putln('static int %s;' % Naming.lineno_cname)
code.putln('static int %s = 0;' % Naming.clineno_cname)
- code.putln('static char * %s= %s;' % (Naming.cfilenm_cname, Naming.file_c_macro))
- code.putln('static char *%s;' % Naming.filename_cname)
- code.putln('static char **%s;' % Naming.filetable_cname)
+ code.putln('static const char * %s= %s;' % (Naming.cfilenm_cname, Naming.file_c_macro))
+ code.putln('static const char *%s;' % Naming.filename_cname)
+ code.putln('static const char **%s;' % Naming.filetable_cname)
if env.doc:
code.putln('')
code.putln('static char %s[] = "%s";' % (env.doc_cname, env.doc))
def generate_filename_table(self, code):
code.putln("")
- code.putln("static char *%s[] = {" % Naming.filenames_cname)
+ code.putln("static const char *%s[] = {" % Naming.filenames_cname)
if code.filename_list:
for source_desc in code.filename_list:
filename = os.path.basename(source_desc.get_filenametable_entry())
reqd_kw_flags = []
has_reqd_kwds = False
code.put(
- "static char *%s[] = {" %
+ "static const char *%s[] = {" %
Naming.kwdlist_cname)
for arg in self.args:
if arg.is_generic:
argformat = '"%s"' % string.join(arg_formats, "")
pt_arglist = [Naming.args_cname, Naming.kwds_cname, argformat,
- Naming.kwdlist_cname] + arg_addrs
+ '(char **)/*temp.hack*/'+Naming.kwdlist_cname] + arg_addrs
pt_argstring = string.join(pt_arglist, ", ")
code.putln(
'if (unlikely(!PyArg_ParseTupleAndKeywords(%s))) %s' % (
unraisable_exception_utility_code = [
"""
-static void __Pyx_WriteUnraisable(char *name); /*proto*/
+static void __Pyx_WriteUnraisable(const char *name); /*proto*/
""","""
-static void __Pyx_WriteUnraisable(char *name) {
+static void __Pyx_WriteUnraisable(const char *name) {
PyObject *old_exc, *old_val, *old_tb;
PyObject *ctx;
PyErr_Fetch(&old_exc, &old_val, &old_tb);
traceback_utility_code = [
"""
-static void __Pyx_AddTraceback(char *funcname); /*proto*/
+static void __Pyx_AddTraceback(const char *funcname); /*proto*/
""","""
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
-static void __Pyx_AddTraceback(char *funcname) {
+static void __Pyx_AddTraceback(const char *funcname) {
PyObject *py_srcfile = 0;
PyObject *py_funcname = 0;
PyObject *py_globals = 0;