From 6573d79fd1b911383a99d41744a8c46a28537a34 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Mon, 10 Mar 2014 11:18:04 +0400 Subject: [PATCH] Style fix in Map<> --- libuavcan/include/uavcan/internal/map.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libuavcan/include/uavcan/internal/map.hpp b/libuavcan/include/uavcan/internal/map.hpp index 21a3adba91..f640fec38f 100644 --- a/libuavcan/include/uavcan/internal/map.hpp +++ b/libuavcan/include/uavcan/internal/map.hpp @@ -37,12 +37,12 @@ UAVCAN_PACKED_BEGIN struct KVGroup : LinkedListNode { - enum { NUM_KV = (MemPoolBlockSize - sizeof(LinkedListNode)) / sizeof(KVPair) }; - KVPair kvs[NUM_KV]; + enum { NumKV = (MemPoolBlockSize - sizeof(LinkedListNode)) / sizeof(KVPair) }; + KVPair kvs[NumKV]; KVGroup() { - StaticAssert<(NUM_KV > 0)>::check(); + StaticAssert<(NumKV > 0)>::check(); IsDynamicallyAllocatable::check(); } @@ -66,7 +66,7 @@ UAVCAN_PACKED_BEGIN KVPair* find(const Key& key) { - for (int i = 0; i < NUM_KV; i++) + for (int i = 0; i < NumKV; i++) if (kvs[i].match(key)) return kvs + i; return NULL; @@ -118,7 +118,7 @@ UAVCAN_PACKED_END while (p) { bool stop = false; - for (int i = 0; i < KVGroup::NUM_KV; i++) + for (int i = 0; i < KVGroup::NumKV; i++) { if (!p->kvs[i].match(Key())) // Non empty { @@ -147,7 +147,7 @@ UAVCAN_PACKED_END { KVGroup* const next = p->getNextListNode(); bool remove_this = true; - for (int i = 0; i < KVGroup::NUM_KV; i++) + for (int i = 0; i < KVGroup::NumKV; i++) { if (!p->kvs[i].match(Key())) { @@ -247,7 +247,7 @@ public: KVGroup* p = list_.get(); while (p) { - for (int i = 0; i < KVGroup::NUM_KV; i++) + for (int i = 0; i < KVGroup::NumKV; i++) { const KVPair* const kv = p->kvs + i; if (!kv->match(Key())) @@ -293,7 +293,7 @@ public: KVGroup* p = list_.get(); while (p) { - for (int i = 0; i < KVGroup::NUM_KV; i++) + for (int i = 0; i < KVGroup::NumKV; i++) { const KVPair* const kv = p->kvs + i; if (!kv->match(Key()))