Mercurial > hg > cdb
view uint32_unpack.c @ 17:d9c11148df3b default tip
shh...
| author | Henry S. Thompson <ht@inf.ed.ac.uk> |
|---|---|
| date | Thu, 28 Aug 2025 11:02:58 +0100 |
| parents | 2cb46628feec |
| children |
line wrap: on
line source
#include "uint32.h" void uint32_unpack(char s[4],uint32 *u) { uint32 result; result = (unsigned char) s[3]; result <<= 8; result += (unsigned char) s[2]; result <<= 8; result += (unsigned char) s[1]; result <<= 8; result += (unsigned char) s[0]; *u = result; } void uint32_unpack_big(char s[4],uint32 *u) { uint32 result; result = (unsigned char) s[0]; result <<= 8; result += (unsigned char) s[1]; result <<= 8; result += (unsigned char) s[2]; result <<= 8; result += (unsigned char) s[3]; *u = result; }
