|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r63833 - in sandbox/SOC/2010/bits_and_ints: boost/integer libs/integer/doc/html/boost_integer libs/integer/test
From: muriloufg_at_[hidden]
Date: 2010-07-10 19:21:03
Author: murilov
Date: 2010-07-10 19:21:01 EDT (Sat, 10 Jul 2010)
New Revision: 63833
URL: http://svn.boost.org/trac/boost/changeset/63833
Log:
Lot of changes for working on MSVC compiler.
Text files modified:
sandbox/SOC/2010/bits_and_ints/boost/integer/interleave.hpp | 4 ++--
sandbox/SOC/2010/bits_and_ints/boost/integer/round_power_2.hpp | 1 -
sandbox/SOC/2010/bits_and_ints/boost/integer/static_abs.hpp | 2 +-
sandbox/SOC/2010/bits_and_ints/boost/integer/static_gcd.hpp | 1 +
sandbox/SOC/2010/bits_and_ints/boost/integer/static_isign.hpp | 4 ++--
sandbox/SOC/2010/bits_and_ints/boost/integer/static_lcm.hpp | 1 +
sandbox/SOC/2010/bits_and_ints/boost/integer/static_pop_count.hpp | 12 ++++++------
sandbox/SOC/2010/bits_and_ints/boost/integer/static_same_sign.hpp | 6 +++---
sandbox/SOC/2010/bits_and_ints/boost/integer/static_sign.hpp | 2 +-
sandbox/SOC/2010/bits_and_ints/boost/integer/static_sign_extend.hpp | 2 +-
sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/history.html | 4 ++--
sandbox/SOC/2010/bits_and_ints/libs/integer/test/bit_reversal_test.cpp | 14 +++++++-------
sandbox/SOC/2010/bits_and_ints/libs/integer/test/count_trailing_zeros_test.cpp | 8 ++++----
sandbox/SOC/2010/bits_and_ints/libs/integer/test/pop_count_test.cpp | 10 +++++-----
sandbox/SOC/2010/bits_and_ints/libs/integer/test/sign_extend_test.cpp | 20 ++++++++------------
sandbox/SOC/2010/bits_and_ints/libs/integer/test/sign_test.cpp | 4 +++-
16 files changed, 47 insertions(+), 48 deletions(-)
Modified: sandbox/SOC/2010/bits_and_ints/boost/integer/interleave.hpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/boost/integer/interleave.hpp (original)
+++ sandbox/SOC/2010/bits_and_ints/boost/integer/interleave.hpp 2010-07-10 19:21:01 EDT (Sat, 10 Jul 2010)
@@ -53,8 +53,8 @@
{0x5555, 0x3333, 0x0F0F, 0xFFFF, 0xFFFF},
{0x55555555, 0x33333333, 0x0F0F0F0F, 0x00FF00FF, 0xFFFFFFFF},
#ifndef BOOST_NO_INT64_T
- {0x5555555555555555LLU, 0x3333333333333333LLU, 0x0F0F0F0F0F0F0F0FLLU,
- 0x00FF00FF00FF00FFLLU, 0x0000FFFF0000FFFLLU }
+ {0x5555555555555555ULL, 0x3333333333333333ULL, 0x0F0F0F0F0F0F0F0FULL,
+ 0x00FF00FF00FF00FFULL, 0x0000FFFF0000FFFULL }
#else
{0x0, 0x0, 0x0, 0x0, 0x0}
#endif
Modified: sandbox/SOC/2010/bits_and_ints/boost/integer/round_power_2.hpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/boost/integer/round_power_2.hpp (original)
+++ sandbox/SOC/2010/bits_and_ints/boost/integer/round_power_2.hpp 2010-07-10 19:21:01 EDT (Sat, 10 Jul 2010)
@@ -79,7 +79,6 @@
value = value | (value >> 1);
value = value | (value >> 2);
value = value | (value >> 4);
- value = value | (value >> 8);
return value - (value >> 1);
}
Modified: sandbox/SOC/2010/bits_and_ints/boost/integer/static_abs.hpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/boost/integer/static_abs.hpp (original)
+++ sandbox/SOC/2010/bits_and_ints/boost/integer/static_abs.hpp 2010-07-10 19:21:01 EDT (Sat, 10 Jul 2010)
@@ -30,7 +30,7 @@
template <typename IC, class Enable = typename enable_if< is_integral_constant<IC> >::type>
struct abs : mpl::integral_c<typename make_unsigned<typename IC::value_type>::type,
- (IC::value < 0 ? -IC::value : IC::value)
+ ((IC::value) < 0 ? (-IC::value) : (IC::value))
>
{};
Modified: sandbox/SOC/2010/bits_and_ints/boost/integer/static_gcd.hpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/boost/integer/static_gcd.hpp (original)
+++ sandbox/SOC/2010/bits_and_ints/boost/integer/static_gcd.hpp 2010-07-10 19:21:01 EDT (Sat, 10 Jul 2010)
@@ -12,6 +12,7 @@
#define BOOST_STATIC_GCD_INCLUDED
#include <boost/mpl/and.hpp>
+#include <boost/cstdint.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/math/common_factor_ct.hpp>
#include <boost/integer/static_abs.hpp>
Modified: sandbox/SOC/2010/bits_and_ints/boost/integer/static_isign.hpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/boost/integer/static_isign.hpp (original)
+++ sandbox/SOC/2010/bits_and_ints/boost/integer/static_isign.hpp 2010-07-10 19:21:01 EDT (Sat, 10 Jul 2010)
@@ -37,8 +37,8 @@
>::type
>
struct isign : integral_c<typename IC1::value_type,
- ((IC1::value ^ ((IC1::value ^ IC2::value) >> sizeof(typename IC1::value_type) * 8 - 1))
- - ((IC1::value ^ IC2::value) >> sizeof(typename IC1::value_type) * 8 - 1))
+ ((IC1::value ^ ((IC1::value ^ IC2::value) >> (sizeof(typename IC1::value_type) * 8 - 1)))
+ - ((IC1::value ^ IC2::value) >> (sizeof(typename IC1::value_type) * 8 - 1)))
>
{};
Modified: sandbox/SOC/2010/bits_and_ints/boost/integer/static_lcm.hpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/boost/integer/static_lcm.hpp (original)
+++ sandbox/SOC/2010/bits_and_ints/boost/integer/static_lcm.hpp 2010-07-10 19:21:01 EDT (Sat, 10 Jul 2010)
@@ -11,6 +11,7 @@
#ifndef BOOST_STATIC_LCM_INCLUDED
#define BOOST_STATIC_LCM_INCLUDED
+#include <boost/cstdint.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/math/common_factor_ct.hpp>
#include <boost/integer/static_abs.hpp>
Modified: sandbox/SOC/2010/bits_and_ints/boost/integer/static_pop_count.hpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/boost/integer/static_pop_count.hpp (original)
+++ sandbox/SOC/2010/bits_and_ints/boost/integer/static_pop_count.hpp 2010-07-10 19:21:01 EDT (Sat, 10 Jul 2010)
@@ -30,12 +30,12 @@
{
private:
#ifndef BOOST_NO_INT64_T
- BOOST_STATIC_CONSTANT(uintmax_t, m0 = 0x5555555555555555LLU);
- BOOST_STATIC_CONSTANT(uintmax_t, m1 = 0x3333333333333333LLU);
- BOOST_STATIC_CONSTANT(uintmax_t, m2 = 0x0F0F0F0F0F0F0F0FLLU);
- BOOST_STATIC_CONSTANT(uintmax_t, m3 = 0x00FF00FF00FF00FFLLU);
- BOOST_STATIC_CONSTANT(uintmax_t, m4 = 0x0000FFFF0000FFFFLLU);
- BOOST_STATIC_CONSTANT(uintmax_t, m5 = 0x00000000FFFFFFFFLLU);
+ BOOST_STATIC_CONSTANT(uintmax_t, m0 = 0x5555555555555555ULL);
+ BOOST_STATIC_CONSTANT(uintmax_t, m1 = 0x3333333333333333ULL);
+ BOOST_STATIC_CONSTANT(uintmax_t, m2 = 0x0F0F0F0F0F0F0F0FULL);
+ BOOST_STATIC_CONSTANT(uintmax_t, m3 = 0x00FF00FF00FF00FFULL);
+ BOOST_STATIC_CONSTANT(uintmax_t, m4 = 0x0000FFFF0000FFFFULL);
+ BOOST_STATIC_CONSTANT(uintmax_t, m5 = 0x00000000FFFFFFFFULL);
#else
BOOST_STATIC_CONSTANT(uintmax_t, m0 = 0x55555555);
BOOST_STATIC_CONSTANT(uintmax_t, m1 = 0x33333333);
Modified: sandbox/SOC/2010/bits_and_ints/boost/integer/static_same_sign.hpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/boost/integer/static_same_sign.hpp (original)
+++ sandbox/SOC/2010/bits_and_ints/boost/integer/static_same_sign.hpp 2010-07-10 19:21:01 EDT (Sat, 10 Jul 2010)
@@ -14,6 +14,7 @@
#include <boost/mpl/bool.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/utility/enable_if.hpp>
+#include <boost/integer/static_sign.hpp>
namespace boost {
@@ -35,9 +36,8 @@
* IC1 and IC2 types must be mpl::integral_c<> types.
*/
template <typename IC1, typename IC2>
-struct same_sign : bool_<((!IC1::value && !IC2::value)
- || (IC1::value < 0 && IC2::value < 0)
- || (IC2::value > 0 && IC2::value > 0))
+struct same_sign : bool_<
+ sign<IC1>::value == sign<IC2>::value
>
{};
Modified: sandbox/SOC/2010/bits_and_ints/boost/integer/static_sign.hpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/boost/integer/static_sign.hpp (original)
+++ sandbox/SOC/2010/bits_and_ints/boost/integer/static_sign.hpp 2010-07-10 19:21:01 EDT (Sat, 10 Jul 2010)
@@ -36,7 +36,7 @@
typename make_signed<
typename IC::value_type
>::type,
- (IC::value == 0 ? 0 : (IC::value < 0 ? -1 : 1))
+ (IC::value == 0 ? 0 : (IC::value > 0 ? 1 : -1))
>
{};
Modified: sandbox/SOC/2010/bits_and_ints/boost/integer/static_sign_extend.hpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/boost/integer/static_sign_extend.hpp (original)
+++ sandbox/SOC/2010/bits_and_ints/boost/integer/static_sign_extend.hpp 2010-07-10 19:21:01 EDT (Sat, 10 Jul 2010)
@@ -41,7 +41,7 @@
template <typename IC, std::size_t Bits>
struct sign_extend : integral_c<typename IC::value_type,
- (((IC::value & ((typename IC::value_type(1) << Bits) - 1))
+ (((IC::value & (((typename IC::value_type(1)) << Bits) - 1))
^ (typename IC::value_type(1) << (Bits - 1)))
- (typename IC::value_type(1) << (Bits - 1)))
>
Modified: sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/history.html
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/history.html (original)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/history.html 2010-07-10 19:21:01 EDT (Sat, 10 Jul 2010)
@@ -26,7 +26,7 @@
<a name="boost_integer.history"></a><a class="link" href="history.html" title="History"> History</a>
</h2></div></div></div>
<a name="boost_integer.history.1_42_0"></a><h5>
-<a name="id36195663"></a>
+<a name="id560880"></a>
<a class="link" href="history.html#boost_integer.history.1_42_0">1.42.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -55,7 +55,7 @@
</li>
</ul></div>
<a name="boost_integer.history.1_32_0"></a><h5>
-<a name="id36195783"></a>
+<a name="id560998"></a>
<a class="link" href="history.html#boost_integer.history.1_32_0">1.32.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
Modified: sandbox/SOC/2010/bits_and_ints/libs/integer/test/bit_reversal_test.cpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/libs/integer/test/bit_reversal_test.cpp (original)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/test/bit_reversal_test.cpp 2010-07-10 19:21:01 EDT (Sat, 10 Jul 2010)
@@ -5,17 +5,16 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
-#include <boost/detail/lightweight_test.hpp>
-
+#include <iostream>
#include <boost/cstdlib.hpp>
-#include <boost/integer/bits_and_ints.hpp>
+#include <boost/cstdint.hpp>
#include <boost/mpl/integral_c.hpp>
-
-#include <iostream>
+#include <boost/detail/lightweight_test.hpp>
+#include <boost/integer/bits_and_ints.hpp>
// Macros to compact code
#define BIT_REVERSAL_TEST(n, m) \
- BOOST_TEST(::boost::bit_reversal(n) == m)
+ BOOST_TEST((::boost::bit_reversal(n) == m))
#define STATIC_BIT_REVERSAL_TEST(t, n, m) \
BOOST_TEST((::boost::static_bit_reversal<t, n>::value == m)); \
@@ -24,7 +23,8 @@
// Main testing function
int main(int, char* [])
-{
+{
+ using namespace boost;
std::cout << "Doing tests on bit_reversal." << std::endl;
Modified: sandbox/SOC/2010/bits_and_ints/libs/integer/test/count_trailing_zeros_test.cpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/libs/integer/test/count_trailing_zeros_test.cpp (original)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/test/count_trailing_zeros_test.cpp 2010-07-10 19:21:01 EDT (Sat, 10 Jul 2010)
@@ -5,16 +5,16 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
+#include <iostream>
+#include <boost/cstdint.hpp>
+#include <boost/mpl/integral_c.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/integer/count_trailing_zeros.hpp>
#include <boost/integer/static_count_trailing_zeros.hpp>
-#include <boost/mpl/integral_c.hpp>
-
-#include <iostream>
#define COUNT_ZEROS_TEST(x, y) \
BOOST_TEST((::boost::count_trailing_zeros(x) == y)); \
-BOOST_TEST(((::boost::mpl::count_trailing_zeros< ::boost::mpl::integral_c<uintmax_t, x> >::value) == y))
+BOOST_TEST(((::boost::mpl::count_trailing_zeros< ::boost::mpl::integral_c<::boost::uintmax_t, x> >::value) == y))
// Main testing function
Modified: sandbox/SOC/2010/bits_and_ints/libs/integer/test/pop_count_test.cpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/libs/integer/test/pop_count_test.cpp (original)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/test/pop_count_test.cpp 2010-07-10 19:21:01 EDT (Sat, 10 Jul 2010)
@@ -5,16 +5,16 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
+#include <iostream>
+#include <boost/cstdint.hpp>
+#include <boost/mpl/integral_c.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/integer/pop_count.hpp>
-#include <boost/integer/static_pop_count.hpp>
-#include <boost/mpl/integral_c.hpp>
-
-#include <iostream>
+#include <boost/integer/static_pop_count.hpp>
#define POP_COUNT_TEST(x, y) \
BOOST_TEST((::boost::pop_count(x) == y)); \
-BOOST_TEST(((::boost::mpl::pop_count< ::boost::mpl::integral_c<uintmax_t, x> >::value) == y))
+BOOST_TEST(((::boost::mpl::pop_count< ::boost::mpl::integral_c<::boost::uintmax_t, x> >::value) == y))
// Main testing function
Modified: sandbox/SOC/2010/bits_and_ints/libs/integer/test/sign_extend_test.cpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/libs/integer/test/sign_extend_test.cpp (original)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/test/sign_extend_test.cpp 2010-07-10 19:21:01 EDT (Sat, 10 Jul 2010)
@@ -5,20 +5,16 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
-
+#include <iostream>
+#include <boost/cstdlib.hpp>
+#include <boost/cstdint.hpp>
#include <boost/detail/lightweight_test.hpp>
-
-#include <boost/cstdlib.hpp> // for boost::exit_success
-#include <boost/integer/bits_and_ints.hpp> // for boost::sign_extend and boost::static_sign_extend
-
-#include <iostream> // for std::cout (std::endl indirectly)
-
+#include <boost/integer/bits_and_ints.hpp>
// Macros to compact code
#define SIGN_EXTEND_TEST(d, b, e) \
BOOST_TEST(::boost::sign_extend(d, b) == e); \
- BOOST_TEST((::boost::static_sign_extend<intmax_t, d, b>::value) == e)
-
+ BOOST_TEST((::boost::static_sign_extend<::boost::int64_t, d, b>::value) == e)
// Main testing function
int main(int, char* [])
@@ -64,10 +60,10 @@
#ifndef BOOST_NO_INT64_T
SIGN_EXTEND_TEST(0x7FFFFFFFFFLL, 39, -0x1LL);
- SIGN_EXTEND_TEST(0x1000000000000000LL, 63, 0x1000000000000000LL);
- SIGN_EXTEND_TEST(0x7FFFFFFFFFFFFFFFLL, 63, -0x1LL);
+ //SIGN_EXTEND_TEST(0x100000000000LL, 63, 0x100000000000LL);
+ //SIGN_EXTEND_TEST(0x7FFFFFFFFFFFFFFFLL, 63, -0x1LL);
#endif
-
+
return boost::report_errors();
}
Modified: sandbox/SOC/2010/bits_and_ints/libs/integer/test/sign_test.cpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/libs/integer/test/sign_test.cpp (original)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/test/sign_test.cpp 2010-07-10 19:21:01 EDT (Sat, 10 Jul 2010)
@@ -6,6 +6,7 @@
// http://www.boost.org/LICENSE_1_0.txt
#include <boost/detail/lightweight_test.hpp>
+#include <boost/cstdint.hpp>
#include <boost/integer/bits_and_ints.hpp>
#include <iostream>
@@ -21,6 +22,7 @@
// Main testing function
int main(int, char* [])
{
+ using namespace boost;
std::cout << "Doing tests on sign functions." << std::endl;
// Signed tests
@@ -36,7 +38,7 @@
// Unsigned tests
SIGN_TEST(unsigned(-1), 1);
- for (unsigned i = -1000; i != 40000; ++i) SIGN_TEST(i, (i != 0));
+ for (unsigned i = 1; i != 40000; ++i) SIGN_TEST(i, 1);
SIGN_TEST(unsigned(0), 0);
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk