[Python-checkins] commit of r41576 - python/branches/ast-objects/Python

neal.norwitz python-checkins at python.org
Thu Dec 1 07:30:18 CET 2005


Author: neal.norwitz
Date: Thu Dec  1 07:30:13 2005
New Revision: 41576

Modified:
   python/branches/ast-objects/Python/ast.c
   python/branches/ast-objects/Python/compile.c
Log:
get rid of uses of bool

Modified: python/branches/ast-objects/Python/ast.c
==============================================================================
--- python/branches/ast-objects/Python/ast.c	(original)
+++ python/branches/ast-objects/Python/ast.c	Thu Dec  1 07:30:13 2005
@@ -2099,7 +2099,7 @@
      */
     expr_ty dest = NULL, expression;
     asdl_seq *seq;
-    bool nl;
+    int nl;
     int i, start = 1;
 
     REQ(n, print_stmt);

Modified: python/branches/ast-objects/Python/compile.c
==============================================================================
--- python/branches/ast-objects/Python/compile.c	(original)
+++ python/branches/ast-objects/Python/compile.c	Thu Dec  1 07:30:13 2005
@@ -125,7 +125,7 @@
 
 	int u_firstlineno; /* the first lineno of the block */
 	int u_lineno;      /* the lineno for the current stmt */
-	bool u_lineno_set; /* boolean to indicate whether instr
+	int u_lineno_set; /* boolean to indicate whether instr
 			      has been generated with current lineno */
 };
 
@@ -1089,7 +1089,7 @@
 	u->u_nfblocks = 0;
 	u->u_firstlineno = lineno;
 	u->u_lineno = 0;
-	u->u_lineno_set = false;
+	u->u_lineno_set = 0;
 	u->u_consts = PyDict_New();
 	if (!u->u_consts) {
                 compiler_unit_free(u);
@@ -1247,7 +1247,7 @@
 	basicblock *b;
 	if (c->u->u_lineno_set)
 		return;
-	c->u->u_lineno_set = true;
+	c->u->u_lineno_set = 1;
 	b = c->u->u_curblock;
  	b->b_instr[off].i_lineno = c->u->u_lineno;
 }
@@ -2043,14 +2043,14 @@
 compiler_print(struct compiler *c, stmt_ty s)
 {
 	int i, n;
-	bool dest;
+	int dest;
 
 	assert(s->kind == Print_kind);
 	n = asdl_seq_LEN(s->v.Print.values);
-	dest = false;
+	dest = 0;
 	if (s->v.Print.dest) {
 		VISIT(c, expr, s->v.Print.dest);
-		dest = true;
+		dest = 1;
 	}
 	for (i = 0; i < n; i++) {
 		expr_ty e = (expr_ty)asdl_seq_GET(s->v.Print.values, i);
@@ -2532,7 +2532,7 @@
 	int i, n;
 
 	c->u->u_lineno = s->lineno;
-	c->u->u_lineno_set = false;
+	c->u->u_lineno_set = 0;
 	switch (s->kind) {
         case FunctionDef_kind:
 		return compiler_function(c, s);
@@ -3265,7 +3265,7 @@
 
 	if (e->lineno > c->u->u_lineno) {
 		c->u->u_lineno = e->lineno;
-		c->u->u_lineno_set = false;
+		c->u->u_lineno_set = 0;
 	}
 	switch (e->kind) {
         case BoolOp_kind:


More information about the Python-checkins mailing list