[Scummvm-git-logs] scummvm master -> 5bbb675ad0cc71ee0f65ef516351c82f33e78f1f

sev- noreply at scummvm.org
Fri Jun 3 18:41:15 UTC 2022


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
5bbb675ad0 GOB: Remove needless NULL validation


Commit: 5bbb675ad0cc71ee0f65ef516351c82f33e78f1f
    https://github.com/scummvm/scummvm/commit/5bbb675ad0cc71ee0f65ef516351c82f33e78f1f
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2022-06-03T20:41:13+02:00

Commit Message:
GOB: Remove needless NULL validation

Reported by GCC 12:

goblin.cpp: In destructor 'virtual Gob::Goblin::~Goblin()':
goblin.cpp:110:77: warning: comparing the result of pointer addition '(((Gob::Goblin*)this)->Gob::Goblin::_goblins[i]->Gob::Goblin::Gob_Object::realStateMach + ((sizetype)(((long long unsigned int)state) * 48)))' and NULL [-Waddress]
  110 |                                         if (_goblins[i]->realStateMach[state])
      |                                                                             ^

Changed paths:
    engines/gob/goblin.cpp


diff --git a/engines/gob/goblin.cpp b/engines/gob/goblin.cpp
index b9760d255d9..7f822c84c04 100644
--- a/engines/gob/goblin.cpp
+++ b/engines/gob/goblin.cpp
@@ -107,10 +107,8 @@ Goblin::~Goblin() {
 		if (_goblins[i]) {
 			if (_goblins[i]->realStateMach) {
 				for (state = 0; state < (i == 3 ? 70 : 40); state++)
-					if (_goblins[i]->realStateMach[state])
-						for (col = 0; col < 6; col++)
-							if (_goblins[i]->realStateMach[state][col])
-								delete _goblins[i]->realStateMach[state][col];
+					for (col = 0; col < 6; col++)
+						delete _goblins[i]->realStateMach[state][col];
 				delete[] _goblins[i]->realStateMach;
 			}
 			delete _goblins[i];




More information about the Scummvm-git-logs mailing list