1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-19 11:49:09 +00:00

Update4 for MSVC10

Fix for loop scope problems.
This commit is contained in:
Skoader
2012-04-22 13:15:34 +10:00
parent f8c3f7ac31
commit 7a501c1b1f
2 changed files with 8 additions and 4 deletions

View File

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

View File

@ -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++;