Give up with --std=c++11

There are too many distros that use old versions of g++ that don't support it adequately.
This commit is contained in:
Joe Thornber
2013-08-08 10:49:59 +01:00
parent 79f64267b5
commit 0029962f20
10 changed files with 65 additions and 47 deletions

View File

@@ -29,16 +29,19 @@ rmap_visitor::visit(btree_path const &path,
}
}
namespace {
bool cmp_data_begin(rmap_visitor::rmap_region const &lhs,
rmap_visitor::rmap_region const &rhs) {
return lhs.data_begin < rhs.data_begin;
};
}
void
rmap_visitor::complete()
{
if (current_rmap_)
push_current();
auto cmp_data_begin = [] (rmap_region const &lhs, rmap_region const &rhs) {
return lhs.data_begin < rhs.data_begin;
};
std::sort(rmap_.begin(), rmap_.end(), cmp_data_begin);
}
@@ -52,8 +55,9 @@ rmap_visitor::get_rmap() const
bool
rmap_visitor::in_regions(block_address b) const
{
for (region const &r : regions_)
if (r.contains(b))
vector<region>::const_iterator it;
for (it = regions_.begin(); it != regions_.end(); ++it)
if (it->contains(b))
return true;
return false;

View File

@@ -131,7 +131,7 @@ namespace thin_provisioning {
using namespace superblock_detail;
superblock sb;
auto r = bm->read_lock(location, superblock_validator());
block_manager<>::read_ref r = bm->read_lock(location, superblock_validator());
superblock_disk const *sbd = reinterpret_cast<superblock_disk const *>(&r.data());
superblock_traits::unpack(*sbd, sb);
return sb;

View File

@@ -168,7 +168,7 @@ namespace {
virtual void visit(superblock_detail::superblock_corruption const &d) {
out_ << "superblock is corrupt" << end_message();
{
auto _ = out_.push();
nested_output::nest _ = out_.push();
out_ << d.desc_ << end_message();
}
err_ = combine_errors(err_, FATAL);
@@ -195,7 +195,7 @@ namespace {
virtual void visit(device_tree_detail::missing_devices const &d) {
out_ << "missing devices: " << d.keys_ << end_message();
{
auto _ = out_.push();
nested_output::nest _ = out_.push();
out_ << d.desc_ << end_message();
}
@@ -222,7 +222,7 @@ namespace {
virtual void visit(mapping_tree_detail::missing_devices const &d) {
out_ << "missing all mappings for devices: " << d.keys_ << end_message();
{
auto _ = out_.push();
nested_output::nest _ = out_.push();
out_ << d.desc_ << end_message();
}
err_ = combine_errors(err_, FATAL);
@@ -231,7 +231,7 @@ namespace {
virtual void visit(mapping_tree_detail::missing_mappings const &d) {
out_ << "thin device " << d.thin_dev_ << " is missing mappings " << d.keys_ << end_message();
{
auto _ = out_.push();
nested_output::nest _ = out_.push();
out_ << d.desc_ << end_message();
}
err_ = combine_errors(err_, FATAL);
@@ -267,7 +267,7 @@ namespace {
out << "examining superblock" << end_message();
{
auto _ = out.push();
nested_output::nest _ = out.push();
check_superblock(bm, sb_rep);
}
@@ -280,7 +280,7 @@ namespace {
if (fs.check_device_tree) {
out << "examining devices tree" << end_message();
{
auto _ = out.push();
nested_output::nest _ = out.push();
device_tree dtree(tm, sb.device_details_root_,
device_tree_detail::device_details_traits::ref_counter());
check_device_tree(dtree, dev_rep);
@@ -290,7 +290,7 @@ namespace {
if (fs.check_mapping_tree_level1 && !fs.check_mapping_tree_level2) {
out << "examining top level of mapping tree" << end_message();
{
auto _ = out.push();
nested_output::nest _ = out.push();
dev_tree dtree(tm, sb.data_mapping_root_,
mapping_tree_detail::mtree_traits::ref_counter(tm));
check_mapping_tree(dtree, mapping_rep);
@@ -299,7 +299,7 @@ namespace {
} else if (fs.check_mapping_tree_level2) {
out << "examining mapping tree" << end_message();
{
auto _ = out.push();
nested_output::nest _ = out.push();
mapping_tree mtree(tm, sb.data_mapping_root_,
mapping_tree_detail::block_traits::ref_counter(tm->get_sm()));
check_mapping_tree(mtree, mapping_rep);

View File

@@ -50,7 +50,9 @@ namespace {
};
void display_rmap(ostream &out, vector<rmap_region> const &rmap) {
for (rmap_region const &r : rmap) {
vector<rmap_region>::const_iterator it;
for (it = rmap.begin(); it != rmap.end(); ++it) {
rmap_region const &r = *it;
out << "data " << r.data_begin
<< ".." << r.data_end
<< " -> thin(" << r.thin_dev
@@ -66,8 +68,9 @@ namespace {
rmap_visitor rv;
try {
for (region const &r : regions)
rv.add_data_region(r);
vector<region>::const_iterator it;
for (it = regions.begin(); it != regions.end(); ++it)
rv.add_data_region(*it);
block_manager<>::ptr bm = open_bm(path);
transaction_manager::ptr tm = open_tm(bm);