Author: chromatic
Date: Wed Apr 18 12:13:32 2007
New Revision: 18279
Modified:
trunk/compilers/imcc/pbc.c
trunk/compilers/imcc/symreg.c
trunk/compilers/imcc/symreg.h
trunk/compilers/imcc/unit.h
trunk/config/auto/gcc.pm
trunk/src/debug.c
trunk/src/gc/gc_ims.c
trunk/src/pic.c
trunk/src/pmc/array.pmc
trunk/src/pmc/class.pmc
trunk/src/pmc/default.pmc
trunk/src/pmc/deleg_pmc.pmc
trunk/src/pmc/delegate.pmc
trunk/src/pmc/namespace.pmc
trunk/src/pmc/object.pmc
trunk/src/pmc/pair.pmc
trunk/src/pmc/parrotclass.pmc
trunk/src/pmc/parrotobject.pmc
trunk/src/pmc/role.pmc
trunk/src/pmc/scalar.pmc
trunk/src/pmc/smop_attribute.pmc
trunk/src/pmc/string.pmc
Log:
Clean up additional C++ keyword uses (Steve Peters, Mark Glines, RT #42602).
Modified: trunk/compilers/imcc/pbc.c
==============================================================================
--- trunk/compilers/imcc/pbc.c (original)
+++ trunk/compilers/imcc/pbc.c Wed Apr 18 12:13:32 2007
@@ -310,16 +310,16 @@
*pc = 0;
for (s = globals.cs->first; s; s = s->next) {
#if 0
- fprintf(stderr, "namespace %s\n", s->unit->namespace ?
- s->unit->namespace->name : "(null");
+ fprintf(stderr, "namespace %s\n", s->unit->_namespace ?
+ s->unit->_namespace->name : "(null");
#endif
r = s->unit->instructions->r[0];
/* if names and namespaces are matching - ok */
if (r && !strcmp(r->name, name) &&
- ((sym->unit->namespace && s->unit->namespace &&
- !strcmp(sym->unit->namespace->name,
- s->unit->namespace->name))
- || (!sym->unit->namespace && !s->unit->namespace))) {
+ ((sym->unit->_namespace && s->unit->_namespace &&
+ !strcmp(sym->unit->_namespace->name,
+ s->unit->_namespace->name))
+ || (!sym->unit->_namespace && !s->unit->_namespace))) {
return s;
}
*pc += s->size;
@@ -654,8 +654,8 @@
unit = globals.cs->subs->unit;
- if (unit->namespace) {
- ns = unit->namespace->reg;
+ if (unit->_namespace) {
+ ns = unit->_namespace->reg;
IMCC_debug(interp, DEBUG_PBC_CONST,
"name space const = %d ns name '%s'\n",
ns->color, ns->name);
@@ -950,7 +950,7 @@
make_pmc_const(Interp *interp, SymReg *r)
{
STRING *s;
- PMC *p, *class;
+ PMC *p, *_class;
int k;
if (*r->name == '"')
@@ -960,8 +960,8 @@
s = string_unescape_cstring(interp, r->name + 1, '\'', NULL);
else
s = string_unescape_cstring(interp, r->name, 0, NULL);
- class = interp->vtables[r->pmc_type]->pmc_class;
- p = VTABLE_new_from_string(interp, class, s, PObj_constant_FLAG);
+ _class = interp->vtables[r->pmc_type]->pmc_class;
+ p = VTABLE_new_from_string(interp, _class, s, PObj_constant_FLAG);
/* append PMC constant */
k = PDB_extend_const_table(interp);
interp->code->const_table->constants[k]->type = PFC_PMC;
Modified: trunk/compilers/imcc/symreg.c
==============================================================================
--- trunk/compilers/imcc/symreg.c (original)
+++ trunk/compilers/imcc/symreg.c Wed Apr 18 12:13:32 2007
@@ -19,16 +19,16 @@
push_namespace(char * name)
{
Namespace * ns = (Namespace *) malloc(sizeof (*ns));
- ns->parent = namespace;
+ ns->parent = _namespace;
ns->name = name;
ns->idents = NULL;
- namespace = ns;
+ _namespace = ns;
}
void
pop_namespace(char * name)
{
- Namespace * ns = namespace;
+ Namespace * ns = _namespace;
if (ns == NULL) {
fprintf(stderr, "pop() on empty namespace stack\n");
abort();
@@ -46,7 +46,7 @@
free(ident);
}
- namespace = ns->parent;
+ _namespace = ns->parent;
free(ns);
}
@@ -160,13 +160,13 @@
if (!ns)
return;
- if (unit->namespace)
+ if (unit->_namespace)
return;
- if (unit->prev && unit->prev->namespace == ns)
- unit->namespace = ns;
+ if (unit->prev && unit->prev->_namespace == ns)
+ unit->_namespace = ns;
else {
g = dup_sym(ns);
- unit->namespace = g;
+ unit->_namespace = g;
g->reg = ns;
g->type = VT_CONSTP;
if (! (r = _get_sym(&IMCC_INFO(interp)->ghash, g->name)) ||
@@ -269,21 +269,21 @@
char *
mk_fullname(const char * name)
{
- return _mk_fullname(namespace, name);
+ return _mk_fullname(_namespace, name);
}
/* Makes a new identifier */
SymReg *
mk_ident(Interp *interp, char * name, int t)
{
- char * fullname = _mk_fullname(namespace, name);
+ char * fullname = _mk_fullname(_namespace, name);
Identifier * ident;
SymReg * r;
- if (namespace) {
+ if (_namespace) {
ident = calloc(1, sizeof (struct ident_t));
ident->name = fullname;
- ident->next = namespace->idents;
- namespace->idents = ident;
+ ident->next = _namespace->idents;
+ _namespace->idents = ident;
}
r = mk_symreg(interp, fullname, t);
r->type = VTIDENTIFIER;
@@ -565,10 +565,10 @@
SymReg *
dup_sym(SymReg *r)
{
- SymReg * new = mem_sys_allocate(sizeof (SymReg));
- memcpy(new, r, sizeof (SymReg));
- new->name = str_dup(r->name);
- return new;
+ SymReg * new_sym = mem_allocate_typed(SymReg);
+ memcpy(new_sym, r, sizeof (SymReg));
+ new_sym->name = str_dup(r->name);
+ return new_sym;
}
SymReg *
@@ -789,7 +789,7 @@
find_sym(Interp *interp, const char * name)
{
if (IMCC_INFO(interp)->cur_unit)
- return _find_sym(interp, namespace,
&IMCC_INFO(interp)->cur_unit->hash, name);
+ return _find_sym(interp, _namespace,
&IMCC_INFO(interp)->cur_unit->hash, name);
return NULL;
}
Modified: trunk/compilers/imcc/symreg.h
==============================================================================
--- trunk/compilers/imcc/symreg.h (original)
+++ trunk/compilers/imcc/symreg.h Wed Apr 18 12:13:32 2007
@@ -100,7 +100,7 @@
Identifier * idents;
};
-EXTERN Namespace * namespace;
+EXTERN Namespace * _namespace;
struct _IMC_Unit;
Modified: trunk/compilers/imcc/unit.h
==============================================================================
--- trunk/compilers/imcc/unit.h (original)
+++ trunk/compilers/imcc/unit.h Wed Apr 18 12:13:32 2007
@@ -50,7 +50,7 @@
struct _IMC_Unit * prev;
struct _IMC_Unit * next;
- SymReg *namespace;
+ SymReg *_namespace;
int pasm_file;
const char *file;
int n_vars_used[4]; /* INSP in PIR */
Modified: trunk/config/auto/gcc.pm
==============================================================================
--- trunk/config/auto/gcc.pm (original)
+++ trunk/config/auto/gcc.pm Wed Apr 18 12:13:32 2007
@@ -206,7 +206,7 @@
. "-Wvariadic-macros "
. "-Wno-discard-qual "
. "-Wno-pointer-sign ",
- 4.1 => "",
+ 4.1 => "-Wc++-compat",
4.2 => "",
# -Wsequence-point is part of -Wall
Modified: trunk/src/debug.c
==============================================================================
--- trunk/src/debug.c (original)
+++ trunk/src/debug.c Wed Apr 18 12:13:32 2007
@@ -1273,7 +1273,7 @@
PDB_escape(const char *string, INTVAL length)
{
const char *end;
- char *new,*fill;
+ char *_new,*fill;
length = length > 20 ? 20 : length;
end = string + length;
@@ -1282,7 +1282,7 @@
if (!string)
return NULL;
- fill = new = (char *)mem_sys_allocate(length * 2 + 1);
+ fill = _new = (char *)mem_sys_allocate(length * 2 + 1);
for (; string < end; string++) {
switch (*string) {
@@ -1320,7 +1320,7 @@
}
}
*fill = '\0';
- return new;
+ return _new;
}
/*
@@ -1685,7 +1685,7 @@
long
PDB_add_label(PDB_file_t *file, opcode_t *cur_opcode, opcode_t offset)
{
- PDB_label_t *new, *label = file->label;
+ PDB_label_t *_new, *label = file->label;
/* See if there is already a label at this line */
while (label) {
@@ -1695,20 +1695,20 @@
}
/* Allocate a new label */
label = file->label;
- new = (PDB_label_t *)mem_sys_allocate(sizeof (PDB_label_t));
- new->opcode = cur_opcode + offset;
- new->next = NULL;
+ _new = mem_allocate_typed(PDB_label_t);
+ _new->opcode = cur_opcode + offset;
+ _new->next = NULL;
if (label) {
while (label->next)
label = label->next;
- new->number = label->number + 1;
- label->next = new;
+ _new->number = label->number + 1;
+ label->next = _new;
}
else {
- file->label = new;
- new->number = 1;
+ file->label = _new;
+ _new->number = 1;
}
- return new->number;
+ return _new->number;
}
/*
Modified: trunk/src/gc/gc_ims.c
==============================================================================
--- trunk/src/gc/gc_ims.c (original)
+++ trunk/src/gc/gc_ims.c Wed Apr 18 12:13:32 2007
@@ -933,13 +933,13 @@
void
-Parrot_dod_ims_wb(Interp* interp, PMC *agg, PMC *new)
+Parrot_dod_ims_wb(Interp* interp, PMC *agg, PMC *_new)
{
#if DOD_IMS_GREY_NEW
IMS_DEBUG((stderr, "%d agg %p mark %p\n",
((Gc_ims_private *)interp->arena_base->
- gc_private)->state, agg, new));
- pobject_lives(interp, (PObj*)new);
+ gc_private)->state, agg, _new));
+ pobject_lives(interp, (PObj*)_new);
#else
PObj_get_FLAGS(agg) &= ~ (PObj_live_FLAG|PObj_custom_GC_FLAG);
pobject_lives(interp, (PObj*)agg);
Modified: trunk/src/pic.c
==============================================================================
--- trunk/src/pic.c (original)
+++ trunk/src/pic.c Wed Apr 18 12:13:32 2007
@@ -556,15 +556,15 @@
switch (op) {
case PARROT_OP_new_p_sc:
{
- STRING *class;
+ STRING *_class;
INTVAL type;
- class = (STRING *)cur_opcode[2];
- type = pmc_type(interp, class);
+ _class = (STRING *)cur_opcode[2];
+ type = pmc_type(interp, _class);
if (!type)
- type = pmc_type(interp, class);
+ type = pmc_type(interp, _class);
if (type <= 0)
real_exception(interp, NULL, NO_CLASS,
- "Class '%Ss' not found", class);
+ "Class '%Ss' not found", _class);
pc_pred[2] = (void*)type;
op = PARROT_OP_new_p_ic;
}
Modified: trunk/src/pmc/array.pmc
==============================================================================
--- trunk/src/pmc/array.pmc (original)
+++ trunk/src/pmc/array.pmc Wed Apr 18 12:13:32 2007
@@ -1225,7 +1225,7 @@
*/
PMC* share_ro() {
- PMC *true;
+ PMC *_true;
PMC *ret;
/* prevent infinite recursion */
@@ -1234,13 +1234,13 @@
"something that already is shared");
}
- true = pmc_new(INTERP, enum_class_Integer);
- VTABLE_set_integer_native(INTERP, true, 1);
+ _true = pmc_new(INTERP, enum_class_Integer);
+ VTABLE_set_integer_native(INTERP, _true, 1);
ret = pt_shared_fixup(INTERP, SELF);
/* first set readonly */
- VTABLE_setprop(INTERP, ret, const_string(INTERP, "_ro"), true);
+ VTABLE_setprop(INTERP, ret, const_string(INTERP, "_ro"), _true);
/* XXX do something that deals better with sparse lists */
{
Modified: trunk/src/pmc/class.pmc
==============================================================================
--- trunk/src/pmc/class.pmc (original)
+++ trunk/src/pmc/class.pmc Wed Apr 18 12:13:32 2007
@@ -779,15 +779,15 @@
*/
PCCMETHOD void resolve_method(PMC *resolve_list :optional, int got_list
:opt_flag) {
- Parrot_Class *class = PARROT_CLASS(SELF);
+ Parrot_Class *_class = PARROT_CLASS(SELF);
PMC *ret_list = NULL;
if (got_list) {
/* Store list. */
- class->resolve_method = resolve_list;
+ _class->resolve_method = resolve_list;
}
- ret_list = class->resolve_method;
+ ret_list = _class->resolve_method;
PCCRETURN(PMC *ret_list);
}
@@ -802,20 +802,20 @@
*/
PCCMETHOD void new(PMC *args :slurpy :named) {
- Parrot_Class *class = PARROT_CLASS(SELF);
+ Parrot_Class *_class = PARROT_CLASS(SELF);
PMC *obj;
PMC *iter;
Parrot_Object *obj_guts = NULL;
/* If we've not been instantiated before... */
- if (!class->instantiated) {
+ if (!_class->instantiated) {
/* Check that we have all methods listed in resolve list. */
- int resolve_count = VTABLE_elements(interp, class->resolve_method);
+ int resolve_count = VTABLE_elements(interp,
_class->resolve_method);
int i;
for (i = 0; i < resolve_count; i++) {
STRING *check_meth = VTABLE_get_string_keyed_int(interp,
- class->resolve_method, i);
- if (!VTABLE_exists_keyed_str(interp, class->methods,
check_meth)) {
+ _class->resolve_method, i);
+ if (!VTABLE_exists_keyed_str(interp, _class->methods,
check_meth)) {
real_exception(interp, NULL, METH_NOT_FOUND,
"The method '%S' was named in the resolve list, but
not supplied",
check_meth);
@@ -824,16 +824,16 @@
/* Build full parents list.
* XXX Need pluggable MRO, for now always do C3. */
- class->all_parents = Parrot_ComputeMRO_C3(interp, SELF);
+ _class->all_parents = Parrot_ComputeMRO_C3(interp, SELF);
/* Build attributes index. */
build_attrib_index(interp, SELF);
- if (PMC_IS_NULL(class->attrib_index))
+ if (PMC_IS_NULL(_class->attrib_index))
return;
}
/* Set instantiated flag. */
- class->instantiated = 1;
+ _class->instantiated = 1;
/* Create object. */
obj = pmc_new_noinit(interp, enum_class_Object);
@@ -982,23 +982,23 @@
int got_exclude_method :opt_flag,
PMC* alias_method :optional :named["alias_method"],
int got_alias_method :opt_flag) {
- Parrot_Class *class = PARROT_CLASS(SELF);
+ Parrot_Class *_class = PARROT_CLASS(SELF);
/* Add everything on the resolve list to the exclude list; if we have
* no exclude list, pass along the resolve list in its place if it has
* any methods listed in it. */
if (!got_exclude_method) {
- if (VTABLE_elements(interp, class->resolve_method) != 0) {
- exclude_method = class->resolve_method;
+ if (VTABLE_elements(interp, _class->resolve_method) != 0) {
+ exclude_method = _class->resolve_method;
got_exclude_method = 1;
}
}
else {
- int resolve_count = VTABLE_elements(interp, class->resolve_method);
+ int resolve_count = VTABLE_elements(interp,
_class->resolve_method);
int i;
for (i = 0; i < resolve_count; i++) {
STRING *meth_name = VTABLE_get_string_keyed_int(interp,
- class->resolve_method, i);
+ _class->resolve_method, i);
VTABLE_push_string(interp, exclude_method, meth_name);
}
}
@@ -1006,7 +1006,7 @@
/* Do the composition. */
Parrot_ComposeRole(interp, role, exclude_method, got_exclude_method,
alias_method, got_alias_method,
- class->methods, class->roles);
+ _class->methods, _class->roles);
}
/*
Modified: trunk/src/pmc/default.pmc
==============================================================================
--- trunk/src/pmc/default.pmc (original)
+++ trunk/src/pmc/default.pmc Wed Apr 18 12:13:32 2007
@@ -898,7 +898,7 @@
/*
-=item C<INTVAL isa(STRING *class)>
+=item C<INTVAL isa(STRING *_class)>
Returns whether the PMC "isa" C<*class>.
@@ -906,9 +906,9 @@
*/
- INTVAL isa(STRING* class) {
+ INTVAL isa(STRING* _class) {
/* TODO FIXME - walk mro */
- return does_isa(INTERP, class, SELF->vtable->isa_str);
+ return does_isa(INTERP, _class, SELF->vtable->isa_str);
}
/*
Modified: trunk/src/pmc/deleg_pmc.pmc
==============================================================================
--- trunk/src/pmc/deleg_pmc.pmc (original)
+++ trunk/src/pmc/deleg_pmc.pmc Wed Apr 18 12:13:32 2007
@@ -39,7 +39,7 @@
void init() {
}
- void init_pmc(PMC* class) {
+ void init_pmc(PMC* _class) {
}
void mark() {
Modified: trunk/src/pmc/delegate.pmc
==============================================================================
--- trunk/src/pmc/delegate.pmc (original)
+++ trunk/src/pmc/delegate.pmc Wed Apr 18 12:13:32 2007
@@ -40,12 +40,12 @@
static PMC *
find_meth(Interp *interp, PMC *pmc, STRING *meth) {
- PMC *class = pmc;
+ PMC *_class = pmc;
if (PObj_is_object_TEST(pmc)) {
- class = GET_CLASS(PMC_data(pmc), pmc);
+ _class = GET_CLASS(PMC_data(pmc), pmc);
}
- return Parrot_find_method_with_cache(interp, class, meth);
+ return Parrot_find_method_with_cache(interp, _class, meth);
}
/*
@@ -64,14 +64,14 @@
find_or_die(Interp *interp, PMC *pmc, STRING *meth) {
PMC *returnPMC = find_meth(interp, pmc, meth);
if (PMC_IS_NULL(returnPMC)) {
- PMC *class = pmc;
+ PMC *_class = pmc;
if (PObj_is_object_TEST(pmc)) {
- class = GET_CLASS(PMC_data(pmc), pmc);
+ _class = GET_CLASS(PMC_data(pmc), pmc);
real_exception(interp, NULL, E_LookupError,
"Can't find method '%s' for object '%s'",
string_to_cstring(interp, meth),
string_to_cstring(interp, PMC_str_val(
- get_attrib_num((SLOTTYPE *)PMC_data(class),
+ get_attrib_num((SLOTTYPE *)PMC_data(_class),
PCD_CLASS_NAME))));
}
else {
@@ -105,15 +105,15 @@
*/
static void
-noarg_noreturn(Interp *interp, PMC *obj, PMC* class,
+noarg_noreturn(Interp *interp, PMC *obj, PMC* _class,
const char *name, int die)
{
STRING *meth = const_string(interp, name);
STRING *meth_v = const_string(interp, name + 2);
- PMC *method = Parrot_find_vtable_meth(interp, class, meth);
+ PMC *method = Parrot_find_vtable_meth(interp, _class, meth);
if (PMC_IS_NULL(method))
- method = die ? find_or_die(interp, class, meth) :
- find_meth(interp, class, meth);
+ method = die ? find_or_die(interp, _class, meth) :
+ find_meth(interp, _class, meth);
if (PMC_IS_NULL(method)) {
if (Interp_trace_TEST(interp, PARROT_TRACE_FIND_METH_FLAG)) {
PIO_eprintf(interp, "# not found\n");
@@ -153,8 +153,8 @@
noarg_noreturn(INTERP, SELF, SELF, PARROT_VTABLE_INIT_METHNAME, 0);
}
- void init_pmc(PMC* class) {
- noarg_noreturn(INTERP, SELF, class, PARROT_VTABLE_INIT_METHNAME, 0);
+ void init_pmc(PMC* _class) {
+ noarg_noreturn(INTERP, SELF, _class, PARROT_VTABLE_INIT_METHNAME, 0);
}
void destroy() {
Modified: trunk/src/pmc/namespace.pmc
==============================================================================
--- trunk/src/pmc/namespace.pmc (original)
+++ trunk/src/pmc/namespace.pmc Wed Apr 18 12:13:32 2007
@@ -343,14 +343,14 @@
*/
- METHOD void add_namespace(STRING *name, PMC *namespace) {
+ METHOD void add_namespace(STRING *name, PMC *_namespace) {
STRING *s_ns = CONST_STRING(INTERP, "NameSpace");
- if (!VTABLE_isa(INTERP, namespace, s_ns))
+ if (!VTABLE_isa(INTERP, _namespace, s_ns))
real_exception(INTERP, NULL, E_TypeError,
"Invalid type %d in add_namespace()",
- namespace->vtable->base_type);
+ _namespace->vtable->base_type);
- VTABLE_set_pmc_keyed_str(INTERP, SELF, name, namespace);
+ VTABLE_set_pmc_keyed_str(INTERP, SELF, name, _namespace);
return;
}
Modified: trunk/src/pmc/object.pmc
==============================================================================
--- trunk/src/pmc/object.pmc (original)
+++ trunk/src/pmc/object.pmc Wed Apr 18 12:13:32 2007
@@ -24,24 +24,24 @@
/* This finds the index of an attribute in an object's attribute store and
* returns it. Returns -1 if the attribute does not exist. */
static INTVAL get_attrib_index(Parrot_Interp interp, PMC *self, STRING *name) {
- Parrot_Class *class = PARROT_CLASS(self);
+ Parrot_Class *_class = PARROT_CLASS(self);
/* If we can't find the attribute, we hand back -1. */
INTVAL index = -1;
/* First see if we can find it in the cache. */
- if (VTABLE_exists_keyed_str(interp, class->attrib_cache, name)) {
+ if (VTABLE_exists_keyed_str(interp, _class->attrib_cache, name)) {
/* Yay! We got a cache hit! */
- index = VTABLE_get_integer_keyed_str(interp, class->attrib_cache,
name);
+ index = VTABLE_get_integer_keyed_str(interp, _class->attrib_cache,
name);
}
else {
/* No hit. We need to walk up the list of parents to try and find the
* attribute. */
- int num_classes = VTABLE_elements(interp, class->all_parents);
+ int num_classes = VTABLE_elements(interp, _class->all_parents);
int i;
for (i = 0; i < num_classes; i++) {
/* Get the class and its attribute metadata hash. */
- PMC *cur_class = VTABLE_get_pmc_keyed_int(interp,
class->all_parents, i);
+ PMC *cur_class = VTABLE_get_pmc_keyed_int(interp,
_class->all_parents, i);
Parrot_Class *class_info = PARROT_CLASS(cur_class);
/* Build a string representing the fully qualified attribute name.
*/
@@ -49,10 +49,10 @@
fq_name = string_append(interp, fq_name, name);
/* Look up. */
- if (VTABLE_exists_keyed_str(interp, class->attrib_index, fq_name))
{
+ if (VTABLE_exists_keyed_str(interp, _class->attrib_index,
fq_name)) {
/* Found it. Get value, cache it and we're done. */
- index = VTABLE_get_integer_keyed_str(interp,
class->attrib_index, fq_name);
- VTABLE_set_integer_keyed_str(interp, class->attrib_cache,
name, index);
+ index = VTABLE_get_integer_keyed_str(interp,
_class->attrib_index, fq_name);
+ VTABLE_set_integer_keyed_str(interp, _class->attrib_cache,
name, index);
break;
}
}
@@ -188,15 +188,15 @@
PMC* find_method(STRING *name)
{
Parrot_Object *obj = PARROT_OBJECT(SELF);
- Parrot_Class *class = PARROT_CLASS(obj->_class);
+ Parrot_Class *_class = PARROT_CLASS(obj->_class);
PMC *method = PMCNULL;
/* Walk and search. One day, we'll use the cache first. */
- int num_classes = VTABLE_elements(interp, class->all_parents);
+ int num_classes = VTABLE_elements(interp, _class->all_parents);
int i;
for (i = 0; i < num_classes; i++) {
/* Get the class and see if it has the method. */
- PMC *cur_class = VTABLE_get_pmc_keyed_int(interp,
class->all_parents, i);
+ PMC *cur_class = VTABLE_get_pmc_keyed_int(interp,
_class->all_parents, i);
Parrot_Class *class_info = PARROT_CLASS(cur_class);
if (VTABLE_exists_keyed_str(interp, class_info->methods, name)) {
/* Found it! */
Modified: trunk/src/pmc/pair.pmc
==============================================================================
--- trunk/src/pmc/pair.pmc (original)
+++ trunk/src/pmc/pair.pmc Wed Apr 18 12:13:32 2007
@@ -48,14 +48,14 @@
}
PMC* instantiate(PMC* sig) {
- PMC * const class = REG_PMC(2);
+ PMC * const _class = REG_PMC(2);
const int argcP = REG_INT(3);
const int argcS = REG_INT(2);
return PMCNULL; /* XXX This looks wrong, since we skip all the
* following code */
- SELF = pmc_new(INTERP, class->vtable->base_type);
+ SELF = pmc_new(INTERP, _class->vtable->base_type);
if (argcS == 1 && argcP == 1) {
PMC_struct_val(SELF) = REG_STR(5);
PObj_key_is_string_SET(SELF);
Modified: trunk/src/pmc/parrotclass.pmc
==============================================================================
--- trunk/src/pmc/parrotclass.pmc (original)
+++ trunk/src/pmc/parrotclass.pmc Wed Apr 18 12:13:32 2007
@@ -108,11 +108,11 @@
*/
INTVAL isa(STRING* classname) {
- PMC *class;
+ PMC *_class;
if (SUPER(classname))
return 1;
- class = Parrot_class_lookup(INTERP, classname);
- return Parrot_object_isa(INTERP, SELF, class);
+ _class = Parrot_class_lookup(INTERP, classname);
+ return Parrot_object_isa(INTERP, SELF, _class);
}
@@ -265,13 +265,13 @@
void thawfinish(visit_info *info) {
INTVAL i, n, nold;
- PMC * class;
+ PMC *_class;
PMC *parents, *attribs, *old;
PMC **class_data;
int parent_not_class = 0;
- class = SELF;
- class_data = (PMC**)(PMC_data(class));
+ _class = SELF;
+ class_data = (PMC**)(PMC_data(_class));
old = class_data[PCD_PARENTS];
nold = VTABLE_elements(INTERP, old);
@@ -293,7 +293,7 @@
parent_not_class++;
parent_class = parent_class->vtable->pmc_class;
}
- Parrot_add_parent(INTERP, class, parent_class);
+ Parrot_add_parent(INTERP, _class, parent_class);
}
}
/*
@@ -317,7 +317,7 @@
* Parrot_add_parent() and must be first
*/
for (i = parent_not_class ? 1 : 0; i < n; ++i) {
- Parrot_add_attribute(INTERP, class,
+ Parrot_add_attribute(INTERP, _class,
VTABLE_get_string_keyed_int(INTERP, attribs, i));
}
}
@@ -336,11 +336,11 @@
*/
METHOD PMC* get_parents() {
- PMC * class;
+ PMC *_class;
PMC **class_data;
- class = SELF;
- class_data = (PMC**)(PMC_data(class));
+ _class = SELF;
+ class_data = (PMC**)(PMC_data(_class));
return class_data[PCD_PARENTS];
}
Modified: trunk/src/pmc/parrotobject.pmc
==============================================================================
--- trunk/src/pmc/parrotobject.pmc (original)
+++ trunk/src/pmc/parrotobject.pmc Wed Apr 18 12:13:32 2007
@@ -29,12 +29,12 @@
/* XXX duplicated from delegate.pmc */
static PMC *
find_meth(Interp* interp, PMC *pmc, STRING *meth) {
- PMC *class = pmc;
+ PMC *_class = pmc;
if (PObj_is_object_TEST(pmc)) {
- class = GET_CLASS((Buffer *)PMC_data(pmc), pmc);
+ _class = GET_CLASS((Buffer *)PMC_data(pmc), pmc);
}
- return Parrot_find_method_with_cache(interp, class, meth);
+ return Parrot_find_method_with_cache(interp, _class, meth);
}
pmclass ParrotObject extends ParrotClass need_ext {
@@ -86,7 +86,7 @@
*/
void destroy() {
- PMC* class;
+ PMC* _class;
PMC* meth, *ns;
STRING* fin;
@@ -94,12 +94,12 @@
*/
if ((UINTVAL)SELF->vtable == 0xdeadbeef)
return;
- class = SELF->vtable->pmc_class;
- if ((UINTVAL)class->vtable == 0xdeadbeef)
+ _class = SELF->vtable->pmc_class;
+ if ((UINTVAL)_class->vtable == 0xdeadbeef)
return;
if (PObj_get_FLAGS(SELF) & PObj_need_finalize_FLAG) {
fin = CONST_STRING(INTERP, "__finalize");
- ns = VTABLE_pmc_namespace(interp, class);
+ ns = VTABLE_pmc_namespace(interp, _class);
meth = VTABLE_get_pmc_keyed_str(interp, ns, fin);
if (!PMC_IS_NULL(meth)) {
/*
@@ -127,8 +127,8 @@
*/
STRING* name() {
- PMC *class = VTABLE_get_class(INTERP, SELF);
- return VTABLE_name(INTERP, class);
+ PMC *_class = VTABLE_get_class(INTERP, SELF);
+ return VTABLE_name(INTERP, _class);
}
@@ -163,14 +163,14 @@
*/
PMC* find_method(STRING* name) {
- PMC *class = VTABLE_get_class(INTERP, SELF);
+ PMC *_class = VTABLE_get_class(INTERP, SELF);
STRING *meth = CONST_STRING(interp, "__find_method");
STRING *meth_v = CONST_STRING(interp, "find_method");
PMC *sub = Parrot_find_vtable_meth(interp, SELF, meth_v);
if (PMC_IS_NULL(sub))
sub = find_meth(interp, SELF, meth);
if (PMC_IS_NULL(sub))
- return VTABLE_find_method(INTERP, class, name);
+ return VTABLE_find_method(INTERP, _class, name);
return (PMC*) Parrot_run_meth_fromc_args(interp, sub,
SELF, meth, "PS", name);
}
Modified: trunk/src/pmc/role.pmc
==============================================================================
--- trunk/src/pmc/role.pmc (original)
+++ trunk/src/pmc/role.pmc Wed Apr 18 12:13:32 2007
@@ -54,7 +54,7 @@
/* This is the underlying structure of this PMC. */
typedef struct Parrot_Role {
STRING *name; /* The name of the role. */
- PMC *namespace; /* The namespace it's linked to, if any. */
+ PMC *_namespace; /* The namespace it's linked to, if any. */
PMC *roles; /* Any roles that this role is composed from. */
PMC *methods; /* Hash of method names to methods in this role. */
PMC *attrib_metadata; /* Hash of attributes in this role to hashes of
metadata. */
@@ -80,21 +80,21 @@
string_from_const_cstring(interp, "namespace", 0));
/* Take a copy of the current namespace the role is attached to. */
- old_ns = role->namespace;
+ old_ns = role->_namespace;
/* Let's roll (no pun intended!) If we have a namespace and a name,
* set both. */
if (have_name && have_ns) {
/* If we weren't passed a NameSpace PMC, assume it's something we have
* to look one up with and do so. */
- PMC *namespace = VTABLE_get_pmc_keyed_str(interp, info,
+ PMC *_namespace = VTABLE_get_pmc_keyed_str(interp, info,
string_from_const_cstring(interp, "namespace", 0));
- if (!VTABLE_isa(interp, namespace, string_from_const_cstring(interp,
"NameSpace", 0)))
- namespace = Parrot_make_namespace_autobase(interp, namespace);
+ if (!VTABLE_isa(interp, _namespace, string_from_const_cstring(interp,
"NameSpace", 0)))
+ _namespace = Parrot_make_namespace_autobase(interp, _namespace);
/* If we get something null back it's an error; otherwise, store it. */
- if (!PMC_IS_NULL(namespace))
- role->namespace = namespace;
+ if (!PMC_IS_NULL(_namespace))
+ role->_namespace = _namespace;
else
real_exception(interp, NULL, E_NameError, "Namespace not found");
@@ -111,7 +111,7 @@
/* Namespace is nested in the current namespace and with the name of
* the role. */
- role->namespace = Parrot_make_namespace_keyed_str(interp,
+ role->_namespace = Parrot_make_namespace_keyed_str(interp,
CONTEXT(interp->ctx)->current_namespace, role->name);
}
@@ -119,31 +119,31 @@
else if (have_ns) {
/* If we weren't passed a NameSpace PMC, assume it's something we have
* to look one up with and do so. */
- PMC *namespace = VTABLE_get_pmc_keyed_str(interp, info,
+ PMC *_namespace = VTABLE_get_pmc_keyed_str(interp, info,
string_from_const_cstring(interp, "namespace", 0));
- if (!VTABLE_isa(interp, namespace, string_from_const_cstring(interp,
"NameSpace", 0)))
- namespace = Parrot_make_namespace_autobase(interp, namespace);
+ if (!VTABLE_isa(interp, _namespace, string_from_const_cstring(interp,
"NameSpace", 0)))
+ _namespace = Parrot_make_namespace_autobase(interp, _namespace);
/* If we get something null back it's an error; otherwise, store it. */
- if (!PMC_IS_NULL(namespace))
- role->namespace = namespace;
+ if (!PMC_IS_NULL(_namespace))
+ role->_namespace = _namespace;
else
real_exception(interp, NULL, E_NameError, "Namespace not found");
/* Name is that of the most nested part of the namespace. */
- role->name = VTABLE_get_string(interp, namespace);
+ role->name = VTABLE_get_string(interp, _namespace);
}
/* If we were attached to a namespce and are now attached to a new one,
* need to unset ourselves in the old namespace. */
- if (!PMC_IS_NULL(old_ns) && role->namespace != old_ns)
+ if (!PMC_IS_NULL(old_ns) && role->_namespace != old_ns)
Parrot_PCCINVOKE(interp, old_ns,
string_from_const_cstring(interp, "set_class", 0),
"P->", PMCNULL);
/* Link namespace to this role, if there is one. */
- if (!PMC_IS_NULL(role->namespace))
- Parrot_PCCINVOKE(interp, role->namespace,
+ if (!PMC_IS_NULL(role->_namespace))
+ Parrot_PCCINVOKE(interp, role->_namespace,
string_from_const_cstring(interp, "set_class", 0),
"P->", self);
@@ -234,7 +234,7 @@
/* Set up the object. */
role = mem_sys_allocate_zeroed(sizeof (Parrot_Role));
role->name = CONST_STRING(interp, "");
- role->namespace = PMCNULL;
+ role->_namespace = PMCNULL;
role->roles = pmc_new(interp, enum_class_ResizablePMCArray);
role->methods = pmc_new(interp, enum_class_Hash);
role->attrib_metadata = pmc_new(interp, enum_class_Hash);
@@ -279,8 +279,8 @@
Parrot_Role *role = PARROT_ROLE(SELF);
if (role->name)
pobject_lives(interp, (PObj*)role->name);
- if (role->namespace)
- pobject_lives(interp, (PObj*)role->namespace);
+ if (role->_namespace)
+ pobject_lives(interp, (PObj*)role->_namespace);
if (role->roles)
pobject_lives(interp, (PObj*)role->roles);
if (role->methods)
@@ -402,7 +402,7 @@
}
else if (string_equal(interp, what, CONST_STRING(interp, "namespace"))
== 0) {
/* Don't clone the namespace, as it's not part of our state. */
- return role->namespace;
+ return role->_namespace;
}
else if (string_equal(interp, what, CONST_STRING(interp,
"attributes")) == 0) {
found = role->attrib_metadata;
@@ -496,7 +496,7 @@
/*
=item C<PCCMETHOD void
- namespace()>
+ pmc_namespace()>
Gets the namespace associated with this role, if any.
@@ -504,9 +504,9 @@
*/
- PCCMETHOD void namespace() {
+ PCCMETHOD void pmc_namespace() {
Parrot_Role *role = PARROT_ROLE(SELF);
- PMC *ret_namespace = role->namespace;
+ PMC *ret_namespace = role->_namespace;
PCCRETURN(PMC *ret_namespace);
}
Modified: trunk/src/pmc/scalar.pmc
==============================================================================
--- trunk/src/pmc/scalar.pmc (original)
+++ trunk/src/pmc/scalar.pmc Wed Apr 18 12:13:32 2007
@@ -1400,16 +1400,16 @@
*/
PMC* share_ro() {
- PMC *true;
+ PMC *_true;
PMC *ret;
- true = pmc_new(INTERP, enum_class_Integer);
- VTABLE_set_integer_native(INTERP, true, 1);
+ _true = pmc_new(INTERP, enum_class_Integer);
+ VTABLE_set_integer_native(INTERP, _true, 1);
ret = pt_shared_fixup(INTERP, SELF);
/* first set readonly */
- VTABLE_setprop(INTERP, ret, const_string(INTERP, "_ro"), true);
+ VTABLE_setprop(INTERP, ret, const_string(INTERP, "_ro"), _true);
/* now share; we add a PMC_EXT so we can identify the owning interp */
Modified: trunk/src/pmc/smop_attribute.pmc
==============================================================================
--- trunk/src/pmc/smop_attribute.pmc (original)
+++ trunk/src/pmc/smop_attribute.pmc Wed Apr 18 12:13:32 2007
@@ -105,10 +105,10 @@
=cut
*/
- PCCMETHOD void class(PMC *class :optional, int got_class :opt_flag) {
+ PCCMETHOD void class(PMC *_class :optional, int got_class :opt_flag) {
PMC *class_attr = NULL;
if (got_class) {
- SMOP_attr(SELF)->class_ = class;
+ SMOP_attr(SELF)->class_ = _class;
}
class_attr = SMOP_attr(SELF)->class_;
PCCRETURN(PMC *class_attr);
Modified: trunk/src/pmc/string.pmc
==============================================================================
--- trunk/src/pmc/string.pmc (original)
+++ trunk/src/pmc/string.pmc Wed Apr 18 12:13:32 2007
@@ -629,22 +629,22 @@
}
/*
-=item C<void replace(STRING* orig, STRING* new)>
+=item C<void replace(STRING* orig, STRING* _new)>
-Replace every occurrence of C<orig> with C<new>.
+Replace every occurrence of C<orig> with C<_new>.
=cut
*/
- METHOD void replace(STRING* orig, STRING* new) {
+ METHOD void replace(STRING* orig, STRING* _new) {
INTVAL i = 0;
INTVAL old_len = string_length(INTERP, orig);
- INTVAL new_len = string_length(INTERP, new);
+ INTVAL new_len = string_length(INTERP, _new);
STRING *s = VTABLE_get_string(INTERP, SELF);
while (-1 != (i = string_str_index(INTERP, s, orig, i))) {
- (void)string_replace(INTERP, s, i, old_len, new, NULL);
+ (void)string_replace(INTERP, s, i, old_len, _new, NULL);
i += new_len;
}
VTABLE_set_string_native(INTERP, SELF, s);