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
f913f4d3
Commit
f913f4d3
authored
Mar 09, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
streamline __Pyx_PyInt_AsSize_t() a bit
parent
e6b4ffbd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
Cython/Utility/TypeConversion.c
Cython/Utility/TypeConversion.c
+4
-5
No files found.
Cython/Utility/TypeConversion.c
View file @
f913f4d3
...
...
@@ -280,11 +280,10 @@ static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
static
CYTHON_INLINE
size_t
__Pyx_PyInt_AsSize_t
(
PyObject
*
x
)
{
unsigned
PY_LONG_LONG
val
=
__Pyx_PyInt_AsUnsignedLongLong
(
x
);
if
(
unlikely
(
val
==
(
unsigned
PY_LONG_LONG
)
-
1
&&
PyErr_Occurred
()))
{
return
(
size_t
)
-
1
;
}
else
if
(
unlikely
(
val
!=
(
unsigned
PY_LONG_LONG
)(
size_t
)
val
))
{
PyErr_SetString
(
PyExc_OverflowError
,
"value too large to convert to size_t"
);
if
(
unlikely
(
val
!=
(
unsigned
PY_LONG_LONG
)(
size_t
)
val
))
{
if
((
val
!=
(
unsigned
PY_LONG_LONG
)
-
1
)
||
!
PyErr_Occurred
())
PyErr_SetString
(
PyExc_OverflowError
,
"value too large to convert to size_t"
);
return
(
size_t
)
-
1
;
}
return
(
size_t
)
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