decoder/dsdlib: add class DsdUint64

Merge lots of duplicate code.
This commit is contained in:
Max Kellermann
2013-10-28 23:29:23 +01:00
parent 0e8a15e813
commit 0ad2eb34c7
3 changed files with 26 additions and 25 deletions

View File

@@ -43,22 +43,21 @@
struct DsdiffHeader {
DsdId id;
uint32_t size_high, size_low;
DsdUint64 size;
DsdId format;
};
struct DsdiffChunkHeader {
DsdId id;
uint32_t size_high, size_low;
DsdUint64 size;
/**
* Read the "size" attribute from the specified header, converting it
* to the host byte order if needed.
*/
gcc_const
constexpr
uint64_t GetSize() const {
return (uint64_t(FromBE32(size_high)) << 32) |
uint64_t(FromBE32(size_low));
return size.Read();
}
};