From e5a284a2bafd1e48525b3b3c4fbfe2464cce7c68 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Thu, 6 Dec 2012 12:34:32 -0500 Subject: [PATCH] fix compiling warnings / error --- src/client/Client.cpp | 2 +- src/client/GameSave.cpp | 8 ++++---- src/game/GameModel.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/Client.cpp b/src/client/Client.cpp index fb14050cf..cf830a85f 100644 --- a/src/client/Client.cpp +++ b/src/client/Client.cpp @@ -1612,7 +1612,7 @@ std::vector > * Client::GetTags(int start, int count { json::Number tagCount = tagsArray[j]["Count"]; json::String tag = tagsArray[j]["Tag"]; - tagArray->push_back(std::pair(tag.Value(), tagCount.Value())); + tagArray->push_back(std::pair(tag.Value(), (int)tagCount.Value())); } } catch (json::Exception &e) diff --git a/src/client/GameSave.cpp b/src/client/GameSave.cpp index 1751c5421..a4d654ff1 100644 --- a/src/client/GameSave.cpp +++ b/src/client/GameSave.cpp @@ -259,9 +259,9 @@ void GameSave::setSize(int newWidth, int newHeight) blockMapPtr = new unsigned char[blockHeight*blockWidth]; std::fill(blockMapPtr, blockMapPtr+(blockHeight*blockWidth), 0); fanVelXPtr = new float[(blockHeight)*(blockWidth)]; - std::fill(fanVelXPtr, fanVelXPtr+((blockHeight)*(blockWidth)), 0); + std::fill(fanVelXPtr, fanVelXPtr+((blockHeight)*(blockWidth)), 0.0f); fanVelYPtr = new float[(blockHeight)*(blockWidth)]; - std::fill(fanVelYPtr, fanVelYPtr+((blockHeight)*(blockWidth)), 0); + std::fill(fanVelYPtr, fanVelYPtr+((blockHeight)*(blockWidth)), 0.0f); blockMap = new unsigned char*[blockHeight]; for(int y = 0; y < blockHeight; y++) @@ -330,9 +330,9 @@ void GameSave::Transform(matrix2d transform, vector2d translate) blockMapPtrNew = new unsigned char[newBlockHeight*newBlockWidth]; std::fill(blockMapPtrNew, blockMapPtrNew+(newBlockHeight*newBlockWidth), 0); fanVelXPtrNew = new float[newBlockHeight*newBlockWidth]; - std::fill(fanVelXPtrNew, fanVelXPtrNew+(newBlockHeight*newBlockWidth), 0); + std::fill(fanVelXPtrNew, fanVelXPtrNew+(newBlockHeight*newBlockWidth), 0.0f); fanVelYPtrNew = new float[(newBlockHeight)*(newBlockWidth)]; - std::fill(fanVelYPtrNew, fanVelYPtrNew+(newBlockHeight*newBlockWidth), 0); + std::fill(fanVelYPtrNew, fanVelYPtrNew+(newBlockHeight*newBlockWidth), 0.0f); blockMapNew = new unsigned char*[newBlockHeight]; for(int y = 0; y < newBlockHeight; y++) diff --git a/src/game/GameModel.cpp b/src/game/GameModel.cpp index 71d926355..b0178af9e 100644 --- a/src/game/GameModel.cpp +++ b/src/game/GameModel.cpp @@ -321,7 +321,7 @@ void GameModel::BuildMenus() std::cout << "Brushes: Skipping " << brushFiles[i] << ". Could not open" << std::endl; continue; } - int dimension = std::sqrt(brushData.size()); + int dimension = std::sqrt((float)brushData.size()); if(dimension * dimension != brushData.size()) { std::cout << "Brushes: Skipping " << brushFiles[i] << ". Invalid bitmap size" << std::endl;