aboutsummaryrefslogtreecommitdiff
path: root/src/util/common_endian.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-12-25 16:14:57 +0100
committerChristian Grothoff <christian@grothoff.org>2019-12-25 16:14:57 +0100
commit64d6551e3c6608afcd5dfd5ebdf6ad9bbac0b9f5 (patch)
tree54b7297c6a6c7ffe5b7c9fcce09c520037339ee5 /src/util/common_endian.c
parentd1dea55be8b970f9ecfec06695d03b0ccfcb9c2d (diff)
downloadgnunet-64d6551e3c6608afcd5dfd5ebdf6ad9bbac0b9f5.tar.gz
gnunet-64d6551e3c6608afcd5dfd5ebdf6ad9bbac0b9f5.zip
replace expensive function call with macro for trivial calculation
Diffstat (limited to 'src/util/common_endian.c')
-rw-r--r--src/util/common_endian.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util/common_endian.c b/src/util/common_endian.c
index fa7d99d85..d69cc1da5 100644
--- a/src/util/common_endian.c
+++ b/src/util/common_endian.c
@@ -31,6 +31,7 @@
31#define LOG(kind, ...) GNUNET_log_from (kind, "util-common-endian", __VA_ARGS__) 31#define LOG(kind, ...) GNUNET_log_from (kind, "util-common-endian", __VA_ARGS__)
32 32
33 33
34#ifndef htonbe64
34uint64_t 35uint64_t
35GNUNET_htonll (uint64_t n) 36GNUNET_htonll (uint64_t n)
36{ 37{
@@ -44,6 +45,10 @@ GNUNET_htonll (uint64_t n)
44} 45}
45 46
46 47
48#endif
49
50
51#ifndef be64toh
47uint64_t 52uint64_t
48GNUNET_ntohll (uint64_t n) 53GNUNET_ntohll (uint64_t n)
49{ 54{
@@ -57,6 +62,9 @@ GNUNET_ntohll (uint64_t n)
57} 62}
58 63
59 64
65#endif
66
67
60/** 68/**
61 * Convert double to network-byte-order. 69 * Convert double to network-byte-order.
62 * @param d the value in network byte order 70 * @param d the value in network byte order