]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Get it compiling with C++ compilers again.
authorDale Weiler <killfieldengine@gmail.com>
Wed, 30 Jan 2013 06:49:50 +0000 (06:49 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Wed, 30 Jan 2013 06:49:50 +0000 (06:49 +0000)
correct.c
ftepp.c
util.c

index 04bd8d1256b15b084c96f81a561b482ae714510b..5d872c112d0488c087dd8104a92ce539fea79979 100644 (file)
--- a/correct.c
+++ b/correct.c
@@ -461,7 +461,7 @@ static GMQCC_INLINE char **correct_known_resize(char **res, size_t *allocated, s
     if (size < oldallocated)
         return res;
 
-    out = correct_pool_alloc(sizeof(*res) * oldallocated + 32);
+    out = (char**)correct_pool_alloc(sizeof(*res) * oldallocated + 32);
     memcpy(out, res, sizeof(*res) * oldallocated);
 
     *allocated += 32;
@@ -474,7 +474,7 @@ static char **correct_known(correction_t *corr, correct_trie_t* table, char **ar
     size_t len = 0;
     size_t row = 0;
     size_t nxt = 8;
-    char **res = correct_pool_alloc(sizeof(char *) * nxt);
+    char **res = (char**)correct_pool_alloc(sizeof(char *) * nxt);
     char **end = NULL;
 
     for (; itr < rows; itr++) {
diff --git a/ftepp.c b/ftepp.c
index ce5dd8ac2e0044f1388c815e797478334bac97f7..88705512ac44c0985966afbc4a97c6f5a612a291 100644 (file)
--- a/ftepp.c
+++ b/ftepp.c
@@ -82,7 +82,7 @@ static uint32_t ftepp_predef_randval  = 0;
 char *ftepp_predef_date(lex_file *context) {
     struct tm *itime;
     time_t     rtime;
-    char      *value = mem_a(82);
+    char      *value = (char*)mem_a(82);
     /* 82 is enough for strftime but we also have " " in our string */
 
     (void)context;
@@ -100,7 +100,7 @@ char *ftepp_predef_date(lex_file *context) {
 char *ftepp_predef_time(lex_file *context) {
     struct tm *itime;
     time_t     rtime;
-    char      *value = mem_a(82);
+    char      *value = (char*)mem_a(82);
     /* 82 is enough for strftime but we also have " " in our string */
 
     (void)context;
diff --git a/util.c b/util.c
index 1810adfce16c94d710e063db835d5d15e21cd911..004b69b0d5daef6215a2e85d16a408607d8ea07c 100644 (file)
--- 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;