Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
36ff3d23
Commit
36ff3d23
authored
Oct 21, 2015
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch calling convention of string.replace() away from varargs
parent
b9764e2d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
from_cpython/Objects/stringobject.c
from_cpython/Objects/stringobject.c
+8
-3
src/runtime/str.cpp
src/runtime/str.cpp
+1
-1
No files found.
from_cpython/Objects/stringobject.c
View file @
36ff3d23
...
@@ -899,14 +899,19 @@ replace(PyStringObject *self,
...
@@ -899,14 +899,19 @@ replace(PyStringObject *self,
}
}
}
}
PyObject
*
string_replace
(
PyStringObject
*
self
,
PyObject
*
args
)
// Pyston change: don't use varags calling convention
// PyObject* string_replace(PyStringObject *self, PyObject *args)
PyObject
*
string_replace
(
PyStringObject
*
self
,
PyObject
*
from
,
PyObject
*
to
,
PyObject
**
args
)
{
{
PyObject
*
_count
=
args
[
0
];
Py_ssize_t
count
=
-
1
;
Py_ssize_t
count
=
-
1
;
PyObject
*
from
,
*
to
;
const
char
*
from_s
,
*
to_s
;
const
char
*
from_s
,
*
to_s
;
Py_ssize_t
from_len
,
to_len
;
Py_ssize_t
from_len
,
to_len
;
if
(
!
PyArg_ParseTuple
(
args
,
"OO|n:replace"
,
&
from
,
&
to
,
&
count
))
// Pyston change: don't use varags calling convention
// if (!PyArg_ParseTuple(args, "OO|n:replace", &from, &to, &count))
// return NULL;
if
(
_count
&&
!
PyArg_ParseSingle
(
_count
,
3
,
"replace"
,
"n"
,
&
count
))
return
NULL
;
return
NULL
;
if
(
PyString_Check
(
from
))
{
if
(
PyString_Check
(
from
))
{
...
...
src/runtime/str.cpp
View file @
36ff3d23
...
@@ -2780,7 +2780,7 @@ static PyMethodDef string_methods[] = {
...
@@ -2780,7 +2780,7 @@ static PyMethodDef string_methods[] = {
{
"rindex"
,
(
PyCFunction
)
string_rindex
,
METH_VARARGS
,
NULL
},
{
"rindex"
,
(
PyCFunction
)
string_rindex
,
METH_VARARGS
,
NULL
},
{
"rfind"
,
(
PyCFunction
)
string_rfind
,
METH_VARARGS
,
NULL
},
{
"rfind"
,
(
PyCFunction
)
string_rfind
,
METH_VARARGS
,
NULL
},
{
"expandtabs"
,
(
PyCFunction
)
string_expandtabs
,
METH_VARARGS
,
NULL
},
{
"expandtabs"
,
(
PyCFunction
)
string_expandtabs
,
METH_VARARGS
,
NULL
},
{
"replace"
,
(
PyCFunction
)
string_replace
,
METH_
VARARGS
,
NULL
},
{
"replace"
,
(
PyCFunction
)
string_replace
,
METH_
O3
|
METH_D1
,
NULL
},
{
"splitlines"
,
(
PyCFunction
)
string_splitlines
,
METH_VARARGS
,
NULL
},
{
"splitlines"
,
(
PyCFunction
)
string_splitlines
,
METH_VARARGS
,
NULL
},
{
"zfill"
,
(
PyCFunction
)
string_zfill
,
METH_VARARGS
,
NULL
},
{
"zfill"
,
(
PyCFunction
)
string_zfill
,
METH_VARARGS
,
NULL
},
{
"__format__"
,
(
PyCFunction
)
string__format__
,
METH_VARARGS
,
NULL
},
{
"__format__"
,
(
PyCFunction
)
string__format__
,
METH_VARARGS
,
NULL
},
...
...
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