Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLK: Remove pointless NULL validation #3947

Merged
merged 1 commit into from Jun 3, 2022
Merged

Conversation

orgads
Copy link
Contributor

@orgads orgads commented Jun 2, 2022

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 */
      |                   ^~~~~~~~

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 */
      |                   ^~~~~~~~
@aquadran aquadran assigned dreammaster and unassigned dreammaster Jun 2, 2022
@aquadran aquadran requested a review from dreammaster Jun 2, 2022
@dreammaster
Copy link
Member

@dreammaster dreammaster commented Jun 3, 2022

Looks good, thanks

@dreammaster dreammaster merged commit 3cd8075 into scummvm:master Jun 3, 2022
8 checks passed
@orgads orgads deleted the glk-null branch Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants