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
49b4a386
Commit
49b4a386
authored
Feb 06, 2009
by
Lisandro Dalcin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix type conversion functions involving PY_LONG_LONG for Python 3
parent
7abeaf17
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+8
-2
No files found.
Cython/Compiler/PyrexTypes.py
View file @
49b4a386
...
@@ -1403,10 +1403,13 @@ static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
...
@@ -1403,10 +1403,13 @@ static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
}
}
static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x) {
static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x) {
#if PY_VERSION_HEX < 0x03000000
if (PyInt_CheckExact(x)) {
if (PyInt_CheckExact(x)) {
return PyInt_AS_LONG(x);
return PyInt_AS_LONG(x);
}
}
else if (PyLong_CheckExact(x)) {
else
#endif
if (PyLong_CheckExact(x)) {
return PyLong_AsLongLong(x);
return PyLong_AsLongLong(x);
}
}
else {
else {
...
@@ -1419,6 +1422,7 @@ static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x) {
...
@@ -1419,6 +1422,7 @@ static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x) {
}
}
static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
#if PY_VERSION_HEX < 0x03000000
if (PyInt_CheckExact(x)) {
if (PyInt_CheckExact(x)) {
long val = PyInt_AS_LONG(x);
long val = PyInt_AS_LONG(x);
if (unlikely(val < 0)) {
if (unlikely(val < 0)) {
...
@@ -1427,7 +1431,9 @@ static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x)
...
@@ -1427,7 +1431,9 @@ static INLINE unsigned PY_LONG_LONG __pyx_PyInt_AsUnsignedLongLong(PyObject* x)
}
}
return val;
return val;
}
}
else if (PyLong_CheckExact(x)) {
else
#endif
if (PyLong_CheckExact(x)) {
return PyLong_AsUnsignedLongLong(x);
return PyLong_AsUnsignedLongLong(x);
}
}
else {
else {
...
...
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