diff --git a/source/formats/midi/midiexporter.cpp b/source/formats/midi/midiexporter.cpp index 9e020a02c..a31c8a69b 100644 --- a/source/formats/midi/midiexporter.cpp +++ b/source/formats/midi/midiexporter.cpp @@ -19,30 +19,16 @@ #include +#include + #include #include -#include #include -static uint8_t bswap(uint8_t val) -{ - return val; -} - -static uint16_t bswap(uint16_t val) -{ - return _byteswap_ushort(val); -} - -static uint32_t bswap(uint32_t val) -{ - return _byteswap_ulong(val); -} - template static void write(std::ostream &os, T val) { - val = bswap(val); + val = qToBigEndian(val); os.write(reinterpret_cast(&val), sizeof(T)); }