X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/7d8c555e92954b02d40c15702476fd48e55c4f94..8e0ef249a2c1a67e11838ff48329b51c4aa7ccdc:/src/endian.c diff --git a/src/endian.c b/src/endian.c index aff2425a..741f8bf2 100644 --- a/src/endian.c +++ b/src/endian.c @@ -1,3 +1,5 @@ +#include + /* Toggle the 16 bit unsigned integer pointed by *p from little endian to * big endian */ void memrev16(void *p) { @@ -40,6 +42,21 @@ void memrev64(void *p) { x[4] = t; } +uint16_t intrev16(uint16_t v) { + memrev16(&v); + return v; +} + +uint32_t intrev32(uint32_t v) { + memrev32(&v); + return v; +} + +uint64_t intrev64(uint64_t v) { + memrev64(&v); + return v; +} + #ifdef TESTMAIN #include