X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=util.c;h=004b69b0d5daef6215a2e85d16a408607d8ea07c;hp=1810adfce16c94d710e063db835d5d15e21cd911;hb=48d6375817d3834e934bec6849cdd08daaa3c9b2;hpb=36c5722273f1ea87603621c6ee20b7178a7a641b diff --git a/util.c b/util.c index 1810adf..004b69b 100644 --- a/util.c +++ b/util.c @@ -616,7 +616,7 @@ static void util_hsupdate(hash_set_t *set) { set->bits ++; set->capacity = (size_t)(1 << set->bits); set->mask = set->capacity - 1; - set->items = mem_a(set->capacity * sizeof(size_t)); + set->items = (size_t*)mem_a(set->capacity * sizeof(size_t)); set->total = 0; /*assert(set->items);*/ @@ -680,14 +680,14 @@ int util_hshas(hash_set_t *set, void *item) { hash_set_t *util_hsnew(void) { hash_set_t *set; - if (!(set = mem_a(sizeof(hash_set_t)))) + if (!(set = (hash_set_t*)mem_a(sizeof(hash_set_t)))) return NULL; set->bits = 3; set->total = 0; set->capacity = (size_t)(1 << set->bits); set->mask = set->capacity - 1; - set->items = mem_a(set->capacity * sizeof(size_t)); + set->items = (size_t*)mem_a(set->capacity * sizeof(size_t)); if (!set->items) { util_hsdel(set); @@ -760,7 +760,7 @@ int util_vasprintf(char **dat, const char *fmt, va_list args) { } /* not large enough ... */ - tmp = mem_a(len + 1); + tmp = (char*)mem_a(len + 1); if ((ret = vsnprintf(tmp, len + 1, fmt, args)) != len) { mem_d(tmp); *dat = NULL;