mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
use field_offset to hide the nastyness
This commit is contained in:
parent
b130da8e12
commit
22f465dabe
1 changed files with 1 additions and 1 deletions
|
@ -72,7 +72,7 @@ hashtab_t *
|
||||||
Hash_NewTable (int tsize, const char *(*gk)(void*,void*), void (*f)(void*,void*),
|
Hash_NewTable (int tsize, const char *(*gk)(void*,void*), void (*f)(void*,void*),
|
||||||
void *ud)
|
void *ud)
|
||||||
{
|
{
|
||||||
hashtab_t *tab = calloc (1, (size_t)&((hashtab_t*)0)->tab[tsize]);
|
hashtab_t *tab = calloc (1, field_offset (hashtab_t, tab[tsize]));
|
||||||
if (!tab)
|
if (!tab)
|
||||||
return 0;
|
return 0;
|
||||||
tab->tab_size = tsize;
|
tab->tab_size = tsize;
|
||||||
|
|
Loading…
Reference in a new issue