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

NotFound at svn.parrot.org NotFound at svn.parrot.org
Sat May 1 23:29:32 UTC 2010


Author: NotFound
Date: Sat May  1 23:29:31 2010
New Revision: 46211
URL: https://trac.parrot.org/parrot/changeset/46211

Log:
a few more init_int usages

Modified:
   trunk/src/pmc/imageiosize.pmc
   trunk/src/pmc/resizablepmcarray.pmc
   trunk/src/pmc/scalar.pmc
   trunk/src/pmc/task.pmc

Modified: trunk/src/pmc/imageiosize.pmc
==============================================================================
--- trunk/src/pmc/imageiosize.pmc	Sat May  1 21:39:10 2010	(r46210)
+++ trunk/src/pmc/imageiosize.pmc	Sat May  1 23:29:31 2010	(r46211)
@@ -134,8 +134,8 @@
 */
 
     VTABLE PMC *get_pmc() {
-        PMC * const ret = Parrot_pmc_new(INTERP, enum_class_Integer);
-        VTABLE_set_integer_native(INTERP, ret, PARROT_IMAGEIOSIZE(SELF)->size);
+        PMC * const ret = Parrot_pmc_new_init_int(INTERP, enum_class_Integer,
+                PARROT_IMAGEIOSIZE(SELF)->size);
         return ret;
     }
 

Modified: trunk/src/pmc/resizablepmcarray.pmc
==============================================================================
--- trunk/src/pmc/resizablepmcarray.pmc	Sat May  1 21:39:10 2010	(r46210)
+++ trunk/src/pmc/resizablepmcarray.pmc	Sat May  1 23:29:31 2010	(r46211)
@@ -382,9 +382,7 @@
     VTABLE void push_integer(INTVAL value) {
 
         const INTVAL size = PMC_size(SELF);
-        PMC   * const val = Parrot_pmc_new(INTERP, enum_class_Integer);
-
-        VTABLE_set_integer_native(INTERP, val, value);
+        PMC   * const val = Parrot_pmc_new_init_int(INTERP, enum_class_Integer, value);
         SELF.set_pmc_keyed_int(size, val);
 
         return;
@@ -531,11 +529,10 @@
     VTABLE void unshift_integer(INTVAL value) {
 
         const INTVAL size = PMC_size(SELF);
-        PMC * const val   = Parrot_pmc_new(INTERP, enum_class_Integer);
+        PMC * const val   = Parrot_pmc_new_init_int(INTERP, enum_class_Integer, value);
         PMC    **data;
         INTVAL   i;
 
-        VTABLE_set_integer_native(INTERP, val, value);
         SELF.set_integer_native(size + 1);
 
         data = PMC_array(SELF);

Modified: trunk/src/pmc/scalar.pmc
==============================================================================
--- trunk/src/pmc/scalar.pmc	Sat May  1 21:39:10 2010	(r46210)
+++ trunk/src/pmc/scalar.pmc	Sat May  1 23:29:31 2010	(r46211)
@@ -938,9 +938,7 @@
 */
     VTABLE PMC *share_ro() {
         PMC         *ret  = pt_shared_fixup(INTERP, SELF);
-        PMC * const _true = Parrot_pmc_new(INTERP, enum_class_Integer);
-
-        VTABLE_set_integer_native(INTERP, _true, 1);
+        PMC * const _true = Parrot_pmc_new_init_int(INTERP, enum_class_Integer, 1);
 
         /* first set readonly */
         VTABLE_setprop(INTERP, ret, CONST_STRING(INTERP, "_ro"), _true);

Modified: trunk/src/pmc/task.pmc
==============================================================================
--- trunk/src/pmc/task.pmc	Sat May  1 21:39:10 2010	(r46210)
+++ trunk/src/pmc/task.pmc	Sat May  1 23:29:31 2010	(r46211)
@@ -210,8 +210,8 @@
         PMC *value;
 
         if (Parrot_str_equal(interp, name, CONST_STRING(interp, "id"))) {
-            value = Parrot_pmc_new(interp, enum_class_Integer);
-            VTABLE_set_integer_native(interp, value, core_struct->id);
+            value = Parrot_pmc_new_init_int(interp, enum_class_Integer,
+                    core_struct->id);
         }
         else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "type"))) {
             value = Parrot_pmc_new(interp, enum_class_String);
@@ -222,8 +222,8 @@
             VTABLE_set_string_native(interp, value, core_struct->subtype);
         }
         else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "priority"))) {
-            value = Parrot_pmc_new(interp, enum_class_Integer);
-            VTABLE_set_integer_native(interp, value, core_struct->priority);
+            value = Parrot_pmc_new_init_int(interp, enum_class_Integer,
+                    core_struct->priority);
         }
         else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "status"))) {
             value = Parrot_pmc_new(interp, enum_class_String);


More information about the parrot-commits mailing list