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
0a589021
Commit
0a589021
authored
Jul 07, 2015
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tailmatch functions return Py_ssize_t, not int.
parent
e13fa642
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
Cython/Utility/StringTools.c
Cython/Utility/StringTools.c
+12
-9
No files found.
Cython/Utility/StringTools.c
View file @
0a589021
...
@@ -535,12 +535,13 @@ static CYTHON_INLINE int __Pyx_Py_UNICODE_ISTITLE(Py_UCS4 uchar)
...
@@ -535,12 +535,13 @@ static CYTHON_INLINE int __Pyx_Py_UNICODE_ISTITLE(Py_UCS4 uchar)
// tuple of prefixes/suffixes, whereas it's much more common to
// tuple of prefixes/suffixes, whereas it's much more common to
// test for a single unicode string.
// test for a single unicode string.
static
int
__Pyx_PyUnicode_Tailmatch
(
PyObject
*
s
,
PyObject
*
substr
,
static
Py_ssize_t
__Pyx_PyUnicode_Tailmatch
(
PyObject
*
s
,
PyObject
*
substr
,
Py_ssize_t
start
,
Py_ssize_t
end
,
int
direction
)
{
Py_ssize_t
start
,
Py_ssize_t
end
,
int
direction
)
{
if
(
unlikely
(
PyTuple_Check
(
substr
)))
{
if
(
unlikely
(
PyTuple_Check
(
substr
)))
{
Py_ssize_t
i
,
count
=
PyTuple_GET_SIZE
(
substr
);
Py_ssize_t
i
,
count
=
PyTuple_GET_SIZE
(
substr
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
for
(
i
=
0
;
i
<
count
;
i
++
)
{
in
t
result
;
Py_ssize_
t
result
;
#if CYTHON_COMPILING_IN_CPYTHON
#if CYTHON_COMPILING_IN_CPYTHON
result
=
PyUnicode_Tailmatch
(
s
,
PyTuple_GET_ITEM
(
substr
,
i
),
result
=
PyUnicode_Tailmatch
(
s
,
PyTuple_GET_ITEM
(
substr
,
i
),
start
,
end
,
direction
);
start
,
end
,
direction
);
...
@@ -562,14 +563,15 @@ static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr,
...
@@ -562,14 +563,15 @@ static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr,
/////////////// bytes_tailmatch.proto ///////////////
/////////////// bytes_tailmatch.proto ///////////////
static
int
__Pyx_PyBytes_SingleTailmatch
(
PyObject
*
self
,
PyObject
*
arg
,
Py_ssize_t
start
,
static
Py_ssize_t
__Pyx_PyBytes_SingleTailmatch
(
PyObject
*
self
,
PyObject
*
arg
,
Py_ssize_t
end
,
int
direction
)
Py_ssize_t
start
,
Py_ssize_t
end
,
int
direction
)
{
{
const
char
*
self_ptr
=
PyBytes_AS_STRING
(
self
);
const
char
*
self_ptr
=
PyBytes_AS_STRING
(
self
);
Py_ssize_t
self_len
=
PyBytes_GET_SIZE
(
self
);
Py_ssize_t
self_len
=
PyBytes_GET_SIZE
(
self
);
const
char
*
sub_ptr
;
const
char
*
sub_ptr
;
Py_ssize_t
sub_len
;
Py_ssize_t
sub_len
;
in
t
retval
;
Py_ssize_
t
retval
;
Py_buffer
view
;
Py_buffer
view
;
view
.
obj
=
NULL
;
view
.
obj
=
NULL
;
...
@@ -619,13 +621,14 @@ static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg, Py_ssize
...
@@ -619,13 +621,14 @@ static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg, Py_ssize
return
retval
;
return
retval
;
}
}
static
int
__Pyx_PyBytes_Tailmatch
(
PyObject
*
self
,
PyObject
*
substr
,
Py_ssize_t
start
,
static
Py_ssize_t
__Pyx_PyBytes_Tailmatch
(
PyObject
*
self
,
PyObject
*
substr
,
Py_ssize_t
end
,
int
direction
)
Py_ssize_t
start
,
Py_ssize_t
end
,
int
direction
)
{
{
if
(
unlikely
(
PyTuple_Check
(
substr
)))
{
if
(
unlikely
(
PyTuple_Check
(
substr
)))
{
Py_ssize_t
i
,
count
=
PyTuple_GET_SIZE
(
substr
);
Py_ssize_t
i
,
count
=
PyTuple_GET_SIZE
(
substr
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
for
(
i
=
0
;
i
<
count
;
i
++
)
{
in
t
result
;
Py_ssize_
t
result
;
#if CYTHON_COMPILING_IN_CPYTHON
#if CYTHON_COMPILING_IN_CPYTHON
result
=
__Pyx_PyBytes_SingleTailmatch
(
self
,
PyTuple_GET_ITEM
(
substr
,
i
),
result
=
__Pyx_PyBytes_SingleTailmatch
(
self
,
PyTuple_GET_ITEM
(
substr
,
i
),
start
,
end
,
direction
);
start
,
end
,
direction
);
...
...
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