Index: src/pmc/addrregistry.pmc =================================================================== --- src/pmc/addrregistry.pmc (版本 43268) +++ src/pmc/addrregistry.pmc (工作副本) @@ -73,7 +73,7 @@ Hash *hash; const void *value; - GET_ATTR_hash(interp, SELF, hash); + GET_ATTR_hash(INTERP, SELF, hash); value = parrot_hash_get(INTERP, hash, key); if (value) @@ -85,7 +85,7 @@ VTABLE INTVAL elements() { const Hash *hash; - GET_ATTR_hash(interp, SELF, hash); + GET_ATTR_hash(INTERP, SELF, hash); return parrot_hash_size(INTERP, hash); } @@ -93,7 +93,7 @@ VTABLE INTVAL get_bool() { const Hash *hash; - GET_ATTR_hash(interp, SELF, hash); + GET_ATTR_hash(INTERP, SELF, hash); return parrot_hash_size(INTERP, hash) != 0; } @@ -124,7 +124,7 @@ Hash *hash; UNUSED(value); - GET_ATTR_hash(interp, SELF, hash); + GET_ATTR_hash(INTERP, SELF, hash); oldval = parrot_hash_get(INTERP, hash, key); @@ -136,7 +136,7 @@ VTABLE void set_integer_keyed(PMC *key, INTVAL value) { Hash *hash; - GET_ATTR_hash(interp, SELF, hash); + GET_ATTR_hash(INTERP, SELF, hash); parrot_hash_put(INTERP, hash, key, (void *)value); } @@ -144,7 +144,7 @@ Hash *hash; void *value; - GET_ATTR_hash(interp, SELF, hash); + GET_ATTR_hash(INTERP, SELF, hash); value = parrot_hash_get(INTERP, hash, key); /* these casts look bad, but they avoid type punning warnings with -O */ Index: src/pmc/array.pmc =================================================================== --- src/pmc/array.pmc (版本 43268) +++ src/pmc/array.pmc (工作副本) @@ -151,10 +151,10 @@ const INTVAL size = VTABLE_elements(INTERP, other); INTVAL i; - SELF.set_integer_native(size); + SELF.set_integer_native(size); for (i = 0; i < size; i++) { PMC * const elem = VTABLE_get_pmc_keyed_int(INTERP, other, i); - SELF.set_pmc_keyed_int(i, elem); + SELF.set_pmc_keyed_int(i, elem); } } @@ -170,7 +170,7 @@ */ VTABLE void set_pmc(PMC *other) { - SELF.assign_pmc(other); + SELF.assign_pmc(other); } /* @@ -220,7 +220,7 @@ */ VTABLE INTVAL get_integer() { - return SELF.elements(); + return SELF.elements(); } /* @@ -234,8 +234,7 @@ */ VTABLE INTVAL get_bool() { - const INTVAL size = SELF.elements(); - return (INTVAL)(size != 0); + return (INTVAL)(SELF.elements() != 0); } /* @@ -292,7 +291,7 @@ */ VTABLE INTVAL get_integer_keyed_int(INTVAL key) { - PMC * const value = SELF.get_pmc_keyed_int(key); + PMC * const value = SELF.get_pmc_keyed_int(key); return VTABLE_get_integer(INTERP, value); } @@ -318,9 +317,9 @@ nextkey = key_next(INTERP, key); if (!nextkey) - return SELF.get_integer_keyed_int(ix); + return SELF.get_integer_keyed_int(ix); - box = SELF.get_pmc_keyed_int(ix); + box = SELF.get_pmc_keyed_int(ix); if (!box) box = undef(INTERP); @@ -339,7 +338,7 @@ */ VTABLE FLOATVAL get_number_keyed_int(INTVAL key) { - PMC * const value = SELF.get_pmc_keyed_int(key); + PMC * const value = SELF.get_pmc_keyed_int(key); return VTABLE_get_number(INTERP, value); @@ -366,9 +365,9 @@ nextkey = key_next(INTERP, key); if (!nextkey) - return SELF.get_number_keyed_int(ix); + return SELF.get_number_keyed_int(ix); - box = SELF.get_pmc_keyed_int(ix); + box = SELF.get_pmc_keyed_int(ix); if (!box) box = undef(INTERP); @@ -387,7 +386,7 @@ */ VTABLE STRING *get_string_keyed_int(INTVAL key) { - PMC * const value = SELF.get_pmc_keyed_int(key); + PMC * const value = SELF.get_pmc_keyed_int(key); return VTABLE_get_string(INTERP, value); } @@ -413,9 +412,9 @@ nextkey = key_next(INTERP, key); if (!nextkey) - return SELF.get_string_keyed_int(ix); + return SELF.get_string_keyed_int(ix); - box = SELF.get_pmc_keyed_int(ix); + box = SELF.get_pmc_keyed_int(ix); if (!box) box = undef(INTERP); @@ -434,7 +433,6 @@ */ VTABLE PMC *get_pmc_keyed_int(INTVAL key) { - return retval(INTERP, Parrot_pmc_array_get(INTERP, (List *)PMC_data(SELF), key, enum_type_PMC)); } @@ -460,9 +458,9 @@ nextkey = key_next(INTERP, key); if (!nextkey) - return SELF.get_pmc_keyed_int(ix); + return SELF.get_pmc_keyed_int(ix); - box = SELF.get_pmc_keyed_int(ix); + box = SELF.get_pmc_keyed_int(ix); if (!box) box = undef(INTERP); @@ -536,11 +534,11 @@ nextkey = key_next(INTERP, key); if (!nextkey) { - SELF.set_integer_keyed_int(ix, value); + SELF.set_integer_keyed_int(ix, value); return; } - box = SELF.get_pmc_keyed_int(ix); + box = SELF.get_pmc_keyed_int(ix); /* autovivify an Array */ if (!box) @@ -587,11 +585,11 @@ nextkey = key_next(INTERP, key); if (!nextkey) { - SELF.set_number_keyed_int(ix, value); + SELF.set_number_keyed_int(ix, value); return; } - box = SELF.get_pmc_keyed_int(ix); + box = SELF.get_pmc_keyed_int(ix); /* autovivify an Array */ if (!box) @@ -642,7 +640,7 @@ return; } - box = SELF.get_pmc_keyed_int(ix); + box = SELF.get_pmc_keyed_int(ix); /* autovivify an Array */ if (!box) @@ -693,7 +691,7 @@ return; } - box = SELF.get_pmc_keyed_int(ix); + box = SELF.get_pmc_keyed_int(ix); /* autovivify an Array */ if (!box) @@ -714,8 +712,8 @@ */ VTABLE void push_integer(INTVAL value) { - const INTVAL nextix = SELF.elements(); - SELF.set_integer_keyed_int(nextix, value); + const INTVAL nextix = SELF.elements(); + SELF.set_integer_keyed_int(nextix, value); } /* @@ -730,8 +728,8 @@ */ VTABLE void push_float(FLOATVAL value) { - const INTVAL nextix = SELF.elements(); - SELF.set_number_keyed_int(nextix, value); + const INTVAL nextix = SELF.elements(); + SELF.set_number_keyed_int(nextix, value); } /* @@ -746,8 +744,8 @@ */ VTABLE void push_string(STRING *value) { - const INTVAL nextix = SELF.elements(); - SELF.set_string_keyed_int(nextix, value); + const INTVAL nextix = SELF.elements(); + SELF.set_string_keyed_int(nextix, value); } /* @@ -762,8 +760,8 @@ */ VTABLE void push_pmc(PMC *value) { - const INTVAL nextix = SELF.elements(); - SELF.set_pmc_keyed_int(nextix, value); + const INTVAL nextix = SELF.elements(); + SELF.set_pmc_keyed_int(nextix, value); } /* @@ -845,7 +843,7 @@ */ VTABLE INTVAL pop_integer() { - PMC * const ptr = SELF.pop_pmc(); + PMC * const ptr = SELF.pop_pmc(); return VTABLE_get_integer(INTERP, ptr); } @@ -860,7 +858,7 @@ */ VTABLE FLOATVAL pop_float() { - PMC * const ptr = SELF.pop_pmc(); + PMC * const ptr = SELF.pop_pmc(); return VTABLE_get_number(INTERP, ptr); } @@ -875,7 +873,7 @@ */ VTABLE STRING *pop_string() { - PMC * const ptr = SELF.pop_pmc(); + PMC * const ptr = SELF.pop_pmc(); return VTABLE_get_string(INTERP, ptr); } @@ -905,7 +903,7 @@ */ VTABLE INTVAL shift_integer() { - PMC * const ptr = SELF.shift_pmc(); + PMC * const ptr = SELF.shift_pmc(); return VTABLE_get_integer(INTERP, ptr); } @@ -920,7 +918,7 @@ */ VTABLE FLOATVAL shift_float() { - PMC * const ptr = SELF.shift_pmc(); + PMC * const ptr = SELF.shift_pmc(); return VTABLE_get_number(INTERP, ptr); } @@ -935,7 +933,7 @@ */ VTABLE STRING *shift_string() { - PMC * const ptr = SELF.shift_pmc(); + PMC * const ptr = SELF.shift_pmc(); return VTABLE_get_string(INTERP, ptr); } @@ -1020,9 +1018,9 @@ PMC * const nextkey = key_next(INTERP, key); if (!nextkey) - return SELF.defined_keyed_int(ix); + return SELF.defined_keyed_int(ix); - box = SELF.get_pmc_keyed_int(ix); + box = SELF.get_pmc_keyed_int(ix); if (!box) return 0; @@ -1067,9 +1065,9 @@ PMC * const nextkey = key_next(INTERP, key); if (!nextkey) - return SELF.exists_keyed_int(ix); + return SELF.exists_keyed_int(ix); - box = SELF.get_pmc_keyed_int(ix); + box = SELF.get_pmc_keyed_int(ix); if (!box) return 0; @@ -1122,13 +1120,13 @@ if (value->vtable->base_type != enum_class_Array) return 0; - n = SELF.elements(); + n = SELF.elements(); if (VTABLE_elements(INTERP, value) != n) return 0; for (j = 0; j < n; ++j) { - PMC * const item1 = SELF.get_pmc_keyed_int(j); + PMC * const item1 = SELF.get_pmc_keyed_int(j); PMC * const item2 = VTABLE_get_pmc_keyed_int(INTERP, value, j); if (item1 != item2) { @@ -1146,7 +1144,7 @@ =item C -Return a new iterator for SELF. +Return a new iterator for SELF. =cut @@ -1204,7 +1202,7 @@ SUPER(info); if (info->extra_flags == EXTRA_IS_NULL) { - SELF.set_integer_native(VTABLE_shift_integer(INTERP, io)); + SELF.set_integer_native(VTABLE_shift_integer(INTERP, io)); } } @@ -1218,18 +1216,17 @@ */ VTABLE PMC *share_ro() { - PMC *_true, *ret; + PMC * const _true = pmc_new(INTERP, enum_class_Integer); + PMC * const ret = pt_shared_fixup(INTERP, SELF); /* prevent infinite recursion */ if (PObj_is_PMC_shared_TEST(SELF)) Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, "share_ro on something that already is shared"); - _true = pmc_new(INTERP, enum_class_Integer); + VTABLE_set_integer_native(INTERP, _true, 1); - ret = pt_shared_fixup(INTERP, SELF); - /* first set readonly */ VTABLE_setprop(INTERP, ret, CONST_STRING(INTERP, "_ro"), _true); Index: src/pmc/arrayiterator.pmc =================================================================== --- src/pmc/arrayiterator.pmc (版本 43268) +++ src/pmc/arrayiterator.pmc (工作副本) @@ -86,7 +86,7 @@ VTABLE void init_pmc(PMC *array) { - SET_ATTR_array(interp, SELF, array); + SET_ATTR_array(INTERP, SELF, array); PObj_custom_mark_SET(SELF); @@ -124,14 +124,14 @@ PMC *array; PMC *clone; - GET_ATTR_array(interp, SELF, array); - GET_ATTR_pos(interp, SELF, pos); - GET_ATTR_reverse(interp, SELF, reverse); + GET_ATTR_array(INTERP, SELF, array); + GET_ATTR_pos(INTERP, SELF, pos); + GET_ATTR_reverse(INTERP, SELF, reverse); clone = pmc_new_init(INTERP, enum_class_ArrayIterator, array); - SET_ATTR_pos(interp, clone, pos); - SET_ATTR_reverse(interp, clone, reverse); + SET_ATTR_pos(INTERP, clone, pos); + SET_ATTR_reverse(INTERP, clone, reverse); return clone; } @@ -163,15 +163,15 @@ VTABLE INTVAL elements() { INTVAL reverse, pos, length; - GET_ATTR_reverse(interp, SELF, reverse); + GET_ATTR_reverse(INTERP, SELF, reverse); if (reverse) { - GET_ATTR_pos(interp, SELF, pos); + GET_ATTR_pos(INTERP, SELF, pos); return pos; } else { - GET_ATTR_length(interp, SELF, length); - GET_ATTR_pos(interp, SELF, pos); + GET_ATTR_length(INTERP, SELF, length); + GET_ATTR_pos(INTERP, SELF, pos); return length - pos; } } @@ -197,18 +197,18 @@ PMC *array; if (value == ITERATE_FROM_START) { - GET_ATTR_array(interp, SELF, array); - SET_ATTR_reverse(interp, SELF, 0); - SET_ATTR_pos(interp, SELF, 0); - SET_ATTR_length(interp, SELF, VTABLE_elements(INTERP, array)); + GET_ATTR_array(INTERP, SELF, array); + SET_ATTR_reverse(INTERP, SELF, 0); + SET_ATTR_pos(INTERP, SELF, 0); + SET_ATTR_length(INTERP, SELF, VTABLE_elements(INTERP, array)); } else if (value == ITERATE_FROM_END) { INTVAL element; - GET_ATTR_array(interp, SELF, array); + GET_ATTR_array(INTERP, SELF, array); element = VTABLE_elements(INTERP, array); - SET_ATTR_reverse(interp, SELF, 1); - SET_ATTR_length(interp, SELF, element); - SET_ATTR_pos(interp, SELF, element); + SET_ATTR_reverse(INTERP, SELF, 1); + SET_ATTR_length(INTERP, SELF, element); + SET_ATTR_pos(INTERP, SELF, element); } else Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, Index: src/pmc/bigint.pmc =================================================================== --- src/pmc/bigint.pmc (版本 43268) +++ src/pmc/bigint.pmc (工作副本) @@ -761,7 +761,7 @@ } VTABLE STRING *get_repr() { - STRING * const s = SELF.get_string(); + STRING * const s = SELF.get_string(); return Parrot_str_append(INTERP, s, CONST_STRING(INTERP, "L")); } /* Index: src/pmc/bignum.pmc =================================================================== --- src/pmc/bignum.pmc (版本 43268) +++ src/pmc/bignum.pmc (工作副本) @@ -1020,7 +1020,7 @@ } VTABLE STRING *get_repr() { - STRING *s = SELF.get_string(); + STRING *s = SELF.get_string(); return Parrot_str_append(INTERP, s, Parrot_str_new(interp, "N", 1)); } /* Index: src/pmc/boolean.pmc =================================================================== --- src/pmc/boolean.pmc (版本 43268) +++ src/pmc/boolean.pmc (工作副本) @@ -34,10 +34,10 @@ */ VTABLE void init_pmc(PMC *value) { if (!PMC_IS_NULL(value)) { - SELF.set_bool(VTABLE_get_bool(INTERP, value)); + SELF.set_bool(VTABLE_get_bool(INTERP, value)); } else { - SELF.set_bool(0); + SELF.set_bool(0); } } /* @@ -71,7 +71,7 @@ VTABLE void set_bool(INTVAL value) { - SELF.set_integer_native(value); + SELF.set_integer_native(value); } /* @@ -85,7 +85,7 @@ */ VTABLE void set_number_native(FLOATVAL value) { - SELF.set_bool(!FLOAT_IS_ZERO(value)); + SELF.set_bool(!FLOAT_IS_ZERO(value)); } /* @@ -99,7 +99,7 @@ */ VTABLE void set_string_native(STRING *value) { - SELF.set_bool(Parrot_str_boolean(INTERP, value)); + SELF.set_bool(Parrot_str_boolean(INTERP, value)); } } Index: src/pmc/callcontext.pmc =================================================================== --- src/pmc/callcontext.pmc (版本 43268) +++ src/pmc/callcontext.pmc (工作副本) @@ -173,7 +173,7 @@ static Pcc_cell * get_cell_at(PARROT_INTERP, ARGIN(PMC *SELF), INTVAL key) { - INTVAL i, num_positionals; + INTVAL num_positionals; Pcc_cell *cell; GETATTR_CallContext_num_positionals(interp, SELF, num_positionals); @@ -337,7 +337,6 @@ static void mark_hash(PARROT_INTERP, ARGIN(Hash *h)) { - UINTVAL entries = h->entries; INTVAL i; for (i = h->mask; i >= 0; --i) { @@ -469,37 +468,41 @@ */ VTABLE void mark() { - Hash *hash; - STRING *short_sig; - Pcc_cell *positionals; - INTVAL num_positionals; - PMC *arg_flags, *type_tuple, *return_flags, *tmp; - UINTVAL i; - UINTVAL *n_regs_used; - Regs_ps bp_ps; + UINTVAL i; + const UINTVAL *n_regs_used; + INTVAL num_positionals; + STRING *short_sig; + PMC *tmp; + Hash *hash; + Regs_ps bp_ps; + Pcc_cell *positionals; if (!PMC_data(SELF)) return; - GET_ATTR_type_tuple(INTERP, SELF, type_tuple); - GET_ATTR_short_sig(INTERP, SELF, short_sig); - GET_ATTR_arg_flags(INTERP, SELF, arg_flags); - GET_ATTR_return_flags(INTERP, SELF, return_flags); GET_ATTR_num_positionals(INTERP, SELF, num_positionals); GET_ATTR_positionals(INTERP, SELF, positionals); - GET_ATTR_hash(INTERP, SELF, hash); - Parrot_gc_mark_PMC_alive(INTERP, type_tuple); - Parrot_gc_mark_STRING_alive(INTERP, short_sig); - Parrot_gc_mark_PMC_alive(INTERP, arg_flags); - Parrot_gc_mark_PMC_alive(INTERP, return_flags); - if (num_positionals) mark_positionals(INTERP, positionals); + GET_ATTR_hash(INTERP, SELF, hash); + if (hash) mark_hash(INTERP, hash); + GET_ATTR_short_sig(INTERP, SELF, short_sig); + Parrot_gc_mark_STRING_alive(INTERP, short_sig); + + GET_ATTR_type_tuple(INTERP, SELF, tmp); + Parrot_gc_mark_PMC_alive(INTERP, tmp); + + GET_ATTR_arg_flags(INTERP, SELF, tmp); + Parrot_gc_mark_PMC_alive(INTERP, tmp); + + GET_ATTR_return_flags(INTERP, SELF, tmp); + Parrot_gc_mark_PMC_alive(INTERP, tmp); + GET_ATTR_caller_ctx(INTERP, SELF, tmp); Parrot_gc_mark_PMC_alive(INTERP, tmp); @@ -530,22 +533,25 @@ GET_ATTR_current_sig(INTERP, SELF, tmp); Parrot_gc_mark_PMC_alive(INTERP, tmp); + GET_ATTR_n_regs_used(INTERP, SELF, n_regs_used); + if (!n_regs_used) return; GET_ATTR_bp_ps(INTERP, SELF, bp_ps); + for (i = 0; i < n_regs_used[REGNO_PMC]; ++i) { PMC *p = bp_ps.regs_p[-1L-(i)]; /* Original code from CTX_REG_PMC */ if (p) - Parrot_gc_mark_PMC_alive(interp, p); + Parrot_gc_mark_PMC_alive(INTERP, p); } for (i = 0; i < n_regs_used[REGNO_STR]; ++i) { STRING *s = bp_ps.regs_s[i]; if (s) - Parrot_gc_mark_STRING_alive(interp, s); + Parrot_gc_mark_STRING_alive(INTERP, s); } } @@ -737,7 +743,6 @@ */ VTABLE void set_attr_str(STRING *key, PMC *value) { - if (Parrot_str_equal(INTERP, key, CONST_STRING(INTERP, "arg_flags"))) { SET_ATTR_arg_flags(INTERP, SELF, value); } @@ -874,34 +879,34 @@ } VTABLE void push_integer(INTVAL value) { - Pcc_cell *cell = CREATE_INTVAL_CELL(INTERP); + Pcc_cell * const cell = CREATE_INTVAL_CELL(INTERP); APPEND_CELL(INTERP, SELF, cell); CELL_INT(cell) = value; } VTABLE void push_float(FLOATVAL value) { - Pcc_cell *cell = CREATE_FLOATVAL_CELL(INTERP); + Pcc_cell * const cell = CREATE_FLOATVAL_CELL(INTERP); APPEND_CELL(INTERP, SELF, cell); CELL_FLOAT(cell) = value; } VTABLE void push_string(STRING *value) { - Pcc_cell *cell = CREATE_STRING_CELL(INTERP); + Pcc_cell * const cell = CREATE_STRING_CELL(INTERP); APPEND_CELL(INTERP, SELF, cell); CELL_STRING(cell) = value; } VTABLE void push_pmc(PMC *value) { - Pcc_cell *cell = CREATE_PMC_CELL(INTERP); + Pcc_cell * const cell = CREATE_PMC_CELL(INTERP); APPEND_CELL(INTERP, SELF, cell); CELL_PMC(cell) = value; } VTABLE INTVAL pop_integer() { - Pcc_cell *cell = pop_cell(INTERP, SELF); + Pcc_cell * const cell = pop_cell(INTERP, SELF); if (cell) { - INTVAL result = autobox_intval(INTERP, cell); + const INTVAL result = autobox_intval(INTERP, cell); FREE_CELL(INTERP, cell); return result; } @@ -910,10 +915,10 @@ } VTABLE FLOATVAL pop_float() { - Pcc_cell *cell = pop_cell(INTERP, SELF); + Pcc_cell * const cell = pop_cell(INTERP, SELF); if (cell) { - FLOATVAL result = autobox_floatval(INTERP, cell); + const FLOATVAL result = autobox_floatval(INTERP, cell); FREE_CELL(INTERP, cell); return result; } @@ -922,10 +927,10 @@ } VTABLE PMC * pop_pmc() { - Pcc_cell *cell = pop_cell(INTERP, SELF); + Pcc_cell * const cell = pop_cell(INTERP, SELF); if (cell) { - PMC *result = autobox_pmc(INTERP, cell); + PMC * const result = autobox_pmc(INTERP, cell); FREE_CELL(INTERP, cell); return result; } @@ -934,10 +939,10 @@ } VTABLE STRING * pop_string() { - Pcc_cell *cell = pop_cell(INTERP, SELF); + Pcc_cell * const cell = pop_cell(INTERP, SELF); if (cell) { - STRING *result = autobox_string(INTERP, cell); + STRING * const result = autobox_string(INTERP, cell); FREE_CELL(INTERP, cell); return result; } @@ -946,7 +951,7 @@ } VTABLE INTVAL get_integer_keyed_int(INTVAL key) { - Pcc_cell *cell = get_cell_at(INTERP, SELF, key); + Pcc_cell * const cell = get_cell_at(INTERP, SELF, key); if (!cell) return 0; @@ -955,7 +960,7 @@ } VTABLE FLOATVAL get_number_keyed_int(INTVAL key) { - Pcc_cell *cell = get_cell_at(INTERP, SELF, key); + Pcc_cell * const cell = get_cell_at(INTERP, SELF, key); if (!cell) return 0.0; @@ -964,7 +969,7 @@ } VTABLE STRING * get_string_keyed_int(INTVAL key) { - Pcc_cell *cell = get_cell_at(INTERP, SELF, key); + Pcc_cell * const cell = get_cell_at(INTERP, SELF, key); if (!cell) return NULL; @@ -982,19 +987,19 @@ } VTABLE void unshift_integer(INTVAL value) { - Pcc_cell *cell = CREATE_INTVAL_CELL(INTERP); + Pcc_cell * const cell = CREATE_INTVAL_CELL(INTERP); PREPEND_CELL(INTERP, SELF, cell); CELL_INT(cell) = value; } VTABLE void unshift_float(FLOATVAL value) { - Pcc_cell *cell = CREATE_FLOATVAL_CELL(INTERP); + Pcc_cell * const cell = CREATE_FLOATVAL_CELL(INTERP); PREPEND_CELL(INTERP, SELF, cell); CELL_FLOAT(cell) = value; } VTABLE void unshift_string(STRING *value) { - Pcc_cell *cell = CREATE_STRING_CELL(INTERP); + Pcc_cell * const cell = CREATE_STRING_CELL(INTERP); PREPEND_CELL(INTERP, SELF, cell); CELL_STRING(cell) = value; } @@ -1006,10 +1011,10 @@ } VTABLE INTVAL shift_integer() { - Pcc_cell *cell = shift_cell(INTERP, SELF); + Pcc_cell * const cell = shift_cell(INTERP, SELF); if (cell) { - INTVAL result = autobox_intval(INTERP, cell); + const INTVAL result = autobox_intval(INTERP, cell); FREE_CELL(INTERP, cell); return result; } @@ -1021,7 +1026,7 @@ Pcc_cell *cell = shift_cell(INTERP, SELF); if (cell) { - FLOATVAL result = autobox_floatval(INTERP, cell); + const FLOATVAL result = autobox_floatval(INTERP, cell); FREE_CELL(INTERP, cell); return result; } @@ -1030,10 +1035,10 @@ } VTABLE STRING * shift_string() { - Pcc_cell *cell = shift_cell(INTERP, SELF); + Pcc_cell * const cell = shift_cell(INTERP, SELF); if (cell) { - STRING *result = autobox_string(INTERP, cell); + STRING * const result = autobox_string(INTERP, cell); FREE_CELL(INTERP, cell); return result; } @@ -1042,10 +1047,10 @@ } VTABLE PMC * shift_pmc() { - Pcc_cell *cell = shift_cell(INTERP, SELF); + Pcc_cell * const cell = shift_cell(INTERP, SELF); if (cell) { - PMC *result = autobox_pmc(INTERP, cell); + PMC * const result = autobox_pmc(INTERP, cell); FREE_CELL(INTERP, cell); return result; } @@ -1054,7 +1059,7 @@ } VTABLE void set_integer_keyed_int(INTVAL key, INTVAL value) { - Pcc_cell *cell = get_cell_at(INTERP, SELF, key); + Pcc_cell * const cell = get_cell_at(INTERP, SELF, key); if (!cell) { INTVAL num_positionals; @@ -1072,7 +1077,7 @@ } VTABLE void set_number_keyed_int(INTVAL key, FLOATVAL value) { - Pcc_cell *cell = get_cell_at(INTERP, SELF, key); + Pcc_cell * const cell = get_cell_at(INTERP, SELF, key); if (!cell) { INTVAL num_positionals; @@ -1090,7 +1095,7 @@ } VTABLE void set_string_keyed_int(INTVAL key, STRING *value) { - Pcc_cell *cell = get_cell_at(INTERP, SELF, key); + Pcc_cell * const cell = get_cell_at(INTERP, SELF, key); if (!cell) { INTVAL num_positionals; @@ -1108,7 +1113,7 @@ } VTABLE void set_pmc_keyed_int(INTVAL key, PMC *value) { - Pcc_cell *cell = get_cell_at(INTERP, SELF, key); + Pcc_cell * const cell = get_cell_at(INTERP, SELF, key); if (!cell) { INTVAL num_positionals; @@ -1126,8 +1131,8 @@ } VTABLE void set_integer_keyed_str(STRING *key, INTVAL value) { - Hash *hash = get_hash(INTERP, SELF); - Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, (void *)key); + Hash * const hash = get_hash(INTERP, SELF); + Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, (void *)key); if (!cell) { cell = CREATE_INTVAL_CELL(INTERP); @@ -1141,8 +1146,8 @@ } VTABLE void set_number_keyed_str(STRING *key, FLOATVAL value) { - Hash *hash = get_hash(INTERP, SELF); - Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, (void *)key); + Hash * const hash = get_hash(INTERP, SELF); + Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, (void *)key); if (!cell) { cell = CREATE_FLOATVAL_CELL(INTERP); @@ -1156,8 +1161,8 @@ } VTABLE void set_string_keyed_str(STRING *key, STRING *value) { - Hash *hash = get_hash(INTERP, SELF); - Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, (void *)key); + Hash * const hash = get_hash(INTERP, SELF); + Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, (void *)key); if (!cell) { cell = CREATE_STRING_CELL(INTERP); @@ -1171,8 +1176,8 @@ } VTABLE void set_pmc_keyed_str(STRING *key, PMC *value) { - Hash *hash = get_hash(INTERP, SELF); - Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, (void *)key); + Hash * const hash = get_hash(INTERP, SELF); + Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, (void *)key); if (!cell) { cell = CREATE_PMC_CELL(INTERP); @@ -1186,9 +1191,9 @@ } VTABLE void set_integer_keyed(PMC *key, INTVAL value) { - Hash *hash = get_hash(INTERP, SELF); - void *k = hash_key_from_pmc(INTERP, hash, key); - Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); + Hash * const hash = get_hash(INTERP, SELF); + void * const k = hash_key_from_pmc(INTERP, hash, key); + Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); if (!cell) { cell = CREATE_INTVAL_CELL(INTERP); @@ -1202,9 +1207,9 @@ } VTABLE void set_number_keyed(PMC *key, FLOATVAL value) { - Hash *hash = get_hash(INTERP, SELF); - void *k = hash_key_from_pmc(INTERP, hash, key); - Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); + Hash * const hash = get_hash(INTERP, SELF); + void * const k = hash_key_from_pmc(INTERP, hash, key); + Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); if (!cell) { cell = CREATE_FLOATVAL_CELL(INTERP); @@ -1218,9 +1223,9 @@ } VTABLE void set_string_keyed(PMC *key, STRING *value) { - Hash *hash = get_hash(INTERP, SELF); - void *k = hash_key_from_pmc(INTERP, hash, key); - Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); + Hash * const hash = get_hash(INTERP, SELF); + void * const k = hash_key_from_pmc(INTERP, hash, key); + Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); if (!cell) { cell = CREATE_STRING_CELL(INTERP); @@ -1234,9 +1239,9 @@ } VTABLE void set_pmc_keyed(PMC *key, PMC *value) { - Hash *hash = get_hash(INTERP, SELF); - void *k = hash_key_from_pmc(INTERP, hash, key); - Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); + Hash * const hash = get_hash(INTERP, SELF); + void * const k = hash_key_from_pmc(INTERP, hash, key); + Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); if (!cell) { cell = CREATE_PMC_CELL(INTERP); @@ -1250,11 +1255,11 @@ } VTABLE INTVAL get_integer_keyed_str(STRING *key) { - Hash *hash = get_hash(INTERP, SELF); + Hash * const hash = get_hash(INTERP, SELF); if (hash) { - void *k = hash_key_from_string(INTERP, hash, key); - Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); + void * const k = hash_key_from_string(INTERP, hash, key); + Pcc_cell * const cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); if (cell) return autobox_intval(INTERP, cell); @@ -1264,11 +1269,11 @@ } VTABLE FLOATVAL get_number_keyed_str(STRING *key) { - Hash *hash = get_hash(INTERP, SELF); + Hash * const hash = get_hash(INTERP, SELF); if (hash) { - void *k = hash_key_from_string(INTERP, hash, key); - Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); + void * const k = hash_key_from_string(INTERP, hash, key); + Pcc_cell * const cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); if (cell) return autobox_floatval(INTERP, cell); @@ -1279,11 +1284,11 @@ VTABLE STRING * get_string_keyed_str(STRING *key) { - Hash *hash = get_hash(INTERP, SELF); + Hash * const hash = get_hash(INTERP, SELF); if (hash) { - void *k = hash_key_from_string(INTERP, hash, key); - Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); + void * const k = hash_key_from_string(INTERP, hash, key); + Pcc_cell * const cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); if (cell) return autobox_string(INTERP, cell); @@ -1293,11 +1298,11 @@ } VTABLE PMC * get_pmc_keyed_str(STRING *key) { - Hash *hash = get_hash(INTERP, SELF); + Hash * const hash = get_hash(INTERP, SELF); if (hash) { - void *k = hash_key_from_string(INTERP, hash, key); - Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); + void * const k = hash_key_from_string(INTERP, hash, key); + Pcc_cell * const cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); if (cell) return autobox_pmc(INTERP, cell); @@ -1307,11 +1312,11 @@ } VTABLE INTVAL get_integer_keyed(PMC *key) { - Hash *hash = get_hash(INTERP, SELF); + Hash * const hash = get_hash(INTERP, SELF); if (hash) { - void *k = hash_key_from_pmc(INTERP, hash, key); - Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); + void * const k = hash_key_from_pmc(INTERP, hash, key); + Pcc_cell * const cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); if (cell) return autobox_intval(INTERP, cell); @@ -1321,11 +1326,11 @@ } VTABLE FLOATVAL get_number_keyed(PMC *key) { - Hash *hash = get_hash(INTERP, SELF); + Hash * const hash = get_hash(INTERP, SELF); if (hash) { - void *k = hash_key_from_pmc(INTERP, hash, key); - Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); + void * const k = hash_key_from_pmc(INTERP, hash, key); + Pcc_cell * const cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); if (cell) return autobox_floatval(INTERP, cell); @@ -1335,11 +1340,11 @@ } VTABLE STRING * get_string_keyed(PMC *key) { - Hash *hash = get_hash(INTERP, SELF); + Hash * const hash = get_hash(INTERP, SELF); if (hash) { - void *k = hash_key_from_pmc(INTERP, hash, key); - Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); + void * const k = hash_key_from_pmc(INTERP, hash, key); + Pcc_cell * const cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); if (cell) return autobox_string(INTERP, cell); @@ -1349,11 +1354,11 @@ } VTABLE PMC * get_pmc_keyed(PMC *key) { - Hash *hash = get_hash(INTERP, SELF); + Hash * const hash = get_hash(INTERP, SELF); if (hash) { - void *k = hash_key_from_pmc(INTERP, hash, key); - Pcc_cell *cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); + void * const k = hash_key_from_pmc(INTERP, hash, key); + Pcc_cell * const cell = (Pcc_cell *)parrot_hash_get(INTERP, hash, k); if (cell) return autobox_pmc(INTERP, cell); @@ -1363,10 +1368,10 @@ } VTABLE INTVAL exists_keyed(PMC *key) { - Hash *hash = get_hash(INTERP, SELF); + Hash * const hash = get_hash(INTERP, SELF); if (hash) { - void *k = hash_key_from_pmc(INTERP, hash, key); + void * const k = hash_key_from_pmc(INTERP, hash, key); return parrot_hash_exists(INTERP, hash, k); } @@ -1374,10 +1379,10 @@ } VTABLE INTVAL exists_keyed_str(STRING *key) { - Hash *hash = get_hash(INTERP, SELF); + Hash * const hash = get_hash(INTERP, SELF); if (hash) { - void *k = hash_key_from_string(INTERP, hash, key); + void * const k = hash_key_from_string(INTERP, hash, key); return parrot_hash_exists(INTERP, hash, k); } @@ -1408,7 +1413,7 @@ Pcc_cell *cell; STRING *short_sig; PMC *type_tuple, *arg_flags, *return_flags; - PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type); + PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type); GET_ATTR_positionals(INTERP, SELF, cell); @@ -1435,6 +1440,7 @@ CELL_PMC(cloned_cell) = CELL_PMC(cell); break; default: + cloned_cell = NULL; break; } APPEND_CELL(INTERP, dest, cloned_cell); @@ -1490,48 +1496,49 @@ */ METHOD backtrace(PMC *resume :optional, INTVAL has_resume :opt_flag) { - PMC *result = pmc_new(interp, enum_class_ResizablePMCArray); - PMC *cur_ctx = SELF; - Parrot_Continuation_attributes *cont = has_resume ? PMC_cont(resume) : NULL; + PMC * const result = pmc_new(INTERP, enum_class_ResizablePMCArray); + PMC *cur_ctx = SELF; /* Get starting context, then loop over them. */ while (cur_ctx) { - PMC *frame = pmc_new(interp, enum_class_Hash); + PMC * const frame = pmc_new(INTERP, enum_class_Hash); PMC *annotations = NULL; - Parrot_Sub_attributes *sub; /* Get sub and put it in the hash. */ - PMC *sub_pmc = Parrot_pcc_get_sub(interp, cur_ctx); + PMC *sub_pmc = Parrot_pcc_get_sub(INTERP, cur_ctx); if (!sub_pmc) sub_pmc = PMCNULL; - VTABLE_set_pmc_keyed_str(interp, frame, CONST_STRING(interp, "sub"), sub_pmc); + VTABLE_set_pmc_keyed_str(INTERP, frame, CONST_STRING(INTERP, "sub"), sub_pmc); /* Look up any annotations and put them in the hash. */ if (!PMC_IS_NULL(sub_pmc)) { - PMC_get_sub(interp, sub_pmc, sub); + Parrot_Sub_attributes *sub; + Parrot_Continuation_attributes *cont = has_resume ? PMC_cont(resume) : NULL; + PMC_get_sub(INTERP, sub_pmc, sub); + if (sub->seg->annotations) { - PackFile_ByteCode *seg = sub->seg; - opcode_t *pc = cont && cur_ctx == cont->to_ctx - ? cont->address - : Parrot_pcc_get_pc(interp, cur_ctx); + PackFile_ByteCode * const seg = sub->seg; + opcode_t * const pc = cont && cur_ctx == cont->to_ctx + ? cont->address + : Parrot_pcc_get_pc(INTERP, cur_ctx); - annotations = PackFile_Annotations_lookup(interp, + annotations = PackFile_Annotations_lookup(INTERP, seg->annotations, pc - seg->base.data, NULL); } } if (!annotations) - annotations = pmc_new(interp, enum_class_Hash); + annotations = pmc_new(INTERP, enum_class_Hash); - VTABLE_set_pmc_keyed_str(interp, frame, CONST_STRING(interp, "annotations"), annotations); + VTABLE_set_pmc_keyed_str(INTERP, frame, CONST_STRING(INTERP, "annotations"), annotations); /* Push frame and go to next caller. */ - VTABLE_push_pmc(interp, result, frame); - cur_ctx = Parrot_pcc_get_caller_ctx(interp, cur_ctx); + VTABLE_push_pmc(INTERP, result, frame); + cur_ctx = Parrot_pcc_get_caller_ctx(INTERP, cur_ctx); } RETURN(PMC *result); Index: src/pmc/capture.pmc =================================================================== --- src/pmc/capture.pmc (版本 43268) +++ src/pmc/capture.pmc (工作副本) @@ -816,16 +816,16 @@ */ VTABLE void mark() { - PMC *array, *hash; + PMC *tmp; if (!PMC_data(SELF)) return; - GET_ATTR_array(INTERP, SELF, array); - GET_ATTR_hash(INTERP, SELF, hash); + GET_ATTR_array(INTERP, SELF, tmp); + Parrot_gc_mark_PMC_alive(INTERP, tmp); - Parrot_gc_mark_PMC_alive(INTERP, array); - Parrot_gc_mark_PMC_alive(INTERP, hash); + GET_ATTR_hash(INTERP, SELF, tmp); + Parrot_gc_mark_PMC_alive(INTERP, tmp); } /* Index: src/pmc/codestring.pmc =================================================================== --- src/pmc/codestring.pmc (版本 43268) +++ src/pmc/codestring.pmc (工作副本) @@ -101,14 +101,14 @@ */ METHOD emit(STRING *fmt, PMC *args :slurpy, PMC *hash :slurpy :named) { + INTVAL I0, I1; + INTVAL pos = 0; + INTVAL replen = 0; STRING * const percent = CONST_STRING(INTERP, "%"); STRING * const comma = CONST_STRING(INTERP, ","); STRING * const comma_space = CONST_STRING(INTERP, ", "); STRING * const newline = CONST_STRING(INTERP, "\n"); - STRING *key, *repl, *S0, *S1; - INTVAL pos = 0; - INTVAL replen = 0; - INTVAL I0, I1; + STRING *key, *repl, *S0, *S1; fmt = Parrot_str_new_COW(INTERP, fmt); Index: src/pmc/complex.pmc =================================================================== --- src/pmc/complex.pmc (版本 43268) +++ src/pmc/complex.pmc (工作副本) @@ -233,23 +233,23 @@ */ VTABLE opcode_t *invoke(void *next) { - const int argcP = REG_INT(interp, 3); + const int argcP = REG_INT(INTERP, 3); PMC * const res = pmc_new(INTERP, enum_class_Complex); if (argcP == 1) { - PMC * const arg = REG_PMC(interp, 5); + PMC * const arg = REG_PMC(INTERP, 5); if (arg->vtable->base_type == enum_class_String) - VTABLE_set_string_native(INTERP, res, VTABLE_get_string(interp, arg)); + VTABLE_set_string_native(INTERP, res, VTABLE_get_string(INTERP, arg)); else SET_ATTR_re(INTERP, res, VTABLE_get_number(INTERP, arg)); } else if (argcP == 2) { - SET_ATTR_re(INTERP, res, VTABLE_get_number(INTERP, REG_PMC(interp, 5))); - SET_ATTR_im(INTERP, res, VTABLE_get_number(INTERP, REG_PMC(interp, 6))); + SET_ATTR_re(INTERP, res, VTABLE_get_number(INTERP, REG_PMC(INTERP, 5))); + SET_ATTR_im(INTERP, res, VTABLE_get_number(INTERP, REG_PMC(INTERP, 6))); } - REG_PMC(interp, 5) = res; + REG_PMC(INTERP, 5) = res; return (opcode_t *)next; } @@ -284,31 +284,31 @@ } VTABLE void init_pmc(PMC *initializer) { - const INTVAL arg_type = VTABLE_type(interp, initializer); - SELF.init(); + const INTVAL arg_type = VTABLE_type(INTERP, initializer); + SELF.init(); switch (arg_type) { case enum_class_String: - SELF.set_string_native(VTABLE_get_string(interp, initializer)); + SELF.set_string_native(VTABLE_get_string(INTERP, initializer)); break; case enum_class_FixedFloatArray: case enum_class_ResizableFloatArray: case enum_class_FixedIntegerArray: case enum_class_ResizableIntegerArray: - if (VTABLE_get_integer(interp, initializer) == 2) { - FLOATVAL re = VTABLE_get_number_keyed_int(interp, initializer, 0); - FLOATVAL im = VTABLE_get_number_keyed_int(interp, initializer, 1); + if (VTABLE_get_integer(INTERP, initializer) == 2) { + FLOATVAL re = VTABLE_get_number_keyed_int(INTERP, initializer, 0); + FLOATVAL im = VTABLE_get_number_keyed_int(INTERP, initializer, 1); SET_ATTR_re(INTERP, SELF, re); SET_ATTR_im(INTERP, SELF, im); break; } /* else let it fall to default */ default: - if (VTABLE_isa(interp, initializer, CONST_STRING(interp, "String"))) { - STRING * s = VTABLE_get_string(interp, initializer); - SELF.set_string_native(s); + if (VTABLE_isa(INTERP, initializer, CONST_STRING(INTERP, "String"))) { + STRING * s = VTABLE_get_string(INTERP, initializer); + SELF.set_string_native(s); } else { - Parrot_ex_throw_from_c_args(interp, NULL, + Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, "Invalid Complex initializer"); } @@ -350,7 +350,7 @@ */ VTABLE INTVAL get_integer() { - const FLOATVAL f = SELF.get_number(); + const FLOATVAL f = SELF.get_number(); return (INTVAL)f; } @@ -397,17 +397,17 @@ VTABLE INTVAL get_integer_keyed(PMC *key) { STRING * const s = VTABLE_get_string(INTERP, key); - return SELF.get_integer_keyed_str(s); + return SELF.get_integer_keyed_str(s); } VTABLE INTVAL get_integer_keyed_str(STRING *key) { - const FLOATVAL f = SELF.get_number_keyed_str(key); + const FLOATVAL f = SELF.get_number_keyed_str(key); return (INTVAL)f; } VTABLE FLOATVAL get_number_keyed(PMC *key) { STRING * const s = VTABLE_get_string(INTERP, key); - return SELF.get_number_keyed_str(s); + return SELF.get_number_keyed_str(s); } VTABLE FLOATVAL get_number_keyed_str(STRING *key) { @@ -419,25 +419,25 @@ GET_ATTR_im(INTERP, SELF, value); } else - Parrot_ex_throw_from_c_args(interp, NULL, + Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, "Complex: key is neither 'real' or 'imag'"); return value; } VTABLE PMC *get_pmc_keyed(PMC *key) { - if (VTABLE_isa(interp, key, CONST_STRING(interp, "Integer"))) { - const INTVAL i = VTABLE_get_integer(interp, key); - return SELF.get_pmc_keyed_int(i); + if (VTABLE_isa(INTERP, key, CONST_STRING(INTERP, "Integer"))) { + const INTVAL i = VTABLE_get_integer(INTERP, key); + return SELF.get_pmc_keyed_int(i); } else { STRING * const s = VTABLE_get_string(INTERP, key); - return SELF.get_pmc_keyed_str(s); + return SELF.get_pmc_keyed_str(s); } } VTABLE PMC *get_pmc_keyed_str(STRING *key) { PMC * const ret = pmc_new(INTERP, enum_class_Float); - const FLOATVAL val = SELF.get_number_keyed_str(key); + const FLOATVAL val = SELF.get_number_keyed_str(key); VTABLE_set_number_native(INTERP, ret, val); return ret; } @@ -454,7 +454,7 @@ VTABLE PMC *get_pmc_keyed_int(INTVAL key) { PMC * const ret = pmc_new(INTERP, enum_class_Float); - const FLOATVAL val = SELF.get_number_keyed_int(key); + const FLOATVAL val = SELF.get_number_keyed_int(key); VTABLE_set_number_native(INTERP, ret, val); return ret; } @@ -486,7 +486,7 @@ GET_ATTR_im(INTERP, SELF, f); break; default: - Parrot_ex_throw_from_c_args(interp, NULL, + Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, "Complex: key must be 0 or 1"); } return f; @@ -501,7 +501,7 @@ SET_ATTR_im(INTERP, SELF, v); break; default: - Parrot_ex_throw_from_c_args(interp, NULL, + Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, "Complex: key must be 0 or 1"); } } @@ -549,7 +549,7 @@ } VTABLE void set_integer_native(INTVAL value) { - SELF.set_number_native((FLOATVAL)value); + SELF.set_number_native((FLOATVAL)value); } VTABLE void set_number_native(FLOATVAL value) { @@ -579,21 +579,21 @@ */ VTABLE void set_integer_keyed(PMC *key, INTVAL value) { - SELF.set_number_keyed(key, (FLOATVAL)value); + SELF.set_number_keyed(key, (FLOATVAL)value); } VTABLE void set_integer_keyed_str(STRING *key, INTVAL value) { - SELF.set_number_keyed_str(key, (FLOATVAL)value); + SELF.set_number_keyed_str(key, (FLOATVAL)value); } VTABLE void set_number_keyed(PMC *key, FLOATVAL value) { - if (VTABLE_isa(interp, key, CONST_STRING(interp, "Integer"))) { - const INTVAL i = VTABLE_get_integer(interp, key); - SELF.set_number_keyed_int(i, value); + if (VTABLE_isa(INTERP, key, CONST_STRING(INTERP, "Integer"))) { + const INTVAL i = VTABLE_get_integer(INTERP, key); + SELF.set_number_keyed_int(i, value); } else { STRING *s = VTABLE_get_string(INTERP, key); - SELF.set_number_keyed_str(s, value); + SELF.set_number_keyed_str(s, value); } } @@ -605,18 +605,18 @@ SET_ATTR_im(INTERP, SELF, value); } else - Parrot_ex_throw_from_c_args(interp, NULL, + Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION, "Complex: key is neither 'real' or 'imag'"); } VTABLE void set_pmc_keyed(PMC *key, PMC *value) { const FLOATVAL f = VTABLE_get_number(INTERP, value); - SELF.set_number_keyed(key, f); + SELF.set_number_keyed(key, f); } VTABLE void set_pmc_keyed_str(STRING *key, PMC *value) { const FLOATVAL f = VTABLE_get_number(INTERP, value); - SELF.set_number_keyed_str(key, f); + SELF.set_number_keyed_str(key, f); } /* @@ -662,7 +662,7 @@ } VTABLE PMC *add_int(INTVAL value, PMC *dest) { - return SELF.add_float((FLOATVAL)value, dest); + return SELF.add_float((FLOATVAL)value, dest); } VTABLE PMC *add_float(FLOATVAL value, PMC *dest) { @@ -698,7 +698,7 @@ } VTABLE void i_add_int(INTVAL value) { - SELF.i_add_float((FLOATVAL)value); + SELF.i_add_float((FLOATVAL)value); } VTABLE void i_add_float(FLOATVAL value) { @@ -751,7 +751,7 @@ } VTABLE PMC *subtract_int(INTVAL value, PMC *dest) { - return SELF.subtract_float((FLOATVAL)value, dest); + return SELF.subtract_float((FLOATVAL)value, dest); } VTABLE PMC *subtract_float(FLOATVAL value, PMC *dest) { @@ -787,7 +787,7 @@ } VTABLE void i_subtract_int(INTVAL value) { - SELF.i_subtract_float((FLOATVAL) value); + SELF.i_subtract_float((FLOATVAL) value); } VTABLE void i_subtract_float(FLOATVAL value) { @@ -852,7 +852,7 @@ } VTABLE PMC *multiply_int(INTVAL value, PMC *dest) { - return SELF.multiply_float((FLOATVAL) value, dest); + return SELF.multiply_float((FLOATVAL) value, dest); } VTABLE PMC *multiply_float(FLOATVAL value, PMC *dest) { @@ -1799,13 +1799,13 @@ dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); - Parrot_pcc_invoke_method_from_c_args(interp, SELF, CONST_STRING(interp, "ln"), + Parrot_pcc_invoke_method_from_c_args(INTERP, SELF, CONST_STRING(INTERP, "ln"), "->P", &log); l = Parrot_Complex_multi_multiply_Complex_PMC(INTERP, log, value, l); - Parrot_pcc_invoke_method_from_c_args(interp, l, CONST_STRING(interp, "exp"), + Parrot_pcc_invoke_method_from_c_args(INTERP, l, CONST_STRING(INTERP, "exp"), "->P", &dest); return dest; @@ -1817,10 +1817,10 @@ dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); - Parrot_pcc_invoke_method_from_c_args(interp, SELF, CONST_STRING(interp, "ln"), + Parrot_pcc_invoke_method_from_c_args(INTERP, SELF, CONST_STRING(INTERP, "ln"), "->P", &log); l = Parrot_Complex_multi_multiply_DEFAULT_PMC(INTERP, log, value, l); - Parrot_pcc_invoke_method_from_c_args(interp, l, CONST_STRING(interp, "exp"), + Parrot_pcc_invoke_method_from_c_args(INTERP, l, CONST_STRING(INTERP, "exp"), "->P", &dest); return dest;