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:
Orgad Shaneh
2022-06-02 18:30:27 -07:00
committed by Paul Gilbert
parent 1030283cf4
commit 3cd8075771
+1 -1
View File
@@ -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);