explicit cast from (void*) for (ucx_memchunk*) to silence a warning

Tue, 19 Sep 2017 14:35:08 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 19 Sep 2017 14:35:08 +0200
changeset 248
dff45a2234ce
parent 247
ecd242949641
child 249
fb21858ad8da

explicit cast from (void*) for (ucx_memchunk*) to silence a warning

ucx/mempool.c file | annotate | diff | comparison | revisions
--- a/ucx/mempool.c	Tue Sep 19 14:16:26 2017 +0200
+++ b/ucx/mempool.c	Tue Sep 19 14:35:08 2017 +0200
@@ -115,7 +115,8 @@
         }
     }
 
-    ucx_memchunk *mem = (ucx_memchunk*)malloc(sizeof(ucx_destructor) + n);
+    void *p = malloc(sizeof(ucx_destructor) + n);
+    ucx_memchunk *mem = (ucx_memchunk*)p;
     if (!mem) {
         return NULL;
     }

mercurial