Skip to content

Commit

Permalink
fix whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsracz committed Nov 14, 2020
1 parent 60e854f commit 4170f43
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/openlcb/AliasAllocator.cxxtest
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include <map>

#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
{
Expand Down Expand Up @@ -94,7 +94,7 @@ protected:
expect_packet(StringPrintf(":X10700%03XN;", a));
}
}

Buffer<AliasInfo> *b_;
AliasAllocator alias_allocator_;
std::unique_ptr<BulkAliasAllocatorInterface> bulkAllocator_;
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/openlcb/AliasAllocator.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
12 changes: 7 additions & 5 deletions src/openlcb/BulkAliasAllocator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,17 @@ class BulkAliasAllocator : public CallableFlow<BulkAliasRequest>
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;
Expand Down Expand Up @@ -257,9 +259,9 @@ class BulkAliasAllocator : public CallableFlow<BulkAliasRequest>
};

std::unique_ptr<BulkAliasAllocatorInterface> create_bulk_alias_allocator(
IfCan *can_if) {
IfCan *can_if)
{
return std::make_unique<BulkAliasAllocator>(can_if);
}


} // namespace openlcb
2 changes: 1 addition & 1 deletion src/utils/test_main.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <gperftools/profiler.h>
Expand Down

0 comments on commit 4170f43

Please sign in to comment.