Author: petdance
Date: Wed Jun 6 17:26:48 2007
New Revision: 18850
Modified:
trunk/src/pmc/lexpad.pmc
trunk/src/pmc/multisub.pmc
Log:
internal auto variable consting
Modified: trunk/src/pmc/lexpad.pmc
==============================================================================
--- trunk/src/pmc/lexpad.pmc (original)
+++ trunk/src/pmc/lexpad.pmc Wed Jun 6 17:26:48 2007
@@ -92,21 +92,21 @@
}
INTVAL exists_keyed_str(STRING* name) {
- PMC *info = PMC_pmc_val(SELF);
+ PMC * const info = PMC_pmc_val(SELF);
return parrot_hash_get_bucket(INTERP,
(Hash*) PMC_struct_val(info), name) != 0;
}
INTVAL exists_keyed(PMC *name) {
- STRING *s = key_string(INTERP, name);
+ STRING * const s = key_string(INTERP, name);
return SELF.exists_keyed_str(s);
}
PMC* get_pmc_keyed_str(STRING* name) {
- PMC *info = PMC_pmc_val(SELF);
- Hash *hash = (Hash *)PMC_struct_val(info);
- parrot_context_t *ctx = (parrot_context_t *)PMC_struct_val(SELF);
- HashBucket *b = parrot_hash_get_bucket(INTERP, hash, name);
+ PMC * const info = PMC_pmc_val(SELF);
+ Hash * const hash = (Hash *)PMC_struct_val(info);
+ parrot_context_t * const ctx = (parrot_context_t
*)PMC_struct_val(SELF);
+ HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
name);
INTVAL regno;
if (!b)
@@ -118,15 +118,15 @@
}
PMC* get_pmc_keyed(PMC *name) {
- STRING *s = key_string(INTERP, name);
+ STRING * const s = key_string(INTERP, name);
return SELF.get_pmc_keyed_str(s);
}
void set_pmc_keyed_str(STRING *name, PMC *value) {
- PMC *info = PMC_pmc_val(SELF);
- Hash *hash = (Hash *)PMC_struct_val(info);
- parrot_context_t *ctx = (parrot_context_t *)PMC_struct_val(SELF);
- HashBucket *b = parrot_hash_get_bucket(INTERP, hash, name);
+ PMC * const info = PMC_pmc_val(SELF);
+ Hash * const hash = (Hash *)PMC_struct_val(info);
+ parrot_context_t * const ctx = (parrot_context_t
*)PMC_struct_val(SELF);
+ HashBucket * const b = parrot_hash_get_bucket(INTERP, hash,
name);
INTVAL regno;
if (!b)
@@ -138,7 +138,7 @@
}
void set_pmc_keyed(PMC *name, PMC *value) {
- STRING *s = key_string(INTERP, name);
+ STRING * const s = key_string(INTERP, name);
SELF.set_pmc_keyed_str(s, value);
}
Modified: trunk/src/pmc/multisub.pmc
==============================================================================
--- trunk/src/pmc/multisub.pmc (original)
+++ trunk/src/pmc/multisub.pmc Wed Jun 6 17:26:48 2007
@@ -25,8 +25,8 @@
pmclass MultiSub extends ResizablePMCArray need_ext does array {
void push_pmc(PMC* value) {
- STRING *_sub = CONST_STRING(interp, "Sub");
- STRING *_nci = CONST_STRING(interp, "NCI");
+ STRING * const _sub = CONST_STRING(interp, "Sub");
+ STRING * const _nci = CONST_STRING(interp, "NCI");
if (!VTABLE_isa(interp, value, _sub) &&
!VTABLE_isa(interp, value, _nci))
real_exception(interp, NULL, E_TypeError,
@@ -58,10 +58,11 @@
}
opcode_t* invoke(void *next) {
- PMC *list = Parrot_mmd_sort_candidate_list(interp, SELF);
- PMC *func = PMCNULL;
- if (!PMC_IS_NULL(list))
- func = VTABLE_get_pmc_keyed_int(interp, list, 0);
+ PMC * const list = Parrot_mmd_sort_candidate_list(interp, SELF);
+ PMC * const func =
+ PMC_IS_NULL(list)
+ ? PMCNULL
+ : VTABLE_get_pmc_keyed_int(interp, list, 0);
return VTABLE_invoke(INTERP, func, next);
}
}