fixing warnings
keep old const names for compatibility
This commit is contained in:
parent
c22dcb04af
commit
c4c731c0aa
@ -821,8 +821,11 @@ class PythonWrapperGenerator(object):
|
|||||||
|
|
||||||
self.code_ns_reg.write('static ConstDef consts_%s[] = {\n'%wname)
|
self.code_ns_reg.write('static ConstDef consts_%s[] = {\n'%wname)
|
||||||
for name, cname in sorted(ns.consts.items()):
|
for name, cname in sorted(ns.consts.items()):
|
||||||
self.code_ns_reg.write(' {"%s", (long)(%s)},\n'%(name, cname))
|
self.code_ns_reg.write(' {"%s", %s},\n'%(name, cname))
|
||||||
self.code_ns_reg.write(' {NULL, NULL}\n};\n\n')
|
compat_name = re.sub(r"([a-z])([A-Z])", r"\1_\2", name).upper()
|
||||||
|
if name != compat_name:
|
||||||
|
self.code_ns_reg.write(' {"%s", %s},\n'%(compat_name, cname))
|
||||||
|
self.code_ns_reg.write(' {NULL, 0}\n};\n\n')
|
||||||
|
|
||||||
def gen_namespaces_reg(self):
|
def gen_namespaces_reg(self):
|
||||||
self.code_ns_reg.write('static void init_submodules(PyObject * root) \n{\n')
|
self.code_ns_reg.write('static void init_submodules(PyObject * root) \n{\n')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user