[Scummvm-cvs-logs] scummvm master -> 0958ac9b7fe196b0ea8459b19c7576da2686a9cc

Strangerke Strangerke at scummvm.org
Sat Feb 22 18:28:12 CET 2014


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:
0958ac9b7f BBVS: Silent some CppCheck warnings


Commit: 0958ac9b7fe196b0ea8459b19c7576da2686a9cc
    https://github.com/scummvm/scummvm/commit/0958ac9b7fe196b0ea8459b19c7576da2686a9cc
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-02-22T09:26:35-08:00

Commit Message:
BBVS: Silent some CppCheck warnings

Changed paths:
    engines/bbvs/bbvs.cpp
    engines/bbvs/detection.cpp
    engines/bbvs/minigames/bbairguitar.cpp
    engines/bbvs/minigames/bbant.cpp
    engines/bbvs/minigames/bbloogie.cpp
    engines/bbvs/minigames/bbtennis.cpp



diff --git a/engines/bbvs/bbvs.cpp b/engines/bbvs/bbvs.cpp
index eefeea0..d7e6606 100644
--- a/engines/bbvs/bbvs.cpp
+++ b/engines/bbvs/bbvs.cpp
@@ -268,10 +268,10 @@ void BbvsEngine::drawScreen() {
 }
 
 void BbvsEngine::updateGame() {
-	int currTicks, inputTicks;
+	int inputTicks;
 
 	if (_gameTicks > 0) {
-		currTicks = _system->getMillis();
+		int currTicks = _system->getMillis();
 		inputTicks = (currTicks - _gameTicks) / 17;
 		_gameTicks = currTicks - (currTicks - _gameTicks) % 17;
 	} else {
@@ -1994,7 +1994,7 @@ void BbvsEngine::walkFindPath(WalkArea *sourceWalkArea, int infoCount) {
 }
 
 int BbvsEngine::calcDistance(const Common::Point &pt1, const Common::Point &pt2) {
-	return sqrt((pt1.x - pt2.x) * (pt1.x - pt2.x) + (pt1.y - pt2.y) * (pt1.y - pt2.y));
+	return (int)sqrt((double)(pt1.x - pt2.x) * (pt1.x - pt2.x) + (pt1.y - pt2.y) * (pt1.y - pt2.y));
 }
 
 void BbvsEngine::walkFoundPath(int count) {
diff --git a/engines/bbvs/detection.cpp b/engines/bbvs/detection.cpp
index 98565c8..e738316 100644
--- a/engines/bbvs/detection.cpp
+++ b/engines/bbvs/detection.cpp
@@ -109,7 +109,7 @@ SaveStateList BbvsMetaEngine::listSaves(const char *target) const {
 	filenames = saveFileMan->listSavefiles(pattern.c_str());
 	Common::sort(filenames.begin(), filenames.end());	// Sort (hopefully ensuring we are sorted numerically..)
 	SaveStateList saveList;
-	for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); file++) {
+	for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
 		// Obtain the last 3 digits of the filename, since they correspond to the save slot
 		int slotNum = atoi(file->c_str() + file->size() - 3);
 		if (slotNum >= 0 && slotNum <= 999) {
diff --git a/engines/bbvs/minigames/bbairguitar.cpp b/engines/bbvs/minigames/bbairguitar.cpp
index 2c97bcd..6c9d32b 100644
--- a/engines/bbvs/minigames/bbairguitar.cpp
+++ b/engines/bbvs/minigames/bbairguitar.cpp
@@ -793,10 +793,10 @@ int MinigameBbAirGuitar::run(bool fromMainGame) {
 
 void MinigameBbAirGuitar::update() {
 
-	int currTicks, inputTicks;
+	int inputTicks;
 
 	if (_gameTicks > 0) {
-		currTicks = _vm->_system->getMillis();
+		int currTicks = _vm->_system->getMillis();
 		inputTicks = 3 * (currTicks - _gameTicks) / 50;
 		_gameTicks = currTicks - (currTicks - _gameTicks - 50 * inputTicks / 3);
 	} else {
diff --git a/engines/bbvs/minigames/bbant.cpp b/engines/bbvs/minigames/bbant.cpp
index abecf22..3d48132 100644
--- a/engines/bbvs/minigames/bbant.cpp
+++ b/engines/bbvs/minigames/bbant.cpp
@@ -1216,10 +1216,10 @@ int MinigameBbAnt::run(bool fromMainGame) {
 
 void MinigameBbAnt::update() {
 
-	int currTicks, inputTicks;
+	int inputTicks;
 
 	if (_gameTicks > 0) {
-		currTicks = _vm->_system->getMillis();
+		int currTicks = _vm->_system->getMillis();
 		inputTicks = 3 * (currTicks - _gameTicks) / 50;
 		_gameTicks = currTicks - (currTicks - _gameTicks - 50 * inputTicks / 3);
 	} else {
diff --git a/engines/bbvs/minigames/bbloogie.cpp b/engines/bbvs/minigames/bbloogie.cpp
index df7fec3..3f7a407 100644
--- a/engines/bbvs/minigames/bbloogie.cpp
+++ b/engines/bbvs/minigames/bbloogie.cpp
@@ -982,8 +982,8 @@ void MinigameBbLoogie::updateIndicator(int objIndex) {
 		int unk2div = loogieObj->unk2 / 8 * 8;
 		int v6 = 0;
 		if (unk2div >= 8) {
-			int v7 = 1;
 			if (unk2div != 8) {
+				int v7 = 1;
 				do {
 					v6 += 8 * kLoogieOffY[v7++];
 				} while (v7 != unk2mod);
@@ -1311,10 +1311,10 @@ int MinigameBbLoogie::run(bool fromMainGame) {
 
 void MinigameBbLoogie::update() {
 
-	int currTicks, inputTicks;
+	int inputTicks;
 
 	if (_gameTicks > 0) {
-		currTicks = _vm->_system->getMillis();
+		int currTicks = _vm->_system->getMillis();
 		inputTicks = (currTicks - _gameTicks) / 17;
 		_gameTicks = currTicks - (currTicks - _gameTicks) % 17;
 	} else {
diff --git a/engines/bbvs/minigames/bbtennis.cpp b/engines/bbvs/minigames/bbtennis.cpp
index aa9e2c2..2bee57d 100644
--- a/engines/bbvs/minigames/bbtennis.cpp
+++ b/engines/bbvs/minigames/bbtennis.cpp
@@ -1230,10 +1230,10 @@ int MinigameBbTennis::run(bool fromMainGame) {
 
 void MinigameBbTennis::update() {
 
-	int currTicks, inputTicks;
+	int inputTicks;
 
 	if (_gameTicks > 0) {
-		currTicks = _vm->_system->getMillis();
+		int currTicks = _vm->_system->getMillis();
 		inputTicks = 3 * (currTicks - _gameTicks) / 50;
 		_gameTicks = currTicks - (currTicks - _gameTicks - 50 * inputTicks / 3);
 	} else {






More information about the Scummvm-git-logs mailing list