[svn:parrot] r44973 - trunk/src

petdance at svn.parrot.org petdance at svn.parrot.org
Tue Mar 16 21:56:46 UTC 2010


Author: petdance
Date: Tue Mar 16 21:56:43 2010
New Revision: 44973
URL: https://trac.parrot.org/parrot/changeset/44973

Log:
consting and localizing.  Removed ancient HISTORY heading.

Modified:
   trunk/src/pmc.c

Modified: trunk/src/pmc.c
==============================================================================
--- trunk/src/pmc.c	Tue Mar 16 21:32:23 2010	(r44972)
+++ trunk/src/pmc.c	Tue Mar 16 21:56:43 2010	(r44973)
@@ -303,7 +303,7 @@
     ASSERT_ARGS(Parrot_pmc_reuse_by_class)
     const INTVAL   new_type   = PARROT_CLASS(class_)->id;
     VTABLE * const new_vtable = interp->vtables[new_type];
-    INTVAL         new_flags  = flags;
+    const INTVAL   new_flags  = flags;
 
     if (pmc->vtable->base_type == new_type)
         return pmc;
@@ -582,9 +582,10 @@
     PMC *const classobj = interp->vtables[base_type]->pmc_class;
 
     if (!PMC_IS_NULL(classobj) && PObj_is_class_TEST(classobj)) {
-        PMC *initial = Parrot_pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_Integer));
+        PMC * const initial = Parrot_pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_Integer));
         VTABLE_set_integer_native(interp, initial, init);
         VTABLE_instantiate(interp, classobj, initial);
+        /* XXX Falls through to end of function without returning */
     }
     else {
         PMC * const pmc = get_new_pmc_header(interp, base_type, 0);
@@ -791,9 +792,7 @@
 {
     ASSERT_ARGS(Parrot_pmc_get_type)
     PMC * const classname_hash = interp->class_hash;
-    PMC * item;
-
-    item = (PMC *)VTABLE_get_pointer_keyed(interp, classname_hash, name);
+    PMC * const item = (PMC *)VTABLE_get_pointer_keyed(interp, classname_hash, name);
 
     if (!PMC_IS_NULL(item))
         return VTABLE_get_integer(interp, item);
@@ -860,9 +859,9 @@
 Parrot_pmc_create_mro(PARROT_INTERP, INTVAL type)
 {
     ASSERT_ARGS(Parrot_pmc_create_mro)
-    PMC    *_class, *mro;
+    PMC    *mro;
     VTABLE *vtable   = interp->vtables[type];
-    PMC    *mro_list = vtable->mro;
+    PMC    * const mro_list = vtable->mro;
     INTVAL  i, count;
 
     /* this should never be PMCNULL */
@@ -881,8 +880,9 @@
     count = VTABLE_elements(interp, mro_list);
 
     for (i = 0; i < count; ++i) {
-        STRING *class_name  = VTABLE_get_string_keyed_int(interp, mro_list, i);
-        INTVAL  parent_type = Parrot_pmc_get_type_str(interp, class_name);
+        STRING * const class_name = VTABLE_get_string_keyed_int(interp, mro_list, i);
+        const INTVAL parent_type  = Parrot_pmc_get_type_str(interp, class_name);
+        PMC *_class;
 
         /* abstract classes don't have a vtable */
         if (!parent_type)
@@ -971,10 +971,6 @@
 C<5.1.0.14.2.20011008152120.02158148 at pop.sidhe.org>
 (http://www.nntp.perl.org/group/perl.perl6.internals/5516).
 
-=head1 HISTORY
-
-Initial version by Simon on 2001.10.20.
-
 =cut
 
 */


More information about the parrot-commits mailing list