1 From e77e8715b0a91a60cf2c4b85933b1063385da122 Mon Sep 17 00:00:00 2001
2 From: Joe Thornber <ejt@redhat.com>
3 Date: Wed, 2 Jul 2014 08:19:20 +0000
4 Subject: Remove ambiguity between boost::uint64_t and ::uint64_t.
6 This has been causing people problems on uclibc builds.
8 caching/cache_metadata_size.cc | 15 +++++++--------
9 caching/xml_format.cc | 7 +++----
10 era/superblock.cc | 5 ++---
11 era/writeset_tree.cc | 5 ++---
12 persistent-data/data-structures/bitset.cc | 7 +++----
13 thin-provisioning/device_tree.h | 4 +---
14 thin-provisioning/metadata_dumper.cc | 2 +-
15 7 files changed, 19 insertions(+), 26 deletions(-)
17 diff --git a/caching/cache_metadata_size.cc b/caching/cache_metadata_size.cc
18 index 7584da6..5792c49 100644
19 --- a/caching/cache_metadata_size.cc
20 +++ b/caching/cache_metadata_size.cc
25 -using namespace boost;
28 //----------------------------------------------------------------
29 @@ -18,9 +17,9 @@ namespace {
33 - optional<uint64_t> device_size;
34 - optional<uint32_t> block_size;
35 - optional<uint64_t> nr_blocks;
36 + boost::optional<uint64_t> device_size;
37 + boost::optional<uint32_t> block_size;
38 + boost::optional<uint64_t> nr_blocks;
39 uint32_t max_hint_width;
42 @@ -58,19 +57,19 @@ namespace {
43 while ((c = getopt_long(argc, argv, short_opts, long_opts, NULL)) != -1) {
46 - fs.block_size = lexical_cast<uint32_t>(optarg);
47 + fs.block_size = boost::lexical_cast<uint32_t>(optarg);
51 - fs.device_size = lexical_cast<uint64_t>(optarg);
52 + fs.device_size = boost::lexical_cast<uint64_t>(optarg);
56 - fs.nr_blocks = lexical_cast<uint64_t>(optarg);
57 + fs.nr_blocks = boost::lexical_cast<uint64_t>(optarg);
61 - fs.max_hint_width = lexical_cast<uint32_t>(optarg);
62 + fs.max_hint_width = boost::lexical_cast<uint32_t>(optarg);
66 diff --git a/caching/xml_format.cc b/caching/xml_format.cc
67 index cb03018..84d6fc2 100644
68 --- a/caching/xml_format.cc
69 +++ b/caching/xml_format.cc
71 #include <boost/lexical_cast.hpp>
74 -using namespace boost;
75 using namespace caching;
76 using namespace persistent_data;
78 @@ -189,14 +188,14 @@ namespace {
80 block_address cblock = get_attr<uint64_t>(attr, "cache_block");
81 decoded_or_error doe = base64_decode(get_attr<string>(attr, "data"));
82 - if (!get<vector<unsigned char> >(&doe)) {
83 + if (!boost::get<vector<unsigned char> >(&doe)) {
85 msg << "invalid base64 encoding of hint for cache block "
86 - << cblock << ": " << get<string>(doe);
87 + << cblock << ": " << boost::get<string>(doe);
88 throw runtime_error(msg.str());
91 - e->hint(cblock, get<vector<unsigned char> >(doe));
92 + e->hint(cblock, boost::get<vector<unsigned char> >(doe));
95 // FIXME: why passing e by ptr?
96 diff --git a/era/superblock.cc b/era/superblock.cc
97 index 1bd1a4f..c319e9b 100644
98 --- a/era/superblock.cc
99 +++ b/era/superblock.cc
101 #include "persistent-data/errors.h"
103 using namespace base;
104 -using namespace boost;
106 using namespace superblock_damage;
107 using namespace persistent_data;
108 @@ -149,8 +148,8 @@ superblock_traits::unpack(disk_type const &disk, value_type &value)
110 block_address ms = to_cpu<uint64_t>(disk.metadata_snap);
111 value.metadata_snap = (ms == SUPERBLOCK_LOCATION) ?
112 - optional<block_address>() :
113 - optional<block_address>(ms);
114 + boost::optional<block_address>() :
115 + boost::optional<block_address>(ms);
119 diff --git a/era/writeset_tree.cc b/era/writeset_tree.cc
120 index 54aa6a1..4e2c478 100644
121 --- a/era/writeset_tree.cc
122 +++ b/era/writeset_tree.cc
124 #include "persistent-data/data-structures/btree_damage_visitor.h"
125 #include "persistent-data/data-structures/bitset.h"
127 -using namespace boost;
129 using namespace writeset_tree_detail;
130 using namespace persistent_data;
131 @@ -90,8 +89,8 @@ namespace {
133 template <typename T>
134 run<uint32_t> to_uint32(run<T> const &r) {
135 - return run<uint32_t>(optional<uint32_t>(r.begin_),
136 - optional<uint32_t>(r.end_));
137 + return run<uint32_t>(boost::optional<uint32_t>(r.begin_),
138 + boost::optional<uint32_t>(r.end_));
142 diff --git a/persistent-data/data-structures/bitset.cc b/persistent-data/data-structures/bitset.cc
143 index 5851e28..e49e19f 100644
144 --- a/persistent-data/data-structures/bitset.cc
145 +++ b/persistent-data/data-structures/bitset.cc
147 #include "persistent-data/data-structures/bitset.h"
148 #include "persistent-data/math_utils.h"
150 -using namespace boost;
151 using namespace persistent_data;
152 using namespace persistent_data::bitset_detail;
154 @@ -12,7 +11,7 @@ using namespace std;
156 struct bitset_traits {
157 typedef base::le64 disk_type;
158 - typedef uint64_t value_type;
159 + typedef ::uint64_t value_type;
160 typedef no_op_ref_counter<uint64_t> ref_counter;
162 static void unpack(disk_type const &disk, value_type &value) {
163 @@ -118,11 +117,11 @@ namespace persistent_data {
167 - optional<uint32_t> lifted_mult64(optional<uint32_t> const &m) {
168 + boost::optional<uint32_t> lifted_mult64(boost::optional<uint32_t> const &m) {
172 - return optional<uint32_t>(*m * 64);
173 + return boost::optional<uint32_t>(*m * 64);
177 diff --git a/thin-provisioning/device_tree.h b/thin-provisioning/device_tree.h
178 index 320eb73..23ae924 100644
179 --- a/thin-provisioning/device_tree.h
180 +++ b/thin-provisioning/device_tree.h
182 #include "persistent-data/data-structures/btree.h"
183 #include "persistent-data/run.h"
185 -using namespace boost;
187 //----------------------------------------------------------------
189 namespace thin_provisioning {
190 @@ -50,7 +48,7 @@ namespace thin_provisioning {
192 class damage_visitor {
194 - typedef shared_ptr<damage_visitor> ptr;
195 + typedef boost::shared_ptr<damage_visitor> ptr;
197 virtual ~damage_visitor() {}
199 diff --git a/thin-provisioning/metadata_dumper.cc b/thin-provisioning/metadata_dumper.cc
200 index dfe18e0..0bd284e 100644
201 --- a/thin-provisioning/metadata_dumper.cc
202 +++ b/thin-provisioning/metadata_dumper.cc
203 @@ -226,7 +226,7 @@ thin_provisioning::metadata_dump(metadata::ptr md, emitter::ptr e, bool repair)
205 md->sb_.data_block_size_,
206 md->data_sm_->get_nr_blocks(),
207 - optional<block_address>());
208 + boost::optional<block_address>());
211 mapping_tree_detail::damage_visitor::ptr md_policy(mapping_damage_policy(repair));