Cleanup warnings
authorRobert Bradshaw <robertwb@math.washington.edu>
Wed, 13 Feb 2008 06:16:30 +0000 (22:16 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Wed, 13 Feb 2008 06:16:30 +0000 (22:16 -0800)
Cython/Compiler/ModuleNode.py
Cython/Compiler/Nodes.py
Cython/Compiler/Symtab.py

index 0c0469b64279188c2f803ac6130bfba568d92c29..1d7874cde2bc96cd003334c6f8fc075c19ac424f 100644 (file)
@@ -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)
index dfd8ae65abe6f86417fe7fe38194498fbdcedc68..3360f82703dd0f5af651087ee8448a72d217bbe6 100644 (file)
@@ -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('}')
index 7ad19b9fdce73d0572c9731c7146a7959b116580..aadf184358fc9378d79fa4c6528c9d9b38356350 100644 (file)
@@ -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)