Get tools building with g++ 4.8.1
This commit is contained in:
@@ -76,7 +76,6 @@ namespace persistent_data {
|
||||
namespace btree_detail {
|
||||
using namespace base;
|
||||
using namespace std;
|
||||
using namespace boost;
|
||||
|
||||
uint32_t const BTREE_CSUM_XOR = 121107;
|
||||
|
||||
@@ -164,7 +163,7 @@ namespace persistent_data {
|
||||
|
||||
// Various searches
|
||||
int bsearch(uint64_t key, int want_hi) const;
|
||||
optional<unsigned> exact_search(uint64_t key) const;
|
||||
boost::optional<unsigned> exact_search(uint64_t key) const;
|
||||
int lower_bound(uint64_t key) const;
|
||||
|
||||
template <typename RefCounter>
|
||||
@@ -211,7 +210,7 @@ namespace persistent_data {
|
||||
const_cast<unsigned char *>(b.data().raw())));
|
||||
}
|
||||
|
||||
class ro_spine : private noncopyable {
|
||||
class ro_spine : private boost::noncopyable {
|
||||
public:
|
||||
ro_spine(transaction_manager::ptr tm,
|
||||
typename block_manager<>::validator::ptr v)
|
||||
@@ -232,7 +231,7 @@ namespace persistent_data {
|
||||
std::list<block_manager<>::read_ref> spine_;
|
||||
};
|
||||
|
||||
class shadow_spine : private noncopyable {
|
||||
class shadow_spine : private boost::noncopyable {
|
||||
public:
|
||||
typedef transaction_manager::read_ref read_ref;
|
||||
typedef transaction_manager::write_ref write_ref;
|
||||
|
||||
@@ -294,17 +294,17 @@ namespace persistent_data {
|
||||
}
|
||||
|
||||
template <typename ValueTraits>
|
||||
optional<unsigned>
|
||||
boost::optional<unsigned>
|
||||
node_ref<ValueTraits>::exact_search(uint64_t key) const
|
||||
{
|
||||
int i = bsearch(key, 0);
|
||||
if (i < 0 || static_cast<unsigned>(i) >= get_nr_entries())
|
||||
return optional<unsigned>();
|
||||
return boost::optional<unsigned>();
|
||||
|
||||
if (key != key_at(i))
|
||||
return optional<unsigned>();
|
||||
return boost::optional<unsigned>();
|
||||
|
||||
return optional<unsigned>(i);
|
||||
return boost::optional<unsigned>(i);
|
||||
}
|
||||
|
||||
template <typename ValueTraits>
|
||||
@@ -405,14 +405,14 @@ namespace persistent_data {
|
||||
namespace {
|
||||
template <typename ValueTraits>
|
||||
struct lower_bound_search {
|
||||
static optional<unsigned> search(btree_detail::node_ref<ValueTraits> n, uint64_t key) {
|
||||
static boost::optional<unsigned> search(btree_detail::node_ref<ValueTraits> n, uint64_t key) {
|
||||
return n.lower_bound(key);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename ValueTraits>
|
||||
struct exact_search {
|
||||
static optional<unsigned> search(btree_detail::node_ref<ValueTraits> n, uint64_t key) {
|
||||
static boost::optional<unsigned> search(btree_detail::node_ref<ValueTraits> n, uint64_t key) {
|
||||
return n.exact_search(key);
|
||||
}
|
||||
};
|
||||
@@ -428,7 +428,7 @@ namespace persistent_data {
|
||||
block_address root = root_;
|
||||
|
||||
for (unsigned level = 0; level < Levels - 1; ++level) {
|
||||
optional<block_address> mroot =
|
||||
boost::optional<block_address> mroot =
|
||||
lookup_raw<block_traits, lower_bound_search<block_traits> >(spine, root, key[level]);
|
||||
if (!mroot)
|
||||
return maybe_value();
|
||||
@@ -535,7 +535,7 @@ namespace persistent_data {
|
||||
|
||||
template <unsigned Levels, typename _>
|
||||
template <typename ValueTraits, typename Search>
|
||||
optional<typename ValueTraits::value_type>
|
||||
boost::optional<typename ValueTraits::value_type>
|
||||
btree<Levels, _>::
|
||||
lookup_raw(ro_spine &spine, block_address block, uint64_t key) const
|
||||
{
|
||||
@@ -546,18 +546,18 @@ namespace persistent_data {
|
||||
spine.step(block);
|
||||
node_ref<ValueTraits> leaf = spine.template get_node<ValueTraits>();
|
||||
|
||||
optional<unsigned> mi;
|
||||
boost::optional<unsigned> mi;
|
||||
if (leaf.get_type() == btree_detail::LEAF) {
|
||||
mi = Search::search(leaf, key);
|
||||
if (!mi)
|
||||
return optional<leaf_type>();
|
||||
return optional<leaf_type>(leaf.value_at(*mi));
|
||||
return boost::optional<leaf_type>();
|
||||
return boost::optional<leaf_type>(leaf.value_at(*mi));
|
||||
|
||||
}
|
||||
|
||||
mi = leaf.lower_bound(key);
|
||||
if (!mi || *mi < 0)
|
||||
return optional<leaf_type>();
|
||||
return boost::optional<leaf_type>();
|
||||
|
||||
node_ref<block_traits> internal = spine.template get_node<block_traits>();
|
||||
block = internal.value_at(*mi);
|
||||
@@ -803,7 +803,7 @@ namespace persistent_data {
|
||||
node_location loc2(loc);
|
||||
|
||||
loc2.push_key(o.key_at(i));
|
||||
loc2.key = optional<uint64_t>();
|
||||
loc2.key = boost::optional<uint64_t>();
|
||||
|
||||
walk_tree(v, loc2, o.value_at(i));
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace persistent_data {
|
||||
check_max_entries(n) &&
|
||||
check_nr_entries(n, loc.is_sub_root()) &&
|
||||
check_ordered_keys(n) &&
|
||||
check_parent_key(loc.is_sub_root() ? optional<uint64_t>() : loc.key, n)) {
|
||||
check_parent_key(loc.is_sub_root() ? boost::optional<uint64_t>() : loc.key, n)) {
|
||||
if (loc.is_sub_root())
|
||||
new_root(loc.level());
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace persistent_data {
|
||||
check_max_entries(n) &&
|
||||
check_nr_entries(n, loc.is_sub_root()) &&
|
||||
check_ordered_keys(n) &&
|
||||
check_parent_key(loc.is_sub_root() ? optional<uint64_t>() : loc.key, n)) {
|
||||
check_parent_key(loc.is_sub_root() ? boost::optional<uint64_t>() : loc.key, n)) {
|
||||
if (loc.is_sub_root())
|
||||
new_root(loc.level());
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ namespace persistent_data {
|
||||
check_max_entries(n) &&
|
||||
check_nr_entries(n, loc.is_sub_root()) &&
|
||||
check_ordered_keys(n) &&
|
||||
check_parent_key(loc.is_sub_root() ? optional<uint64_t>() : loc.key, n)) {
|
||||
check_parent_key(loc.is_sub_root() ? boost::optional<uint64_t>() : loc.key, n)) {
|
||||
if (loc.is_sub_root())
|
||||
new_root(loc.level());
|
||||
|
||||
@@ -225,7 +225,7 @@ namespace persistent_data {
|
||||
check_max_entries(n) &&
|
||||
check_nr_entries(n, loc.is_sub_root()) &&
|
||||
check_ordered_keys(n) &&
|
||||
check_parent_key(loc.is_sub_root() ? optional<uint64_t>() : loc.key, n)) {
|
||||
check_parent_key(loc.is_sub_root() ? boost::optional<uint64_t>() : loc.key, n)) {
|
||||
if (loc.is_sub_root())
|
||||
new_root(loc.level());
|
||||
|
||||
|
||||
@@ -26,12 +26,10 @@
|
||||
#include "persistent-data/math_utils.h"
|
||||
#include "persistent-data/transaction_manager.h"
|
||||
|
||||
using namespace boost;
|
||||
using namespace persistent_data;
|
||||
using namespace std;
|
||||
using namespace sm_disk_detail;
|
||||
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
namespace {
|
||||
@@ -322,7 +320,7 @@ namespace {
|
||||
unsigned bit_begin = (index == begin_index) ? (begin % ENTRIES_PER_BLOCK) : 0;
|
||||
unsigned bit_end = (index == end_index - 1) ? (end % ENTRIES_PER_BLOCK) : ENTRIES_PER_BLOCK;
|
||||
|
||||
optional<unsigned> maybe_b = bm.find_free(bit_begin, bit_end);
|
||||
boost::optional<unsigned> maybe_b = bm.find_free(bit_begin, bit_end);
|
||||
if (maybe_b) {
|
||||
block_address b = (index * ENTRIES_PER_BLOCK) + *maybe_b;
|
||||
return b;
|
||||
@@ -474,7 +472,7 @@ namespace {
|
||||
|
||||
ref_t lookup_ref_count(block_address b) const {
|
||||
uint64_t key[1] = {b};
|
||||
optional<ref_t> mvalue = ref_counts_.lookup(key);
|
||||
boost::optional<ref_t> mvalue = ref_counts_.lookup(key);
|
||||
if (!mvalue)
|
||||
throw runtime_error("ref count not in tree");
|
||||
return *mvalue;
|
||||
@@ -572,7 +570,7 @@ namespace {
|
||||
|
||||
virtual index_entry find_ie(block_address ie_index) const {
|
||||
uint64_t key[1] = {ie_index};
|
||||
optional<index_entry> mindex = bitmaps_.lookup(key);
|
||||
boost::optional<index_entry> mindex = bitmaps_.lookup(key);
|
||||
if (!mindex)
|
||||
throw runtime_error("Couldn't lookup bitmap");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user