aboutsummaryrefslogtreecommitdiff
path: root/src/util/common_endian.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/common_endian.c')
-rw-r--r--src/util/common_endian.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/util/common_endian.c b/src/util/common_endian.c
index 247e9e876..1fb74600e 100644
--- a/src/util/common_endian.c
+++ b/src/util/common_endian.c
@@ -59,8 +59,8 @@ GNUNET_htonll (uint64_t n)
59 * @param d the value in network byte order 59 * @param d the value in network byte order
60 * @return the same value in host byte order 60 * @return the same value in host byte order
61 */ 61 */
62double 62double
63GNUNET_hton_double (double d) 63GNUNET_hton_double (double d)
64{ 64{
65 double res; 65 double res;
66 uint64_t *in = (uint64_t *) &d; 66 uint64_t *in = (uint64_t *) &d;
@@ -77,15 +77,15 @@ GNUNET_hton_double (double d)
77 * @param d the value in network byte order 77 * @param d the value in network byte order
78 * @return the same value in host byte order 78 * @return the same value in host byte order
79 */ 79 */
80double 80double
81GNUNET_ntoh_double (double d) 81GNUNET_ntoh_double (double d)
82{ 82{
83 double res; 83 double res;
84 uint64_t *in = (uint64_t *) &d; 84 uint64_t *in = (uint64_t *) &d;
85 uint64_t *out = (uint64_t *) &res; 85 uint64_t *out = (uint64_t *) &res;
86 86
87 out[0] = GNUNET_ntohll(in[0]); 87 out[0] = GNUNET_ntohll(in[0]);
88 88
89 return res; 89 return res;
90} 90}
91 91