Normalize WTK_declare_c_class -> declare_c_class.
authorW. Trevor King <wking@drexel.edu>
Sun, 6 Mar 2011 03:12:44 +0000 (22:12 -0500)
committerW. Trevor King <wking@drexel.edu>
Sun, 6 Mar 2011 03:12:44 +0000 (22:12 -0500)
Cython/Compiler/Nodes.py
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/Symtab.py

index 91fac61b7e3138685eb906b80659f2a6957dfdc2..0410ceefb1b2d1f7b3555be997a880279650c23b 100644 (file)
@@ -3276,7 +3276,7 @@ class CClassDefNode(ClassDefNode):
         binding = Binding()
         binding.pull(self)
         binding.name = self.class_name
-        self.entry = home_scope.WTK_declare_c_class(
+        self.entry = home_scope.declare_c_class(
             binding, 
             objstruct_cname = self.objstruct_name,
             base_type = self.base_type,
@@ -5284,8 +5284,9 @@ class FromCImportStatNode(StatNode):
                         entry = module_scope.declare_struct_or_union(
                             binding, kind = kind, scope = None, pos = pos)
                     elif kind == 'class':
-                        entry = module_scope.declare_c_class(name, pos = pos,
-                            module_name = self.module_name)
+                        binding = Binding(name = name)
+                        entry = module_scope.declare_c_class(
+                            binding, module_name = self.module_name, pos = pos)
                     else:
                         submodule_scope = env.context.find_module(name, relative_to = module_scope, pos = self.pos)
                         if submodule_scope.parent_module is module_scope:
index 5886c8d674b453488591a8c073c6547fdf4a4568..57ce935c5c7778104c70284ef53149f23adc2d1d 100644 (file)
@@ -6,6 +6,7 @@ cython.declare(PyrexTypes=object, Naming=object, ExprNodes=object, Nodes=object,
                TemplateTransform=object, EncodedString=object,
                error=object, warning=object, copy=object)
 
+from Binding import Binding
 import PyrexTypes
 import Naming
 import ExprNodes
@@ -1485,8 +1486,9 @@ class CreateClosureClasses(CythonTransform):
 
         as_name = '%s_%s' % (target_module_scope.next_id(Naming.closure_class_prefix), node.entry.cname)
 
-        entry = target_module_scope.declare_c_class(name = as_name,
-            pos = node.pos, defining = True, implementing = True)
+        binding = Binding(name = as_name)
+        entry = target_module_scope.declare_c_class(
+            binding, defining = True, implementing = True, pos = node.pos)
         func_scope.scope_class = entry
         class_scope = entry.type.scope
         class_scope.is_internal = True
index 9843dc507bb0902d395d1439d1088953ca5e6180..8cb8dae6f22e8902e6b0d2155a44609b02fa8723 100644 (file)
@@ -1136,18 +1136,7 @@ class ModuleScope(Scope):
         if new_code is not None:
             self.utility_code_list.append(new_code)
 
-    def declare_c_class(self, name, pos, defining = 0, implementing = 0,
-        module_name = None, base_type = None, objstruct_cname = None,
-        typeobj_cname = None, visibility = 'private', typedef_flag = 0, api = 0,
-        buffer_defaults = None, shadow = 0):
-        binding = self._WTK_setup(name, objstruct_cname, visibility)
-        binding.api = api
-        return self.WTK_declare_c_class(
-            binding, objstruct_cname, None, base_type, defining, implementing,
-            module_name, typeobj_cname, typedef_flag, buffer_defaults, shadow,
-            pos)
-
-    def WTK_declare_c_class(
+    def declare_c_class(
         self, binding, objstruct_cname = None, type=None, base_type=None,
         defining = 0, implementing = 0, module_name = None,
         typeobj_cname = None, typedef_flag = 0, buffer_defaults = None,