Skip to content

Tidy up #98

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

Merged
merged 5 commits into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ UseColor: On
Checks: >-
-*,
readability-delete-null-pointer,
bugprone-assignment-in-if-condition,
bugprone-bool-pointer-implicit-conversion,
bugprone-casting-through-void,
bugprone-parent-virtual-call,
bugprone-unused-return-value,
bugprone-use-after-move,


WarningsAsErrors: false
HeaderFileExtensions: ['', 'h','hh','hpp','hxx']
Expand Down
11 changes: 11 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# The following refs can be ignored by git blame if 'git blame' is called with
# --ignore-revs-file .git-blame-ignore-revs
# Alternatively configure git to always ignore refs stored in this file by
# calling:
# git config blame.ignoreRevsFile .git-blame-ignore-revs
# Or extend your git config manually with
# [blame]
# ignoreRevsFile = .git-blame-ignore-revs

# Reformatted codebase with clang-format
efb1ad8497bc43a84d7a90fe58b25a242aa13183
14 changes: 3 additions & 11 deletions src/fdb5/api/helpers/ListIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,9 @@ class ListIterator : public APIIterator<ListElement> {
ListIterator(APIIterator<ListElement>&& iter, bool deduplicate = false) :
APIIterator<ListElement>(std::move(iter)), seenKeys_({}), deduplicate_(deduplicate) {}

ListIterator(ListIterator&& iter) :
APIIterator<ListElement>(std::move(iter)),
seenKeys_(std::move(iter.seenKeys_)),
deduplicate_(iter.deduplicate_) {}

ListIterator& operator=(ListIterator&& iter) {
seenKeys_ = std::move(iter.seenKeys_);
deduplicate_ = iter.deduplicate_;
APIIterator<ListElement>::operator=(std::move(iter));
return *this;
}
ListIterator(ListIterator&& iter) = default;

ListIterator& operator=(ListIterator&& iter) = default;

bool next(ListElement& elem);

Expand Down
4 changes: 1 addition & 3 deletions src/fdb5/database/EntryVisitMechanism.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ bool EntryVisitor::preVisitDatabase(const eckit::URI& /*uri*/, const Schema& /*s
EntryVisitor::EntryVisitor() : currentCatalogue_(nullptr), currentStore_(nullptr), currentIndex_(nullptr) {}

EntryVisitor::~EntryVisitor() {
if (currentStore_) {
delete currentStore_;
}
delete currentStore_;
}

Store& EntryVisitor::store() const {
Expand Down
4 changes: 1 addition & 3 deletions src/fdb5/io/FieldHandle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ FieldHandle::~FieldHandle() {
if (current_ && currentMemoryHandle_) {
delete current_;
}
if (buffer_) {
delete[] buffer_;
}
delete[] buffer_;
}

void FieldHandle::openCurrent() {
Expand Down
6 changes: 3 additions & 3 deletions src/fdb5/remote/server/ServerConnection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,10 @@ size_t ServerConnection::archiveThreadLoop() {
if (elem.multiblob_) {
// Handle MultiBlob

const char* firstData = static_cast<const char*>(elem.payload_.data()); // For pointer arithmetic
const char* firstData = reinterpret_cast<const char*>(elem.payload_.data()); // For pointer arithmetic
const char* charData = firstData;
while (size_t(charData - firstData) < elem.payload_.size()) {
const MessageHeader* hdr = static_cast<const MessageHeader*>(static_cast<const void*>(charData));
const MessageHeader* hdr = reinterpret_cast<const MessageHeader*>(charData);
ASSERT(hdr->message == Message::Blob);
ASSERT(hdr->clientID() == elem.clientID_);
ASSERT(hdr->requestID == elem.requestID_);
Expand All @@ -366,7 +366,7 @@ size_t ServerConnection::archiveThreadLoop() {
const void* payloadData = charData;
charData += hdr->payloadSize;

const auto* e = static_cast<const MessageHeader::MarkerType*>(static_cast<const void*>(charData));
const auto* e = reinterpret_cast<const MessageHeader::MarkerType*>(charData);
ASSERT(*e == MessageHeader::EndMarker);
charData += MessageHeader::markerBytes;

Expand Down
Loading