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

petdance at svn.parrot.org petdance at svn.parrot.org
Fri Apr 23 05:32:43 UTC 2010


Author: petdance
Date: Fri Apr 23 05:32:43 2010
New Revision: 45936
URL: https://trac.parrot.org/parrot/changeset/45936

Log:
random consting

Modified:
   trunk/src/pmc/packfileannotations.pmc
   trunk/src/pmc/packfilefixupentry.pmc

Modified: trunk/src/pmc/packfileannotations.pmc
==============================================================================
--- trunk/src/pmc/packfileannotations.pmc	Fri Apr 23 05:05:09 2010	(r45935)
+++ trunk/src/pmc/packfileannotations.pmc	Fri Apr 23 05:32:43 2010	(r45936)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2001-2008, Parrot Foundation.
+Copyright (C) 2001-2010, Parrot Foundation.
 $Id$
 
 =head1 NAME
@@ -267,7 +267,6 @@
         PackFile_Annotations *res = mem_gc_allocate_zeroed_typed(INTERP,
                 PackFile_Annotations);
         INTVAL                i, num;
-        INTVAL                key_type;
         PMC                  *keys;             /* Temporary representation of Keys */
         PMC                  *names;            /* Constants for Key's names */
         PMC                  *types;            /* Types of Keys */
@@ -304,8 +303,9 @@
         res->num_entries = num;
         res->entries = mem_gc_allocate_n_typed(INTERP, num, PackFile_Annotations_Entry*);
         for (i = 0; i < num; ++i) {
-            PMC  *entity = VTABLE_get_pmc_keyed_int(interp, attrs->annotations, i);
-            Parrot_PackfileAnnotation_attributes *entity_attrs = PARROT_PACKFILEANNOTATION(entity);
+            PMC  * const entity = VTABLE_get_pmc_keyed_int(interp, attrs->annotations, i);
+            const Parrot_PackfileAnnotation_attributes * const entity_attrs =
+                PARROT_PACKFILEANNOTATION(entity);
 
             /* Handle creating of Key */
             PMC * key_array = VTABLE_get_pmc_keyed_str(interp, keys, entity_attrs->name);

Modified: trunk/src/pmc/packfilefixupentry.pmc
==============================================================================
--- trunk/src/pmc/packfilefixupentry.pmc	Fri Apr 23 05:05:09 2010	(r45935)
+++ trunk/src/pmc/packfilefixupentry.pmc	Fri Apr 23 05:32:43 2010	(r45936)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2001-2008, Parrot Foundation.
+Copyright (C) 2001-2010, Parrot Foundation.
 $Id$
 
 =head1 NAME
@@ -58,7 +58,7 @@
 */
 
     VTABLE void mark() {
-        Parrot_PackfileFixupEntry_attributes * attrs =
+        Parrot_PackfileFixupEntry_attributes * const attrs =
                 PARROT_PACKFILEFIXUPENTRY(SELF);
 
         Parrot_gc_mark_STRING_alive(interp, attrs->name);
@@ -75,7 +75,7 @@
 */
 
     VTABLE void set_pointer(void * pointer) {
-        Parrot_PackfileFixupEntry_attributes * attrs =
+        Parrot_PackfileFixupEntry_attributes * const attrs =
                 PARROT_PACKFILEFIXUPENTRY(SELF);
         PackFile_FixupEntry *entry = (PackFile_FixupEntry*)pointer;
 
@@ -96,9 +96,9 @@
 
 */
     VTABLE void *get_pointer() {
-        Parrot_PackfileFixupEntry_attributes * attrs =
+        Parrot_PackfileFixupEntry_attributes * const attrs =
                 PARROT_PACKFILEFIXUPENTRY(SELF);
-        PackFile_FixupEntry                  * entry =
+        PackFile_FixupEntry                  * const entry =
                 mem_gc_allocate_zeroed_typed(INTERP, PackFile_FixupEntry);
 
         entry->type     = attrs->type;
@@ -173,7 +173,7 @@
 
 */
     METHOD get_type() {
-        INTVAL rv = PARROT_PACKFILEFIXUPENTRY(SELF)->type;
+        const INTVAL rv = PARROT_PACKFILEFIXUPENTRY(SELF)->type;
         RETURN(INTVAL rv);
     }
 


More information about the parrot-commits mailing list