[svn:parrot] r36167 - trunk/lib/Parrot/Pmc2c

cotto at svn.parrot.org cotto at svn.parrot.org
Fri Jan 30 02:48:35 UTC 2009


Author: cotto
Date: Fri Jan 30 02:48:34 2009
New Revision: 36167
URL: https://trac.parrot.org/parrot/changeset/36167

Log:
[pmc2c] Make ATTR accessor generation code smarter about arrays of pointers.
This eliminates the compiler warnings from r36165.

Modified:
   trunk/lib/Parrot/Pmc2c/Attribute.pm

Modified: trunk/lib/Parrot/Pmc2c/Attribute.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c/Attribute.pm	Fri Jan 30 02:18:30 2009	(r36166)
+++ trunk/lib/Parrot/Pmc2c/Attribute.pm	Fri Jan 30 02:48:34 2009	(r36167)
@@ -121,14 +121,14 @@
             (dest) = VTABLE_get_number(interp, attr_value); \\
 EOA
     }
-    elsif ($attrtype =~ "STRING") {
+    elsif ($attrtype =~ /STRING\s*\*[^\*]/) {
         $decl .= <<"EOA";
             PMC *attr_value = VTABLE_get_attr_str(interp, \\
                               pmc, const_string(interp, "$attrname")); \\
             (dest) = VTABLE_get_string(interp, attr_value); \\
 EOA
     }
-    elsif ($attrtype =~ /PMC/) {
+    elsif ($attrtype =~ /PMC\s*\*[^\*]/) {
         $decl .= <<"EOA";
             (dest) = VTABLE_get_attr_str(interp, \\
                               pmc, const_string(interp, "$attrname")); \\
@@ -170,7 +170,7 @@
                               const_string(interp, "$attrname"), attr_value); \\
 EOA
     }
-    elsif ($attrtype =~ "STRING") {
+    elsif ($attrtype =~ /STRING\s*\*[^\*]/) {
         $decl .= <<"EOA";
             PMC *attr_value = pmc_new(interp, enum_class_String); \\
             VTABLE_set_string_native(interp, attr_value, value); \\
@@ -178,7 +178,7 @@
                               const_string(interp, "$attrname"), attr_value); \\
 EOA
     }
-    elsif ($attrtype =~ /PMC/) {
+    elsif ($attrtype =~ /PMC\s\*[^\*]/) {
         $decl .= <<"EOA";
             VTABLE_set_attr_str(interp, pmc, \\
                               const_string(interp, "$attrname"), value); \\


More information about the parrot-commits mailing list