Use explicit visibilities in CClassScope initialization.
authorW. Trevor King <wking@drexel.edu>
Thu, 3 Mar 2011 21:15:59 +0000 (16:15 -0500)
committerW. Trevor King <wking@drexel.edu>
Thu, 3 Mar 2011 21:18:16 +0000 (16:18 -0500)
Cython/Compiler/PyrexTypes.py
Cython/Compiler/Symtab.py

index 269c663522466087311127ef7a78198a5876dc1d..3b69395866704c4e83823f1d5fec9d33b45c87f8 100755 (executable)
@@ -682,7 +682,7 @@ class CNumericType(CType):
             self.scope = scope = Symtab.CClassScope(
                     '',
                     None,
-                    visibility="extern")
+                    extern=1)
             scope.parent_type = self
             scope.directives = {}
             entry = scope.declare_cfunction(
@@ -1187,7 +1187,7 @@ class CComplexType(CNumericType):
             self.scope = scope = Symtab.CClassScope(
                     '',
                     None,
-                    visibility="extern")
+                    extern=1)
             scope.parent_type = self
             scope.directives = {}
             scope.declare_var("real", self.real_type, None, "real", is_cdef=True)
index 9a919d5030b8b85405a34c2a39914a52b6600740..957a53e6e99d0eb8a8980bcd3f09490164e6837b 100644 (file)
@@ -952,8 +952,9 @@ class BuiltinScope(Scope):
     def WTK_declare_builtin_type(self, binding, objstruct_cname = None, utility_code = None):
         binding.name = EncodedString(binding.name)
         type = PyrexTypes.BuiltinObjectType(binding.name, binding.cname, objstruct_cname)
-        # WTK: TODO: visibility checking.  CClassCcope visibility splitting
-        scope = CClassScope(binding.name, outer_scope=None, visibility='extern')
+        # WTK: TODO: visibility checking
+        scope = CClassScope(
+            binding.name, outer_scope = None, extern = 1)
         scope.directives = {}
         if binding.name == 'bool':
             scope.directives['final'] = True
@@ -1311,15 +1312,10 @@ class ModuleScope(Scope):
         #
         if not type.scope:
             if defining or implementing:
-                visibility = 'private'
-                if binding.extern:
-                    visibility = 'extern'
-                elif binding.c_visibility != 'private':
-                    visibility = binding.c_visibility
                 scope = CClassScope(
                     name = binding.name,
                     outer_scope = self,
-                    visibility = visibility)  # WTK: scope visiblity?
+                    extern = binding.extern)
                 if base_type and base_type.scope:
                     scope.declare_inherited_c_attributes(base_type.scope)
                 type.set_scope(scope)
@@ -1781,9 +1777,9 @@ class CClassScope(ClassScope):
 
     is_c_class_scope = 1
 
-    def __init__(self, name, outer_scope, visibility):
+    def __init__(self, name, outer_scope, extern):
         ClassScope.__init__(self, name, outer_scope)
-        if visibility != 'extern':
+        if not extern:
             self.method_table_cname = outer_scope.mangle(Naming.methtab_prefix, name)
             self.getset_table_cname = outer_scope.mangle(Naming.gstab_prefix, name)
         self.has_pyobject_attrs = 0