Permalink
Browse files

remove unnecessary casting of cur_opcode

  • Loading branch information...
1 parent 581af05 commit 945d1c8b0591591e4fff4a4fa24713a39998d3d6 @petdance petdance committed Mar 28, 2012
Showing with 6 additions and 6 deletions.
  1. +2 −2 compilers/opsc/src/Ops/Trans/C.pm
  2. +2 −2 t/compilers/opsc/03-past.t
  3. +2 −2 t/compilers/opsc/08-emitter.t
@@ -1,5 +1,5 @@
#! nqp
-# Copyright (C) 2010-2011, Parrot Foundation.
+# Copyright (C) 2010-2012, Parrot Foundation.
class Ops::Trans::C is Ops::Trans;
@@ -90,7 +90,7 @@ method restart_offset($offset) {
method goto_address($addr) { "return (opcode_t *)$addr"; }
-method goto_offset($offset) { "return (opcode_t *)cur_opcode + $offset"; }
+method goto_offset($offset) { "return cur_opcode + $offset"; }
method expr_address($addr) { $addr; }
@@ -1,5 +1,5 @@
#! ./parrot-nqp
-# Copyright (C) 2010, Parrot Foundation.
+# Copyright (C) 2010-2012, Parrot Foundation.
# "Comprehensive" test for creating PAST for op.
@@ -101,7 +101,7 @@ ok( $op.arg_types.join('_') eq 'i_pc_nc', "Second variant correct");
# Check body munching.
$op := @ops[0];
-ok( $op.get_body($trans) ~~ /'return (opcode_t *)cur_opcode + 1'/ , "goto NEXT appended for non :flow ops");
+ok( $op.get_body($trans) ~~ /'return cur_opcode + 1'/ , "goto NEXT appended for non :flow ops");
# Check write barriers.
ok( !$op.need_write_barrier, "Write Barrier is not required");
@@ -1,5 +1,5 @@
#! ./parrot-nqp
-# Copyright (C) 2010, Parrot Foundation.
+# Copyright (C) 2010-2012, Parrot Foundation.
pir::load_bytecode("opsc.pbc");
@@ -88,7 +88,7 @@ inline op branch(in LABEL) :base_loop :flow {
goto OFFSET($1);
}';
$new_body := translate_op_body($trans, $op_body);
-$restart_addr_ok := $new_body ~~ /'return (opcode_t *)cur_opcode + IREG(1);'/;
+$restart_addr_ok := $new_body ~~ /'return cur_opcode + IREG(1);'/;
ok($restart_addr_ok, "goto OFFSET() and \$1 translated ok");
ok($new_body ~~ /'PARROT_JUMP_RELATIVE'/, "jump flags generated");

0 comments on commit 945d1c8

Please sign in to comment.