X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fbyteorder.c;h=4b6eeb07acbeafaf2ea54107f15e824dcf47ed73;hb=3928e14fbe1ed17cefe9bdbbb282fb7ecf053e7a;hp=c020785bd2603963f68c31fb213299980d82350c;hpb=2b312deb8b7b3f662b492f94a13e673723387724;p=m6w6%2Flibmemcached diff --git a/libmemcached/byteorder.c b/libmemcached/byteorder.c index c020785b..4b6eeb07 100644 --- a/libmemcached/byteorder.c +++ b/libmemcached/byteorder.c @@ -1,14 +1,25 @@ -#include "common.h" +/* LibMemcached + * Copyright (C) 2006-2009 Brian Aker + * All rights reserved. + * + * Use and distribution licensed under the BSD license. See + * the COPYING file in the parent directory for full text. + * + * Summary: + * + */ + +#include "byteorder.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 +#ifndef WORDS_BIGENDIAN /* Little endian, flip the bytes around until someone makes a faster/better * way to do this. */ uint64_t rv= 0; uint8_t x= 0; - for(x= 0; x < 8; x++) + for(x= 0; x < 8; x++) { rv= (rv << 8) | (in & 0xff); in >>= 8; @@ -20,10 +31,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); }