X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fbyteorder.c;h=28889aaee457158fce825a881bc02c9bb1d527db;hb=dd7bb96826037b01b659f59498f6318cf577909e;hp=f407fa039c01f62fcf4405137a43d80c67796582;hpb=933e5a561b10c1450563f1421b83d72396b805d2;p=awesomized%2Flibmemcached diff --git a/libmemcached/byteorder.c b/libmemcached/byteorder.c index f407fa03..28889aae 100644 --- a/libmemcached/byteorder.c +++ b/libmemcached/byteorder.c @@ -1,13 +1,14 @@ #include "common.h" /* Byte swap a 64-bit number. */ -static inline uint64_t swap64(uint64_t in) { +static inline uint64_t swap64(uint64_t in) +{ #ifndef BYTEORDER_BIG_ENDIAN /* Little endian, flip the bytes around until someone makes a faster/better * way to do this. */ uint64_t rv= 0; - int i= 0; - for(i= 0; i < 8; i++) + uint8_t x= 0; + for(x= 0; x < 8; x++) { rv= (rv << 8) | (in & 0xff); in >>= 8; @@ -19,10 +20,12 @@ static inline uint64_t swap64(uint64_t in) { #endif } -uint64_t ntohll(uint64_t value) { +uint64_t ntohll(uint64_t value) +{ return swap64(value); } -uint64_t htonll(uint64_t value) { +uint64_t htonll(uint64_t value) +{ return swap64(value); }