2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 10:37:41 -04:00

Fix a few type issues due to typedef updates

This commit is contained in:
Branan Purvine-Riley
2011-10-24 23:25:20 -07:00
parent 2980fbf53c
commit 0af3d1877d
9 changed files with 21 additions and 26 deletions

View File

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

View File

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

View File

@ -251,7 +251,7 @@ static unsigned THREADCALL NtWorkerThreadProc (AsyncThread * thread) {
// process I/O operations
{
dword bytes;
DWORD bytes;
NtObject * ntObj;
Operation * op;
(void) GetQueuedCompletionStatus(

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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