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
Gwenaël Samain
cython
Commits
8443607d
Commit
8443607d
authored
Jul 31, 2012
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
determine buffer typegroup of integer dtypes based on signedness at C compile time
parent
c527279f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
15 deletions
+8
-15
Cython/Compiler/Buffer.py
Cython/Compiler/Buffer.py
+8
-15
No files found.
Cython/Compiler/Buffer.py
View file @
8443607d
...
...
@@ -680,32 +680,25 @@ def get_type_information_cname(code, dtype, maxdepth=None):
rep
=
str
(
dtype
)
flags
=
"0"
is_unsigned
=
"0"
if
dtype
.
is_int
:
if
dtype
.
signed
==
0
:
typegroup
=
'U'
else
:
typegroup
=
'I'
is_unsigned
=
"IS_UNSIGNED(%s)"
%
declcode
typegroup
=
"%s ? 'U' : 'I'"
%
is_unsigned
elif
complex_possible
or
dtype
.
is_complex
:
typegroup
=
'C'
typegroup
=
"'C'"
elif
dtype
.
is_float
:
typegroup
=
'R'
typegroup
=
"'R'"
elif
dtype
.
is_struct
:
typegroup
=
'S'
typegroup
=
"'S'"
if
dtype
.
packed
:
flags
=
"__PYX_BUF_FLAGS_PACKED_STRUCT"
elif
dtype
.
is_pyobject
:
typegroup
=
'O'
typegroup
=
"'O'"
else
:
assert
False
if
dtype
.
is_int
:
is_unsigned
=
"IS_UNSIGNED(%s)"
%
declcode
else
:
is_unsigned
=
"0"
typeinfo
=
(
'static __Pyx_TypeInfo %s = '
'{ "%s", %s, sizeof(%s), { %s }, %s,
\
'
%s
\
'
, %s, %s };'
)
'{ "%s", %s, sizeof(%s), { %s }, %s,
%s
, %s, %s };'
)
tup
=
(
name
,
rep
,
structinfo_name
,
declcode
,
', '
.
join
([
str
(
x
)
for
x
in
arraysizes
])
or
'0'
,
len
(
arraysizes
),
typegroup
,
is_unsigned
,
flags
)
...
...
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