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
b058adc5
Commit
b058adc5
authored
Apr 26, 2018
by
Alex Huszagh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug fix for boolean return using statement with internal commas.
parent
ee1b0219
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
Cython/Utility/TypeConversion.c
Cython/Utility/TypeConversion.c
+7
-1
tests/run/cpp_bool_template_return.pyx
tests/run/cpp_bool_template_return.pyx
+16
-0
tests/run/cpp_templates_helper.h
tests/run/cpp_templates_helper.h
+6
-0
No files found.
Cython/Utility/TypeConversion.c
View file @
b058adc5
...
...
@@ -84,7 +84,7 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static
CYTHON_INLINE
PyObject
*
__Pyx_PyBool_FromLong
(
long
b
);
static
CYTHON_INLINE
int
__Pyx_PyObject_IsTrue
(
PyObject
*
);
static
CYTHON_INLINE
PyObject
*
__Pyx_PyNumber_IntOrLong
(
PyObject
*
x
);
...
...
@@ -402,6 +402,12 @@ static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
return
ival
;
}
static
CYTHON_INLINE
PyObject
*
__Pyx_PyBool_FromLong
(
long
b
)
{
return
b
?
__Pyx_NewRef
(
Py_True
)
:
__Pyx_NewRef
(
Py_False
);
}
static
CYTHON_INLINE
PyObject
*
__Pyx_PyInt_FromSize_t
(
size_t
ival
)
{
return
PyInt_FromSize_t
(
ival
);
}
...
...
tests/run/cpp_bool_template_return.pyx
0 → 100644
View file @
b058adc5
# tag: cpp
from
libcpp
cimport
bool
cdef
extern
from
"cpp_templates_helper.h"
:
cdef
cppclass
BinaryAnd
[
T1
,
T2
]:
@
staticmethod
T1
call
(
T1
x
,
T2
y
)
def
test_compound_bool_return
(
bool
x
,
bool
y
):
"""
>>> test_compound_bool_return(True, False)
False
"""
return
BinaryAnd
[
bool
,
bool
].
call
(
x
,
y
)
tests/run/cpp_templates_helper.h
View file @
b058adc5
...
...
@@ -44,3 +44,9 @@ class Div {
public:
static
T
half
(
T
value
)
{
return
value
/
2
;
}
};
template
<
class
T1
,
class
T2
>
class
BinaryAnd
{
public:
static
T1
call
(
T1
x
,
T2
y
)
{
return
x
&
y
;
}
};
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