mojoshader_common.c
changeset 956 7888858a6777
parent 946 16fec3a3f687
child 963 5a8f7ef13735
--- a/mojoshader_common.c	Wed Nov 17 15:58:40 2010 -0500
+++ b/mojoshader_common.c	Thu Nov 18 22:42:58 2010 -0500
@@ -589,7 +589,7 @@
     return buffer;
 } // buffer_create
 
-void *buffer_reserve(Buffer *buffer, const size_t len)
+char *buffer_reserve(Buffer *buffer, const size_t len)
 {
     // note that we make the blocks bigger than blocksize when we have enough
     //  data to overfill a fresh block, to reduce allocations.
@@ -607,7 +607,7 @@
             buffer->tail->bytes += len;
             buffer->total_bytes += len;
             assert(buffer->tail->bytes <= blocksize);
-            return buffer->tail->data + tailbytes;
+            return (char *) buffer->tail->data + tailbytes;
         } // if
     } // if
 
@@ -630,7 +630,7 @@
 
     buffer->total_bytes += len;
 
-    return item->data;
+    return (char *) item->data;
 } // buffer_reserve
 
 int buffer_append(Buffer *buffer, const void *_data, size_t len)
@@ -739,7 +739,7 @@
     buffer->total_bytes = 0;
 } // buffer_empty
 
-void *buffer_flatten(Buffer *buffer)
+char *buffer_flatten(Buffer *buffer)
 {
     char *retval = (char *) buffer->m(buffer->total_bytes + 1, buffer->d);
     if (retval == NULL)
@@ -764,7 +764,7 @@
     return retval;
 } // buffer_flatten
 
-void *buffer_merge(Buffer **buffers, const size_t n, size_t *_len)
+char *buffer_merge(Buffer **buffers, const size_t n, size_t *_len)
 {
     Buffer *first = NULL;
     size_t len = 0;
@@ -779,7 +779,7 @@
         len += buffer->total_bytes;
     } // for
 
-    char *retval = (char *) first ? first->m(len + 1, first->d) : NULL;
+    char *retval = (char *) (first ? first->m(len + 1, first->d) : NULL);
     if (retval == NULL)
     {
         *_len = 0;