mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 06:48:31 +00:00
Revert "Backport METH_FASTCALL from Python 3.7 (#328)"
This reverts commit cf73bbd678
.
This commit is contained in:
parent
e7611a8476
commit
2ea1dc405c
102 changed files with 3299 additions and 2894 deletions
|
@ -52,7 +52,7 @@ PyDoc_STRVAR(bytearray_translate__doc__,
|
|||
"The remaining characters are mapped through the given translation table.");
|
||||
|
||||
#define BYTEARRAY_TRANSLATE_METHODDEF \
|
||||
{"translate", (PyCFunction)bytearray_translate, METH_FASTCALL|METH_KEYWORDS, bytearray_translate__doc__},
|
||||
{"translate", (PyCFunction)bytearray_translate, METH_FASTCALL, bytearray_translate__doc__},
|
||||
|
||||
static PyObject *
|
||||
bytearray_translate_impl(PyByteArrayObject *self, PyObject *table,
|
||||
|
@ -95,7 +95,7 @@ static PyObject *
|
|||
bytearray_maketrans_impl(Py_buffer *frm, Py_buffer *to);
|
||||
|
||||
static PyObject *
|
||||
bytearray_maketrans(void *null, PyObject **args, Py_ssize_t nargs)
|
||||
bytearray_maketrans(void *null, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer frm = {NULL, NULL};
|
||||
|
@ -105,6 +105,10 @@ bytearray_maketrans(void *null, PyObject **args, Py_ssize_t nargs)
|
|||
&frm, &to)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("maketrans", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = bytearray_maketrans_impl(&frm, &to);
|
||||
|
||||
exit:
|
||||
|
@ -141,7 +145,7 @@ bytearray_replace_impl(PyByteArrayObject *self, Py_buffer *old,
|
|||
Py_buffer *new, Py_ssize_t count);
|
||||
|
||||
static PyObject *
|
||||
bytearray_replace(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs)
|
||||
bytearray_replace(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_buffer old = {NULL, NULL};
|
||||
|
@ -152,6 +156,10 @@ bytearray_replace(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs)
|
|||
&old, &new, &count)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("replace", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = bytearray_replace_impl(self, &old, &new, count);
|
||||
|
||||
exit:
|
||||
|
@ -182,7 +190,7 @@ PyDoc_STRVAR(bytearray_split__doc__,
|
|||
" -1 (the default value) means no limit.");
|
||||
|
||||
#define BYTEARRAY_SPLIT_METHODDEF \
|
||||
{"split", (PyCFunction)bytearray_split, METH_FASTCALL|METH_KEYWORDS, bytearray_split__doc__},
|
||||
{"split", (PyCFunction)bytearray_split, METH_FASTCALL, bytearray_split__doc__},
|
||||
|
||||
static PyObject *
|
||||
bytearray_split_impl(PyByteArrayObject *self, PyObject *sep,
|
||||
|
@ -257,7 +265,7 @@ PyDoc_STRVAR(bytearray_rsplit__doc__,
|
|||
"Splitting is done starting at the end of the bytearray and working to the front.");
|
||||
|
||||
#define BYTEARRAY_RSPLIT_METHODDEF \
|
||||
{"rsplit", (PyCFunction)bytearray_rsplit, METH_FASTCALL|METH_KEYWORDS, bytearray_rsplit__doc__},
|
||||
{"rsplit", (PyCFunction)bytearray_rsplit, METH_FASTCALL, bytearray_rsplit__doc__},
|
||||
|
||||
static PyObject *
|
||||
bytearray_rsplit_impl(PyByteArrayObject *self, PyObject *sep,
|
||||
|
@ -318,7 +326,7 @@ static PyObject *
|
|||
bytearray_insert_impl(PyByteArrayObject *self, Py_ssize_t index, int item);
|
||||
|
||||
static PyObject *
|
||||
bytearray_insert(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs)
|
||||
bytearray_insert(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t index;
|
||||
|
@ -328,6 +336,10 @@ bytearray_insert(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs)
|
|||
&index, _getbytevalue, &item)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("insert", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = bytearray_insert_impl(self, index, item);
|
||||
|
||||
exit:
|
||||
|
@ -395,7 +407,7 @@ static PyObject *
|
|||
bytearray_pop_impl(PyByteArrayObject *self, Py_ssize_t index);
|
||||
|
||||
static PyObject *
|
||||
bytearray_pop(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs)
|
||||
bytearray_pop(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
Py_ssize_t index = -1;
|
||||
|
@ -404,6 +416,10 @@ bytearray_pop(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs)
|
|||
&index)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("pop", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = bytearray_pop_impl(self, index);
|
||||
|
||||
exit:
|
||||
|
@ -455,7 +471,7 @@ static PyObject *
|
|||
bytearray_strip_impl(PyByteArrayObject *self, PyObject *bytes);
|
||||
|
||||
static PyObject *
|
||||
bytearray_strip(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs)
|
||||
bytearray_strip(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *bytes = Py_None;
|
||||
|
@ -465,6 +481,10 @@ bytearray_strip(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs)
|
|||
&bytes)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("strip", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = bytearray_strip_impl(self, bytes);
|
||||
|
||||
exit:
|
||||
|
@ -486,7 +506,7 @@ static PyObject *
|
|||
bytearray_lstrip_impl(PyByteArrayObject *self, PyObject *bytes);
|
||||
|
||||
static PyObject *
|
||||
bytearray_lstrip(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs)
|
||||
bytearray_lstrip(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *bytes = Py_None;
|
||||
|
@ -496,6 +516,10 @@ bytearray_lstrip(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs)
|
|||
&bytes)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("lstrip", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = bytearray_lstrip_impl(self, bytes);
|
||||
|
||||
exit:
|
||||
|
@ -517,7 +541,7 @@ static PyObject *
|
|||
bytearray_rstrip_impl(PyByteArrayObject *self, PyObject *bytes);
|
||||
|
||||
static PyObject *
|
||||
bytearray_rstrip(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs)
|
||||
bytearray_rstrip(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
PyObject *bytes = Py_None;
|
||||
|
@ -527,6 +551,10 @@ bytearray_rstrip(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs)
|
|||
&bytes)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("rstrip", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = bytearray_rstrip_impl(self, bytes);
|
||||
|
||||
exit:
|
||||
|
@ -549,7 +577,7 @@ PyDoc_STRVAR(bytearray_decode__doc__,
|
|||
" can handle UnicodeDecodeErrors.");
|
||||
|
||||
#define BYTEARRAY_DECODE_METHODDEF \
|
||||
{"decode", (PyCFunction)bytearray_decode, METH_FASTCALL|METH_KEYWORDS, bytearray_decode__doc__},
|
||||
{"decode", (PyCFunction)bytearray_decode, METH_FASTCALL, bytearray_decode__doc__},
|
||||
|
||||
static PyObject *
|
||||
bytearray_decode_impl(PyByteArrayObject *self, const char *encoding,
|
||||
|
@ -597,7 +625,7 @@ PyDoc_STRVAR(bytearray_splitlines__doc__,
|
|||
"true.");
|
||||
|
||||
#define BYTEARRAY_SPLITLINES_METHODDEF \
|
||||
{"splitlines", (PyCFunction)bytearray_splitlines, METH_FASTCALL|METH_KEYWORDS, bytearray_splitlines__doc__},
|
||||
{"splitlines", (PyCFunction)bytearray_splitlines, METH_FASTCALL, bytearray_splitlines__doc__},
|
||||
|
||||
static PyObject *
|
||||
bytearray_splitlines_impl(PyByteArrayObject *self, int keepends);
|
||||
|
@ -681,7 +709,7 @@ static PyObject *
|
|||
bytearray_reduce_ex_impl(PyByteArrayObject *self, int proto);
|
||||
|
||||
static PyObject *
|
||||
bytearray_reduce_ex(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs)
|
||||
bytearray_reduce_ex(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs, PyObject *kwnames)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
int proto = 0;
|
||||
|
@ -690,6 +718,10 @@ bytearray_reduce_ex(PyByteArrayObject *self, PyObject **args, Py_ssize_t nargs)
|
|||
&proto)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!_PyArg_NoStackKeywords("__reduce_ex__", kwnames)) {
|
||||
goto exit;
|
||||
}
|
||||
return_value = bytearray_reduce_ex_impl(self, proto);
|
||||
|
||||
exit:
|
||||
|
@ -713,4 +745,4 @@ bytearray_sizeof(PyByteArrayObject *self, PyObject *Py_UNUSED(ignored))
|
|||
{
|
||||
return bytearray_sizeof_impl(self);
|
||||
}
|
||||
/*[clinic end generated code: output=c2804d009182328c input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=c1b1b83b0e19df74 input=a9049054013a1b77]*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue