From Olaf, "there are more dubious calls to istream::readsome instead of

istream::read. IMHO it does make no sense here and potentially breaks
this plugin."
This commit is contained in:
Robert Osfield
2007-05-24 09:49:22 +00:00
parent babee83194
commit 6bf7fec64e

View File

@@ -46,14 +46,14 @@ static inline void swap(unsigned& x, bool isSwapped)
static inline unsigned char readByte(std::istream& stream) static inline unsigned char readByte(std::istream& stream)
{ {
unsigned char x; unsigned char x;
stream.readsome(reinterpret_cast<std::istream::char_type*>(&x), 1); stream.read(reinterpret_cast<std::istream::char_type*>(&x), 1);
return x; return x;
} }
static inline unsigned short readShort(std::istream& stream, bool isSwapped) static inline unsigned short readShort(std::istream& stream, bool isSwapped)
{ {
unsigned short x; unsigned short x;
stream.readsome(reinterpret_cast<std::istream::char_type*>(&x), 2); stream.read(reinterpret_cast<std::istream::char_type*>(&x), 2);
swap(x, isSwapped); swap(x, isSwapped);
return x; return x;
} }
@@ -61,7 +61,7 @@ static inline unsigned short readShort(std::istream& stream, bool isSwapped)
static inline unsigned readInt(std::istream& stream, bool isSwapped) static inline unsigned readInt(std::istream& stream, bool isSwapped)
{ {
unsigned x; unsigned x;
stream.readsome(reinterpret_cast<std::istream::char_type*>(&x), 4); stream.read(reinterpret_cast<std::istream::char_type*>(&x), 4);
swap(x, isSwapped); swap(x, isSwapped);
return x; return x;
} }