Browse Source

Fix some more conformance difference related errors/warnings

Zrax 14 years ago
parent
commit
37a87f3b54
  1. 4
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Uuid.cpp
  2. 9
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.cpp
  3. 2
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp
  4. 8
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp

4
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Uuid.cpp

@ -146,12 +146,12 @@ bool GuidIsNil (const Uuid & uuid) {
const wchar * GuidToString (const Uuid & uuid, wchar * dst, unsigned chars) { const wchar * GuidToString (const Uuid & uuid, wchar * dst, unsigned chars) {
wchar * src; wchar * src;
RPC_STATUS s; RPC_STATUS s;
s = UuidToStringW( (GUID *) &uuid, &src ); s = UuidToStringW( (GUID *) &uuid, (RPC_WSTR*)&src );
if (RPC_S_OK == s) if (RPC_S_OK == s)
StrCopy(dst, src, chars); StrCopy(dst, src, chars);
else else
StrCopy(dst, L"", chars); StrCopy(dst, L"", chars);
RpcStringFreeW(&src); RpcStringFreeW( (RPC_WSTR *)&src );
return dst; return dst;
} }

9
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.cpp

@ -321,7 +321,8 @@ void BigNum::DivNormalized (const BigNum & a, const BigNum & b, BigNum * remaind
if (quotient) { if (quotient) {
Val borrow = 0; Val borrow = 0;
Val carry = 0; Val carry = 0;
for (unsigned denomIndex = 0; denomIndex != denomCount; ++denomIndex) { unsigned denomIndex;
for (denomIndex = 0; denomIndex != denomCount; ++denomIndex) {
DVal product = (DVal)(Mul((*denom)[denomIndex], quotient) + carry); DVal product = (DVal)(Mul((*denom)[denomIndex], quotient) + carry);
carry = HIGH(product); carry = HIGH(product);
numer->SetVal(quotientIndex + denomIndex, (DVal)((DVal)(*numer)[quotientIndex + denomIndex] - (DVal)LOW(product) - (DVal)borrow), &borrow); numer->SetVal(quotientIndex + denomIndex, (DVal)((DVal)(*numer)[quotientIndex + denomIndex] - (DVal)LOW(product) - (DVal)borrow), &borrow);
@ -1297,7 +1298,8 @@ void BigNum::Sub (const BigNum & a, Val b) {
const unsigned count = a.Count(); const unsigned count = a.Count();
SetCount(count); SetCount(count);
Val borrow = b; Val borrow = b;
for (unsigned index = 0; index < count; ++index) { unsigned index;
for (index = 0; index < count; ++index) {
SetVal(index, (DVal)((DVal)a[index] - (DVal)borrow), &borrow); SetVal(index, (DVal)((DVal)a[index] - (DVal)borrow), &borrow);
borrow = (Val)((Val)0 - (Val)borrow); borrow = (Val)((Val)0 - (Val)borrow);
} }
@ -1314,7 +1316,8 @@ void BigNum::Sub (const BigNum & a, const BigNum & b) {
const unsigned bCount = b.Count(); const unsigned bCount = b.Count();
GrowToCount(count, true); GrowToCount(count, true);
Val borrow = 0; Val borrow = 0;
for (unsigned index = 0; index < count; ++index) { unsigned index;
for (index = 0; index < count; ++index) {
Val bVal = (index < bCount) ? b[index] : (Val)0; Val bVal = (index < bCount) ? b[index] : (Val)0;
SetVal(index, (DVal)((DVal)a[index] - (DVal)bVal - (DVal)borrow), &borrow); SetVal(index, (DVal)((DVal)a[index] - (DVal)bVal - (DVal)borrow), &borrow);
borrow = (Val)((Val)0 - (Val)borrow); borrow = (Val)((Val)0 - (Val)borrow);

2
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp

@ -48,6 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <time.h> #include <time.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <errno.h>
#if HS_BUILD_FOR_WIN32 #if HS_BUILD_FOR_WIN32
@ -57,7 +58,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#if HS_BUILD_FOR_UNIX #if HS_BUILD_FOR_UNIX
#include <unistd.h> #include <unistd.h>
#include <errno.h>
#include <utime.h> #include <utime.h>
#endif #endif

8
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp

@ -456,15 +456,15 @@ bool plStatusLog::IReOpen( void )
ext = L".elf"; ext = L".elf";
#endif #endif
wchar fileToOpen[MAX_PATH]; wchar fileToOpen[MAX_PATH];
swprintf(fileToOpen, L"%s.0%s", fileNoExt, ext); swprintf(fileToOpen, MAX_PATH, L"%s.0%s", fileNoExt, ext);
if (!(fFlags & kDontRotateLogs)) if (!(fFlags & kDontRotateLogs))
{ {
wchar work[MAX_PATH], work2[MAX_PATH]; wchar work[MAX_PATH], work2[MAX_PATH];
swprintf(work, L"%s.3%s",fileNoExt,ext); swprintf(work, MAX_PATH, L"%s.3%s",fileNoExt,ext);
_wremove(work); _wremove(work);
swprintf(work2, L"%s.2%s",fileNoExt,ext); swprintf(work2, MAX_PATH, L"%s.2%s",fileNoExt,ext);
_wrename(work2, work); _wrename(work2, work);
swprintf(work, L"%s.1%s",fileNoExt,ext); swprintf(work, MAX_PATH, L"%s.1%s",fileNoExt,ext);
_wrename(work, work2); _wrename(work, work2);
_wrename(fileToOpen, work); _wrename(fileToOpen, work);
} }

Loading…
Cancel
Save