projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Merged trunk.
[m6w6/libmemcached]
/
libmemcached
/
byteorder.c
diff --git
a/libmemcached/byteorder.c
b/libmemcached/byteorder.c
index c020785bd2603963f68c31fb213299980d82350c..24f8e8c6e88e1e13be7595325dd51c7f8b266c76 100644
(file)
--- a/
libmemcached/byteorder.c
+++ b/
libmemcached/byteorder.c
@@
-1,14
+1,14
@@
-#include "
common
.h"
+#include "
byteorder
.h"
/* Byte swap a 64-bit number. */
/* 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_BIG
ENDIAN
/* Little endian, flip the bytes around until someone makes a faster/better
* way to do this. */
uint64_t rv= 0;
uint8_t x= 0;
/* 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;
{
rv= (rv << 8) | (in & 0xff);
in >>= 8;
@@
-20,10
+20,12
@@
static inline uint64_t swap64(uint64_t in)
#endif
}
#endif
}
-uint64_t ntohll(uint64_t value) {
+uint64_t ntohll(uint64_t value)
+{
return swap64(value);
}
return swap64(value);
}
-uint64_t htonll(uint64_t value) {
+uint64_t htonll(uint64_t value)
+{
return swap64(value);
}
return swap64(value);
}