aboutsummaryrefslogtreecommitdiff
path: root/src/util/common_endian.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-12-06 13:54:18 +0000
committerChristian Grothoff <christian@grothoff.org>2011-12-06 13:54:18 +0000
commit22dca01af96e22856387eb6993b3d357f30ffb1c (patch)
treea47c4110437209b6a4a104f0a5cf4af0569a0143 /src/util/common_endian.c
parent176763b1ac81a2116c1b81a308e52026714f8edf (diff)
downloadgnunet-22dca01af96e22856387eb6993b3d357f30ffb1c.tar.gz
gnunet-22dca01af96e22856387eb6993b3d357f30ffb1c.zip
use uint64_t instead of long long for GNUNET_ntohll/GNUNET_htonll
Diffstat (limited to 'src/util/common_endian.c')
-rw-r--r--src/util/common_endian.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/util/common_endian.c b/src/util/common_endian.c
index 5d7aa50d5..f4641445d 100644
--- a/src/util/common_endian.c
+++ b/src/util/common_endian.c
@@ -29,23 +29,23 @@
29 29
30#define LOG(kind,...) GNUNET_log_from (kind, "util",__VA_ARGS__) 30#define LOG(kind,...) GNUNET_log_from (kind, "util",__VA_ARGS__)
31 31
32unsigned long long 32uint64_t
33GNUNET_ntohll (unsigned long long n) 33GNUNET_ntohll (uint64_t)
34{ 34{
35#if __BYTE_ORDER == __BIG_ENDIAN 35#if __BYTE_ORDER == __BIG_ENDIAN
36 return n; 36 return n;
37#else 37#else
38 return (((unsigned long long) ntohl (n)) << 32) + ntohl (n >> 32); 38 return (((uint64_t) ntohl (n)) << 32) + ntohl (n >> 32);
39#endif 39#endif
40} 40}
41 41
42unsigned long long 42uint64_t
43GNUNET_htonll (unsigned long long n) 43GNUNET_htonll (uint64_t n)
44{ 44{
45#if __BYTE_ORDER == __BIG_ENDIAN 45#if __BYTE_ORDER == __BIG_ENDIAN
46 return n; 46 return n;
47#else 47#else
48 return (((unsigned long long) htonl (n)) << 32) + htonl (n >> 32); 48 return (((uint64_t) htonl (n)) << 32) + htonl (n >> 32);
49#endif 49#endif
50} 50}
51 51