[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r19006 - gnunet/src/util
From: |
gnunet |
Subject: |
[GNUnet-SVN] r19006 - gnunet/src/util |
Date: |
Thu, 5 Jan 2012 16:16:03 +0100 |
Author: grothoff
Date: 2012-01-05 16:16:03 +0100 (Thu, 05 Jan 2012)
New Revision: 19006
Modified:
gnunet/src/util/common_endian.c
Log:
-fix
Modified: gnunet/src/util/common_endian.c
===================================================================
--- gnunet/src/util/common_endian.c 2012-01-05 15:10:46 UTC (rev 19005)
+++ gnunet/src/util/common_endian.c 2012-01-05 15:16:03 UTC (rev 19006)
@@ -54,12 +54,11 @@
GNUNET_hton_double (double d)
{
double res;
- unsigned int *in = (unsigned int *) &d;
- unsigned int *out = (unsigned int *) &res;
+ uint64_t *in = (uint64_t *) &d;
+ uint64_t *out = (uint64_t *) &res;
- out[0] = htonl(in[0]);
- out[1] = htonl(in[1]);
-
+ out[0] = GNUNET_htonll(in[0]);
+
return res;
}
@@ -68,11 +67,10 @@
GNUNET_ntoh_double (double d)
{
double res;
- unsigned int *in = (unsigned int *) &d;
- unsigned int *out = (unsigned int *) &res;
+ uint64_t *in = (uint64_t *) &d;
+ uint64_t *out = (uint64_t *) &res;
- out[0] = ntohl(in[0]);
- out[1] = ntohl(in[1]);
+ out[0] = GNUNET_ntohll(in[0]);
return res;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r19006 - gnunet/src/util,
gnunet <=