[svn:parrot] r48998 - trunk/src/pmc
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Tue Sep 14 14:27:42 UTC 2010
Author: NotFound
Date: Tue Sep 14 14:27:41 2010
New Revision: 48998
URL: https://trac.parrot.org/parrot/changeset/48998
Log:
implement Boolean init_int vtable and use it in FixedBooleanArray
Modified:
trunk/src/pmc/boolean.pmc
trunk/src/pmc/fixedbooleanarray.pmc
Modified: trunk/src/pmc/boolean.pmc
==============================================================================
--- trunk/src/pmc/boolean.pmc Tue Sep 14 12:00:33 2010 (r48997)
+++ trunk/src/pmc/boolean.pmc Tue Sep 14 14:27:41 2010 (r48998)
@@ -58,11 +58,16 @@
Create a new C<Boolean> with the given initial value interpreted
as a Boolean.
+=item C<void init_int(INTVAL value)>
+
+Create a new C<Boolean> with the given initial value interpreted
+as a Boolean.
+
=cut
*/
- /* These two init functions set the boolean flag directly. */
+ /* These init functions set the boolean flag directly. */
VTABLE void init() {
set_boolean_FLAG(SELF, 0);
@@ -73,6 +78,10 @@
set_boolean_FLAG(SELF, v);
}
+ VTABLE void init_int(INTVAL value) {
+ set_boolean_FLAG(SELF, value);
+ }
+
/*
=item C<INTVAL get_bool()>
Modified: trunk/src/pmc/fixedbooleanarray.pmc
==============================================================================
--- trunk/src/pmc/fixedbooleanarray.pmc Tue Sep 14 12:00:33 2010 (r48997)
+++ trunk/src/pmc/fixedbooleanarray.pmc Tue Sep 14 14:27:41 2010 (r48998)
@@ -334,10 +334,8 @@
*/
VTABLE PMC *get_pmc_keyed_int(INTVAL key) {
- PMC * const ret = Parrot_pmc_new(INTERP, enum_class_Boolean);
- const INTVAL val = SELF.get_integer_keyed_int(key);
- VTABLE_set_integer_native(INTERP, ret, val);
- return ret;
+ return Parrot_pmc_new_init_int(INTERP, enum_class_Boolean,
+ SELF.get_integer_keyed_int(key));
}
/*
More information about the parrot-commits
mailing list