From 0ad2eb34c74dc128e7884552ef1f930f3f495066 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 28 Oct 2013 23:29:23 +0100 Subject: decoder/dsdlib: add class DsdUint64 Merge lots of duplicate code. --- src/decoder/DsdiffDecoderPlugin.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/decoder/DsdiffDecoderPlugin.cxx') diff --git a/src/decoder/DsdiffDecoderPlugin.cxx b/src/decoder/DsdiffDecoderPlugin.cxx index 939904d11..1dc7c7c6a 100644 --- a/src/decoder/DsdiffDecoderPlugin.cxx +++ b/src/decoder/DsdiffDecoderPlugin.cxx @@ -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(); } }; -- cgit v1.2.3