mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
Issue #1772673: The type of char* arguments now changed to const char*.
This commit is contained in:
parent
80ab13067e
commit
c679227e31
39 changed files with 148 additions and 137 deletions
|
|
@ -223,7 +223,7 @@ PyObject_DelItem(PyObject *o, PyObject *key)
|
|||
}
|
||||
|
||||
int
|
||||
PyObject_DelItemString(PyObject *o, char *key)
|
||||
PyObject_DelItemString(PyObject *o, const char *key)
|
||||
{
|
||||
PyObject *okey;
|
||||
int ret;
|
||||
|
|
@ -1950,7 +1950,7 @@ PyMapping_Length(PyObject *o)
|
|||
#define PyMapping_Length PyMapping_Size
|
||||
|
||||
PyObject *
|
||||
PyMapping_GetItemString(PyObject *o, char *key)
|
||||
PyMapping_GetItemString(PyObject *o, const char *key)
|
||||
{
|
||||
PyObject *okey, *r;
|
||||
|
||||
|
|
@ -1966,7 +1966,7 @@ PyMapping_GetItemString(PyObject *o, char *key)
|
|||
}
|
||||
|
||||
int
|
||||
PyMapping_SetItemString(PyObject *o, char *key, PyObject *value)
|
||||
PyMapping_SetItemString(PyObject *o, const char *key, PyObject *value)
|
||||
{
|
||||
PyObject *okey;
|
||||
int r;
|
||||
|
|
@ -1985,7 +1985,7 @@ PyMapping_SetItemString(PyObject *o, char *key, PyObject *value)
|
|||
}
|
||||
|
||||
int
|
||||
PyMapping_HasKeyString(PyObject *o, char *key)
|
||||
PyMapping_HasKeyString(PyObject *o, const char *key)
|
||||
{
|
||||
PyObject *v;
|
||||
|
||||
|
|
|
|||
|
|
@ -1347,7 +1347,7 @@ do_argstrip(PyBytesObject *self, int striptype, PyObject *args)
|
|||
{
|
||||
PyObject *sep = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, (char *)stripformat[striptype], &sep))
|
||||
if (!PyArg_ParseTuple(args, stripformat[striptype], &sep))
|
||||
return NULL;
|
||||
|
||||
if (sep != NULL && sep != Py_None) {
|
||||
|
|
|
|||
|
|
@ -121,11 +121,11 @@ BaseException_str(PyBaseExceptionObject *self)
|
|||
static PyObject *
|
||||
BaseException_repr(PyBaseExceptionObject *self)
|
||||
{
|
||||
char *name;
|
||||
char *dot;
|
||||
const char *name;
|
||||
const char *dot;
|
||||
|
||||
name = (char *)Py_TYPE(self)->tp_name;
|
||||
dot = strrchr(name, '.');
|
||||
name = Py_TYPE(self)->tp_name;
|
||||
dot = (const char *) strrchr(name, '.');
|
||||
if (dot != NULL) name = dot+1;
|
||||
|
||||
return PyUnicode_FromFormat("%s%R", name, self->args);
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ extern "C" {
|
|||
/* External C interface */
|
||||
|
||||
PyObject *
|
||||
PyFile_FromFd(int fd, char *name, char *mode, int buffering, char *encoding,
|
||||
char *errors, char *newline, int closefd)
|
||||
PyFile_FromFd(int fd, const char *name, const char *mode, int buffering, const char *encoding,
|
||||
const char *errors, const char *newline, int closefd)
|
||||
{
|
||||
PyObject *io, *stream;
|
||||
_Py_IDENTIFIER(open);
|
||||
|
|
|
|||
|
|
@ -1941,10 +1941,10 @@ unsigned char _PyLong_DigitValue[256] = {
|
|||
* string characters.
|
||||
*/
|
||||
static PyLongObject *
|
||||
long_from_binary_base(char **str, int base)
|
||||
long_from_binary_base(const char **str, int base)
|
||||
{
|
||||
char *p = *str;
|
||||
char *start = p;
|
||||
const char *p = *str;
|
||||
const char *start = p;
|
||||
int bits_per_char;
|
||||
Py_ssize_t n;
|
||||
PyLongObject *z;
|
||||
|
|
@ -2009,10 +2009,10 @@ long_from_binary_base(char **str, int base)
|
|||
* If unsuccessful, NULL will be returned.
|
||||
*/
|
||||
PyObject *
|
||||
PyLong_FromString(char *str, char **pend, int base)
|
||||
PyLong_FromString(const char *str, char **pend, int base)
|
||||
{
|
||||
int sign = 1, error_if_nonzero = 0;
|
||||
char *start, *orig_str = str;
|
||||
const char *start, *orig_str = str;
|
||||
PyLongObject *z = NULL;
|
||||
PyObject *strobj;
|
||||
Py_ssize_t slen;
|
||||
|
|
@ -2147,7 +2147,7 @@ digit beyond the first.
|
|||
int convwidth;
|
||||
twodigits convmultmax, convmult;
|
||||
digit *pz, *pzstop;
|
||||
char* scan;
|
||||
const char* scan;
|
||||
|
||||
static double log_base_BASE[37] = {0.0e0,};
|
||||
static int convwidth_base[37] = {0,};
|
||||
|
|
@ -2275,12 +2275,12 @@ digit beyond the first.
|
|||
if (z == NULL)
|
||||
return NULL;
|
||||
if (pend != NULL)
|
||||
*pend = str;
|
||||
*pend = (char *)str;
|
||||
return (PyObject *) z;
|
||||
|
||||
onError:
|
||||
if (pend != NULL)
|
||||
*pend = str;
|
||||
*pend = (char *)str;
|
||||
Py_XDECREF(z);
|
||||
slen = strlen(orig_str) < 200 ? strlen(orig_str) : 200;
|
||||
strobj = PyUnicode_FromStringAndSize(orig_str, slen);
|
||||
|
|
|
|||
|
|
@ -11874,7 +11874,7 @@ do_argstrip(PyObject *self, int striptype, PyObject *args)
|
|||
{
|
||||
PyObject *sep = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, (char *)stripformat[striptype], &sep))
|
||||
if (!PyArg_ParseTuple(args, stripformat[striptype], &sep))
|
||||
return NULL;
|
||||
|
||||
if (sep != NULL && sep != Py_None) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue