From 3cd80757715fe6b341d8b4fca503fdc1ca8da3ca Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 2 Jun 2022 23:24:57 +0300 Subject: [PATCH] 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 */ | ^~~~~~~~ --- engines/glk/tads/tads2/debug.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/glk/tads/tads2/debug.cpp b/engines/glk/tads/tads2/debug.cpp index 0cf73fc75b7..b641c3295ea 100644 --- a/engines/glk/tads/tads2/debug.cpp +++ b/engines/glk/tads/tads2/debug.cpp @@ -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, "", (size_t)17); return(17);