@@ -34,7 +34,6 @@ static INTVAL initialized = 0;
34
34
static INTVAL stable_id = 0;
35
35
static INTVAL smo_id = 0;
36
36
static INTVAL disp_id = 0;
37
- static INTVAL qrpa_id = 0;
38
37
static INTVAL ohash_id = 0;
39
38
40
39
/* Built-in meta-objects. */
@@ -60,7 +59,7 @@ static PMC *empty_hash = NULL;
60
59
/* SC write barrier for objects. */
61
60
static void SC_write_barrier_obj(PARROT_INTERP, PMC *obj) {
62
61
if (!sc_write_barrier_off_depth && VTABLE_get_bool(interp, compiling_scs)) {
63
- PMC *comp_sc = VTABLE_get_pmc_keyed_int(interp, compiling_scs, 0);
62
+ const PMC *comp_sc = VTABLE_get_pmc_keyed_int(interp, compiling_scs, 0);
64
63
if (SC_PMC(obj) != comp_sc) {
65
64
SC_repossess_object(interp, comp_sc, SC_PMC(obj), obj);
66
65
SC_PMC(obj) = comp_sc;
@@ -73,7 +72,7 @@ static void SC_write_barrier_obj(PARROT_INTERP, PMC *obj) {
73
72
/* SC write barrier for STables. */
74
73
static void SC_write_barrier_st(PARROT_INTERP, STable *st) {
75
74
if (!sc_write_barrier_off_depth && VTABLE_get_bool(interp, compiling_scs)) {
76
- PMC *comp_sc = VTABLE_get_pmc_keyed_int(interp, compiling_scs, 0);
75
+ const PMC *comp_sc = VTABLE_get_pmc_keyed_int(interp, compiling_scs, 0);
77
76
if (st->sc != comp_sc) {
78
77
SC_repossess_stable(interp, comp_sc, st->sc, st->stable_pmc);
79
78
st->sc = comp_sc;
@@ -83,18 +82,18 @@ static void SC_write_barrier_st(PARROT_INTERP, STable *st) {
83
82
}
84
83
}
85
84
86
- /* Test for something being a list (RPA or QRPA ). */
85
+ /* Test for something being a list (ResizablePMCArray or ResizableStringArray ). */
87
86
static INTVAL
88
87
nqp_islist(PMC *pmc) {
89
- INTVAL type = pmc->vtable->base_type;
90
- return (INTVAL)(type == qrpa_id || type == enum_class_ResizablePMCArray
91
- || type == enum_class_ResizableStringArray);
88
+ const INTVAL type = pmc->vtable->base_type;
89
+ return (INTVAL)(type == enum_class_ResizablePMCArray
90
+ || type == enum_class_ResizableStringArray);
92
91
}
93
92
94
93
/* Test for something being a hash. */
95
94
static INTVAL
96
95
nqp_ishash(PMC *pmc) {
97
- INTVAL type = pmc->vtable->base_type;
96
+ const INTVAL type = pmc->vtable->base_type;
98
97
return (INTVAL)(type == enum_class_Hash || type == ohash_id);
99
98
}
100
99
@@ -136,14 +135,14 @@ revquicksort(INTVAL *arr, INTVAL elements) {
136
135
137
136
/* Does a run of the NFA. Produces a list of integers indicating the
138
137
* chosen ordering. */
139
- static INTVAL * nqp_nfa_run(PARROT_INTERP, NFABody *nfa, STRING *target, INTVAL offset, INTVAL *total_fates_out) {
140
- INTVAL eos = Parrot_str_length(interp, target);
138
+ static const INTVAL * nqp_nfa_run(PARROT_INTERP, NFABody *nfa, STRING *target, INTVAL offset, INTVAL *total_fates_out) {
139
+ const INTVAL eos = Parrot_str_length(interp, target);
141
140
INTVAL gen = 1;
142
141
INTVAL numcur = 0;
143
142
INTVAL numnext = 0;
144
143
INTVAL *done, *fates, *curst, *nextst, *longlit;
145
144
INTVAL i, fate_arr_len, num_states, total_fates, prev_fates, usedlonglit;
146
- INTVAL orig_offset = offset;
145
+ const INTVAL orig_offset = offset;
147
146
148
147
/* Allocate "done states", "current states" and "next states" arrays. */
149
148
num_states = nfa->num_states;
@@ -978,7 +977,6 @@ inline op nqp_dynop_setup() :base_core {
978
977
/* Look up and cache some type IDs. */
979
978
stable_id = Parrot_pmc_get_type_str(interp, Parrot_str_new(interp, "STable", 0));
980
979
smo_id = Parrot_pmc_get_type_str(interp, Parrot_str_new(interp, "SixModelObject", 0));
981
- qrpa_id = Parrot_pmc_get_type_str(interp, Parrot_str_new(interp, "QRPA", 0));
982
980
ohash_id = Parrot_pmc_get_type_str(interp, Parrot_str_new(interp, "OwnedHash", 0));
983
981
984
982
/* Initialize the object model. */
@@ -2878,7 +2876,7 @@ inline op repr_hint_for(out INT, invar PMC, in STR) :base_core {
2878
2876
2879
2877
=item nqp_islist
2880
2878
2881
- Checks if the type of thing in $2 is a nqp list (either QRPA or RPA ).
2879
+ Checks if the type of thing in $2 is a nqp list (either ResizablePMCArray or ResizableStringArray ).
2882
2880
2883
2881
=cut
2884
2882
@@ -3278,7 +3276,7 @@ inline op nqp_push_label(invar PMC, in LABEL) :base_core {
3278
3276
inline op nqp_nfa_run_proto(out PMC, invar PMC, in STR, in INT) :base_core {
3279
3277
/* Run the NFA. */
3280
3278
INTVAL total_fates, i;
3281
- INTVAL *fates = nqp_nfa_run(interp, OBJECT_BODY($2), $3, $4, &total_fates);
3279
+ const INTVAL *fates = nqp_nfa_run(interp, (NFABody *) OBJECT_BODY($2), $3, $4, &total_fates);
3282
3280
3283
3281
/* Copy results into an RIA. */
3284
3282
PMC *fatepmc = Parrot_pmc_new(interp, enum_class_ResizableIntegerArray);
@@ -3299,7 +3297,7 @@ inline op nqp_nfa_run_alt(invar PMC, in STR, in INT, invar PMC, invar PMC, invar
3299
3297
3300
3298
/* Run the NFA. */
3301
3299
INTVAL total_fates, i;
3302
- INTVAL *fates = nqp_nfa_run(interp, OBJECT_BODY(nfa), target, offset, &total_fates);
3300
+ const INTVAL *fates = nqp_nfa_run(interp, (NFABody *) OBJECT_BODY(nfa), target, offset, &total_fates);
3303
3301
3304
3302
/* Push the results onto the bstack. */
3305
3303
INTVAL caps = VTABLE_defined(interp, cstack) ? VTABLE_elements(interp, cstack) : 0;
0 commit comments