Cube/src/tools.mm
Jonathan Schleifer dd08a1069e Improve clang-format
FossilOrigin-Name: 6f5dd506262655e5d3a6732794f955c8476b19a80fa03d5ebb6744ed8b18c963
2025-03-08 02:38:40 +00:00

21 lines
424 B
Text

// implementation of generic tools
#include "tools.h"
#include <new>
///////////////////////// misc tools ///////////////////////
void
endianswap(
void *memory, int stride, int length) // little indians as storage format
{
if (*((char *)&stride))
return;
loop(w, length) loop(i, stride / 2)
{
uchar *p = (uchar *)memory + w * stride;
uchar t = p[i];
p[i] = p[stride - i - 1];
p[stride - i - 1] = t;
}
}