From f3951214c164babf40212ce41339a2e12d42d01d Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Wed, 3 Sep 2025 18:22:50 +0100 Subject: [PATCH] Codechange: Shuffle MusicSongInfo members to reduce alignment padding. (#14580) --- src/base_media_music.h | 14 +++++++------- src/music_gui.cpp | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/base_media_music.h b/src/base_media_music.h index 86b3e8cad7..9907ca4ecd 100644 --- a/src/base_media_music.h +++ b/src/base_media_music.h @@ -33,14 +33,14 @@ enum MusicTrackType : uint8_t { /** Metadata about a music track. */ struct MusicSongInfo { - std::string songname; ///< name of song displayed in UI - uint8_t tracknr; ///< track number of song displayed in UI - std::string filename; ///< file on disk containing song (when used in MusicSet class) + std::string songname; ///< name of song displayed in UI + std::string filename; ///< file on disk containing song (when used in MusicSet class) + int cat_index; ///< entry index in CAT file, for filetype==MTT_MPSMIDI + int override_start; ///< MIDI ticks to skip over in beginning + int override_end; ///< MIDI tick to end the song at (0 if no override) + uint8_t tracknr; ///< track number of song displayed in UI MusicTrackType filetype; ///< decoder required for song file - int cat_index; ///< entry index in CAT file, for filetype==MTT_MPSMIDI - bool loop; ///< song should play in a tight loop if possible, never ending - int override_start; ///< MIDI ticks to skip over in beginning - int override_end; ///< MIDI tick to end the song at (0 if no override) + bool loop; ///< song should play in a tight loop if possible, never ending }; template <> struct BaseSetTraits { diff --git a/src/music_gui.cpp b/src/music_gui.cpp index 1d9316f424..22c0a09d0e 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -39,8 +39,8 @@ struct MusicSystem { struct PlaylistEntry : MusicSongInfo { - const MusicSet *set; ///< music set the song comes from - uint set_index; ///< index of song in set + const MusicSet *set; ///< music set the song comes from + uint set_index; ///< index of song in set PlaylistEntry(const MusicSet *set, uint set_index) : MusicSongInfo(set->songinfo[set_index]), set(set), set_index(set_index) { } bool IsValid() const { return !this->songname.empty(); }