Mercurial > hg > batmud > maputils
changeset 1472:fe72ebfed971
Use th_malloc0().
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 14 May 2014 16:43:12 +0300 |
parents | da2dc8d19038 |
children | ca272867a81b |
files | liblocfile.c libmaputils.c |
diffstat | 2 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/liblocfile.c Wed May 14 01:39:12 2014 +0300 +++ b/liblocfile.c Wed May 14 16:43:12 2014 +0300 @@ -28,7 +28,7 @@ LocMarker * locCopyLocMarker(LocMarker *src) { int i; - LocMarker *res = th_calloc(1, sizeof(LocMarker)); + LocMarker *res = th_malloc0(sizeof(LocMarker)); if (res == NULL) return NULL; @@ -74,7 +74,7 @@ int i; /* Allocate location struct */ - if ((tmp = th_calloc(1, sizeof(LocMarker))) == NULL) + if ((tmp = th_malloc0(sizeof(LocMarker))) == NULL) return FALSE; tmp->x = tmp->ox = x;
--- a/libmaputils.c Wed May 14 01:39:12 2014 +0300 +++ b/libmaputils.c Wed May 14 16:43:12 2014 +0300 @@ -478,7 +478,7 @@ return NULL; /* Allocate struct and data */ - res = (MapBlock *) th_calloc(1, sizeof(MapBlock)); + res = (MapBlock *) th_malloc0(sizeof(MapBlock)); if (!res) return NULL; res->width = blockW; @@ -486,7 +486,7 @@ res->scansize = ((blockW / BLOCK_SCAN_ALIGN) + 1) * BLOCK_SCAN_ALIGN; res->size = res->height * res->scansize * sizeof(char); - res->data = (unsigned char *) th_calloc(1, res->size); + res->data = (unsigned char *) th_malloc0(res->size); if (!res->data) { th_free(res); @@ -515,7 +515,7 @@ if (block == NULL) return NULL; - res = (MapBlock *) th_calloc(1, sizeof(MapBlock)); + res = (MapBlock *) th_malloc0(sizeof(MapBlock)); if (!res) return NULL; res->width = block->width;