[svn:parrot] r39031 - trunk/lib/Parrot/Pmc2c
petdance at svn.parrot.org
petdance at svn.parrot.org
Fri May 22 06:16:22 UTC 2009
Author: petdance
Date: Fri May 22 06:16:21 2009
New Revision: 39031
URL: https://trac.parrot.org/parrot/changeset/39031
Log:
consting some args in the generated code
Modified:
trunk/lib/Parrot/Pmc2c/Attribute.pm
Modified: trunk/lib/Parrot/Pmc2c/Attribute.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c/Attribute.pm Fri May 22 06:09:01 2009 (r39030)
+++ trunk/lib/Parrot/Pmc2c/Attribute.pm Fri May 22 06:16:21 2009 (r39031)
@@ -129,21 +129,21 @@
}
elsif ($attrtype eq "INTVAL") {
$decl .= <<"EOA";
- PMC *attr_value = VTABLE_get_attr_str(interp, \\
+ PMC * const attr_value = VTABLE_get_attr_str(interp, \\
pmc, Parrot_str_new_constant(interp, "$attrname")); \\
(dest) = (PMC_IS_NULL(attr_value) ? (INTVAL) 0: VTABLE_get_integer(interp, attr_value)); \\
EOA
}
elsif ($attrtype eq "FLOATVAL") {
$decl .= <<"EOA";
- PMC *attr_value = VTABLE_get_attr_str(interp, \\
+ PMC * const attr_value = VTABLE_get_attr_str(interp, \\
pmc, Parrot_str_new_constant(interp, "$attrname")); \\
(dest) = (PMC_IS_NULL(attr_value) ? (FLOATVAL) 0.0: VTABLE_get_number(interp, attr_value)); \\
EOA
}
elsif ($attrtype =~ $isptrtostring) {
$decl .= <<"EOA";
- PMC *attr_value = VTABLE_get_attr_str(interp, \\
+ PMC * const attr_value = VTABLE_get_attr_str(interp, \\
pmc, Parrot_str_new_constant(interp, "$attrname")); \\
(dest) = (PMC_IS_NULL(attr_value) ? (STRING *) 0: VTABLE_get_string(interp, attr_value)); \\
EOA
@@ -184,7 +184,7 @@
}
elsif ($attrtype eq "INTVAL") {
$decl .= <<"EOA";
- PMC *attr_value = pmc_new(interp, enum_class_Integer); \\
+ PMC * const attr_value = pmc_new(interp, enum_class_Integer); \\
VTABLE_set_integer_native(interp, attr_value, value); \\
VTABLE_set_attr_str(interp, pmc, \\
Parrot_str_new_constant(interp, "$attrname"), attr_value); \\
@@ -192,7 +192,7 @@
}
elsif ($attrtype eq "FLOATVAL") {
$decl .= <<"EOA";
- PMC *attr_value = pmc_new(interp, enum_class_Float); \\
+ PMC * const attr_value = pmc_new(interp, enum_class_Float); \\
VTABLE_set_number_native(interp, attr_value, value); \\
VTABLE_set_attr_str(interp, pmc, \\
Parrot_str_new_constant(interp, "$attrname"), attr_value); \\
@@ -200,7 +200,7 @@
}
elsif ($attrtype =~ $isptrtostring) {
$decl .= <<"EOA";
- PMC *attr_value = pmc_new(interp, enum_class_String); \\
+ PMC * const attr_value = pmc_new(interp, enum_class_String); \\
VTABLE_set_string_native(interp, attr_value, value); \\
VTABLE_set_attr_str(interp, pmc, \\
Parrot_str_new_constant(interp, "$attrname"), attr_value); \\
More information about the parrot-commits
mailing list