From c472046cbb6f2b9361b87bdaa00325be681eb8b8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 12 Mar 2023 20:21:37 +0100 Subject: [PATCH] decoder/dsdiff: use PackedBE64 instead of DffDsdUint64 --- src/decoder/plugins/DsdLib.hxx | 11 ----------- src/decoder/plugins/DsdiffDecoderPlugin.cxx | 6 +++--- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/decoder/plugins/DsdLib.hxx b/src/decoder/plugins/DsdLib.hxx index 8f10ee7f6..45cb3be86 100644 --- a/src/decoder/plugins/DsdLib.hxx +++ b/src/decoder/plugins/DsdLib.hxx @@ -31,17 +31,6 @@ public: } }; -class DffDsdUint64 { - uint32_t hi; - uint32_t lo; - -public: - constexpr uint64_t Read() const { - return (uint64_t(FromBE32(hi)) << 32) | - uint64_t(FromBE32(lo)); - } -}; - bool dsdlib_skip_to(DecoderClient *client, InputStream &is, offset_type offset); diff --git a/src/decoder/plugins/DsdiffDecoderPlugin.cxx b/src/decoder/plugins/DsdiffDecoderPlugin.cxx index 064a9e030..e325185cd 100644 --- a/src/decoder/plugins/DsdiffDecoderPlugin.cxx +++ b/src/decoder/plugins/DsdiffDecoderPlugin.cxx @@ -22,13 +22,13 @@ struct DsdiffHeader { DsdId id; - DffDsdUint64 size; + PackedBE64 size; DsdId format; }; struct DsdiffChunkHeader { DsdId id; - DffDsdUint64 size; + PackedBE64 size; /** * Read the "size" attribute from the specified header, converting it @@ -36,7 +36,7 @@ struct DsdiffChunkHeader { */ [[nodiscard]] constexpr uint64_t GetSize() const { - return size.Read(); + return size; } /**