summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-09-28 08:27:24 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-09-28 08:27:24 (GMT)
commit20b39b27d96b7c068f364ea79584feaa70fd15b6 (patch)
tree8a37818cb0163a3f5cab0e04d36223cdc190e0f5 /Objects
parent131caba074ae6d72dd795ca9a61f17c45c1a3349 (diff)
downloadcpython-20b39b27d96b7c068f364ea79584feaa70fd15b6.zip
cpython-20b39b27d96b7c068f364ea79584feaa70fd15b6.tar.gz
cpython-20b39b27d96b7c068f364ea79584feaa70fd15b6.tar.bz2
Removed redundant casts to `char *`.
Corresponding functions now accept `const char *` (issue #1772673).
Diffstat (limited to 'Objects')
-rw-r--r--Objects/bytesobject.c2
-rw-r--r--Objects/floatobject.c4
-rw-r--r--Objects/longobject.c2
-rw-r--r--Objects/unicodeobject.c4
4 files changed, 6 insertions, 6 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 63d5a5c..4f2da4c 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -3403,7 +3403,7 @@ _PyBytes_Resize(PyObject **pv, Py_ssize_t newsize)
_Py_DEC_REFTOTAL;
_Py_ForgetReference(v);
*pv = (PyObject *)
- PyObject_REALLOC((char *)v, PyBytesObject_SIZE + newsize);
+ PyObject_REALLOC(v, PyBytesObject_SIZE + newsize);
if (*pv == NULL) {
PyObject_Del(v);
PyErr_NoMemory();
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index 05b7679..dceb55e 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -2026,7 +2026,7 @@ _PyFloat_Pack4(double x, unsigned char *p, int le)
}
else {
float y = (float)x;
- const char *s = (char*)&y;
+ const unsigned char *s = (unsigned char*)&y;
int i, incr = 1;
if (Py_IS_INFINITY(y) && !Py_IS_INFINITY(x))
@@ -2162,7 +2162,7 @@ _PyFloat_Pack8(double x, unsigned char *p, int le)
return -1;
}
else {
- const char *s = (char*)&x;
+ const unsigned char *s = (unsigned char*)&x;
int i, incr = 1;
if ((double_format == ieee_little_endian_format && !le)
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 68dc85f..bb2eb17 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -2312,7 +2312,7 @@ _PyLong_FromBytes(const char *s, Py_ssize_t len, int base)
PyObject *result, *strobj;
char *end = NULL;
- result = PyLong_FromString((char*)s, &end, base);
+ result = PyLong_FromString(s, &end, base);
if (end == NULL || (result != NULL && end == s + len))
return result;
Py_XDECREF(result);
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index f5d7b78..5a3ccaf 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -727,7 +727,7 @@ resize_compact(PyObject *unicode, Py_ssize_t length)
_Py_DEC_REFTOTAL;
_Py_ForgetReference(unicode);
- new_unicode = (PyObject *)PyObject_REALLOC((char *)unicode, new_size);
+ new_unicode = (PyObject *)PyObject_REALLOC(unicode, new_size);
if (new_unicode == NULL) {
_Py_NewReference(unicode);
PyErr_NoMemory();
@@ -3483,7 +3483,7 @@ mbstowcs_errorpos(const char *str, size_t len)
memset(&mbs, 0, sizeof mbs);
while (len)
{
- converted = mbrtowc(&ch, (char*)str, len, &mbs);
+ converted = mbrtowc(&ch, str, len, &mbs);
if (converted == 0)
/* Reached end of string */
break;