From f935822406cf368257b35667e1169e9b9534ddc3 Mon Sep 17 00:00:00 2001 From: Tom Pittenger Date: Sun, 25 Mar 2018 15:21:40 -0700 Subject: [PATCH] rename ch to chr to avoid shadow variable in ChibiOS --- libuavcan/include/uavcan/marshal/array.hpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/libuavcan/include/uavcan/marshal/array.hpp b/libuavcan/include/uavcan/marshal/array.hpp index 1e2508238c..b409d5d0c1 100644 --- a/libuavcan/include/uavcan/marshal/array.hpp +++ b/libuavcan/include/uavcan/marshal/array.hpp @@ -809,13 +809,13 @@ public: * This operator can only be used with string-like arrays; otherwise it will fail to compile. * @ref c_str() */ - bool operator==(const char* ch) const + bool operator==(const char* chr) const { - if (ch == UAVCAN_NULLPTR) + if (chr == UAVCAN_NULLPTR) { return false; } - return std::strncmp(Base::c_str(), ch, MaxSize) == 0; + return std::strncmp(Base::c_str(), chr, MaxSize) == 0; } /** @@ -827,18 +827,18 @@ public: * This operator can only be used with string-like arrays; otherwise it will fail to compile. * @ref c_str() */ - SelfType& operator=(const char* ch) + SelfType& operator=(const char* chr) { StaticAssert::check(); StaticAssert::check(); Base::clear(); - if (ch == UAVCAN_NULLPTR) + if (chr == UAVCAN_NULLPTR) { handleFatalError("Array::operator=(const char*)"); } - while (*ch) + while (*chr) { - push_back(ValueType(*ch++)); // Value type is likely to be unsigned char, so conversion may be required. + push_back(ValueType(*chr++)); // Value type is likely to be unsigned char, so conversion may be required. } return *this; } @@ -847,17 +847,17 @@ public: * This operator can only be used with string-like arrays; otherwise it will fail to compile. * @ref c_str() */ - SelfType& operator+=(const char* ch) + SelfType& operator+=(const char* chr) { StaticAssert::check(); StaticAssert::check(); - if (ch == UAVCAN_NULLPTR) + if (chr == UAVCAN_NULLPTR) { handleFatalError("Array::operator+=(const char*)"); } - while (*ch) + while (*chr) { - push_back(ValueType(*ch++)); + push_back(ValueType(*chr++)); } return *this; }