mirror of https://github.com/python/cpython
Hopefully fix Windows compilation error following 499a96611baa
This commit is contained in:
parent
5df8a8a1fd
commit
5b72075387
|
@ -2431,21 +2431,21 @@ bytearray_remove(PyByteArrayObject *self, PyObject *arg)
|
||||||
/* XXX These two helpers could be optimized if argsize == 1 */
|
/* XXX These two helpers could be optimized if argsize == 1 */
|
||||||
|
|
||||||
static Py_ssize_t
|
static Py_ssize_t
|
||||||
lstrip_helper(unsigned char *myptr, Py_ssize_t mysize,
|
lstrip_helper(char *myptr, Py_ssize_t mysize,
|
||||||
void *argptr, Py_ssize_t argsize)
|
void *argptr, Py_ssize_t argsize)
|
||||||
{
|
{
|
||||||
Py_ssize_t i = 0;
|
Py_ssize_t i = 0;
|
||||||
while (i < mysize && memchr(argptr, myptr[i], argsize))
|
while (i < mysize && memchr(argptr, (unsigned char) myptr[i], argsize))
|
||||||
i++;
|
i++;
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Py_ssize_t
|
static Py_ssize_t
|
||||||
rstrip_helper(unsigned char *myptr, Py_ssize_t mysize,
|
rstrip_helper(char *myptr, Py_ssize_t mysize,
|
||||||
void *argptr, Py_ssize_t argsize)
|
void *argptr, Py_ssize_t argsize)
|
||||||
{
|
{
|
||||||
Py_ssize_t i = mysize - 1;
|
Py_ssize_t i = mysize - 1;
|
||||||
while (i >= 0 && memchr(argptr, myptr[i], argsize))
|
while (i >= 0 && memchr(argptr, (unsigned char) myptr[i], argsize))
|
||||||
i--;
|
i--;
|
||||||
return i + 1;
|
return i + 1;
|
||||||
}
|
}
|
||||||
|
@ -2460,7 +2460,7 @@ static PyObject *
|
||||||
bytearray_strip(PyByteArrayObject *self, PyObject *args)
|
bytearray_strip(PyByteArrayObject *self, PyObject *args)
|
||||||
{
|
{
|
||||||
Py_ssize_t left, right, mysize, argsize;
|
Py_ssize_t left, right, mysize, argsize;
|
||||||
void *myptr, *argptr;
|
char *myptr, *argptr;
|
||||||
PyObject *arg = Py_None;
|
PyObject *arg = Py_None;
|
||||||
Py_buffer varg;
|
Py_buffer varg;
|
||||||
if (!PyArg_ParseTuple(args, "|O:strip", &arg))
|
if (!PyArg_ParseTuple(args, "|O:strip", &arg))
|
||||||
|
@ -2472,7 +2472,7 @@ bytearray_strip(PyByteArrayObject *self, PyObject *args)
|
||||||
else {
|
else {
|
||||||
if (_getbuffer(arg, &varg) < 0)
|
if (_getbuffer(arg, &varg) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
argptr = varg.buf;
|
argptr = (char *) varg.buf;
|
||||||
argsize = varg.len;
|
argsize = varg.len;
|
||||||
}
|
}
|
||||||
myptr = PyByteArray_AS_STRING(self);
|
myptr = PyByteArray_AS_STRING(self);
|
||||||
|
@ -2497,7 +2497,7 @@ static PyObject *
|
||||||
bytearray_lstrip(PyByteArrayObject *self, PyObject *args)
|
bytearray_lstrip(PyByteArrayObject *self, PyObject *args)
|
||||||
{
|
{
|
||||||
Py_ssize_t left, right, mysize, argsize;
|
Py_ssize_t left, right, mysize, argsize;
|
||||||
void *myptr, *argptr;
|
char *myptr, *argptr;
|
||||||
PyObject *arg = Py_None;
|
PyObject *arg = Py_None;
|
||||||
Py_buffer varg;
|
Py_buffer varg;
|
||||||
if (!PyArg_ParseTuple(args, "|O:lstrip", &arg))
|
if (!PyArg_ParseTuple(args, "|O:lstrip", &arg))
|
||||||
|
@ -2509,7 +2509,7 @@ bytearray_lstrip(PyByteArrayObject *self, PyObject *args)
|
||||||
else {
|
else {
|
||||||
if (_getbuffer(arg, &varg) < 0)
|
if (_getbuffer(arg, &varg) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
argptr = varg.buf;
|
argptr = (char *) varg.buf;
|
||||||
argsize = varg.len;
|
argsize = varg.len;
|
||||||
}
|
}
|
||||||
myptr = PyByteArray_AS_STRING(self);
|
myptr = PyByteArray_AS_STRING(self);
|
||||||
|
@ -2531,7 +2531,7 @@ static PyObject *
|
||||||
bytearray_rstrip(PyByteArrayObject *self, PyObject *args)
|
bytearray_rstrip(PyByteArrayObject *self, PyObject *args)
|
||||||
{
|
{
|
||||||
Py_ssize_t right, mysize, argsize;
|
Py_ssize_t right, mysize, argsize;
|
||||||
void *myptr, *argptr;
|
char *myptr, *argptr;
|
||||||
PyObject *arg = Py_None;
|
PyObject *arg = Py_None;
|
||||||
Py_buffer varg;
|
Py_buffer varg;
|
||||||
if (!PyArg_ParseTuple(args, "|O:rstrip", &arg))
|
if (!PyArg_ParseTuple(args, "|O:rstrip", &arg))
|
||||||
|
@ -2543,7 +2543,7 @@ bytearray_rstrip(PyByteArrayObject *self, PyObject *args)
|
||||||
else {
|
else {
|
||||||
if (_getbuffer(arg, &varg) < 0)
|
if (_getbuffer(arg, &varg) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
argptr = varg.buf;
|
argptr = (char *) varg.buf;
|
||||||
argsize = varg.len;
|
argsize = varg.len;
|
||||||
}
|
}
|
||||||
myptr = PyByteArray_AS_STRING(self);
|
myptr = PyByteArray_AS_STRING(self);
|
||||||
|
|
Loading…
Reference in New Issue