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
6160e548
Commit
6160e548
authored
Sep 21, 2013
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify macro arguments.
parent
5ef198d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
Cython/Utility/TypeConversion.c
Cython/Utility/TypeConversion.c
+14
-14
No files found.
Cython/Utility/TypeConversion.c
View file @
6160e548
...
...
@@ -450,20 +450,20 @@ static CYTHON_INLINE PyObject* {{TO_PY_FUNCTION}}({{TYPE}} value) {
/////////////// CIntFromPyVerify ///////////////
#define __PYX_VERIFY_RETURN_INT(t
ype, value
_type, func) \
{ \
value_type value = func(x);
\
if (sizeof(t
ype) < sizeof(value
_type)) { \
if (unlikely(value != (
value_type) (
type) value)) { \
const
value_type zero = 0; \
PyErr_SetString
(
PyExc_OverflowError
,
\
(
is_unsigned
&&
unlikely
(
value
<
zero
))
?
\
"can't convert negative value to "
#
t
ype
:
\
"value too large to convert to "
#
t
ype
);
\
return
(
t
ype
)
-
1
;
\
}
\
}
\
return
(
t
ype
)
value
;
\
#define __PYX_VERIFY_RETURN_INT(t
arget_type, func
_type, func) \
{
\
func_type value = func(x);
\
if (sizeof(t
arget_type) < sizeof(func
_type)) { \
if (unlikely(value != (
func_type) (target_
type) value)) { \
const
func_type zero = 0; \
PyErr_SetString(PyExc_OverflowError,
\
(is_unsigned && unlikely(value < zero)) ?
\
"can't convert negative value to " #t
arget_type :
\
"value too large to convert to " #t
arget_type);
\
return (t
arget_type) -1;
\
}
\
}
\
return (t
arget_type) value;
\
}
...
...
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