[svn:parrot] r36188 - trunk/src/pmc

petdance at svn.parrot.org petdance at svn.parrot.org
Sat Jan 31 07:01:26 UTC 2009


Author: petdance
Date: Sat Jan 31 07:01:25 2009
New Revision: 36188
URL: https://trac.parrot.org/parrot/changeset/36188

Log:
consting

Modified:
   trunk/src/pmc/packfiledirectory.pmc

Modified: trunk/src/pmc/packfiledirectory.pmc
==============================================================================
--- trunk/src/pmc/packfiledirectory.pmc	Sat Jan 31 07:00:41 2009	(r36187)
+++ trunk/src/pmc/packfiledirectory.pmc	Sat Jan 31 07:01:25 2009	(r36188)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2001-2008, The Perl Foundation.
+Copyright (C) 2001-2009, The Perl Foundation.
 $Id$
 
 =head1 NAME
@@ -55,7 +55,7 @@
 
 */
     VTABLE PMC *get_pmc_keyed_int(INTVAL index)  {
-        PackFile_Directory *pfd = PMC_data_typed(SELF, PackFile_Directory *);
+        const PackFile_Directory * const pfd = PMC_data_typed(SELF, PackFile_Directory *);
         PackFile_Segment *pfseg;
         PMC *rv;
         int pmc_type;
@@ -78,6 +78,7 @@
             case PF_DEBUG_SEG:
             default:
                 pmc_type = enum_class_PackfileRawSegment;
+                break;
         }
         rv = pmc_new(interp, pmc_type);
         PMC_data(rv) = pfseg;
@@ -95,9 +96,8 @@
 
 */
     VTABLE STRING *get_string_keyed_int(INTVAL index)  {
-        PackFile_Directory *pfd = PMC_data_typed(SELF, PackFile_Directory *);
-        PackFile_Segment *pfseg;
-        PMC *rv;
+        const PackFile_Directory * const pfd = PMC_data_typed(SELF, PackFile_Directory *);
+        const PackFile_Segment *pfseg;
         if (index < 0 || index >= (INTVAL)pfd->num_segments)
             Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
                                         "PackfileDirectory: index out of bounds!");
@@ -116,11 +116,11 @@
 
 */
     VTABLE PMC *get_pmc_keyed_str(STRING *name)  {
-        PackFile_Directory *pfd = PMC_data_typed(SELF, PackFile_Directory *);
-        int i, total = pfd->num_segments;
+        const PackFile_Directory * const pfd = PMC_data_typed(SELF, PackFile_Directory *);
+        const int total = pfd->num_segments;
+        int i;
         for (i = 0; i < total; i++) {
-            PackFile_Segment *pfseg;
-            pfseg = pfd->segments[i];
+            const PackFile_Segment * const pfseg = pfd->segments[i];
             if (!string_compare(interp, name, const_string(interp, pfseg->name)))
                 return VTABLE_get_pmc_keyed_int(interp, SELF, i);
         }


More information about the parrot-commits mailing list