Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
consted pointers
  • Loading branch information
petdance committed Apr 14, 2011
1 parent b63fa28 commit 5ac05ef
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/ops/perl6.ops
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2008-2010, The Perl Foundation.
* Copyright (C) 2008-2011, The Perl Foundation.
*/

BEGIN_OPS_PREAMBLE
Expand Down Expand Up @@ -291,7 +291,7 @@ inline op x_is_uprop(out INT, in STR, in STR, in INT) :base_core {
"Unicode property '%Ss' not found", $2);
goto ADDRESS(handler);
#else
opcode_t *handler = Parrot_ex_throw_from_op_args(interp, NULL,
opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, NULL,
EXCEPTION_ICU_ERROR,
"ICU not loaded", $2);
goto ADDRESS(handler);
Expand Down Expand Up @@ -357,7 +357,7 @@ inline op transform_to_p6opaque(inout PMC) :base_core {
goto NEXT();
}
else {
opcode_t *handler = Parrot_ex_throw_from_op_args(interp, NULL,
opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, NULL,
EXCEPTION_INVALID_OPERATION, "Can only transform an Object to p6opaque");
goto ADDRESS(handler);
}
Expand Down Expand Up @@ -459,7 +459,7 @@ inline op get_llsig_size(out INT, in PMC) :base_core {
goto NEXT();
}
else {
opcode_t *handler = Parrot_ex_throw_from_op_args(interp, NULL,
opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, NULL,
EXCEPTION_INVALID_OPERATION, "get_llsig_size only works on P6LowLevelSig PMCs");
goto ADDRESS(handler);
}
Expand Down Expand Up @@ -496,7 +496,7 @@ inline op set_llsig_elem(in PMC, in INT, in STR, in INT, inout PMC, inout PMC, i
GETATTR_P6LowLevelSig_num_elements(interp, $1, num_elements);
if ($2 < num_elements) {
/* Set up sig. */
struct llsig_element *element = elements[$2];
struct llsig_element * const element = elements[$2];
element->variable_name = $3;
element->flags = $4;
element->post_constraints = $6;
Expand Down Expand Up @@ -529,13 +529,13 @@ inline op set_llsig_elem(in PMC, in INT, in STR, in INT, inout PMC, inout PMC, i
goto NEXT();
}
else {
opcode_t *handler = Parrot_ex_throw_from_op_args(interp, NULL,
opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, NULL,
EXCEPTION_INVALID_OPERATION, "signature element out of range in set_llsig_elem");
goto ADDRESS(handler);
}
}
else {
opcode_t *handler = Parrot_ex_throw_from_op_args(interp, NULL,
opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, NULL,
EXCEPTION_INVALID_OPERATION, "set_llsig_elem only works on P6LowLevelSig PMCs");
goto ADDRESS(handler);
}
Expand Down Expand Up @@ -571,7 +571,7 @@ inline op get_llsig_elem(in PMC, in INT, out STR, out INT, out PMC, out PMC, out
GETATTR_P6LowLevelSig_elements(interp, $1, elements);
GETATTR_P6LowLevelSig_num_elements(interp, $1, num_elements);
if ($2 < num_elements) {
struct llsig_element *element = elements[$2];
struct llsig_element * const element = elements[$2];
$3 = element->variable_name;
$4 = element->flags;
$5 = element->nominal_type;
Expand All @@ -584,13 +584,13 @@ inline op get_llsig_elem(in PMC, in INT, out STR, out INT, out PMC, out PMC, out
goto NEXT();
}
else {
opcode_t *handler = Parrot_ex_throw_from_op_args(interp, NULL,
opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, NULL,
EXCEPTION_INVALID_OPERATION, "signature element out of range in set_llsig_elem");
goto ADDRESS(handler);
}
}
else {
opcode_t *handler = Parrot_ex_throw_from_op_args(interp, NULL,
opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, NULL,
EXCEPTION_INVALID_OPERATION, "get_llsig_elem only works on P6LowLevelSig PMCs");
goto ADDRESS(handler);
}
Expand All @@ -610,19 +610,19 @@ refactors are complete, it will take one argument - the CallContext.

*/
inline op bind_llsig(in PMC) :base_core {
PMC *ctx = CURRENT_CONTEXT(interp);
PMC * const ctx = CURRENT_CONTEXT(interp);

/* If we aren't already bound, enter the appropriate binder. */
if (!PObj_flag_TEST(P6S_ALREADY_BOUND, ctx)) {
PMC *lexpad = Parrot_pcc_get_lex_pad(interp, ctx);
PMC *sub = Parrot_pcc_get_sub(interp, ctx);
PMC *llsig = VTABLE_getprop(interp, sub, LLSIG_ATTR_str);
INTVAL noms_checked = PObj_flag_TEST(P6S_ALREADY_CHECKED, ctx);
PMC * const lexpad = Parrot_pcc_get_lex_pad(interp, ctx);
PMC * const sub = Parrot_pcc_get_sub(interp, ctx);
PMC * const llsig = VTABLE_getprop(interp, sub, LLSIG_ATTR_str);
const INTVAL noms_checked = PObj_flag_TEST(P6S_ALREADY_CHECKED, ctx);
STRING *error = NULL;
INTVAL bind_error;

/* Need to make sure some stuff doesn't get destroyed. */
PMC * ctx = CURRENT_CONTEXT(interp);
PMC * const ctx = CURRENT_CONTEXT(interp); /* XXX This ctx shadows the outer one. */
PMC * const saved_ccont = interp->current_cont;
PMC * const saved_sig = Parrot_pcc_get_signature(interp, ctx);
opcode_t * const current_pc = Parrot_pcc_get_pc(interp, ctx);
Expand Down Expand Up @@ -668,7 +668,7 @@ inline op bind_llsig(in PMC) :base_core {
}
else {
/* Nope, just normal fail... */
opcode_t *handler = Parrot_ex_throw_from_op_args(interp, NULL,
opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, NULL,
EXCEPTION_INVALID_OPERATION, "%Ss", error);
goto ADDRESS(handler);
}
Expand Down Expand Up @@ -719,13 +719,13 @@ inline op find_method_null_ok(out PMC, in PMC, in STR) :base_core {

*/
inline op fixup_outer_ctx(inout PMC) :base_core {
PMC *cur_ctx = CURRENT_CONTEXT(interp);
PMC * const cur_ctx = CURRENT_CONTEXT(interp);
if ($1->vtable->base_type == enum_class_CallContext) {
Parrot_pcc_set_outer_ctx(interp, $1, cur_ctx);
goto NEXT();
}
else {
opcode_t *handler = Parrot_ex_throw_from_op_args(interp, NULL,
opcode_t * const handler = Parrot_ex_throw_from_op_args(interp, NULL,
EXCEPTION_INVALID_OPERATION, "fixup_outer_ctx only valid on a context");
goto ADDRESS(handler);
}
Expand Down

0 comments on commit 5ac05ef

Please sign in to comment.