Author: petdance
Date: Tue May 29 22:51:27 2007
New Revision: 18678

Modified:
   trunk/src/pmc/sarray.pmc
   trunk/src/sub.c

Log:
PMCs need the consting love,too

Modified: trunk/src/pmc/sarray.pmc
==============================================================================
--- trunk/src/pmc/sarray.pmc    (original)
+++ trunk/src/pmc/sarray.pmc    Tue May 29 22:51:27 2007
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2001-2006, The Perl Foundation.
+Copyright (C) 2001-2007, The Perl Foundation.
 $Id$
 
 =head1 NAME
@@ -56,7 +56,7 @@
 /*
 
 =item C<static PARROT_INLINE INTVAL
-ret_int(Interp* interp, HashEntry *e)>
+ret_int(Interp* interp, const HashEntry *e)>
 
 Processes C<*e>, returning the appropriate integer, or raising an
 exception if necessary.
@@ -66,7 +66,7 @@
 */
 
 static PARROT_INLINE INTVAL
-ret_int(Interp* interp, HashEntry *e)
+ret_int(Interp* interp, const HashEntry *e)
 {
     switch (e->type) {
     case enum_hash_int:
@@ -84,7 +84,7 @@
 /*
 
 =item C<static PARROT_INLINE FLOATVAL
-ret_num(Interp* interp, HashEntry *e)>
+ret_num(Interp* interp, const HashEntry *e)>
 
 Processes C<*e>, returning the appropriate floating-point number, or
 raising an exception if necessary.
@@ -94,7 +94,7 @@
 */
 
 static PARROT_INLINE FLOATVAL
-ret_num(Interp* interp, HashEntry *e)
+ret_num(Interp* interp, const HashEntry *e)
 {
     switch (e->type) {
         case enum_hash_num:
@@ -122,7 +122,7 @@
 */
 
 static PARROT_INLINE STRING*
-ret_string(Interp* interp, HashEntry *e)
+ret_string(Interp* interp, const HashEntry *e)
 {
     switch (e->type) {
         case enum_hash_string:
@@ -140,7 +140,7 @@
 /*
 
 =item C<static PARROT_INLINE PMC *
-ret_pmc(Interp* interp, HashEntry *e)>
+ret_pmc(Interp* interp, const HashEntry *e)>
 
 Processes C<*e>, returning the appropriate PMC, or raising an exception
 if necessary.
@@ -150,7 +150,7 @@
 */
 
 static PARROT_INLINE PMC*
-ret_pmc(Interp* interp, HashEntry *e)
+ret_pmc(Interp* interp, const HashEntry *e)
 {
     PMC *ret;
     switch (e->type) {
@@ -189,10 +189,10 @@
 static PARROT_INLINE HashEntry *
 shift_entry(PMC *self)
 {
-    HashEntry *e = (HashEntry *) PMC_data(self);
+    HashEntry * const e = (HashEntry *) PMC_data(self);
     HashEntry *ret;
     INTVAL start_index = UVal_int(e[0].val);
-    INTVAL end_index   = UVal_int(e[1].val);
+    const INTVAL end_index   = UVal_int(e[1].val);
 
     if (start_index >= end_index)
         internal_exception(OUT_OF_BOUNDS, "SArray index out of bounds!");
@@ -219,8 +219,8 @@
 get_entry(PMC *self, INTVAL key)
 {
     HashEntry *e = (HashEntry *) PMC_data(self);
-    INTVAL start_index = UVal_int(e[0].val);
-    INTVAL end_index   = UVal_int(e[1].val);
+    const INTVAL start_index = UVal_int(e[0].val);
+    const INTVAL end_index   = UVal_int(e[1].val);
 
     if (key < 0) {
         key += end_index;

Modified: trunk/src/sub.c
==============================================================================
--- trunk/src/sub.c     (original)
+++ trunk/src/sub.c     Tue May 29 22:51:27 2007
@@ -388,7 +388,7 @@
 
     Parrot_block_DOD(interp);
     if (Parrot_Context_get_info(interp, ctx, &info)) {
-        const char * const file = info.file;
+        char * const file = info.file;
         res        = Parrot_sprintf_c(interp,
             "%s '%Ss' pc %d (%s:%d)", msg,
             info.fullname, info.pc, file, info.line);

Reply via email to