From 48382d926e69da6f524ae672667187866a73647f Mon Sep 17 00:00:00 2001 From: yoe Date: Sun, 23 Jan 2005 01:44:40 +0000 Subject: [PATCH 1/1] r99: Endianness fix --- gznbd/gznbd.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) 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) { -- 1.7.10.4