Use alloca instead of a c++ vla for W_HashLumpName
This commit is contained in:
parent
1e0ee984ee
commit
eed7625a45
2 changed files with 1 additions and 2 deletions
|
|
@ -534,7 +534,6 @@ target_compile_options(SRB2SDL2 PRIVATE
|
||||||
-Wno-unused-function
|
-Wno-unused-function
|
||||||
-Wno-unused-but-set-variable
|
-Wno-unused-but-set-variable
|
||||||
-Wno-unused-private-field
|
-Wno-unused-private-field
|
||||||
-Wno-vla-extension
|
|
||||||
>
|
>
|
||||||
|
|
||||||
# GNU
|
# GNU
|
||||||
|
|
|
||||||
|
|
@ -462,7 +462,7 @@ FUNCINLINE static ATTRINLINE void W_InvalidateLumpnumCache(void)
|
||||||
|
|
||||||
FUNCINLINE static ATTRINLINE UINT32 W_HashLumpName(const char *name, size_t len)
|
FUNCINLINE static ATTRINLINE UINT32 W_HashLumpName(const char *name, size_t len)
|
||||||
{
|
{
|
||||||
char uname[len + 1];
|
char *uname = (char *)alloca(len + 1);
|
||||||
strlcpy(uname, name, len + 1);
|
strlcpy(uname, name, len + 1);
|
||||||
strupr(uname);
|
strupr(uname);
|
||||||
return HASH32(uname, len);
|
return HASH32(uname, len);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue