Author: petdance
Date: Wed Jun  6 17:25:20 2007
New Revision: 18849

Modified:
   trunk/src/pmc/key.pmc

Log:
Removed unused parm from is_hash_iter.  Consted other parms.

Modified: trunk/src/pmc/key.pmc
==============================================================================
--- trunk/src/pmc/key.pmc       (original)
+++ trunk/src/pmc/key.pmc       Wed Jun  6 17:25:20 2007
@@ -21,7 +21,7 @@
 #include "parrot/parrot.h"
 
 static int
-is_hash_iter(PMC *agg, PMC *key)
+is_hash_iter(PMC *key /*NN*/)
 {
     if ((PObj_get_FLAGS(key) & KEY_type_FLAGS) ==
         KEY_hash_iterator_FLAGS)
@@ -56,7 +56,7 @@
 */
 
     PMC* clone() {
-        PMC *dest = pmc_new_noinit(INTERP, SELF->vtable->base_type);
+        PMC * const dest = pmc_new_noinit(INTERP, SELF->vtable->base_type);
         PMC *dkey = dest;
         PMC *key = SELF;
         PMC *p;
@@ -226,7 +226,7 @@
 
 */
 
-    void push_pmc(PMC * value) {
+    void push_pmc(PMC * value /*NN*/) {
         if (value->vtable->base_type != enum_class_Key)
             real_exception(interp, NULL, INVALID_OPERATION,
                 "Can only push another Key onto a Key PMC.");
@@ -282,7 +282,7 @@
 */
 
     PMC* nextkey_keyed(PMC* agg, INTVAL what) {
-        INTVAL n = VTABLE_elements(INTERP, agg);
+        const INTVAL n = VTABLE_elements(INTERP, agg);
         PMC *ret = SELF;
         STRING *_hash;
 
@@ -319,7 +319,7 @@
                  * iterating over a hash needs additionally the
                  * Bucket index
                  */
-                if (is_hash_iter(agg, ret))
+                if (is_hash_iter(ret))
                     PMC_data(ret) = (void *)INITBucketIndex;
                 break;
             case ITERATE_GET_NEXT:
@@ -327,7 +327,7 @@
                  * src/hash.c:parrot_hash_get_idx() advances to next
                  * so, if we are iterating over a hash do nothing
                  * */
-                if (!is_hash_iter(agg, ret)) {
+                if (!is_hash_iter(ret)) {
                     if (PMC_int_val(ret) < n - 1)
                         ++PMC_int_val(ret);
                     else
@@ -373,15 +373,15 @@
          * at end a PMC_NULL is written during thaw,
          * which should stop visiting the key
          */
-        PMC **pos = (PMC**)&PMC_data(SELF);
+        PMC ** const pos = (PMC**)&PMC_data(SELF);
         info->thaw_ptr = pos;
         (info->visit_pmc_now)(INTERP, *pos, info);
     }
 
-    void freeze(visit_info *info) {
-        IMAGE_IO *io = info->image_io;
+    void freeze(visit_info *info /*NN*/) {
+        IMAGE_IO * const io = info->image_io;
         /* write flags */
-        INTVAL flags = (PObj_get_FLAGS(SELF) & KEY_type_FLAGS);
+        const INTVAL flags = (PObj_get_FLAGS(SELF) & KEY_type_FLAGS);
         /* write the contents of a register - else thaw can't restore
          * the register state
          */
@@ -407,8 +407,8 @@
         }
     }
 
-    void thaw(visit_info *info) {
-        IMAGE_IO *io = info->image_io;
+    void thaw(visit_info *info /*NN*/) {
+        IMAGE_IO * const io = info->image_io;
         /* get flags */
         INTVAL flags = io->vtable->shift_integer(INTERP, io);
         flags &= KEY_type_FLAGS;
@@ -434,10 +434,9 @@
 
     void thawfinish(visit_info *info) {
         PMC *key = SELF;
-        PMC *next;
 
         while (1) {
-            next = (PMC *)PMC_data(key);
+            PMC * const next = (PMC *)PMC_data(key);
 
             if (PMC_IS_NULL(next)) {
                 PMC_data(key) = NULL;

Reply via email to