From 5f9f6c11b859924a10843ad62d74d45245bc9c2f Mon Sep 17 00:00:00 2001 From: Dale Weiler Date: Wed, 30 Jan 2013 06:49:50 +0000 Subject: [PATCH] Get it compiling with C++ compilers again. --- correct.c | 4 ++-- ftepp.c | 4 ++-- util.c | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/correct.c b/correct.c index 04bd8d1..5d872c1 100644 --- 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 ce5dd8a..8870551 100644 --- 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 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; -- 2.39.2