Browse Source

Fix a few type issues due to typedef updates

Branan Purvine-Riley 13 years ago
parent
commit
0af3d1877d
  1. 6
      Sources/Plasma/CoreLib/hsSTLStream.cpp
  2. 6
      Sources/Plasma/CoreLib/hsStream.cpp
  3. 2
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNt.cpp
  4. 2
      Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.h
  5. 10
      Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp
  6. 3
      Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h
  7. 10
      Sources/Plasma/PubUtilLib/plCompression/plZlibCompress.cpp
  8. 2
      Sources/Plasma/PubUtilLib/plJPEG/plJPEG.cpp
  9. 6
      Sources/Tools/MaxComponent/plMultistageBehComponent.cpp

6
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;
}

6
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");

2
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(

2
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; }

10
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]));

3
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 ();

10
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;
}
//

2
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();

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

Loading…
Cancel
Save