[svn:parrot] r45896 - branches/string_consting/src/string

bacek at svn.parrot.org bacek at svn.parrot.org
Thu Apr 22 11:32:28 UTC 2010


Author: bacek
Date: Thu Apr 22 11:32:28 2010
New Revision: 45896
URL: https://trac.parrot.org/parrot/changeset/45896

Log:
Consting Parrot_str_join.

Modified:
   branches/string_consting/src/string/api.c

Modified: branches/string_consting/src/string/api.c
==============================================================================
--- branches/string_consting/src/string/api.c	Thu Apr 22 11:32:14 2010	(r45895)
+++ branches/string_consting/src/string/api.c	Thu Apr 22 11:32:28 2010	(r45896)
@@ -2963,9 +2963,9 @@
 Parrot_str_join(PARROT_INTERP, ARGIN_NULLOK(const STRING *j), ARGIN(PMC *ar))
 {
     ASSERT_ARGS(Parrot_str_join)
-    STRING  **chunks;
+    STRING  const * *chunks;
     STRING   *res;
-    STRING   *s;
+    const STRING   *s;
     char     *pos;
     const int ar_len       = VTABLE_elements(interp, ar);
     int       total_length = 0;
@@ -2978,11 +2978,11 @@
     if (STRING_IS_NULL(j))
         j = Parrot_str_new_noinit(interp, enum_stringrep_one, 0);
 
-    chunks = (STRING **)Parrot_gc_allocate_fixed_size_storage(interp,
+    chunks = (STRING const* *)Parrot_gc_allocate_fixed_size_storage(interp,
         ar_len * sizeof (STRING *));
 
     for (i = 0; i < ar_len; ++i) {
-        STRING *next = VTABLE_get_string_keyed_int(interp, ar, i);
+        const STRING *next = VTABLE_get_string_keyed_int(interp, ar, i);
 
         if (STRING_IS_NULL(next)) {
             chunks[i] = STRINGNULL;
@@ -3009,7 +3009,7 @@
         const ENCODING *e = j->encoding;
 
         for (i = 0; i < ar_len; ++i) {
-            STRING *s = chunks[i];
+            const STRING *s = chunks[i];
 
             if (STRING_IS_NULL(s))
                 continue;
@@ -3042,7 +3042,7 @@
     }
 
     for (i = 1; i < ar_len; ++i) {
-        STRING *next = chunks[i];
+        const STRING *next = chunks[i];
 
         if (STRING_IS_NULL(next))
             continue;


More information about the parrot-commits mailing list