[svn:parrot] r48305 - trunk/src/pmc
petdance at svn.parrot.org
petdance at svn.parrot.org
Wed Aug 4 04:25:57 UTC 2010
Author: petdance
Date: Wed Aug 4 04:25:56 2010
New Revision: 48305
URL: https://trac.parrot.org/parrot/changeset/48305
Log:
consting some pointers
Modified:
trunk/src/pmc/imageio.pmc
Modified: trunk/src/pmc/imageio.pmc
==============================================================================
--- trunk/src/pmc/imageio.pmc Wed Aug 4 01:10:10 2010 (r48304)
+++ trunk/src/pmc/imageio.pmc Wed Aug 4 04:25:56 2010 (r48305)
@@ -139,7 +139,7 @@
{
ASSERT_ARGS(SET_VISIT_CURSOR)
- const char *bufstart = (char *)Buffer_bufstart(PARROT_IMAGEIO(pmc)->buffer);
+ const char * const bufstart = (const char *)Buffer_bufstart(PARROT_IMAGEIO(pmc)->buffer);
PARROT_IMAGEIO(pmc)->pos = (cursor - bufstart);
}
@@ -181,9 +181,8 @@
Parrot_gc_new_bufferlike_header(interp, sizeof (Buffer));
Parrot_gc_allocate_buffer_storage_aligned(interp,
PARROT_IMAGEIO(info)->buffer, len);
-
SET_VISIT_CURSOR(info,
- (char *)Buffer_bufstart(PARROT_IMAGEIO(info)->buffer));
+ (const char *)Buffer_bufstart(PARROT_IMAGEIO(info)->buffer));
}
@@ -201,7 +200,7 @@
{
ASSERT_ARGS(ensure_buffer_size)
- Buffer *buf = PARROT_IMAGEIO(io)->buffer;
+ Buffer * const buf = PARROT_IMAGEIO(io)->buffer;
const size_t used = PARROT_IMAGEIO(io)->pos;
const int need_free = Buffer_buflen(buf) - used - len;
@@ -523,7 +522,7 @@
const size_t len = PF_size_integer() * sizeof (opcode_t);
ensure_buffer_size(INTERP, SELF, len);
SET_VISIT_CURSOR(SELF,
- (char *)PF_store_integer(GET_VISIT_CURSOR(SELF), v));
+ (const char *)PF_store_integer(GET_VISIT_CURSOR(SELF), v));
}
@@ -541,7 +540,7 @@
const size_t len = PF_size_number() * sizeof (opcode_t);
ensure_buffer_size(INTERP, SELF, len);
SET_VISIT_CURSOR(SELF,
- (char *)PF_store_number(GET_VISIT_CURSOR(SELF), &v));
+ (const char *)PF_store_number(GET_VISIT_CURSOR(SELF), &v));
}
@@ -558,9 +557,9 @@
VTABLE void push_string(STRING *v) {
if (PObj_flag_TEST(private1, SELF)) {
/* store a reference to constant table entry of string */
- PMC *v_pmc = key_new_string(interp, v);
- PackFile_ConstTable *table = PARROT_IMAGEIO(SELF)->pf_ct;
- int idx =
+ PMC * const v_pmc = key_new_string(interp, v);
+ PackFile_ConstTable * const table = PARROT_IMAGEIO(SELF)->pf_ct;
+ const int idx =
PackFile_ConstTable_rlookup(INTERP, table, v_pmc, PFC_STRING);
if (idx >= 0) {
@@ -582,7 +581,7 @@
const size_t len = PF_size_string(v) * sizeof (opcode_t);
ensure_buffer_size(INTERP, SELF, len);
SET_VISIT_CURSOR(SELF,
- (char *)PF_store_string(GET_VISIT_CURSOR(SELF), v));
+ (const char *)PF_store_string(GET_VISIT_CURSOR(SELF), v));
}
}
@@ -655,7 +654,7 @@
VTABLE FLOATVAL shift_float() {
const opcode_t *pos = GET_VISIT_CURSOR(SELF);
FLOATVAL f = PF_fetch_number(PARROT_IMAGEIO(SELF)->pf, &pos);
- SET_VISIT_CURSOR(SELF, (char *)pos);
+ SET_VISIT_CURSOR(SELF, (const char *)pos);
BYTECODE_SHIFT_OK(SELF);
return f;
}
@@ -692,10 +691,10 @@
}
{
- const opcode_t *pos = GET_VISIT_CURSOR(SELF);
- STRING *s = PF_fetch_string(INTERP,
+ const opcode_t * pos = GET_VISIT_CURSOR(SELF);
+ STRING * const s = PF_fetch_string(INTERP,
PARROT_IMAGEIO(SELF)->pf, &pos);
- SET_VISIT_CURSOR(SELF, (char *)pos);
+ SET_VISIT_CURSOR(SELF, (const char *)pos);
BYTECODE_SHIFT_OK(SELF);
return s;
}
@@ -749,7 +748,7 @@
PARROT_ASSERT(image->_bufstart == image->strstart);
SET_VISIT_CURSOR(SELF,
- (char *)Buffer_bufstart(PARROT_IMAGEIO(SELF)->buffer));
+ (const char *)Buffer_bufstart(PARROT_IMAGEIO(SELF)->buffer));
PARROT_IMAGEIO(SELF)->input_length = image->strlen;
PARROT_IMAGEIO(SELF)->pf->options |= PFOPT_PMC_FREEZE_ONLY;
More information about the parrot-commits
mailing list