Author: petdance
Date: Fri Jun 1 21:20:03 2007
New Revision: 18760
Modified:
trunk/src/pmc/smop_class.pmc
Log:
Rmeoved unused auto vars. Consted a few other vars.
Modified: trunk/src/pmc/smop_class.pmc
==============================================================================
--- trunk/src/pmc/smop_class.pmc (original)
+++ trunk/src/pmc/smop_class.pmc Fri Jun 1 21:20:03 2007
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2001-2005, The Perl Foundation.
+Copyright (C) 2001-2007, The Perl Foundation.
$Id$
=head1 NAME
@@ -68,8 +68,9 @@
"attributes", "methods", "superclasses" };
for (i=0; i<6; i++) {
- PMC* attribute = pmc_new(interp, enum_class_SMOP_Attribute);
- STRING *attrib_name = string_from_const_cstring(interp,
attribute_names[i], 0);
+ PMC* const attribute = pmc_new(interp,
enum_class_SMOP_Attribute);
+ STRING * const attrib_name = string_from_const_cstring(interp,
attribute_names[i], 0);
+
PCCINVOKE(interp, attribute, "name", STRING* attrib_name);
PCCINVOKE(interp, attribute, "class", PMC* _class);
VTABLE_push_pmc(interp, attributes, attribute);
@@ -111,14 +112,14 @@
void init_pmc(PMC* args) {
int i;
- int n = VTABLE_elements(interp, args);
+ const int n = VTABLE_elements(interp, args);
SELF.init();
/* invoke accessor for each constructor arg in args */
for (i=0; i<n; i++); {
- PMC *key = VTABLE_get_pmc_keyed_int(interp, args, i);
- PMC *value = VTABLE_get_pmc_keyed(interp, args, key);
+ PMC * const key = VTABLE_get_pmc_keyed_int(interp, args, i);
+ PMC * const value = VTABLE_get_pmc_keyed(interp, args, key);
VTABLE_invoke(interp, key, value);
}
}
@@ -162,11 +163,11 @@
STRING *attributes_string = string_from_const_cstring(interp,
"add_attribute", 0);
if (got_attribs) {
int i;
- int n = VTABLE_elements(interp, attribs);
+ const int n = VTABLE_elements(interp, attribs);
for (i=0; i<n; i++); {
- PMC *key = VTABLE_get_pmc_keyed_int(interp, attribs, i);
- PMC *value = VTABLE_get_pmc_keyed(interp, attribs, key);
+ PMC * const key = VTABLE_get_pmc_keyed_int(interp, attribs, i);
+ PMC * const value = VTABLE_get_pmc_keyed(interp, attribs, key);
PCCINVOKE(interp, pmc, method_name, PMC* key, PMC* value);
}
}
@@ -176,10 +177,6 @@
PCCMETHOD void add_attribute(STRING *attribute_name,
STRING* attribute_type :optional, int got_type :opt_flag) {
- PMC *attributes;
- PMC *new_attribute = pmc_new(interp, pmc_type(interp,
- string_from_const_cstring(interp, "SMOP_Attribute", 0)));
-
PCCINVOKE(interp, pmc, "name", STRING* attribute_name);
PCCINVOKE(interp, SELF, "class", PMC* SELF);
@@ -199,14 +196,10 @@
}
METHOD void set_meta_attribute(STRING* attribute_name, PMC *value) {
- SMOP_Class *smop = SMOP(SELF);
- PMC* attributes = SMOP(SELF)->attributes;
VTABLE_set_pmc_keyed_str(interp, pmc, attribute_name, pmc);
}
METHOD PMC* get_meta_attribute(STRING* attribute_name) {
- SMOP_Class *smop = SMOP(SELF);
- PMC* attributes = SMOP(SELF)->attributes;
return VTABLE_get_pmc_keyed_str(interp, pmc, attribute_name);
}
}