From: W. Trevor King Date: Thu, 3 Mar 2011 21:15:59 +0000 (-0500) Subject: Use explicit visibilities in CClassScope initialization. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=511c89ece319c1bc4f179a8303a76e79ca78b8f4;p=cython.git Use explicit visibilities in CClassScope initialization. --- diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py index 269c6635..3b693958 100755 --- a/Cython/Compiler/PyrexTypes.py +++ b/Cython/Compiler/PyrexTypes.py @@ -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) diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py index 9a919d50..957a53e6 100644 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@ -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