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
5ef8c817
Commit
5ef8c817
authored
Sep 10, 2009
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imported patch shrink-int-convert
parent
021488a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+4
-7
No files found.
Cython/Compiler/PyrexTypes.py
View file @
5ef8c817
...
@@ -599,15 +599,12 @@ static INLINE %(type)s __Pyx_PyInt_As%(SignWord)s%(TypeName)s(PyObject* x) {
...
@@ -599,15 +599,12 @@ static INLINE %(type)s __Pyx_PyInt_As%(SignWord)s%(TypeName)s(PyObject* x) {
if (sizeof(%(type)s) < sizeof(long)) {
if (sizeof(%(type)s) < sizeof(long)) {
long val = __Pyx_PyInt_AsLong(x);
long val = __Pyx_PyInt_AsLong(x);
if (unlikely(val != (long)(%(type)s)val)) {
if (unlikely(val != (long)(%(type)s)val)) {
if (unlikely(val == -1 && PyErr_Occurred()))
if (!unlikely(val == -1 && PyErr_Occurred())) {
return (%(type)s)-1;
if (((%(type)s)-1) > ((%(type)s)0) && unlikely(val < 0)) {
PyErr_SetString(PyExc_OverflowError,
PyErr_SetString(PyExc_OverflowError,
"can't convert negative value to %(type)s");
(((%(type)s)-1) > ((%(type)s)0) && unlikely(val < 0)) ?
return (%(type)s)-1;
"can't convert negative value to %(type)s" :
"value too large to convert to %(type)s");
}
}
PyErr_SetString(PyExc_OverflowError,
"value too large to convert to %(type)s");
return (%(type)s)-1;
return (%(type)s)-1;
}
}
return (%(type)s)val;
return (%(type)s)val;
...
...
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