mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-21 10:21:03 +00:00
Get it compiling with C++ compilers again.
This commit is contained in:
parent
1916a6e339
commit
5f9f6c11b8
3 changed files with 8 additions and 8 deletions
|
@ -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++) {
|
||||
|
|
4
ftepp.c
4
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;
|
||||
|
|
8
util.c
8
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;
|
||||
|
|
Loading…
Reference in a new issue