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
010ca805
Commit
010ca805
authored
Apr 09, 2016
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
assure constant declarations in bint->PyUnicode conversion code
parent
9fd9d301
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
12 deletions
+9
-12
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+8
-11
Cython/Utility/TypeConversion.c
Cython/Utility/TypeConversion.c
+1
-1
No files found.
Cython/Compiler/PyrexTypes.py
View file @
010ca805
...
...
@@ -1768,17 +1768,14 @@ class CBIntType(CIntType):
return
not
format_spec
def
to_pystring_function
(
self
,
code
):
if
self
.
to_pyunicode_utility
is
None
:
utility_code_name
=
"__Pyx_PyUnicode_FromBInt_"
+
self
.
specialization_name
()
to_pyunicode_utility
=
TempitaUtilityCode
.
load_cached
(
"CBIntToPyUnicode"
,
"TypeConversion.c"
,
context
=
{
"TRUE_CONST"
:
code
.
globalstate
.
get_py_string_const
(
StringEncoding
.
EncodedString
(
"True"
)).
cname
,
"FALSE_CONST"
:
code
.
globalstate
.
get_py_string_const
(
StringEncoding
.
EncodedString
(
"False"
)).
cname
,
"TO_PY_FUNCTION"
:
utility_code_name
,
})
self
.
to_pyunicode_utility
=
(
utility_code_name
,
to_pyunicode_utility
)
else
:
utility_code_name
,
to_pyunicode_utility
=
self
.
to_pyunicode_utility
# NOTE: no caching here as the string constant cnames depend on the current module
utility_code_name
=
"__Pyx_PyUnicode_FromBInt_"
+
self
.
specialization_name
()
to_pyunicode_utility
=
TempitaUtilityCode
.
load_cached
(
"CBIntToPyUnicode"
,
"TypeConversion.c"
,
context
=
{
"TRUE_CONST"
:
code
.
globalstate
.
get_py_string_const
(
StringEncoding
.
EncodedString
(
"True"
)).
cname
,
"FALSE_CONST"
:
code
.
globalstate
.
get_py_string_const
(
StringEncoding
.
EncodedString
(
"False"
)).
cname
,
"TO_PY_FUNCTION"
:
utility_code_name
,
})
code
.
globalstate
.
use_utility_code
(
to_pyunicode_utility
)
return
utility_code_name
...
...
Cython/Utility/TypeConversion.c
View file @
010ca805
...
...
@@ -657,7 +657,7 @@ static CYTHON_INLINE PyObject* {{TO_PY_FUNCTION}}({{TYPE}} value, char format_ch
/////////////// CBIntToPyUnicode.proto ///////////////
#define {{TO_PY_FUNCTION}}(value, format_char) \
((value) ?
(Py_INCREF({{TRUE_CONST}}), {{TRUE_CONST}}) : (Py_INCREF({{FALSE_CONST}}),
{{FALSE_CONST}}))
((value) ?
__Pyx_NewRef({{TRUE_CONST}}) : __Pyx_NewRef(
{{FALSE_CONST}}))
/////////////// PyIntFromDouble.proto ///////////////
...
...
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