mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
GLK: Remove pointless NULL validation
Reported by GCC 12:
../scummvm/engines/glk/tads/tads2/debug.cpp: In function 'int Glk::TADS::TADS2::dbgnam(dbgcxdef*, char*, int, int)':
../scummvm/engines/glk/tads/tads2/debug.cpp:158:47: warning: the address of 'Glk::TADS::TADS2::tokthdef::tokthhsh' will never be NULL [-Waddress]
158 | if (!ctx->dbgcxtab || !ctx->dbgcxtab->tokthhsh)
| ~~~~~~~~~~~~~~~^~~~~~~~
In file included from ../scummvm/engines/glk/tads/tads2/run.h:42,
from ../scummvm/engines/glk/tads/tads2/debug.cpp:24:
../scummvm/engines/glk/tads/tads2/tokenizer.h:222:19: note: 'Glk::TADS::TADS2::tokthdef::tokthhsh' declared here
222 | tokthpdef tokthhsh[TOKHASHSIZE]; /* hash table */
| ^~~~~~~~
This commit is contained in:
committed by
Paul Gilbert
parent
1030283cf4
commit
3cd8075771
@@ -155,7 +155,7 @@ int dbgnam(dbgcxdef *ctx, char *outbuf, int typ, int val)
|
||||
{
|
||||
toksdef sym;
|
||||
|
||||
if (!ctx->dbgcxtab || !ctx->dbgcxtab->tokthhsh)
|
||||
if (!ctx->dbgcxtab)
|
||||
{
|
||||
memcpy(outbuf, "<NO SYMBOL TABLE>", (size_t)17);
|
||||
return(17);
|
||||
|
||||
Reference in New Issue
Block a user