[Python-checkins] r42404 - python/branches/release24-maint/Python/ceval.c python/branches/release24-maint/Python/compile.c

brett.cannon python-checkins at python.org
Thu Feb 16 08:01:46 CET 2006


Author: brett.cannon
Date: Thu Feb 16 08:01:45 2006
New Revision: 42404

Modified:
   python/branches/release24-maint/Python/ceval.c
   python/branches/release24-maint/Python/compile.c
Log:
Cast assignments to ``unsigned char *`` from PyString_AS_STRING() calls to
silence compiler warnings on gcc 4.0.1 .


Modified: python/branches/release24-maint/Python/ceval.c
==============================================================================
--- python/branches/release24-maint/Python/ceval.c	(original)
+++ python/branches/release24-maint/Python/ceval.c	Thu Feb 16 08:01:45 2006
@@ -715,7 +715,7 @@
 	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

Modified: python/branches/release24-maint/Python/compile.c
==============================================================================
--- python/branches/release24-maint/Python/compile.c	(original)
+++ python/branches/release24-maint/Python/compile.c	Thu Feb 16 08:01:45 2006
@@ -509,7 +509,7 @@
 
 	/* 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;


More information about the Python-checkins mailing list