9dd978070312252f18860eb3393dd1c1b05ba313
[gentoo.git] /
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.
5
6 This has been causing people problems on uclibc builds.
7 ---
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(-)
16
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
21 @@ -7,7 +7,6 @@
22  #include <stdint.h>
23  #include <stdexcept>
24  
25 -using namespace boost;
26  using namespace std;
27  
28  //----------------------------------------------------------------
29 @@ -18,9 +17,9 @@ namespace {
30                         : max_hint_width(4) {
31                 }
32  
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;
40         };
41  
42 @@ -58,19 +57,19 @@ namespace {
43                 while ((c = getopt_long(argc, argv, short_opts, long_opts, NULL)) != -1) {
44                         switch (c) {
45                         case 0:
46 -                               fs.block_size = lexical_cast<uint32_t>(optarg);
47 +                               fs.block_size = boost::lexical_cast<uint32_t>(optarg);
48                                 break;
49  
50                         case 1:
51 -                               fs.device_size = lexical_cast<uint64_t>(optarg);
52 +                               fs.device_size = boost::lexical_cast<uint64_t>(optarg);
53                                 break;
54  
55                         case 2:
56 -                               fs.nr_blocks = lexical_cast<uint64_t>(optarg);
57 +                               fs.nr_blocks = boost::lexical_cast<uint64_t>(optarg);
58                                 break;
59  
60                         case 3:
61 -                               fs.max_hint_width = lexical_cast<uint32_t>(optarg);
62 +                               fs.max_hint_width = boost::lexical_cast<uint32_t>(optarg);
63                                 break;
64  
65                         case 'h':
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
70 @@ -5,7 +5,6 @@
71  #include <boost/lexical_cast.hpp>
72  #include <expat.h>
73  
74 -using namespace boost;
75  using namespace caching;
76  using namespace persistent_data;
77  using namespace std;
78 @@ -189,14 +188,14 @@ namespace {
79  
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)) {
84                         ostringstream msg;
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());
89                 }
90  
91 -               e->hint(cblock, get<vector<unsigned char> >(doe));
92 +               e->hint(cblock, boost::get<vector<unsigned char> >(doe));
93         }
94  
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
100 @@ -4,7 +4,6 @@
101  #include "persistent-data/errors.h"
102  
103  using namespace base;
104 -using namespace boost;
105  using namespace era;
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)
109  
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);
116  }
117  
118  void
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
123 @@ -2,7 +2,6 @@
124  #include "persistent-data/data-structures/btree_damage_visitor.h"
125  #include "persistent-data/data-structures/bitset.h"
126  
127 -using namespace boost;
128  using namespace era;
129  using namespace writeset_tree_detail;
130  using namespace persistent_data;
131 @@ -90,8 +89,8 @@ namespace {
132         private:
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_));
139                 }
140  
141                 damage_visitor &v_;
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
146 @@ -2,7 +2,6 @@
147  #include "persistent-data/data-structures/bitset.h"
148  #include "persistent-data/math_utils.h"
149  
150 -using namespace boost;
151  using namespace persistent_data;
152  using namespace persistent_data::bitset_detail;
153  using namespace std;
154 @@ -12,7 +11,7 @@ using namespace std;
155  namespace {
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;
161  
162                 static void unpack(disk_type const &disk, value_type &value) {
163 @@ -118,11 +117,11 @@ namespace persistent_data {
164                                 }
165  
166                         private:
167 -                               optional<uint32_t> lifted_mult64(optional<uint32_t> const &m) {
168 +                               boost::optional<uint32_t> lifted_mult64(boost::optional<uint32_t> const &m) {
169                                         if (!m)
170                                                 return m;
171  
172 -                                       return optional<uint32_t>(*m * 64);
173 +                                       return boost::optional<uint32_t>(*m * 64);
174                                 }
175  
176                                 bitset_visitor &v_;
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
181 @@ -4,8 +4,6 @@
182  #include "persistent-data/data-structures/btree.h"
183  #include "persistent-data/run.h"
184  
185 -using namespace boost;
186 -
187  //----------------------------------------------------------------
188  
189  namespace thin_provisioning {
190 @@ -50,7 +48,7 @@ namespace thin_provisioning {
191  
192                 class damage_visitor {
193                 public:
194 -                       typedef shared_ptr<damage_visitor> ptr;
195 +                       typedef boost::shared_ptr<damage_visitor> ptr;
196  
197                         virtual ~damage_visitor() {}
198  
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)
204                             md->sb_.trans_id_,
205                             md->sb_.data_block_size_,
206                             md->data_sm_->get_nr_blocks(),
207 -                           optional<block_address>());
208 +                           boost::optional<block_address>());
209  
210         {
211                 mapping_tree_detail::damage_visitor::ptr md_policy(mapping_damage_policy(repair));
212 -- 
213 2.0.2
214