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
     1.1 --- a/ucx/mempool.c	Tue Sep 19 14:16:26 2017 +0200
     1.2 +++ b/ucx/mempool.c	Tue Sep 19 14:35:08 2017 +0200
     1.3 @@ -115,7 +115,8 @@
     1.4          }
     1.5      }
     1.6  
     1.7 -    ucx_memchunk *mem = (ucx_memchunk*)malloc(sizeof(ucx_destructor) + n);
     1.8 +    void *p = malloc(sizeof(ucx_destructor) + n);
     1.9 +    ucx_memchunk *mem = (ucx_memchunk*)p;
    1.10      if (!mem) {
    1.11          return NULL;
    1.12      }

mercurial