From: antirez Date: Wed, 8 Feb 2012 22:20:39 +0000 (+0100) Subject: more ziplist.c endianess fixes X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/8e0ef249a2c1a67e11838ff48329b51c4aa7ccdc?ds=inline more ziplist.c endianess fixes --- diff --git a/src/ziplist.c b/src/ziplist.c index c8fd64ac..f2ce933f 100644 --- a/src/ziplist.c +++ b/src/ziplist.c @@ -92,8 +92,8 @@ #define ZIPLIST_LENGTH(zl) (*((uint16_t*)((zl)+sizeof(uint32_t)*2))) #define ZIPLIST_HEADER_SIZE (sizeof(uint32_t)*2+sizeof(uint16_t)) #define ZIPLIST_ENTRY_HEAD(zl) ((zl)+ZIPLIST_HEADER_SIZE) -#define ZIPLIST_ENTRY_TAIL(zl) ((zl)+ZIPLIST_TAIL_OFFSET(zl)) -#define ZIPLIST_ENTRY_END(zl) ((zl)+ZIPLIST_BYTES(zl)-1) +#define ZIPLIST_ENTRY_TAIL(zl) ((zl)+intrev32ifbe(ZIPLIST_TAIL_OFFSET(zl))) +#define ZIPLIST_ENTRY_END(zl) ((zl)+intrev32ifbe(ZIPLIST_BYTES(zl))-1) /* We know a positive increment can only be 1 because entries can only be * pushed one at a time. */