[svn:parrot] r36226 - trunk/src/ops

petdance at svn.parrot.org petdance at svn.parrot.org
Sun Feb 1 03:50:24 UTC 2009


Author: petdance
Date: Sun Feb  1 03:50:20 2009
New Revision: 36226
URL: https://trac.parrot.org/parrot/changeset/36226

Log:
consting some ops internals

Modified:
   trunk/src/ops/bit.ops
   trunk/src/ops/cmp.ops
   trunk/src/ops/sys.ops
   trunk/src/ops/var.ops

Modified: trunk/src/ops/bit.ops
==============================================================================
--- trunk/src/ops/bit.ops	Sun Feb  1 02:54:02 2009	(r36225)
+++ trunk/src/ops/bit.ops	Sun Feb  1 03:50:20 2009	(r36226)
@@ -336,7 +336,7 @@
 =cut
 
 inline op shr(inout INT, in INT) :base_core {
-  INTVAL signed_shift = -$2;
+  const INTVAL signed_shift = -$2;
   $1 = bit_shift_left($1, signed_shift);
 }
 
@@ -349,7 +349,7 @@
 }
 
 inline op shr(out INT, in INT, in INT) :base_core {
-  INTVAL signed_shift = -$3;
+  const INTVAL signed_shift = -$3;
   $1 = bit_shift_left($2, signed_shift);
 }
 
@@ -533,7 +533,7 @@
 
 =head1 COPYRIGHT
 
-Copyright (C) 2001-2008, The Perl Foundation.
+Copyright (C) 2001-2009, The Perl Foundation.
 
 =head1 LICENSE
 

