Gentoo Archives: gentoo-commits

From: "Samuli Suominen (ssuominen)" <ssuominen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-block/thin-provisioning-tools/files: thin-provisioning-tools-0.3.2-Remove-ambiguity-between-boost-uint64_t-and-uint64_t.patch
Date: Fri, 01 Aug 2014 09:14:16
Message-Id: 20140801091412.592032004E@flycatcher.gentoo.org
1 ssuominen 14/08/01 09:14:12
2
3 Added:
4 thin-provisioning-tools-0.3.2-Remove-ambiguity-between-boost-uint64_t-and-uint64_t.patch
5 Log:
6 Fix portability with, for exaexample, sys-libs/uclibc using upstream patch http://github.com/jthornber/thin-provisioning-tools/commit/e77e8715b0a91a60cf2c4b85933b1063385da122
7
8 (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 4868F14D)
9
10 Revision Changes Path
11 1.1 sys-block/thin-provisioning-tools/files/thin-provisioning-tools-0.3.2-Remove-ambiguity-between-boost-uint64_t-and-uint64_t.patch
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-block/thin-provisioning-tools/files/thin-provisioning-tools-0.3.2-Remove-ambiguity-between-boost-uint64_t-and-uint64_t.patch?rev=1.1&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-block/thin-provisioning-tools/files/thin-provisioning-tools-0.3.2-Remove-ambiguity-between-boost-uint64_t-and-uint64_t.patch?rev=1.1&content-type=text/plain
15
16 Index: thin-provisioning-tools-0.3.2-Remove-ambiguity-between-boost-uint64_t-and-uint64_t.patch
17 ===================================================================
18 From e77e8715b0a91a60cf2c4b85933b1063385da122 Mon Sep 17 00:00:00 2001
19 From: Joe Thornber <ejt@××××××.com>
20 Date: Wed, 2 Jul 2014 08:19:20 +0000
21 Subject: Remove ambiguity between boost::uint64_t and ::uint64_t.
22
23 This has been causing people problems on uclibc builds.
24 ---
25 caching/cache_metadata_size.cc | 15 +++++++--------
26 caching/xml_format.cc | 7 +++----
27 era/superblock.cc | 5 ++---
28 era/writeset_tree.cc | 5 ++---
29 persistent-data/data-structures/bitset.cc | 7 +++----
30 thin-provisioning/device_tree.h | 4 +---
31 thin-provisioning/metadata_dumper.cc | 2 +-
32 7 files changed, 19 insertions(+), 26 deletions(-)
33
34 diff --git a/caching/cache_metadata_size.cc b/caching/cache_metadata_size.cc
35 index 7584da6..5792c49 100644
36 --- a/caching/cache_metadata_size.cc
37 +++ b/caching/cache_metadata_size.cc
38 @@ -7,7 +7,6 @@
39 #include <stdint.h>
40 #include <stdexcept>
41
42 -using namespace boost;
43 using namespace std;
44
45 //----------------------------------------------------------------
46 @@ -18,9 +17,9 @@ namespace {
47 : max_hint_width(4) {
48 }
49
50 - optional<uint64_t> device_size;
51 - optional<uint32_t> block_size;
52 - optional<uint64_t> nr_blocks;
53 + boost::optional<uint64_t> device_size;
54 + boost::optional<uint32_t> block_size;
55 + boost::optional<uint64_t> nr_blocks;
56 uint32_t max_hint_width;
57 };
58
59 @@ -58,19 +57,19 @@ namespace {
60 while ((c = getopt_long(argc, argv, short_opts, long_opts, NULL)) != -1) {
61 switch (c) {
62 case 0:
63 - fs.block_size = lexical_cast<uint32_t>(optarg);
64 + fs.block_size = boost::lexical_cast<uint32_t>(optarg);
65 break;
66
67 case 1:
68 - fs.device_size = lexical_cast<uint64_t>(optarg);
69 + fs.device_size = boost::lexical_cast<uint64_t>(optarg);
70 break;
71
72 case 2:
73 - fs.nr_blocks = lexical_cast<uint64_t>(optarg);
74 + fs.nr_blocks = boost::lexical_cast<uint64_t>(optarg);
75 break;
76
77 case 3:
78 - fs.max_hint_width = lexical_cast<uint32_t>(optarg);
79 + fs.max_hint_width = boost::lexical_cast<uint32_t>(optarg);
80 break;
81
82 case 'h':
83 diff --git a/caching/xml_format.cc b/caching/xml_format.cc
84 index cb03018..84d6fc2 100644
85 --- a/caching/xml_format.cc
86 +++ b/caching/xml_format.cc
87 @@ -5,7 +5,6 @@
88 #include <boost/lexical_cast.hpp>
89 #include <expat.h>
90
91 -using namespace boost;
92 using namespace caching;
93 using namespace persistent_data;
94 using namespace std;
95 @@ -189,14 +188,14 @@ namespace {
96
97 block_address cblock = get_attr<uint64_t>(attr, "cache_block");
98 decoded_or_error doe = base64_decode(get_attr<string>(attr, "data"));
99 - if (!get<vector<unsigned char> >(&doe)) {
100 + if (!boost::get<vector<unsigned char> >(&doe)) {
101 ostringstream msg;
102 msg << "invalid base64 encoding of hint for cache block "
103 - << cblock << ": " << get<string>(doe);
104 + << cblock << ": " << boost::get<string>(doe);
105 throw runtime_error(msg.str());
106 }
107
108 - e->hint(cblock, get<vector<unsigned char> >(doe));
109 + e->hint(cblock, boost::get<vector<unsigned char> >(doe));
110 }
111
112 // FIXME: why passing e by ptr?
113 diff --git a/era/superblock.cc b/era/superblock.cc
114 index 1bd1a4f..c319e9b 100644
115 --- a/era/superblock.cc
116 +++ b/era/superblock.cc
117 @@ -4,7 +4,6 @@
118 #include "persistent-data/errors.h"
119
120 using namespace base;
121 -using namespace boost;
122 using namespace era;
123 using namespace superblock_damage;
124 using namespace persistent_data;
125 @@ -149,8 +148,8 @@ superblock_traits::unpack(disk_type const &disk, value_type &value)
126
127 block_address ms = to_cpu<uint64_t>(disk.metadata_snap);
128 value.metadata_snap = (ms == SUPERBLOCK_LOCATION) ?
129 - optional<block_address>() :
130 - optional<block_address>(ms);
131 + boost::optional<block_address>() :
132 + boost::optional<block_address>(ms);
133 }
134
135 void
136 diff --git a/era/writeset_tree.cc b/era/writeset_tree.cc
137 index 54aa6a1..4e2c478 100644
138 --- a/era/writeset_tree.cc
139 +++ b/era/writeset_tree.cc
140 @@ -2,7 +2,6 @@
141 #include "persistent-data/data-structures/btree_damage_visitor.h"
142 #include "persistent-data/data-structures/bitset.h"
143
144 -using namespace boost;
145 using namespace era;
146 using namespace writeset_tree_detail;
147 using namespace persistent_data;
148 @@ -90,8 +89,8 @@ namespace {
149 private:
150 template <typename T>
151 run<uint32_t> to_uint32(run<T> const &r) {
152 - return run<uint32_t>(optional<uint32_t>(r.begin_),
153 - optional<uint32_t>(r.end_));
154 + return run<uint32_t>(boost::optional<uint32_t>(r.begin_),
155 + boost::optional<uint32_t>(r.end_));
156 }
157
158 damage_visitor &v_;
159 diff --git a/persistent-data/data-structures/bitset.cc b/persistent-data/data-structures/bitset.cc
160 index 5851e28..e49e19f 100644
161 --- a/persistent-data/data-structures/bitset.cc
162 +++ b/persistent-data/data-structures/bitset.cc
163 @@ -2,7 +2,6 @@
164 #include "persistent-data/data-structures/bitset.h"
165 #include "persistent-data/math_utils.h"
166
167 -using namespace boost;
168 using namespace persistent_data;
169 using namespace persistent_data::bitset_detail;
170 using namespace std;
171 @@ -12,7 +11,7 @@ using namespace std;
172 namespace {
173 struct bitset_traits {
174 typedef base::le64 disk_type;
175 - typedef uint64_t value_type;
176 + typedef ::uint64_t value_type;
177 typedef no_op_ref_counter<uint64_t> ref_counter;
178
179 static void unpack(disk_type const &disk, value_type &value) {
180 @@ -118,11 +117,11 @@ namespace persistent_data {
181 }
182
183 private:
184 - optional<uint32_t> lifted_mult64(optional<uint32_t> const &m) {
185 + boost::optional<uint32_t> lifted_mult64(boost::optional<uint32_t> const &m) {
186 if (!m)
187 return m;
188
189 - return optional<uint32_t>(*m * 64);
190 + return boost::optional<uint32_t>(*m * 64);
191 }
192
193 bitset_visitor &v_;
194 diff --git a/thin-provisioning/device_tree.h b/thin-provisioning/device_tree.h
195 index 320eb73..23ae924 100644
196 --- a/thin-provisioning/device_tree.h
197 +++ b/thin-provisioning/device_tree.h
198 @@ -4,8 +4,6 @@
199 #include "persistent-data/data-structures/btree.h"
200 #include "persistent-data/run.h"
201
202 -using namespace boost;
203 -
204 //----------------------------------------------------------------
205
206 namespace thin_provisioning {
207 @@ -50,7 +48,7 @@ namespace thin_provisioning {
208
209 class damage_visitor {
210 public:
211 - typedef shared_ptr<damage_visitor> ptr;
212 + typedef boost::shared_ptr<damage_visitor> ptr;
213
214 virtual ~damage_visitor() {}
215
216 diff --git a/thin-provisioning/metadata_dumper.cc b/thin-provisioning/metadata_dumper.cc
217 index dfe18e0..0bd284e 100644
218 --- a/thin-provisioning/metadata_dumper.cc
219 +++ b/thin-provisioning/metadata_dumper.cc
220 @@ -226,7 +226,7 @@ thin_provisioning::metadata_dump(metadata::ptr md, emitter::ptr e, bool repair)
221 md->sb_.trans_id_,
222 md->sb_.data_block_size_,
223 md->data_sm_->get_nr_blocks(),
224 - optional<block_address>());
225 + boost::optional<block_address>());
226
227 {
228 mapping_tree_detail::damage_visitor::ptr md_policy(mapping_damage_policy(repair));
229 --
230 2.0.2