summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorAnthony Baxter <anthonybaxter@gmail.com>2006-04-13 01:23:28 (GMT)
committerAnthony Baxter <anthonybaxter@gmail.com>2006-04-13 01:23:28 (GMT)
commitd691f1a35f370321e1cf768b2164308cb20d2b63 (patch)
tree8223b4ed5ada7521a95c95e0580b0d32212a07a4 /Python
parent3109d62da6c3953d5d818df9e090a2baad9128cd (diff)
downloadcpython-d691f1a35f370321e1cf768b2164308cb20d2b63.zip
cpython-d691f1a35f370321e1cf768b2164308cb20d2b63.tar.gz
cpython-d691f1a35f370321e1cf768b2164308cb20d2b63.tar.bz2
casting nastiness to make C++ compiler happy
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/Python/compile.c b/Python/compile.c
index cb6e0ec..1bbe73a 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -3058,12 +3058,18 @@ compiler_compare(struct compiler *c, expr_ty e)
VISIT(c, expr,
(expr_ty)asdl_seq_GET(e->v.Compare.comparators, 0));
}
+#ifdef __cplusplus
+#define CMPCAST (intptr_t)
+#else
+#define CMPCAST
+#endif
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)asdl_seq_GET(e->v.Compare.ops, i - 1)));
+ cmpop((cmpop_ty)( CMPCAST asdl_seq_GET(
+ e->v.Compare.ops, i - 1))));
ADDOP_JREL(c, JUMP_IF_FALSE, cleanup);
NEXT_BLOCK(c);
ADDOP(c, POP_TOP);
@@ -3074,7 +3080,8 @@ 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)asdl_seq_GET(e->v.Compare.ops, n - 1)));
+ cmpop((cmpop_ty)( CMPCAST asdl_seq_GET(e->v.Compare.ops,
+ n - 1))));
if (n > 1) {
basicblock *end = compiler_new_block(c);
if (end == NULL)
@@ -3087,6 +3094,7 @@ compiler_compare(struct compiler *c, expr_ty e)
}
return 1;
}
+#undef CMPCAST
static int
compiler_call(struct compiler *c, expr_ty e)