diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2005-11-13 18:41:28 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2005-11-13 18:41:28 (GMT) |
commit | 6576bd844fb49b37ebbfc6d7567bcd495ddbdbae (patch) | |
tree | c0cc3005994e22c8cc9cdae40872749279c9ba2f /Parser | |
parent | f6a904456e6d0ce96d5ed6456eec8eaec8f92f75 (diff) | |
download | cpython-6576bd844fb49b37ebbfc6d7567bcd495ddbdbae.zip cpython-6576bd844fb49b37ebbfc6d7567bcd495ddbdbae.tar.gz cpython-6576bd844fb49b37ebbfc6d7567bcd495ddbdbae.tar.bz2 |
Prevent name pollution by making lots of internal functions static.
Diffstat (limited to 'Parser')
-rwxr-xr-x | Parser/asdl_c.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index ebf8bee..fa71c23 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -334,7 +334,7 @@ class MarshalPrototypeVisitor(PickleVisitor): def prototype(self, sum, name): ctype = get_c_type(name) - self.emit("int marshal_write_%s(PyObject **, int *, %s);" + self.emit("static int marshal_write_%s(PyObject **, int *, %s);" % (name, ctype), 0) visitProduct = visitSum = prototype @@ -487,7 +487,7 @@ class MarshalFunctionVisitor(PickleVisitor): def func_begin(self, name, has_seq): ctype = get_c_type(name) - self.emit("int", 0) + self.emit("static int", 0) self.emit("marshal_write_%s(PyObject **buf, int *off, %s o)" % (name, ctype), 0) self.emit("{", 0) @@ -580,7 +580,6 @@ def main(srcfile): StructVisitor(f), PrototypeVisitor(f), FreePrototypeVisitor(f), - MarshalPrototypeVisitor(f), ) c.visit(mod) f.close() @@ -594,7 +593,8 @@ def main(srcfile): print >> f, '#include "Python.h"' print >> f, '#include "%s-ast.h"' % mod.name print >> f - v = ChainOfVisitors(FunctionVisitor(f), + v = ChainOfVisitors(MarshalPrototypeVisitor(f), + FunctionVisitor(f), StaticVisitor(f), FreeVisitor(f), MarshalFunctionVisitor(f), |