Artifact 8e8dbaa30682487acaf11633a0dcd0e9e82651a5fc4cff64dc449285f706216c:
- File src/tools.m — part of check-in [b5bfe2af86] at 2025-03-23 02:59:37 on branch trunk — Remove u{char,short,int} (user: js, size: 479) [annotate] [blame] [check-ins using]
// 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; for (int w = 0; w < length; w++) { for (int i = 0; i < stride / 2; i++) { unsigned char *p = (unsigned char *)memory + w * stride; unsigned char t = p[i]; p[i] = p[stride - i - 1]; p[stride - i - 1] = t; } } }