From: yoe Date: Sun, 23 Jan 2005 01:44:40 +0000 (+0000) Subject: r99: Endianness fix X-Git-Url: http://git.alex.org.uk?hp=5d3076a52465de8d12110c5f97825a7e6d990129 r99: Endianness fix --- diff --git a/gznbd/gznbd.c b/gznbd/gznbd.c index e5c1e49..61f7640 100644 --- a/gznbd/gznbd.c +++ b/gznbd/gznbd.c @@ -52,30 +52,15 @@ #define u32 __u32 #define u64 __u64 -#include +/* these headers take care of endianness */ +#include "../config.h" +#include "../cliserv.h" #define BLOCK 1024 /* don't ask me why this value, I only copied it */ #define CHUNK BLOCK*20 -/* taken litterally from the original nbd */ -#ifdef WORDS_BIGENDIAN -u64 ntohll(u64 a) -{ - return a; -} -#else -u64 ntohll(u64 a) -{ - u32 lo = a & 0xffffffff; - u32 hi = a >> 32U; - lo = ntohl(lo); - hi = ntohl(hi); - return ((u64) lo) << 32U | hi; -} -#endif - int main(int argc, char **argv) {