diff options
author | Max Horn | 2002-10-21 13:23:25 +0000 |
---|---|---|
committer | Max Horn | 2002-10-21 13:23:25 +0000 |
commit | 8af300fec3a760cc5c153c5be92134c1a99169a4 (patch) | |
tree | 422e11a861066b333615f602a0357944007c99e0 /common/file.cpp | |
parent | 0006197cf11187fc9756c7aba5de239cf719c4a4 (diff) | |
download | scummvm-rg350-8af300fec3a760cc5c153c5be92134c1a99169a4.tar.gz scummvm-rg350-8af300fec3a760cc5c153c5be92134c1a99169a4.tar.bz2 scummvm-rg350-8af300fec3a760cc5c153c5be92134c1a99169a4.zip |
The terms Word and DWord are somewhat Windows centric; in fact there are systems on which word is 32bit, as opposed to our 16 bits. Hence, use the uin16/uint32 naming scheme, which is not ambigious
svn-id: r5216
Diffstat (limited to 'common/file.cpp')
-rw-r--r-- | common/file.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/common/file.cpp b/common/file.cpp index 7812d1f067..c2459abb56 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -221,27 +221,27 @@ byte File::readByte() { return b ^ _encbyte; } -uint16 File::readWordLE() { +uint16 File::readUint16LE() { uint16 a = readByte(); uint16 b = readByte(); return a | (b << 8); } -uint32 File::readDwordLE() { - uint32 a = readWordLE(); - uint32 b = readWordLE(); +uint32 File::readUint32LE() { + uint32 a = readUint16LE(); + uint32 b = readUint16LE(); return (b << 16) | a; } -uint16 File::readWordBE() { +uint16 File::readUint16BE() { uint16 b = readByte(); uint16 a = readByte(); return a | (b << 8); } -uint32 File::readDwordBE() { - uint32 b = readWordBE(); - uint32 a = readWordBE(); +uint32 File::readUint32BE() { + uint32 b = readUint16BE(); + uint32 a = readUint16BE(); return (b << 16) | a; } @@ -280,22 +280,22 @@ void File::writeByte(byte value) { } } -void File::writeWordLE(uint16 value) { +void File::writeUint16LE(uint16 value) { writeByte((byte)(value & 0xff)); writeByte((byte)(value >> 8)); } -void File::writeDwordLE(uint32 value) { - writeWordLE((uint16)(value & 0xffff)); - writeWordLE((uint16)(value >> 16)); +void File::writeUint32LE(uint32 value) { + writeUint16LE((uint16)(value & 0xffff)); + writeUint16LE((uint16)(value >> 16)); } -void File::writeWordBE(uint16 value) { +void File::writeUint16BE(uint16 value) { writeByte((byte)(value >> 8)); writeByte((byte)(value & 0xff)); } -void File::writeDwordBE(uint32 value) { - writeWordBE((uint16)(value >> 16)); - writeWordBE((uint16)(value & 0xffff)); +void File::writeUint32BE(uint32 value) { + writeUint16BE((uint16)(value >> 16)); + writeUint16BE((uint16)(value & 0xffff)); } |