[Scummvm-cvs-logs] CVS: scummvm/common file.cpp,1.14,1.15 file.h,1.8,1.9

Max Horn fingolfin at users.sourceforge.net
Mon Oct 21 06:24:02 CEST 2002


Update of /cvsroot/scummvm/scummvm/common
In directory usw-pr-cvs1:/tmp/cvs-serv30223/common

Modified Files:
	file.cpp file.h 
Log Message:
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

Index: file.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/file.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- file.cpp	17 Sep 2002 21:45:13 -0000	1.14
+++ file.cpp	21 Oct 2002 13:23:24 -0000	1.15
@@ -221,27 +221,27 @@
 	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::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));
 }

Index: file.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/file.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- file.h	15 Sep 2002 19:28:34 -0000	1.8
+++ file.h	21 Oct 2002 13:23:24 -0000	1.9
@@ -54,16 +54,16 @@
 	void seek(int32 offs, int whence);
 	uint32 read(void *ptr, uint32 size);
 	byte readByte();
-	uint16 readWordLE();
-	uint32 readDwordLE();
-	uint16 readWordBE();
-	uint32 readDwordBE();
+	uint16 readUint16LE();
+	uint32 readUint32LE();
+	uint16 readUint16BE();
+	uint32 readUint32BE();
 	uint32 write(void *ptr, uint32 size);
 	void writeByte(byte value);
-	void writeWordLE(uint16 value);
-	void writeDwordLE(uint32 value);
-	void writeWordBE(uint16 value);
-	void writeDwordBE(uint32 value);
+	void writeUint16LE(uint16 value);
+	void writeUint32LE(uint32 value);
+	void writeUint16BE(uint16 value);
+	void writeUint32BE(uint32 value);
 };
 
 #endif





More information about the Scummvm-git-logs mailing list