From 4170f433fd9bbd6289238796a5811412ee489413 Mon Sep 17 00:00:00 2001 From: Balazs Racz Date: Sun, 15 Nov 2020 00:28:12 +0100 Subject: [PATCH] fix whitespace --- src/openlcb/AliasAllocator.cxxtest | 8 ++++---- src/openlcb/AliasAllocator.hxx | 2 +- src/openlcb/BulkAliasAllocator.cxx | 12 +++++++----- src/utils/test_main.hxx | 2 +- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/openlcb/AliasAllocator.cxxtest b/src/openlcb/AliasAllocator.cxxtest index 621c6559b..2ff91b437 100644 --- a/src/openlcb/AliasAllocator.cxxtest +++ b/src/openlcb/AliasAllocator.cxxtest @@ -1,10 +1,10 @@ #include -#include "utils/async_if_test_helper.hxx" #include "openlcb/AliasAllocator.hxx" #include "openlcb/AliasCache.hxx" -#include "openlcb/CanDefs.hxx" #include "openlcb/BulkAliasAllocator.hxx" +#include "openlcb/CanDefs.hxx" +#include "utils/async_if_test_helper.hxx" namespace openlcb { @@ -94,7 +94,7 @@ protected: expect_packet(StringPrintf(":X10700%03XN;", a)); } } - + Buffer *b_; AliasAllocator alias_allocator_; std::unique_ptr bulkAllocator_; @@ -296,7 +296,7 @@ TEST_F(AsyncAliasAllocatorTest, BulkConflict) wait(); LOG(INFO, "send conflicts"); clear_expect(true); - expect_cid(aliases_.begin()+5, aliases_.end()); + expect_cid(aliases_.begin() + 5, aliases_.end()); send_packet(StringPrintf(":X10700%03XN;", aliases_[0])); send_packet(StringPrintf(":X10700%03XN;", aliases_[1])); wait(); diff --git a/src/openlcb/AliasAllocator.hxx b/src/openlcb/AliasAllocator.hxx index 83bc048b9..b79edb797 100644 --- a/src/openlcb/AliasAllocator.hxx +++ b/src/openlcb/AliasAllocator.hxx @@ -125,7 +125,7 @@ public: /** Returns a new alias to check from the random sequence. Checks that it * is not in the alias cache yet.*/ NodeAlias get_new_seed(); - + /** "Allocate" a buffer from this pool (but without initialization) in * order to get a reserved alias. */ QAsync *reserved_aliases() diff --git a/src/openlcb/BulkAliasAllocator.cxx b/src/openlcb/BulkAliasAllocator.cxx index ba9deafca..429051b87 100644 --- a/src/openlcb/BulkAliasAllocator.cxx +++ b/src/openlcb/BulkAliasAllocator.cxx @@ -158,15 +158,17 @@ class BulkAliasAllocator : public CallableFlow auto rb = get_buffer_deleter(message); auto alias = CanDefs::get_src(GET_CAN_FRAME_ID_EFF(*message->data())); auto it = pendingAliasesByKey_.find(alias); - if (it != pendingAliasesByKey_.end() && !it->hasConflict_) { + if (it != pendingAliasesByKey_.end() && !it->hasConflict_) + { it->hasConflict_ = 1; ++request()->numAliases_; } } /// Listens to incoming CAN frames and handles alias conflicts. - IncomingFrameHandler::GenericHandler conflictHandler_{this, &BulkAliasAllocator::handle_conflict}; - + IncomingFrameHandler::GenericHandler conflictHandler_ { + this, &BulkAliasAllocator::handle_conflict}; + /// How many count to wait before sending out the RID frames. One count is /// 10 msec (see { \link relative_time } ). static constexpr unsigned ALLOCATE_DELAY = 20; @@ -257,9 +259,9 @@ class BulkAliasAllocator : public CallableFlow }; std::unique_ptr create_bulk_alias_allocator( - IfCan *can_if) { + IfCan *can_if) +{ return std::make_unique(can_if); } - } // namespace openlcb diff --git a/src/utils/test_main.hxx b/src/utils/test_main.hxx index 393cb5ae9..e85348124 100644 --- a/src/utils/test_main.hxx +++ b/src/utils/test_main.hxx @@ -49,12 +49,12 @@ #include "gmock/gmock.h" #include "can_frame.h" +#include "executor/CallableFlow.hxx" #include "executor/Executor.hxx" #include "executor/Service.hxx" #include "os/TempFile.hxx" #include "os/os.h" #include "utils/StringPrintf.hxx" -#include "executor/CallableFlow.hxx" #ifdef WITHGPERFTOOLS #include