From 17c358cb129c9f0006f8ecb892bb0c21d4b565a4 Mon Sep 17 00:00:00 2001 From: linshier Date: Tue, 9 Nov 2010 02:57:52 +0000 Subject: [PATCH] Fixed a compiling error for GCC-4.4.5. --- projects/mtg/src/TestSuiteAI.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/mtg/src/TestSuiteAI.cpp b/projects/mtg/src/TestSuiteAI.cpp index 8d40639b3..6124507ca 100644 --- a/projects/mtg/src/TestSuiteAI.cpp +++ b/projects/mtg/src/TestSuiteAI.cpp @@ -232,7 +232,8 @@ void TestSuiteState::parsePlayerState(int playerId, string s){ unsigned int value; limiter = s.find(","); if (limiter != string::npos){ - value = Rules::getMTGId(trim(s.substr(0,limiter))); + string ss = s.substr(0,limiter); // ss is needed because trim requires a non-const reference, + value = Rules::getMTGId(trim(ss)); // while in g++ functions cannot take non-const references from temporary values s = s.substr(limiter+1); }else{ value = Rules::getMTGId(trim(s)); @@ -610,4 +611,4 @@ void TestSuite::pregameTests(){ if(!sb.unitTest()) nbFailed++; } -} \ No newline at end of file +}