From 81c405238fa4ab31d4cad4c24cc2f8be76f4c62b Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Tue, 12 Feb 2008 22:16:30 -0800 Subject: [PATCH] Cleanup warnings --- Cython/Compiler/ModuleNode.py | 1 + Cython/Compiler/Nodes.py | 2 +- Cython/Compiler/Symtab.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 0c0469b6..1d7874cd 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -1301,6 +1301,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): self.generate_builtin_init_code(env, code) code.putln("%s = PyTuple_New(0); %s" % (Naming.empty_tuple, code.error_goto_if_null(Naming.empty_tuple, self.pos))); + code.putln("%s = 0;" % Naming.skip_dispatch_cname); code.putln("/*--- Global init code ---*/") self.generate_global_init_code(env, code) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index dfd8ae65..3360f827 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -1693,7 +1693,7 @@ class OverrideCheckNode(StatNode): code.putln('%s = PyObject_GetAttrString(%s, "%s"); %s' % (self.func_node.result_code, self_arg, self.py_func.entry.name, err)) # It appears that this type is not anywhere exposed in the Python/C API is_builtin_function_or_method = '(strcmp(%s->ob_type->tp_name, "builtin_function_or_method") == 0)' % self.func_node.result_code - is_overridden = '(PyCFunction_GET_FUNCTION(%s) != &%s)' % (self.func_node.result_code, self.py_func.entry.func_cname) + is_overridden = '(PyCFunction_GET_FUNCTION(%s) != (void *)&%s)' % (self.func_node.result_code, self.py_func.entry.func_cname) code.putln('if (!%s || %s) {' % (is_builtin_function_or_method, is_overridden)) self.body.generate_execution_code(code) code.putln('}') diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py index 7ad19b9f..aadf1843 100644 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@ -509,7 +509,7 @@ class Scope: cname = "%s%d" % (Naming.pyrex_prefix, n) entry = Entry("", cname, type) entry.used = 1 - if type.is_pyobject: + if type.is_pyobject or type == c_py_ssize_t_type: entry.init = "0" self.cname_to_entry[entry.cname] = entry self.temp_entries.append(entry) -- 2.26.2