Permalink
Browse files

consting args. Flag unsued args. Add an XXX where we are not setting …

…an outbound pointer.
  • Loading branch information...
1 parent a9a87f1 commit 71ed52129ae75c2b69adb89d706e2363192a535a @petdance petdance committed Apr 20, 2011
Showing with 13 additions and 7 deletions.
  1. +13 −7 src/embed.c
View
@@ -454,6 +454,9 @@ Parrot_load_bytecode_file(PARROT_INTERP, ARGIN(const char *filename))
return 0;
Parrot_pf_set_current_packfile(interp, pf);
return 1;
+#else
+ UNUSED(interp);
+ UNUSED(filename);
#endif
return 0;
}
@@ -576,7 +579,7 @@ set_current_sub(PARROT_INTERP)
*/
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)) {
Parrot_Sub_attributes *sub;
@@ -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]);
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);
switch (c->vtable->base_type) {
@@ -906,22 +909,25 @@ Parrot_compile_string(PARROT_INTERP, Parrot_String type, ARGIN(const char *code)
ARGOUT(Parrot_String *error))
{
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)) {
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL,
"Could not find compiler %Ss", type);
}
else {
+ PMC *result;
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);
- INTVAL is_pasm = VTABLE_get_integer(interp, compiler);
+ imc_info_t * imcc = (imc_info_t*) VTABLE_get_pointer(interp, compiler);
+ const INTVAL is_pasm = VTABLE_get_integer(interp, compiler);
+
Parrot_block_GC_mark(interp);
result = imcc_compile_string(imcc, code_s, is_pasm);
if (PMC_IS_NULL(result)) {
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_ex_throw_from_c_args(interp, NULL, code, "%Ss", msg);
}

0 comments on commit 71ed521

Please sign in to comment.