From b4dbf8d74c627fa0d2d06f6b51030b130ed3ef51 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Thu, 1 Sep 2011 10:42:57 +0100 Subject: [PATCH] g++ 4.4 fixups --- .gitignore | 1 + Makefile | 4 ++-- btree.h | 18 +++++++++--------- space_map_disk.cc | 18 +++++++++--------- transaction_manager.cc | 2 +- transaction_manager.h | 12 ++++++------ 6 files changed, 28 insertions(+), 27 deletions(-) diff --git a/.gitignore b/.gitignore index 152ef73..9800e17 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,6 @@ *.d test.data thin_dump +thin_restore thin_repair *.metadata \ No newline at end of file diff --git a/Makefile b/Makefile index 9deccf3..11786ac 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/btree.h b/btree.h index 94b1bac..238f65f 100644 --- a/btree.h +++ b/btree.h @@ -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::read_ref> spine_; + transaction_manager::ptr tm_; + std::list::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::write_ref> spine_; + transaction_manager::ptr tm_; + std::list::write_ref> spine_; block_address root_; }; diff --git a/space_map_disk.cc b/space_map_disk.cc index a5531c0..9ac5b2b 100644 --- a/space_map_disk.cc +++ b/space_map_disk.cc @@ -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(&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(&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(&rr.data()); @@ -458,7 +458,7 @@ namespace { } void commit_ies() { - std::pair::write_ref, bool> p = + std::pair::write_ref, bool> p = sm_disk_base::get_tm()->shadow(bitmap_root_); bitmap_root_ = p.first.get_location(); diff --git a/transaction_manager.cc b/transaction_manager.cc index 99c59d5..ed26b6e 100644 --- a/transaction_manager.cc +++ b/transaction_manager.cc @@ -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) diff --git a/transaction_manager.h b/transaction_manager.h index 7a856bd..353b38d 100644 --- a/transaction_manager.h +++ b/transaction_manager.h @@ -13,15 +13,15 @@ namespace persistent_data { class transaction_manager : boost::noncopyable { public: typedef boost::shared_ptr 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 shadows_;