NotFound wrote:
Patches to bigint, complex, float and string applied in r31370, thanks.
Thanks. There is little bit more patches.
Just replacing most obvious calls.
--
Bacek
diff --git a/src/pmc/bigint.pmc b/src/pmc/bigint.pmc
index 0c00f18..b94d513 100644
--- a/src/pmc/bigint.pmc
+++ b/src/pmc/bigint.pmc
@@ -770,7 +770,7 @@ MMD_BigInt: {
bigint_add_bigint(INTERP, SELF, value, SELF);
}
MMD_Integer: {
- bigint_add_bigint_int(INTERP, SELF, PMC_int_val(value), SELF);
+ bigint_add_bigint_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), SELF);
}
MMD_DEFAULT: {
Parrot_ex_throw_from_c_args(INTERP, NULL,
@@ -828,7 +828,7 @@ MMD_BigInt: {
bigint_sub_bigint(INTERP, SELF, value, SELF);
}
MMD_Integer: {
- bigint_sub_bigint_int(INTERP, SELF, PMC_int_val(value), SELF);
+ bigint_sub_bigint_int(INTERP, SELF, VTABLE_get_integer(INTERP, value), SELF);
}
MMD_DEFAULT: {
Parrot_ex_throw_from_c_args(INTERP, NULL,
diff --git a/src/pmc/env.pmc b/src/pmc/env.pmc
index 0655637..fcf3bd5 100644
--- a/src/pmc/env.pmc
+++ b/src/pmc/env.pmc
@@ -146,11 +146,12 @@ Returns the Parrot string value for the environment variable C<*key>.
VTABLE STRING *get_string_keyed(PMC *key) {
if ((PObj_get_FLAGS(key) & KEY_type_FLAGS) == KEY_integer_FLAG) {
- if (PMC_int_val(key) < 0 || PMC_int_val(key) >= SELF.elements()) {
+ if (VTABLE_get_integer(INTERP, key) < 0
+ || VTABLE_get_integer(INTERP, key) >= SELF.elements()) {
return CONST_STRING(interp, "");
}
else {
- const char * const envp = environ[PMC_int_val(key)];
+ const char * const envp = environ[VTABLE_get_integer(INTERP, key)];
const char * const p = strchr(envp, '=');
return string_from_cstring(interp, envp, (INTVAL)(p - envp));
}
diff --git a/src/pmc/integer.pmc b/src/pmc/integer.pmc
index d57d218..5985e34 100644
--- a/src/pmc/integer.pmc
+++ b/src/pmc/integer.pmc
@@ -415,7 +415,7 @@ MMD_Complex: {
}
MMD_DEFAULT: {
VTABLE_set_number_native(INTERP, SELF,
- PMC_int_val(SELF) + VTABLE_get_number(INTERP, value));
+ SELF.get_integer() + VTABLE_get_number(INTERP, value));
}
}