Skip to content

Commit

Permalink
consting args. Flag unsued args. Add an XXX where we are not setting …
Browse files Browse the repository at this point in the history
…an outbound pointer.
  • Loading branch information
petdance committed Apr 20, 2011
1 parent a9a87f1 commit 71ed521
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/embed.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -454,6 +454,9 @@ Parrot_load_bytecode_file(PARROT_INTERP, ARGIN(const char *filename))
return 0; return 0;
Parrot_pf_set_current_packfile(interp, pf); Parrot_pf_set_current_packfile(interp, pf);
return 1; return 1;
#else
UNUSED(interp);
UNUSED(filename);
#endif #endif
return 0; return 0;
} }
Expand Down Expand Up @@ -576,7 +579,7 @@ set_current_sub(PARROT_INTERP)
*/ */


for (i = 0; i < ct->pmc.const_count; i++) { for (i = 0; i < ct->pmc.const_count; i++) {
PMC *sub_pmc = ct->pmc.constants[i]; PMC * const sub_pmc = ct->pmc.constants[i];
if (VTABLE_isa(interp, sub_pmc, SUB)) { if (VTABLE_isa(interp, sub_pmc, SUB)) {
Parrot_Sub_attributes *sub; Parrot_Sub_attributes *sub;


Expand Down Expand Up @@ -730,7 +733,7 @@ print_constant_table(PARROT_INTERP, ARGIN(PMC *output))
Parrot_io_fprintf(interp, output, "STR_CONST(%d): %S\n", i, ct->str.constants[i]); Parrot_io_fprintf(interp, output, "STR_CONST(%d): %S\n", i, ct->str.constants[i]);


for (i = 0; i < ct->pmc.const_count; i++) { for (i = 0; i < ct->pmc.const_count; i++) {
PMC *c = ct->pmc.constants[i]; PMC * const c = ct->pmc.constants[i];
Parrot_io_fprintf(interp, output, "PMC_CONST(%d): ", i); Parrot_io_fprintf(interp, output, "PMC_CONST(%d): ", i);


switch (c->vtable->base_type) { switch (c->vtable->base_type) {
Expand Down Expand Up @@ -906,22 +909,25 @@ Parrot_compile_string(PARROT_INTERP, Parrot_String type, ARGIN(const char *code)
ARGOUT(Parrot_String *error)) ARGOUT(Parrot_String *error))
{ {
ASSERT_ARGS(Parrot_compile_string) ASSERT_ARGS(Parrot_compile_string)
PMC * compiler = Parrot_get_compiler(interp, type); PMC * const compiler = Parrot_get_compiler(interp, type);


/* XXX error is not being set */
if (PMC_IS_NULL(compiler)) { if (PMC_IS_NULL(compiler)) {
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL, Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL,
"Could not find compiler %Ss", type); "Could not find compiler %Ss", type);
} }
else { else {
PMC *result;
STRING * const code_s = Parrot_str_new(interp, code, 0); STRING * const code_s = Parrot_str_new(interp, code, 0);
PMC * result = PMCNULL; imc_info_t * imcc = (imc_info_t*) VTABLE_get_pointer(interp, compiler);
imc_info_t * imcc = (imc_info_t*) VTABLE_get_pointer(interp, compiler); const INTVAL is_pasm = VTABLE_get_integer(interp, compiler);
INTVAL is_pasm = VTABLE_get_integer(interp, compiler);
Parrot_block_GC_mark(interp); Parrot_block_GC_mark(interp);
result = imcc_compile_string(imcc, code_s, is_pasm); result = imcc_compile_string(imcc, code_s, is_pasm);
if (PMC_IS_NULL(result)) { if (PMC_IS_NULL(result)) {
STRING * const msg = imcc_last_error_message(imcc); STRING * const msg = imcc_last_error_message(imcc);
INTVAL code = imcc_last_error_code(imcc); const INTVAL code = imcc_last_error_code(imcc);

Parrot_unblock_GC_mark(interp); Parrot_unblock_GC_mark(interp);
Parrot_ex_throw_from_c_args(interp, NULL, code, "%Ss", msg); Parrot_ex_throw_from_c_args(interp, NULL, code, "%Ss", msg);
} }
Expand Down

0 comments on commit 71ed521

Please sign in to comment.