Permalink
Browse files

This patch adds Resizable*Array pmcs as the counterparts to Fixed*Array

pmcs.  It does so by inheriting from them, so the Fixed ones are changed
too.

Courtesy of Matt Fowles <fowles@sccs.swarthmore.edu>


git-svn-id: https://svn.parrot.org/parrot/trunk@6220 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
1 parent c455897 commit 6a546727950e8f8775a973f6bc42a0ee5ca04c45 Dan Sugalski committed Jun 14, 2004
View
@@ -82,6 +82,11 @@ classes/pmc.num []
classes/pointer.pmc []
classes/random.pmc []
classes/ref.pmc []
+classes/resizablebooleanarray.pmc []
+classes/resizablefloatarray.pmc []
+classes/resizableintegerarray.pmc []
+classes/resizablepmcarray.pmc []
+classes/resizablestringarray.pmc []
classes/retcontinuation.pmc []
classes/sarray.pmc []
classes/scalar.pmc []
@@ -2734,6 +2739,11 @@ t/pmc/perlstring.t []
t/pmc/pmc.t []
t/pmc/prop.t []
t/pmc/ref.t []
+t/pmc/resizablebooleanarray.t []
+t/pmc/resizablefloatarray.t []
+t/pmc/resizableintegerarray.t []
+t/pmc/resizablepmcarray.t []
+t/pmc/resizablestringarray.t []
t/pmc/sarray.t []
t/pmc/scratchpad.t []
t/pmc/signal.t []
@@ -112,7 +112,7 @@ fixed sized array).
*/
INTVAL get_bool () {
- INTVAL size = DYNSELF.elements();
+ INTVAL size = DYNDYNSELF.elements();
return (INTVAL)(size != 0);
}
@@ -139,7 +139,7 @@ Returns the number of elements in the array.
*/
INTVAL get_integer () {
- return DYNSELF.elements();
+ return DYNDYNSELF.elements();
}
@@ -176,7 +176,7 @@ Returns the integer value of the element at index C<*key>.
INTVAL get_integer_keyed (PMC* key) {
/* simple int keys only */
INTVAL k = key_integer(INTERP, key);
- return SELF.get_integer_keyed_int(k);
+ return DYNSELF.get_integer_keyed_int(k);
}
@@ -191,7 +191,7 @@ Returns the floating-point value of the element at index C<key>.
*/
FLOATVAL get_number_keyed_int (INTVAL key) {
- return (FLOATVAL)SELF.get_integer_keyed_int(key);
+ return (FLOATVAL)DYNSELF.get_integer_keyed_int(key);
}
/*
@@ -206,7 +206,7 @@ Returns the floating-point value of the element at index C<*key>.
FLOATVAL get_number_keyed (PMC* key) {
INTVAL k = key_integer(INTERP, key);
- return SELF.get_number_keyed_int(k);
+ return DYNSELF.get_number_keyed_int(k);
}
/*
@@ -221,7 +221,7 @@ Returns the Parrot string value of the element at index C<key>.
STRING* get_string_keyed_int (INTVAL key) {
PMC *temp;
- temp = SELF.get_pmc_keyed_int(key);
+ temp = DYNSELF.get_pmc_keyed_int(key);
return VTABLE_get_string(INTERP, temp);
}
@@ -237,7 +237,7 @@ Returns the Parrot string value of the element at index C<*key>.
STRING* get_string_keyed(PMC* key) {
INTVAL k = key_integer(INTERP, key);
- return SELF.get_string_keyed_int(k);
+ return DYNSELF.get_string_keyed_int(k);
}
@@ -256,7 +256,7 @@ Returns the PMC value of the element at index C<key>.
INTVAL val;
ret = pmc_new(INTERP, enum_class_Boolean);
- val = SELF.get_integer_keyed_int(key);
+ val = DYNSELF.get_integer_keyed_int(key);
VTABLE_set_integer_native(INTERP, ret, val);
return ret;
}
@@ -273,7 +273,7 @@ Returns the PMC value of the element at index C<*key>.
PMC* get_pmc_keyed(PMC* key) {
INTVAL k = key_integer(INTERP, key);
- return SELF.get_pmc_keyed_int(k);
+ return DYNSELF.get_pmc_keyed_int(k);
}
/*
@@ -327,7 +327,7 @@ Sets the integer value of the element at index C<key> to C<value>.
void set_integer_keyed (PMC *key, INTVAL value) {
INTVAL k;
k = key_integer(INTERP, key);
- SELF.set_integer_keyed_int(k, value);
+ DYNSELF.set_integer_keyed_int(k, value);
}
/*
@@ -342,7 +342,7 @@ C<value>.
*/
void set_number_keyed_int (INTVAL key, FLOATVAL value) {
- SELF.set_integer_keyed_int(key, (INTVAL)(value != 0.0));
+ DYNSELF.set_integer_keyed_int(key, (INTVAL)(value != 0.0));
}
/*
@@ -359,7 +359,7 @@ C<value>.
void set_number_keyed(PMC *key, FLOATVAL value) {
INTVAL k;
k = key_integer(INTERP, key);
- SELF.set_number_keyed_int(k, value);
+ DYNSELF.set_number_keyed_int(k, value);
}
/*
@@ -379,7 +379,7 @@ Sets the Parrot string value of the element at index C<key> to C<value>.
tempPMC = pmc_new(INTERP, enum_class_Boolean);
VTABLE_set_string_native(INTERP, tempPMC, value);
tempInt = VTABLE_get_integer(INTERP, tempPMC);
- SELF.set_integer_keyed_int(key, tempInt);
+ DYNSELF.set_integer_keyed_int(key, tempInt);
}
/*
@@ -396,7 +396,7 @@ C<value>.
void set_string_keyed(PMC *key, STRING* value) {
INTVAL k;
k = key_integer(INTERP, key);
- SELF.set_string_keyed_int(k, value);
+ DYNSELF.set_string_keyed_int(k, value);
}
/*
@@ -413,7 +413,7 @@ Sets the PMC value of the element at index C<key> to C<*src>.
INTVAL tempInt;
tempInt = VTABLE_get_integer(INTERP, src);
- SELF.set_integer_keyed_int(key, tempInt);
+ DYNSELF.set_integer_keyed_int(key, tempInt);
}
/*
@@ -430,7 +430,7 @@ C<value>.
void set_pmc_keyed(PMC *key, PMC* value) {
INTVAL k;
k = key_integer(INTERP, key);
- SELF.set_pmc_keyed_int(k, value);
+ DYNSELF.set_pmc_keyed_int(k, value);
}
}
@@ -112,7 +112,7 @@ fixed sized array).
*/
INTVAL get_bool () {
- INTVAL size = DYNSELF.elements();
+ INTVAL size = DYNDYNSELF.elements();
return (INTVAL)(size != 0);
}
@@ -139,7 +139,7 @@ Returns the number of elements in the array.
*/
INTVAL get_integer () {
- return DYNSELF.elements();
+ return DYNDYNSELF.elements();
}
@@ -154,7 +154,7 @@ Returns the integer value of the element at index C<key>.
*/
INTVAL get_integer_keyed_int (INTVAL key) {
- return (INTVAL)SELF.get_number_keyed_int(key);
+ return (INTVAL)DYNSELF.get_number_keyed_int(key);
}
/*
@@ -170,7 +170,7 @@ Returns the integer value of the element at index C<*key>.
INTVAL get_integer_keyed (PMC* key) {
/* simple int keys only */
INTVAL k = key_integer(INTERP, key);
- return SELF.get_integer_keyed_int(k);
+ return DYNSELF.get_integer_keyed_int(k);
}
@@ -206,7 +206,7 @@ Returns the floating-point value of the element at index C<*key>.
FLOATVAL get_number_keyed (PMC* key) {
INTVAL k = key_integer(INTERP, key);
- return SELF.get_number_keyed_int(k);
+ return DYNSELF.get_number_keyed_int(k);
}
/*
@@ -221,7 +221,7 @@ Returns the Parrot string value of the element at index C<key>.
STRING* get_string_keyed_int (INTVAL key) {
PMC *temp;
- temp = SELF.get_pmc_keyed_int(key);
+ temp = DYNSELF.get_pmc_keyed_int(key);
return VTABLE_get_string(INTERP, temp);
}
@@ -237,7 +237,7 @@ Returns the Parrot string value of the element at index C<*key>.
STRING* get_string_keyed(PMC* key) {
INTVAL k = key_integer(INTERP, key);
- return SELF.get_string_keyed_int(k);
+ return DYNSELF.get_string_keyed_int(k);
}
@@ -256,7 +256,7 @@ Returns the PMC value of the element at index C<key>.
FLOATVAL val;
ret = pmc_new(INTERP, enum_class_Float);
- val = SELF.get_number_keyed_int(key);
+ val = DYNSELF.get_number_keyed_int(key);
VTABLE_set_number_native(INTERP, ret, val);
return ret;
}
@@ -273,7 +273,7 @@ Returns the PMC value of the element at index C<*key>.
PMC* get_pmc_keyed(PMC* key) {
INTVAL k = key_integer(INTERP, key);
- return SELF.get_pmc_keyed_int(k);
+ return DYNSELF.get_pmc_keyed_int(k);
}
/*
@@ -305,7 +305,7 @@ Sets the integer value of the element at index C<key> to C<value>.
*/
void set_integer_keyed_int (INTVAL key, INTVAL value) {
- SELF.set_number_keyed_int(key, (FLOATVAL)value);
+ DYNSELF.set_number_keyed_int(key, (FLOATVAL)value);
}
/*
@@ -321,7 +321,7 @@ Sets the integer value of the element at index C<key> to C<value>.
void set_integer_keyed (PMC *key, INTVAL value) {
INTVAL k;
k = key_integer(INTERP, key);
- SELF.set_integer_keyed_int(k, value);
+ DYNSELF.set_integer_keyed_int(k, value);
}
/*
@@ -359,7 +359,7 @@ C<value>.
void set_number_keyed(PMC *key, FLOATVAL value) {
INTVAL k;
k = key_integer(INTERP, key);
- SELF.set_number_keyed_int(k, value);
+ DYNSELF.set_number_keyed_int(k, value);
}
/*
@@ -379,7 +379,7 @@ Sets the Parrot string value of the element at index C<key> to C<value>.
tempPMC = pmc_new(INTERP, enum_class_Float);
VTABLE_set_string_native(INTERP, tempPMC, value);
tempNum = VTABLE_get_number(INTERP, tempPMC);
- SELF.set_number_keyed_int(key, tempNum);
+ DYNSELF.set_number_keyed_int(key, tempNum);
}
/*
@@ -396,7 +396,7 @@ C<value>.
void set_string_keyed(PMC *key, STRING* value) {
INTVAL k;
k = key_integer(INTERP, key);
- SELF.set_string_keyed_int(k, value);
+ DYNSELF.set_string_keyed_int(k, value);
}
/*
@@ -412,7 +412,7 @@ Sets the PMC value of the element at index C<key> to C<*src>.
void set_pmc_keyed_int (INTVAL key, PMC* src) {
FLOATVAL tempNum;
tempNum = VTABLE_get_number(INTERP, src);
- SELF.set_number_keyed_int(key, tempNum);
+ DYNSELF.set_number_keyed_int(key, tempNum);
}
/*
@@ -429,7 +429,7 @@ C<value>.
void set_pmc_keyed(PMC *key, PMC* value) {
INTVAL k;
k = key_integer(INTERP, key);
- SELF.set_pmc_keyed_int(k, value);
+ DYNSELF.set_pmc_keyed_int(k, value);
}
}
Oops, something went wrong.

0 comments on commit 6a54672

Please sign in to comment.