Hello.
There is patch for src/pmc/integer.pmc which changes usage of
PMC_int_val to SELF.get_integer() for fetching value.
--
Bacek.
Index: src/pmc/integer.pmc
===================================================================
--- src/pmc/integer.pmc (revision 27652)
+++ src/pmc/integer.pmc (working copy)
@@ -200,7 +200,7 @@
*/
VTABLE FLOATVAL get_number() {
- return (FLOATVAL)PMC_int_val(SELF);
+ return (FLOATVAL)SELF.get_integer();
}
/*
@@ -229,11 +229,11 @@
*/
VTABLE STRING *get_string() {
- return string_from_int(INTERP, PMC_int_val(SELF));
+ return string_from_int(INTERP, SELF.get_integer());
}
VTABLE STRING *get_repr() {
- return string_from_int(INTERP, PMC_int_val(SELF));
+ return string_from_int(INTERP, SELF.get_integer());
}
/*
@@ -413,7 +413,7 @@
}
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));
}
}
@@ -660,7 +660,7 @@
}
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));
}
}
@@ -1136,7 +1136,7 @@
VTABLE INTVAL is_equal(PMC *value) {
MMD_BigInt: {
PMC * const temp = pmc_new(INTERP, enum_class_BigInt);
- VTABLE_set_integer_native(INTERP, temp, PMC_int_val(SELF));
+ VTABLE_set_integer_native(INTERP, temp, SELF.get_integer());
return Parrot_BigInt_is_equal_BigInt(INTERP, temp, value);
}
MMD_DEFAULT: {
@@ -1157,10 +1157,10 @@
VTABLE INTVAL cmp(PMC *value) {
MMD_String: {
FLOATVAL fdiff =
- PMC_int_val(SELF) - VTABLE_get_number(INTERP, value);
+ SELF.get_integer() - VTABLE_get_number(INTERP, value);
if (FLOAT_IS_ZERO(fdiff)) {
const INTVAL idiff =
- PMC_int_val(SELF) - VTABLE_get_integer(INTERP, value);
+ SELF.get_integer() - VTABLE_get_integer(INTERP, value);
return idiff > 0 ? 1 : idiff < 0 ? -1 : 0;
}
else {
@@ -1169,12 +1169,12 @@
}
MMD_Float: {
const FLOATVAL diff =
- (FLOATVAL)PMC_int_val(SELF) - VTABLE_get_number(INTERP, value);
+ (FLOATVAL)SELF.get_integer() - VTABLE_get_number(INTERP, value);
return diff > 0 ? 1 : diff < 0 ? -1 : 0;
}
MMD_DEFAULT: {
/* int or undef */
- const INTVAL diff = PMC_int_val(SELF)
+ const INTVAL diff = SELF.get_integer()
- VTABLE_get_integer(INTERP, value);
return diff > 0 ? 1 : diff < 0 ? -1 : 0;
}
@@ -1192,11 +1192,11 @@
VTABLE INTVAL cmp_num(PMC *value) {
MMD_String: {
FLOATVAL fdiff =
- PMC_int_val(SELF) - VTABLE_get_number(INTERP, value);
+ SELF.get_integer() - VTABLE_get_number(INTERP, value);
if (FLOAT_IS_ZERO(fdiff)) {
const INTVAL idiff =
- PMC_int_val(SELF) - VTABLE_get_integer(INTERP, value);
+ SELF.get_integer() - VTABLE_get_integer(INTERP, value);
return idiff > 0 ? 1 : idiff < 0 ? -1 : 0;
}
else {
@@ -1205,13 +1205,13 @@
}
MMD_Float: {
const FLOATVAL diff =
- (FLOATVAL)PMC_int_val(SELF) - VTABLE_get_number(INTERP, value);
+ (FLOATVAL)SELF.get_integer() - VTABLE_get_number(INTERP, value);
return diff > 0 ? 1 : diff < 0 ? -1 : 0;
}
MMD_DEFAULT: {
/* int or undef */
const INTVAL diff =
- PMC_int_val(SELF) - VTABLE_get_integer(INTERP, value);
+ SELF.get_integer() - VTABLE_get_integer(INTERP, value);
return diff > 0 ? 1 : diff < 0 ? -1 : 0;
}
}
@@ -1308,7 +1308,7 @@
VTABLE void freeze(visit_info *info) {
IMAGE_IO * const io = info->image_io;
SUPER(info);
- VTABLE_push_integer(INTERP, io, PMC_int_val(SELF));
+ VTABLE_push_integer(INTERP, io, SELF.get_integer());
}
/*