g++ 4.4 fixups

This commit is contained in:
Joe Thornber 2011-09-01 10:42:57 +01:00
parent 28a2639036
commit b4dbf8d74c
6 changed files with 28 additions and 27 deletions

1
.gitignore vendored
View File

@ -4,5 +4,6 @@
*.d
test.data
thin_dump
thin_restore
thin_repair
*.metadata

View File

@ -12,8 +12,8 @@ SOURCE=\
OBJECTS=$(subst .cc,.o,$(SOURCE))
TOP_DIR:=$(PWD)
#CPPFLAGS=-Wall -g -I$(TOP_DIR)
CPPFLAGS=-Wall -std=c++0x -g -I$(TOP_DIR)
CPPFLAGS=-Wall -g -I$(TOP_DIR)
#CPPFLAGS=-Wall -std=c++0x -g -I$(TOP_DIR)
LIBS=-lstdc++
.PHONEY: test-programs

18
btree.h
View File

@ -165,7 +165,7 @@ namespace persistent_data {
class ro_spine : private noncopyable {
public:
ro_spine(typename transaction_manager::ptr tm)
ro_spine(transaction_manager::ptr tm)
: tm_(tm) {
}
@ -181,16 +181,16 @@ namespace persistent_data {
}
private:
typename transaction_manager::ptr tm_;
std::list<typename block_manager<>::read_ref> spine_;
transaction_manager::ptr tm_;
std::list<block_manager<>::read_ref> spine_;
};
class shadow_spine : private noncopyable {
public:
typedef typename transaction_manager::read_ref read_ref;
typedef typename transaction_manager::write_ref write_ref;
typedef transaction_manager::read_ref read_ref;
typedef transaction_manager::write_ref write_ref;
shadow_spine(typename transaction_manager::ptr tm)
shadow_spine(transaction_manager::ptr tm)
: tm_(tm) {
}
@ -206,7 +206,7 @@ namespace persistent_data {
return p.second;
}
void step(typename transaction_manager::write_ref b) {
void step(transaction_manager::write_ref b) {
spine_.push_back(b);
if (spine_.size() == 1)
root_ = spine_.front().get_location();
@ -247,8 +247,8 @@ namespace persistent_data {
}
private:
typename transaction_manager::ptr tm_;
std::list<typename block_manager<>::write_ref> spine_;
transaction_manager::ptr tm_;
std::list<block_manager<>::write_ref> spine_;
block_address root_;
};

View File

@ -81,17 +81,17 @@ namespace {
}
private:
void *bitmap_data(typename transaction_manager::write_ref &wr) {
void *bitmap_data(transaction_manager::write_ref &wr) {
bitmap_header *h = reinterpret_cast<bitmap_header *>(&wr.data()[0]);
return h + 1;
}
void const *bitmap_data(typename transaction_manager::read_ref &rr) const {
void const *bitmap_data(transaction_manager::read_ref &rr) const {
bitmap_header const *h = reinterpret_cast<bitmap_header const *>(&rr.data()[0]);
return h + 1;
}
typename transaction_manager::ptr tm_;
transaction_manager::ptr tm_;
index_entry ie_;
};
@ -132,7 +132,7 @@ namespace {
ref_counts_(tm_, ref_count_traits::ref_counter()) {
}
sm_disk_base(typename transaction_manager::ptr tm,
sm_disk_base(transaction_manager::ptr tm,
sm_root const &root)
: tm_(tm),
entries_per_block_((MD_BLOCK_SIZE - sizeof(bitmap_header)) * 4),
@ -239,12 +239,12 @@ namespace {
}
virtual void check(block_counter &counter) const {
typename ref_count_validator::ptr v(new ref_count_validator(counter));
ref_count_validator::ptr v(new ref_count_validator(counter));
ref_counts_.visit(v);
}
protected:
typename transaction_manager::ptr get_tm() const {
transaction_manager::ptr get_tm() const {
return tm_;
}
@ -364,7 +364,7 @@ namespace {
void check(block_counter &counter) const {
sm_disk_base::check(counter);
typename bitmap_tree_validator::ptr v(new bitmap_tree_validator(counter));
bitmap_tree_validator::ptr v(new bitmap_tree_validator(counter));
bitmaps_.visit(v);
}
@ -446,7 +446,7 @@ namespace {
}
void load_ies() {
typename block_manager<>::read_ref rr =
block_manager<>::read_ref rr =
sm_disk_base::get_tm()->read_lock(bitmap_root_);
metadata_index const *mdi = reinterpret_cast<metadata_index const *>(&rr.data());
@ -458,7 +458,7 @@ namespace {
}
void commit_ies() {
std::pair<typename block_manager<>::write_ref, bool> p =
std::pair<block_manager<>::write_ref, bool> p =
sm_disk_base::get_tm()->shadow(bitmap_root_);
bitmap_root_ = p.first.get_location();

View File

@ -8,7 +8,7 @@ using namespace std;
//----------------------------------------------------------------
transaction_manager::transaction_manager(typename block_manager<>::ptr bm,
transaction_manager::transaction_manager(block_manager<>::ptr bm,
space_map::ptr sm)
: bm_(bm),
sm_(sm)

View File

@ -13,15 +13,15 @@ namespace persistent_data {
class transaction_manager : boost::noncopyable {
public:
typedef boost::shared_ptr<transaction_manager> ptr;
typedef typename block_manager<>::read_ref read_ref;
typedef typename block_manager<>::write_ref write_ref;
typedef typename block_manager<>::validator::ptr validator;
typedef block_manager<>::read_ref read_ref;
typedef block_manager<>::write_ref write_ref;
typedef block_manager<>::validator::ptr validator;
// If the space map is persistent, then the caller should
// hold onto a reference and remember to call sm_->commit()
// and update the superblock before dropping the superblock
// reference.
transaction_manager(typename block_manager<>::ptr bm,
transaction_manager(block_manager<>::ptr bm,
space_map::ptr sm);
~transaction_manager();
@ -44,7 +44,7 @@ namespace persistent_data {
return sm_;
}
typename block_manager<>::ptr get_bm() {
block_manager<>::ptr get_bm() {
return bm_;
}
@ -54,7 +54,7 @@ namespace persistent_data {
bool is_shadow(block_address b) const;
void wipe_shadow_table();
typename block_manager<>::ptr bm_;
block_manager<>::ptr bm_;
space_map::ptr sm_;
std::set<block_address> shadows_;