From 7a501c1b1f4460ece6fd04e5d721bc3fed5a8315 Mon Sep 17 00:00:00 2001 From: Skoader Date: Sun, 22 Apr 2012 13:15:34 +1000 Subject: [PATCH] Update4 for MSVC10 Fix for loop scope problems. --- .../Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.cpp | 9 ++++++--- .../Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp | 3 ++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.cpp index 00de12d4..c81c7e7c 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.cpp @@ -337,7 +337,8 @@ void BigNum::DivNormalized (const BigNum & a, const BigNum & b, BigNum * remaind if (quotient) { Val borrow = 0; Val carry = 0; - for (unsigned denomIndex = 0; denomIndex != denomCount; ++denomIndex) { + unsigned denomIndex = 0; + for (; denomIndex != denomCount; ++denomIndex) { DVal product = (DVal)(Mul((*denom)[denomIndex], quotient) + carry); carry = HIGH(product); numer->SetVal(quotientIndex + denomIndex, (DVal)((DVal)(*numer)[quotientIndex + denomIndex] - (DVal)LOW(product) - (DVal)borrow), &borrow); @@ -1313,7 +1314,8 @@ void BigNum::Sub (const BigNum & a, Val b) { const unsigned count = a.Count(); SetCount(count); Val borrow = b; - for (unsigned index = 0; index < count; ++index) { + unsigned index = 0; + for (; index < count; ++index) { SetVal(index, (DVal)((DVal)a[index] - (DVal)borrow), &borrow); borrow = (Val)((Val)0 - (Val)borrow); } @@ -1330,7 +1332,8 @@ void BigNum::Sub (const BigNum & a, const BigNum & b) { const unsigned bCount = b.Count(); GrowToCount(count, true); Val borrow = 0; - for (unsigned index = 0; index < count; ++index) { + unsigned index = 0; + for (; index < count; ++index) { Val bVal = (index < bCount) ? b[index] : (Val)0; SetVal(index, (DVal)((DVal)a[index] - (DVal)bVal - (DVal)borrow), &borrow); borrow = (Val)((Val)0 - (Val)borrow); diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp index 17769cac..978aef9e 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp @@ -1241,7 +1241,8 @@ static ENetError FixupPlayerName (wchar * name) { // Trim leading and trailing whitespace and convert // multiple internal spaces into only one space unsigned nonSpaceChars = 0; - for (wchar *src = name, *dst = name; *src; ) { + wchar *dst = name; + for (wchar *src = name; *src; ) { // Skip whitespace while (*src && ICharIsSpace(*src)) src++;