From: Roy Marples Date: Tue, 28 Mar 2017 21:29:24 +0000 (+0100) Subject: Define htonll a macro as it's only used once. X-Git-Tag: v7.0.0-beta1~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47e6bd276ac95d59d56a285bdc73a916f9ff4318;p=thirdparty%2Fdhcpcd.git Define htonll a macro as it's only used once. --- diff --git a/src/auth.c b/src/auth.c index 4f8abae6..e0ec38f6 100644 --- a/src/auth.c +++ b/src/auth.c @@ -49,29 +49,19 @@ #ifndef htonll #if (BYTE_ORDER == LITTLE_ENDIAN) -static inline uint64_t -htonll(uint64_t x) -{ - - return (uint64_t)htonl((uint32_t)(x >> 32)) | - (uint64_t)htonl((uint32_t)(x & 0xffffffff)) << 32; -} +#define htonll(x) ((uint64_t)htonl((uint32_t)((x) >> 32)) | \ + (uint64_t)htonl((uint32_t)((x) & 0xffffffff)) << 32) #else /* (BYTE_ORDER == LITTLE_ENDIAN) */ -#define htonll(x) (x) +#define htonll(x) (x) #endif #endif /* htonll */ #ifndef ntohll #if (BYTE_ORDER == LITTLE_ENDIAN) -static inline uint64_t -ntohll(uint64_t x) -{ - - return (uint64_t)ntohl((uint32_t)(x >> 32)) | - (uint64_t)ntohl((uint32_t)(x & 0xffffffff)) << 32; -} +#define ntohll(x) ((uint64_t)ntohl((uint32_t)((x) >> 32)) | \ + (uint64_t)ntohl((uint32_t)((x) & 0xffffffff)) << 32) #else /* (BYTE_ORDER == LITTLE_ENDIAN) */ -#define ntohll(x) (x) +#define ntohll(x) (x) #endif #endif /* ntohll */