summaryrefslogtreecommitdiffstats
path: root/Python/marshal.c
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2005-06-25 08:23:41 (GMT)
committerBrett Cannon <bcannon@gmail.com>2005-06-25 08:23:41 (GMT)
commitc9371d4a1b64074e48bfe99713970c9a01112f60 (patch)
tree153d8e0a7df05cc0606fb29343eb4256df19c3ab /Python/marshal.c
parent55fa66dd45e76a57deca8cebaedf1a624499648b (diff)
downloadcpython-c9371d4a1b64074e48bfe99713970c9a01112f60.zip
cpython-c9371d4a1b64074e48bfe99713970c9a01112f60.tar.gz
cpython-c9371d4a1b64074e48bfe99713970c9a01112f60.tar.bz2
Fix signedness of various char variables to stop causing a warning under gcc 4.
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index 7f38a46..3eb7b1e 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -169,14 +169,14 @@ w_object(PyObject *v, WFILE *p)
}
else if (PyFloat_Check(v)) {
if (p->version > 1) {
- char buf[8];
+ unsigned char buf[8];
if (_PyFloat_Pack8(PyFloat_AsDouble(v),
buf, 1) < 0) {
p->error = 1;
return;
}
w_byte(TYPE_BINARY_FLOAT, p);
- w_string(buf, 8, p);
+ w_string((char*)buf, 8, p);
}
else {
char buf[256]; /* Plenty to format any double */
@@ -190,20 +190,20 @@ w_object(PyObject *v, WFILE *p)
#ifndef WITHOUT_COMPLEX
else if (PyComplex_Check(v)) {
if (p->version > 1) {
- char buf[8];
+ unsigned char buf[8];
if (_PyFloat_Pack8(PyComplex_RealAsDouble(v),
buf, 1) < 0) {
p->error = 1;
return;
}
w_byte(TYPE_BINARY_COMPLEX, p);
- w_string(buf, 8, p);
+ w_string((char*)buf, 8, p);
if (_PyFloat_Pack8(PyComplex_ImagAsDouble(v),
buf, 1) < 0) {
p->error = 1;
return;
}
- w_string(buf, 8, p);
+ w_string((char*)buf, 8, p);
}
else {
char buf[256]; /* Plenty to format any double */
@@ -556,9 +556,9 @@ r_object(RFILE *p)
case TYPE_BINARY_FLOAT:
{
- char buf[8];
+ unsigned char buf[8];
double x;
- if (r_string(buf, 8, p) != 8) {
+ if (r_string((char*)buf, 8, p) != 8) {
PyErr_SetString(PyExc_EOFError,
"EOF read where object expected");
return NULL;
@@ -600,9 +600,9 @@ r_object(RFILE *p)
case TYPE_BINARY_COMPLEX:
{
- char buf[8];
+ unsigned char buf[8];
Py_complex c;
- if (r_string(buf, 8, p) != 8) {
+ if (r_string((char*)buf, 8, p) != 8) {
PyErr_SetString(PyExc_EOFError,
"EOF read where object expected");
return NULL;
@@ -611,7 +611,7 @@ r_object(RFILE *p)
if (c.real == -1.0 && PyErr_Occurred()) {
return NULL;
}
- if (r_string(buf, 8, p) != 8) {
+ if (r_string((char*)buf, 8, p) != 8) {
PyErr_SetString(PyExc_EOFError,
"EOF read where object expected");
return NULL;