Skip to content

Commit

Permalink
consting vars, and localized a work variable
Browse files Browse the repository at this point in the history
  • Loading branch information
petdance committed Feb 26, 2011
1 parent eb0ebb2 commit 2eba1cf
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/pmc/resizablepmcarray.pmc
Expand Up @@ -63,7 +63,7 @@ do_shift(ARGIN(PMC *arr))
{
ASSERT_ARGS(do_shift)
INTVAL size = PMC_size(arr);
PMC **item = PMC_array(arr);
PMC ** const item = PMC_array(arr);

PMC_size(arr) = --size;
mem_sys_memmove(item, item + 1, size * sizeof (PMC *));
Expand Down Expand Up @@ -146,12 +146,12 @@ Resizes the array to C<size> elements.
return;
}
else {
INTVAL i, cur, needed;
INTVAL i, cur;
i = cur = PMC_threshold(SELF);
if (cur < 8192)
cur = (size < 2 * cur) ? (2 * cur) : size;
else {
needed = size - cur;
const INTVAL needed = size - cur;
cur += needed + 4096;
cur &= ~0xfff;
}
Expand Down Expand Up @@ -191,7 +191,7 @@ TODO: Check whether there is already an element that can be shifted
*/

VTABLE FLOATVAL shift_float() {
INTVAL size = PMC_size(SELF);
const INTVAL size = PMC_size(SELF);
FLOATVAL value;

if (0 == size)
Expand All @@ -203,7 +203,7 @@ TODO: Check whether there is already an element that can be shifted
}

VTABLE INTVAL shift_integer() {
INTVAL size = PMC_size(SELF);
const INTVAL size = PMC_size(SELF);
INTVAL value;

if (0 == size)
Expand All @@ -215,7 +215,7 @@ TODO: Check whether there is already an element that can be shifted
}

VTABLE PMC *shift_pmc() {
INTVAL size = PMC_size(SELF);
const INTVAL size = PMC_size(SELF);
PMC *data;

if (0 == size)
Expand All @@ -227,7 +227,7 @@ TODO: Check whether there is already an element that can be shifted
}

VTABLE STRING *shift_string() {
INTVAL size = PMC_size(SELF);
const INTVAL size = PMC_size(SELF);
STRING *value;

if (0 == size)
Expand Down

0 comments on commit 2eba1cf

Please sign in to comment.