From 2d48e82bbbad5f5f6b96a4a0651412e3cfc53c9c Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sun, 12 Jul 2026 21:32:30 +0200 Subject: [PATCH] Codechange: remove unneeded packing of ChunkHeader and WAVE_DOWNLOAD --- src/music/dmusic.cpp | 16 ++++++++-------- src/stdafx.h | 9 --------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/music/dmusic.cpp b/src/music/dmusic.cpp index 9503038666..0dc3b5bbed 100644 --- a/src/music/dmusic.cpp +++ b/src/music/dmusic.cpp @@ -146,18 +146,18 @@ private: }; /** A RIFF chunk header. */ -PACK_N(struct ChunkHeader { +struct ChunkHeader { FOURCC type; ///< Chunk type. DWORD length; ///< Length of the chunk, not including the chunk header itself. -}, 2); +}; /** Buffer format for a DLS wave download. */ -PACK_N(struct WAVE_DOWNLOAD { - DMUS_DOWNLOADINFO dlInfo; - ULONG ulOffsetTable[2]; - DMUS_WAVE dmWave; - DMUS_WAVEDATA dmWaveData; -}, 2); +struct WAVE_DOWNLOAD { + DMUS_DOWNLOADINFO dlInfo; ///< Request header for the to be downloaded wave data. + ULONG ulOffsetTable[2]; ///< Offsets to the \c dmWave and \c dmWaveData fields. + DMUS_WAVE dmWave; ///< Definition of the wave chunk to download. + DMUS_WAVEDATA dmWaveData; ///< The buffer the wave chunk data is written to. +}; struct PlaybackSegment { uint32_t start, end; diff --git a/src/stdafx.h b/src/stdafx.h index 3a38028156..d125c6448b 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -176,15 +176,6 @@ using namespace std::literals::string_view_literals; # define PATHSEPCHAR '/' #endif -#if defined(_MSC_VER) -# define PACK_N(type_dec, n) __pragma(pack(push, n)) type_dec; __pragma(pack(pop)) -#elif defined(__MINGW32__) -# define PRAGMA(x) _Pragma(#x) -# define PACK_N(type_dec, n) PRAGMA(pack(push, n)) type_dec; PRAGMA(pack(pop)) -#else -# define PACK_N(type_dec, n) type_dec __attribute__((__packed__, aligned(n))) -#endif - /** @def debug_inline * When making a (pure) debug build, the compiler will by default disable * inlining of functions. This has a detrimental effect on the performance of