diff --git a/JGE/include/DebugRoutines.h b/JGE/include/DebugRoutines.h index 43569b162..a3cf611d7 100644 --- a/JGE/include/DebugRoutines.h +++ b/JGE/include/DebugRoutines.h @@ -18,9 +18,9 @@ using namespace std; template std::string ToHex(T* pointer) { - std::ostringstream stream; - stream << hex << showbase << setfill('0') << setw(8) << (uint64_t) pointer; - return stream.str(); + std::ostringstream stream; + stream << hex << showbase << setfill('0') << setw(8) << (uint64_t) pointer; + return stream.str(); } #ifdef LINUX @@ -42,9 +42,9 @@ std::string ToHex(T* pointer) #else // CAPTURE_STDERR #define DebugTrace(inString) \ { \ - std::ostringstream stream; \ - stream << inString; \ - qDebug("%s", stream.str().c_str()); \ + std::ostringstream stream; \ + stream << inString; \ + qDebug("%s", stream.str().c_str()); \ } #endif // CAPTURE_STDERR @@ -52,16 +52,16 @@ std::string ToHex(T* pointer) #include #define DebugTrace(inString) \ { \ - std::ostringstream stream; \ - stream << inString; \ - __android_log_write(ANDROID_LOG_DEBUG, "Wagic", stream.str().c_str());\ + std::ostringstream stream; \ + stream << inString; \ + __android_log_write(ANDROID_LOG_DEBUG, "Wagic", stream.str().c_str());\ } #else #define DebugTrace(inString) \ { \ std::ostringstream stream; \ stream << inString << std::endl; \ - OutputDebugStringA(stream.str().c_str()); \ + OutputDebugStringA(stream.str().c_str()); \ } #endif // QT_CONFIG #endif // Win32, Linux @@ -71,7 +71,7 @@ std::string ToHex(T* pointer) #ifndef DebugTrace #define DebugTrace(inString) \ { \ - std::cerr << inString << std::endl; \ + std::cerr << inString << std::endl; \ } #endif //DEBUG #endif diff --git a/projects/mtg/include/utils.h b/projects/mtg/include/utils.h index 612874c59..b598193a2 100644 --- a/projects/mtg/include/utils.h +++ b/projects/mtg/include/utils.h @@ -77,7 +77,7 @@ public: RandomGenerator(unsigned int seed = -1, bool doLog = false) : log(doLog) { if(seed != (unsigned int)-1) srand(seed);}; void loadRandValues(string s); ostream& saveUsedRandValues(ostream& out) const; - ostream& saveLoadedRandValues(ostream& out); + ostream& saveLoadedRandValues(ostream& out) const; int random(); void setSeed(unsigned int seed) { srand(seed); }; template void random_shuffle(Iter first, Iter last) diff --git a/projects/mtg/src/TestSuiteAI.cpp b/projects/mtg/src/TestSuiteAI.cpp index 0a3df4796..508b157e9 100644 --- a/projects/mtg/src/TestSuiteAI.cpp +++ b/projects/mtg/src/TestSuiteAI.cpp @@ -852,7 +852,7 @@ void TestSuiteGame::initGame() p->life = initState.players[i]->life; p->poisonCount = initState.players[i]->poisonCount; stringstream stream; - stream << initState.players[i]->getRandomGenerator()->saveLoadedRandValues(stream); + initState.players[i]->getRandomGenerator()->saveLoadedRandValues(stream); p->getRandomGenerator()->loadRandValues(stream.str()); MTGGameZone * playerZones[] = { p->game->graveyard, p->game->library, p->game->hand, p->game->inPlay, p->game->removedFromGame }; MTGGameZone * loadedPlayerZones[] = { initState.players[i]->game->graveyard, diff --git a/projects/mtg/src/utils.cpp b/projects/mtg/src/utils.cpp index 544fb35ff..63eaac718 100644 --- a/projects/mtg/src/utils.cpp +++ b/projects/mtg/src/utils.cpp @@ -49,9 +49,9 @@ ostream& RandomGenerator::saveUsedRandValues(ostream& out) const return out; } -ostream& RandomGenerator::saveLoadedRandValues(ostream& out) +ostream& RandomGenerator::saveLoadedRandValues(ostream& out) const { - list::iterator ite; + list::const_iterator ite; for(ite=loadedRandomValues.begin(); ite != loadedRandomValues.end(); ite++) { out << *ite << ",";