From d330572e370f7c22ef048cf924f1d68ef71026f4 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Wed, 19 Feb 2014 00:50:24 +0400 Subject: [PATCH] Style fix: LinkedListRoot<>::length() --> getLength() --- .../include/uavcan/internal/linked_list.hpp | 2 +- .../uavcan/internal/transport/dispatcher.hpp | 2 +- .../internal/transport/transfer_buffer.hpp | 2 +- libuavcan/test/linked_list.cpp | 16 ++++++++-------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libuavcan/include/uavcan/internal/linked_list.hpp b/libuavcan/include/uavcan/internal/linked_list.hpp index ce7b1cbc9c..475055c726 100644 --- a/libuavcan/include/uavcan/internal/linked_list.hpp +++ b/libuavcan/include/uavcan/internal/linked_list.hpp @@ -48,7 +48,7 @@ public: T* get() const { return root_; } bool isEmpty() const { return get() == NULL; } - unsigned int length() const + unsigned int getLength() const { T* node = root_; unsigned int cnt = 0; diff --git a/libuavcan/include/uavcan/internal/transport/dispatcher.hpp b/libuavcan/include/uavcan/internal/transport/dispatcher.hpp index e398cbd618..9ac3b787e7 100644 --- a/libuavcan/include/uavcan/internal/transport/dispatcher.hpp +++ b/libuavcan/include/uavcan/internal/transport/dispatcher.hpp @@ -44,7 +44,7 @@ class Dispatcher : Noncopyable void cleanup(uint64_t ts_monotonic); void handleFrame(const RxFrame& frame); - int getNumEntries() const { return list_.length(); } + int getNumEntries() const { return list_.getLength(); } }; ListenerRegister lmsg_; diff --git a/libuavcan/include/uavcan/internal/transport/transfer_buffer.hpp b/libuavcan/include/uavcan/internal/transport/transfer_buffer.hpp index bf58fe2cd5..a01b6e6c82 100644 --- a/libuavcan/include/uavcan/internal/transport/transfer_buffer.hpp +++ b/libuavcan/include/uavcan/internal/transport/transfer_buffer.hpp @@ -422,7 +422,7 @@ public: bool isEmpty() const { return (getNumStaticBuffers() == 0) && (getNumDynamicBuffers() == 0); } - unsigned int getNumDynamicBuffers() const { return dynamic_buffers_.length(); } + unsigned int getNumDynamicBuffers() const { return dynamic_buffers_.getLength(); } unsigned int getNumStaticBuffers() const { diff --git a/libuavcan/test/linked_list.cpp b/libuavcan/test/linked_list.cpp index a6a59c791d..9f39307791 100644 --- a/libuavcan/test/linked_list.cpp +++ b/libuavcan/test/linked_list.cpp @@ -40,23 +40,23 @@ TEST(LinkedList, Basic) /* * Insert/remove */ - EXPECT_EQ(0, root.length()); + EXPECT_EQ(0, root.getLength()); ListItem item1; root.insert(&item1); root.insert(&item1); // Insert twice - second will be ignored - EXPECT_EQ(1, root.length()); + EXPECT_EQ(1, root.getLength()); EXPECT_TRUE(root.remove(&item1)); EXPECT_FALSE(root.remove(&item1)); - EXPECT_EQ(0, root.length()); + EXPECT_EQ(0, root.getLength()); ListItem items[3]; root.insert(&item1); root.insert(items + 0); root.insert(items + 1); root.insert(items + 2); - EXPECT_EQ(4, root.length()); + EXPECT_EQ(4, root.getLength()); /* * Order persistence @@ -75,7 +75,7 @@ TEST(LinkedList, Basic) EXPECT_TRUE(root.remove(items + 0)); EXPECT_TRUE(root.remove(items + 2)); EXPECT_FALSE(root.remove(items + 2)); - EXPECT_EQ(2, root.length()); + EXPECT_EQ(2, root.getLength()); const int expected_values2[] = {11, 0}; node = root.get(); @@ -86,7 +86,7 @@ TEST(LinkedList, Basic) } root.insert(items + 2); - EXPECT_EQ(3, root.length()); + EXPECT_EQ(3, root.getLength()); EXPECT_EQ(12, root.get()->value); /* @@ -96,7 +96,7 @@ TEST(LinkedList, Basic) EXPECT_FALSE(root.remove(items + 0)); EXPECT_TRUE(root.remove(items + 1)); EXPECT_TRUE(root.remove(items + 2)); - EXPECT_EQ(0, root.length()); + EXPECT_EQ(0, root.getLength()); } TEST(LinkedList, Sorting) @@ -111,7 +111,7 @@ TEST(LinkedList, Sorting) items[1].insort(root); items[5].insort(root); - EXPECT_EQ(6, root.length()); + EXPECT_EQ(6, root.getLength()); int prev_val = -100500; const ListItem* item = root.get();