]> granicus.if.org Git - python/commitdiff
Fix signedness of various char variables to stop causing a warning under gcc 4.
authorBrett Cannon <bcannon@gmail.com>
Sat, 25 Jun 2005 08:23:41 +0000 (08:23 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sat, 25 Jun 2005 08:23:41 +0000 (08:23 +0000)
Python/ceval.c
Python/compile.c
Python/marshal.c

index 972061d0d6e101ab48a1f4eff9f56895c165587a..1103dfc736532215315c92ee72e39e3c4f8624fa 100644 (file)
@@ -721,7 +721,7 @@ PyEval_EvalFrame(PyFrameObject *f)
        consts = co->co_consts;
        fastlocals = f->f_localsplus;
        freevars = f->f_localsplus + f->f_nlocals;
-       first_instr = PyString_AS_STRING(co->co_code);
+       first_instr = (unsigned char*) PyString_AS_STRING(co->co_code);
        /* An explanation is in order for the next line.
 
           f->f_lasti now refers to the index of the last instruction
index 5781b21ce4cde227face4144b3b263be4e1e7192..476dbe6e5669851e4ba6d246046c0a80b6e74836 100644 (file)
@@ -662,7 +662,7 @@ optimize_code(PyObject *code, PyObject* consts, PyObject *names, PyObject *linen
 
        /* Bypass optimization when the lineno table is too complex */
        assert(PyString_Check(lineno_obj));
-       lineno = PyString_AS_STRING(lineno_obj);
+       lineno = (unsigned char*)PyString_AS_STRING(lineno_obj);
        tabsiz = PyString_GET_SIZE(lineno_obj);
        if (memchr(lineno, 255, tabsiz) != NULL)
                goto exitUnchanged;
index 7f38a467f9694c2f9c4d6ec27b66e101129c53a8..3eb7b1ec7ae11e032424456706c0db5a6e64b90c 100644 (file)
@@ -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;