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
1a3b1fba
Commit
1a3b1fba
authored
Oct 08, 2008
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More struct cleanup.
parent
6049280b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
9 deletions
+3
-9
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+3
-1
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+0
-8
No files found.
Cython/Compiler/PyrexTypes.py
View file @
1a3b1fba
...
@@ -953,9 +953,11 @@ class CStructOrUnionType(CType):
...
@@ -953,9 +953,11 @@ class CStructOrUnionType(CType):
code
.
putln
(
"res = PyDict_New(); if (res == NULL) return NULL;"
)
code
.
putln
(
"res = PyDict_New(); if (res == NULL) return NULL;"
)
for
member
in
self
.
scope
.
var_entries
:
for
member
in
self
.
scope
.
var_entries
:
if
member
.
type
.
to_py_function
and
member
.
type
.
create_convert_utility_code
(
env
):
if
member
.
type
.
to_py_function
and
member
.
type
.
create_convert_utility_code
(
env
):
interned_name
=
env
.
get_string_const
(
member
.
name
,
identifier
=
True
)
env
.
add_py_string
(
interned_name
)
code
.
putln
(
"member = %s(s.%s); if (member == NULL) goto bad;"
%
(
code
.
putln
(
"member = %s(s.%s); if (member == NULL) goto bad;"
%
(
member
.
type
.
to_py_function
,
member
.
cname
))
member
.
type
.
to_py_function
,
member
.
cname
))
code
.
putln
(
"if (PyDict_SetItem(res, %s, member) < 0) goto bad;"
%
member
.
py
_name
.
pystring_cname
)
code
.
putln
(
"if (PyDict_SetItem(res, %s, member) < 0) goto bad;"
%
interned
_name
.
pystring_cname
)
code
.
putln
(
"Py_DECREF(member);"
)
code
.
putln
(
"Py_DECREF(member);"
)
else
:
else
:
self
.
to_py_function
=
None
self
.
to_py_function
=
None
...
...
Cython/Compiler/Symtab.py
View file @
1a3b1fba
...
@@ -359,8 +359,6 @@ class Scope:
...
@@ -359,8 +359,6 @@ class Scope:
self.type_entries.append(entry)
self.type_entries.append(entry)
if not scope and not entry.type.scope:
if not scope and not entry.type.scope:
self.check_for_illegal_incomplete_ctypedef(typedef_flag, pos)
self.check_for_illegal_incomplete_ctypedef(typedef_flag, pos)
if scope and self.outer_scope:
scope.module_scope = self
return entry
return entry
def check_previous_typedef_flag(self, entry, typedef_flag, pos):
def check_previous_typedef_flag(self, entry, typedef_flag, pos):
...
@@ -1207,8 +1205,6 @@ class GeneratorLocalScope(LocalScope):
...
@@ -1207,8 +1205,6 @@ class GeneratorLocalScope(LocalScope):
class StructOrUnionScope(Scope):
class StructOrUnionScope(Scope):
# Namespace of a C struct or union.
# Namespace of a C struct or union.
module_scope = None
def __init__(self, name="?"):
def __init__(self, name="?"):
Scope.__init__(self, name, None, None)
Scope.__init__(self, name, None, None)
...
@@ -1221,10 +1217,6 @@ class StructOrUnionScope(Scope):
...
@@ -1221,10 +1217,6 @@ class StructOrUnionScope(Scope):
type = PyrexTypes.CPtrType(type)
type = PyrexTypes.CPtrType(type)
entry = self.declare(name, cname, type, pos, visibility)
entry = self.declare(name, cname, type, pos, visibility)
entry.is_variable = 1
entry.is_variable = 1
if self.module_scope:
py_name = self.module_scope.get_string_const(name, identifier=True)
self.module_scope.add_py_string(py_name)
entry.py_name = py_name
self.var_entries.append(entry)
self.var_entries.append(entry)
if type.is_pyobject and not allow_pyobject:
if type.is_pyobject and not allow_pyobject:
error(pos,
error(pos,
...
...
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