From: Brett Cannon Date: Thu, 16 Feb 2006 07:01:45 +0000 (+0000) Subject: Cast assignments to ``unsigned char *`` from PyString_AS_STRING() calls to X-Git-Tag: v2.4.3c1~80 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=df7d40861f7111bdfaba9537219dce4f069fc6d8;p=thirdparty%2FPython%2Fcpython.git Cast assignments to ``unsigned char *`` from PyString_AS_STRING() calls to silence compiler warnings on gcc 4.0.1 . --- diff --git a/Python/ceval.c b/Python/ceval.c index a1cdb1dfdf88..ee3b308495b5 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -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 diff --git a/Python/compile.c b/Python/compile.c index ea325ff0698a..a5bd09eb4d9c 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -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;