diff options
author | Skip Montanaro <skip@pobox.com> | 2006-04-13 09:37:01 (GMT) |
---|---|---|
committer | Skip Montanaro <skip@pobox.com> | 2006-04-13 09:37:01 (GMT) |
commit | b9406711864885c8434c9ba41da90f7ea1e18a47 (patch) | |
tree | e69b327ed5e617041beff1fdfae844d7d994526b /Python/compile.c | |
parent | 83687c98dcb1deb6c0e7091e2f9df7dbeae56910 (diff) | |
download | cpython-b9406711864885c8434c9ba41da90f7ea1e18a47.zip cpython-b9406711864885c8434c9ba41da90f7ea1e18a47.tar.gz cpython-b9406711864885c8434c9ba41da90f7ea1e18a47.tar.bz2 |
Use union to discriminate pointer types from enum/int types.
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Python/compile.c b/Python/compile.c index 1bbe73a..0fc0200 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -3066,10 +3066,8 @@ compiler_compare(struct compiler *c, expr_ty e) for (i = 1; i < n; i++) { ADDOP(c, DUP_TOP); ADDOP(c, ROT_THREE); - /* XXX We're casting a void* to cmpop_ty in the next stmt. */ ADDOP_I(c, COMPARE_OP, - cmpop((cmpop_ty)( CMPCAST asdl_seq_GET( - e->v.Compare.ops, i - 1)))); + cmpop((cmpop_ty)asdl_seq_GET_ENUM(e->v.Compare.ops, i - 1))); ADDOP_JREL(c, JUMP_IF_FALSE, cleanup); NEXT_BLOCK(c); ADDOP(c, POP_TOP); @@ -3080,8 +3078,7 @@ compiler_compare(struct compiler *c, expr_ty e) VISIT(c, expr, (expr_ty)asdl_seq_GET(e->v.Compare.comparators, n - 1)); ADDOP_I(c, COMPARE_OP, /* XXX We're casting a void* to cmpop_ty in the next stmt. */ - cmpop((cmpop_ty)( CMPCAST asdl_seq_GET(e->v.Compare.ops, - n - 1)))); + cmpop((cmpop_ty)asdl_seq_GET_ENUM(e->v.Compare.ops, n - 1))); if (n > 1) { basicblock *end = compiler_new_block(c); if (end == NULL) |