[svn:parrot] r48370 - in branches/unshared_buffers/src: . gc io pmc string string/charset string/encoding

darbelo at svn.parrot.org darbelo at svn.parrot.org
Mon Aug 9 21:08:41 UTC 2010


Author: darbelo
Date: Mon Aug  9 21:08:41 2010
New Revision: 48370
URL: https://trac.parrot.org/parrot/changeset/48370

Log:
Fix the c++ build.

Modified:
   branches/unshared_buffers/src/gc/gc_ms.c
   branches/unshared_buffers/src/io/unix.c
   branches/unshared_buffers/src/pmc/eval.pmc
   branches/unshared_buffers/src/string/api.c
   branches/unshared_buffers/src/string/charset/ascii.c
   branches/unshared_buffers/src/string/encoding/ucs2.c
   branches/unshared_buffers/src/string/encoding/utf16.c
   branches/unshared_buffers/src/string/encoding/utf8.c
   branches/unshared_buffers/src/utils.c

Modified: branches/unshared_buffers/src/gc/gc_ms.c
==============================================================================
--- branches/unshared_buffers/src/gc/gc_ms.c	Mon Aug  9 21:08:18 2010	(r48369)
+++ branches/unshared_buffers/src/gc/gc_ms.c	Mon Aug  9 21:08:41 2010	(r48370)
@@ -1213,9 +1213,9 @@
     size_t newsize)
 {
     ASSERT_ARGS(gc_ms_reallocate_string_storage)
-    size_t copysize;
-    char *mem, *oldmem;
-    size_t new_size, needed, old_size;
+    char *mem;
+    void *oldmem;
+    size_t copysize, new_size, needed, old_size;
 
     Variable_Size_Pool * const pool =
         PObj_constant_TEST(str)

Modified: branches/unshared_buffers/src/io/unix.c
==============================================================================
--- branches/unshared_buffers/src/io/unix.c	Mon Aug  9 21:08:18 2010	(r48369)
+++ branches/unshared_buffers/src/io/unix.c	Mon Aug  9 21:08:41 2010	(r48370)
@@ -556,7 +556,7 @@
 {
     ASSERT_ARGS(Parrot_io_write_unix)
     const PIOHANDLE file_descriptor = Parrot_io_get_os_handle(interp, filehandle);
-    const char * const buffer = Buffer_bufstart(s);
+    const char * const buffer = (const char * const) Buffer_bufstart(s);
     const char * ptr          = buffer;
 
     size_t to_write = s->bufused;

Modified: branches/unshared_buffers/src/pmc/eval.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/eval.pmc	Mon Aug  9 21:08:18 2010	(r48369)
+++ branches/unshared_buffers/src/pmc/eval.pmc	Mon Aug  9 21:08:41 2010	(r48370)
@@ -301,7 +301,7 @@
         res->strlen  = res->bufused = size;
 
         if ((size_t)(Buffer_bufstart(res)) & 0xf) {
-            char *adr     = Buffer_bufstart(res);
+            char *adr     = (char *) Buffer_bufstart(res);
             adr          += 16 - ((size_t)adr & 0xf);
             Buffer_bufstart(res) = adr;
         }

Modified: branches/unshared_buffers/src/string/api.c
==============================================================================
--- branches/unshared_buffers/src/string/api.c	Mon Aug  9 21:08:18 2010	(r48369)
+++ branches/unshared_buffers/src/string/api.c	Mon Aug  9 21:08:41 2010	(r48370)
@@ -738,7 +738,7 @@
            it was safe by setting PObj_external_FLAG.
            (The cast is necessary to pacify TenDRA's tcc.)
            */
-        Buffer_bufstart(s) = PARROT_const_cast(void *, buffer);
+        Buffer_bufstart(s) = PARROT_const_cast(char *, buffer);
         Buffer_buflen(s)   = s->bufused  = len;
 
         if (encoding == Parrot_fixed_8_encoding_ptr)

Modified: branches/unshared_buffers/src/string/charset/ascii.c
==============================================================================
--- branches/unshared_buffers/src/string/charset/ascii.c	Mon Aug  9 21:08:18 2010	(r48369)
+++ branches/unshared_buffers/src/string/charset/ascii.c	Mon Aug  9 21:08:41 2010	(r48370)
@@ -313,7 +313,7 @@
     const UINTVAL n = src->strlen;
 
     if (n) {
-        char * const buffer = Buffer_bufstart(result);
+        char * const buffer = (char * const) Buffer_bufstart(result);
         UINTVAL offset;
 
         for (offset = 0; offset < n; ++offset) {
@@ -343,7 +343,7 @@
     const UINTVAL n      = src->strlen;
 
     if (n) {
-        char * const buffer = Buffer_bufstart(result);
+        char * const buffer = (char * const) Buffer_bufstart(result);
         UINTVAL offset;
 
         for (offset = 0; offset < n; ++offset) {
@@ -375,7 +375,7 @@
     const UINTVAL n      = src->strlen;
 
     if (n) {
-        char * const buffer = Buffer_bufstart(result);
+        char * const buffer = (char * const) Buffer_bufstart(result);
         UINTVAL offset;
 
         buffer[0] = (char)toupper((unsigned char)buffer[0]);
@@ -406,7 +406,7 @@
     STRING * const result = Parrot_str_clone(interp, src);
 
     if (result->strlen > 0) {
-        char * const buffer = Buffer_bufstart(result);
+        char * const buffer = (char * const) Buffer_bufstart(result);
         buffer[0] = (char)toupper((unsigned char)buffer[0]);
     }
 
@@ -432,7 +432,7 @@
     STRING * const result = Parrot_str_clone(interp, src);
 
     if (result->strlen > 0) {
-        char * const buffer = Buffer_bufstart(result);
+        char * const buffer = (char * const) Buffer_bufstart(result);
         buffer[0] = (char)tolower((unsigned char)buffer[0]);
     }
 
@@ -458,7 +458,7 @@
     STRING * const result = Parrot_str_clone(interp, src);
 
     if (result->strlen > 0) {
-        char * const buffer = Buffer_bufstart(result);
+        char * const buffer = (char * const) Buffer_bufstart(result);
         buffer[0] = (char)toupper((unsigned char)buffer[0]);
     }
 

Modified: branches/unshared_buffers/src/string/encoding/ucs2.c
==============================================================================
--- branches/unshared_buffers/src/string/encoding/ucs2.c	Mon Aug  9 21:08:18 2010	(r48369)
+++ branches/unshared_buffers/src/string/encoding/ucs2.c	Mon Aug  9 21:08:41 2010	(r48370)
@@ -78,8 +78,8 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 static STRING * get_codepoints(PARROT_INTERP,
-    ARGIN(const STRING *src),
-    UINTVAL offset,
+    ARGIN(const STRING *s),
+    UINTVAL offs,
     UINTVAL count)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
@@ -144,7 +144,7 @@
     , PARROT_ASSERT_ARG(src))
 #define ASSERT_ARGS_get_codepoints __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
-    , PARROT_ASSERT_ARG(src))
+    , PARROT_ASSERT_ARG(s))
 #define ASSERT_ARGS_iter_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(src) \
@@ -297,8 +297,8 @@
 
 /*
 
-=item C<static STRING * get_codepoints(PARROT_INTERP, const STRING *src, UINTVAL
-offset, UINTVAL count)>
+=item C<static STRING * get_codepoints(PARROT_INTERP, const STRING *s, UINTVAL
+offs, UINTVAL count)>
 
 Returns the codepoints in string C<src> at position C<offset> and length
 C<count>.
@@ -310,14 +310,14 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
 static STRING *
-get_codepoints(PARROT_INTERP, ARGIN(const STRING *src), UINTVAL offset, UINTVAL count)
+get_codepoints(PARROT_INTERP, ARGIN(const STRING *s), UINTVAL offs, UINTVAL count)
 {
     ASSERT_ARGS(get_codepoints)
 #if PARROT_HAS_ICU
-    return Parrot_str_new_init(interp, Buffer_bufstart(src) + offset * sizeof (UChar),
-        count * sizeof (UChar), src->encoding, src->charset, PObj_get_FLAGS(src));
+    return Parrot_str_new_init(interp, (char *)Buffer_bufstart(s) + offs * sizeof (UChar),
+        count * sizeof (UChar), s->encoding, s->charset, PObj_get_FLAGS(s));
 #else
-    UNUSED(src);
+    UNUSED(s);
     UNUSED(offset);
     UNUSED(count);
     no_ICU_lib(interp);

Modified: branches/unshared_buffers/src/string/encoding/utf16.c
==============================================================================
--- branches/unshared_buffers/src/string/encoding/utf16.c	Mon Aug  9 21:08:18 2010	(r48369)
+++ branches/unshared_buffers/src/string/encoding/utf16.c	Mon Aug  9 21:08:41 2010	(r48370)
@@ -219,7 +219,7 @@
     else {
         err = U_ZERO_ERROR;
         u_strFromUTF8(p, src_len,
-                &dest_len, Buffer_bufstart(src), src->bufused, &err);
+                &dest_len, (char *) Buffer_bufstart(src), src->bufused, &err);
         if (!U_SUCCESS(err)) {
             /*
              * have to resize - required len in UChars is in dest_len
@@ -229,7 +229,7 @@
                                      sizeof (UChar) * dest_len);
             p = (UChar *)Buffer_bufstart(result);
             u_strFromUTF8(p, dest_len,
-                    &dest_len, Buffer_bufstart(src), src->bufused, &err);
+                    &dest_len, (char *) Buffer_bufstart(src), src->bufused, &err);
             PARROT_ASSERT(U_SUCCESS(err));
         }
     }
@@ -385,8 +385,8 @@
     start = iter.bytepos;
     iter.set_position(interp, &iter, offset + count);
 
-    return Parrot_str_new_init(interp, Buffer_bufstart(src) + start, iter.bytepos - start,
-        src->encoding, src->charset, PObj_get_FLAGS(src));
+    return Parrot_str_new_init(interp, (char *)Buffer_bufstart(src) + start,
+        iter.bytepos - start, src->encoding, src->charset, PObj_get_FLAGS(src));
 }
 
 

Modified: branches/unshared_buffers/src/string/encoding/utf8.c
==============================================================================
--- branches/unshared_buffers/src/string/encoding/utf8.c	Mon Aug  9 21:08:18 2010	(r48369)
+++ branches/unshared_buffers/src/string/encoding/utf8.c	Mon Aug  9 21:08:41 2010	(r48370)
@@ -691,8 +691,8 @@
     if (count)
         iter.set_position(interp, &iter, offset + count);
 
-    return Parrot_str_new_init(interp, Buffer_bufstart(src) + start, iter.bytepos - start, 
-        src->encoding, src->charset, PObj_get_FLAGS(src));
+    return Parrot_str_new_init(interp, (char *)Buffer_bufstart(src) + start,
+        iter.bytepos - start, src->encoding, src->charset, PObj_get_FLAGS(src));
 }
 
 /*
@@ -711,8 +711,8 @@
 get_bytes(PARROT_INTERP, ARGIN(const STRING *src), UINTVAL offset, UINTVAL count)
 {
     ASSERT_ARGS(get_bytes)
-    return Parrot_str_new_init(interp, Buffer_bufstart(src) + offset, count,
-        src->encoding, src->charset, PObj_get_FLAGS(src));
+    return Parrot_str_new_init(interp, (char *) Buffer_bufstart(src) + offset,
+        count, src->encoding, src->charset, PObj_get_FLAGS(src));
 }
 
 

Modified: branches/unshared_buffers/src/utils.c
==============================================================================
--- branches/unshared_buffers/src/utils.c	Mon Aug  9 21:08:18 2010	(r48369)
+++ branches/unshared_buffers/src/utils.c	Mon Aug  9 21:08:41 2010	(r48370)
@@ -596,9 +596,9 @@
         ARGIN(const STRING *search), UINTVAL start_offset)
 {
     ASSERT_ARGS(Parrot_byte_index)
-    const char * const str_start  = Buffer_bufstart(base);
+    const char * const str_start  = (const char * const) Buffer_bufstart(base);
     const INTVAL       str_len    = base->strlen;
-    const char * const search_str = Buffer_bufstart(search);
+    const char * const search_str = (const char * const) Buffer_bufstart(search);
     const INTVAL       search_len = search->strlen;
     const char        *str_pos    = str_start + start_offset;
     INTVAL             len_remain = str_len   - start_offset;


More information about the parrot-commits mailing list