8000 fixed TRI_ASSERT warnings (#14789) · arangodb/arangodb@0c2fbee · GitHub
[go: up one dir, main page]

Skip to content

Commit 0c2fbee

Browse files
fcellerKVS85
andauthored
fixed TRI_ASSERT warnings (#14789)
* fixed TRI_ASSERT warnings * fixed TRI_ASSERT warnings * fixed TRI_ASSERT warnings Co-authored-by: Vadim Kondratyev <vadim@arangodb.com>
1 parent ea7cada commit 0c2fbee

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

arangod/Aql/CostEstimate.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ void CostEstimate::invalidate() {
4242
// a value of < 0 will mean that the cost estimation was not performed yet
4343
estimatedCost = -1.0;
4444
estimatedNrItems = 0;
45+
// cppcheck-suppress ignoredReturnValue
4546
TRI_ASSERT(!isValid());
4647
}
4748

4849
void CostEstimate::initialize() {
4950
estimatedCost = 0.0;
5051
estimatedNrItems = 0;
52+
// cppcheck-suppress ignoredReturnValue
5153
TRI_ASSERT(isValid());
5254
}
5355

arangod/Replication2/Streams/StreamInformationBlock.tpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ auto StreamInformationBlock<stream_descriptor<Id, Type, Tags>>::getIteratorRange
128128
[](StreamEntry<Type> const& left, LogIndex index) {
129129
return left.first < index;
130130
})),
131+
// cppcheck-suppress selfInitialization
131132
start(start),
133+
// cppcheck-suppress selfInitialization
132134
stop(stop) {}
133135
};
134136
return std::make_unique<Iterator>(std::move(log), start, stop);

lib/Basics/ReadWriteSpinLock.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,20 @@ void ReadWriteSpinLock::unlock() noexcept {
169169
if (isLockedWrite()) {
170170
unlockWrite();
171171
} else {
172+
// cppcheck-suppress ignoredReturnValue
172173
TRI_ASSERT(isLockedRead());
173174
unlockRead();
174175
}
175176
}
176177

177178
void ReadWriteSpinLock::unlockRead() noexcept {
179+
// cppcheck-suppress ignoredReturnValue
178180
TRI_ASSERT(isLockedRead());
179181
_state.fetch_sub(::ReaderIncrement, std::memory_order_release);
180182
}
181183

182184
void ReadWriteSpinLock::unlockWrite() noexcept {
185+
// cppcheck-suppress ignoredReturnValue
183186
TRI_ASSERT(isLockedWrite());
184187
_state.fetch_sub(::WriteLock, std::memory_order_release);
185188
}

0 commit comments

Comments
 (0)
0