Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
60757b21
Commit
60757b21
authored
Dec 05, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
29bc0218
f020a6d2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
2 deletions
+30
-2
.hgtags
.hgtags
+1
-0
Cython/Compiler/Buffer.py
Cython/Compiler/Buffer.py
+4
-0
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+20
-0
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+1
-1
Cython/Compiler/Version.py
Cython/Compiler/Version.py
+1
-1
tests/compile/ctypedefstruct.pyx
tests/compile/ctypedefstruct.pyx
+3
-0
No files found.
.hgtags
View file @
60757b21
...
@@ -5,3 +5,4 @@ a09347d7b470290076b983aef98707921445a038 0.9.8.1
...
@@ -5,3 +5,4 @@ a09347d7b470290076b983aef98707921445a038 0.9.8.1
82084a7b654e2a133ab64ceb47e03d6e7a204990 0.9.9.2.beta
82084a7b654e2a133ab64ceb47e03d6e7a204990 0.9.9.2.beta
a89b05b78236a27a654f3004bdffc7b8a56311a7 0.10
a89b05b78236a27a654f3004bdffc7b8a56311a7 0.10
ef9d2c680684d0df7d81f529cda29e9e1741f575 cython-0.10.1
ef9d2c680684d0df7d81f529cda29e9e1741f575 cython-0.10.1
92baafe0edf3cea00deb7ce1e31e337bb485af1a 0.10.2
Cython/Compiler/Buffer.py
View file @
60757b21
...
@@ -710,7 +710,11 @@ def use_py2_buffer_functions(env):
...
@@ -710,7 +710,11 @@ def use_py2_buffer_functions(env):
# Search all types for __getbuffer__ overloads
# Search all types for __getbuffer__ overloads
types
=
[]
types
=
[]
visited_scopes
=
set
()
def
find_buffer_types
(
scope
):
def
find_buffer_types
(
scope
):
if
scope
in
visited_scopes
:
return
visited_scopes
.
add
(
scope
)
for
m
in
scope
.
cimported_modules
:
for
m
in
scope
.
cimported_modules
:
find_buffer_types
(
m
)
find_buffer_types
(
m
)
for
e
in
scope
.
type_entries
:
for
e
in
scope
.
type_entries
:
...
...
Cython/Compiler/Nodes.py
View file @
60757b21
...
@@ -784,11 +784,31 @@ class CStructOrUnionDefNode(StatNode):
...
@@ -784,11 +784,31 @@ class CStructOrUnionDefNode(StatNode):
self
.
entry
=
env
.
declare_struct_or_union
(
self
.
entry
=
env
.
declare_struct_or_union
(
self
.
name
,
self
.
kind
,
scope
,
self
.
typedef_flag
,
self
.
pos
,
self
.
name
,
self
.
kind
,
scope
,
self
.
typedef_flag
,
self
.
pos
,
self
.
cname
,
visibility
=
self
.
visibility
)
self
.
cname
,
visibility
=
self
.
visibility
)
need_typedef_indirection
=
False
if
self
.
attributes
is
not
None
:
if
self
.
attributes
is
not
None
:
if
self
.
in_pxd
and
not
env
.
in_cinclude
:
if
self
.
in_pxd
and
not
env
.
in_cinclude
:
self
.
entry
.
defined_in_pxd
=
1
self
.
entry
.
defined_in_pxd
=
1
for
attr
in
self
.
attributes
:
for
attr
in
self
.
attributes
:
attr
.
analyse_declarations
(
env
,
scope
)
attr
.
analyse_declarations
(
env
,
scope
)
if
self
.
visibility
!=
'extern'
:
for
attr
in
scope
.
var_entries
:
type
=
attr
.
type
while
type
.
is_array
:
type
=
type
.
base_type
if
type
==
self
.
entry
.
type
:
error
(
attr
.
pos
,
"Struct cannot contain itself as a member."
)
if
self
.
typedef_flag
:
while
type
.
is_ptr
:
type
=
type
.
base_type
if
type
==
self
.
entry
.
type
:
need_typedef_indirection
=
True
if
need_typedef_indirection
:
# C can't handle typedef structs that refer to themselves.
struct_entry
=
self
.
entry
cname
=
env
.
new_const_cname
()
self
.
entry
=
env
.
declare_typedef
(
self
.
name
,
struct_entry
.
type
,
self
.
pos
,
cname
=
self
.
cname
,
visibility
=
'ignore'
)
struct_entry
.
type
.
typedef_flag
=
False
struct_entry
.
cname
=
struct_entry
.
type
.
cname
=
env
.
new_const_cname
()
def
analyse_expressions
(
self
,
env
):
def
analyse_expressions
(
self
,
env
):
pass
pass
...
...
Cython/Compiler/Symtab.py
View file @
60757b21
...
@@ -1020,7 +1020,7 @@ class ModuleScope(Scope):
...
@@ -1020,7 +1020,7 @@ class ModuleScope(Scope):
if defining or implementing:
if defining or implementing:
scope = CClassScope(name = name, outer_scope = self,
scope = CClassScope(name = name, outer_scope = self,
visibility = visibility)
visibility = visibility)
if base_type:
if base_type
and base_type.scope
:
scope.declare_inherited_c_attributes(base_type.scope)
scope.declare_inherited_c_attributes(base_type.scope)
type.set_scope(scope)
type.set_scope(scope)
self.type_entries.append(entry)
self.type_entries.append(entry)
...
...
Cython/Compiler/Version.py
View file @
60757b21
version
=
'0.10.
1
'
version
=
'0.10.
2
'
tests/compile/ctypedefstruct.pyx
View file @
60757b21
...
@@ -7,3 +7,6 @@ cdef order order1
...
@@ -7,3 +7,6 @@ cdef order order1
order1
.
spam
=
7
order1
.
spam
=
7
order1
.
eggs
=
2
order1
.
eggs
=
2
ctypedef
struct
linked
:
int
a
linked
*
next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment