[svn:parrot] r45610 - trunk/src/pmc
petdance at svn.parrot.org
petdance at svn.parrot.org
Mon Apr 12 20:23:51 UTC 2010
Author: petdance
Date: Mon Apr 12 20:23:50 2010
New Revision: 45610
URL: https://trac.parrot.org/parrot/changeset/45610
Log:
consting
Modified:
trunk/src/pmc/string.pmc
Modified: trunk/src/pmc/string.pmc
==============================================================================
--- trunk/src/pmc/string.pmc Mon Apr 12 17:16:24 2010 (r45609)
+++ trunk/src/pmc/string.pmc Mon Apr 12 20:23:50 2010 (r45610)
@@ -38,7 +38,7 @@
*/
VTABLE void init() {
- STRING *str_val = STRINGNULL;
+ STRING * const str_val = STRINGNULL;
SET_ATTR_str_val(INTERP, SELF, str_val);
PObj_custom_mark_SET(SELF);
@@ -191,7 +191,7 @@
*/
VTABLE void set_string_native(STRING *value) {
- if (!value)
+ if (value == NULL)
value = STRINGNULL;
/* Only allow constant PMCs to embed constant strings */
@@ -540,7 +540,7 @@
*/
METHOD to_int(INTVAL base) {
- PMC *result = Parrot_pmc_new(INTERP, Parrot_get_ctx_HLL_type(interp,
+ PMC * const result = Parrot_pmc_new(INTERP, Parrot_get_ctx_HLL_type(interp,
enum_class_Integer));
/* TODO verify encoding */
@@ -575,7 +575,7 @@
}
if (j < len) {
- char ch = str[j];
+ const char ch = str[j];
Parrot_str_free_cstring(str);
Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"invalid conversion to int - bad char %c", ch);
More information about the parrot-commits
mailing list