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
4140e118
Commit
4140e118
authored
Feb 05, 2011
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
in Py3.2, the unicode character testing/conversion functions accept Py_UCS4 instead of Py_UNICODE
parent
ac984421
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+11
-3
No files found.
Cython/Compiler/Optimize.py
View file @
4140e118
...
...
@@ -2183,7 +2183,7 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
PyUnicode_uchar_predicate_func_type
=
PyrexTypes
.
CFuncType
(
PyrexTypes
.
c_bint_type
,
[
PyrexTypes
.
CFuncTypeArg
(
"uchar"
,
PyrexTypes
.
c_py_u
nicode
_type
,
None
),
PyrexTypes
.
CFuncTypeArg
(
"uchar"
,
PyrexTypes
.
c_py_u
cs4
_type
,
None
),
])
def
_inject_unicode_predicate
(
self
,
node
,
args
,
is_unbound_method
):
...
...
@@ -2221,8 +2221,8 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
_handle_simple_method_unicode_isupper
=
_inject_unicode_predicate
PyUnicode_uchar_conversion_func_type
=
PyrexTypes
.
CFuncType
(
PyrexTypes
.
c_py_u
nicode
_type
,
[
PyrexTypes
.
CFuncTypeArg
(
"uchar"
,
PyrexTypes
.
c_py_u
nicode
_type
,
None
),
PyrexTypes
.
c_py_u
cs4
_type
,
[
PyrexTypes
.
CFuncTypeArg
(
"uchar"
,
PyrexTypes
.
c_py_u
cs4
_type
,
None
),
])
def
_inject_unicode_character_conversion
(
self
,
node
,
args
,
is_unbound_method
):
...
...
@@ -2702,10 +2702,18 @@ py_unicode_istitle_utility_code = UtilityCode(
# Py_UNICODE_ISTITLE() doesn't match unicode.istitle() as the latter
# additionally allows character that comply with Py_UNICODE_ISUPPER()
proto
=
'''
#if PY_VERSION_HEX < 0x030200A2
static CYTHON_INLINE int __Pyx_Py_UNICODE_ISTITLE(Py_UNICODE uchar); /* proto */
#else
static CYTHON_INLINE int __Pyx_Py_UNICODE_ISTITLE(Py_UCS4 uchar); /* proto */
#endif
'''
,
impl
=
'''
#if PY_VERSION_HEX < 0x030200A2
static CYTHON_INLINE int __Pyx_Py_UNICODE_ISTITLE(Py_UNICODE uchar) {
#else
static CYTHON_INLINE int __Pyx_Py_UNICODE_ISTITLE(Py_UCS4 uchar) {
#endif
return Py_UNICODE_ISTITLE(uchar) || Py_UNICODE_ISUPPER(uchar);
}
'''
)
...
...
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