diff --git a/Sources/Plasma/CoreLib/hsSTLStream.cpp b/Sources/Plasma/CoreLib/hsSTLStream.cpp index 4ed08c4c..aa7eb174 100644 --- a/Sources/Plasma/CoreLib/hsSTLStream.cpp +++ b/Sources/Plasma/CoreLib/hsSTLStream.cpp @@ -280,7 +280,7 @@ hsBool hsNamedPipeStream::ICheckOverlappedResult(BOOL result, UInt32 &numTransfe { if (WaitForSingleObject(fOverlap.hEvent, fTimeout) == WAIT_OBJECT_0) { - BOOL oResult = GetOverlappedResult(fPipe, &fOverlap, &numTransferred, FALSE); + BOOL oResult = GetOverlappedResult(fPipe, &fOverlap, (LPDWORD)&numTransferred, FALSE); if (oResult) return true; hsAssert(oResult, "GetOverlappedResult failed"); @@ -300,7 +300,7 @@ hsBool hsNamedPipeStream::IRead(UInt32 byteCount, void *buffer, UInt32 &numRead) if (fPipe != INVALID_HANDLE_VALUE && fReadMode) { - BOOL result = ReadFile(fPipe, buffer, byteCount, &numRead, &fOverlap); + BOOL result = ReadFile(fPipe, buffer, byteCount, (LPDWORD)&numRead, &fOverlap); if (ICheckOverlappedResult(result, numRead)) return true; } @@ -318,7 +318,7 @@ hsBool hsNamedPipeStream::IWrite(UInt32 byteCount, const void *buffer, UInt32 &n if (fPipe != INVALID_HANDLE_VALUE && !fReadMode) { - BOOL result = WriteFile(fPipe, buffer, byteCount, &numWritten, &fOverlap); + BOOL result = WriteFile(fPipe, buffer, byteCount, (LPDWORD)&numWritten, &fOverlap); if (ICheckOverlappedResult(result, numWritten)) return true; } diff --git a/Sources/Plasma/CoreLib/hsStream.cpp b/Sources/Plasma/CoreLib/hsStream.cpp index 7fc2fe0e..8e0b38d3 100644 --- a/Sources/Plasma/CoreLib/hsStream.cpp +++ b/Sources/Plasma/CoreLib/hsStream.cpp @@ -827,7 +827,7 @@ UInt32 hsFileStream::Read(UInt32 bytes, void* buffer) #elif HS_BUILD_FOR_WIN32 UInt32 rBytes; - ReadFile((HANDLE)fRef, buffer, bytes, &rBytes, nil); + ReadFile((HANDLE)fRef, buffer, bytes, (LPDWORD)&rBytes, nil); if(bytes == rBytes) return bytes; else @@ -867,7 +867,7 @@ UInt32 hsFileStream::Write(UInt32 bytes, const void* buffer) return 0; #elif HS_BUILD_FOR_WIN32 UInt32 wBytes; - WriteFile((HANDLE)fRef, buffer, bytes, &wBytes, nil); + WriteFile((HANDLE)fRef, buffer, bytes, (LPDWORD)&wBytes, nil); if(bytes == wBytes) return bytes; else @@ -904,7 +904,7 @@ hsBool hsFileStream::AtEnd() #elif HS_BUILD_FOR_WIN32 UInt32 bytes; - PeekNamedPipe((void*)fRef, nil, 0, nil, &bytes, nil); + PeekNamedPipe((void*)fRef, nil, 0, nil, (LPDWORD)&bytes, nil); return bytes>0; #else hsAssert(0,"No hsStream::AtEnd() implemented for this stream class"); diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNt.cpp b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNt.cpp index e80ef064..1dd13f40 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNt.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNt.cpp @@ -251,7 +251,7 @@ static unsigned THREADCALL NtWorkerThreadProc (AsyncThread * thread) { // process I/O operations { - dword bytes; + DWORD bytes; NtObject * ntObj; Operation * op; (void) GetQueuedCompletionStatus( diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.h b/Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.h index 1c619c65..ba7f3cb4 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.h +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.h @@ -113,8 +113,6 @@ public: operator bool() const { return IToBool(); } operator const CharPtr() const { return IToString(); } operator char() const { return IToChar(); } - operator unsigned int() const { return IToUInt(); } - operator int() const { return IToInt(); } void SetType(Types t) { fType=t; } UInt8 GetType( void ) const { return fType; } diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp index 75664efb..113198df 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp @@ -1125,15 +1125,7 @@ void CSrvPackBuffer::AddString (const wchar str[]) { } //============================================================================ -void CSrvPackBuffer::AddDWordArray (const dword * arr, unsigned count) { - // Don't let large counts cause pointer wrap - count &= 0x00ffffff; - AddData(arr, count * sizeof(arr[0])); -} - -//============================================================================ -void CSrvPackBuffer::AddDWordArray (const unsigned * arr, unsigned count) { - COMPILER_ASSERT(sizeof(unsigned) == sizeof(dword)); +void CSrvPackBuffer::AddDWordArray (const UInt32 * arr, unsigned count) { // Don't let large counts cause pointer wrap count &= 0x00ffffff; AddData(arr, count * sizeof(arr[0])); diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h index 4af2d3c7..a461cf44 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h @@ -470,8 +470,7 @@ public: void * Alloc (unsigned bytes); void AddData (const void * ptr, unsigned bytes); void AddString (const wchar str[]); - void AddDWordArray (const dword * arr, unsigned count); - void AddDWordArray (const unsigned * arr, unsigned count); + void AddDWordArray (const UInt32 * arr, unsigned count); // add new "Add..." methods here as needed unsigned Size (); diff --git a/Sources/Plasma/PubUtilLib/plCompression/plZlibCompress.cpp b/Sources/Plasma/PubUtilLib/plCompression/plZlibCompress.cpp index 7c2a807d..0a5eab8a 100644 --- a/Sources/Plasma/PubUtilLib/plCompression/plZlibCompress.cpp +++ b/Sources/Plasma/PubUtilLib/plCompression/plZlibCompress.cpp @@ -46,14 +46,20 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com hsBool plZlibCompress::Uncompress(UInt8* bufOut, UInt32* bufLenOut, const UInt8* bufIn, UInt32 bufLenIn) { - return (uncompress(bufOut, bufLenOut, bufIn, bufLenIn) == Z_OK); + unsigned long buflen_out; + bool result = (uncompress(bufOut, &buflen_out, bufIn, bufLenIn) == Z_OK); + *bufLenOut = buflen_out; + return result; } hsBool plZlibCompress::Compress(UInt8* bufOut, UInt32* bufLenOut, const UInt8* bufIn, UInt32 bufLenIn) { // according to compress doc, the bufOut buffer should be at least .1% larger than source buffer, plus 12 bytes. hsAssert(*bufLenOut>=(int)(bufLenIn*1.1+12), "bufOut compress buffer is not large enough"); - return (compress(bufOut, bufLenOut, bufIn, bufLenIn) == Z_OK); + unsigned long buflen_out; + bool result = (compress(bufOut, &buflen_out, bufIn, bufLenIn) == Z_OK); + *bufLenOut = buflen_out; + return result; } // diff --git a/Sources/Plasma/PubUtilLib/plJPEG/plJPEG.cpp b/Sources/Plasma/PubUtilLib/plJPEG/plJPEG.cpp index 5feefe14..3dd655dc 100644 --- a/Sources/Plasma/PubUtilLib/plJPEG/plJPEG.cpp +++ b/Sources/Plasma/PubUtilLib/plJPEG/plJPEG.cpp @@ -299,7 +299,7 @@ hsBool plJPEG::IWrite( plMipmap *source, hsStream *outStream ) } UInt8 *bufferAddr = jpgBuffer; - UInt32 bufferSize = jpgBufferSize; + unsigned long bufferSize = jpgBufferSize; jpeg_mem_dest( &cinfo, &bufferAddr, &bufferSize ); cinfo.image_width = source->GetWidth(); diff --git a/Sources/Tools/MaxComponent/plMultistageBehComponent.cpp b/Sources/Tools/MaxComponent/plMultistageBehComponent.cpp index 0da9f929..43ab6b50 100644 --- a/Sources/Tools/MaxComponent/plMultistageBehComponent.cpp +++ b/Sources/Tools/MaxComponent/plMultistageBehComponent.cpp @@ -492,11 +492,11 @@ public: virtual void Skip(UInt32 deltaByteCount) { hsAssert(0, "Not supported"); } virtual void Rewind() { hsAssert(0, "Not supported"); } - virtual UInt32 GetEOF() { return fLoad->CurChunkLength(); } + virtual UInt32 GetEOF() { return (UInt32)fLoad->CurChunkLength(); } virtual UInt32 Read(UInt32 byteCount, void * buffer) { - UInt32 numRead = 0; + ULONG numRead = 0; hsAssert(fLoad, "No Max ILoad!"); if (fLoad) fLoad->Read(buffer, byteCount, &numRead); @@ -505,7 +505,7 @@ public: } virtual UInt32 Write(UInt32 byteCount, const void* buffer) { - UInt32 numWritten; + ULONG numWritten; hsAssert(fSave, "No Max ISave!"); if (fSave) fSave->Write(buffer, byteCount, &numWritten);