diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/abstract.c | 8 | ||||
-rw-r--r-- | Objects/bytesobject.c | 2 | ||||
-rw-r--r-- | Objects/exceptions.c | 8 | ||||
-rw-r--r-- | Objects/fileobject.c | 4 | ||||
-rw-r--r-- | Objects/longobject.c | 16 | ||||
-rw-r--r-- | Objects/unicodeobject.c | 2 |
6 files changed, 20 insertions, 20 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index 078b4bc..d937892 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -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; diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 3a2906c..6132690 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -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) { diff --git a/Objects/exceptions.c b/Objects/exceptions.c index 79bbb8f..de5d746 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -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); diff --git a/Objects/fileobject.c b/Objects/fileobject.c index f273b0b..596f909 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -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); diff --git a/Objects/longobject.c b/Objects/longobject.c index 876cd19..a5c0d1b 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -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); diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index b9e8e1e..ff806cf 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -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) { |