Commit 843c2a69 authored by Robert Bradshaw's avatar Robert Bradshaw

cleanup

parent 3e76b40f
......@@ -429,7 +429,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
type_entries.append(entry)
self.generate_type_header_code(type_entries, code)
for entry in vtabslot_list:
# self.generate_objstruct_definition(entry.type, code)
self.generate_typeobj_predeclaration(entry, code)
for entry in vtab_list:
self.generate_typeobj_predeclaration(entry, code)
......
......@@ -3350,6 +3350,18 @@ class CClassDefNode(ClassDefNode):
decorators = None
shadow = False
def buffer_defaults(self, env):
if not hasattr(self, '_buffer_defaults'):
import Buffer
if self.buffer_defaults_node:
self._buffer_defaults = Buffer.analyse_buffer_options(
self.buffer_defaults_pos,
env, [], self.buffer_defaults_node,
need_complete=False)
else:
self._buffer_defaults = None
return self._buffer_defaults
def declare(self, env):
if self.module_name and self.visibility != 'extern':
module_path = self.module_name.split(".")
......@@ -3359,14 +3371,6 @@ class CClassDefNode(ClassDefNode):
else:
home_scope = env
import Buffer
if self.buffer_defaults_node:
self.buffer_defaults = Buffer.analyse_buffer_options(self.buffer_defaults_pos,
env, [], self.buffer_defaults_node,
need_complete=False)
else:
self.buffer_defaults = None
self.entry = home_scope.declare_c_class(
name = self.class_name,
pos = self.pos,
......@@ -3379,7 +3383,7 @@ class CClassDefNode(ClassDefNode):
visibility = self.visibility,
typedef_flag = self.typedef_flag,
api = self.api,
buffer_defaults = self.buffer_defaults,
buffer_defaults = self.buffer_defaults(env),
shadow = self.shadow)
def analyse_declarations(self, env):
......@@ -3463,7 +3467,7 @@ class CClassDefNode(ClassDefNode):
visibility = self.visibility,
typedef_flag = self.typedef_flag,
api = self.api,
buffer_defaults = self.buffer_defaults,
buffer_defaults = self.buffer_defaults(env),
shadow = self.shadow)
if self.shadow:
home_scope.lookup(self.class_name).as_variable = self.entry
......
......@@ -16,10 +16,12 @@ cdef struct StructB:
StructB *b
cdef class ClassA:
cdef ClassA a
cdef ClassB b
ctypedef public class ClassB [ object ClassB, type TypeB ]:
cdef ClassA a
cdef ClassB b
cdef StructA struct_a
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment