Skip to content

Commit

Permalink
Clean up additional C++ keyword uses (Steve Peters, Mark Glines, RT #…
Browse files Browse the repository at this point in the history
…42602).

git-svn-id: https://svn.parrot.org/parrot/trunk@18279 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
chromatic committed Apr 18, 2007
1 parent 3472839 commit ce63aa4
Show file tree
Hide file tree
Showing 22 changed files with 163 additions and 163 deletions.
22 changes: 11 additions & 11 deletions compilers/imcc/pbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,16 +310,16 @@ find_global_label(char *name, struct subs *sym, int *pc)
*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;
Expand Down Expand Up @@ -654,8 +654,8 @@ add_const_pmc_sub(Interp *interp, SymReg *r,

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);
Expand Down Expand Up @@ -950,7 +950,7 @@ static void
make_pmc_const(Interp *interp, SymReg *r)
{
STRING *s;
PMC *p, *class;
PMC *p, *_class;
int k;

if (*r->name == '"')
Expand All @@ -960,8 +960,8 @@ make_pmc_const(Interp *interp, SymReg *r)
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;
Expand Down
36 changes: 18 additions & 18 deletions compilers/imcc/symreg.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ void
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();
Expand All @@ -46,7 +46,7 @@ pop_namespace(char * name)
free(ident);
}

namespace = ns->parent;
_namespace = ns->parent;
free(ns);
}

Expand Down Expand Up @@ -160,13 +160,13 @@ add_namespace(Parrot_Interp interp, IMC_Unit *unit)

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)) ||
Expand Down Expand Up @@ -269,21 +269,21 @@ _mk_fullname(Namespace * ns, const char * name)
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;
Expand Down Expand Up @@ -565,10 +565,10 @@ mk_label_address(Interp *interp, char * name)
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 *
Expand Down Expand Up @@ -789,7 +789,7 @@ SymReg *
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;
}

Expand Down
2 changes: 1 addition & 1 deletion compilers/imcc/symreg.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ struct namespace_t {
Identifier * idents;
};

EXTERN Namespace * namespace;
EXTERN Namespace * _namespace;

struct _IMC_Unit;

Expand Down
2 changes: 1 addition & 1 deletion compilers/imcc/unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ typedef struct _IMC_Unit {
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 */
Expand Down
2 changes: 1 addition & 1 deletion config/auto/gcc.pm
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ sub runstep {
. "-Wvariadic-macros "
. "-Wno-discard-qual "
. "-Wno-pointer-sign ",
4.1 => "",
4.1 => "-Wc++-compat",
4.2 => "",

# -Wsequence-point is part of -Wall
Expand Down
24 changes: 12 additions & 12 deletions src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,7 @@ char *
PDB_escape(const char *string, INTVAL length)
{
const char *end;
char *new,*fill;
char *_new,*fill;

length = length > 20 ? 20 : length;
end = string + length;
Expand All @@ -1282,7 +1282,7 @@ PDB_escape(const char *string, INTVAL length)
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) {
Expand Down Expand Up @@ -1320,7 +1320,7 @@ PDB_escape(const char *string, INTVAL length)
}
}
*fill = '\0';
return new;
return _new;
}

/*
Expand Down Expand Up @@ -1685,7 +1685,7 @@ Add a label to the label list.
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) {
Expand All @@ -1695,20 +1695,20 @@ PDB_add_label(PDB_file_t *file, opcode_t *cur_opcode, opcode_t offset)
}
/* 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;
}

/*
Expand Down
6 changes: 3 additions & 3 deletions src/gc/gc_ims.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,13 +933,13 @@ be greyed or the aggregate must be rescanned - by greying it.


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);
Expand Down
10 changes: 5 additions & 5 deletions src/pic.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,15 +556,15 @@ parrot_PIC_prederef(Interp *interp, opcode_t op, void **pc_pred, int core)
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;
}
Expand Down
8 changes: 4 additions & 4 deletions src/pmc/array.pmc
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,7 @@ Recursively make the array read-only and shared.

*/
PMC* share_ro() {
PMC *true;
PMC *_true;
PMC *ret;

/* prevent infinite recursion */
Expand All @@ -1234,13 +1234,13 @@ Recursively make the array read-only and shared.
"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 */
{
Expand Down
Loading

0 comments on commit ce63aa4

Please sign in to comment.