]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - util.c
More function flatening
[xonotic/gmqcc.git] / util.c
diff --git a/util.c b/util.c
index 1810adfce16c94d710e063db835d5d15e21cd911..023eb5e8e52899878993eef0eaac5cbd210c7f69 100644 (file)
--- a/util.c
+++ b/util.c
@@ -253,7 +253,7 @@ void util_endianswap(void *_data, size_t length, unsigned int typesize) {
                 util_swap64((uint32_t*)_data, length>>3);
                 return;
 
-            default: abort(); /* please blow the fuck up! */
+            default: exit(EXIT_FAILURE); /* please blow the fuck up! */
         }
 #   endif
 #endif
@@ -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;