ucx/map.c

changeset 69
fb59270b1de3
parent 67
27e67e725d35
child 70
6721482eaf8e
--- a/ucx/map.c	Thu Oct 11 16:29:30 2012 +0200
+++ b/ucx/map.c	Fri Oct 12 10:54:55 2012 +0200
@@ -177,7 +177,7 @@
     UcxKey key;
     key.data = data;
     key.len = len;
-    key.hash = ucx_hash(data, len);
+    key.hash = ucx_hash((const char*) data, len);
     return key;
 }
 
@@ -281,13 +281,13 @@
 
         /* read into key buffer */
         n = 16;
-        key = malloc(n);
+        key = (char*) malloc(n);
         r = 0;
         do {
             if (c == '=') break;
             if (r > n - 2) {
                 n *= 2;
-                key = realloc(key, n);
+                key = (char*) realloc(key, n);
             }
             key[r] = c;
             r++;
@@ -310,13 +310,13 @@
 
         /* read into value buffer */
         n = 64;
-        value = malloc(n);
+        value = (char*) malloc(n);
         r = 0;
         do {
             if (c == '\n') break;
             if (r > n - 2) {
                 n *= 2;
-                value = realloc(value, n);
+                value = (char*) realloc(value, n);
             }
             value[r] = c;
             r++;
@@ -328,18 +328,18 @@
             size_t decodedSize;
             void *decoded = decoder(value, decdata, &decodedSize);
             free(value);
-            value = decoded;
+            value = (char*) decoded;
             r = decodedSize;
         } else {
             r += 2;
-            value = realloc(value, r);
+            value = (char*) realloc(value, r);
         }
 
         if (allocator.pool) {
             void *pooledValue = allocator.malloc(allocator.pool, r);
             memcpy(pooledValue, value, r);
             free(value);
-            value = pooledValue;
+            value = (char*) pooledValue;
         }
 
         ucx_map_cstr_put(map, key, value);
@@ -362,7 +362,7 @@
         if (encoder) {
             size_t encodedSize;
             void *encoded = encoder(v, encdata, &encodedSize);
-            value = sstrn(encoded,encodedSize - 1);
+            value = sstrn((char*) encoded,encodedSize - 1);
         } else {
             value = sstr(v);
         }

mercurial