BBVS: Silent some CppCheck warnings

This commit is contained in:
Strangerke 2014-02-22 18:26:35 +01:00
parent 59f440c36a
commit 0958ac9b7f
6 changed files with 13 additions and 13 deletions

View File

@ -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) {

View File

@ -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) {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {