[Scummvm-cvs-logs] scummvm master -> e81d8d8112a1dc7e81bcd7eff5b2b601f64cfd75

eriktorbjorn eriktorbjorn at telia.com
Sun Aug 18 09:10:32 CEST 2013


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

Summary:
598d1a9c9c SCUMM: Remove unnecessary NULL check, CID 1003627
b8c198aec9 SCUMM: Remove unnecessary NULL check, CID 1003628
e81d8d8112 SCUMM: Remove unnecessary NULL check, CID 1003629


Commit: 598d1a9c9c461c175dc1f57614008766bdb58107
    https://github.com/scummvm/scummvm/commit/598d1a9c9c461c175dc1f57614008766bdb58107
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2013-08-18T00:02:14-07:00

Commit Message:
SCUMM: Remove unnecessary NULL check, CID 1003627

Since ah->data is an array, it can't ever be NULL.

Changed paths:
    engines/scumm/he/script_v72he.cpp



diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp
index d4920cf..42bf9a4 100644
--- a/engines/scumm/he/script_v72he.cpp
+++ b/engines/scumm/he/script_v72he.cpp
@@ -158,7 +158,7 @@ int ScummEngine_v72he::readArray(int array, int idx2, int idx1) {
 
 	ArrayHeader *ah = (ArrayHeader *)getResourceAddress(rtString, readVar(array));
 
-	if (ah == NULL || ah->data == NULL)
+	if (!ah)
 		error("readArray: invalid array %d (%d)", array, readVar(array));
 
 	if (idx2 < (int)FROM_LE_32(ah->dim2start) || idx2 > (int)FROM_LE_32(ah->dim2end) ||


Commit: b8c198aec9ab92f22b8ddce0bf0049501e14fb62
    https://github.com/scummvm/scummvm/commit/b8c198aec9ab92f22b8ddce0bf0049501e14fb62
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2013-08-18T00:05:03-07:00

Commit Message:
SCUMM: Remove unnecessary NULL check, CID 1003628

Since ah->data is an array, it can't ever be NULL.

Changed paths:
    engines/scumm/script_v6.cpp



diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp
index a75e864..6983c51 100644
--- a/engines/scumm/script_v6.cpp
+++ b/engines/scumm/script_v6.cpp
@@ -394,7 +394,7 @@ ScummEngine_v6::ArrayHeader *ScummEngine_v6::getArray(int array) {
 int ScummEngine_v6::readArray(int array, int idx, int base) {
 	ArrayHeader *ah = getArray(array);
 
-	if (ah == NULL || ah->data == NULL)
+	if (!ah)
 		error("readArray: invalid array %d (%d)", array, readVar(array));
 
 	// WORKAROUND bug #645711. This is clearly a script bug, as this script


Commit: e81d8d8112a1dc7e81bcd7eff5b2b601f64cfd75
    https://github.com/scummvm/scummvm/commit/e81d8d8112a1dc7e81bcd7eff5b2b601f64cfd75
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2013-08-18T00:07:49-07:00

Commit Message:
SCUMM: Remove unnecessary NULL check, CID 1003629

Since _actors[i]->_sound is an array, it can't ever be NULL.

Changed paths:
    engines/scumm/actor.cpp



diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index 5c148a7..4e14473 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -1485,7 +1485,7 @@ void ScummEngine::playActorSounds() {
 	int sound;
 
 	for (i = 1; i < _numActors; i++) {
-		if (_actors[i]->_cost.soundCounter && _actors[i]->isInCurrentRoom() && _actors[i]->_sound) {
+		if (_actors[i]->_cost.soundCounter && _actors[i]->isInCurrentRoom()) {
 			_currentScript = 0xFF;
 			if (_game.version == 0) {
 				sound = v0ActorSounds[i - 1] & 0x3F;






More information about the Scummvm-git-logs mailing list