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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
1f56cb7d
Commit
1f56cb7d
authored
Apr 19, 2012
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix C compiler warning about missing struct initialisers, removed some dead code
parent
b4ddca5e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
13 deletions
+3
-13
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+2
-12
Cython/Utility/TypeConversion.c
Cython/Utility/TypeConversion.c
+1
-1
No files found.
Cython/Compiler/PyrexTypes.py
View file @
1f56cb7d
...
...
@@ -2828,7 +2828,7 @@ class CStructOrUnionType(CType):
if
env
.
outer_scope
is
None
:
return
False
if
self
.
_convert_to_py_code
is
False
:
return
# tri-state-ish
if
self
.
_convert_to_py_code
is
False
:
return
None
# tri-state-ish
if
self
.
_convert_to_py_code
is
None
:
for
member
in
self
.
scope
.
var_entries
:
...
...
@@ -2846,7 +2846,7 @@ class CStructOrUnionType(CType):
if
env
.
outer_scope
is
None
:
return
False
if
self
.
_convert_from_py_code
is
False
:
return
# tri-state-ish
if
self
.
_convert_from_py_code
is
False
:
return
None
# tri-state-ish
if
self
.
_convert_from_py_code
is
None
:
for
member
in
self
.
scope
.
var_entries
:
...
...
@@ -2856,20 +2856,10 @@ class CStructOrUnionType(CType):
self
.
_convert_from_py_code
=
False
return
False
forward_decl
=
(
self
.
entry
.
visibility
!=
'extern'
)
# Avoid C compiler warnings
nesting_depth
=
0
type
=
self
while
type
.
is_struct_or_union
:
type
=
type
.
scope
.
var_entries
[
0
].
type
nesting_depth
+=
1
context
=
dict
(
struct_type_decl
=
self
.
declaration_code
(
""
),
var_entries
=
self
.
scope
.
var_entries
,
funcname
=
self
.
from_py_function
,
init
=
'%s 0 %s'
%
(
'{'
*
nesting_depth
,
'}'
*
nesting_depth
)
)
self
.
_convert_from_py_code
=
TempitaUtilityCode
.
load
(
"FromPyStructUtility"
,
"TypeConversion.c"
,
context
=
context
)
...
...
Cython/Utility/TypeConversion.c
View file @
1f56cb7d
...
...
@@ -4,7 +4,7 @@ static {{struct_type_decl}} {{funcname}}(PyObject *);
/////////////// FromPyStructUtility ///////////////
static
{{
struct_type_decl
}}
{{
funcname
}}(
PyObject
*
o
)
{
{{
struct_type_decl
}}
result
=
{{
init
}}
;
{{
struct_type_decl
}}
result
;
PyObject
*
value
=
NULL
;
if
(
!
PyMapping_Check
(
o
))
{
...
...
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