From e77e8715b0a91a60cf2c4b85933b1063385da122 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Wed, 2 Jul 2014 08:19:20 +0000 Subject: [PATCH] Remove ambiguity between boost::uint64_t and ::uint64_t. This has been causing people problems on uclibc builds. --- caching/cache_metadata_size.cc | 15 +++++++-------- caching/xml_format.cc | 7 +++---- era/superblock.cc | 5 ++--- era/writeset_tree.cc | 5 ++--- persistent-data/data-structures/bitset.cc | 7 +++---- thin-provisioning/device_tree.h | 4 +--- thin-provisioning/metadata_dumper.cc | 2 +- 7 files changed, 19 insertions(+), 26 deletions(-) diff --git a/caching/cache_metadata_size.cc b/caching/cache_metadata_size.cc index 7584da6f..5792c49c 100644 --- a/caching/cache_metadata_size.cc +++ b/caching/cache_metadata_size.cc @@ -7,7 +7,6 @@ #include #include -using namespace boost; using namespace std; //---------------------------------------------------------------- @@ -18,9 +17,9 @@ namespace { : max_hint_width(4) { } - optional device_size; - optional block_size; - optional nr_blocks; + boost::optional device_size; + boost::optional block_size; + boost::optional nr_blocks; uint32_t max_hint_width; }; @@ -58,19 +57,19 @@ namespace { while ((c = getopt_long(argc, argv, short_opts, long_opts, NULL)) != -1) { switch (c) { case 0: - fs.block_size = lexical_cast(optarg); + fs.block_size = boost::lexical_cast(optarg); break; case 1: - fs.device_size = lexical_cast(optarg); + fs.device_size = boost::lexical_cast(optarg); break; case 2: - fs.nr_blocks = lexical_cast(optarg); + fs.nr_blocks = boost::lexical_cast(optarg); break; case 3: - fs.max_hint_width = lexical_cast(optarg); + fs.max_hint_width = boost::lexical_cast(optarg); break; case 'h': diff --git a/caching/xml_format.cc b/caching/xml_format.cc index cb030187..84d6fc29 100644 --- a/caching/xml_format.cc +++ b/caching/xml_format.cc @@ -5,7 +5,6 @@ #include #include -using namespace boost; using namespace caching; using namespace persistent_data; using namespace std; @@ -189,14 +188,14 @@ namespace { block_address cblock = get_attr(attr, "cache_block"); decoded_or_error doe = base64_decode(get_attr(attr, "data")); - if (!get >(&doe)) { + if (!boost::get >(&doe)) { ostringstream msg; msg << "invalid base64 encoding of hint for cache block " - << cblock << ": " << get(doe); + << cblock << ": " << boost::get(doe); throw runtime_error(msg.str()); } - e->hint(cblock, get >(doe)); + e->hint(cblock, boost::get >(doe)); } // FIXME: why passing e by ptr? diff --git a/era/superblock.cc b/era/superblock.cc index 1bd1a4f2..c319e9b5 100644 --- a/era/superblock.cc +++ b/era/superblock.cc @@ -4,7 +4,6 @@ #include "persistent-data/errors.h" using namespace base; -using namespace boost; using namespace era; using namespace superblock_damage; using namespace persistent_data; @@ -149,8 +148,8 @@ superblock_traits::unpack(disk_type const &disk, value_type &value) block_address ms = to_cpu(disk.metadata_snap); value.metadata_snap = (ms == SUPERBLOCK_LOCATION) ? - optional() : - optional(ms); + boost::optional() : + boost::optional(ms); } void diff --git a/era/writeset_tree.cc b/era/writeset_tree.cc index 54aa6a16..4e2c478f 100644 --- a/era/writeset_tree.cc +++ b/era/writeset_tree.cc @@ -2,7 +2,6 @@ #include "persistent-data/data-structures/btree_damage_visitor.h" #include "persistent-data/data-structures/bitset.h" -using namespace boost; using namespace era; using namespace writeset_tree_detail; using namespace persistent_data; @@ -90,8 +89,8 @@ namespace { private: template run to_uint32(run const &r) { - return run(optional(r.begin_), - optional(r.end_)); + return run(boost::optional(r.begin_), + boost::optional(r.end_)); } damage_visitor &v_; diff --git a/persistent-data/data-structures/bitset.cc b/persistent-data/data-structures/bitset.cc index 5851e28e..e49e19f1 100644 --- a/persistent-data/data-structures/bitset.cc +++ b/persistent-data/data-structures/bitset.cc @@ -2,7 +2,6 @@ #include "persistent-data/data-structures/bitset.h" #include "persistent-data/math_utils.h" -using namespace boost; using namespace persistent_data; using namespace persistent_data::bitset_detail; using namespace std; @@ -12,7 +11,7 @@ using namespace std; namespace { struct bitset_traits { typedef base::le64 disk_type; - typedef uint64_t value_type; + typedef ::uint64_t value_type; typedef no_op_ref_counter ref_counter; static void unpack(disk_type const &disk, value_type &value) { @@ -118,11 +117,11 @@ namespace persistent_data { } private: - optional lifted_mult64(optional const &m) { + boost::optional lifted_mult64(boost::optional const &m) { if (!m) return m; - return optional(*m * 64); + return boost::optional(*m * 64); } bitset_visitor &v_; diff --git a/thin-provisioning/device_tree.h b/thin-provisioning/device_tree.h index 320eb73b..23ae9247 100644 --- a/thin-provisioning/device_tree.h +++ b/thin-provisioning/device_tree.h @@ -4,8 +4,6 @@ #include "persistent-data/data-structures/btree.h" #include "persistent-data/run.h" -using namespace boost; - //---------------------------------------------------------------- namespace thin_provisioning { @@ -50,7 +48,7 @@ namespace thin_provisioning { class damage_visitor { public: - typedef shared_ptr ptr; + typedef boost::shared_ptr ptr; virtual ~damage_visitor() {} diff --git a/thin-provisioning/metadata_dumper.cc b/thin-provisioning/metadata_dumper.cc index dfe18e0f..0bd284e2 100644 --- a/thin-provisioning/metadata_dumper.cc +++ b/thin-provisioning/metadata_dumper.cc @@ -226,7 +226,7 @@ thin_provisioning::metadata_dump(metadata::ptr md, emitter::ptr e, bool repair) md->sb_.trans_id_, md->sb_.data_block_size_, md->data_sm_->get_nr_blocks(), - optional()); + boost::optional()); { mapping_tree_detail::damage_visitor::ptr md_policy(mapping_damage_policy(repair));