Skip to content
This repository has been archived by the owner on Jun 9, 2018. It is now read-only.

Commit

Permalink
rename functions in PMC after the merge of branch pmc_func_cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fperrad committed Feb 20, 2010
1 parent cdc873f commit c91bc99
Show file tree
Hide file tree
Showing 11 changed files with 153 additions and 153 deletions.
24 changes: 12 additions & 12 deletions dynext/pmc/lua.pmc
Expand Up @@ -41,19 +41,19 @@ pmclass Lua
void class_init() {
Lua_PMC = NULL;

dynpmc_LuaBoolean = pmc_type(INTERP,
dynpmc_LuaBoolean = Parrot_pmc_get_type_str(INTERP,
Parrot_str_new_constant(INTERP, "LuaBoolean"));
dynpmc_LuaFunction = pmc_type(INTERP,
dynpmc_LuaFunction = Parrot_pmc_get_type_str(INTERP,
Parrot_str_new_constant(INTERP, "LuaFunction"));
dynpmc_LuaNil = pmc_type(INTERP,
dynpmc_LuaNil = Parrot_pmc_get_type_str(INTERP,
Parrot_str_new_constant(INTERP, "LuaNil"));
dynpmc_LuaNumber = pmc_type(INTERP,
dynpmc_LuaNumber = Parrot_pmc_get_type_str(INTERP,
Parrot_str_new_constant(INTERP, "LuaNumber"));
dynpmc_LuaString = pmc_type(INTERP,
dynpmc_LuaString = Parrot_pmc_get_type_str(INTERP,
Parrot_str_new_constant(INTERP, "LuaString"));
dynpmc_LuaTable = pmc_type(INTERP,
dynpmc_LuaTable = Parrot_pmc_get_type_str(INTERP,
Parrot_str_new_constant(INTERP, "LuaTable"));
dynpmc_LuaUserdata = pmc_type(INTERP,
dynpmc_LuaUserdata = Parrot_pmc_get_type_str(INTERP,
Parrot_str_new_constant(INTERP, "LuaUserdata"));
}

Expand Down Expand Up @@ -86,7 +86,7 @@ information see F<src/pmc.c>.
*/
METHOD PMC* clock() {
const FLOATVAL f = clock() / (FLOATVAL)CLOCKS_PER_SEC;
PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
PMC * const retval = Parrot_pmc_new(INTERP, dynpmc_LuaNumber);
VTABLE_set_number_native(INTERP, retval, f);
RETURN(PMC *retval);
}
Expand Down Expand Up @@ -114,9 +114,9 @@ information see F<src/pmc.c>.
t = mktime(&ts);

if (t == -1)
retval = pmc_new(INTERP, dynpmc_LuaNil);
retval = Parrot_pmc_new(INTERP, dynpmc_LuaNil);
else {
retval = pmc_new(INTERP, dynpmc_LuaNumber);
retval = Parrot_pmc_new(INTERP, dynpmc_LuaNumber);
VTABLE_set_integer_native(INTERP, retval, t);
}

Expand All @@ -140,12 +140,12 @@ information see F<src/pmc.c>.
PMC *retval;

if (p) {
retval = pmc_new(INTERP, dynpmc_LuaString);
retval = Parrot_pmc_new(INTERP, dynpmc_LuaString);
VTABLE_set_string_native(INTERP, retval,
Parrot_str_new(INTERP, p, 0));
}
else
retval = pmc_new(INTERP, dynpmc_LuaNil);
retval = Parrot_pmc_new(INTERP, dynpmc_LuaNil);

RETURN(PMC *retval);
}
Expand Down
46 changes: 23 additions & 23 deletions dynext/pmc/luaany.pmc
Expand Up @@ -73,7 +73,7 @@ _LuaAny_find_meth(PARROT_INTERP, PMC *obj, const char *name) {
}
else {
PMC *method;
PMC * const key = pmc_new(interp, dynpmc_LuaString);
PMC * const key = Parrot_pmc_new(interp, dynpmc_LuaString);
VTABLE_set_string_native(interp, key, Parrot_str_new_constant(interp, name));

method = VTABLE_get_pmc_keyed(interp, meta, key);
Expand Down Expand Up @@ -140,7 +140,7 @@ Returns the address of the PMC.
VTABLE void assign_pmc(PMC *value) {
const INTVAL type = PMC_type(value);
if (PMC_type(SELF) != type)
pmc_reuse(INTERP, SELF, type, 0);
Parrot_pmc_reuse(INTERP, SELF, type, 0);
if (type != dynpmc_LuaNil)
SELF.set_pmc(value);
}
Expand All @@ -165,7 +165,7 @@ Throws an exception.
PMC * retval = PMCNULL;
Parrot_ext_call(INTERP, meth, "PiP->P", SELF, key, &retval);
if (PMC_IS_NULL(retval))
return pmc_new(INTERP, dynpmc_LuaNil);
return Parrot_pmc_new(INTERP, dynpmc_LuaNil);

return retval;
}
Expand Down Expand Up @@ -217,7 +217,7 @@ Throws an exception.
Parrot_ext_call(INTERP, meth, "Pi->P", SELF, &dest);

if (PMC_IS_NULL(dest))
return pmc_new(INTERP, dynpmc_LuaNil);
return Parrot_pmc_new(INTERP, dynpmc_LuaNil);

return dest;
}
Expand All @@ -232,7 +232,7 @@ Throws an exception.
Parrot_ext_call(INTERP, meth, "Pi->P", SELF, &SELF);

if (PMC_IS_NULL(SELF))
SELF = pmc_new(INTERP, dynpmc_LuaNil);
SELF = Parrot_pmc_new(INTERP, dynpmc_LuaNil);
}

/*
Expand All @@ -246,7 +246,7 @@ Common implementation
*/
VTABLE PMC* logical_not(PMC *dest) {
const INTVAL result = ! SELF.get_bool();
dest = pmc_new(INTERP, dynpmc_LuaBoolean);
dest = Parrot_pmc_new(INTERP, dynpmc_LuaBoolean);
VTABLE_set_bool(INTERP, dest, result);
return dest;
}
Expand Down Expand Up @@ -332,7 +332,7 @@ Throws an exception.
Parrot_ext_call(INTERP, meth, "PiP->P", SELF, value, &dest);

if (PMC_IS_NULL(dest))
return pmc_new(INTERP, dynpmc_LuaNil);
return Parrot_pmc_new(INTERP, dynpmc_LuaNil);

return dest;
}
Expand All @@ -346,7 +346,7 @@ Throws an exception.

Parrot_ext_call(INTERP, meth, "PiP->P", SELF, value, &SELF);
if (PMC_IS_NULL(SELF))
SELF = pmc_new(INTERP, dynpmc_LuaNil);
SELF = Parrot_pmc_new(INTERP, dynpmc_LuaNil);
}

MULTI PMC* subtract(DEFAULT value, PMC *dest) {
Expand All @@ -358,7 +358,7 @@ Throws an exception.
Parrot_ext_call(INTERP, meth, "PiP->P", SELF, value, &dest);

if (PMC_IS_NULL(dest))
return pmc_new(INTERP, dynpmc_LuaNil);
return Parrot_pmc_new(INTERP, dynpmc_LuaNil);

return dest;
}
Expand All @@ -372,7 +372,7 @@ Throws an exception.
Parrot_ext_call(INTERP, meth, "PiP->P", SELF, value, &SELF);

if (PMC_IS_NULL(SELF))
SELF = pmc_new(INTERP, dynpmc_LuaNil);
SELF = Parrot_pmc_new(INTERP, dynpmc_LuaNil);
}

MULTI PMC* multiply(DEFAULT value, PMC *dest) {
Expand All @@ -385,7 +385,7 @@ Throws an exception.
Parrot_ext_call(INTERP, meth, "PiP->P", SELF, value, &dest);

if (PMC_IS_NULL(dest))
return pmc_new(INTERP, dynpmc_LuaNil);
return Parrot_pmc_new(INTERP, dynpmc_LuaNil);

return dest;
}
Expand All @@ -400,7 +400,7 @@ Throws an exception.
Parrot_ext_call(INTERP, meth, "PiP->P", SELF, value, &SELF);

if (PMC_IS_NULL(SELF))
SELF = pmc_new(INTERP, dynpmc_LuaNil);
SELF = Parrot_pmc_new(INTERP, dynpmc_LuaNil);
}

MULTI PMC* divide(DEFAULT value, PMC *dest) {
Expand All @@ -413,7 +413,7 @@ Throws an exception.
Parrot_ext_call(INTERP, meth, "PiP->P", SELF, value, &dest);

if (PMC_IS_NULL(dest))
return pmc_new(INTERP, dynpmc_LuaNil);
return Parrot_pmc_new(INTERP, dynpmc_LuaNil);

return dest;
}
Expand All @@ -428,7 +428,7 @@ Throws an exception.
Parrot_ext_call(INTERP, meth, "PiP->P", SELF, value, &SELF);

if (PMC_IS_NULL(SELF))
SELF = pmc_new(INTERP, dynpmc_LuaNil);
SELF = Parrot_pmc_new(INTERP, dynpmc_LuaNil);
}

MULTI PMC* modulus(DEFAULT value, PMC *dest) {
Expand All @@ -441,7 +441,7 @@ Throws an exception.
Parrot_ext_call(INTERP, meth, "PiP->P", SELF, value, &dest);

if (PMC_IS_NULL(dest))
return pmc_new(INTERP, dynpmc_LuaNil);
return Parrot_pmc_new(INTERP, dynpmc_LuaNil);

return dest;
}
Expand All @@ -456,7 +456,7 @@ Throws an exception.
Parrot_ext_call(INTERP, meth, "PiP->P", SELF, value, &SELF);

if (PMC_IS_NULL(SELF))
SELF = pmc_new(INTERP, dynpmc_LuaNil);
SELF = Parrot_pmc_new(INTERP, dynpmc_LuaNil);
}

MULTI PMC* concatenate(DEFAULT value, PMC *dest) {
Expand All @@ -469,7 +469,7 @@ Throws an exception.
Parrot_ext_call(INTERP, meth, "PiP->P", SELF, value, &dest);

if (PMC_IS_NULL(dest))
return pmc_new(INTERP, dynpmc_LuaNil);
return Parrot_pmc_new(INTERP, dynpmc_LuaNil);

return dest;
}
Expand All @@ -483,7 +483,7 @@ Throws an exception.
Parrot_ext_call(INTERP, meth, "PiP->P", SELF, value, &SELF);

if (PMC_IS_NULL(SELF))
SELF = pmc_new(INTERP, dynpmc_LuaNil);
SELF = Parrot_pmc_new(INTERP, dynpmc_LuaNil);
}

/*
Expand Down Expand Up @@ -540,7 +540,7 @@ Without shortcut like in Default PMC.

*/
METHOD PMC* get_metatable() {
PMC * const nil = pmc_new(INTERP, dynpmc_LuaNil);
PMC * const nil = Parrot_pmc_new(INTERP, dynpmc_LuaNil);
RETURN(PMC *nil);
}

Expand All @@ -564,7 +564,7 @@ Without shortcut like in Default PMC.
Parrot_ext_call(INTERP, meth, "Pi->P", SELF, &retval);

if (PMC_IS_NULL(retval))
retval = pmc_new(INTERP, dynpmc_LuaNil);
retval = Parrot_pmc_new(INTERP, dynpmc_LuaNil);

RETURN(PMC *retval);
}
Expand All @@ -579,7 +579,7 @@ Returns C<nil>.

*/
METHOD PMC* tonumber() {
PMC * const nil = pmc_new(INTERP, dynpmc_LuaNil);
PMC * const nil = Parrot_pmc_new(INTERP, dynpmc_LuaNil);
RETURN(PMC *nil);
}

Expand All @@ -603,10 +603,10 @@ Common implementation (use C<__tostring> or C<get_string>).
Parrot_ext_call(INTERP, meth, "Pi->P", SELF, &retval);

if (PMC_IS_NULL(retval))
retval = pmc_new(INTERP, dynpmc_LuaNil);
retval = Parrot_pmc_new(INTERP, dynpmc_LuaNil);
}
else {
retval = pmc_new(INTERP, dynpmc_LuaString);
retval = Parrot_pmc_new(INTERP, dynpmc_LuaString);
VTABLE_set_string_native(INTERP, retval, SELF.get_string());
}

Expand Down
4 changes: 2 additions & 2 deletions dynext/pmc/luaboolean.pmc
Expand Up @@ -72,7 +72,7 @@ Creates and returns a clone of the scalar.
*/
VTABLE PMC* clone() {
INTVAL iv;
PMC *dest = pmc_new(INTERP, PMC_type(SELF));
PMC *dest = Parrot_pmc_new(INTERP, PMC_type(SELF));
GET_ATTR_iv(INTERP, SELF, iv);
SET_ATTR_iv(INTERP, dest, iv);
return dest;
Expand Down Expand Up @@ -223,7 +223,7 @@ Used to unarchive the boolean.
const INTVAL b = (PMC_type(SELF) == PMC_type(value)
&& VTABLE_get_integer(INTERP, SELF) == VTABLE_get_integer(INTERP, value))
? 1 : 0;
PMC * const retval = pmc_new(INTERP, dynpmc_LuaBoolean);
PMC * const retval = Parrot_pmc_new(INTERP, dynpmc_LuaBoolean);
VTABLE_set_integer_native(INTERP, retval, b);
RETURN(PMC *retval);
}
Expand Down
8 changes: 4 additions & 4 deletions dynext/pmc/luabytecode.pmc
Expand Up @@ -132,31 +132,31 @@ static PMC* _load_function(Interp *interp);

static PMC* _load_bool(Interp *interp)
{
PMC* const ret = pmc_new(interp, pmc_type(interp,
PMC* const ret = Parrot_pmc_new(interp, Parrot_pmc_get_type_str(interp,
Parrot_str_new_constant(interp, "Boolean")));
VTABLE_set_integer_native(interp, ret, _get_byte());
return ret;
}

static PMC* _load_byte(Interp *interp)
{
PMC* const ret = pmc_new(interp, pmc_type(interp,
PMC* const ret = Parrot_pmc_new(interp, Parrot_pmc_get_type_str(interp,
Parrot_str_new_constant(interp, "Integer")));
VTABLE_set_integer_native(interp, ret, _get_byte());
return ret;
}

static PMC* _load_integer(Interp *interp)
{
PMC* const ret = pmc_new(interp, pmc_type(interp,
PMC* const ret = Parrot_pmc_new(interp, Parrot_pmc_get_type_str(interp,
Parrot_str_new_constant(interp, "Integer")));
VTABLE_set_integer_native(interp, ret, _get_integer());
return ret;
}

static PMC* _load_string(Interp *interp)
{
PMC* const ret = pmc_new(interp, pmc_type(interp,
PMC* const ret = Parrot_pmc_new(interp, Parrot_pmc_get_type_str(interp,
Parrot_str_new_constant(interp, "String")));
VTABLE_set_string_native(interp, ret, _get_string(interp));
return ret;
Expand Down
4 changes: 2 additions & 2 deletions dynext/pmc/luafunction.pmc
Expand Up @@ -197,7 +197,7 @@ Return the string "function".
PMC *retval = f_env(SELF);

if (PMC_IS_NULL(retval))
retval = pmc_new(INTERP, dynpmc_LuaNil);
retval = Parrot_pmc_new(INTERP, dynpmc_LuaNil);

RETURN(PMC *retval);
}
Expand All @@ -219,7 +219,7 @@ Return the string "function".
&& my_sub->seg == value_sub->seg)
? 1 : 0;
}
retval = pmc_new(INTERP, dynpmc_LuaBoolean);
retval = Parrot_pmc_new(INTERP, dynpmc_LuaBoolean);
VTABLE_set_integer_native(INTERP, retval, b);
RETURN(PMC *retval);
}
Expand Down
4 changes: 2 additions & 2 deletions dynext/pmc/luanil.pmc
Expand Up @@ -59,7 +59,7 @@ Creates and returns a clone of the scalar.

*/
VTABLE PMC* clone() {
return pmc_new(INTERP, PMC_type(SELF));
return Parrot_pmc_new(INTERP, PMC_type(SELF));
}

/*
Expand Down Expand Up @@ -137,7 +137,7 @@ Return always C<false>.
*/
METHOD PMC *rawequal(PMC *value) {
const INTVAL b = (PMC_type(SELF) == PMC_type(value)) ? 1 : 0;
PMC * const retval = pmc_new(INTERP, dynpmc_LuaBoolean);
PMC * const retval = Parrot_pmc_new(INTERP, dynpmc_LuaBoolean);
VTABLE_set_integer_native(INTERP, retval, b);
RETURN(PMC *retval);
}
Expand Down

0 comments on commit c91bc99

Please sign in to comment.