]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Define htonll a macro as it's only used once.
authorRoy Marples <roy@marples.name>
Tue, 28 Mar 2017 21:29:24 +0000 (22:29 +0100)
committerRoy Marples <roy@marples.name>
Tue, 28 Mar 2017 21:29:24 +0000 (22:29 +0100)
src/auth.c

index 4f8abae6e042e49ec32763b384a1d07322066b09..e0ec38f6e22cfa56d7b75b77abed362805c2c738 100644 (file)
 
 #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 */