Index: src/pmc_freeze.c =================================================================== --- src/pmc_freeze.c (revision 36986) +++ src/pmc_freeze.c (working copy) @@ -132,13 +132,15 @@ __attribute__nonnull__(1) __attribute__nonnull__(2); -static void push_ascii_integer(PARROT_INTERP, ARGIN(IMAGE_IO *io), INTVAL v) +static void push_ascii_integer(PARROT_INTERP, + ARGIN(IMAGE_IO *io), + const INTVAL v) __attribute__nonnull__(1) __attribute__nonnull__(2); static void push_ascii_number(PARROT_INTERP, ARGIN(const IMAGE_IO *io), - FLOATVAL v) + const FLOATVAL v) __attribute__nonnull__(1) __attribute__nonnull__(2); @@ -158,26 +160,26 @@ static void push_opcode_integer(PARROT_INTERP, ARGIN(IMAGE_IO *io), - INTVAL v) + const INTVAL v) __attribute__nonnull__(1) __attribute__nonnull__(2); static void push_opcode_number(PARROT_INTERP, ARGIN(IMAGE_IO *io), - FLOATVAL v) + const FLOATVAL v) __attribute__nonnull__(1) __attribute__nonnull__(2); static void push_opcode_pmc(PARROT_INTERP, ARGIN(IMAGE_IO *io), - ARGIN(PMC* v)) + ARGIN(const PMC* v)) __attribute__nonnull__(1) __attribute__nonnull__(2) __attribute__nonnull__(3); static void push_opcode_string(PARROT_INTERP, ARGIN(IMAGE_IO *io), - ARGIN(STRING *v)) + ARGIN(const STRING *v)) __attribute__nonnull__(1) __attribute__nonnull__(2) __attribute__nonnull__(3); @@ -436,7 +438,7 @@ /* HEADERIZER END: static */ /* - * define this to 1 for testing. TODO: 1 is broken. + * define this to 1 for testing. TODO TT #375: 1 is broken. */ #ifndef FREEZE_ASCII # define FREEZE_ASCII 0 @@ -510,7 +512,7 @@ */ static void -push_ascii_integer(PARROT_INTERP, ARGIN(IMAGE_IO *io), INTVAL v) +push_ascii_integer(PARROT_INTERP, ARGIN(IMAGE_IO *io), const INTVAL v) { ASSERT_ARGS(push_ascii_integer) char buffer[20]; @@ -530,7 +532,7 @@ */ static void -push_ascii_number(PARROT_INTERP, ARGIN(const IMAGE_IO *io), FLOATVAL v) +push_ascii_number(PARROT_INTERP, ARGIN(const IMAGE_IO *io), const FLOATVAL v) { ASSERT_ARGS(push_ascii_number) char buffer[40]; @@ -558,7 +560,7 @@ { ASSERT_ARGS(push_ascii_string) const UINTVAL length = Parrot_str_byte_length(interp, s); - char * const buffer = (char *)malloc(4*length); /* XXX Why 4? What does that mean? */ + char * const buffer = (char *)malloc(OPCODE_T_SIZE*length); char *cursor = buffer; UINTVAL idx = 0; @@ -777,7 +779,7 @@ */ static void -push_opcode_integer(PARROT_INTERP, ARGIN(IMAGE_IO *io), INTVAL v) +push_opcode_integer(PARROT_INTERP, ARGIN(IMAGE_IO *io), const INTVAL v) { ASSERT_ARGS(push_opcode_integer) PARROT_ASSERT(sizeof (opcode_t) == sizeof (INTVAL)); @@ -795,7 +797,7 @@ */ static void -push_opcode_number(PARROT_INTERP, ARGIN(IMAGE_IO *io), FLOATVAL v) +push_opcode_number(PARROT_INTERP, ARGIN(IMAGE_IO *io), const FLOATVAL v) { ASSERT_ARGS(push_opcode_number) const size_t len = PF_size_number() * sizeof (opcode_t); @@ -822,7 +824,7 @@ */ static void -push_opcode_string(PARROT_INTERP, ARGIN(IMAGE_IO *io), ARGIN(STRING *v)) +push_opcode_string(PARROT_INTERP, ARGIN(IMAGE_IO *io), ARGIN(const STRING *v)) { ASSERT_ARGS(push_opcode_string) const size_t len = PF_size_string(v) * sizeof (opcode_t); @@ -849,7 +851,7 @@ */ static void -push_opcode_pmc(PARROT_INTERP, ARGIN(IMAGE_IO *io), ARGIN(PMC* v)) +push_opcode_pmc(PARROT_INTERP, ARGIN(IMAGE_IO *io), ARGIN(const PMC* v)) { ASSERT_ARGS(push_opcode_pmc) op_append(interp, io->image, (opcode_t)v, sizeof (opcode_t)); Index: include/parrot/pmc_freeze.h =================================================================== --- include/parrot/pmc_freeze.h (revision 36906) +++ include/parrot/pmc_freeze.h (working copy) @@ -28,10 +28,10 @@ struct _image_io; #define IMAGE_IO struct _image_io -typedef void (*push_integer_f) (PARROT_INTERP, IMAGE_IO*, INTVAL); -typedef void (*push_pmc_f) (PARROT_INTERP, IMAGE_IO*, PMC*); -typedef void (*push_string_f) (PARROT_INTERP, IMAGE_IO*, STRING*); -typedef void (*push_number_f) (PARROT_INTERP, IMAGE_IO*, FLOATVAL); +typedef void (*push_integer_f) (PARROT_INTERP, IMAGE_IO*, const INTVAL); +typedef void (*push_pmc_f) (PARROT_INTERP, IMAGE_IO*, const PMC*); +typedef void (*push_string_f) (PARROT_INTERP, IMAGE_IO*, const STRING*); +typedef void (*push_number_f) (PARROT_INTERP, IMAGE_IO*, const FLOATVAL); typedef INTVAL (*shift_integer_f) (PARROT_INTERP, IMAGE_IO*); typedef PMC* (*shift_pmc_f) (PARROT_INTERP, IMAGE_IO*); typedef STRING* (*shift_string_f) (PARROT_INTERP, IMAGE_IO*);