Compare commits

...

6 Commits

Author SHA1 Message Date
Edward Diener
4f54d83981 Merge pull request #21 from NAThompson/remove_deprecated_header
Replace deprecated header with non-deprecated
2018-02-11 16:50:56 -05:00
Nick Thompson
4cac68e762 Remove deprecated header. 2018-02-11 15:08:19 -06:00
Marshall Clow
d3eb4faf0c Fix some warnings from gcc - https://github.com/boostorg/dynamic_bitset/issues/19 2018-01-31 11:11:12 -08:00
Marshall Clow
3f3662d39d Fix comment block in Jamfile; addresses https://github.com/boostorg/dynamic_bitset/issues/20 2018-01-31 09:27:51 -08:00
Edward Diener
184d1ba7ad Merge pull request #17 from DanielaE/feature/squash-narrowing-warnings
squash compiler warnings due to wrong order of type-cast and integral…
2017-06-27 09:36:10 -04:00
Daniela Engert
5b39db5ba0 squash compiler warnings due to wrong order of type-cast and integral type promotion
Signed-off-by: Daniela Engert <dani@ngrt.de>
2017-05-25 10:29:34 +02:00
3 changed files with 15 additions and 15 deletions

View File

@@ -1,11 +1,12 @@
// -----------------------------------------------------------
// Copyright (c) 2002 Gennaro Prota
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// -----------------------------------------------------------
# -----------------------------------------------------------
# Copyright (c) 2002 Gennaro Prota
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# -----------------------------------------------------------
exe timing_tests
: timing_tests.cpp
;

View File

@@ -977,7 +977,7 @@ template <typename Block, typename Allocator>
dynamic_bitset<Block, Allocator>&
dynamic_bitset<Block, Allocator>::set()
{
std::fill(m_bits.begin(), m_bits.end(), ~Block(0));
std::fill(m_bits.begin(), m_bits.end(), static_cast<Block>(~0));
m_zero_unused_bits();
return *this;
}
@@ -1056,7 +1056,7 @@ bool dynamic_bitset<Block, Allocator>::all() const
}
const block_width_type extra_bits = count_extra_bits();
block_type const all_ones = ~static_cast<Block>(0);
block_type const all_ones = static_cast<Block>(~0);
if (extra_bits == 0) {
for (size_type i = 0, e = num_blocks(); i < e; ++i) {
@@ -1070,7 +1070,7 @@ bool dynamic_bitset<Block, Allocator>::all() const
return false;
}
}
block_type const mask = ~(~static_cast<Block>(0) << extra_bits);
const block_type mask = (block_type(1) << extra_bits) - 1;
if (m_highest_block() != mask) {
return false;
}
@@ -1940,8 +1940,7 @@ inline void dynamic_bitset<Block, Allocator>::m_zero_unused_bits()
const block_width_type extra_bits = count_extra_bits();
if (extra_bits != 0)
m_highest_block() &= ~(~static_cast<Block>(0) << extra_bits);
m_highest_block() &= (Block(1) << extra_bits) - 1;
}
// check class invariants
@@ -1950,7 +1949,7 @@ bool dynamic_bitset<Block, Allocator>::m_check_invariants() const
{
const block_width_type extra_bits = count_extra_bits();
if (extra_bits > 0) {
block_type const mask = (~static_cast<Block>(0) << extra_bits);
const block_type mask = block_type(~0) << extra_bits;
if ((m_highest_block() & mask) != 0)
return false;
}

View File

@@ -15,7 +15,7 @@
#define BOOST_LOWEST_BIT_HPP_GP_20030301
#include <assert.h>
#include "boost/pending/integer_log2.hpp"
#include "boost/integer/integer_log2.hpp"
namespace boost {