Permalink
Browse files

rename pmc attributes struct from Parrot_<type> to Parrot_<type>_attr…

…ibutes RT#48014

git-svn-id: https://svn.parrot.org/parrot/trunk@30914 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
1 parent 4100d19 commit 971e99779f320ba7f608dc9bb784e48b678dc453 @NotFound NotFound committed Sep 8, 2008
View
@@ -230,8 +230,9 @@ of a C<pmclass> or C<prole> declaration.
ATTR <type> <name> [ :<modifier> ... ];
-This declaration is used to generate the data struct for the PMC (named
-"Parrot_<pmcname>_Data"). The data struct incorporates any attributes declared
+This declaration is used to generate the data struct for the PMC
+(named "Parrot_<pmcname>_attributes").
+The data struct incorporates any attributes declared
in a composed role or inherited class. Composed attributes are inserted at the
end of the generated struct. Inherited attributes are inserted at the top of
the generated struct, so the struct members shared by the parent and child are
@@ -71,7 +71,7 @@ Initializes the userdata.
*/
void init() {
- Parrot_LuaUserdata *u = mem_allocate_zeroed_typed(Parrot_LuaUserdata);
+ Parrot_LuaUserdata_attributes *u = mem_allocate_zeroed_typed(Parrot_LuaUserdata_attributes);
PMC_data(SELF) = u;
u_env(SELF) = getcurrenv(INTERP);
PMC_metadata(SELF) = NULL;
@@ -106,7 +106,7 @@ Call finalizer and free the userdata.
*/
void destroy() {
- Parrot_LuaUserdata *u = PARROT_LUAUSERDATA(SELF);
+ Parrot_LuaUserdata_attributes *u = PARROT_LUAUSERDATA(SELF);
PMC *meth = find_meth(INTERP, SELF, "__gc");
if (meth)
@@ -33,7 +33,7 @@ pmclass MutableVAR need_ext dynpmc group perl6_group {
PObj_active_destroy_SET(SELF);
/* Create underlying structure and set scalar value. */
- PMC_data(SELF) = mem_allocate_zeroed_typed(Parrot_MutableVAR);
+ PMC_data(SELF) = mem_allocate_zeroed_typed(Parrot_MutableVAR_attributes);
SET_ATTR_scalar(INTERP, SELF, scalar);
}
@@ -569,7 +569,7 @@ Allocates the PMC's underlying storage.
/* Allocate the underlying struct and make candidate list an empty
* ResizablePMCArray. */
PMC *candidates = pmc_new(interp, enum_class_ResizablePMCArray);
- PMC_data(SELF) = mem_allocate_zeroed_typed(Parrot_Perl6MultiSub);
+ PMC_data(SELF) = mem_allocate_zeroed_typed(Parrot_Perl6MultiSub_attributes);
SETATTR_Perl6MultiSub_candidates(interp, SELF, candidates)
/* Need custom mark and destroy. */
@@ -57,7 +57,7 @@ sub generate_start {
$h->emit(<<"EOH");
/* $name PMC's underlying struct. */
-typedef struct Parrot_${name} {
+typedef struct Parrot_${name}_attributes {
EOH
return 1;
@@ -76,10 +76,10 @@ sub generate_end {
my $ucname = uc($name);
$h->emit(<<"EOH");
-} Parrot_${name};
+} Parrot_${name}_attributes;
/* Macro to access underlying structure of a $name PMC. */
-#define PARROT_${ucname}(o) ((Parrot_${name} *) PMC_data(o))
+#define PARROT_${ucname}(o) ((Parrot_${name}_attributes *) PMC_data(o))
EOH
@@ -146,7 +146,7 @@ EOA
$decl .= <<"EOA";
} \\
else \\
- (dest) = ((Parrot_${pmcname} *)PMC_data(pmc))->$attrname; \\
+ (dest) = ((Parrot_${pmcname}_attributes *)PMC_data(pmc))->$attrname; \\
}
#define SETATTR_${pmcname}_${attrname}(interp, pmc, value) \\
@@ -196,7 +196,7 @@ EOA
$decl .= <<"EOA";
} \\
else \\
- ((Parrot_${pmcname} *)PMC_data(pmc))->$attrname = (value); \\
+ ((Parrot_${pmcname}_attributes *)PMC_data(pmc))->$attrname = (value); \\
}
EOA
@@ -101,8 +101,8 @@ sub body {
my $generated = <<EOC;
$l
$decl {
- Parrot_Object * const obj = PARROT_OBJECT(pmc);
- Parrot_Class * const _class = PARROT_CLASS(obj->_class);
+ Parrot_Object_attributes * const obj = PARROT_OBJECT(pmc);
+ Parrot_Class_attributes * const _class = PARROT_CLASS(obj->_class);
/* Walk and search for the vtable method. */
const int num_classes = VTABLE_elements(interp, _class->all_parents);
@@ -124,7 +124,7 @@ EOC
# since it's unsafe.
if ( $meth !~ /get_pointer/ ) {
$generated .= <<EOC;
- const Parrot_Class * const class_info = PARROT_CLASS(cur_class);
+ const ParrotClass_attributes * const class_info = PARROT_CLASS(cur_class);
if (VTABLE_exists_keyed_str(interp, class_info->vtable_overrides, CONST_STRING_GEN(interp, "$meth"))) {
/* Found it; call. */
PMC * const meth = VTABLE_get_pmc_keyed_str(interp,
@@ -40,8 +40,8 @@ sub pre_method_gen {
$superargs =~ s/^,//;
$new_default_method->body( Parrot::Pmc2c::Emitter->text(<<"EOC") );
- Parrot_Object * const obj = PARROT_OBJECT(pmc);
- Parrot_Class * const _class = PARROT_CLASS(obj->_class);
+ Parrot_Object_attributes * const obj = PARROT_OBJECT(pmc);
+ Parrot_Class_attributes * const _class = PARROT_CLASS(obj->_class);
STRING * const meth_name = CONST_STRING_GEN(interp, "$vt_method_name");
/* Walk and search for the vtable method. */
View
@@ -166,7 +166,7 @@ PARROT_WARN_UNUSED_RESULT
PMC *
Parrot_oo_get_namespace(SHIM_INTERP, ARGIN(const PMC *classobj))
{
- Parrot_Class * const _class = PARROT_CLASS(classobj);
+ Parrot_Class_attributes * const _class = PARROT_CLASS(classobj);
PMC * const _namespace = _class->_namespace;
if (PMC_IS_NULL(_namespace))
@@ -324,7 +324,7 @@ PMC *
Parrot_oo_find_vtable_override_for_class(PARROT_INTERP,
ARGIN(PMC *classobj), ARGIN(STRING *name))
{
- Parrot_Class *class_info;
+ Parrot_Class_attributes *class_info;
PARROT_ASSERT(PObj_is_class_TEST(classobj));
class_info = PARROT_CLASS(classobj);
@@ -349,7 +349,7 @@ PMC *
Parrot_oo_find_vtable_override(PARROT_INTERP,
ARGIN(PMC *classobj), ARGIN(STRING *name))
{
- Parrot_Class * const _class = PARROT_CLASS(classobj);
+ Parrot_Class_attributes * const _class = PARROT_CLASS(classobj);
if (VTABLE_exists_keyed_str(interp, _class->parent_overrides, name))
return VTABLE_get_pmc_keyed_str(interp, _class->parent_overrides, name);
View
@@ -49,8 +49,8 @@ Free hash structure.
VTABLE void init() {
Hash *registry;
- Parrot_AddrRegistry * const addr_registry =
- mem_allocate_zeroed_typed(Parrot_AddrRegistry);
+ Parrot_AddrRegistry_attributes * const addr_registry =
+ mem_allocate_zeroed_typed(Parrot_AddrRegistry_attributes);
PMC_data(SELF) = addr_registry;
PObj_custom_mark_destroy_SETALL(SELF);
@@ -67,7 +67,7 @@ Free hash structure.
VTABLE void destroy() {
if (PMC_data(SELF)) {
- Parrot_AddrRegistry * const registry = PARROT_ADDRREGISTRY(SELF);
+ Parrot_AddrRegistry_attributes * const registry = PARROT_ADDRREGISTRY(SELF);
parrot_hash_destroy(INTERP, registry->hash);
PMC_data(SELF) = NULL;
View
@@ -48,7 +48,7 @@ Free structures.
*/
VTABLE void init() {
- Parrot_Capture *capture = mem_allocate_typed(Parrot_Capture);
+ Parrot_Capture_attributes *capture = mem_allocate_typed(Parrot_Capture_attributes);
PMC_data(SELF) = capture;
capture->array = NULL;
capture->hash = NULL;
Oops, something went wrong.

0 comments on commit 971e997

Please sign in to comment.