Author: petdance
Date: Sat Jun 9 17:28:49 2007
New Revision: 18898
Modified:
trunk/src/pmc/timer.pmc
Log:
internal consting
Modified: trunk/src/pmc/timer.pmc
==============================================================================
--- trunk/src/pmc/timer.pmc (original)
+++ trunk/src/pmc/timer.pmc Sat Jun 9 17:28:49 2007
@@ -84,7 +84,7 @@
static void
add_timer(Interp* interp, PMC *pmc)
{
- parrot_timer_event *t = (parrot_timer_event *)PMC_struct_val(pmc);
+ const parrot_timer_event * const t = (parrot_timer_event
*)PMC_struct_val(pmc);
if (!PMC_IS_NULL(t->sub))
Parrot_new_timer_event(interp, pmc, t->abs_time,
@@ -126,7 +126,7 @@
* t->abs_time actually is relative, its converted to an
* absolute time, when the timer is started
*/
- parrot_timer_event *t = mem_allocate_zeroed_typed(parrot_timer_event);
+ parrot_timer_event * const t =
mem_allocate_zeroed_typed(parrot_timer_event);
PMC_struct_val(SELF) = t;
PObj_active_destroy_SET(SELF);
++INTERP->arena_base->num_early_DOD_PMCs;
@@ -143,33 +143,33 @@
*/
void init_pmc(PMC *init) {
- INTVAL n = VTABLE_get_integer(INTERP, init);
+ const INTVAL n = VTABLE_get_integer(INTERP, init);
INTVAL i;
- INTVAL val;
- FLOATVAL nval;
- PMC *pval;
SELF.init();
for (i = 0; i < n; i += 2) {
- INTVAL key = VTABLE_get_integer_keyed_int(INTERP, init, i);
+ const INTVAL key = VTABLE_get_integer_keyed_int(INTERP, init, i);
switch (key) {
case PARROT_TIMER_SEC:
case PARROT_TIMER_USEC:
case PARROT_TIMER_REPEAT:
case PARROT_TIMER_RUNNING:
- val =
- VTABLE_get_integer_keyed_int(INTERP, init, i+1);
+ {
+ const INTVAL val = VTABLE_get_integer_keyed_int(INTERP,
init, i+1);
SELF.set_integer_keyed_int(key, val);
+ }
break;
case PARROT_TIMER_NSEC:
- nval =
- VTABLE_get_number_keyed_int(INTERP, init, i+1);
+ {
+ const FLOATVAL nval = VTABLE_get_number_keyed_int(INTERP,
init, i+1);
SELF.set_number_keyed_int(key, nval);
+ }
break;
case PARROT_TIMER_HANDLER:
- pval =
- VTABLE_get_pmc_keyed_int(INTERP, init, i+1);
+ {
+ PMC * const pval = VTABLE_get_pmc_keyed_int(INTERP, init,
i+1);
SELF.set_pmc_keyed_int(key, pval);
+ }
break;
}
}