From edbdee81ca1386439282ed451cb601b9157bb062 Mon Sep 17 00:00:00 2001 From: Vadim Kurland Date: Tue, 16 Nov 2010 15:57:34 -0800 Subject: [PATCH] changes to make this compile on Windows --- src/fwbuilder/InetAddr.cpp | 8 ++++---- src/fwbuilder/uint128.h | 26 +++++++++++++------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/fwbuilder/InetAddr.cpp b/src/fwbuilder/InetAddr.cpp index 22565af8e..c4e33a641 100644 --- a/src/fwbuilder/InetAddr.cpp +++ b/src/fwbuilder/InetAddr.cpp @@ -168,16 +168,16 @@ uint128 InetAddr::to_uint128() const { assert(isV6()); uint128 res; - uint128 x = ntohl(((uint32_t *) (&ipv6))[0]); + uint128 x = uint64_t(ntohl(((uint32_t *) (&ipv6))[0])); x <<= 96; res |= x; - x = ntohl(((uint32_t *) (&ipv6))[1]); + x = uint64_t(ntohl(((uint32_t *) (&ipv6))[1])); x <<= 64; res |= x; - x = ntohl(((uint32_t *) (&ipv6))[2]); + x = uint64_t(ntohl(((uint32_t *) (&ipv6))[2])); x <<= 32; res |= x; - x = ntohl(((uint32_t *) (&ipv6))[3]); + x = uint64_t(ntohl(((uint32_t *) (&ipv6))[3])); res |= x; return res; } diff --git a/src/fwbuilder/uint128.h b/src/fwbuilder/uint128.h index a91c628ee..f89d463c7 100644 --- a/src/fwbuilder/uint128.h +++ b/src/fwbuilder/uint128.h @@ -34,7 +34,7 @@ #include #include -#include +// #include // convinience macro #define U128_C(s) uint128(#s) @@ -521,18 +521,18 @@ template<> struct numeric_limits { static const bool is_specialized = true; - static uint128 min() throw() - { - return 0; - } - - static uint128 max() throw() - { - return uint128( - std::numeric_limits::max(), - std::numeric_limits::max() - ); - } +// static uint128 min() throw() +// { +// return 0; +// } +// +// static uint128 max() throw() +// { +// return uint128( +// std::numeric_limits::max(), +// std::numeric_limits::max() +// ); +// } static const bool is_signed = false; static const bool is_integer = true;