Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation fixes for clang-10s more strict checking #11316

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
devel
-----

* Compilation issues with wrong cv-qualifiers and unnecessary
temporary copying.

* Add DTRACE points to track a request through the infrastructure.

* Fixed issue #11275: indexes backward compatibility broken in 3.5+.

* Updated snowball dependency to the latest version.
More stemmers are available. Built-in analyzer list is unchanged.
More stemmers are available. Built-in analyzer list is unchanged.

* Reactive REST API endpoint at `/_admin/auth/reload`, as it is called by DC2DC.

* Fix an endless loop in FollowerInfo::persistInAgency which could trigger
a hanger if a collection was dropped at the wrong time.

Expand Down Expand Up @@ -57,7 +60,7 @@ devel

* Allow to override the detected total amount of memory via an environment
variable ARANGODB_OVERRIDE_DETECTED_TOTAL_MEMORY.

* `splice-subqueries` optimization is not limited by any type of operation within the
subquery any more. It can now be applied on every subquery and will be by default.
However they may be a performance impact on some queries where splice-subqueries
Expand Down
2 changes: 1 addition & 1 deletion arangod/Agency/FailedLeader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void FailedLeader::rollback() {
VPackArrayBuilder a(payload.get());
{ // opers
VPackObjectBuilder b(payload.get());
for (auto const c : cs) {
for (auto const& c : cs) {
payload->add(planColPrefix + _database + "/" + c.collection +
"/shards/" + c.shard,
rb.slice());
Expand Down
2 changes: 1 addition & 1 deletion arangod/Cluster/ClusterMethods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2294,7 +2294,7 @@ Future<OperationResult> modifyDocumentOnCoordinator(
VPackBuffer<uint8_t> buffer;
buffer.append(slice.begin(), slice.byteSize());

for (std::pair<ShardID, std::vector<ServerID>> const& shardServers : *shardIds) {
for (auto const& shardServers : *shardIds) {
ShardID const& shard = shardServers.first;
network::Headers headers;
addTransactionHeaderForShard(trx, *shardIds, shard, headers);
Expand Down
4 changes: 2 additions & 2 deletions arangod/Pregel/Algos/DMID/DMID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ struct DMIDComputation : public VertexComputation<DMIDValue, float, DMIDMessage>
int64_t const* iterationCounter = getAggregatedValue<int64_t>(ITERATION_AGG);

size_t m = std::min(getEdgeCount(), messages.size());
for (std::pair<PregelID, float> const& pair : membershipCounter) {
for (auto const& pair : membershipCounter) {
// FIXME
// float const ttt = pair.second / getEdges().size();
float const ttt = pair.second / m;
Expand Down Expand Up @@ -615,7 +615,7 @@ struct DMIDGraphFormat : public GraphFormat<DMIDValue, float> {
} else {
// Output for DMID modularity calculator
b.add(_resultField, VPackValue(VPackValueType::Array));
for (std::pair<PregelID, float> const& pair : ptr->membershipDegree) {
for (auto const& pair : ptr->membershipDegree) {
size_t i = arangodb::basics::StringUtils::uint64_trusted(pair.first.key.data(),
pair.first.key.size());
b.openArray();
Expand Down
4 changes: 2 additions & 2 deletions arangod/Pregel/Algos/DMID/VertexSumAggregator.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct VertexSumAggregator : public IAggregator {
// if you use this from a vertex I will end you
void aggregate(void const* valuePtr) override {
VertexMap const* map = (VertexMap const*)valuePtr;
for (MyPair const& pair1 : *map) {
for (auto const& pair1 : *map) {
for (auto const& pair2 : pair1.second) {
_entries[pair1.first][pair2.first] += pair2.second;
}
Expand Down Expand Up @@ -129,7 +129,7 @@ struct VertexSumAggregator : public IAggregator {
for (auto const& pair : _entries) {
PregelShard shard = pair.first;
std::unordered_map<std::string, double> const& vertexMap = pair.second;
for (std::pair<std::string, double> const& vertexMessage : vertexMap) {
for (auto const& vertexMessage : vertexMap) {
func(PregelID(shard, vertexMessage.first), vertexMessage.second);
}
}
Expand Down
4 changes: 2 additions & 2 deletions arangod/Pregel/Algos/SLPA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ struct SLPAComputation : public VertexComputation<SLPAValue, int8_t, uint64_t> {
uint64_t cumulativeSum = 0;
// Randomly select a label with probability proportional to the
// occurrence frequency of this label in its memory
for (std::pair<uint64_t, uint64_t> const& e : val->memory) {
for (auto const& e : val->memory) {
cumulativeSum += e.second;
if (cumulativeSum >= random) {
sendMessageToAllNeighbours(e.first);
Expand Down Expand Up @@ -159,7 +159,7 @@ struct SLPAGraphFormat : public GraphFormat<SLPAValue, int8_t> {
return false;
} else {
std::vector<std::pair<uint64_t, double>> vec;
for (std::pair<uint64_t, uint64_t> pair : ptr->memory) {
for (auto const& pair : ptr->memory) {
double t = (double)pair.second / ptr->numCommunities;
if (t >= threshold) {
vec.emplace_back(pair.first, t);
Expand Down
4 changes: 2 additions & 2 deletions arangod/RestServer/Metrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ void Counter::store(uint64_t const& n) {

void Counter::toPrometheus(std::string& result) const {
_b.push();
result += "#TYPE " + name() + " counter\n";
result += "\n#TYPE " + name() + " counter\n";
result += "#HELP " + name() + " " + help() + "\n";
result += name() + "{" + labels() + "} " + std::to_string(load()) + "\n";
result += name() + "{" + labels() + "} " + std::to_string(load());
kvahed marked this conversation as resolved.
Show resolved Hide resolved
}

Counter::Counter(
Expand Down
4 changes: 2 additions & 2 deletions arangod/RestServer/Metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ template<typename T> class Gauge : public Metric {
return _g.load();
};
virtual void toPrometheus(std::string& result) const override {
result += "#TYPE " + name() + " gauge\n";
result += "\n#TYPE " + name() + " gauge\n";
result += "#HELP " + name() + " " + help() + "\n";
result += name() + "{" + labels() + "} " + std::to_string(load()) + "\n";
};
Expand Down Expand Up @@ -396,7 +396,7 @@ template<typename Scale> class Histogram : public Metric {
size_t size() const { return _c.size(); }

virtual void toPrometheus(std::string& result) const override {
result += "#TYPE " + name() + " histogram\n";
result += "\n#TYPE " + name() + " histogram\n";
result += "#HELP " + name() + " " + help() + "\n";
std::string lbs = labels();
auto const haveLabels = !lbs.empty();
Expand Down
8 changes: 4 additions & 4 deletions arangod/RestServer/counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ template< typename Integral > class strong_duplex
private:
void insert( broker_type* child );
void erase( broker_type* child, Integral by );
std::mutex serializer_;
mutable std::mutex serializer_;
typedef std::unordered_set< broker_type* > set_type;
set_type children_;
};
Expand Down Expand Up @@ -640,7 +640,7 @@ template< typename Integral > class weak_duplex
private:
void insert( broker_type* child );
void erase( broker_type* child, Integral by );
std::mutex serializer_;
mutable std::mutex serializer_;
typedef std::unordered_set< broker_type* > set_type;
set_type children_;
};
Expand Down Expand Up @@ -821,7 +821,7 @@ template< typename Integral > class strong_duplex_array
private:
void insert( broker_type* child );
void erase( broker_type* child, Integral by );
std::mutex serializer_;
mutable std::mutex serializer_;
typedef std::unordered_set< broker_type* > set_type;
set_type children_;
};
Expand Down Expand Up @@ -894,7 +894,7 @@ template< typename Integral > class weak_duplex_array
private:
void insert( broker_type* child );
void erase( broker_type* child, Integral by );
std::mutex serializer_;
mutable std::mutex serializer_;
typedef std::unordered_set< broker_type* > set_type;
set_type children_;
};
Expand Down
Loading