Skip to content

Commit

Permalink
address bitrot (#4)
Browse files Browse the repository at this point in the history
pmc_new -> Parrot_pmc_new
  • Loading branch information
coke committed Jan 26, 2012
1 parent 6f3c072 commit e0eb829
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions src/binary.c
Expand Up @@ -80,7 +80,7 @@ binary_scan_number_field(PARROT_INTERP, char field, char *binstr, int *_pos, int
if (pos >= length)
break;
c = (char *)(binstr + pos);
value = pmc_new(interp, class_TclInt);
value = Parrot_pmc_new(interp, class_TclInt);
VTABLE_set_integer_native(interp, value, (INTVAL)*c);
pos += 1;
break;
Expand All @@ -90,7 +90,7 @@ binary_scan_number_field(PARROT_INTERP, char field, char *binstr, int *_pos, int
if (pos + len > length)
break;
d = (double *)(binstr + pos);
value = pmc_new(interp, class_TclFloat);
value = Parrot_pmc_new(interp, class_TclFloat);
VTABLE_set_number_native(interp, value, *d);
pos += len;
break;
Expand All @@ -100,7 +100,7 @@ binary_scan_number_field(PARROT_INTERP, char field, char *binstr, int *_pos, int
if (pos + len > length)
break;
f = (float *)(binstr + pos);
value = pmc_new(interp, class_TclFloat);
value = Parrot_pmc_new(interp, class_TclFloat);
VTABLE_set_number_native(interp, value, *f);
pos += len;
break;
Expand All @@ -110,7 +110,7 @@ binary_scan_number_field(PARROT_INTERP, char field, char *binstr, int *_pos, int
if (pos + len > length)
break;
n = (int *)(binstr + pos);
value = pmc_new(interp, class_TclInt);
value = Parrot_pmc_new(interp, class_TclInt);
VTABLE_set_integer_native(interp, value, *n);
pos += len;
break;
Expand All @@ -136,7 +136,7 @@ static PMC *
binary_scan_number_slurpy(PARROT_INTERP, char field, char *binstr, int *_pos, int length)
{
PMC *elem;
PMC *values = pmc_new(interp, class_TclList);
PMC *values = Parrot_pmc_new(interp, class_TclList);

while ((elem = binary_scan_number_field(interp, field, binstr, _pos, length)) != PMCNULL)
VTABLE_push_pmc(interp, values, elem);
Expand Down Expand Up @@ -267,7 +267,7 @@ binary_scan_string(PARROT_INTERP, char field,
{

STRING *value = Parrot_str_new_noinit(interp, 64);
PMC *pmcval = pmc_new(interp, class_TclString);
PMC *pmcval = Parrot_pmc_new(interp, class_TclString);

if ((*formatpos) < formatlen && format[*formatpos] == '*')
{
Expand Down Expand Up @@ -320,7 +320,7 @@ PMC *ParTcl_binary_scan(PARROT_INTERP, STRING *BINSTR, STRING *FORMAT)
class_TclString = Parrot_pmc_get_type_str(interp, string_from_literal(interp, "TclString"));
}

values = pmc_new(interp, class_TclList);
values = Parrot_pmc_new(interp, class_TclList);
while (formatpos < formatlen)
{
char field = format[formatpos++];
Expand Down
12 changes: 6 additions & 6 deletions src/ops/tcl.ops
Expand Up @@ -80,7 +80,7 @@ and $errorInfo of C<''>.
inline op tcl_error(in STR, in PMC, in PMC) :flow {
PMC *errorCode, *errorInfo, *ns;
PMC *const root_ns = interp->root_namespace;
PMC *tcl_key = pmc_new(interp, enum_class_Key);
PMC *tcl_key = Parrot_pmc_new(interp, enum_class_Key);
PMC *exception = Parrot_ex_build_exception(interp, EXCEPT_error,
CONTROL_ERROR, $1);
opcode_t * const ret = expr NEXT();
Expand All @@ -104,7 +104,7 @@ inline op tcl_error(in STR, in PMC, in PMC) :flow {
inline op tcl_error(in STR, in PMC) :flow {
PMC *errorCode, *errorInfo, *ns;
PMC *const root_ns = interp->root_namespace;
PMC *tcl_key = pmc_new(interp, enum_class_Key);
PMC *tcl_key = Parrot_pmc_new(interp, enum_class_Key);
PMC *exception = Parrot_ex_build_exception(interp, EXCEPT_error,
CONTROL_ERROR, $1);
opcode_t * const ret = expr NEXT();
Expand All @@ -119,7 +119,7 @@ inline op tcl_error(in STR, in PMC) :flow {
VTABLE_assign_pmc(interp, errorInfo, $2);

errorCode = Parrot_ns_find_namespace_global(interp, ns, string_from_literal(interp, "$errorCode"));
newEC = pmc_new(interp, Parrot_hll_get_ctx_HLL_type(interp, enum_class_String));
newEC = Parrot_pmc_new(interp, Parrot_hll_get_ctx_HLL_type(interp, enum_class_String));
VTABLE_set_string_native(interp, newEC, string_from_literal(interp, "NONE"));
VTABLE_assign_pmc(interp, errorCode, newEC);

Expand All @@ -131,7 +131,7 @@ inline op tcl_error(in STR, in PMC) :flow {
inline op tcl_error(in STR) :flow {
PMC *errorCode, *errorInfo, *ns;
PMC *const root_ns = interp->root_namespace;
PMC *tcl_key = pmc_new(interp, enum_class_Key);
PMC *tcl_key = Parrot_pmc_new(interp, enum_class_Key);
PMC *exception = Parrot_ex_build_exception(interp, EXCEPT_error,
CONTROL_ERROR, $1);
opcode_t * const ret = expr NEXT();
Expand All @@ -143,12 +143,12 @@ inline op tcl_error(in STR) :flow {
ns = Parrot_ns_get_namespace_keyed(interp, root_ns, tcl_key);

errorInfo = Parrot_ns_find_namespace_global(interp, ns, string_from_literal(interp, "$errorCode"));
newEI = pmc_new(interp, Parrot_hll_get_ctx_HLL_type(interp, enum_class_String));
newEI = Parrot_pmc_new(interp, Parrot_hll_get_ctx_HLL_type(interp, enum_class_String));
VTABLE_set_string_native(interp, newEI, string_from_literal(interp, ""));
VTABLE_assign_pmc(interp, errorInfo, newEI);

errorCode = Parrot_ns_find_namespace_global(interp, ns, string_from_literal(interp, "$errorCode"));
newEC = pmc_new(interp, Parrot_hll_get_ctx_HLL_type(interp, enum_class_String));
newEC = Parrot_pmc_new(interp, Parrot_hll_get_ctx_HLL_type(interp, enum_class_String));
VTABLE_set_string_native(interp, newEC, string_from_literal(interp, "NONE"));
VTABLE_assign_pmc(interp, errorCode, newEC);

Expand Down
2 changes: 1 addition & 1 deletion src/pmc/tclint.pmc
Expand Up @@ -45,7 +45,7 @@ pmclass TclInt
"divide by zero");

if (!dest)
dest = pmc_new(INTERP, SELF->vtable->base_type);
dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type);

VTABLE_set_integer_native(INTERP, dest, floor(SELF.get_integer() / d));
return dest;
Expand Down

0 comments on commit e0eb829

Please sign in to comment.