ucx/buffer.c

changeset 78
af355652f271
parent 76
655020a30e77
child 84
7465c18765dc
--- a/ucx/buffer.c	Thu Jan 17 23:56:48 2013 +0100
+++ b/ucx/buffer.c	Wed Feb 06 12:55:56 2013 +0100
@@ -8,7 +8,7 @@
     if (buffer) {
         buffer->flags = flags;
         if (!space) {
-            buffer->space = malloc(size);
+            buffer->space = (char*)malloc(size);
             if (!buffer->space) {
                 free(buffer);
                 return NULL;
@@ -16,7 +16,7 @@
             memset(buffer->space, 0, size);
             buffer->flags |= UCX_BUFFER_AUTOFREE;
         } else {
-            buffer->space = space;
+            buffer->space = (char*)space;
         }
         buffer->capacity = size;
         buffer->size = 0;
@@ -48,7 +48,7 @@
 
     UcxBuffer *dst = (UcxBuffer*) malloc(sizeof(UcxBuffer));
     if (dst) {
-        dst->space = malloc(length);
+        dst->space = (char*)malloc(length);
         if (!dst->space) {
             free(dst);
             return NULL;
@@ -95,7 +95,7 @@
     size_t newcap = buffer->capacity;
     while (buffer->pos + len > newcap) newcap <<= 1;
     
-    char *newspace = realloc(buffer->space, newcap);
+    char *newspace = (char*)realloc(buffer->space, newcap);
     if (newspace) {
         memset(newspace+buffer->size, 0, newcap-buffer->size);
         buffer->space = newspace;
@@ -185,7 +185,7 @@
 size_t ucx_buffer_generic_copy(void *s1, void *s2,
         read_func readfnc, write_func writefnc, size_t bufsize) {
     size_t ncp = 0;
-    char *buf = malloc(bufsize);
+    char *buf = (char*)malloc(bufsize);
     if(buf == NULL) {
         return 0;
     }

mercurial