Browse Source

Fix some silly assumptions about types.

Darryl Pogue 13 years ago
parent
commit
eb16ed7f97
  1. 4
      Sources/Plasma/CoreLib/hsMemory.cpp
  2. 4
      Sources/Plasma/CoreLib/hsStream.h
  3. 4
      Sources/Plasma/CoreLib/hsTypes.h

4
Sources/Plasma/CoreLib/hsMemory.cpp

@ -99,11 +99,11 @@ void HSMemory::Clear(void* m, UInt32 byteLen)
UInt8* memStop = mem + byteLen;
if (byteLen > 8)
{ while (UInt32(mem) & 3)
{ while (unsigned_ptr(mem) & 3)
*mem++ = 0;
UInt32* mem32 = (UInt32*)mem;
UInt32* mem32Stop = (UInt32*)(UInt32(memStop) & ~3);
UInt32* mem32Stop = (UInt32*)(unsigned_ptr(memStop) & ~3);
do {
*mem32++ = 0;
} while (mem32 < mem32Stop);

4
Sources/Plasma/CoreLib/hsStream.h

@ -200,8 +200,6 @@ public:
void ReadSwap(int count, Int16 values[]) { this->ReadSwap16(count, (UInt16*)values); }
void ReadSwap(Int32* value) { *value = (Int32)this->ReadSwap32(); }
void ReadSwap(int count, Int32 values[]) { this->ReadSwap32(count, (UInt32*)values); }
void ReadSwap(int* value) { *value = (Int32)this->ReadSwap32(); }
void ReadSwap(int count, int values[]) { this->ReadSwap32(count, (UInt32*)values); }
#ifdef STREAM_LOGGER
// Begin LogReadSwaps
virtual void LogReadSwap(Int8* value, const char* desc) { this->ReadSwap(value); }
@ -224,8 +222,6 @@ public:
void WriteSwap(int count, const Int16 values[]) { this->WriteSwap16(count, (UInt16*)values); }
void WriteSwap(Int32 value) { this->WriteSwap32((UInt32)value); }
void WriteSwap(int count, const Int32 values[]) { this->WriteSwap32(count, (UInt32*)values); }
void WriteSwap(int value) { this->WriteSwap32((UInt32)value); }
void WriteSwap(int count, const int values[]) { this->WriteSwap32(count, (UInt32*)values); }
/* Overloaded End */

4
Sources/Plasma/CoreLib/hsTypes.h

@ -74,7 +74,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#include <cstdint>
#include <stdint.h>
#endif
typedef uint8_t byte;
@ -82,7 +82,7 @@ typedef uint16_t word;
typedef uint32_t dword;
typedef uint64_t qword;
typedef size_t unsigned_ptr;
typedef uintptr_t unsigned_ptr;
typedef wchar_t wchar;

Loading…
Cancel
Save