Skip to content

Commit b908ad9

Browse files
Added a number of typename qualifier to deal with old versions of gcc.
clang-format
1 parent 45ccac9 commit b908ad9

File tree

15 files changed

+62
-92
lines changed

15 files changed

+62
-92
lines changed

tiledb/api/c_api_test_support/storage_manager_stub/storage_manager_override.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ class StorageManagerStub {
4848

4949
public:
5050
static constexpr bool is_overriding_class = true;
51-
StorageManagerStub(
52-
ContextResources&,
53-
const Config& config)
51+
StorageManagerStub(ContextResources&, const Config& config)
5452
: config_(config) {
5553
}
5654

tiledb/common/registry/registry.h

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class Registry {
167167
/**
168168
* The iterator type is only visible to friends.
169169
*/
170-
using registry_iterator_type = registry_list_type::iterator;
170+
using registry_iterator_type = typename registry_list_type::iterator;
171171

172172
/**
173173
* List of entries with this registry
@@ -200,7 +200,7 @@ class Registry {
200200
/**
201201
* The return type of `size()` is forwarded from its underlying container.
202202
*/
203-
using size_type = registry_list_type::size_type;
203+
using size_type = typename registry_list_type::size_type;
204204

205205
/**
206206
* The handle type. A registered class should have a member variable of this
@@ -218,7 +218,7 @@ class Registry {
218218
const registry_handle_type register_item(value_type& item) {
219219
lock_guard_type lg(m_);
220220
registry_list_.emplace_back(item, *this);
221-
cv_.notify_all(); // `emplace_back` adds one to the registry size
221+
cv_.notify_all(); // `emplace_back` adds one to the registry size
222222
/*
223223
* `emplace_back` returns a reference to the list member, not its iterator.
224224
* We have to construct an iterator instead.
@@ -261,27 +261,23 @@ class Registry {
261261
* @param f A callable object of type F
262262
*/
263263
template <class F>
264-
void for_each(F f) const
265-
{
264+
void for_each(F f) const {
266265
lock_guard_type lg(m_);
267266
/*
268267
* We iterate over entries, but apply the function to valid items. Thus we
269268
* need to provide `for_each` with an adapter.
270269
*/
271-
auto g{
272-
[&f](const RegistryEntry<T>& entry) -> void {
273-
/*
274-
* We can only iterate over items that have registered `shared_ptr`.
275-
* Otherwise we might iterate over a dangling reference.
276-
*/
277-
auto item_ptr{entry.item_ptr_.lock()};
278-
if (item_ptr) {
279-
f(*item_ptr);
280-
}
281-
}
282-
};
283-
std::for_each(
284-
registry_list_.begin(), registry_list_.end(), g);
270+
auto g{[&f](const RegistryEntry<T>& entry) -> void {
271+
/*
272+
* We can only iterate over items that have registered `shared_ptr`.
273+
* Otherwise we might iterate over a dangling reference.
274+
*/
275+
auto item_ptr{entry.item_ptr_.lock()};
276+
if (item_ptr) {
277+
f(*item_ptr);
278+
}
279+
}};
280+
std::for_each(registry_list_.begin(), registry_list_.end(), g);
285281
}
286282

287283
private:
@@ -301,7 +297,7 @@ class Registry {
301297
void deregister(registry_iterator_type& iter) {
302298
lock_guard_type lg(m_);
303299
registry_list_.erase(iter);
304-
cv_.notify_all(); // `erase` subtracts one from the registry size
300+
cv_.notify_all(); // `erase` subtracts one from the registry size
305301
}
306302
};
307303

@@ -340,7 +336,7 @@ class RegistryHandle {
340336
* immediate erasure of the entry; there's no separate index or other
341337
* secondary structure required.
342338
*/
343-
using referential_type = Registry<T>::registry_iterator_type;
339+
using referential_type = typename Registry<T>::registry_iterator_type;
344340

345341
/**
346342
* The iterator that comprises the underlying data of this handle.
@@ -478,6 +474,6 @@ class RegistryHandle {
478474
}
479475
};
480476

481-
} // namespace tiledb::sm
477+
} // namespace tiledb::common
482478

483479
#endif // TILEDB_REGISTRY_H

tiledb/common/registry/test/unit_registry.cc

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ struct Item {
5757
void check_size(const item_registry_type& r, item_registry_type::size_type n) {
5858
CHECK(r.size() == n);
5959
item_registry_type::size_type m{0};
60-
auto f{[&m](const item_registry_type::value_type&) -> void {
61-
++m;
62-
}};
60+
auto f{[&m](const item_registry_type::value_type&) -> void { ++m; }};
6361
r.for_each(f);
6462
CHECK(r.size() == m);
6563
}
@@ -98,19 +96,19 @@ TEST_CASE("Registry - construct and add, two nested") {
9896
*/
9997
TEST_CASE("Registry - construct and add, two interleaved") {
10098
item_registry_type r;
101-
check_size(r,0);
99+
check_size(r, 0);
102100
{
103101
auto i1{std::make_shared<Item>(r)};
104102
i1->register_shared_ptr(i1);
105-
check_size(r,1);
103+
check_size(r, 1);
106104
{
107105
auto i2{std::make_shared<Item>(r)};
108106
i2->register_shared_ptr(i2);
109-
check_size(r,2);
107+
check_size(r, 2);
110108
i1.reset();
111-
check_size(r,1);
109+
check_size(r, 1);
112110
}
113-
check_size(r,0);
111+
check_size(r, 0);
114112
}
115-
check_size(r,0);
113+
check_size(r, 0);
116114
}

tiledb/sm/consolidator/consolidator.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,7 @@ void Consolidator::array_vacuum(
330330
}
331331

332332
auto mode = Consolidator::mode_from_config(config, true);
333-
auto consolidator =
334-
Consolidator::create(parent, mode, config);
333+
auto consolidator = Consolidator::create(parent, mode, config);
335334
consolidator->vacuum(array_name);
336335
}
337336

tiledb/sm/consolidator/fragment_consolidator.cc

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -685,12 +685,8 @@ Status FragmentConsolidator::create_queries(
685685
// is not a user input prone to errors).
686686

687687
// Create read query
688-
query_r = tdb_unique_ptr<Query>(tdb_new(
689-
Query,
690-
*this,
691-
array_for_reads,
692-
nullopt,
693-
read_memory_budget));
688+
query_r = tdb_unique_ptr<Query>(
689+
tdb_new(Query, *this, array_for_reads, nullopt, read_memory_budget));
694690
throw_if_not_ok(query_r->set_layout(Layout::GLOBAL_ORDER));
695691

696692
// Dense consolidation will do a tile aligned read.
@@ -716,11 +712,7 @@ Status FragmentConsolidator::create_queries(
716712

717713
// Create write query
718714
query_w = tdb_unique_ptr<Query>(tdb_new(
719-
Query,
720-
*this,
721-
array_for_writes,
722-
fragment_name,
723-
write_memory_budget));
715+
Query, *this, array_for_writes, fragment_name, write_memory_budget));
724716
throw_if_not_ok(query_w->set_layout(Layout::GLOBAL_ORDER));
725717
throw_if_not_ok(query_w->disable_checks_consolidation());
726718
query_w->set_fragment_size(config_.max_fragment_size_);

tiledb/sm/group/group_details_v2.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
* This file implements TileDB Group Details V2
3131
*/
3232

33-
#include "group.h"
3433
#include "tiledb/sm/group/group_details_v2.h"
34+
#include "group.h"
3535
#include "tiledb/common/common.h"
3636
#include "tiledb/common/logger.h"
3737

tiledb/sm/query/dimension_label/array_dimension_label_queries.cc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,7 @@ void ArrayDimensionLabelQueries::add_read_queries(
248248

249249
// Create the range query.
250250
range_queries_.emplace_back(tdb_new(
251-
DimensionLabelQuery,
252-
*this,
253-
dim_label,
254-
dim_label_ref,
255-
label_ranges));
251+
DimensionLabelQuery, *this, dim_label, dim_label_ref, label_ranges));
256252
label_range_queries_by_dim_idx_[dim_idx] = range_queries_.back().get();
257253
} catch (const StatusException& err) {
258254
throw DimensionLabelQueryException(

tiledb/sm/query/query.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
#include "tiledb/sm/query/update_value.h"
5656
#include "tiledb/sm/query/validity_vector.h"
5757
#include "tiledb/sm/rest/rest_client.h"
58-
#include "tiledb/sm/storage_manager/job.h"
5958
#include "tiledb/sm/storage_manager/cancellation_source.h"
59+
#include "tiledb/sm/storage_manager/job.h"
6060
#include "tiledb/sm/subarray/subarray.h"
6161

6262
using namespace tiledb::common;

tiledb/sm/storage_manager/context.cc

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -156,19 +156,17 @@ Status get_config_thread_count(
156156
}
157157

158158
/**
159-
* Obtain the number of threads in a compute thread pool from a configuration
160-
*
161-
* Returns the maximum of the configured value and the thread count returned
162-
* from get_config_thread_count().
163-
*
164-
* @param config A configuration that specifies the compute thread
165-
* @return Compute thread count
159+
* Obtain the number of threads in a compute thread pool from a configuration
160+
*
161+
* Returns the maximum of the configured value and the thread count returned
162+
* from get_config_thread_count().
163+
*
164+
* @param config A configuration that specifies the compute thread
165+
* @return Compute thread count
166166
*/
167-
size_t get_compute_thread_count(
168-
Logger& logger, const Config& config) {
167+
size_t get_compute_thread_count(Logger& logger, const Config& config) {
169168
uint64_t config_thread_count{0};
170-
if (!get_config_thread_count(logger, config, config_thread_count)
171-
.ok()) {
169+
if (!get_config_thread_count(logger, config, config_thread_count).ok()) {
172170
throw std::logic_error("Cannot get compute thread count");
173171
}
174172

@@ -190,8 +188,7 @@ size_t get_compute_thread_count(
190188

191189
size_t get_io_thread_count(Logger& logger, const Config& config) {
192190
uint64_t config_thread_count{0};
193-
if (!get_config_thread_count(logger, config, config_thread_count)
194-
.ok()) {
191+
if (!get_config_thread_count(logger, config, config_thread_count).ok()) {
195192
throw std::logic_error("Cannot get config thread count");
196193
}
197194

@@ -236,8 +233,7 @@ Context::Context(const Config& config)
236233
: ContextBase(config)
237234
, JobRoot{storage_manager_}
238235
, context_handle_(ContextRegistry::get().register_context(*this))
239-
, last_error_(nullopt)
240-
{
236+
, last_error_(nullopt) {
241237
/*
242238
* Logger class is not yet C.41-compliant
243239
*/

tiledb/sm/storage_manager/context_registry.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,4 @@
3333

3434
#include "context_registry.h"
3535

36-
namespace tiledb::sm {
37-
38-
} // namespace tiledb::sm
36+
namespace tiledb::sm {} // namespace tiledb::sm

0 commit comments

Comments
 (0)