From 2d9e5a65f1a13084f701e1a2330a091883ef53c2 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Sat, 7 Jun 2008 10:45:33 -0700 Subject: [PATCH] Remove spurious const cast and warnings, niceident regex fix, all tests pass. --- Cython/Compiler/Nodes.py | 5 ++--- Cython/Compiler/Symtab.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 772b7898..d668b38e 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -1466,7 +1466,7 @@ class DefNode(FuncDefNode): reqd_kw_flags = [] has_reqd_kwds = False code.put( - "static const char *%s[] = {" % + "static char *%s[] = {" % Naming.kwdlist_cname) for arg in self.args: if arg.is_generic: @@ -1618,8 +1618,7 @@ class DefNode(FuncDefNode): code.putln('else {') argformat = '"%s"' % string.join(arg_formats, "") - pt_arglist = [Naming.args_cname, Naming.kwds_cname, argformat, - '(char **)/*temp.hack*/'+Naming.kwdlist_cname] + arg_addrs + pt_arglist = [Naming.args_cname, Naming.kwds_cname, argformat, Naming.kwdlist_cname] + arg_addrs pt_argstring = string.join(pt_arglist, ", ") code.putln( 'if (unlikely(!PyArg_ParseTupleAndKeywords(%s))) %s' % ( diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py index c6a41ae5..485215a7 100644 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@ -17,7 +17,7 @@ import ControlFlow import __builtin__ possible_identifier = re.compile(ur"(?![0-9])\w+$", re.U).match -nice_identifier = re.compile('[a-zA-Z0-0_]').match +nice_identifier = re.compile('^[a-zA-Z0-0_]+$').match class Entry: # A symbol table entry in a Scope or ModuleNamespace. -- 2.26.2