Fix to handling of big/little endian in trpage_readbuf sent in by Randall Hopper,

and a waning fix.
This commit is contained in:
Robert Osfield 2002-03-14 15:26:55 +00:00
parent fea861e013
commit 3a4efd335a
2 changed files with 4 additions and 4 deletions

View File

@ -579,7 +579,7 @@ public:
trpgrAppFile(trpgEndian,const char *);
virtual ~trpgrAppFile(void);
virtual bool Read(trpgMemReadBuffer *,int32 offset);
virtual bool Read(char *data,int32 offset,int32 dataSize);
virtual bool Read(char *data,int32 offset,uint32 dataSize);
bool isValid(void) const;
protected:

View File

@ -469,7 +469,7 @@ bool trpgrAppFile::Read(trpgMemReadBuffer *buf,int32 offset)
// Byteswap if necessary
if (ness != cpuNess)
trpg_byteswap_int(len);
len = trpg_byteswap_int(len);
if (len < 0) {
valid = false;
@ -496,7 +496,7 @@ bool trpgrAppFile::Read(trpgMemReadBuffer *buf,int32 offset)
check the length against the size of the memory
passed into dataSize.
*/
bool trpgrAppFile::Read(char *data,int32 offset,int32 dataSize)
bool trpgrAppFile::Read(char *data,int32 offset,uint32 dataSize)
{
if (!valid) return false;
@ -516,7 +516,7 @@ bool trpgrAppFile::Read(char *data,int32 offset,int32 dataSize)
// Byteswap if necessary
if (ness != cpuNess)
trpg_byteswap_int(len);
len = trpg_byteswap_int(len);
if (len < 0) {
valid = false;