Modified: trunk/src/ops/cmp.ops
==============================================================================
--- trunk/src/ops/cmp.ops	Sun Feb  1 02:54:02 2009	(r36225)
+++ trunk/src/ops/cmp.ops	Sun Feb  1 03:50:20 2009	(r36226)
@@ -89,7 +89,7 @@
 }
 
 op eq(invar PMC, in INT, inconst LABEL) :base_core {
-  PMC *temp = temporary_pmc_new(interp, enum_class_Integer);
+  PMC * const temp = temporary_pmc_new(interp, enum_class_Integer);
   VTABLE_set_integer_native(interp, temp, $2);
 
   if (VTABLE_is_equal(interp, $1, temp)) {
@@ -196,7 +196,7 @@
 }
 
 op ne(invar PMC, in INT, inconst LABEL) :base_core {
-  PMC *temp = temporary_pmc_new(interp, enum_class_Integer);
+  PMC * const temp = temporary_pmc_new(interp, enum_class_Integer);
   VTABLE_set_integer_native(interp, temp, $2);
 
   if (!VTABLE_is_equal(interp, $1, temp)) {
@@ -293,7 +293,7 @@
 }
 
 op lt(invar PMC, in INT, inconst LABEL) :base_core {
-  PMC *temp         = temporary_pmc_new(interp, enum_class_Integer);
+  PMC * const temp  = temporary_pmc_new(interp, enum_class_Integer);
   PMC_int_val(temp) = $2;
 
   if (VTABLE_cmp(interp, $1, temp) < 0) {
@@ -378,7 +378,7 @@
 }
 
 op le(invar PMC, in INT, inconst LABEL) :base_core {
-  PMC *temp         = temporary_pmc_new(interp, enum_class_Integer);
+  PMC * const temp  = temporary_pmc_new(interp, enum_class_Integer);
   PMC_int_val(temp) = $2;
 
   if (VTABLE_cmp(interp, $1, temp) <= 0) {
@@ -439,7 +439,7 @@
 }
 
 op gt(invar PMC, in INT, inconst LABEL) :base_core {
-  PMC *temp         = temporary_pmc_new(interp, enum_class_Integer);
+  PMC * const temp  = temporary_pmc_new(interp, enum_class_Integer);
   PMC_int_val(temp) = $2;
 
   if (VTABLE_cmp(interp, $1, temp) > 0) {
@@ -500,7 +500,7 @@
 }
 
 op ge(invar PMC, in INT, inconst LABEL) :base_core {
-  PMC *temp         = temporary_pmc_new(interp, enum_class_Integer);
+  PMC * const temp  = temporary_pmc_new(interp, enum_class_Integer);
   PMC_int_val(temp) = $2;
 
   if (VTABLE_cmp(interp, $1, temp) >= 0) {
@@ -640,21 +640,21 @@
 }
 
 inline op cmp(out INT, invar PMC, in INT) :base_core {
-  INTVAL l = VTABLE_get_integer(interp, $2);
+  const INTVAL l = VTABLE_get_integer(interp, $2);
   $1 = l < $3 ? -1 :
        l > $3 ? +1 :
        0;
 }
 
 inline op cmp(out INT, invar PMC, in NUM) :base_core {
-  FLOATVAL l = VTABLE_get_number(interp, $2);
+  const FLOATVAL l = VTABLE_get_number(interp, $2);
   $1 = l < $3 ? -1 :
        l > $3 ? +1 :
        0;
 }
 
 inline op cmp(out INT, invar PMC, in STR) :base_core {
-  STRING* l = VTABLE_get_string(interp, $2);
+  STRING* const l = VTABLE_get_string(interp, $2);
   $1 = string_compare(interp, l, $3);
 }
 
@@ -992,7 +992,7 @@
 
 =head1 COPYRIGHT
 
-Copyright (C) 2001-2008, The Perl Foundation.
+Copyright (C) 2001-2009, The Perl Foundation.
 
 =head1 LICENSE
 

Modified: trunk/src/ops/sys.ops
==============================================================================
--- trunk/src/ops/sys.ops	Sun Feb  1 02:54:02 2009	(r36225)
+++ trunk/src/ops/sys.ops	Sun Feb  1 03:50:20 2009	(r36226)
@@ -282,7 +282,7 @@
 inline op sleep(in INT) :flow {
   opcode_t *next = expr NEXT();
   if ($1 < 0) {
-      opcode_t *handler = Parrot_ex_throw_from_op_args(interp, next,
+      opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, next,
         EXCEPTION_NEG_SLEEP,
         "Cannot go back in time");
       goto ADDRESS(handler);
@@ -294,7 +294,7 @@
 inline op sleep(in NUM) :flow {
   opcode_t *next = expr NEXT();
   if ($1 < 0.0) {
-      opcode_t *handler = Parrot_ex_throw_from_op_args(interp, next,
+      opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, next,
           EXCEPTION_NEG_SLEEP,
           "Cannot go back in time");
       goto ADDRESS(handler);
@@ -324,7 +324,7 @@
 
 =head1 COPYRIGHT
 
-Copyright (C) 2001-2008, The Perl Foundation.
+Copyright (C) 2001-2009, The Perl Foundation.
 
 =head1 LICENSE
 

Modified: trunk/src/ops/var.ops
==============================================================================
--- trunk/src/ops/var.ops	Sun Feb  1 02:54:02 2009	(r36225)
+++ trunk/src/ops/var.ops	Sun Feb  1 03:50:20 2009	(r36226)
@@ -44,7 +44,7 @@
     PMC              * const lex_pad  = Parrot_find_pad(interp, lex_name, ctx);
 
     if (PMC_IS_NULL(lex_pad)) {
-        opcode_t *handler = Parrot_ex_throw_from_op_args(interp, NULL,
+        opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, NULL,
                 EXCEPTION_LEX_NOT_FOUND,
                 "Lexical '%Ss' not found", lex_name);
         goto ADDRESS(handler);
@@ -73,7 +73,7 @@
             ? NULL
             : VTABLE_get_pmc_keyed_str(interp, lex_pad, lex_name);
     if (!result) {
-        opcode_t *handler = Parrot_ex_throw_from_op_args(interp, NULL,
+        opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, NULL,
                 EXCEPTION_LEX_NOT_FOUND,
                 "Lexical '%Ss' not found", lex_name);
         goto ADDRESS(handler);


More information about the parrot-commits mailing list