Convert more files to pure Objective-C
FossilOrigin-Name: 46c577957085f072871cb93b46340fd8349c1e20503a448cc8e6d33ddaea1552
This commit is contained in:
parent
b4d52ea3ec
commit
61bf59bbfc
14 changed files with 176 additions and 162 deletions
20
src/tools.m
Normal file
20
src/tools.m
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue