mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-26 23:55:40 +00:00
15 lines
278 B
C++
15 lines
278 B
C++
#include "Util/ByteSwap.h"
|
|
|
|
namespace Util
|
|
{
|
|
void ByteSwap(uint8_t *buffer, size_t size)
|
|
{
|
|
for (size_t i = 0; i < (size & ~1); i += 2)
|
|
{
|
|
uint8_t x = buffer[i + 0];
|
|
buffer[i + 0] = buffer[i + 1];
|
|
buffer[i + 1] = x;
|
|
}
|
|
}
|
|
} // Util
|