summaryrefslogtreecommitdiffstats
path: root/Modules/binascii.c
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2001-10-04 14:54:53 (GMT)
committerGreg Ward <gward@python.net>2001-10-04 14:54:53 (GMT)
commita645b30294d9f712842da4aa196cbcdda06a7dcc (patch)
tree3f26d0728bdabd2e11e9f7cd0ed4d217e62ea8dc /Modules/binascii.c
parent201baee7ea44b862d5cddcd61b89688fd1203d18 (diff)
downloadcpython-a645b30294d9f712842da4aa196cbcdda06a7dcc.zip
cpython-a645b30294d9f712842da4aa196cbcdda06a7dcc.tar.gz
cpython-a645b30294d9f712842da4aa196cbcdda06a7dcc.tar.bz2
Add various typecasts (back and forth from char * to unsigned char *)
to make the SGI C compiler happier (bug #445960).
Diffstat (limited to 'Modules/binascii.c')
-rw-r--r--Modules/binascii.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/binascii.c b/Modules/binascii.c
index 484f656..4ddea56 100644
--- a/Modules/binascii.c
+++ b/Modules/binascii.c
@@ -1013,7 +1013,7 @@ binascii_a2b_qp(PyObject *self, PyObject *args, PyObject *kwargs)
return NULL;
/* We allocate the output same size as input, this is overkill */
- odata = (char *) calloc(1, datalen);
+ odata = (unsigned char *) calloc(1, datalen);
if (odata == NULL) {
PyErr_NoMemory();
@@ -1065,7 +1065,7 @@ binascii_a2b_qp(PyObject *self, PyObject *args, PyObject *kwargs)
out++;
}
}
- if ((rv = PyString_FromStringAndSize(odata, out)) == NULL) {
+ if ((rv = PyString_FromStringAndSize((char *)odata, out)) == NULL) {
free (odata);
return NULL;
}
@@ -1119,7 +1119,7 @@ binascii_b2a_qp (PyObject *self, PyObject *args, PyObject *kwargs)
/* XXX: this function has the side effect of converting all of
* the end of lines to be the same depending on this detection
* here */
- p = strchr(data, '\n');
+ p = (unsigned char *) strchr((char *)data, '\n');
if ((p != NULL) && (p > data) && (*(p-1) == '\r'))
crlf = 1;
@@ -1183,7 +1183,7 @@ binascii_b2a_qp (PyObject *self, PyObject *args, PyObject *kwargs)
}
}
- odata = (char *) calloc(1, odatalen);
+ odata = (unsigned char *) calloc(1, odatalen);
if (odata == NULL) {
PyErr_NoMemory();
@@ -1256,7 +1256,7 @@ binascii_b2a_qp (PyObject *self, PyObject *args, PyObject *kwargs)
}
}
}
- if ((rv = PyString_FromStringAndSize(odata, out)) == NULL) {
+ if ((rv = PyString_FromStringAndSize((char *)odata, out)) == NULL) {
free (odata);
return NULL;
}