[Python-checkins] r41950 - python/trunk/Python/compile.c

neal.norwitz python-checkins at python.org
Sat Jan 7 22:24:11 CET 2006


Author: neal.norwitz
Date: Sat Jan  7 22:24:09 2006
New Revision: 41950

Modified:
   python/trunk/Python/compile.c
Log:
Fix icc warnings: single bit fields should be unsigned, shadowing local variables

Modified: python/trunk/Python/compile.c
==============================================================================
--- python/trunk/Python/compile.c	(original)
+++ python/trunk/Python/compile.c	Sat Jan  7 22:24:09 2006
@@ -51,9 +51,9 @@
 #define DEFAULT_LNOTAB_SIZE 16
 
 struct instr {
-	int i_jabs : 1;
-	int i_jrel : 1;
-	int i_hasarg : 1;
+	unsigned i_jabs : 1;
+	unsigned i_jrel : 1;
+	unsigned i_hasarg : 1;
 	unsigned char i_opcode;
 	int i_oparg;
 	struct basicblock_ *i_target; /* target block (if jump instruction) */
@@ -74,9 +74,9 @@
 	   block reached by normal control flow. */
 	struct basicblock_ *b_next;
 	/* b_seen is used to perform a DFS of basicblocks. */
-	int b_seen : 1;
+	unsigned b_seen : 1;
 	/* b_return is true if a RETURN_VALUE opcode is inserted. */
-	int b_return : 1;
+	unsigned b_return : 1;
 	/* depth of stack upon entry of block, computed by stackdepth() */
 	int b_startdepth;
 	/* instruction offset for block, computed by assemble_jump_offsets() */
@@ -1673,20 +1673,20 @@
 }
 
 #define VISIT_SEQ(C, TYPE, SEQ) { \
-	int i; \
+	int _i; \
 	asdl_seq *seq = (SEQ); /* avoid variable capture */ \
-	for (i = 0; i < asdl_seq_LEN(seq); i++) { \
-		TYPE ## _ty elt = asdl_seq_GET(seq, i); \
+	for (_i = 0; _i < asdl_seq_LEN(seq); _i++) { \
+		TYPE ## _ty elt = asdl_seq_GET(seq, _i); \
 		if (!compiler_visit_ ## TYPE((C), elt)) \
 			return 0; \
 	} \
 }
 
 #define VISIT_SEQ_IN_SCOPE(C, TYPE, SEQ) { \
-	int i; \
+	int _i; \
 	asdl_seq *seq = (SEQ); /* avoid variable capture */ \
-	for (i = 0; i < asdl_seq_LEN(seq); i++) { \
-		TYPE ## _ty elt = asdl_seq_GET(seq, i); \
+	for (_i = 0; _i < asdl_seq_LEN(seq); _i++) { \
+		TYPE ## _ty elt = asdl_seq_GET(seq, _i); \
 		if (!compiler_visit_ ## TYPE((C), elt)) { \
 			compiler_exit_scope(c); \
 			return 0; \
@@ -3859,7 +3859,7 @@
 		return 1;
 
 	if (d_bytecode > 255) {
-		int i, nbytes, ncodes = d_bytecode / 255;
+		int j, nbytes, ncodes = d_bytecode / 255;
 		nbytes = a->a_lnotab_off + 2 * ncodes;
 		len = PyString_GET_SIZE(a->a_lnotab);
 		if (nbytes >= len) {
@@ -3871,7 +3871,7 @@
 				return 0;
 		}
 		lnotab = PyString_AS_STRING(a->a_lnotab) + a->a_lnotab_off;
-		for (i = 0; i < ncodes; i++) {
+		for (j = 0; j < ncodes; j++) {
 			*lnotab++ = 255;
 			*lnotab++ = 0;
 		}
@@ -3880,7 +3880,7 @@
 	}
 	assert(d_bytecode <= 255);
 	if (d_lineno > 255) {
-		int i, nbytes, ncodes = d_lineno / 255;
+		int j, nbytes, ncodes = d_lineno / 255;
 		nbytes = a->a_lnotab_off + 2 * ncodes;
 		len = PyString_GET_SIZE(a->a_lnotab);
 		if (nbytes >= len) {
@@ -3895,7 +3895,7 @@
 		*lnotab++ = 255;
 		*lnotab++ = d_bytecode;
 		d_bytecode = 0;
-		for (i = 1; i < ncodes; i++) {
+		for (j = 1; j < ncodes; j++) {
 			*lnotab++ = 255;
 			*lnotab++ = 0;
 		}
@@ -4190,7 +4190,7 @@
 
 	/* Emit code in reverse postorder from dfs. */
 	for (i = a.a_nblocks - 1; i >= 0; i--) {
-		basicblock *b = a.a_postorder[i];
+		b = a.a_postorder[i];
 		for (j = 0; j < b->b_iused; j++)
 			if (!assemble_emit(&a, &b->b_instr[j]))
 				goto error;


More information about the Python-checkins mailing list