]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Cast assignments to ``unsigned char *`` from PyString_AS_STRING() calls to
authorBrett Cannon <bcannon@gmail.com>
Thu, 16 Feb 2006 07:01:45 +0000 (07:01 +0000)
committerBrett Cannon <bcannon@gmail.com>
Thu, 16 Feb 2006 07:01:45 +0000 (07:01 +0000)
silence compiler warnings on gcc 4.0.1 .

Python/ceval.c
Python/compile.c

index a1cdb1dfdf88bebe4ec862c31879fc7976db4105..ee3b308495b591c57965e437265c15ee6f093462 100644 (file)
@@ -715,7 +715,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 ea325ff0698a48991883ae10973dca6e58e788d2..a5bd09eb4d9c66d5a2f83713f34cf55d19b8c26f 100644 (file)
@@ -509,7 +509,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;