[Scummvm-cvs-logs] scummvm master -> daa8fca001c0eddd5b0856d60aa7ecd59c7d6acc
lordhoto
lordhoto at gmail.com
Sun Jan 4 21:11:13 CET 2015
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
f1e58efe90 TEST: Fix C++11 compat warnings.
eb4d1a6925 COMMON: Add missing readUint64/readSint64 to ReadStreamEndian.
daa8fca001 TEST: Fix uint64 endian related test code.
Commit: f1e58efe90e2c3ae6740a41db4642b3e47c0c81f
https://github.com/scummvm/scummvm/commit/f1e58efe90e2c3ae6740a41db4642b3e47c0c81f
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2015-01-04T21:09:32+01:00
Commit Message:
TEST: Fix C++11 compat warnings.
Changed paths:
test/common/endian.h
diff --git a/test/common/endian.h b/test/common/endian.h
index f083d12..08e93e4 100644
--- a/test/common/endian.h
+++ b/test/common/endian.h
@@ -11,13 +11,13 @@ class EndianTestSuite : public CxxTest::TestSuite
}
void test_READ_BE_UINT64() {
- const char data[8] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF};
+ const byte data[8] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF};
uint64 value = READ_BE_UINT64(data);
TS_ASSERT_EQUALS(value, 0x123456789ABCDEFFULL);
}
void test_READ_LE_UINT64() {
- const char data[8] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF};
+ const byte data[8] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF};
uint64 value = READ_LE_UINT64(data);
TS_ASSERT_EQUALS(value, 0xFFEDCBA978563412ULL);
}
Commit: eb4d1a69255b06f93c497aabd9cf950bfe0756ec
https://github.com/scummvm/scummvm/commit/eb4d1a69255b06f93c497aabd9cf950bfe0756ec
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2015-01-04T21:09:32+01:00
Commit Message:
COMMON: Add missing readUint64/readSint64 to ReadStreamEndian.
Changed paths:
common/stream.h
diff --git a/common/stream.h b/common/stream.h
index 3021df3..abe5192 100644
--- a/common/stream.h
+++ b/common/stream.h
@@ -517,6 +517,14 @@ public:
return (_bigEndian) ? TO_BE_32(val) : TO_LE_32(val);
}
+#ifdef HAVE_INT64
+ uint64 readUint64() {
+ uint64 val;
+ read(&val, 8);
+ return (_bigEndian) ? TO_BE_64(val) : TO_LE_64(val);
+ }
+#endif
+
FORCEINLINE int16 readSint16() {
return (int16)readUint16();
}
@@ -524,6 +532,12 @@ public:
FORCEINLINE int32 readSint32() {
return (int32)readUint32();
}
+
+#ifdef HAVE_INT64
+ FORCEINLINE int64 readSint64() {
+ return (int64)readUint64();
+ }
+#endif
};
/**
Commit: daa8fca001c0eddd5b0856d60aa7ecd59c7d6acc
https://github.com/scummvm/scummvm/commit/daa8fca001c0eddd5b0856d60aa7ecd59c7d6acc
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2015-01-04T21:09:32+01:00
Commit Message:
TEST: Fix uint64 endian related test code.
This does not fix the actual implementation issues which are present right
now!
Changed paths:
test/common/endian.h
test/common/memoryreadstreamendian.h
diff --git a/test/common/endian.h b/test/common/endian.h
index 08e93e4..065b699 100644
--- a/test/common/endian.h
+++ b/test/common/endian.h
@@ -19,7 +19,7 @@ class EndianTestSuite : public CxxTest::TestSuite
void test_READ_LE_UINT64() {
const byte data[8] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF};
uint64 value = READ_LE_UINT64(data);
- TS_ASSERT_EQUALS(value, 0xFFEDCBA978563412ULL);
+ TS_ASSERT_EQUALS(value, 0xFFDEBC9A78563412ULL);
}
void test_READ_BE_UINT32() {
diff --git a/test/common/memoryreadstreamendian.h b/test/common/memoryreadstreamendian.h
index 515128e..c25ec29 100644
--- a/test/common/memoryreadstreamendian.h
+++ b/test/common/memoryreadstreamendian.h
@@ -82,7 +82,7 @@ class MemoryReadStreamEndianTestSuite : public CxxTest::TestSuite {
TS_ASSERT_EQUALS(ms.pos(), 2);
TS_ASSERT_EQUALS(ms.readUint32BE(), 0x03040506UL);
TS_ASSERT_EQUALS(ms.pos(), 6);
- TS_ASSERT_EQUALS(ms.readUint64LE(), 0x0708090A0B0C0D0EULL);
+ TS_ASSERT_EQUALS(ms.readUint64BE(), 0x0708090A0B0C0D0EULL);
TS_ASSERT_EQUALS(ms.pos(), 14);
TS_ASSERT_EQUALS(ms.readByte(), 0x0F);
TS_ASSERT_EQUALS(ms.pos(), 15);
@@ -97,7 +97,7 @@ class MemoryReadStreamEndianTestSuite : public CxxTest::TestSuite {
TS_ASSERT_EQUALS(ms.pos(), 2);
TS_ASSERT_EQUALS(ms.readUint32(), 0x06050403UL);
TS_ASSERT_EQUALS(ms.pos(), 6);
- TS_ASSERT_EQUALS(ms.readUint64LE(), 0x0E0D0C0B0A090807ULL);
+ TS_ASSERT_EQUALS(ms.readUint64(), 0x0E0D0C0B0A090807ULL);
TS_ASSERT_EQUALS(ms.pos(), 14);
TS_ASSERT_EQUALS(ms.readByte(), 0x0F);
TS_ASSERT_EQUALS(ms.pos(), 15);
@@ -112,7 +112,7 @@ class MemoryReadStreamEndianTestSuite : public CxxTest::TestSuite {
TS_ASSERT_EQUALS(ms.pos(), 2);
TS_ASSERT_EQUALS(ms.readUint32(), 0x03040506UL);
TS_ASSERT_EQUALS(ms.pos(), 6);
- TS_ASSERT_EQUALS(ms.readUint64LE(), 0x0708090A0B0C0D0EULL);
+ TS_ASSERT_EQUALS(ms.readUint64(), 0x0708090A0B0C0D0EULL);
TS_ASSERT_EQUALS(ms.pos(), 14);
TS_ASSERT_EQUALS(ms.readByte(), 0x0F);
TS_ASSERT_EQUALS(ms.pos(), 15);
More information about the Scummvm-git-logs
mailing list