From 3a4efd335af9d3202fd9eb4f06f9ff709cb8b81b Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 14 Mar 2002 15:26:55 +0000 Subject: [PATCH] Fix to handling of big/little endian in trpage_readbuf sent in by Randall Hopper, and a waning fix. --- src/osgPlugins/txp/trpage_io.h | 2 +- src/osgPlugins/txp/trpage_readbuf.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/osgPlugins/txp/trpage_io.h b/src/osgPlugins/txp/trpage_io.h index 44e19e39e..31eef9725 100644 --- a/src/osgPlugins/txp/trpage_io.h +++ b/src/osgPlugins/txp/trpage_io.h @@ -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: diff --git a/src/osgPlugins/txp/trpage_readbuf.cpp b/src/osgPlugins/txp/trpage_readbuf.cpp index 1e5760204..f68467535 100644 --- a/src/osgPlugins/txp/trpage_readbuf.cpp +++ b/src/osgPlugins/txp/trpage_readbuf.cpp @@ -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;