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
98cb5a8e
Commit
98cb5a8e
authored
May 26, 2010
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix types of marked integer literals.
parent
679b58a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+6
-1
tests/run/int_literals.pyx
tests/run/int_literals.pyx
+18
-0
No files found.
Cython/Compiler/ExprNodes.py
View file @
98cb5a8e
...
@@ -787,7 +787,12 @@ class IntNode(ConstNode):
...
@@ -787,7 +787,12 @@ class IntNode(ConstNode):
unsigned
=
""
unsigned
=
""
longness
=
""
longness
=
""
type
=
PyrexTypes
.
c_long_type
def
__init__
(
self
,
pos
,
**
kwds
):
ExprNode
.
__init__
(
self
,
pos
,
**
kwds
)
rank
=
max
(
1
,
len
(
self
.
longness
))
sign
=
not
self
.
unsigned
self
.
type
=
PyrexTypes
.
modifiers_and_name_to_type
[
sign
,
rank
,
"int"
]
def
coerce_to
(
self
,
dst_type
,
env
):
def
coerce_to
(
self
,
dst_type
,
env
):
if
self
.
type
is
dst_type
:
if
self
.
type
is
dst_type
:
...
...
tests/run/int_literals.pyx
View file @
98cb5a8e
...
@@ -6,6 +6,7 @@ __doc__ = u"""
...
@@ -6,6 +6,7 @@ __doc__ = u"""
"""
"""
import
sys
import
sys
from
cython
cimport
typeof
if
sys
.
version_info
[
0
]
>=
3
:
if
sys
.
version_info
[
0
]
>=
3
:
__doc__
=
__doc__
.
replace
(
u'L'
,
u''
)
__doc__
=
__doc__
.
replace
(
u'L'
,
u''
)
...
@@ -35,3 +36,20 @@ def large_literal():
...
@@ -35,3 +36,20 @@ def large_literal():
return
0xFFFFFFFFFFFF
return
0xFFFFFFFFFFFF
else
:
else
:
return
0xFFFFFFF
return
0xFFFFFFF
def
c_long_types
():
"""
>>> c_long_types()
long
long
long long
unsigned long
unsigned long
unsigned long long
"""
print
typeof
(
1
)
print
typeof
(
1L
)
print
typeof
(
1L
L
)
print
typeof
(
1
U
)
print
typeof
(
1
UL
)
print
typeof
(
1
ULL
)
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