From 22dca01af96e22856387eb6993b3d357f30ffb1c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 6 Dec 2011 13:54:18 +0000 Subject: [PATCH] use uint64_t instead of long long for GNUNET_ntohll/GNUNET_htonll --- src/arm/gnunet-service-arm_interceptor.c | 4 ---- src/include/gnunet_common.h | 12 ++++++------ src/util/common_endian.c | 12 ++++++------ 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/arm/gnunet-service-arm_interceptor.c b/src/arm/gnunet-service-arm_interceptor.c index 24dd4ad25..021baa673 100644 --- a/src/arm/gnunet-service-arm_interceptor.c +++ b/src/arm/gnunet-service-arm_interceptor.c @@ -989,7 +989,6 @@ acceptConnection (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) return; GNUNET_CONTAINER_DLL_remove (serviceListeningInfoList_head, serviceListeningInfoList_tail, sli); -#ifndef MINGW use_lsocks = GNUNET_NO; if (GNUNET_YES == GNUNET_CONFIGURATION_have_value (cfg, sli->serviceName, @@ -997,9 +996,6 @@ acceptConnection (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) use_lsocks = GNUNET_CONFIGURATION_get_value_yesno (cfg, sli->serviceName, "DISABLE_SOCKET_FORWARDING"); -#else - use_lsocks = GNUNET_YES; -#endif if (GNUNET_NO != use_lsocks) { accept_and_forward (sli); diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index 49b176ff1..7eed22fdc 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h @@ -417,20 +417,20 @@ GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); /* ************************* endianess conversion ****************** */ /** - * Convert a long-long to host-byte-order. + * Convert unsigned 64-bit integer to host-byte-order. * @param n the value in network byte order * @return the same value in host byte order */ -unsigned long long -GNUNET_ntohll (unsigned long long n); +uint64_t +GNUNET_ntohll (uint64_t n); /** - * Convert a long long to network-byte-order. + * Convert unsigned 64-bit integer to network-byte-order. * @param n the value in host byte order * @return the same value in network byte order */ -unsigned long long -GNUNET_htonll (unsigned long long n); +uint64_t +GNUNET_htonll (uint64_t n); /* ************************* allocation functions ****************** */ 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 @@ #define LOG(kind,...) GNUNET_log_from (kind, "util",__VA_ARGS__) -unsigned long long -GNUNET_ntohll (unsigned long long n) +uint64_t +GNUNET_ntohll (uint64_t) { #if __BYTE_ORDER == __BIG_ENDIAN return n; #else - return (((unsigned long long) ntohl (n)) << 32) + ntohl (n >> 32); + return (((uint64_t) ntohl (n)) << 32) + ntohl (n >> 32); #endif } -unsigned long long -GNUNET_htonll (unsigned long long n) +uint64_t +GNUNET_htonll (uint64_t n) { #if __BYTE_ORDER == __BIG_ENDIAN return n; #else - return (((unsigned long long) htonl (n)) << 32) + htonl (n >> 32); + return (((uint64_t) htonl (n)) << 32) + htonl (n >> 32); #endif } -- 2.25.1