Convert more files to pure Objective-C

FossilOrigin-Name: 46c577957085f072871cb93b46340fd8349c1e20503a448cc8e6d33ddaea1552
This commit is contained in:
Jonathan Schleifer 2025-03-20 21:52:26 +00:00
parent b4d52ea3ec
commit 61bf59bbfc
14 changed files with 176 additions and 162 deletions

20
src/tools.m Normal file
View file

@ -0,0 +1,20 @@
// implementation of generic tools
#include "tools.h"
///////////////////////// 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;
}
}