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

NotFound at svn.parrot.org NotFound at svn.parrot.org
Fri Apr 2 15:42:44 UTC 2010


Author: NotFound
Date: Fri Apr  2 15:42:43 2010
New Revision: 45384
URL: https://trac.parrot.org/parrot/changeset/45384

Log:
some more init_int usages

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

Modified: trunk/src/pmc/opcode.pmc
==============================================================================
--- trunk/src/pmc/opcode.pmc	Fri Apr  2 15:25:20 2010	(r45383)
+++ trunk/src/pmc/opcode.pmc	Fri Apr  2 15:42:43 2010	(r45384)
@@ -114,14 +114,16 @@
 
     METHOD dirs() {
         const op_info_t * const info = PARROT_OPCODE(SELF)->info;
-        PMC *result = Parrot_pmc_new(INTERP, enum_class_FixedIntegerArray);
+        PMC *result;
         INTVAL arg_count = info->op_count - 1;
         if (arg_count > 0) {
             INTVAL i;
-            VTABLE_set_integer_native(INTERP, result, arg_count);
+            result = Parrot_pmc_new_init_int(INTERP, enum_class_FixedIntegerArray, arg_count);
             for (i = 0; i < arg_count; ++i)
                 VTABLE_set_integer_keyed_int(INTERP, result, i, (INTVAL) info->dirs[i]);
         }
+        else
+            result = Parrot_pmc_new(INTERP, enum_class_FixedIntegerArray);
         RETURN(PMC *result);
     }
 

Modified: trunk/src/pmc/packfileannotations.pmc
==============================================================================
--- trunk/src/pmc/packfileannotations.pmc	Fri Apr  2 15:25:20 2010	(r45383)
+++ trunk/src/pmc/packfileannotations.pmc	Fri Apr  2 15:42:43 2010	(r45384)
@@ -311,8 +311,7 @@
             PMC * key_array = VTABLE_get_pmc_keyed_str(interp, keys, entity_attrs->name);
             if (PMC_IS_NULL(key_array)) {
                 /* Never see this name before. Create new FIA and add to keys. */
-                key_array = Parrot_pmc_new(interp, enum_class_FixedIntegerArray);
-                VTABLE_set_integer_native(interp, key_array, 3);
+                key_array = Parrot_pmc_new_init_int(interp, enum_class_FixedIntegerArray, 3);
                 VTABLE_set_integer_keyed_int(interp, key_array, 0, -1);
                 VTABLE_set_integer_keyed_int(interp, key_array, 1, -1);
                 VTABLE_set_integer_keyed_int(interp, key_array, 2, -1);


More information about the parrot-commits mailing list