From bf195152ad4b45466e754adbb23d1e40d3ee0c52 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Wed, 1 Nov 2017 09:31:16 +0000 Subject: [PATCH 1/2] Clean compile for GCC warnings -Wundef -Wshadow -Wstrict-aliasing -Wunused-parameter --- src/array.h | 8 +- src/basic_string.h | 116 +++--- src/bitset.h | 20 +- src/cstring.h | 12 +- src/deque.h | 62 ++-- src/enum_type.h | 4 +- src/error_handler.h | 8 +- src/exception.h | 24 +- src/factory.h | 12 +- src/fixed_iterator.h | 24 +- src/flat_map.h | 4 +- src/flat_multimap.h | 8 +- src/flat_multiset.h | 8 +- src/flat_set.h | 8 +- src/forward_list.h | 34 +- src/frame_check_sequence.h | 4 +- src/fsm.h | 98 ++--- src/fsm_generator.h | 16 +- src/function.h | 26 +- src/ihash.h | 8 +- src/intrusive_forward_list.h | 24 +- src/intrusive_links.h | 8 +- src/intrusive_list.h | 38 +- src/intrusive_queue.h | 8 +- src/intrusive_stack.h | 8 +- src/io_port.h | 16 +- src/list.h | 37 +- src/map.h | 24 +- src/message.h | 8 +- src/message_bus.h | 10 +- src/message_router.h | 154 ++++---- src/message_router_generator.h | 8 +- src/multimap.h | 30 +- src/multiset.h | 30 +- src/murmur3.h | 12 +- src/observer.h | 8 +- src/optional.h | 18 +- src/pearson.h | 6 +- src/pool.h | 22 +- src/priority_queue.h | 18 +- src/private/ivectorpointer.h | 4 +- src/private/pvoidvector.h | 4 +- src/private/vector_base.h | 24 +- src/profiles/arduino_arm.h | 2 +- src/profiles/armv5.h | 2 +- src/profiles/armv6.h | 2 +- src/profiles/cpp03.h | 2 +- src/profiles/cpp11.h | 2 +- src/profiles/cpp14.h | 2 +- src/profiles/gcc_generic.h | 12 +- src/profiles/gcc_linux_x86.h | 12 +- src/profiles/gcc_windows_x86.h | 12 +- src/profiles/msvc_x86.h | 12 +- src/profiles/ticc.h | 2 +- src/queue.h | 26 +- src/reference_flat_map.h | 24 +- src/reference_flat_multimap.h | 24 +- src/reference_flat_multiset.h | 28 +- src/reference_flat_set.h | 24 +- src/scheduler.h | 16 +- src/set.h | 24 +- src/stack.h | 26 +- src/task.h | 4 +- src/type_def.h | 4 +- src/u16string.h | 12 +- src/u32string.h | 12 +- src/unordered_map.h | 126 +++---- src/unordered_multimap.h | 132 +++---- src/unordered_multiset.h | 132 +++---- src/unordered_set.h | 114 +++--- src/user_type.h | 4 +- src/variant.h | 28 +- src/vector.h | 10 +- src/wstring.h | 12 +- test/codeblocks/ETL.cbp | 15 + test/codeblocks/ETL.layout | 513 +++++++++++++++++++++++---- test/data.h | 14 +- test/test_algorithm.cpp | 4 +- test/test_array.cpp | 14 +- test/test_error_handler.cpp | 4 +- test/test_flat_map.cpp | 2 + test/test_fsm.cpp | 20 +- test/test_intrusive_forward_list.cpp | 18 - test/test_intrusive_links.cpp | 16 +- test/test_intrusive_queue.cpp | 6 +- test/test_intrusive_stack.cpp | 4 +- test/test_list.cpp | 10 - test/test_message_bus.cpp | 22 +- test/test_message_router.cpp | 22 +- test/test_message_timer.cpp | 10 +- test/test_packet.cpp | 12 +- test/test_string_char.cpp | 37 +- test/test_string_u16.cpp | 11 +- test/test_string_u32.cpp | 13 +- test/test_string_wchar_t.cpp | 13 +- test/test_task_scheduler.cpp | 8 +- 96 files changed, 1494 insertions(+), 1161 deletions(-) diff --git a/src/array.h b/src/array.h index 22d7a5c9..d2b5de06 100644 --- a/src/array.h +++ b/src/array.h @@ -58,8 +58,8 @@ namespace etl { public: - array_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + array_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -72,8 +72,8 @@ namespace etl { public: - array_out_of_range(string_type file_name, numeric_type line_number) - : array_exception("array:range", file_name, line_number) + array_out_of_range(string_type file_name_, numeric_type line_number_) + : array_exception("array:range", file_name_, line_number_) { } }; diff --git a/src/basic_string.h b/src/basic_string.h index 984fa729..b27b46f4 100644 --- a/src/basic_string.h +++ b/src/basic_string.h @@ -88,8 +88,8 @@ namespace etl { public: - string_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + string_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -102,8 +102,8 @@ namespace etl { public: - string_empty(string_type file_name, numeric_type line_number) - : string_exception(ETL_ERROR_TEXT("string:empty", ETL_FILE"A"), file_name, line_number) + string_empty(string_type file_name_, numeric_type line_number_) + : string_exception(ETL_ERROR_TEXT("string:empty", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -116,8 +116,8 @@ namespace etl { public: - string_out_of_bounds(string_type file_name, numeric_type line_number) - : string_exception(ETL_ERROR_TEXT("string:bounds", ETL_FILE"B"), file_name, line_number) + string_out_of_bounds(string_type file_name_, numeric_type line_number_) + : string_exception(ETL_ERROR_TEXT("string:bounds", ETL_FILE"B"), file_name_, line_number_) { } }; @@ -130,8 +130,8 @@ namespace etl { public: - string_iterator(string_type file_name, numeric_type line_number) - : string_exception(ETL_ERROR_TEXT("string:iterator", ETL_FILE"C"), file_name, line_number) + string_iterator(string_type file_name_, numeric_type line_number_) + : string_exception(ETL_ERROR_TEXT("string:iterator", ETL_FILE"C"), file_name_, line_number_) { } }; @@ -228,10 +228,10 @@ namespace etl //************************************************************************* /// Constructor. //************************************************************************* - string_base(size_t max_size) + string_base(size_t max_size_) : is_truncated(false), current_size(0), - CAPACITY(max_size) + CAPACITY(max_size_) { } @@ -505,8 +505,8 @@ namespace etl //********************************************************************* void assign(const etl::ibasic_string& other) { - size_t length = std::min(CAPACITY, other.size()); - assign(other.begin(), other.begin() + length); + size_t len = std::min(CAPACITY, other.size()); + assign(other.begin(), other.begin() + len); } //********************************************************************* @@ -553,15 +553,15 @@ namespace etl ///\param other The other string. ///\param length The length to copy. //********************************************************************* - void assign(const_pointer other, size_t length) + void assign(const_pointer other, size_t length_) { - length = std::min(length, CAPACITY); + length_ = std::min(length_, CAPACITY); initialise(); - etl::copy_n(other, length, begin()); + etl::copy_n(other, length_, begin()); - current_size = length; + current_size = length_; p_buffer[current_size] = 0; } @@ -576,8 +576,8 @@ namespace etl void assign(TIterator first, TIterator last) { #if defined(ETL_DEBUG) - difference_type count = std::distance(first, last); - ETL_ASSERT(count >= 0, ETL_ERROR(string_iterator)); + difference_type d = std::distance(first, last); + ETL_ASSERT(d >= 0, ETL_ERROR(string_iterator)); #endif initialise(); @@ -969,12 +969,12 @@ namespace etl ///\param length Number of characters. ///\return A refernce to this string. //********************************************************************* - etl::ibasic_string& erase(size_t position, size_t length = npos) + etl::ibasic_string& erase(size_t position, size_t length_ = npos) { // Limit the length. - length = std::min(length, size() - position); + length_ = std::min(length_, size() - position); - erase(begin() + position, begin() + position + length); + erase(begin() + position, begin() + position + length_); return *this; } @@ -1171,9 +1171,9 @@ namespace etl //********************************************************************* size_t rfind(const_pointer s, size_t position = npos) const { - size_t length = etl::strlen(s); + size_t len = etl::strlen(s); - if (length > size()) + if (len > size()) { return npos; } @@ -1185,7 +1185,7 @@ namespace etl position = size() - position; - const_reverse_iterator srbegin(s + length); + const_reverse_iterator srbegin(s + len); const_reverse_iterator srend(s); const_reverse_iterator iposition = std::search(rbegin() + position, rend(), srbegin, srend); @@ -1196,7 +1196,7 @@ namespace etl } else { - return size() - length - std::distance(rbegin(), iposition); + return size() - len - std::distance(rbegin(), iposition); } } @@ -1205,9 +1205,9 @@ namespace etl ///\param str The content to find ///\param pos The position to start searching from. //********************************************************************* - size_t rfind(const_pointer s, size_t position, size_t length) const + size_t rfind(const_pointer s, size_t position, size_t length_) const { - if (length > size()) + if (length_ > size()) { return npos; } @@ -1219,7 +1219,7 @@ namespace etl position = size() - position; - const_reverse_iterator srbegin(s + length); + const_reverse_iterator srbegin(s + length_); const_reverse_iterator srend(s); const_reverse_iterator iposition = std::search(rbegin() + position, rend(), srbegin, srend); @@ -1230,7 +1230,7 @@ namespace etl } else { - return size() - length - std::distance(rbegin(), iposition); + return size() - length_ - std::distance(rbegin(), iposition); } } @@ -1266,15 +1266,15 @@ namespace etl ///\param length The number of characters to replace. ///\param str The string to replace it with. //********************************************************************* - ibasic_string& replace(size_t position, size_t length, const ibasic_string& str) + ibasic_string& replace(size_t position, size_t length_, const ibasic_string& str) { ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds)); // Limit the length. - length = std::min(length, size() - position); + length_ = std::min(length_, size() - position); // Erase the bit we want to replace. - erase(position, length); + erase(position, length_); // Insert the new stuff. insert(position, str); @@ -1306,17 +1306,17 @@ namespace etl //********************************************************************* /// Replace characters from 'position' of 'length' with 'str' from 'subpsotion' of 'sublength'. //********************************************************************* - ibasic_string& replace(size_t position, size_t length, const ibasic_string& str, size_t subposition, size_t sublength) + ibasic_string& replace(size_t position, size_t length_, const ibasic_string& str, size_t subposition, size_t sublength) { ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds)); ETL_ASSERT(subposition <= str.size(), ETL_ERROR(string_out_of_bounds)); // Limit the lengths. - length = std::min(length, size() - position); + length_ = std::min(length_, size() - position); sublength = std::min(sublength, str.size() - subposition); // Erase the bit we want to replace. - erase(position, length); + erase(position, length_); // Insert the new stuff. insert(position, str, subposition, sublength); @@ -1327,15 +1327,15 @@ namespace etl //********************************************************************* /// Replace characters from 'position' of 'length' with pointed to string. //********************************************************************* - ibasic_string& replace(size_t position, size_t length, const_pointer s) + ibasic_string& replace(size_t position, size_t length_, const_pointer s) { ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds)); // Limit the length. - length = std::min(length, size() - position); + length_ = std::min(length_, size() - position); // Erase the bit we want to replace. - erase(position, length); + erase(position, length_); // Insert the new stuff. insert(position, s, etl::strlen(s)); @@ -1364,15 +1364,15 @@ namespace etl //********************************************************************* /// Replace characters from 'position' of 'length' with 'n' characters from pointed to string. //********************************************************************* - ibasic_string& replace(size_t position, size_t length, const_pointer s, size_t n) + ibasic_string& replace(size_t position, size_t length_, const_pointer s, size_t n) { ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds)); // Limit the length. - length = std::min(length, size() - position); + length_ = std::min(length_, size() - position); // Erase the bit we want to replace. - erase(position, length); + erase(position, length_); // Insert the new stuff. insert(position, s, n); @@ -1401,15 +1401,15 @@ namespace etl //********************************************************************* /// Replace characters from 'position' of 'length' with 'n' copies of 'c'. //********************************************************************* - ibasic_string& replace(size_t position, size_t length, size_t n, value_type c) + ibasic_string& replace(size_t position, size_t length_, size_t n, value_type c) { ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds)); // Limit the length. - length = std::min(length, size() - position); + length_ = std::min(length_, size() - position); // Erase the bit we want to replace. - erase(position, length); + erase(position, length_); // Insert the new stuff. insert(position, n, c); @@ -1468,15 +1468,15 @@ namespace etl //************************************************************************* /// Compare position / length with string. //************************************************************************* - int compare(size_t position, size_t length, const ibasic_string& str) const + int compare(size_t position, size_t length_, const ibasic_string& str) const { ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds)); // Limit the length. - length = std::min(length, size() - position); + length_ = std::min(length_, size() - position); return compare(p_buffer + position, - p_buffer + position + length, + p_buffer + position + length_, str.p_buffer, str.p_buffer + str.size()); } @@ -1484,17 +1484,17 @@ namespace etl //************************************************************************* /// Compare position / length with string / subposition / sublength. //************************************************************************* - int compare(size_t position, size_t length, const ibasic_string& str, size_t subposition, size_t sublength) const + int compare(size_t position, size_t length_, const ibasic_string& str, size_t subposition, size_t sublength) const { ETL_ASSERT(position <= size(), ETL_ERROR(string_out_of_bounds)); ETL_ASSERT(subposition <= str.size(), ETL_ERROR(string_out_of_bounds)); // Limit the lengths. - length = std::min(length, size() - position); + length_ = std::min(length_, size() - position); sublength = std::min(sublength, str.size() - subposition); return compare(p_buffer + position, - p_buffer + position + length, + p_buffer + position + length_, str.p_buffer + subposition, str.p_buffer + subposition + sublength); } @@ -1513,10 +1513,10 @@ namespace etl //************************************************************************* /// Compare position / length with C string. //************************************************************************* - int compare(size_t position, size_t length, const_pointer s) const + int compare(size_t position, size_t length_, const_pointer s) const { return compare(p_buffer + position, - p_buffer + position + length, + p_buffer + position + length_, s, s + etl::strlen(s)); } @@ -1524,10 +1524,10 @@ namespace etl //************************************************************************* /// Compare position / length with C string / n. //************************************************************************* - int compare(size_t position, size_t length, const_pointer s, size_t n) const + int compare(size_t position, size_t length_, const_pointer s, size_t n) const { return compare(p_buffer + position, - p_buffer + position + length, + p_buffer + position + length_, s, s + n);; } @@ -1817,7 +1817,7 @@ namespace etl } //********************************************************************* - // + // //********************************************************************* size_t find_last_not_of(value_type c, size_t position = npos) const { @@ -1902,9 +1902,9 @@ namespace etl //********************************************************************* /// Constructor. //********************************************************************* - ibasic_string(T* p_buffer, size_t MAX_SIZE) - : string_base(MAX_SIZE), - p_buffer(p_buffer) + ibasic_string(T* p_buffer_, size_t MAX_SIZE_) + : string_base(MAX_SIZE_), + p_buffer(p_buffer_) { } diff --git a/src/bitset.h b/src/bitset.h index ba4b63bb..584b97dc 100644 --- a/src/bitset.h +++ b/src/bitset.h @@ -72,8 +72,8 @@ namespace etl { public: - bitset_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + bitset_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -86,8 +86,8 @@ namespace etl { public: - bitset_nullptr(string_type file_name, numeric_type line_number) - : bitset_exception("bitset: nullptr", file_name, line_number) + bitset_nullptr(string_type file_name_, numeric_type line_number_) + : bitset_exception("bitset: nullptr", file_name_, line_number_) { } }; @@ -185,9 +185,9 @@ namespace etl //******************************* /// Constructor. //******************************* - bit_reference(ibitset& r_bitset, size_t position) + bit_reference(ibitset& r_bitset, size_t position_) : p_bitset(&r_bitset), - position(position) + position(position_) { } @@ -690,10 +690,10 @@ namespace etl //************************************************************************* /// Constructor. //************************************************************************* - ibitset(size_t nbits, size_t size, element_t* pdata) - : NBITS(nbits), - SIZE(size), - pdata(pdata) + ibitset(size_t nbits_, size_t size_, element_t* pdata_) + : NBITS(nbits_), + SIZE(size_), + pdata(pdata_) { size_t allocated_bits = SIZE * BITS_PER_ELEMENT; size_t top_mask_shift = ((BITS_PER_ELEMENT - (allocated_bits - NBITS)) % BITS_PER_ELEMENT); diff --git a/src/cstring.h b/src/cstring.h index 7f25237f..aae1c86a 100644 --- a/src/cstring.h +++ b/src/cstring.h @@ -82,15 +82,15 @@ namespace etl ///\param position The position of the first character. ///\param length The number of characters. Default = npos. //************************************************************************* - string(const etl::string& other, size_t position, size_t length = npos) + string(const etl::string& other, size_t position, size_t length_ = npos) : istring(reinterpret_cast(&buffer), MAX_SIZE) { ETL_ASSERT(position < other.size(), ETL_ERROR(string_out_of_bounds)); // Set the length to the exact amount. - length = (length > MAX_SIZE_) ? MAX_SIZE_ : length; + length_ = (length_ > MAX_SIZE_) ? MAX_SIZE_ : length_; - istring::assign(other.begin() + position, other.begin() + position + length); + istring::assign(other.begin() + position, other.begin() + position + length_); } //************************************************************************* @@ -144,7 +144,7 @@ namespace etl ///\param position The position of the first character. Default = 0. ///\param length The number of characters. Default = npos. //************************************************************************* - etl::string substr(size_t position = 0, size_t length = npos) const + etl::string substr(size_t position = 0, size_t length_ = npos) const { etl::string new_string; @@ -152,9 +152,9 @@ namespace etl { ETL_ASSERT(position < this->size(), ETL_ERROR(string_out_of_bounds)); - length = std::min(length, this->size() - position); + length_ = std::min(length_, this->size() - position); - new_string.assign(buffer + position, buffer + position + length); + new_string.assign(buffer + position, buffer + position + length_); } return new_string; diff --git a/src/deque.h b/src/deque.h index db9779af..533795df 100644 --- a/src/deque.h +++ b/src/deque.h @@ -71,8 +71,8 @@ namespace etl { public: - deque_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + deque_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -85,8 +85,8 @@ namespace etl { public: - deque_full(string_type file_name, numeric_type line_number) - : etl::deque_exception(ETL_ERROR_TEXT("deque:full", ETL_FILE"A"), file_name, line_number) + deque_full(string_type file_name_, numeric_type line_number_) + : etl::deque_exception(ETL_ERROR_TEXT("deque:full", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -99,8 +99,8 @@ namespace etl { public: - deque_empty(string_type file_name, numeric_type line_number) - : etl::deque_exception(ETL_ERROR_TEXT("deque:empty", ETL_FILE"B"), file_name, line_number) + deque_empty(string_type file_name_, numeric_type line_number_) + : etl::deque_exception(ETL_ERROR_TEXT("deque:empty", ETL_FILE"B"), file_name_, line_number_) { } }; @@ -113,8 +113,8 @@ namespace etl { public: - deque_out_of_bounds(string_type file_name, numeric_type line_number) - : etl::deque_exception(ETL_ERROR_TEXT("deque:bounds", ETL_FILE"C"), file_name, line_number) + deque_out_of_bounds(string_type file_name_, numeric_type line_number_) + : etl::deque_exception(ETL_ERROR_TEXT("deque:bounds", ETL_FILE"C"), file_name_, line_number_) { } }; @@ -127,8 +127,8 @@ namespace etl { public: - deque_incompatible_type(string_type file_name, numeric_type line_number) - : deque_exception(ETL_ERROR_TEXT("deque:type", ETL_FILE"D"), file_name, line_number) + deque_incompatible_type(string_type file_name_, numeric_type line_number_) + : deque_exception(ETL_ERROR_TEXT("deque:type", ETL_FILE"D"), file_name_, line_number_) { } }; @@ -193,10 +193,10 @@ namespace etl //************************************************************************* /// Constructor. //************************************************************************* - deque_base(size_t max_size, size_t buffer_size) + deque_base(size_t max_size_, size_t buffer_size_) : current_size(0), - CAPACITY(max_size), - BUFFER_SIZE(buffer_size) + CAPACITY(max_size_), + BUFFER_SIZE(buffer_size_) { } @@ -412,10 +412,10 @@ namespace etl private: //*************************************************** - iterator(difference_type index, ideque& the_deque, pointer p_buffer) - : index(index), - p_deque(&the_deque), - p_buffer(p_buffer) + iterator(difference_type index_, ideque& the_deque, pointer p_buffer_) + : index(index_), + p_deque(&the_deque), + p_buffer(p_buffer_) { } @@ -594,23 +594,23 @@ namespace etl private: //*************************************************** - difference_type distance(difference_type firstIndex, difference_type index) + difference_type distance(difference_type firstIndex, difference_type index_) { - if (index < firstIndex) + if (index_ < firstIndex) { - return p_deque->BUFFER_SIZE + index - firstIndex; + return p_deque->BUFFER_SIZE + index_ - firstIndex; } else { - return index - firstIndex; + return index_ - firstIndex; } } //*************************************************** - const_iterator(difference_type index, ideque& the_deque, pointer p_buffer) - : index(index), - p_deque(&the_deque), - p_buffer(p_buffer) + const_iterator(difference_type index_, ideque& the_deque, pointer p_buffer_) + : index(index_), + p_deque(&the_deque), + p_buffer(p_buffer_) { } @@ -1786,9 +1786,9 @@ namespace etl //************************************************************************* /// Constructor. //************************************************************************* - ideque(pointer p_buffer, size_t max_size, size_t buffer_size) - : deque_base(max_size, buffer_size), - p_buffer(p_buffer) + ideque(pointer p_buffer_, size_t max_size_, size_t buffer_size_) + : deque_base(max_size_, buffer_size_), + p_buffer(p_buffer_) { } @@ -2019,10 +2019,10 @@ namespace etl /// Assigns data to the deque. //************************************************************************* template - deque(TIterator begin, TIterator end) + deque(TIterator begin_, TIterator end_) : etl::ideque(reinterpret_cast(&buffer[0]), MAX_SIZE, BUFFER_SIZE) { - etl::ideque::assign(begin, end); + etl::ideque::assign(begin_, end_); } //************************************************************************* @@ -2052,7 +2052,7 @@ namespace etl //************************************************************************* void repair() { -#if ETL_C11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED +#if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED ETL_ASSERT(std::is_trivially_copyable::value, ETL_ERROR(etl::deque_incompatible_type)); #endif diff --git a/src/enum_type.h b/src/enum_type.h index 00866597..6f3da8d2 100644 --- a/src/enum_type.h +++ b/src/enum_type.h @@ -86,9 +86,9 @@ SOFTWARE. typedef ValueType value_type; \ TypeName() {} \ TypeName(const TypeName &other) : value(other.value) {} \ - TypeName(enum_type value) : value(value) {} \ + TypeName(enum_type value_) : value(value_) {} \ TypeName& operator=(const TypeName &other) {value = other.value; return *this;} \ - explicit TypeName(value_type value) : value(static_cast(value)) {} \ + explicit TypeName(value_type value_) : value(static_cast(value_)) {} \ operator value_type() const {return static_cast(value);} \ value_type get_value() const {return static_cast(value);} \ enum_type get_enum() const {return value;} \ diff --git a/src/error_handler.h b/src/error_handler.h index c107344f..421be222 100644 --- a/src/error_handler.h +++ b/src/error_handler.h @@ -57,8 +57,8 @@ namespace etl //************************************************************************* struct free_function : public etl::function { - free_function(void (*p_function)(const etl::exception&)) - : etl::function(p_function) + free_function(void (*p_function_)(const etl::exception&)) + : etl::function(p_function_) { } }; @@ -69,8 +69,8 @@ namespace etl template struct member_function : public etl::function { - member_function(TObject& object, void(TObject::*p_function)(const etl::exception&)) - : etl::function(object, p_function) + member_function(TObject& object_, void(TObject::*p_function_)(const etl::exception&)) + : etl::function(object_, p_function_) { } }; diff --git a/src/exception.h b/src/exception.h index 8c4301a2..20dc763b 100644 --- a/src/exception.h +++ b/src/exception.h @@ -54,21 +54,21 @@ namespace etl //************************************************************************* /// Constructor. //************************************************************************* - exception(string_type reason, string_type file, numeric_type line) - : reason(reason), - file(file), - line(line) + exception(string_type reason_, string_type file_, numeric_type line_) + : reason_text(reason_), + file_text(file_), + line(line_) { } #else //************************************************************************* /// Constructor. //************************************************************************* - exception(string_type reason, string_type file, numeric_type line) - : reason(reason), - line(line) + exception(string_type reason_, string_type file_, numeric_type line_) + : reason_text(reason), + line(line_) { - (void)file; + (void)file_text; } #endif @@ -78,7 +78,7 @@ namespace etl //*************************************************************************** string_type what() const { - return reason; + return reason_text; } @@ -89,7 +89,7 @@ namespace etl string_type file_name() const { #if defined(ETL_VERBOSE_ERRORS) - return file; + return file_text; #else return ""; #endif @@ -106,9 +106,9 @@ namespace etl private: - string_type reason; ///< The reason for the exception. + string_type reason_text; ///< The reason for the exception. #if defined(ETL_VERBOSE_ERRORS) - string_type file; ///< The file for the exception. + string_type file_text; ///< The file for the exception. #endif numeric_type line; ///< The line for the exception. }; diff --git a/src/factory.h b/src/factory.h index 6aaeb11c..b4d62b2c 100644 --- a/src/factory.h +++ b/src/factory.h @@ -50,8 +50,8 @@ namespace etl { public: - factory_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + factory_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -61,8 +61,8 @@ namespace etl { public: - factory_cannot_create(string_type file_name, numeric_type line_number) - : factory_exception(ETL_ERROR_TEXT("factory:cannot create", ETL_FILE"A"), file_name, line_number) + factory_cannot_create(string_type file_name_, numeric_type line_number_) + : factory_exception(ETL_ERROR_TEXT("factory:cannot create", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -72,8 +72,8 @@ namespace etl { public: - factory_did_not_create(string_type file_name, numeric_type line_number) - : factory_exception(ETL_ERROR_TEXT("factory:did not create", ETL_FILE"B"), file_name, line_number) + factory_did_not_create(string_type file_name_, numeric_type line_number_) + : factory_exception(ETL_ERROR_TEXT("factory:did not create", ETL_FILE"B"), file_name_, line_number_) { } }; diff --git a/src/fixed_iterator.h b/src/fixed_iterator.h index 12396ea3..b09aba26 100644 --- a/src/fixed_iterator.h +++ b/src/fixed_iterator.h @@ -59,11 +59,11 @@ namespace etl //*************************************************************************** /// Construct from iterator. //*************************************************************************** - fixed_iterator(TIterator it) - : it(it) + fixed_iterator(TIterator it_) + : it(it_) { } - + //*************************************************************************** /// Increment (Does nothing). //*************************************************************************** @@ -71,7 +71,7 @@ namespace etl { return *this; } - + //*************************************************************************** /// Increment (Does nothing). //*************************************************************************** @@ -87,15 +87,15 @@ namespace etl { return *this; } - + //*************************************************************************** /// Decrement (Does nothing). //*************************************************************************** fixed_iterator operator --(int) { return *this; - } - + } + //*************************************************************************** /// Dereference operator. //*************************************************************************** @@ -103,7 +103,7 @@ namespace etl { return *it; } - + //*************************************************************************** /// Dereference operator. //*************************************************************************** @@ -118,7 +118,7 @@ namespace etl TIterator operator ->() { return it; - } + } //*************************************************************************** /// -> operator. @@ -142,15 +142,15 @@ namespace etl fixed_iterator& operator +=(typename std::iterator_traits::difference_type /*offset*/) { return *this; - } - + } + //*************************************************************************** /// -= operator. //*************************************************************************** fixed_iterator& operator -=(typename std::iterator_traits::difference_type /*offset*/) { return *this; - } + } //*************************************************************************** /// Assignment from iterator. diff --git a/src/flat_map.h b/src/flat_map.h index 9321fcd9..1a5b09c0 100644 --- a/src/flat_map.h +++ b/src/flat_map.h @@ -272,8 +272,8 @@ namespace etl void assign(TIterator first, TIterator last) { #if defined(ETL_DEBUG) - difference_type count = std::distance(first, last); - ETL_ASSERT(count <= difference_type(capacity()), ETL_ERROR(flat_map_full)); + difference_type d = std::distance(first, last); + ETL_ASSERT(d <= difference_type(capacity()), ETL_ERROR(flat_map_full)); #endif clear(); diff --git a/src/flat_multimap.h b/src/flat_multimap.h index b4f8de8e..e6315c13 100644 --- a/src/flat_multimap.h +++ b/src/flat_multimap.h @@ -229,8 +229,8 @@ namespace etl void assign(TIterator first, TIterator last) { #if defined(ETL_DEBUG) - difference_type count = std::distance(first, last); - ETL_ASSERT(count <= difference_type(capacity()), ETL_ERROR(flat_multimap_full)); + difference_type d = std::distance(first, last); + ETL_ASSERT(d <= difference_type(capacity()), ETL_ERROR(flat_multimap_full)); #endif clear(); @@ -304,9 +304,9 @@ namespace etl } else { - size_t count = std::distance(range.first, range.second); + size_t d = std::distance(range.first, range.second); erase(range.first, range.second); - return count; + return d; } } diff --git a/src/flat_multiset.h b/src/flat_multiset.h index b0f7329e..10dbc9c9 100644 --- a/src/flat_multiset.h +++ b/src/flat_multiset.h @@ -205,8 +205,8 @@ namespace etl void assign(TIterator first, TIterator last) { #if defined(ETL_DEBUG) - difference_type count = std::distance(first, last); - ETL_ASSERT(count <= difference_type(capacity()), ETL_ERROR(flat_multiset_full)); + difference_type d = std::distance(first, last); + ETL_ASSERT(d <= difference_type(capacity()), ETL_ERROR(flat_multiset_full)); #endif clear(); @@ -282,9 +282,9 @@ namespace etl } else { - size_t count = std::distance(range.first, range.second); + size_t d = std::distance(range.first, range.second); erase(range.first, range.second); - return count; + return d; } } diff --git a/src/flat_set.h b/src/flat_set.h index 22fbfcaf..abaf5c07 100644 --- a/src/flat_set.h +++ b/src/flat_set.h @@ -205,8 +205,8 @@ namespace etl void assign(TIterator first, TIterator last) { #if defined(ETL_DEBUG) - difference_type count = std::distance(first, last); - ETL_ASSERT(count <= difference_type(capacity()), ETL_ERROR(flat_set_full)); + difference_type d = std::distance(first, last); + ETL_ASSERT(d <= difference_type(capacity()), ETL_ERROR(flat_set_full)); #endif clear(); @@ -496,9 +496,9 @@ namespace etl //********************************************************************* /// Constructor. //********************************************************************* - iflat_set(lookup_t& lookup_, storage_t& storage) + iflat_set(lookup_t& lookup_, storage_t& storage_) : refset_t(lookup_), - storage(storage) + storage(storage_) { } diff --git a/src/forward_list.h b/src/forward_list.h index 7154e072..2a2cf156 100644 --- a/src/forward_list.h +++ b/src/forward_list.h @@ -69,8 +69,8 @@ namespace etl { public: - forward_list_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + forward_list_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -83,8 +83,8 @@ namespace etl { public: - forward_list_full(string_type file_name, numeric_type line_number) - : etl::forward_list_exception(ETL_ERROR_TEXT("forward_list:full", ETL_FILE"A"), file_name, line_number) + forward_list_full(string_type file_name_, numeric_type line_number_) + : etl::forward_list_exception(ETL_ERROR_TEXT("forward_list:full", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -97,8 +97,8 @@ namespace etl { public: - forward_list_empty(string_type file_name, numeric_type line_number) - : etl::forward_list_exception(ETL_ERROR_TEXT("forward_list:empty", ETL_FILE"B"), file_name, line_number) + forward_list_empty(string_type file_name_, numeric_type line_number_) + : etl::forward_list_exception(ETL_ERROR_TEXT("forward_list:empty", ETL_FILE"B"), file_name_, line_number_) { } }; @@ -111,8 +111,8 @@ namespace etl { public: - forward_list_iterator(string_type file_name, numeric_type line_number) - : etl::forward_list_exception(ETL_ERROR_TEXT("forward_list:iterator", ETL_FILE"C"), file_name, line_number) + forward_list_iterator(string_type file_name_, numeric_type line_number_) + : etl::forward_list_exception(ETL_ERROR_TEXT("forward_list:iterator", ETL_FILE"C"), file_name_, line_number_) { } }; @@ -216,9 +216,9 @@ namespace etl //************************************************************************* /// The constructor that is called from derived classes. //************************************************************************* - forward_list_base(etl::ipool& node_pool, size_type max_size) - : p_node_pool(&node_pool), - MAX_SIZE(max_size) + forward_list_base(etl::ipool& node_pool_, size_type max_size_) + : p_node_pool(&node_pool_), + MAX_SIZE(max_size_) { } @@ -295,8 +295,8 @@ namespace etl //************************************************************************* struct data_node_t : public node_t { - explicit data_node_t(parameter_t value) - : value(value) + explicit data_node_t(parameter_t value_) + : value(value_) {} T value; @@ -574,8 +574,8 @@ namespace etl void assign(TIterator first, TIterator last) { #if defined(ETL_DEBUG) - difference_type count = std::distance(first, last); - ETL_ASSERT(count >= 0, ETL_ERROR(forward_list_iterator)); + difference_type d = std::distance(first, last); + ETL_ASSERT(d >= 0, ETL_ERROR(forward_list_iterator)); #endif initialise(); @@ -851,8 +851,8 @@ namespace etl void insert_after(iterator position, TIterator first, TIterator last) { #if defined(ETL_DEBUG) - difference_type count = std::distance(first, last); - ETL_ASSERT((count + size()) <= MAX_SIZE, ETL_ERROR(forward_list_full)); + difference_type d = std::distance(first, last); + ETL_ASSERT((d + size()) <= MAX_SIZE, ETL_ERROR(forward_list_full)); #endif while (first != last) diff --git a/src/frame_check_sequence.h b/src/frame_check_sequence.h index 0a1aabc7..093a93c9 100644 --- a/src/frame_check_sequence.h +++ b/src/frame_check_sequence.h @@ -105,9 +105,9 @@ namespace etl //************************************************************************* /// \param value The uint8_t to add to the FCS. //************************************************************************* - void add(uint8_t value) + void add(uint8_t value_) { - frame_check = policy.add(frame_check, value); + frame_check = policy.add(frame_check, value_); } //************************************************************************* diff --git a/src/fsm.h b/src/fsm.h index 372063f0..60edfce7 100644 --- a/src/fsm.h +++ b/src/fsm.h @@ -91,8 +91,8 @@ namespace etl { public: - fsm_exception(string_type what, string_type file_name, numeric_type line_number) - : etl::exception(what, file_name, line_number) + fsm_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : etl::exception(reason_, file_name_, line_number_) { } }; @@ -104,8 +104,8 @@ namespace etl { public: - fsm_null_state_exception(string_type file_name, numeric_type line_number) - : etl::fsm_exception(ETL_ERROR_TEXT("fsm:null state", ETL_FILE"A"), file_name, line_number) + fsm_null_state_exception(string_type file_name_, numeric_type line_number_) + : etl::fsm_exception(ETL_ERROR_TEXT("fsm:null state", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -117,8 +117,8 @@ namespace etl { public: - fsm_state_id_exception(string_type file_name, numeric_type line_number) - : etl::fsm_exception(ETL_ERROR_TEXT("fsm:state id", ETL_FILE"B"), file_name, line_number) + fsm_state_id_exception(string_type file_name_, numeric_type line_number_) + : etl::fsm_exception(ETL_ERROR_TEXT("fsm:state id", ETL_FILE"B"), file_name_, line_number_) { } }; @@ -130,8 +130,8 @@ namespace etl { public: - fsm_state_list_exception(string_type file_name, numeric_type line_number) - : etl::fsm_exception(ETL_ERROR_TEXT("fsm:state list", ETL_FILE"C"), file_name, line_number) + fsm_state_list_exception(string_type file_name_, numeric_type line_number_) + : etl::fsm_exception(ETL_ERROR_TEXT("fsm:state list", ETL_FILE"C"), file_name_, line_number_) { } }; @@ -324,7 +324,7 @@ namespace etl /// Does this FSM accept the message id? /// Yes, it accepts everything! //******************************************* - bool accepts(etl::message_id_t id) const + bool accepts(etl::message_id_t) const { return true; } @@ -383,10 +383,10 @@ namespace etl //*************************************************************************** // The definition for all 16 message types. //*************************************************************************** - template class fsm_state : public ifsm_state { @@ -442,10 +442,10 @@ namespace etl //*************************************************************************** // Specialisation for 15 message types. //*************************************************************************** - template class fsm_state : public ifsm_state { @@ -499,10 +499,10 @@ namespace etl //*************************************************************************** // Specialisation for 14 message types. //*************************************************************************** - template class fsm_state : public ifsm_state { @@ -555,10 +555,10 @@ namespace etl //*************************************************************************** // Specialisation for 13 message types. //*************************************************************************** - template class fsm_state : public ifsm_state { @@ -610,9 +610,9 @@ namespace etl //*************************************************************************** // Specialisation for 12 message types. //*************************************************************************** - template class fsm_state : public ifsm_state { @@ -663,9 +663,9 @@ namespace etl //*************************************************************************** // Specialisation for 11 message types. //*************************************************************************** - template class fsm_state : public ifsm_state { @@ -715,9 +715,9 @@ namespace etl //*************************************************************************** // Specialisation for 10 message types. //*************************************************************************** - template class fsm_state : public ifsm_state { @@ -766,9 +766,9 @@ namespace etl //*************************************************************************** // Specialisation for 9 message types. //*************************************************************************** - template class fsm_state : public ifsm_state { @@ -816,8 +816,8 @@ namespace etl //*************************************************************************** // Specialisation for 8 message types. //*************************************************************************** - template class fsm_state : public ifsm_state { @@ -864,8 +864,8 @@ namespace etl //*************************************************************************** // Specialisation for 7 message types. //*************************************************************************** - template class fsm_state : public ifsm_state { @@ -911,8 +911,8 @@ namespace etl //*************************************************************************** // Specialisation for 6 message types. //*************************************************************************** - template class fsm_state : public ifsm_state { @@ -957,8 +957,8 @@ namespace etl //*************************************************************************** // Specialisation for 5 message types. //*************************************************************************** - template class fsm_state : public ifsm_state { @@ -1002,7 +1002,7 @@ namespace etl //*************************************************************************** // Specialisation for 4 message types. //*************************************************************************** - template class fsm_state : public ifsm_state { @@ -1045,7 +1045,7 @@ namespace etl //*************************************************************************** // Specialisation for 3 message types. //*************************************************************************** - template class fsm_state : public ifsm_state { @@ -1087,7 +1087,7 @@ namespace etl //*************************************************************************** // Specialisation for 2 message types. //*************************************************************************** - template class fsm_state : public ifsm_state { @@ -1128,7 +1128,7 @@ namespace etl //*************************************************************************** // Specialisation for 1 message type. //*************************************************************************** - template class fsm_state : public ifsm_state { diff --git a/src/fsm_generator.h b/src/fsm_generator.h index d10705f2..203c1b77 100644 --- a/src/fsm_generator.h +++ b/src/fsm_generator.h @@ -103,8 +103,8 @@ namespace etl { public: - fsm_exception(string_type what, string_type file_name, numeric_type line_number) - : etl::exception(what, file_name, line_number) + fsm_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : etl::exception(reason_, file_name_, line_number_) { } }; @@ -116,8 +116,8 @@ namespace etl { public: - fsm_null_state_exception(string_type file_name, numeric_type line_number) - : etl::fsm_exception(ETL_ERROR_TEXT("fsm:null state", ETL_FILE"A"), file_name, line_number) + fsm_null_state_exception(string_type file_name_, numeric_type line_number_) + : etl::fsm_exception(ETL_ERROR_TEXT("fsm:null state", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -129,8 +129,8 @@ namespace etl { public: - fsm_state_id_exception(string_type file_name, numeric_type line_number) - : etl::fsm_exception(ETL_ERROR_TEXT("fsm:state id", ETL_FILE"B"), file_name, line_number) + fsm_state_id_exception(string_type file_name_, numeric_type line_number_) + : etl::fsm_exception(ETL_ERROR_TEXT("fsm:state id", ETL_FILE"B"), file_name_, line_number_) { } }; @@ -142,8 +142,8 @@ namespace etl { public: - fsm_state_list_exception(string_type file_name, numeric_type line_number) - : etl::fsm_exception(ETL_ERROR_TEXT("fsm:state list", ETL_FILE"C"), file_name, line_number) + fsm_state_list_exception(string_type file_name_, numeric_type line_number_) + : etl::fsm_exception(ETL_ERROR_TEXT("fsm:state list", ETL_FILE"C"), file_name_, line_number_) { } }; diff --git a/src/function.h b/src/function.h index f90ceaab..7b13b82b 100644 --- a/src/function.h +++ b/src/function.h @@ -98,9 +98,9 @@ namespace etl ///\param object Reference to the object ///\param p_function Pointer to the member function //************************************************************************* - function(TObject& object, void(TObject::* p_function)(TParameter)) - : p_object(&object), - p_function(p_function) + function(TObject& object_, void(TObject::* p_function_)(TParameter)) + : p_object(&object_), + p_function(p_function_) { } @@ -135,9 +135,9 @@ namespace etl ///\param object Reference to the object ///\param p_function Pointer to the member function //************************************************************************* - function(TObject& object, void(TObject::* p_function)(void)) - : p_object(&object), - p_function(p_function) + function(TObject& object_, void(TObject::* p_function_)(void)) + : p_object(&object_), + p_function(p_function_) { } @@ -169,8 +169,8 @@ namespace etl /// Constructor. ///\param p_function Pointer to the function //************************************************************************* - function(void(*p_function)(TParameter)) - : p_function(p_function) + function(void(*p_function_)(TParameter)) + : p_function(p_function_) { } @@ -220,7 +220,7 @@ namespace etl void (*p_function)(); ///< Pointer to the function. }; - + //*************************************************************************** ///\ingroup function /// A derived function template that takes an object type and parameter type. @@ -239,8 +239,8 @@ namespace etl /// Constructor. ///\param object Reference to the object //************************************************************************* - function_mp(TObject& object) - : p_object(&object) + function_mp(TObject& object_) + : p_object(&object_) { } @@ -277,8 +277,8 @@ namespace etl /// Constructor. ///\param object Reference to the object //************************************************************************* - function_mv(TObject& object) - : p_object(&object) + function_mv(TObject& object_) + : p_object(&object_) { } diff --git a/src/ihash.h b/src/ihash.h index e5b2e3a1..db154233 100644 --- a/src/ihash.h +++ b/src/ihash.h @@ -54,8 +54,8 @@ namespace etl { public: - hash_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + hash_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) {} }; @@ -67,8 +67,8 @@ namespace etl { public: - hash_finalised(string_type file_name, numeric_type line_number) - : hash_exception(ETL_ERROR_TEXT("ihash:finalised", ETL_FILE"A"), file_name, line_number) + hash_finalised(string_type file_name_, numeric_type line_number_) + : hash_exception(ETL_ERROR_TEXT("ihash:finalised", ETL_FILE"A"), file_name_, line_number_) {} }; diff --git a/src/intrusive_forward_list.h b/src/intrusive_forward_list.h index 7a56a2cf..578fdfac 100644 --- a/src/intrusive_forward_list.h +++ b/src/intrusive_forward_list.h @@ -63,8 +63,8 @@ namespace etl { public: - intrusive_forward_list_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + intrusive_forward_list_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -77,8 +77,8 @@ namespace etl { public: - intrusive_forward_list_empty(string_type file_name, numeric_type line_number) - : intrusive_forward_list_exception(ETL_ERROR_TEXT("intrusive_forward_list:empty", ETL_FILE"A"), file_name, line_number) + intrusive_forward_list_empty(string_type file_name_, numeric_type line_number_) + : intrusive_forward_list_exception(ETL_ERROR_TEXT("intrusive_forward_list:empty", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -91,8 +91,8 @@ namespace etl { public: - intrusive_forward_list_iterator_exception(string_type file_name, numeric_type line_number) - : intrusive_forward_list_exception(ETL_ERROR_TEXT("intrusive_forward_list:iterator", ETL_FILE"B"), file_name, line_number) + intrusive_forward_list_iterator_exception(string_type file_name_, numeric_type line_number_) + : intrusive_forward_list_exception(ETL_ERROR_TEXT("intrusive_forward_list:iterator", ETL_FILE"B"), file_name_, line_number_) { } }; @@ -105,8 +105,8 @@ namespace etl { public: - intrusive_forward_list_index_exception(string_type file_name, numeric_type line_number) - : intrusive_forward_list_exception(ETL_ERROR_TEXT("intrusive_forward_list:bounds", ETL_FILE"C"), file_name, line_number) + intrusive_forward_list_index_exception(string_type file_name_, numeric_type line_number_) + : intrusive_forward_list_exception(ETL_ERROR_TEXT("intrusive_forward_list:bounds", ETL_FILE"C"), file_name_, line_number_) { } }; @@ -119,8 +119,8 @@ namespace etl { public: - intrusive_forward_list_unsorted(string_type file_name, numeric_type line_number) - : intrusive_forward_list_exception(ETL_ERROR_TEXT("intrusive_forward_list:unsorted", ETL_FILE"D"), file_name, line_number) + intrusive_forward_list_unsorted(string_type file_name_, numeric_type line_number_) + : intrusive_forward_list_exception(ETL_ERROR_TEXT("intrusive_forward_list:unsorted", ETL_FILE"D"), file_name_, line_number_) { } }; @@ -153,8 +153,8 @@ namespace etl void assign(TIterator first, TIterator last) { #if defined(ETL_DEBUG) - intmax_t count = std::distance(first, last); - ETL_ASSERT(count >= 0, ETL_ERROR(intrusive_forward_list_iterator_exception)); + intmax_t d = std::distance(first, last); + ETL_ASSERT(d >= 0, ETL_ERROR(intrusive_forward_list_iterator_exception)); #endif initialise(); diff --git a/src/intrusive_links.h b/src/intrusive_links.h index ee69a950..d4a19cf5 100644 --- a/src/intrusive_links.h +++ b/src/intrusive_links.h @@ -63,8 +63,8 @@ namespace etl { public: - link_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + link_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -76,8 +76,8 @@ namespace etl { public: - not_unlinked_exception(string_type file_name, numeric_type line_number) - : link_exception(ETL_ERROR_TEXT("link:still linked", ETL_FILE"A"), file_name, line_number) + not_unlinked_exception(string_type file_name_, numeric_type line_number_) + : link_exception(ETL_ERROR_TEXT("link:still linked", ETL_FILE"A"), file_name_, line_number_) { } }; diff --git a/src/intrusive_list.h b/src/intrusive_list.h index 0dec4fae..f1da84e8 100644 --- a/src/intrusive_list.h +++ b/src/intrusive_list.h @@ -64,8 +64,8 @@ namespace etl { public: - intrusive_list_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + intrusive_list_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -78,8 +78,8 @@ namespace etl { public: - intrusive_list_empty(string_type file_name, numeric_type line_number) - : intrusive_list_exception(ETL_ERROR_TEXT("intrusive_list:empty", ETL_FILE"A"), file_name, line_number) + intrusive_list_empty(string_type file_name_, numeric_type line_number_) + : intrusive_list_exception(ETL_ERROR_TEXT("intrusive_list:empty", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -92,8 +92,8 @@ namespace etl { public: - intrusive_list_iterator_exception(string_type file_name, numeric_type line_number) - : intrusive_list_exception(ETL_ERROR_TEXT("intrusive_list:iterator", ETL_FILE"B"), file_name, line_number) + intrusive_list_iterator_exception(string_type file_name_, numeric_type line_number_) + : intrusive_list_exception(ETL_ERROR_TEXT("intrusive_list:iterator", ETL_FILE"B"), file_name_, line_number_) { } }; @@ -106,8 +106,8 @@ namespace etl { public: - intrusive_list_unsorted(string_type file_name, numeric_type line_number) - : intrusive_list_exception(ETL_ERROR_TEXT("intrusive_list:unsorted", ETL_FILE"C"), file_name, line_number) + intrusive_list_unsorted(string_type file_name_, numeric_type line_number_) + : intrusive_list_exception(ETL_ERROR_TEXT("intrusive_list:unsorted", ETL_FILE"C"), file_name_, line_number_) { } }; @@ -133,8 +133,8 @@ namespace etl void assign(TIterator first, TIterator last) { #if defined(ETL_DEBUG) - intmax_t count = std::distance(first, last); - ETL_ASSERT(count >= 0, ETL_ERROR(intrusive_list_iterator_exception)); + intmax_t d = std::distance(first, last); + ETL_ASSERT(d >= 0, ETL_ERROR(intrusive_list_iterator_exception)); #endif initialise(); @@ -1028,31 +1028,31 @@ namespace etl value_type* other_begin = static_cast(other.get_head()); value_type* other_end = static_cast(&other.terminal_link); - value_type* begin = static_cast(this->get_head()); - value_type* end = static_cast(&this->terminal_link); + value_type* this_begin = static_cast(this->get_head()); + value_type* this_end = static_cast(&this->terminal_link); - while ((begin != end) && (other_begin != other_end)) + while ((this_begin != this_end) && (other_begin != other_end)) { // Find the place to insert. - while ((begin != end) && !(compare(*other_begin, *begin))) + while ((this_begin != this_end) && !(compare(*other_begin, *this_begin))) { - begin = static_cast(begin->link_type::etl_next); + this_begin = static_cast(this_begin->link_type::etl_next); } // Insert. - if (begin != end) + if (this_begin != this_end) { - while ((other_begin != other_end) && (compare(*other_begin, *begin))) + while ((other_begin != other_end) && (compare(*other_begin, *this_begin))) { value_type* value = other_begin; other_begin = static_cast(other_begin->link_type::etl_next); - etl::link_splice(*begin->link_type::etl_previous, *value); + etl::link_splice(*this_begin->link_type::etl_previous, *value); } } } // Any left over? - if ((begin == end) && (other_begin != other_end)) + if ((this_begin == this_end) && (other_begin != other_end)) { etl::link_splice(*this->get_tail(), *other_begin, *other_end->link_type::etl_previous); } diff --git a/src/intrusive_queue.h b/src/intrusive_queue.h index d8910cf3..bc3edc71 100644 --- a/src/intrusive_queue.h +++ b/src/intrusive_queue.h @@ -50,8 +50,8 @@ namespace etl { public: - intrusive_queue_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + intrusive_queue_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -64,8 +64,8 @@ namespace etl { public: - intrusive_queue_empty(string_type file_name, numeric_type line_number) - : intrusive_queue_exception(ETL_ERROR_TEXT("intrusive_queue:empty", ETL_FILE"A"), file_name, line_number) + intrusive_queue_empty(string_type file_name_, numeric_type line_number_) + : intrusive_queue_exception(ETL_ERROR_TEXT("intrusive_queue:empty", ETL_FILE"A"), file_name_, line_number_) { } }; diff --git a/src/intrusive_stack.h b/src/intrusive_stack.h index 16b7edf8..020ca3a0 100644 --- a/src/intrusive_stack.h +++ b/src/intrusive_stack.h @@ -50,8 +50,8 @@ namespace etl { public: - intrusive_stack_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + intrusive_stack_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -64,8 +64,8 @@ namespace etl { public: - intrusive_stack_empty(string_type file_name, numeric_type line_number) - : intrusive_stack_exception(ETL_ERROR_TEXT("intrusive_stack:empty", ETL_FILE"A"), file_name, line_number) + intrusive_stack_empty(string_type file_name_, numeric_type line_number_) + : intrusive_stack_exception(ETL_ERROR_TEXT("intrusive_stack:empty", ETL_FILE"A"), file_name_, line_number_) { } }; diff --git a/src/io_port.h b/src/io_port.h index ed422983..bebf521d 100644 --- a/src/io_port.h +++ b/src/io_port.h @@ -127,9 +127,9 @@ namespace etl } /// Write. - io_port_rw& operator =(parameter_t value) + io_port_rw& operator =(parameter_t value_) { - *reinterpret_cast(ADDRESS) = value; + *reinterpret_cast(ADDRESS) = value_; return *this; } @@ -409,9 +409,9 @@ namespace etl } /// Write. - io_port_wos& operator =(parameter_t value) + io_port_wos& operator =(parameter_t value_) { - shadow_value = value; + shadow_value = value_; *reinterpret_cast(ADDRESS) = shadow_value; return *this; } @@ -548,9 +548,9 @@ namespace etl } /// Write. - io_port_rw& operator =(parameter_t value) + io_port_rw& operator =(parameter_t value_) { - *address = value; + *address = value_; return *this; } @@ -900,9 +900,9 @@ namespace etl } /// Write. - io_port_wos& operator =(parameter_t value) + io_port_wos& operator =(parameter_t value_) { - shadow_value = value; + shadow_value = value_; *address = shadow_value; return *this; } diff --git a/src/list.h b/src/list.h index e1e71390..b4c83130 100644 --- a/src/list.h +++ b/src/list.h @@ -70,8 +70,8 @@ namespace etl { public: - list_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + list_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -84,8 +84,8 @@ namespace etl { public: - list_full(string_type file_name, numeric_type line_number) - : list_exception(ETL_ERROR_TEXT("list:full", ETL_FILE"A"), file_name, line_number) + list_full(string_type file_name_, numeric_type line_number_) + : list_exception(ETL_ERROR_TEXT("list:full", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -98,8 +98,8 @@ namespace etl { public: - list_empty(string_type file_name, numeric_type line_number) - : list_exception(ETL_ERROR_TEXT("list:empty", ETL_FILE"B"), file_name, line_number) + list_empty(string_type file_name_, numeric_type line_number_) + : list_exception(ETL_ERROR_TEXT("list:empty", ETL_FILE"B"), file_name_, line_number_) { } }; @@ -112,8 +112,8 @@ namespace etl { public: - list_iterator(string_type file_name, numeric_type line_number) - : list_exception(ETL_ERROR_TEXT("list:iterator", ETL_FILE"C"), file_name, line_number) + list_iterator(string_type file_name_, numeric_type line_number_) + : list_exception(ETL_ERROR_TEXT("list:iterator", ETL_FILE"C"), file_name_, line_number_) { } }; @@ -126,8 +126,8 @@ namespace etl { public: - list_unsorted(string_type file_name, numeric_type line_number) - : list_exception(ETL_ERROR_TEXT("list:unsorted", ETL_FILE"D"), file_name, line_number) + list_unsorted(string_type file_name_, numeric_type line_number_) + : list_exception(ETL_ERROR_TEXT("list:unsorted", ETL_FILE"D"), file_name_, line_number_) { } }; @@ -299,10 +299,9 @@ namespace etl //************************************************************************* /// The constructor that is called from derived classes. //************************************************************************* - list_base(etl::ipool& node_pool, - size_type max_size) - : p_node_pool(&node_pool), - MAX_SIZE(max_size) + list_base(etl::ipool& node_pool_, size_type max_size_) + : p_node_pool(&node_pool_), + MAX_SIZE(max_size_) { } @@ -338,8 +337,8 @@ namespace etl //************************************************************************* struct data_node_t : public node_t { - explicit data_node_t(parameter_t value) - : value(value) + explicit data_node_t(parameter_t value_) + : value(value_) { } @@ -713,9 +712,9 @@ namespace etl void assign(TIterator first, TIterator last) { #if defined(ETL_DEBUG) - difference_type count = std::distance(first, last); - ETL_ASSERT(count >= 0, ETL_ERROR(list_iterator)); - ETL_ASSERT(size_t(count) <= MAX_SIZE, ETL_ERROR(list_full)); + difference_type d = std::distance(first, last); + ETL_ASSERT(d >= 0, ETL_ERROR(list_iterator)); + ETL_ASSERT(size_t(d) <= MAX_SIZE, ETL_ERROR(list_full)); #endif initialise(); diff --git a/src/map.h b/src/map.h index 4fe0f34d..cd1a0e2e 100644 --- a/src/map.h +++ b/src/map.h @@ -70,8 +70,8 @@ namespace etl { public: - map_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + map_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -84,8 +84,8 @@ namespace etl { public: - map_full(string_type file_name, numeric_type line_number) - : etl::map_exception("map:full", file_name, line_number) + map_full(string_type file_name_, numeric_type line_number_) + : etl::map_exception("map:full", file_name_, line_number_) { } }; @@ -98,8 +98,8 @@ namespace etl { public: - map_out_of_bounds(string_type file_name, numeric_type line_number) - : etl::map_exception("map:bounds", file_name, line_number) + map_out_of_bounds(string_type file_name_, numeric_type line_number_) + : etl::map_exception("map:bounds", file_name_, line_number_) { } }; @@ -112,8 +112,8 @@ namespace etl { public: - map_iterator(string_type file_name, numeric_type line_number) - : etl::map_exception("map:iterator", file_name, line_number) + map_iterator(string_type file_name_, numeric_type line_number_) + : etl::map_exception("map:iterator", file_name_, line_number_) { } }; @@ -225,9 +225,9 @@ namespace etl //************************************************************************* /// The constructor that is called from derived classes. //************************************************************************* - map_base(size_type max_size) + map_base(size_type max_size_) : current_size(0) - , CAPACITY(max_size) + , CAPACITY(max_size_) , root_node(nullptr) { @@ -493,8 +493,8 @@ namespace etl //************************************************************************* struct Data_Node : public Node { - explicit Data_Node(value_type value) - : value(value) + explicit Data_Node(value_type value_) + : value(value_) { } diff --git a/src/message.h b/src/message.h index b7139e2d..1667a0e5 100644 --- a/src/message.h +++ b/src/message.h @@ -46,8 +46,8 @@ namespace etl { public: - message_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + message_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -57,8 +57,8 @@ namespace etl { public: - unhandled_message_exception(string_type file_name, numeric_type line_number) - : message_exception(ETL_ERROR_TEXT("message:unknown", ETL_FILE"A"), file_name, line_number) + unhandled_message_exception(string_type file_name_, numeric_type line_number_) + : message_exception(ETL_ERROR_TEXT("message:unknown", ETL_FILE"A"), file_name_, line_number_) { } }; diff --git a/src/message_bus.h b/src/message_bus.h index 5112629c..11031a8f 100644 --- a/src/message_bus.h +++ b/src/message_bus.h @@ -54,8 +54,8 @@ namespace etl { public: - message_bus_exception(string_type what, string_type file_name, numeric_type line_number) - : etl::exception(what, file_name, line_number) + message_bus_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : etl::exception(reason_, file_name_, line_number_) { } }; @@ -67,8 +67,8 @@ namespace etl { public: - message_bus_too_many_subscribers(string_type file_name, numeric_type line_number) - : message_bus_exception(ETL_ERROR_TEXT("message bus:too many subscribers", ETL_FILE"A"), file_name, line_number) + message_bus_too_many_subscribers(string_type file_name_, numeric_type line_number_) + : message_bus_exception(ETL_ERROR_TEXT("message bus:too many subscribers", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -274,7 +274,7 @@ namespace etl /// Does this message bus accept the message id? /// Yes!, it accepts everything! //******************************************* - bool accepts(etl::message_id_t id) const + bool accepts(etl::message_id_t) const { return true; } diff --git a/src/message_router.h b/src/message_router.h index 091e6560..397086cd 100644 --- a/src/message_router.h +++ b/src/message_router.h @@ -38,12 +38,12 @@ SOFTWARE. // To generate to header file, run this at the command line. // Note: You will need Python and COG installed. // -// python -m cogapp -d -e -omessage_router.h -DHandlers= message_router_generator.h +// python -m cogapp -d -e -omessage_router.h -DHandlers= message_router_generator.h // Where is the number of messages to support. // // e.g. // To generate handlers for up to 16 messages... -// python -m cogapp -d -e -omessage_router.h -DHandlers=16 message_router_generator.h +// python -m cogapp -d -e -omessage_router.h -DHandlers=16 message_router_generator.h // // See generate.bat //*************************************************************************** @@ -73,8 +73,8 @@ namespace etl { public: - message_router_exception(string_type what, string_type file_name, numeric_type line_number) - : etl::exception(what, file_name, line_number) + message_router_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : etl::exception(reason_, file_name_, line_number_) { } }; @@ -86,8 +86,8 @@ namespace etl { public: - message_router_illegal_id(string_type file_name, numeric_type line_number) - : message_router_exception(ETL_ERROR_TEXT("message router:illegal id", ETL_FILE"A"), file_name, line_number) + message_router_illegal_id(string_type file_name_, numeric_type line_number_) + : message_router_exception(ETL_ERROR_TEXT("message router:illegal id", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -164,17 +164,17 @@ namespace etl } //******************************************** - void receive(const etl::imessage& message) + void receive(const etl::imessage&) { } //******************************************** - void receive(etl::imessage_router& source, const etl::imessage& message) + void receive(etl::imessage_router&, const etl::imessage&) { } //******************************************** - bool accepts(etl::message_id_t id) const + bool accepts(etl::message_id_t) const { return false; } @@ -191,7 +191,7 @@ namespace etl /// Send a message to a router. /// Sets the 'sender' to etl::null_message_router type. //*************************************************************************** - inline static void send_message(etl::imessage_router& destination, + inline static void send_message(etl::imessage_router& destination, const etl::imessage& message) { destination.receive(message); @@ -200,20 +200,20 @@ namespace etl //*************************************************************************** /// Send a message to a router. //*************************************************************************** - inline static void send_message(etl::imessage_router& source, - etl::imessage_router& destination, + inline static void send_message(etl::imessage_router& source, + etl::imessage_router& destination, const etl::imessage& message) { destination.receive(source, message); } - + //*************************************************************************** // The definition for all 16 message types. //*************************************************************************** template class message_router : public imessage_router { @@ -339,8 +339,8 @@ namespace etl { switch (id) { - case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: case T7::ID: case T8::ID: - case T9::ID: case T10::ID: case T11::ID: case T12::ID: case T13::ID: case T14::ID: case T15::ID: case T16::ID: + case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: case T7::ID: case T8::ID: + case T9::ID: case T10::ID: case T11::ID: case T12::ID: case T13::ID: case T14::ID: case T15::ID: case T16::ID: return true; break; default: return false; break; @@ -351,10 +351,10 @@ namespace etl //*************************************************************************** // Specialisation for 15 message types. //*************************************************************************** - template class message_router : public imessage_router @@ -479,8 +479,8 @@ namespace etl { switch (id) { - case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: case T7::ID: case T8::ID: - case T9::ID: case T10::ID: case T11::ID: case T12::ID: case T13::ID: case T14::ID: case T15::ID: + case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: case T7::ID: case T8::ID: + case T9::ID: case T10::ID: case T11::ID: case T12::ID: case T13::ID: case T14::ID: case T15::ID: return true; break; default: return false; break; @@ -491,10 +491,10 @@ namespace etl //*************************************************************************** // Specialisation for 14 message types. //*************************************************************************** - template class message_router : public imessage_router @@ -617,8 +617,8 @@ namespace etl { switch (id) { - case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: case T7::ID: case T8::ID: - case T9::ID: case T10::ID: case T11::ID: case T12::ID: case T13::ID: case T14::ID: + case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: case T7::ID: case T8::ID: + case T9::ID: case T10::ID: case T11::ID: case T12::ID: case T13::ID: case T14::ID: return true; break; default: return false; break; @@ -629,10 +629,10 @@ namespace etl //*************************************************************************** // Specialisation for 13 message types. //*************************************************************************** - template class message_router : public imessage_router @@ -753,8 +753,8 @@ namespace etl { switch (id) { - case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: case T7::ID: case T8::ID: - case T9::ID: case T10::ID: case T11::ID: case T12::ID: case T13::ID: + case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: case T7::ID: case T8::ID: + case T9::ID: case T10::ID: case T11::ID: case T12::ID: case T13::ID: return true; break; default: return false; break; @@ -765,9 +765,9 @@ namespace etl //*************************************************************************** // Specialisation for 12 message types. //*************************************************************************** - template class message_router : public imessage_router @@ -886,8 +886,8 @@ namespace etl { switch (id) { - case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: case T7::ID: case T8::ID: - case T9::ID: case T10::ID: case T11::ID: case T12::ID: + case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: case T7::ID: case T8::ID: + case T9::ID: case T10::ID: case T11::ID: case T12::ID: return true; break; default: return false; break; @@ -898,9 +898,9 @@ namespace etl //*************************************************************************** // Specialisation for 11 message types. //*************************************************************************** - template class message_router : public imessage_router @@ -1017,8 +1017,8 @@ namespace etl { switch (id) { - case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: case T7::ID: case T8::ID: - case T9::ID: case T10::ID: case T11::ID: + case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: case T7::ID: case T8::ID: + case T9::ID: case T10::ID: case T11::ID: return true; break; default: return false; break; @@ -1029,9 +1029,9 @@ namespace etl //*************************************************************************** // Specialisation for 10 message types. //*************************************************************************** - template class message_router : public imessage_router @@ -1146,8 +1146,8 @@ namespace etl { switch (id) { - case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: case T7::ID: case T8::ID: - case T9::ID: case T10::ID: + case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: case T7::ID: case T8::ID: + case T9::ID: case T10::ID: return true; break; default: return false; break; @@ -1158,9 +1158,9 @@ namespace etl //*************************************************************************** // Specialisation for 9 message types. //*************************************************************************** - template class message_router : public imessage_router @@ -1273,8 +1273,8 @@ namespace etl { switch (id) { - case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: case T7::ID: case T8::ID: - case T9::ID: + case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: case T7::ID: case T8::ID: + case T9::ID: return true; break; default: return false; break; @@ -1285,8 +1285,8 @@ namespace etl //*************************************************************************** // Specialisation for 8 message types. //*************************************************************************** - template class message_router : public imessage_router @@ -1397,8 +1397,8 @@ namespace etl { switch (id) { - case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: case T7::ID: case T8::ID: - + case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: case T7::ID: case T8::ID: + return true; break; default: return false; break; @@ -1409,8 +1409,8 @@ namespace etl //*************************************************************************** // Specialisation for 7 message types. //*************************************************************************** - template class message_router : public imessage_router @@ -1519,7 +1519,7 @@ namespace etl { switch (id) { - case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: case T7::ID: + case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: case T7::ID: return true; break; default: return false; break; @@ -1530,8 +1530,8 @@ namespace etl //*************************************************************************** // Specialisation for 6 message types. //*************************************************************************** - template class message_router : public imessage_router @@ -1638,7 +1638,7 @@ namespace etl { switch (id) { - case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: + case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: case T6::ID: return true; break; default: return false; break; @@ -1649,8 +1649,8 @@ namespace etl //*************************************************************************** // Specialisation for 5 message types. //*************************************************************************** - template class message_router : public imessage_router @@ -1755,7 +1755,7 @@ namespace etl { switch (id) { - case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: + case T1::ID: case T2::ID: case T3::ID: case T4::ID: case T5::ID: return true; break; default: return false; break; @@ -1766,7 +1766,7 @@ namespace etl //*************************************************************************** // Specialisation for 4 message types. //*************************************************************************** - template class message_router : public imessage_router @@ -1869,7 +1869,7 @@ namespace etl { switch (id) { - case T1::ID: case T2::ID: case T3::ID: case T4::ID: + case T1::ID: case T2::ID: case T3::ID: case T4::ID: return true; break; default: return false; break; @@ -1880,7 +1880,7 @@ namespace etl //*************************************************************************** // Specialisation for 3 message types. //*************************************************************************** - template class message_router : public imessage_router @@ -1981,7 +1981,7 @@ namespace etl { switch (id) { - case T1::ID: case T2::ID: case T3::ID: + case T1::ID: case T2::ID: case T3::ID: return true; break; default: return false; break; @@ -1992,7 +1992,7 @@ namespace etl //*************************************************************************** // Specialisation for 2 message types. //*************************************************************************** - template class message_router : public imessage_router @@ -2091,7 +2091,7 @@ namespace etl { switch (id) { - case T1::ID: case T2::ID: + case T1::ID: case T2::ID: return true; break; default: return false; break; @@ -2102,7 +2102,7 @@ namespace etl //*************************************************************************** // Specialisation for 1 message type. //*************************************************************************** - template class message_router : public imessage_router @@ -2199,7 +2199,7 @@ namespace etl { switch (id) { - case T1::ID: + case T1::ID: return true; break; default: return false; break; diff --git a/src/message_router_generator.h b/src/message_router_generator.h index 8046b717..857b182a 100644 --- a/src/message_router_generator.h +++ b/src/message_router_generator.h @@ -85,8 +85,8 @@ namespace etl { public: - message_router_exception(string_type what, string_type file_name, numeric_type line_number) - : etl::exception(what, file_name, line_number) + message_router_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : etl::exception(reason_, file_name_, line_number_) { } }; @@ -98,8 +98,8 @@ namespace etl { public: - message_router_illegal_id(string_type file_name, numeric_type line_number) - : message_router_exception(ETL_ERROR_TEXT("message router:illegal id", ETL_FILE"A"), file_name, line_number) + message_router_illegal_id(string_type file_name_, numeric_type line_number_) + : message_router_exception(ETL_ERROR_TEXT("message router:illegal id", ETL_FILE"A"), file_name_, line_number_) { } }; diff --git a/src/multimap.h b/src/multimap.h index 7c34bb60..bd31735a 100644 --- a/src/multimap.h +++ b/src/multimap.h @@ -69,8 +69,8 @@ namespace etl { public: - multimap_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + multimap_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -83,8 +83,8 @@ namespace etl { public: - multimap_full(string_type file_name, numeric_type line_number) - : etl::multimap_exception("multimap:full", file_name, line_number) + multimap_full(string_type file_name_, numeric_type line_number_) + : etl::multimap_exception("multimap:full", file_name_, line_number_) { } }; @@ -97,8 +97,8 @@ namespace etl { public: - multimap_out_of_bounds(string_type file_name, numeric_type line_number) - : etl::multimap_exception("multimap:bounds", file_name, line_number) + multimap_out_of_bounds(string_type file_name_, numeric_type line_number_) + : etl::multimap_exception("multimap:bounds", file_name_, line_number_) { } }; @@ -111,8 +111,8 @@ namespace etl { public: - multimap_iterator(string_type file_name, numeric_type line_number) - : etl::multimap_exception("multimap:iterator", file_name, line_number) + multimap_iterator(string_type file_name_, numeric_type line_number_) + : etl::multimap_exception("multimap:iterator", file_name_, line_number_) { } }; @@ -218,9 +218,9 @@ namespace etl //************************************************************************* /// The constructor that is called from derived classes. //************************************************************************* - multimap_base(size_type max_size) + multimap_base(size_type max_size_) : current_size(0) - , CAPACITY(max_size) + , CAPACITY(max_size_) , root_node(nullptr) { @@ -648,8 +648,8 @@ namespace etl //************************************************************************* struct Data_Node : public Node { - explicit Data_Node(value_type value) - : value(value) + explicit Data_Node(value_type value_) + : value(value_) { } @@ -1134,19 +1134,19 @@ namespace etl size_type erase(key_parameter_t key) { // Number of nodes removed - size_type count = 0; + size_type d = 0; const_iterator lower(*this, find_lower_node(root_node, key)); const_iterator upper(*this, find_upper_node(root_node, key)); while (lower != upper) { // Increment count for each node removed - ++count; + ++d; // Remove node using the other erase method (void)erase(lower++); } // Return the total count erased - return count; + return d; } //************************************************************************* diff --git a/src/multiset.h b/src/multiset.h index d9f13873..753addeb 100644 --- a/src/multiset.h +++ b/src/multiset.h @@ -69,8 +69,8 @@ namespace etl { public: - multiset_exception(string_type what, string_type file_name, numeric_type line_number) - : etl::exception(what, file_name, line_number) + multiset_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : etl::exception(reason_, file_name_, line_number_) { } }; @@ -83,8 +83,8 @@ namespace etl { public: - multiset_full(string_type file_name, numeric_type line_number) - : etl::multiset_exception(ETL_ERROR_TEXT("multiset:full", ETL_FILE"A"), file_name, line_number) + multiset_full(string_type file_name_, numeric_type line_number_) + : etl::multiset_exception(ETL_ERROR_TEXT("multiset:full", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -97,8 +97,8 @@ namespace etl { public: - multiset_out_of_bounds(string_type file_name, numeric_type line_number) - : etl::multiset_exception(ETL_ERROR_TEXT("multiset:bounds", ETL_FILE"B"), file_name, line_number) + multiset_out_of_bounds(string_type file_name_, numeric_type line_number_) + : etl::multiset_exception(ETL_ERROR_TEXT("multiset:bounds", ETL_FILE"B"), file_name_, line_number_) { } }; @@ -111,8 +111,8 @@ namespace etl { public: - multiset_iterator(string_type file_name, numeric_type line_number) - : etl::multiset_exception(ETL_ERROR_TEXT("multiset:iterator", ETL_FILE"C"), file_name, line_number) + multiset_iterator(string_type file_name_, numeric_type line_number_) + : etl::multiset_exception(ETL_ERROR_TEXT("multiset:iterator", ETL_FILE"C"), file_name_, line_number_) { } }; @@ -218,9 +218,9 @@ namespace etl //************************************************************************* /// The constructor that is called from derived classes. //************************************************************************* - multiset_base(size_type max_size) + multiset_base(size_type max_size_) : current_size(0) - , CAPACITY(max_size) + , CAPACITY(max_size_) , root_node(nullptr) { } @@ -645,8 +645,8 @@ namespace etl //************************************************************************* struct Data_Node : public Node { - explicit Data_Node(value_type value) - : value(value) + explicit Data_Node(value_type value_) + : value(value_) { } @@ -1114,19 +1114,19 @@ namespace etl size_type erase(key_parameter_t key_value) { // Number of nodes removed - size_type count = 0; + size_type d = 0; const_iterator lower(*this, find_lower_node(root_node, key_value)); const_iterator upper(*this, find_upper_node(root_node, key_value)); while (lower != upper) { // Increment count for each node removed - ++count; + ++d; // Remove node using the other erase method (void)erase(lower++); } // Return the total count erased - return count; + return d; } //************************************************************************* diff --git a/src/murmur3.h b/src/murmur3.h index 8300c253..6cd9b8ed 100644 --- a/src/murmur3.h +++ b/src/murmur3.h @@ -65,8 +65,8 @@ namespace etl /// Default constructor. /// \param seed The seed value. Default = 0. //************************************************************************* - murmur3(value_type seed = 0) - : seed(seed) + murmur3(value_type seed_ = 0) + : seed(seed_) { reset(); } @@ -78,8 +78,8 @@ namespace etl /// \param seed The seed value. Default = 0. //************************************************************************* template - murmur3(TIterator begin, const TIterator end, value_type seed = 0) - : seed(seed) + murmur3(TIterator begin, const TIterator end, value_type seed_ = 0) + : seed(seed_) { STATIC_ASSERT(sizeof(typename std::iterator_traits::value_type) == 1, "Incompatible type"); @@ -142,12 +142,12 @@ namespace etl /// If the hash has already been finalised then a 'hash_finalised' error will be emitted. /// \param value The char to add to the hash. //************************************************************************* - void add(uint8_t value) + void add(uint8_t value_) { // We can't add to a finalised hash! ETL_ASSERT(!is_finalised, ETL_ERROR(hash_finalised)); - block |= value << (block_fill_count * 8); + block |= value_ << (block_fill_count * 8); if (++block_fill_count == FULL_BLOCK) { diff --git a/src/observer.h b/src/observer.h index 4b6766dc..c48dc7f0 100644 --- a/src/observer.h +++ b/src/observer.h @@ -71,8 +71,8 @@ namespace etl { public: - observer_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + observer_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -85,8 +85,8 @@ namespace etl { public: - observer_list_full(string_type file_name, numeric_type line_number) - : observer_exception(ETL_ERROR_TEXT("observer:full", ETL_FILE"A"), file_name, line_number) + observer_list_full(string_type file_name_, numeric_type line_number_) + : observer_exception(ETL_ERROR_TEXT("observer:full", ETL_FILE"A"), file_name_, line_number_) { } }; diff --git a/src/optional.h b/src/optional.h index 7b5a9e5c..f6f4ce10 100644 --- a/src/optional.h +++ b/src/optional.h @@ -74,8 +74,8 @@ namespace etl { public: - optional_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + optional_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -88,8 +88,8 @@ namespace etl { public: - optional_invalid(string_type file_name, numeric_type line_number) - : optional_exception("optional: invalid", file_name, line_number) + optional_invalid(string_type file_name_, numeric_type line_number_) + : optional_exception("optional: invalid", file_name_, line_number_) { } }; @@ -136,9 +136,9 @@ namespace etl //*************************************************************************** /// Constructor from value type. //*************************************************************************** - optional(const T& value) + optional(const T& value_) { - ::new (storage.template get_address()) T(value); + ::new (storage.template get_address()) T(value_); valid = true; } @@ -199,15 +199,15 @@ namespace etl //*************************************************************************** /// Assignment operator from value type. //*************************************************************************** - optional& operator =(const T& value) + optional& operator =(const T& value_) { if (valid) { - storage.template get_reference() = value; + storage.template get_reference() = value_; } else { - ::new (storage.template get_address()) T(value); + ::new (storage.template get_address()) T(value_); valid = true; } diff --git a/src/pearson.h b/src/pearson.h index 3b99d03b..7e779f44 100644 --- a/src/pearson.h +++ b/src/pearson.h @@ -120,13 +120,13 @@ namespace etl //************************************************************************* /// \param value The char to add to the hash. //************************************************************************* - void add(uint8_t value) + void add(uint8_t value_) { if (first) { for (size_t i = 0; i < HASH_LENGTH; ++i) { - hash[i] = PEARSON_LOOKUP[(uint32_t(value) + i) % 256]; + hash[i] = PEARSON_LOOKUP[(uint32_t(value_) + i) % 256]; } first = false; @@ -135,7 +135,7 @@ namespace etl { for (size_t i = 0; i < HASH_LENGTH; ++i) { - hash[i] = PEARSON_LOOKUP[hash[i] ^ value]; + hash[i] = PEARSON_LOOKUP[hash[i] ^ value_]; } } } diff --git a/src/pool.h b/src/pool.h index a0359c37..8120748d 100644 --- a/src/pool.h +++ b/src/pool.h @@ -63,8 +63,8 @@ namespace etl { public: - pool_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + pool_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) {} }; @@ -76,8 +76,8 @@ namespace etl { public: - explicit pool_no_allocation(string_type file_name, numeric_type line_number) - : pool_exception(ETL_ERROR_TEXT("pool:allocation", ETL_FILE"A"), file_name, line_number) + explicit pool_no_allocation(string_type file_name_, numeric_type line_number_) + : pool_exception(ETL_ERROR_TEXT("pool:allocation", ETL_FILE"A"), file_name_, line_number_) {} }; @@ -89,8 +89,8 @@ namespace etl { public: - pool_object_not_in_pool(string_type file_name, numeric_type line_number) - : pool_exception(ETL_ERROR_TEXT("pool:not in pool", ETL_FILE"B"), file_name, line_number) + pool_object_not_in_pool(string_type file_name_, numeric_type line_number_) + : pool_exception(ETL_ERROR_TEXT("pool:not in pool", ETL_FILE"B"), file_name_, line_number_) {} }; @@ -102,8 +102,8 @@ namespace etl { public: - pool_element_size(string_type file_name, numeric_type line_number) - : pool_exception(ETL_ERROR_TEXT("pool:element size", ETL_FILE"C"), file_name, line_number) + pool_element_size(string_type file_name_, numeric_type line_number_) + : pool_exception(ETL_ERROR_TEXT("pool:element size", ETL_FILE"C"), file_name_, line_number_) {} }; @@ -212,13 +212,13 @@ namespace etl //************************************************************************* /// Constructor //************************************************************************* - ipool(char* p_buffer_, uint32_t item_size, uint32_t max_size) + ipool(char* p_buffer_, uint32_t item_size_, uint32_t max_size_) : p_buffer(p_buffer_), p_next(p_buffer_), items_allocated(0), items_initialised(0), - ITEM_SIZE(item_size), - MAX_SIZE(max_size) + ITEM_SIZE(item_size_), + MAX_SIZE(max_size_) { } diff --git a/src/priority_queue.h b/src/priority_queue.h index 08ace478..c48ba358 100644 --- a/src/priority_queue.h +++ b/src/priority_queue.h @@ -63,8 +63,8 @@ namespace etl { public: - priority_queue_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + priority_queue_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -77,8 +77,8 @@ namespace etl { public: - priority_queue_full(string_type file_name, numeric_type line_number) - : priority_queue_exception(ETL_ERROR_TEXT("priority_queue:full", ETL_FILE"A"), file_name, line_number) + priority_queue_full(string_type file_name_, numeric_type line_number_) + : priority_queue_exception(ETL_ERROR_TEXT("priority_queue:full", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -91,8 +91,8 @@ namespace etl { public: - priority_queue_iterator(string_type file_name, numeric_type line_number) - : priority_queue_exception(ETL_ERROR_TEXT("priority_queue:iterator", ETL_FILE"B"), file_name, line_number) + priority_queue_iterator(string_type file_name_, numeric_type line_number_) + : priority_queue_exception(ETL_ERROR_TEXT("priority_queue:iterator", ETL_FILE"B"), file_name_, line_number_) { } }; @@ -247,9 +247,9 @@ namespace etl void assign(TIterator first, TIterator last) { #if defined(ETL_DEBUG) - difference_type count = std::distance(first, last); - ETL_ASSERT(count >= 0, ETL_ERROR(etl::priority_queue_iterator)); - ETL_ASSERT(static_cast(count) <= max_size(), ETL_ERROR(etl::priority_queue_full)); + difference_type d = std::distance(first, last); + ETL_ASSERT(d >= 0, ETL_ERROR(etl::priority_queue_iterator)); + ETL_ASSERT(static_cast(d) <= max_size(), ETL_ERROR(etl::priority_queue_full)); #endif clear(); diff --git a/src/private/ivectorpointer.h b/src/private/ivectorpointer.h index 5c426204..0ba80810 100644 --- a/src/private/ivectorpointer.h +++ b/src/private/ivectorpointer.h @@ -440,8 +440,8 @@ namespace etl //********************************************************************* /// Constructor. //********************************************************************* - ivector(T** p_buffer, size_t MAX_SIZE) - : pvoidvector(reinterpret_cast(p_buffer), MAX_SIZE) + ivector(T** p_buffer_, size_t MAX_SIZE_) + : pvoidvector(reinterpret_cast(p_buffer_), MAX_SIZE_) { } }; diff --git a/src/private/pvoidvector.h b/src/private/pvoidvector.h index 9cb57d21..664eb563 100644 --- a/src/private/pvoidvector.h +++ b/src/private/pvoidvector.h @@ -328,8 +328,8 @@ namespace etl void assign(TIterator first, TIterator last) { #if defined(ETL_DEBUG) - difference_type count = std::distance(first, last); - ETL_ASSERT(static_cast(count) <= CAPACITY, ETL_ERROR(vector_full)); + difference_type d = std::distance(first, last); + ETL_ASSERT(static_cast(d) <= CAPACITY, ETL_ERROR(vector_full)); #endif initialise(); diff --git a/src/private/vector_base.h b/src/private/vector_base.h index e874f443..732ec657 100644 --- a/src/private/vector_base.h +++ b/src/private/vector_base.h @@ -54,8 +54,8 @@ namespace etl { public: - vector_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + vector_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -68,8 +68,8 @@ namespace etl { public: - vector_full(string_type file_name, numeric_type line_number) - : vector_exception(ETL_ERROR_TEXT("vector:full", ETL_FILE"A"), file_name, line_number) + vector_full(string_type file_name_, numeric_type line_number_) + : vector_exception(ETL_ERROR_TEXT("vector:full", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -82,8 +82,8 @@ namespace etl { public: - vector_empty(string_type file_name, numeric_type line_number) - : vector_exception(ETL_ERROR_TEXT("vector:empty", ETL_FILE"B"), file_name, line_number) + vector_empty(string_type file_name_, numeric_type line_number_) + : vector_exception(ETL_ERROR_TEXT("vector:empty", ETL_FILE"B"), file_name_, line_number_) { } }; @@ -96,8 +96,8 @@ namespace etl { public: - vector_out_of_bounds(string_type file_name, numeric_type line_number) - : vector_exception(ETL_ERROR_TEXT("vector:bounds", ETL_FILE"C"), file_name, line_number) + vector_out_of_bounds(string_type file_name_, numeric_type line_number_) + : vector_exception(ETL_ERROR_TEXT("vector:bounds", ETL_FILE"C"), file_name_, line_number_) { } }; @@ -110,8 +110,8 @@ namespace etl { public: - vector_incompatible_type(string_type file_name, numeric_type line_number) - : vector_exception(ETL_ERROR_TEXT("vector:type", ETL_FILE"D"), file_name, line_number) + vector_incompatible_type(string_type file_name_, numeric_type line_number_) + : vector_exception(ETL_ERROR_TEXT("vector:type", ETL_FILE"D"), file_name_, line_number_) { } }; @@ -149,8 +149,8 @@ namespace etl //************************************************************************* /// Constructor. //************************************************************************* - vector_base(size_t max_size) - : CAPACITY(max_size) + vector_base(size_t max_size_) + : CAPACITY(max_size_) { } diff --git a/src/profiles/arduino_arm.h b/src/profiles/arduino_arm.h index d67d29c0..8de9d110 100644 --- a/src/profiles/arduino_arm.h +++ b/src/profiles/arduino_arm.h @@ -44,7 +44,7 @@ SOFTWARE. #define ETL_CPP14_SUPPORTED 0 #define ETL_NO_NULLPTR_SUPPORT 1 #define ETL_NO_LARGE_CHAR_SUPPORT 1 -#define ETL_C11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 0 +#define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 0 #define ETL_ATOMIC_SUPPORTED 0 #endif diff --git a/src/profiles/armv5.h b/src/profiles/armv5.h index 2066a11d..51e173fe 100644 --- a/src/profiles/armv5.h +++ b/src/profiles/armv5.h @@ -44,7 +44,7 @@ SOFTWARE. #define ETL_CPP14_SUPPORTED 0 #define ETL_NO_NULLPTR_SUPPORT 1 #define ETL_NO_LARGE_CHAR_SUPPORT 1 -#define ETL_C11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 0 +#define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 0 #define ETL_ATOMIC_SUPPORTED 0 #endif diff --git a/src/profiles/armv6.h b/src/profiles/armv6.h index 2128fdbf..cdd73213 100644 --- a/src/profiles/armv6.h +++ b/src/profiles/armv6.h @@ -44,7 +44,7 @@ SOFTWARE. #define ETL_CPP14_SUPPORTED 0 #define ETL_NO_NULLPTR_SUPPORT 0 #define ETL_NO_LARGE_CHAR_SUPPORT 0 -#define ETL_C11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 1 +#define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 1 #define ETL_ATOMIC_SUPPORTED 1 #endif diff --git a/src/profiles/cpp03.h b/src/profiles/cpp03.h index 2faff448..760f7984 100644 --- a/src/profiles/cpp03.h +++ b/src/profiles/cpp03.h @@ -44,7 +44,7 @@ SOFTWARE. #define ETL_CPP14_SUPPORTED 0 #define ETL_NO_NULLPTR_SUPPORT 1 #define ETL_NO_LARGE_CHAR_SUPPORT 1 -#define ETL_C11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 0 +#define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 0 #define ETL_ATOMIC_SUPPORTED 0 #endif diff --git a/src/profiles/cpp11.h b/src/profiles/cpp11.h index 38a42b39..072b2da7 100644 --- a/src/profiles/cpp11.h +++ b/src/profiles/cpp11.h @@ -44,7 +44,7 @@ SOFTWARE. #define ETL_CPP14_SUPPORTED 0 #define ETL_NO_NULLPTR_SUPPORT 0 #define ETL_NO_LARGE_CHAR_SUPPORT 0 -#define ETL_C11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 1 +#define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 1 #define ETL_ATOMIC_SUPPORTED 1 #endif diff --git a/src/profiles/cpp14.h b/src/profiles/cpp14.h index f967aa05..0062770d 100644 --- a/src/profiles/cpp14.h +++ b/src/profiles/cpp14.h @@ -44,7 +44,7 @@ SOFTWARE. #define ETL_CPP14_SUPPORTED 1 #define ETL_NO_NULLPTR_SUPPORT 0 #define ETL_NO_LARGE_CHAR_SUPPORT 0 -#define ETL_C11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 1 +#define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 1 #define ETL_ATOMIC_SUPPORTED 1 #endif diff --git a/src/profiles/gcc_generic.h b/src/profiles/gcc_generic.h index 5a11b7b2..c19609e6 100644 --- a/src/profiles/gcc_generic.h +++ b/src/profiles/gcc_generic.h @@ -40,11 +40,11 @@ SOFTWARE. #define ETL_TARGET_DEVICE_GENERIC #define ETL_TARGET_OS_NONE #define ETL_COMPILER_GCC -#define ETL_CPP11_SUPPORTED (__cplusplus >= 201103L) -#define ETL_CPP14_SUPPORTED (__cplusplus >= 201402L) -#define ETL_NO_NULLPTR_SUPPORT !ETL_CPP11_SUPPORTED -#define ETL_NO_LARGE_CHAR_SUPPORT !ETL_CPP11_SUPPORTED -#define ETL_C11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED ETL_CPP14_SUPPORTED -#define ETL_ATOMIC_SUPPORTED ETL_CPP11_SUPPORTED +#define ETL_CPP11_SUPPORTED (__cplusplus >= 201103L) +#define ETL_CPP14_SUPPORTED (__cplusplus >= 201402L) +#define ETL_NO_NULLPTR_SUPPORT !ETL_CPP11_SUPPORTED +#define ETL_NO_LARGE_CHAR_SUPPORT !ETL_CPP11_SUPPORTED +#define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED ETL_CPP14_SUPPORTED +#define ETL_ATOMIC_SUPPORTED ETL_CPP11_SUPPORTED #endif diff --git a/src/profiles/gcc_linux_x86.h b/src/profiles/gcc_linux_x86.h index d905a6ff..fd8af659 100644 --- a/src/profiles/gcc_linux_x86.h +++ b/src/profiles/gcc_linux_x86.h @@ -40,11 +40,11 @@ SOFTWARE. #define ETL_TARGET_DEVICE_X86 #define ETL_TARGET_OS_LINUX #define ETL_COMPILER_GCC -#define ETL_CPP11_SUPPORTED (__cplusplus >= 201103L) -#define ETL_CPP14_SUPPORTED (__cplusplus >= 201402L) -#define ETL_NO_NULLPTR_SUPPORT !ETL_CPP11_SUPPORTED -#define ETL_NO_LARGE_CHAR_SUPPORT !ETL_CPP11_SUPPORTED -#define ETL_C11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED ETL_CPP14_SUPPORTED -#define ETL_ATOMIC_SUPPORTED ETL_CPP11_SUPPORTED +#define ETL_CPP11_SUPPORTED (__cplusplus >= 201103L) +#define ETL_CPP14_SUPPORTED (__cplusplus >= 201402L) +#define ETL_NO_NULLPTR_SUPPORT !ETL_CPP11_SUPPORTED +#define ETL_NO_LARGE_CHAR_SUPPORT !ETL_CPP11_SUPPORTED +#define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED ETL_CPP14_SUPPORTED +#define ETL_ATOMIC_SUPPORTED ETL_CPP11_SUPPORTED #endif diff --git a/src/profiles/gcc_windows_x86.h b/src/profiles/gcc_windows_x86.h index c8dea2c0..d60fd198 100644 --- a/src/profiles/gcc_windows_x86.h +++ b/src/profiles/gcc_windows_x86.h @@ -40,11 +40,11 @@ SOFTWARE. #define ETL_TARGET_DEVICE_X86 #define ETL_TARGET_OS_WINDOWS #define ETL_COMPILER_GCC -#define ETL_CPP11_SUPPORTED (__cplusplus >= 201103L) -#define ETL_CPP14_SUPPORTED (__cplusplus >= 201402L) -#define ETL_NO_NULLPTR_SUPPORT !ETL_CPP11_SUPPORTED -#define ETL_NO_LARGE_CHAR_SUPPORT !ETL_CPP11_SUPPORTED -#define ETL_C11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED ETL_CPP14_SUPPORTED -#define ETL_ATOMIC_SUPPORTED ETL_CPP11_SUPPORTED +#define ETL_CPP11_SUPPORTED (__cplusplus >= 201103L) +#define ETL_CPP14_SUPPORTED (__cplusplus >= 201402L) +#define ETL_NO_NULLPTR_SUPPORT !ETL_CPP11_SUPPORTED +#define ETL_NO_LARGE_CHAR_SUPPORT !ETL_CPP11_SUPPORTED +#define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED ETL_CPP14_SUPPORTED +#define ETL_ATOMIC_SUPPORTED ETL_CPP11_SUPPORTED #endif diff --git a/src/profiles/msvc_x86.h b/src/profiles/msvc_x86.h index 803eead8..462f3a4c 100644 --- a/src/profiles/msvc_x86.h +++ b/src/profiles/msvc_x86.h @@ -40,11 +40,11 @@ SOFTWARE. #define ETL_TARGET_DEVICE_X86 #define ETL_TARGET_OS_WINDOWS #define ETL_COMPILER_MICROSOFT -#define ETL_CPP11_SUPPORTED (_MSC_VER >= 1600) -#define ETL_CPP14_SUPPORTED (_MSC_VER >= 1900) -#define ETL_NO_NULLPTR_SUPPORT !ETL_CPP11_SUPPORTED -#define ETL_NO_LARGE_CHAR_SUPPORT !ETL_CPP11_SUPPORTED -#define ETL_C11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED ETL_CPP14_SUPPORTED -#define ETL_ATOMIC_SUPPORTED ETL_CPP11_SUPPORTED +#define ETL_CPP11_SUPPORTED (_MSC_VER >= 1600) +#define ETL_CPP14_SUPPORTED (_MSC_VER >= 1900) +#define ETL_NO_NULLPTR_SUPPORT !ETL_CPP11_SUPPORTED +#define ETL_NO_LARGE_CHAR_SUPPORT !ETL_CPP11_SUPPORTED +#define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED ETL_CPP14_SUPPORTED +#define ETL_ATOMIC_SUPPORTED ETL_CPP11_SUPPORTED #endif diff --git a/src/profiles/ticc.h b/src/profiles/ticc.h index 4f4d3c90..d695546a 100644 --- a/src/profiles/ticc.h +++ b/src/profiles/ticc.h @@ -44,7 +44,7 @@ SOFTWARE. #define ETL_CPP14_SUPPORTED 0 #define ETL_NO_NULLPTR_SUPPORT 1 #define ETL_NO_LARGE_CHAR_SUPPORT 1 -#define ETL_C11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 0 +#define ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED 0 #define ETL_ATOMIC_SUPPORTED 0 #endif diff --git a/src/queue.h b/src/queue.h index 3ba4d0fa..75fc8ceb 100644 --- a/src/queue.h +++ b/src/queue.h @@ -64,8 +64,8 @@ namespace etl { public: - queue_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + queue_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -78,8 +78,8 @@ namespace etl { public: - queue_full(string_type file_name, numeric_type line_number) - : queue_exception(ETL_ERROR_TEXT("queue:full", ETL_FILE"A"), file_name, line_number) + queue_full(string_type file_name_, numeric_type line_number_) + : queue_exception(ETL_ERROR_TEXT("queue:full", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -92,8 +92,8 @@ namespace etl { public: - queue_empty(string_type file_name, numeric_type line_number) - : queue_exception(ETL_ERROR_TEXT("queue:empty", ETL_FILE"B"), file_name, line_number) + queue_empty(string_type file_name_, numeric_type line_number_) + : queue_exception(ETL_ERROR_TEXT("queue:empty", ETL_FILE"B"), file_name_, line_number_) { } }; @@ -156,11 +156,11 @@ namespace etl //************************************************************************* /// The constructor that is called from derived classes. //************************************************************************* - queue_base(size_type max_size) + queue_base(size_type max_size_) : in(0), out(0), current_size(0), - CAPACITY(max_size) + CAPACITY(max_size_) { } @@ -397,7 +397,7 @@ namespace etl } //************************************************************************* - /// Gets the oldest value and removes it from the front of the queue and + /// Gets the oldest value and removes it from the front of the queue and /// pushes it to the destination container. /// If asserts or exceptions are enabled, throws an etl::queue_empty if the queue is empty. /// NOTE: The destination must support a push(T) member function. @@ -408,7 +408,7 @@ namespace etl destination.push(front()); pop(); } - + //************************************************************************* /// Assignment operator. //************************************************************************* @@ -444,9 +444,9 @@ namespace etl //************************************************************************* /// The constructor that is called from derived classes. //************************************************************************* - iqueue(T* p_buffer, size_type max_size) - : queue_base(max_size), - p_buffer(p_buffer) + iqueue(T* p_buffer_, size_type max_size_) + : queue_base(max_size_), + p_buffer(p_buffer_) { } diff --git a/src/reference_flat_map.h b/src/reference_flat_map.h index 3c0c104c..fd98fc3e 100644 --- a/src/reference_flat_map.h +++ b/src/reference_flat_map.h @@ -63,8 +63,8 @@ namespace etl { public: - flat_map_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + flat_map_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -77,8 +77,8 @@ namespace etl { public: - flat_map_full(string_type file_name, numeric_type line_number) - : flat_map_exception(ETL_ERROR_TEXT("flat_map: full", ETL_FILE"A"), file_name, line_number) + flat_map_full(string_type file_name_, numeric_type line_number_) + : flat_map_exception(ETL_ERROR_TEXT("flat_map: full", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -91,8 +91,8 @@ namespace etl { public: - flat_map_out_of_bounds(string_type file_name, numeric_type line_number) - : flat_map_exception(ETL_ERROR_TEXT("flat_map:bounds", ETL_FILE"B"), file_name, line_number) + flat_map_out_of_bounds(string_type file_name_, numeric_type line_number_) + : flat_map_exception(ETL_ERROR_TEXT("flat_map:bounds", ETL_FILE"B"), file_name_, line_number_) { } }; @@ -135,8 +135,8 @@ namespace etl { } - iterator(typename lookup_t::iterator ilookup) - : ilookup(ilookup) + iterator(typename lookup_t::iterator ilookup_) + : ilookup(ilookup_) { } @@ -233,8 +233,8 @@ namespace etl { } - const_iterator(typename lookup_t::const_iterator ilookup) - : ilookup(ilookup) + const_iterator(typename lookup_t::const_iterator ilookup_) + : ilookup(ilookup_) { } @@ -525,8 +525,8 @@ namespace etl STATIC_ASSERT((etl::is_same::value_type>::value), "Incompatible data for assign"); #if defined(ETL_DEBUG) - difference_type count = std::distance(first, last); - ETL_ASSERT(count <= difference_type(capacity()), ETL_ERROR(flat_map_full)); + difference_type d = std::distance(first, last); + ETL_ASSERT(d <= difference_type(capacity()), ETL_ERROR(flat_map_full)); #endif clear(); diff --git a/src/reference_flat_multimap.h b/src/reference_flat_multimap.h index 5b78750b..5af87cc1 100644 --- a/src/reference_flat_multimap.h +++ b/src/reference_flat_multimap.h @@ -52,8 +52,8 @@ namespace etl { public: - flat_multimap_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + flat_multimap_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -66,8 +66,8 @@ namespace etl { public: - flat_multimap_full(string_type file_name, numeric_type line_number) - : flat_multimap_exception(ETL_ERROR_TEXT("flat_multimap:full", ETL_FILE"A"), file_name, line_number) + flat_multimap_full(string_type file_name_, numeric_type line_number_) + : flat_multimap_exception(ETL_ERROR_TEXT("flat_multimap:full", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -110,8 +110,8 @@ namespace etl { } - iterator(typename lookup_t::iterator ilookup) - : ilookup(ilookup) + iterator(typename lookup_t::iterator ilookup_) + : ilookup(ilookup_) { } @@ -208,8 +208,8 @@ namespace etl { } - const_iterator(typename lookup_t::const_iterator ilookup) - : ilookup(ilookup) + const_iterator(typename lookup_t::const_iterator ilookup_) + : ilookup(ilookup_) { } @@ -440,8 +440,8 @@ namespace etl void assign(TIterator first, TIterator last) { #if defined(ETL_DEBUG) - difference_type count = std::distance(first, last); - ETL_ASSERT(count <= difference_type(capacity()), ETL_ERROR(flat_multimap_full)); + difference_type d = std::distance(first, last); + ETL_ASSERT(d <= difference_type(capacity()), ETL_ERROR(flat_multimap_full)); #endif clear(); @@ -510,9 +510,9 @@ namespace etl } else { - size_t count = std::distance(range.first, range.second); + size_t d = std::distance(range.first, range.second); erase(range.first, range.second); - return count; + return d; } } diff --git a/src/reference_flat_multiset.h b/src/reference_flat_multiset.h index a7039c52..25e88d58 100644 --- a/src/reference_flat_multiset.h +++ b/src/reference_flat_multiset.h @@ -57,8 +57,8 @@ namespace etl { public: - flat_multiset_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + flat_multiset_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -71,8 +71,8 @@ namespace etl { public: - flat_multiset_full(string_type file_name, numeric_type line_number) - : flat_multiset_exception(ETL_ERROR_TEXT("flat_multiset:full", ETL_FILE"A"), file_name, line_number) + flat_multiset_full(string_type file_name_, numeric_type line_number_) + : flat_multiset_exception(ETL_ERROR_TEXT("flat_multiset:full", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -85,8 +85,8 @@ namespace etl { public: - flat_multiset_iterator(string_type file_name, numeric_type line_number) - : flat_multiset_exception(ETL_ERROR_TEXT("flat_multiset:iterator", ETL_FILE"C"), file_name, line_number) + flat_multiset_iterator(string_type file_name_, numeric_type line_number_) + : flat_multiset_exception(ETL_ERROR_TEXT("flat_multiset:iterator", ETL_FILE"C"), file_name_, line_number_) { } }; @@ -127,8 +127,8 @@ namespace etl { } - iterator(typename lookup_t::iterator ilookup) - : ilookup(ilookup) + iterator(typename lookup_t::iterator ilookup_) + : ilookup(ilookup_) { } @@ -225,8 +225,8 @@ namespace etl { } - const_iterator(typename lookup_t::const_iterator ilookup) - : ilookup(ilookup) + const_iterator(typename lookup_t::const_iterator ilookup_) + : ilookup(ilookup_) { } @@ -437,8 +437,8 @@ namespace etl void assign(TIterator first, TIterator last) { #if defined(ETL_DEBUG) - difference_type count = std::distance(first, last); - ETL_ASSERT(count <= difference_type(capacity()), ETL_ERROR(flat_multiset_full)); + difference_type d = std::distance(first, last); + ETL_ASSERT(d <= difference_type(capacity()), ETL_ERROR(flat_multiset_full)); #endif clear(); @@ -522,9 +522,9 @@ namespace etl } else { - size_t count = std::distance(range.first, range.second); + size_t d = std::distance(range.first, range.second); erase(range.first, range.second); - return count; + return d; } } diff --git a/src/reference_flat_set.h b/src/reference_flat_set.h index 983f1930..361f6036 100644 --- a/src/reference_flat_set.h +++ b/src/reference_flat_set.h @@ -57,8 +57,8 @@ namespace etl { public: - flat_set_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + flat_set_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -71,8 +71,8 @@ namespace etl { public: - flat_set_full(string_type file_name, numeric_type line_number) - : flat_set_exception(ETL_ERROR_TEXT("flat_set:full", ETL_FILE"A"), file_name, line_number) + flat_set_full(string_type file_name_, numeric_type line_number_) + : flat_set_exception(ETL_ERROR_TEXT("flat_set:full", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -85,8 +85,8 @@ namespace etl { public: - flat_set_iterator(string_type file_name, numeric_type line_number) - : flat_set_exception(ETL_ERROR_TEXT("flat_set:iterator", ETL_FILE"C"), file_name, line_number) + flat_set_iterator(string_type file_name_, numeric_type line_number_) + : flat_set_exception(ETL_ERROR_TEXT("flat_set:iterator", ETL_FILE"C"), file_name_, line_number_) { } }; @@ -127,8 +127,8 @@ namespace etl { } - iterator(typename lookup_t::iterator ilookup) - : ilookup(ilookup) + iterator(typename lookup_t::iterator ilookup_) + : ilookup(ilookup_) { } @@ -225,8 +225,8 @@ namespace etl { } - const_iterator(typename lookup_t::const_iterator ilookup) - : ilookup(ilookup) + const_iterator(typename lookup_t::const_iterator ilookup_) + : ilookup(ilookup_) { } @@ -437,8 +437,8 @@ namespace etl void assign(TIterator first, TIterator last) { #if defined(ETL_DEBUG) - difference_type count = std::distance(first, last); - ETL_ASSERT(count <= difference_type(capacity()), ETL_ERROR(flat_set_full)); + difference_type d = std::distance(first, last); + ETL_ASSERT(d <= difference_type(capacity()), ETL_ERROR(flat_set_full)); #endif clear(); diff --git a/src/scheduler.h b/src/scheduler.h index 473d15ac..3bbe8295 100644 --- a/src/scheduler.h +++ b/src/scheduler.h @@ -52,8 +52,8 @@ namespace etl { public: - scheduler_exception(string_type what, string_type file_name, numeric_type line_number) - : etl::exception(what, file_name, line_number) + scheduler_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : etl::exception(reason_, file_name_, line_number_) { } }; @@ -65,8 +65,8 @@ namespace etl { public: - scheduler_no_tasks_exception(string_type file_name, numeric_type line_number) - : etl::scheduler_exception(ETL_ERROR_TEXT("scheduler:no tasks", ETL_FILE"A"), file_name, line_number) + scheduler_no_tasks_exception(string_type file_name_, numeric_type line_number_) + : etl::scheduler_exception(ETL_ERROR_TEXT("scheduler:no tasks", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -78,8 +78,8 @@ namespace etl { public: - scheduler_null_task_exception(string_type file_name, numeric_type line_number) - : etl::scheduler_exception(ETL_ERROR_TEXT("scheduler:null task", ETL_FILE"B"), file_name, line_number) + scheduler_null_task_exception(string_type file_name_, numeric_type line_number_) + : etl::scheduler_exception(ETL_ERROR_TEXT("scheduler:null task", ETL_FILE"B"), file_name_, line_number_) { } }; @@ -91,8 +91,8 @@ namespace etl { public: - scheduler_too_many_tasks_exception(string_type file_name, numeric_type line_number) - : etl::scheduler_exception(ETL_ERROR_TEXT("scheduler:too many tasks", ETL_FILE"C"), file_name, line_number) + scheduler_too_many_tasks_exception(string_type file_name_, numeric_type line_number_) + : etl::scheduler_exception(ETL_ERROR_TEXT("scheduler:too many tasks", ETL_FILE"C"), file_name_, line_number_) { } }; diff --git a/src/set.h b/src/set.h index d3dfba25..27dc85f2 100644 --- a/src/set.h +++ b/src/set.h @@ -70,8 +70,8 @@ namespace etl { public: - set_exception(string_type what, string_type file_name, numeric_type line_number) - : etl::exception(what, file_name, line_number) + set_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : etl::exception(reason_, file_name_, line_number_) { } }; @@ -84,8 +84,8 @@ namespace etl { public: - set_full(string_type file_name, numeric_type line_number) - : etl::set_exception(ETL_ERROR_TEXT("set:full", ETL_FILE"A"), file_name, line_number) + set_full(string_type file_name_, numeric_type line_number_) + : etl::set_exception(ETL_ERROR_TEXT("set:full", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -98,8 +98,8 @@ namespace etl { public: - set_out_of_bounds(string_type file_name, numeric_type line_number) - : etl::set_exception(ETL_ERROR_TEXT("set:bounds", ETL_FILE"B"), file_name, line_number) + set_out_of_bounds(string_type file_name_, numeric_type line_number_) + : etl::set_exception(ETL_ERROR_TEXT("set:bounds", ETL_FILE"B"), file_name_, line_number_) { } }; @@ -112,8 +112,8 @@ namespace etl { public: - set_iterator(string_type file_name, numeric_type line_number) - : etl::set_exception(ETL_ERROR_TEXT("set:iterator problem", ETL_FILE"C"), file_name, line_number) + set_iterator(string_type file_name_, numeric_type line_number_) + : etl::set_exception(ETL_ERROR_TEXT("set:iterator problem", ETL_FILE"C"), file_name_, line_number_) { } }; @@ -220,9 +220,9 @@ namespace etl //************************************************************************* /// The constructor that is called from derived classes. //************************************************************************* - set_base(size_type max_size) + set_base(size_type max_size_) : current_size(0) - , CAPACITY(max_size) + , CAPACITY(max_size_) , root_node(nullptr) { @@ -486,8 +486,8 @@ namespace etl //************************************************************************* struct Data_Node : public Node { - explicit Data_Node(value_type value) - : value(value) + explicit Data_Node(value_type value_) + : value(value_) { } diff --git a/src/stack.h b/src/stack.h index 6be1692b..96bf282f 100644 --- a/src/stack.h +++ b/src/stack.h @@ -64,8 +64,8 @@ namespace etl { public: - stack_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + stack_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -78,8 +78,8 @@ namespace etl { public: - stack_full(string_type file_name, numeric_type line_number) - : stack_exception(ETL_ERROR_TEXT("stack:full", ETL_FILE"A"), file_name, line_number) + stack_full(string_type file_name_, numeric_type line_number_) + : stack_exception(ETL_ERROR_TEXT("stack:full", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -92,8 +92,8 @@ namespace etl { public: - stack_empty(string_type file_name, numeric_type line_number) - : stack_exception(ETL_ERROR_TEXT("stack:empty", ETL_FILE"B"), file_name, line_number) + stack_empty(string_type file_name_, numeric_type line_number_) + : stack_exception(ETL_ERROR_TEXT("stack:empty", ETL_FILE"B"), file_name_, line_number_) { } }; @@ -157,10 +157,10 @@ namespace etl //************************************************************************* /// The constructor that is called from derived classes. //************************************************************************* - stack_base(size_type max_size) + stack_base(size_type max_size_) : top_index(0), - current_size(0), - CAPACITY(max_size) + current_size(0), + CAPACITY(max_size_) { } @@ -362,7 +362,7 @@ namespace etl } //************************************************************************* - /// Removes the oldest item from the top of the stack and pushes it to the + /// Removes the oldest item from the top of the stack and pushes it to the /// destination container. /// NOTE: The destination must support a push(T) member function. //************************************************************************* @@ -413,9 +413,9 @@ namespace etl //************************************************************************* /// The constructor that is called from derived classes. //************************************************************************* - istack(T* p_buffer, size_type max_size) - : stack_base(max_size), - p_buffer(p_buffer) + istack(T* p_buffer_, size_type max_size_) + : stack_base(max_size_), + p_buffer(p_buffer_) { } diff --git a/src/task.h b/src/task.h index 0cd1f88e..693575fe 100644 --- a/src/task.h +++ b/src/task.h @@ -47,8 +47,8 @@ namespace etl { public: - task_exception(string_type what, string_type file_name, numeric_type line_number) - : etl::exception(what, file_name, line_number) + task_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : etl::exception(reason_, file_name_, line_number_) { } }; diff --git a/src/type_def.h b/src/type_def.h index 7d486960..69e89442 100644 --- a/src/type_def.h +++ b/src/type_def.h @@ -64,8 +64,8 @@ namespace etl } //********************************************************************* - explicit type_def(TValue value) - : value(value) + explicit type_def(TValue value_) + : value(value_) { } diff --git a/src/u16string.h b/src/u16string.h index 305ce09d..45e1ec93 100644 --- a/src/u16string.h +++ b/src/u16string.h @@ -83,16 +83,16 @@ namespace etl ///\param position The position of the first character. ///\param length The number of characters. Default = npos. //************************************************************************* - u16string(const etl::u16string& other, size_t position, size_t length = npos) + u16string(const etl::u16string& other, size_t position, size_t length_ = npos) : iu16string(reinterpret_cast(&buffer), MAX_SIZE) { ETL_ASSERT(position < other.size(), ETL_ERROR(string_out_of_bounds)); // Set the length to the exact amount. - length = (length > MAX_SIZE_) ? MAX_SIZE_ : length; + length_ = (length_ > MAX_SIZE_) ? MAX_SIZE_ : length_; iu16string::initialise(); - iu16string::assign(other.begin() + position, other.begin() + position + length); + iu16string::assign(other.begin() + position, other.begin() + position + length_); } //************************************************************************* @@ -148,7 +148,7 @@ namespace etl ///\param position The position of the first character. Default = 0. ///\param length The number of characters. Default = npos. //************************************************************************* - etl::u16string substr(size_t position = 0, size_t length = npos) const + etl::u16string substr(size_t position = 0, size_t length_ = npos) const { etl::u16string new_string; @@ -156,9 +156,9 @@ namespace etl { ETL_ASSERT(position < size(), ETL_ERROR(string_out_of_bounds)); - length = std::min(length, size() - position); + length_ = std::min(length_, size() - position); - new_string.assign(buffer + position, buffer + position + length); + new_string.assign(buffer + position, buffer + position + length_); } return new_string; diff --git a/src/u32string.h b/src/u32string.h index 3e5be881..2cf0ceac 100644 --- a/src/u32string.h +++ b/src/u32string.h @@ -83,16 +83,16 @@ namespace etl ///\param position The position of the first character. ///\param length The number of characters. Default = npos. //************************************************************************* - u32string(const etl::u32string& other, size_t position, size_t length = npos) + u32string(const etl::u32string& other, size_t position, size_t length_ = npos) : iu32string(reinterpret_cast(&buffer), MAX_SIZE) { ETL_ASSERT(position < other.size(), ETL_ERROR(string_out_of_bounds)); // Set the length to the exact amount. - length = (length > MAX_SIZE_) ? MAX_SIZE_ : length; + length_ = (length_ > MAX_SIZE_) ? MAX_SIZE_ : length_; iu32string::initialise(); - iu32string::assign(other.begin() + position, other.begin() + position + length); + iu32string::assign(other.begin() + position, other.begin() + position + length_); } //************************************************************************* @@ -148,7 +148,7 @@ namespace etl ///\param position The position of the first character. Default = 0. ///\param length The number of characters. Default = npos. //************************************************************************* - etl::u32string substr(size_t position = 0, size_t length = npos) const + etl::u32string substr(size_t position = 0, size_t length_ = npos) const { etl::u32string new_string; @@ -156,9 +156,9 @@ namespace etl { ETL_ASSERT(position < size(), ETL_ERROR(string_out_of_bounds)); - length = std::min(length, size() - position); + length_ = std::min(length_, size() - position); - new_string.assign(buffer + position, buffer + position + length); + new_string.assign(buffer + position, buffer + position + length_); } return new_string; diff --git a/src/unordered_map.h b/src/unordered_map.h index ce87fde4..c3c03329 100644 --- a/src/unordered_map.h +++ b/src/unordered_map.h @@ -71,8 +71,8 @@ namespace etl { public: - unordered_map_exception(string_type what, string_type file_name, numeric_type line_number) - : etl::exception(what, file_name, line_number) + unordered_map_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : etl::exception(reason_, file_name_, line_number_) { } }; @@ -85,8 +85,8 @@ namespace etl { public: - unordered_map_full(string_type file_name, numeric_type line_number) - : etl::unordered_map_exception(ETL_ERROR_TEXT("unordered_map:full", ETL_FILE"A"), file_name, line_number) + unordered_map_full(string_type file_name_, numeric_type line_number_) + : etl::unordered_map_exception(ETL_ERROR_TEXT("unordered_map:full", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -99,8 +99,8 @@ namespace etl { public: - unordered_map_out_of_range(string_type file_name, numeric_type line_number) - : etl::unordered_map_exception(ETL_ERROR_TEXT("unordered_map:range", ETL_FILE"B"), file_name, line_number) + unordered_map_out_of_range(string_type file_name_, numeric_type line_number_) + : etl::unordered_map_exception(ETL_ERROR_TEXT("unordered_map:range", ETL_FILE"B"), file_name_, line_number_) {} }; @@ -112,8 +112,8 @@ namespace etl { public: - unordered_map_iterator(string_type file_name, numeric_type line_number) - : etl::unordered_map_exception(ETL_ERROR_TEXT("unordered_map:iterator", ETL_FILE"C"), file_name, line_number) + unordered_map_iterator(string_type file_name_, numeric_type line_number_) + : etl::unordered_map_exception(ETL_ERROR_TEXT("unordered_map:iterator", ETL_FILE"C"), file_name_, line_number_) { } }; @@ -148,8 +148,8 @@ namespace etl // The nodes that store the elements. struct node_t : public link_t { - node_t(const value_type& key_value_pair) - : key_value_pair(key_value_pair) + node_t(const value_type& key_value_pair_) + : key_value_pair(key_value_pair_) { } @@ -291,10 +291,10 @@ namespace etl private: //********************************* - iterator(bucket_t* pbuckets_end, bucket_t* pbucket, local_iterator inode) - : pbuckets_end(pbuckets_end), - pbucket(pbucket), - inode(inode) + iterator(bucket_t* pbuckets_end_, bucket_t* pbucket_, local_iterator inode_) + : pbuckets_end(pbuckets_end_), + pbucket(pbucket_), + inode(inode_) { } @@ -354,16 +354,16 @@ namespace etl //********************************* const_iterator(const typename iunordered_map::iterator& other) : pbuckets_end(other.pbuckets_end), - pbucket(other.pbucket), - inode(other.inode) + pbucket(other.pbucket), + inode(other.inode) { } //********************************* const_iterator(const const_iterator& other) : pbuckets_end(other.pbuckets_end), - pbucket(other.pbucket), - inode(other.inode) + pbucket(other.pbucket), + inode(other.inode) { } @@ -442,10 +442,10 @@ namespace etl private: //********************************* - const_iterator(bucket_t* pbuckets_end, bucket_t* pbucket, local_iterator inode) - : pbuckets_end(pbuckets_end), - pbucket(pbucket), - inode(inode) + const_iterator(bucket_t* pbuckets_end_, bucket_t* pbucket_, local_iterator inode_) + : pbuckets_end(pbuckets_end_), + pbucket(pbucket_), + inode(inode_) { } @@ -592,7 +592,7 @@ namespace etl /// Returns the bucket index for the key. ///\return The bucket index for the key. //********************************************************************* - size_type bucket(key_parameter_t key) const + size_type get_bucket_index(key_parameter_t key) const { return key_hash_function(key) % number_of_buckets; } @@ -634,7 +634,7 @@ namespace etl mapped_type& operator [](key_parameter_t key) { // Find the bucket. - bucket_t* pbucket = pbuckets + bucket(key); + bucket_t* pbucket = pbuckets + get_bucket_index(key); // Find the first node in the bucket. local_iterator inode = pbucket->begin(); @@ -674,7 +674,7 @@ namespace etl mapped_type& at(key_parameter_t key) { // Find the bucket. - bucket_t* pbucket = pbuckets + bucket(key); + bucket_t* pbucket = pbuckets + get_bucket_index(key); // Find the first node in the bucket. local_iterator inode = pbucket->begin(); @@ -709,7 +709,7 @@ namespace etl const mapped_type& at(key_parameter_t key) const { // Find the bucket. - bucket_t* pbucket = pbuckets + bucket(key); + bucket_t* pbucket = pbuckets + get_bucket_index(key); // Find the first node in the bucket. local_iterator inode = pbucket->begin(); @@ -743,19 +743,19 @@ namespace etl ///\param last The iterator to the last element + 1. //********************************************************************* template - void assign(TIterator first, TIterator last) + void assign(TIterator first_, TIterator last_) { #if defined(ETL_DEBUG) - difference_type count = std::distance(first, last); - ETL_ASSERT(count >= 0, ETL_ERROR(unordered_map_iterator)); - ETL_ASSERT(size_t(count) <= max_size(), ETL_ERROR(unordered_map_full)); + difference_type d = std::distance(first_, last_); + ETL_ASSERT(d >= 0, ETL_ERROR(unordered_map_iterator)); + ETL_ASSERT(size_t(d) <= max_size(), ETL_ERROR(unordered_map_full)); #endif clear(); - while (first != last) + while (first_ != last_) { - insert(*first++); + insert(*first_++); } } @@ -774,7 +774,7 @@ namespace etl const mapped_type& mapped = key_value_pair.second; // Get the hash index. - size_t index = bucket(key); + size_t index = get_bucket_index(key); // Get the bucket & bucket iterator. bucket_t* pbucket = pbuckets + index; @@ -855,11 +855,11 @@ namespace etl ///\param last The last + 1 element to add. //********************************************************************* template - void insert(TIterator first, TIterator last) + void insert(TIterator first_, TIterator last_) { - while (first != last) + while (first_ != last_) { - insert(*first++); + insert(*first_++); } } @@ -870,8 +870,8 @@ namespace etl //********************************************************************* size_t erase(key_parameter_t key) { - size_t count = 0; - size_t index = bucket(key); + size_t n = 0; + size_t index = get_bucket_index(key); bucket_t& bucket = pbuckets[index]; @@ -891,11 +891,11 @@ namespace etl bucket.erase_after(iprevious); // Unlink from the bucket. icurrent->key_value_pair.~value_type(); // Destroy the value. pnodepool->release(&*icurrent); // Release it back to the pool. - count = 1; + n = 1; --construct_count; } - return count; + return n; } //********************************************************************* @@ -933,18 +933,18 @@ namespace etl ///\param first Iterator to the first element. ///\param last Iterator to the last element. //********************************************************************* - iterator erase(const_iterator first, const_iterator last) + iterator erase(const_iterator first_, const_iterator last_) { // Make a note of the last. - iterator result((pbuckets + number_of_buckets), last.get_bucket_list_iterator(), last.get_local_iterator()); + iterator result((pbuckets + number_of_buckets), last_.get_bucket_list_iterator(), last_.get_local_iterator()); // Get the starting point. - bucket_t* pbucket = first.get_bucket_list_iterator(); + bucket_t* pbucket = first_.get_bucket_list_iterator(); local_iterator iprevious = pbucket->before_begin(); - local_iterator icurrent = first.get_local_iterator(); - local_iterator iend = last.get_local_iterator(); // Note: May not be in the same bucket as icurrent. + local_iterator icurrent = first_.get_local_iterator(); + local_iterator iend = last_.get_local_iterator(); // Note: May not be in the same bucket as icurrent. - // Find the node previous to the first one. + // Find the node previous to the first one. while (iprevious->etl_next != &*icurrent) { ++iprevious; @@ -1006,7 +1006,7 @@ namespace etl //********************************************************************* iterator find(key_parameter_t key) { - size_t index = bucket(key); + size_t index = get_bucket_index(key); bucket_t* pbucket = pbuckets + index; bucket_t& bucket = *pbucket; @@ -1040,7 +1040,7 @@ namespace etl //********************************************************************* const_iterator find(key_parameter_t key) const { - size_t index = bucket(key); + size_t index = get_bucket_index(key); bucket_t* pbucket = pbuckets + index; bucket_t& bucket = *pbucket; @@ -1077,15 +1077,15 @@ namespace etl //********************************************************************* std::pair equal_range(key_parameter_t key) { - iterator first = find(key); - iterator last = first; + iterator f = find(key); + iterator l = f; - if (last != end()) + if (l != end()) { - ++last; + ++l; } - return std::pair(first, last); + return std::pair(f, l); } //********************************************************************* @@ -1098,15 +1098,15 @@ namespace etl //********************************************************************* std::pair equal_range(key_parameter_t key) const { - const_iterator first = find(key); - const_iterator last = first; + const_iterator f = find(key); + const_iterator l = f; - if (last != end()) + if (l != end()) { - ++last; + ++l; } - return std::pair(first, last); + return std::pair(f, l); } //************************************************************************* @@ -1196,10 +1196,10 @@ namespace etl //********************************************************************* /// Constructor. //********************************************************************* - iunordered_map(pool_t& node_pool, bucket_t* pbuckets_, size_t number_of_buckets) - : pnodepool(&node_pool), + iunordered_map(pool_t& node_pool_, bucket_t* pbuckets_, size_t number_of_buckets_) + : pnodepool(&node_pool_), pbuckets(pbuckets_), - number_of_buckets(number_of_buckets) + number_of_buckets(number_of_buckets_) { } @@ -1351,10 +1351,10 @@ namespace etl ///\param last The iterator to the last element + 1. //************************************************************************* template - unordered_map(TIterator first, TIterator last) + unordered_map(TIterator first_, TIterator last_) : base(node_pool, buckets, MAX_BUCKETS_) { - base::assign(first, last); + base::assign(first_, last_); } //************************************************************************* diff --git a/src/unordered_multimap.h b/src/unordered_multimap.h index 4e676744..4c2bfe74 100644 --- a/src/unordered_multimap.h +++ b/src/unordered_multimap.h @@ -71,8 +71,8 @@ namespace etl { public: - unordered_multimap_exception(string_type what, string_type file_name, numeric_type line_number) - : etl::exception(what, file_name, line_number) + unordered_multimap_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : etl::exception(reason_, file_name_, line_number_) { } }; @@ -85,8 +85,8 @@ namespace etl { public: - unordered_multimap_full(string_type file_name, numeric_type line_number) - : etl::unordered_multimap_exception(ETL_ERROR_TEXT("unordered_multimap:full", ETL_FILE"A"), file_name, line_number) + unordered_multimap_full(string_type file_name_, numeric_type line_number_) + : etl::unordered_multimap_exception(ETL_ERROR_TEXT("unordered_multimap:full", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -99,8 +99,8 @@ namespace etl { public: - unordered_multimap_out_of_range(string_type file_name, numeric_type line_number) - : etl::unordered_multimap_exception(ETL_ERROR_TEXT("unordered_multimap:range", ETL_FILE"B"), file_name, line_number) + unordered_multimap_out_of_range(string_type file_name_, numeric_type line_number_) + : etl::unordered_multimap_exception(ETL_ERROR_TEXT("unordered_multimap:range", ETL_FILE"B"), file_name_, line_number_) {} }; @@ -112,8 +112,8 @@ namespace etl { public: - unordered_multimap_iterator(string_type file_name, numeric_type line_number) - : etl::unordered_multimap_exception(ETL_ERROR_TEXT("unordered_multimap:iterator", ETL_FILE"C"), file_name, line_number) + unordered_multimap_iterator(string_type file_name_, numeric_type line_number_) + : etl::unordered_multimap_exception(ETL_ERROR_TEXT("unordered_multimap:iterator", ETL_FILE"C"), file_name_, line_number_) { } }; @@ -147,8 +147,8 @@ namespace etl struct node_t : public link_t // The nodes that store the elements. { - node_t(const value_type& key_value_pair) - : key_value_pair(key_value_pair) + node_t(const value_type& key_value_pair_) + : key_value_pair(key_value_pair_) { } @@ -290,10 +290,10 @@ namespace etl private: //********************************* - iterator(bucket_t* pbuckets_end, bucket_t* pbucket, local_iterator inode) - : pbuckets_end(pbuckets_end), - pbucket(pbucket), - inode(inode) + iterator(bucket_t* pbuckets_end_, bucket_t* pbucket_, local_iterator inode_) + : pbuckets_end(pbuckets_end_), + pbucket(pbucket_), + inode(inode_) { } @@ -442,10 +442,10 @@ namespace etl private: //********************************* - const_iterator(bucket_t* pbuckets_end, bucket_t* pbucket, local_iterator inode) - : pbuckets_end(pbuckets_end), - pbucket(pbucket), - inode(inode) + const_iterator(bucket_t* pbuckets_end_, bucket_t* pbucket_, local_iterator inode_) + : pbuckets_end(pbuckets_end_), + pbucket(pbucket_), + inode(inode_) { } @@ -592,7 +592,7 @@ namespace etl /// Returns the bucket index for the key. ///\return The bucket index for the key. //********************************************************************* - size_type bucket(key_parameter_t key) const + size_type get_bucket_index(key_parameter_t key) const { return key_hash_function(key) % number_of_buckets; } @@ -634,19 +634,19 @@ namespace etl ///\param last The iterator to the last element + 1. //********************************************************************* template - void assign(TIterator first, TIterator last) + void assign(TIterator first_, TIterator last_) { #if defined(ETL_DEBUG) - difference_type count = std::distance(first, last); - ETL_ASSERT(count >= 0, ETL_ERROR(unordered_multimap_iterator)); - ETL_ASSERT(size_t(count) <= max_size(), ETL_ERROR(unordered_multimap_full)); + difference_type d = std::distance(first_, last_); + ETL_ASSERT(d >= 0, ETL_ERROR(unordered_multimap_iterator)); + ETL_ASSERT(size_t(d) <= max_size(), ETL_ERROR(unordered_multimap_full)); #endif clear(); - while (first != last) + while (first_ != last_) { - insert(*first++); + insert(*first_++); } } @@ -665,7 +665,7 @@ namespace etl const mapped_type& mapped = key_value_pair.second; // Get the hash index. - size_t index = bucket(key); + size_t index = get_bucket_index(key); // Get the bucket & bucket iterator. bucket_t* pbucket = pbuckets + index; @@ -738,11 +738,11 @@ namespace etl ///\param last The last + 1 element to add. //********************************************************************* template - void insert(TIterator first, TIterator last) + void insert(TIterator first_, TIterator last_) { - while (first != last) + while (first_ != last_) { - insert(*first++); + insert(*first_++); } } @@ -753,8 +753,8 @@ namespace etl //********************************************************************* size_t erase(key_parameter_t key) { - size_t count = 0; - size_t bucket_id = bucket(key); + size_t n = 0; + size_t bucket_id = get_bucket_index(key); bucket_t& bucket = pbuckets[bucket_id]; @@ -768,7 +768,7 @@ namespace etl bucket.erase_after(iprevious); // Unlink from the bucket. icurrent->key_value_pair.~value_type(); // Destroy the value. pnodepool->release(&*icurrent); // Release it back to the pool. - ++count; + ++n; icurrent = iprevious; --construct_count; } @@ -780,7 +780,7 @@ namespace etl ++icurrent; } - return count; + return n; } //********************************************************************* @@ -818,16 +818,16 @@ namespace etl ///\param first Iterator to the first element. ///\param last Iterator to the last element. //********************************************************************* - iterator erase(const_iterator first, const_iterator last) + iterator erase(const_iterator first_, const_iterator last_) { // Make a note of the last. - iterator result((pbuckets + number_of_buckets), last.get_bucket_list_iterator(), last.get_local_iterator()); + iterator result((pbuckets + number_of_buckets), last_.get_bucket_list_iterator(), last_.get_local_iterator()); // Get the starting point. - bucket_t* pbucket = first.get_bucket_list_iterator(); + bucket_t* pbucket = first_.get_bucket_list_iterator(); local_iterator iprevious = pbucket->before_begin(); - local_iterator icurrent = first.get_local_iterator(); - local_iterator iend = last.get_local_iterator(); // Note: May not be in the same bucket as icurrent. + local_iterator icurrent = first_.get_local_iterator(); + local_iterator iend = last_.get_local_iterator(); // Note: May not be in the same bucket as icurrent. // Find the node previous to the first one. while (iprevious->etl_next != &*icurrent) @@ -882,17 +882,17 @@ namespace etl size_t count(key_parameter_t key) const { size_t n = 0; - const_iterator first = find(key); - const_iterator last = first; + const_iterator f = find(key); + const_iterator l = f; - if (last != end()) + if (l != end()) { - ++last; + ++l; ++n; - while ((last != end()) && (key == last->first)) + while ((l != end()) && (key == l->first)) { - ++last; + ++l; ++n; } } @@ -907,7 +907,7 @@ namespace etl //********************************************************************* iterator find(key_parameter_t key) { - size_t index = bucket(key); + size_t index = get_bucket_index(key); bucket_t* pbucket = pbuckets + index; bucket_t& bucket = *pbucket; @@ -941,7 +941,7 @@ namespace etl //********************************************************************* const_iterator find(key_parameter_t key) const { - size_t index = bucket(key); + size_t index = get_bucket_index(key); bucket_t* pbucket = pbuckets + index; bucket_t& bucket = *pbucket; @@ -978,20 +978,20 @@ namespace etl //********************************************************************* std::pair equal_range(key_parameter_t key) { - iterator first = find(key); - iterator last = first; + iterator f = find(key); + iterator l = f; - if (last != end()) + if (l != end()) { - ++last; + ++l; - while ((last != end()) && (key == last->first)) + while ((l != end()) && (key == l->first)) { - ++last; + ++l; } } - return std::pair(first, last); + return std::pair(f, l); } //********************************************************************* @@ -1004,20 +1004,20 @@ namespace etl //********************************************************************* std::pair equal_range(key_parameter_t key) const { - const_iterator first = find(key); - const_iterator last = first; + const_iterator f = find(key); + const_iterator l = f; - if (last != end()) + if (l != end()) { - ++last; + ++l; - while ((last != end()) && (key == last->first)) + while ((l != end()) && (key == l->first)) { - ++last; + ++l; } } - return std::pair(first, last); + return std::pair(f, l); } //************************************************************************* @@ -1107,10 +1107,10 @@ namespace etl //********************************************************************* /// Constructor. //********************************************************************* - iunordered_multimap(pool_t& node_pool, bucket_t* pbuckets_, size_t number_of_buckets) - : pnodepool(&node_pool), - pbuckets(pbuckets_), - number_of_buckets(number_of_buckets) + iunordered_multimap(pool_t& node_pool_, bucket_t* pbuckets_, size_t number_of_buckets_) + : pnodepool(&node_pool_), + pbuckets(pbuckets_), + number_of_buckets(number_of_buckets_) { } @@ -1261,10 +1261,10 @@ namespace etl ///\param last The iterator to the last element + 1. //************************************************************************* template - unordered_multimap(TIterator first, TIterator last) + unordered_multimap(TIterator first_, TIterator last_) : base(node_pool, buckets, MAX_BUCKETS) { - base::assign(first, last); + base::assign(first_, last_); } //************************************************************************* diff --git a/src/unordered_multiset.h b/src/unordered_multiset.h index f627a648..405fe9f6 100644 --- a/src/unordered_multiset.h +++ b/src/unordered_multiset.h @@ -70,8 +70,8 @@ namespace etl { public: - unordered_multiset_exception(string_type what, string_type file_name, numeric_type line_number) - : etl::exception(what, file_name, line_number) + unordered_multiset_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : etl::exception(reason_, file_name_, line_number_) { } }; @@ -84,8 +84,8 @@ namespace etl { public: - unordered_multiset_full(string_type file_name, numeric_type line_number) - : etl::unordered_multiset_exception(ETL_ERROR_TEXT("unordered_multiset:full", ETL_FILE"A"), file_name, line_number) + unordered_multiset_full(string_type file_name_, numeric_type line_number_) + : etl::unordered_multiset_exception(ETL_ERROR_TEXT("unordered_multiset:full", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -98,8 +98,8 @@ namespace etl { public: - unordered_multiset_out_of_range(string_type file_name, numeric_type line_number) - : etl::unordered_multiset_exception(ETL_ERROR_TEXT("unordered_multiset:range", ETL_FILE"B"), file_name, line_number) + unordered_multiset_out_of_range(string_type file_name_, numeric_type line_number_) + : etl::unordered_multiset_exception(ETL_ERROR_TEXT("unordered_multiset:range", ETL_FILE"B"), file_name_, line_number_) {} }; @@ -111,8 +111,8 @@ namespace etl { public: - unordered_multiset_iterator(string_type file_name, numeric_type line_number) - : etl::unordered_multiset_exception(ETL_ERROR_TEXT("unordered_multiset:iterator", ETL_FILE"C"), file_name, line_number) + unordered_multiset_iterator(string_type file_name_, numeric_type line_number_) + : etl::unordered_multiset_exception(ETL_ERROR_TEXT("unordered_multiset:iterator", ETL_FILE"C"), file_name_, line_number_) { } }; @@ -144,8 +144,8 @@ namespace etl // The nodes that store the elements. struct node_t : public link_t { - node_t(const value_type& key) - : key(key) + node_t(const value_type& key_) + : key(key_) { } @@ -286,10 +286,10 @@ namespace etl private: //********************************* - iterator(bucket_t* pbuckets_end, bucket_t* pbucket, local_iterator inode) - : pbuckets_end(pbuckets_end), - pbucket(pbucket), - inode(inode) + iterator(bucket_t* pbuckets_end_, bucket_t* pbucket_, local_iterator inode_) + : pbuckets_end(pbuckets_end_), + pbucket(pbucket_), + inode(inode_) { } @@ -437,10 +437,10 @@ namespace etl private: //********************************* - const_iterator(bucket_t* pbuckets_end, bucket_t* pbucket, local_iterator inode) - : pbuckets_end(pbuckets_end), - pbucket(pbucket), - inode(inode) + const_iterator(bucket_t* pbuckets_end_, bucket_t* pbucket_, local_iterator inode_) + : pbuckets_end(pbuckets_end_), + pbucket(pbucket_), + inode(inode_) { } @@ -587,7 +587,7 @@ namespace etl /// Returns the bucket index for the key. ///\return The bucket index for the key. //********************************************************************* - size_type bucket(key_parameter_t key) const + size_type get_bucket_index(key_parameter_t key) const { return key_hash_function(key) % number_of_buckets; } @@ -629,19 +629,19 @@ namespace etl ///\param last The iterator to the last element + 1. //********************************************************************* template - void assign(TIterator first, TIterator last) + void assign(TIterator first_, TIterator last_) { #if defined(ETL_DEBUG) - difference_type count = std::distance(first, last); - ETL_ASSERT(count >= 0, ETL_ERROR(unordered_multiset_iterator)); - ETL_ASSERT(size_t(count) <= max_size(), ETL_ERROR(unordered_multiset_full)); + difference_type d = std::distance(first_, last_); + ETL_ASSERT(d >= 0, ETL_ERROR(unordered_multiset_iterator)); + ETL_ASSERT(size_t(d) <= max_size(), ETL_ERROR(unordered_multiset_full)); #endif clear(); - while (first != last) + while (first_ != last_) { - insert(*first++); + insert(*first_++); } } @@ -657,7 +657,7 @@ namespace etl ETL_ASSERT(!full(), ETL_ERROR(unordered_multiset_full)); // Get the hash index. - size_t index = bucket(key); + size_t index = get_bucket_index(key); // Get the bucket & bucket iterator. bucket_t* pbucket = pbuckets + index; @@ -732,11 +732,11 @@ namespace etl ///\param last The last + 1 element to add. //********************************************************************* template - void insert(TIterator first, TIterator last) + void insert(TIterator first_, TIterator last_) { - while (first != last) + while (first_ != last_) { - insert(*first++); + insert(*first_++); } } @@ -747,8 +747,8 @@ namespace etl //********************************************************************* size_t erase(key_parameter_t key) { - size_t count = 0; - size_t bucket_id = bucket(key); + size_t n = 0; + size_t bucket_id = get_bucket_index(key); bucket_t& bucket = pbuckets[bucket_id]; @@ -762,7 +762,7 @@ namespace etl bucket.erase_after(iprevious); // Unlink from the bucket. icurrent->key.~value_type(); // Destroy the value. pnodepool->release(&*icurrent); // Release it back to the pool. - ++count; + ++n; icurrent = iprevious; --construct_count; } @@ -774,7 +774,7 @@ namespace etl ++icurrent; } - return count; + return n; } //********************************************************************* @@ -812,16 +812,16 @@ namespace etl ///\param first Iterator to the first element. ///\param last Iterator to the last element. //********************************************************************* - iterator erase(const_iterator first, const_iterator last) + iterator erase(const_iterator first_, const_iterator last_) { // Make a note of the last. - iterator result((pbuckets + number_of_buckets), last.get_bucket_list_iterator(), last.get_local_iterator()); + iterator result((pbuckets + number_of_buckets), last_.get_bucket_list_iterator(), last_.get_local_iterator()); // Get the starting point. - bucket_t* pbucket = first.get_bucket_list_iterator(); + bucket_t* pbucket = first_.get_bucket_list_iterator(); local_iterator iprevious = pbucket->before_begin(); - local_iterator icurrent = first.get_local_iterator(); - local_iterator iend = last.get_local_iterator(); // Note: May not be in the same bucket as icurrent. + local_iterator icurrent = first_.get_local_iterator(); + local_iterator iend = last_.get_local_iterator(); // Note: May not be in the same bucket as icurrent. // Find the node previous to the first one. while (iprevious->etl_next != &*icurrent) @@ -876,17 +876,17 @@ namespace etl size_t count(key_parameter_t key) const { size_t n = 0; - const_iterator first = find(key); - const_iterator last = first; + const_iterator f = find(key); + const_iterator l = f; - if (last != end()) + if (l != end()) { - ++last; + ++l; ++n; - while ((last != end()) && (key == *last)) + while ((l != end()) && (key == *l)) { - ++last; + ++l; ++n; } } @@ -901,7 +901,7 @@ namespace etl //********************************************************************* iterator find(key_parameter_t key) { - size_t index = bucket(key); + size_t index = get_bucket_index(key); bucket_t* pbucket = pbuckets + index; bucket_t& bucket = *pbucket; @@ -935,7 +935,7 @@ namespace etl //********************************************************************* const_iterator find(key_parameter_t key) const { - size_t index = bucket(key); + size_t index = get_bucket_index(key); bucket_t* pbucket = pbuckets + index; bucket_t& bucket = *pbucket; @@ -972,20 +972,20 @@ namespace etl //********************************************************************* std::pair equal_range(key_parameter_t key) { - iterator first = find(key); - iterator last = first; + iterator f = find(key); + iterator l = f; - if (last != end()) + if (l != end()) { - ++last; + ++l; - while ((last != end()) && (key == *last)) + while ((l != end()) && (key == *l)) { - ++last; + ++l; } } - return std::pair(first, last); + return std::pair(f, l); } //********************************************************************* @@ -998,20 +998,20 @@ namespace etl //********************************************************************* std::pair equal_range(key_parameter_t key) const { - const_iterator first = find(key); - const_iterator last = first; + const_iterator f = find(key); + const_iterator l = f; - if (last != end()) + if (l != end()) { - ++last; + ++l; - while ((last != end()) && (key == *last)) + while ((l != end()) && (key == *l)) { - ++last; + ++l; } } - return std::pair(first, last); + return std::pair(f, l); } //************************************************************************* @@ -1101,10 +1101,10 @@ namespace etl //********************************************************************* /// Constructor. //********************************************************************* - iunordered_multiset(pool_t& node_pool, bucket_t* pbuckets_, size_t number_of_buckets) - : pnodepool(&node_pool), - pbuckets(pbuckets_), - number_of_buckets(number_of_buckets) + iunordered_multiset(pool_t& node_pool_, bucket_t* pbuckets_, size_t number_of_buckets_) + : pnodepool(&node_pool_), + pbuckets(pbuckets_), + number_of_buckets(number_of_buckets_) { } @@ -1256,10 +1256,10 @@ namespace etl ///\param last The iterator to the last element + 1. //************************************************************************* template - unordered_multiset(TIterator first, TIterator last) + unordered_multiset(TIterator first_, TIterator last_) : base(node_pool, buckets, MAX_BUCKETS) { - base::assign(first, last); + base::assign(first_, last_); } //************************************************************************* diff --git a/src/unordered_set.h b/src/unordered_set.h index a20b9168..68bb968d 100644 --- a/src/unordered_set.h +++ b/src/unordered_set.h @@ -71,8 +71,8 @@ namespace etl { public: - unordered_set_exception(string_type what, string_type file_name, numeric_type line_number) - : etl::exception(what, file_name, line_number) + unordered_set_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : etl::exception(reason_, file_name_, line_number_) { } }; @@ -85,8 +85,8 @@ namespace etl { public: - unordered_set_full(string_type file_name, numeric_type line_number) - : etl::unordered_set_exception(ETL_ERROR_TEXT("unordered_set:full", ETL_FILE"A"), file_name, line_number) + unordered_set_full(string_type file_name_, numeric_type line_number_) + : etl::unordered_set_exception(ETL_ERROR_TEXT("unordered_set:full", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -99,8 +99,8 @@ namespace etl { public: - unordered_set_out_of_range(string_type file_name, numeric_type line_number) - : etl::unordered_set_exception(ETL_ERROR_TEXT("unordered_set:range", ETL_FILE"B"), file_name, line_number) + unordered_set_out_of_range(string_type file_name_, numeric_type line_number_) + : etl::unordered_set_exception(ETL_ERROR_TEXT("unordered_set:range", ETL_FILE"B"), file_name_, line_number_) {} }; @@ -112,8 +112,8 @@ namespace etl { public: - unordered_set_iterator(string_type file_name, numeric_type line_number) - : etl::unordered_set_exception(ETL_ERROR_TEXT("unordered_set:iterator", ETL_FILE"C"), file_name, line_number) + unordered_set_iterator(string_type file_name_, numeric_type line_number_) + : etl::unordered_set_exception(ETL_ERROR_TEXT("unordered_set:iterator", ETL_FILE"C"), file_name_, line_number_) { } }; @@ -145,8 +145,8 @@ namespace etl // The nodes that store the elements. struct node_t : public link_t { - node_t(const value_type& key) - : key(key) + node_t(const value_type& key_) + : key(key_) { } @@ -287,10 +287,10 @@ namespace etl private: //********************************* - iterator(bucket_t* pbuckets_end, bucket_t* pbucket, local_iterator inode) - : pbuckets_end(pbuckets_end), - pbucket(pbucket), - inode(inode) + iterator(bucket_t* pbuckets_end_, bucket_t* pbucket_, local_iterator inode_) + : pbuckets_end(pbuckets_end_), + pbucket(pbucket_), + inode(inode_) { } @@ -438,10 +438,10 @@ namespace etl private: //********************************* - const_iterator(bucket_t* pbuckets_end, bucket_t* pbucket, local_iterator inode) - : pbuckets_end(pbuckets_end), - pbucket(pbucket), - inode(inode) + const_iterator(bucket_t* pbuckets_end_, bucket_t* pbucket_, local_iterator inode_) + : pbuckets_end(pbuckets_end_), + pbucket(pbucket_), + inode(inode_) { } @@ -588,7 +588,7 @@ namespace etl /// Returns the bucket index for the key. ///\return The bucket index for the key. //********************************************************************* - size_type bucket(key_parameter_t key) const + size_type get_bucket_index(key_parameter_t key) const { return key_hash_function(key) % number_of_buckets; } @@ -630,19 +630,19 @@ namespace etl ///\param last The iterator to the last element + 1. //********************************************************************* template - void assign(TIterator first, TIterator last) + void assign(TIterator first_, TIterator last_) { #if defined(ETL_DEBUG) - difference_type count = std::distance(first, last); - ETL_ASSERT(count >= 0, ETL_ERROR(unordered_set_iterator)); - ETL_ASSERT(size_t(count) <= max_size(), ETL_ERROR(unordered_set_full)); + difference_type d = std::distance(first_, last_); + ETL_ASSERT(d >= 0, ETL_ERROR(unordered_set_iterator)); + ETL_ASSERT(size_t(d) <= max_size(), ETL_ERROR(unordered_set_full)); #endif clear(); - while (first != last) + while (first_ != last_) { - insert(*first++); + insert(*first_++); } } @@ -658,7 +658,7 @@ namespace etl ETL_ASSERT(!full(), ETL_ERROR(unordered_set_full)); // Get the hash index. - size_t index = bucket(key); + size_t index = get_bucket_index(key); // Get the bucket & bucket iterator. bucket_t* pbucket = pbuckets + index; @@ -737,11 +737,11 @@ namespace etl ///\param last The last + 1 element to add. //********************************************************************* template - void insert(TIterator first, TIterator last) + void insert(TIterator first_, TIterator last_) { - while (first != last) + while (first_ != last_) { - insert(*first++); + insert(*first_++); } } @@ -752,8 +752,8 @@ namespace etl //********************************************************************* size_t erase(key_parameter_t key) { - size_t count = 0; - size_t index = bucket(key); + size_t n = 0; + size_t index = get_bucket_index(key); bucket_t& bucket = pbuckets[index]; @@ -773,11 +773,11 @@ namespace etl bucket.erase_after(iprevious); // Unlink from the bucket. icurrent->key.~value_type(); // Destroy the value. pnodepool->release(&*icurrent); // Release it back to the pool. - count = 1; + n = 1; --construct_count; } - return count; + return n; } //********************************************************************* @@ -815,16 +815,16 @@ namespace etl ///\param first Iterator to the first element. ///\param last Iterator to the last element. //********************************************************************* - iterator erase(const_iterator first, const_iterator last) + iterator erase(const_iterator first_, const_iterator last_) { // Make a note of the last. - iterator result((pbuckets + number_of_buckets), last.get_bucket_list_iterator(), last.get_local_iterator()); + iterator result((pbuckets + number_of_buckets), last_.get_bucket_list_iterator(), last_.get_local_iterator()); // Get the starting point. - bucket_t* pbucket = first.get_bucket_list_iterator(); + bucket_t* pbucket = first_.get_bucket_list_iterator(); local_iterator iprevious = pbucket->before_begin(); - local_iterator icurrent = first.get_local_iterator(); - local_iterator iend = last.get_local_iterator(); // Note: May not be in the same bucket as icurrent. + local_iterator icurrent = first_.get_local_iterator(); + local_iterator iend = last_.get_local_iterator(); // Note: May not be in the same bucket as icurrent. // Find the node previous to the first one. while (iprevious->etl_next != &*icurrent) @@ -888,7 +888,7 @@ namespace etl //********************************************************************* iterator find(key_parameter_t key) { - size_t index = bucket(key); + size_t index = get_bucket_index(key); bucket_t* pbucket = pbuckets + index; bucket_t& bucket = *pbucket; @@ -922,7 +922,7 @@ namespace etl //********************************************************************* const_iterator find(key_parameter_t key) const { - size_t index = bucket(key); + size_t index = get_bucket_index(key); bucket_t* pbucket = pbuckets + index; bucket_t& bucket = *pbucket; @@ -959,15 +959,15 @@ namespace etl //********************************************************************* std::pair equal_range(key_parameter_t key) { - iterator first = find(key); - iterator last = first; + iterator f = find(key); + iterator l = f; - if (last != end()) + if (l != end()) { - ++last; + ++l; } - return std::pair(first, last); + return std::pair(f, l); } //********************************************************************* @@ -980,15 +980,15 @@ namespace etl //********************************************************************* std::pair equal_range(key_parameter_t key) const { - const_iterator first = find(key); - const_iterator last = first; + const_iterator f = find(key); + const_iterator l = f; - if (last != end()) + if (l != end()) { - ++last; + ++l; } - return std::pair(first, last); + return std::pair(f, l); } //************************************************************************* @@ -1078,10 +1078,10 @@ namespace etl //********************************************************************* /// Constructor. //********************************************************************* - iunordered_set(pool_t& node_pool, bucket_t* pbuckets_, size_t number_of_buckets) - : pnodepool(&node_pool), - pbuckets(pbuckets_), - number_of_buckets(number_of_buckets) + iunordered_set(pool_t& node_pool_, bucket_t* pbuckets_, size_t number_of_buckets_) + : pnodepool(&node_pool_), + pbuckets(pbuckets_), + number_of_buckets(number_of_buckets_) { } @@ -1222,7 +1222,7 @@ namespace etl unordered_set(const unordered_set& other) : base(node_pool, buckets, MAX_BUCKETS) { - base::assign(other.cbegin(), other.cend()); + base::assign(other.cbegin(), other.cend()); } //************************************************************************* @@ -1232,10 +1232,10 @@ namespace etl ///\param last The iterator to the last element + 1. //************************************************************************* template - unordered_set(TIterator first, TIterator last) + unordered_set(TIterator first_, TIterator last_) : base(node_pool, buckets, MAX_BUCKETS) { - base::assign(first, last); + base::assign(first_, last_); } //************************************************************************* diff --git a/src/user_type.h b/src/user_type.h index 4815ed55..49adae7b 100644 --- a/src/user_type.h +++ b/src/user_type.h @@ -83,7 +83,7 @@ SOFTWARE. TypeName() {} \ TypeName(const TypeName &other) : value(other.value) {} \ TypeName& operator=(const TypeName &other) { value = other.value; return *this; } \ - explicit TypeName(ValueType value) : value(value) {} \ + explicit TypeName(ValueType value_) : value(value_) {} \ operator ValueType() const { return value; } \ ValueType& get() { return value; } \ const ValueType& get() const { return value; } \ @@ -118,7 +118,7 @@ SOFTWARE. //***************************************************************************** #define ETL_END_USER_TYPE(TypeName) \ }; \ - TypeName(enum_type value) : value(static_cast(value)) {} \ + TypeName(enum_type value_) : value(static_cast(value_)) {} \ }; diff --git a/src/variant.h b/src/variant.h index 0d57a4a4..4bf3d5b9 100644 --- a/src/variant.h +++ b/src/variant.h @@ -78,8 +78,8 @@ namespace etl class variant_exception : public exception { public: - variant_exception(string_type what, string_type file_name, numeric_type line_number) - : exception(what, file_name, line_number) + variant_exception(string_type reason_, string_type file_name_, numeric_type line_number_) + : exception(reason_, file_name_, line_number_) { } }; @@ -91,8 +91,8 @@ namespace etl class variant_incorrect_type_exception : public variant_exception { public: - variant_incorrect_type_exception(string_type file_name, numeric_type line_number) - : variant_exception(ETL_ERROR_TEXT("variant: unsupported type", ETL_FILE"A"), file_name, line_number) + variant_incorrect_type_exception(string_type file_name_, numeric_type line_number_) + : variant_exception(ETL_ERROR_TEXT("variant: unsupported type", ETL_FILE"A"), file_name_, line_number_) { } }; @@ -764,22 +764,22 @@ namespace etl template bool is_same_type(const variant& other) const { - bool is_same_type = false; + bool is_same = false; switch (other.type_id) { - case 0: is_same_type = type_id == Type_Id_Lookup::type_id; break; - case 1: is_same_type = type_id == Type_Id_Lookup::type_id; break; - case 2: is_same_type = type_id == Type_Id_Lookup::type_id; break; - case 3: is_same_type = type_id == Type_Id_Lookup::type_id; break; - case 4: is_same_type = type_id == Type_Id_Lookup::type_id; break; - case 5: is_same_type = type_id == Type_Id_Lookup::type_id; break; - case 6: is_same_type = type_id == Type_Id_Lookup::type_id; break; - case 7: is_same_type = type_id == Type_Id_Lookup::type_id; break; + case 0: is_same = (type_id == Type_Id_Lookup::type_id); break; + case 1: is_same = (type_id == Type_Id_Lookup::type_id); break; + case 2: is_same = (type_id == Type_Id_Lookup::type_id); break; + case 3: is_same = (type_id == Type_Id_Lookup::type_id); break; + case 4: is_same = (type_id == Type_Id_Lookup::type_id); break; + case 5: is_same = (type_id == Type_Id_Lookup::type_id); break; + case 6: is_same = (type_id == Type_Id_Lookup::type_id); break; + case 7: is_same = (type_id == Type_Id_Lookup::type_id); break; default: break; } - return is_same_type; + return is_same; } //*************************************************************************** diff --git a/src/vector.h b/src/vector.h index 38c0b2e7..547f8fdc 100644 --- a/src/vector.h +++ b/src/vector.h @@ -33,10 +33,6 @@ SOFTWARE. #define __ETL_IN_VECTOR_H__ -#if ETL_CPP11_SUPPORTED - #include -#endif - #include #include #include @@ -366,8 +362,8 @@ namespace etl STATIC_ASSERT((etl::is_same::type, typename etl::remove_cv::value_type>::type>::value), "Iterator type does not match container type"); #if defined(ETL_DEBUG) - difference_type count = std::distance(first, last); - ETL_ASSERT(static_cast(count) <= CAPACITY, ETL_ERROR(vector_full)); + difference_type d = std::distance(first, last); + ETL_ASSERT(static_cast(d) <= CAPACITY, ETL_ERROR(vector_full)); #endif initialise(); @@ -1134,7 +1130,7 @@ namespace etl //************************************************************************* void repair() { - #if ETL_C11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED + #if ETL_CPP11_TYPE_TRAITS_IS_TRIVIAL_SUPPORTED ETL_ASSERT(std::is_trivially_copyable::value, ETL_ERROR(etl::vector_incompatible_type)); #endif diff --git a/src/wstring.h b/src/wstring.h index 7fe7d0ed..3d8c4832 100644 --- a/src/wstring.h +++ b/src/wstring.h @@ -84,16 +84,16 @@ namespace etl ///\param position The position of the first character. ///\param length The number of characters. Default = npos. //************************************************************************* - wstring(const etl::wstring& other, size_t position, size_t length = npos) + wstring(const etl::wstring& other, size_t position, size_t length_ = npos) : iwstring(reinterpret_cast(&buffer), MAX_SIZE) { ETL_ASSERT(position < other.size(), ETL_ERROR(string_out_of_bounds)); // Set the length to the exact amount. - length = (length > MAX_SIZE_) ? MAX_SIZE_ : length; + length_ = (length_ > MAX_SIZE_) ? MAX_SIZE_ : length_; iwstring::initialise(); - iwstring::assign(other.begin() + position, other.begin() + position + length); + iwstring::assign(other.begin() + position, other.begin() + position + length_); } //************************************************************************* @@ -149,7 +149,7 @@ namespace etl ///\param position The position of the first character. Default = 0. ///\param length The number of characters. Default = npos. //************************************************************************* - etl::wstring substr(size_t position = 0, size_t length = npos) const + etl::wstring substr(size_t position = 0, size_t length_ = npos) const { etl::wstring new_string; @@ -157,9 +157,9 @@ namespace etl { ETL_ASSERT(position < size(), ETL_ERROR(string_out_of_bounds)); - length = std::min(length, size() - position); + length_ = std::min(length_, size() - position); - new_string.assign(buffer + position, buffer + position + length); + new_string.assign(buffer + position, buffer + position + length_); } return new_string; diff --git a/test/codeblocks/ETL.cbp b/test/codeblocks/ETL.cbp index ee73a714..11c28d9b 100644 --- a/test/codeblocks/ETL.cbp +++ b/test/codeblocks/ETL.cbp @@ -42,6 +42,10 @@ + + + + @@ -159,6 +163,17 @@ + + + + + + + + + + + diff --git a/test/codeblocks/ETL.layout b/test/codeblocks/ETL.layout index b63bb058..79201827 100644 --- a/test/codeblocks/ETL.layout +++ b/test/codeblocks/ETL.layout @@ -1,169 +1,530 @@ - - + + + - + - + - + - + - + - + - + - + - + - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/data.h b/test/data.h index 4e3a5208..8bd99496 100644 --- a/test/data.h +++ b/test/data.h @@ -45,9 +45,9 @@ public: { } - explicit TestDataDC(const T& value, int index = 0) - : value(value), - index(index) + explicit TestDataDC(const T& value_, int index_ = 0) + : value(value_), + index(index_) { } @@ -92,9 +92,9 @@ class TestDataNDC { public: - explicit TestDataNDC(const T& value, int index = 0) - : value(value), - index(index) + explicit TestDataNDC(const T& value_, int index_ = 0) + : value(value_), + index(index_) {} bool operator < (const TestDataNDC& other) const @@ -130,4 +130,4 @@ std::ostream& operator << (std::ostream& s, const TestDataNDC& rhs) return s; } -#endif \ No newline at end of file +#endif diff --git a/test/test_algorithm.cpp b/test/test_algorithm.cpp index eb631739..b04d62fc 100644 --- a/test/test_algorithm.cpp +++ b/test/test_algorithm.cpp @@ -69,9 +69,9 @@ namespace } }; - std::ostream& operator << (std::ostream& os, const StructData& data) + std::ostream& operator << (std::ostream& os, const StructData& data_) { - os << data.a << "," << data.b; + os << data_.a << "," << data_.b; return os; } diff --git a/test/test_array.cpp b/test/test_array.cpp index 050e9b8a..993be93b 100644 --- a/test/test_array.cpp +++ b/test/test_array.cpp @@ -211,7 +211,7 @@ namespace CHECK_EQUAL(data.cend(), &data[SIZE]); } - + //************************************************************************* TEST(test_rbegin) { @@ -243,7 +243,7 @@ namespace CHECK(data.crend() == Data::const_reverse_iterator(&data[0])); } - + //************************************************************************* TEST(test_iterator) { @@ -315,14 +315,14 @@ namespace Data data; data.fill(1); - Compare_Data compare_data; - compare_data.fill(1); + Compare_Data compare; + compare.fill(1); - bool isEqual = std::equal(data.begin(), data.end(), compare_data.begin()); + bool isEqual = std::equal(data.begin(), data.end(), compare.begin()); CHECK(isEqual); } - + //************************************************************************* TEST(test_swap) { @@ -352,7 +352,7 @@ namespace TEST(test_assign) { int initial[] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; - int source[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; + int source[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; int check1[] = { 0, 1, 2, 3, 4, -1, -1, -1, -1, -1 }; int check2[] = { 0, 1, 2, 3, 4, 99, 99, 99, 99, 99 }; int check3[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; diff --git a/test/test_error_handler.cpp b/test/test_error_handler.cpp index 2cdc4cd1..b50ce2dd 100644 --- a/test/test_error_handler.cpp +++ b/test/test_error_handler.cpp @@ -45,8 +45,8 @@ class test_exception : public etl::exception { public: - test_exception(string_type file_name, numeric_type line_number) - : exception(ETL_ERROR_TEXT("test_exception", "123"), file_name, line_number) + test_exception(string_type file_name_, numeric_type line_number_) + : exception(ETL_ERROR_TEXT("test_exception", "123"), file_name_, line_number_) { error_received = false; } diff --git a/test/test_flat_map.cpp b/test/test_flat_map.cpp index 2d73f46b..dd3768a4 100644 --- a/test/test_flat_map.cpp +++ b/test/test_flat_map.cpp @@ -544,6 +544,8 @@ namespace bool isEqual = Check_Equal(data.begin(), data.end(), compare_data.begin()); + + CHECK(isEqual); } //************************************************************************* diff --git a/test/test_fsm.cpp b/test/test_fsm.cpp index 71a78263..37c2a8ec 100644 --- a/test/test_fsm.cpp +++ b/test/test_fsm.cpp @@ -82,7 +82,7 @@ namespace { public: - SetSpeed(int speed) : speed(speed) {} + SetSpeed(int speed_) : speed(speed_) {} const int speed; }; @@ -170,7 +170,7 @@ namespace bool isLampOn; int speed; }; - + //*********************************** // The idle state. //*********************************** @@ -179,14 +179,14 @@ namespace public: //*********************************** - etl::fsm_state_id_t on_event(etl::imessage_router& sender, const Start& event) + etl::fsm_state_id_t on_event(etl::imessage_router&, const Start&) { ++get_fsm_context().startCount; return StateId::RUNNING; } //*********************************** - etl::fsm_state_id_t on_event_unknown(etl::imessage_router& sender, const etl::imessage& event) + etl::fsm_state_id_t on_event_unknown(etl::imessage_router&, const etl::imessage&) { ++get_fsm_context().unknownCount; return STATE_ID; @@ -208,7 +208,7 @@ namespace public: //*********************************** - etl::fsm_state_id_t on_event(etl::imessage_router& sender, const Stop& event) + etl::fsm_state_id_t on_event(etl::imessage_router&, const Stop& event) { ++get_fsm_context().stopCount; @@ -223,7 +223,7 @@ namespace } //*********************************** - etl::fsm_state_id_t on_event(etl::imessage_router& sender, const SetSpeed& event) + etl::fsm_state_id_t on_event(etl::imessage_router&, const SetSpeed& event) { ++get_fsm_context().setSpeedCount; get_fsm_context().SetSpeed(event.speed); @@ -231,7 +231,7 @@ namespace } //*********************************** - etl::fsm_state_id_t on_event_unknown(etl::imessage_router& sender, const etl::imessage& event) + etl::fsm_state_id_t on_event_unknown(etl::imessage_router&, const etl::imessage&) { ++get_fsm_context().unknownCount; return STATE_ID; @@ -254,14 +254,14 @@ namespace public: //*********************************** - etl::fsm_state_id_t on_event(etl::imessage_router& source, const Stopped& event) + etl::fsm_state_id_t on_event(etl::imessage_router&, const Stopped&) { ++get_fsm_context().stoppedCount; return StateId::IDLE; } //*********************************** - etl::fsm_state_id_t on_event_unknown(etl::imessage_router& source, const etl::imessage& event) + etl::fsm_state_id_t on_event_unknown(etl::imessage_router&, const etl::imessage&) { ++get_fsm_context().unknownCount; return STATE_ID; @@ -276,7 +276,7 @@ namespace public: //*********************************** - etl::fsm_state_id_t on_event_unknown(etl::imessage_router& source, const etl::imessage& event) + etl::fsm_state_id_t on_event_unknown(etl::imessage_router&, const etl::imessage&) { ++get_fsm_context().unknownCount; return STATE_ID; diff --git a/test/test_intrusive_forward_list.cpp b/test/test_intrusive_forward_list.cpp index 365ac19c..0ec1a5d7 100644 --- a/test/test_intrusive_forward_list.cpp +++ b/test/test_intrusive_forward_list.cpp @@ -784,8 +784,6 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_splice_list) { - bool are_equal; - DataNDC0 data0(sorted_data.begin(), sorted_data.end()); DataNDC0 data1(sorted_data2.begin(), sorted_data2.end()); @@ -811,8 +809,6 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_splice_list_self) { - bool are_equal; - DataNDC0 data0(sorted_data.begin(), sorted_data.end()); DataNDC0::iterator idata_destination = data0.begin(); @@ -831,8 +827,6 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_splice_range) { - bool are_equal; - DataNDC0 data0(sorted_data.begin(), sorted_data.end()); DataNDC0 data1(sorted_data2.begin(), sorted_data2.end()); @@ -870,8 +864,6 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_splice_range_self) { - bool are_equal; - DataNDC0 data0(sorted_data.begin(), sorted_data.end()); DataNDC0::iterator idata_destination = data0.begin(); @@ -906,8 +898,6 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_merge_0_1) { - bool are_equal; - DataNDC0 data0(merge_data0.begin(), merge_data0.end()); DataNDC0 data1(merge_data1.begin(), merge_data1.end()); @@ -927,8 +917,6 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_merge_0_2) { - bool are_equal; - DataNDC0 data0(merge_data0.begin(), merge_data0.end()); DataNDC0 data2(merge_data2.begin(), merge_data2.end()); @@ -948,8 +936,6 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_merge_0_3) { - bool are_equal; - DataNDC0 data0(merge_data0.begin(), merge_data0.end()); DataNDC0 data3(merge_data3.begin(), merge_data3.end()); @@ -969,8 +955,6 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_merge_0_4) { - bool are_equal; - DataNDC0 data0(merge_data0.begin(), merge_data0.end()); DataNDC0 data4(merge_data4.begin(), merge_data4.end()); @@ -990,8 +974,6 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_merge_0_1_reverse_order) { - bool are_equal; - DataNDC0 data0(merge_data0.begin(), merge_data0.end()); DataNDC0 data1(merge_data1.begin(), merge_data1.end()); diff --git a/test/test_intrusive_links.cpp b/test/test_intrusive_links.cpp index 49ed4337..d98570be 100644 --- a/test/test_intrusive_links.cpp +++ b/test/test_intrusive_links.cpp @@ -43,8 +43,8 @@ namespace struct FData : public FLink0, public FLink1 { - FData(int value) - : value(value) + FData(int value_) + : value(value_) { } @@ -59,8 +59,8 @@ namespace struct BData : public BLink0, public BLink1 { - BData(int value) - : value(value) + BData(int value_) + : value(value_) { } @@ -76,8 +76,8 @@ namespace struct TData : public TLink0, public TLink1 { - TData(int value) - : value(value) + TData(int value_) + : value(value_) { } @@ -89,8 +89,8 @@ namespace //******************************************************* struct MData : public FLink0, public BLink1, public TLink2 { - MData(int value) - : value(value) + MData(int value_) + : value(value_) { } diff --git a/test/test_intrusive_queue.cpp b/test/test_intrusive_queue.cpp index 8fd06207..3c6f5849 100644 --- a/test/test_intrusive_queue.cpp +++ b/test/test_intrusive_queue.cpp @@ -40,8 +40,8 @@ namespace struct Data : public link0, public link1 { - Data(int i) - : i(i) + Data(int i_) + : i(i_) { } @@ -245,7 +245,7 @@ namespace queue1.pop_into(queue2); CHECK_EQUAL(0U, queue1.size()); - + CHECK_EQUAL(3U, queue2.size()); CHECK_EQUAL(data1, queue2.front()); CHECK_EQUAL(data3, queue2.back()); diff --git a/test/test_intrusive_stack.cpp b/test/test_intrusive_stack.cpp index 7d595d7c..f6340479 100644 --- a/test/test_intrusive_stack.cpp +++ b/test/test_intrusive_stack.cpp @@ -40,8 +40,8 @@ namespace struct Data : public link0, public link1 { - Data(int i) - : i(i) + Data(int i_) + : i(i_) { } diff --git a/test/test_list.cpp b/test/test_list.cpp index ed52b1f8..1bb66cd3 100644 --- a/test/test_list.cpp +++ b/test/test_list.cpp @@ -1510,8 +1510,6 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_merge_0_1) { - bool are_equal; - DataNDC2 data0(merge_data0.begin(), merge_data0.end()); DataNDC2 data1(merge_data1.begin(), merge_data1.end()); @@ -1531,8 +1529,6 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_merge_0_2) { - bool are_equal; - DataNDC2 data0(merge_data0.begin(), merge_data0.end()); DataNDC2 data2(merge_data2.begin(), merge_data2.end()); @@ -1552,8 +1548,6 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_merge_0_3) { - bool are_equal; - DataNDC2 data0(merge_data0.begin(), merge_data0.end()); DataNDC2 data3(merge_data3.begin(), merge_data3.end()); @@ -1573,8 +1567,6 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_merge_0_4) { - bool are_equal; - DataNDC2 data0(merge_data0.begin(), merge_data0.end()); DataNDC2 data4(merge_data4.begin(), merge_data4.end()); @@ -1594,8 +1586,6 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_merge_0_1_reverse_order) { - bool are_equal; - DataNDC2 data0(merge_data0.begin(), merge_data0.end()); DataNDC2 data1(merge_data1.begin(), merge_data1.end()); diff --git a/test/test_message_bus.cpp b/test/test_message_bus.cpp index 66e079f5..42ad6118 100644 --- a/test/test_message_bus.cpp +++ b/test/test_message_bus.cpp @@ -106,7 +106,7 @@ namespace } - void on_receive(etl::imessage_router& sender, const Message1& msg) + void on_receive(etl::imessage_router& sender, const Message1&) { ++message1_count; etl::send_message(sender, message5); @@ -114,30 +114,30 @@ namespace order = call_order++; } - void on_receive(etl::imessage_router& sender, const Message2& msg) + void on_receive(etl::imessage_router& sender, const Message2&) { ++message2_count; etl::send_message(sender, message5); } - void on_receive(etl::imessage_router& sender, const Message3& msg) + void on_receive(etl::imessage_router& sender, const Message3&) { ++message3_count; etl::send_message(sender, message5); } - void on_receive(etl::imessage_router& sender, const Message4& msg) + void on_receive(etl::imessage_router& sender, const Message4&) { ++message4_count; etl::send_message(sender, message5); } - void on_receive(etl::imessage_router& sender, const Message5& msg) + void on_receive(etl::imessage_router&, const Message5&) { ++message5_count; } - void on_receive_unknown(etl::imessage_router& sender, const etl::imessage& msg) + void on_receive_unknown(etl::imessage_router&, const etl::imessage&) { ++message_unknown_count; } @@ -169,30 +169,30 @@ namespace } - void on_receive(etl::imessage_router& sender, const Message1& msg) + void on_receive(etl::imessage_router& sender, const Message1&) { ++message1_count; etl::send_message(sender, message5); } - void on_receive(etl::imessage_router& sender, const Message2& msg) + void on_receive(etl::imessage_router& sender, const Message2&) { ++message2_count; etl::send_message(sender, message5); } - void on_receive(etl::imessage_router& sender, const Message4& msg) + void on_receive(etl::imessage_router& sender, const Message4&) { ++message4_count; etl::send_message(sender, message5); } - void on_receive(etl::imessage_router& sender, const Message5& msg) + void on_receive(etl::imessage_router&, const Message5&) { ++message5_count; } - void on_receive_unknown(etl::imessage_router& sender, const etl::imessage& msg) + void on_receive_unknown(etl::imessage_router& sender, const etl::imessage&) { ++message_unknown_count; etl::send_message(sender, message5); diff --git a/test/test_message_router.cpp b/test/test_message_router.cpp index 4af52cb3..c15408fb 100644 --- a/test/test_message_router.cpp +++ b/test/test_message_router.cpp @@ -100,36 +100,36 @@ namespace } - void on_receive(etl::imessage_router& sender, const Message1& msg) + void on_receive(etl::imessage_router& sender, const Message1&) { ++message1_count; etl::send_message(sender, message5); } - void on_receive(etl::imessage_router& sender, const Message2& msg) + void on_receive(etl::imessage_router& sender, const Message2&) { ++message2_count; etl::send_message(sender, message5); } - void on_receive(etl::imessage_router& sender, const Message3& msg) + void on_receive(etl::imessage_router& sender, const Message3&) { ++message3_count; etl::send_message(sender, message5); } - void on_receive(etl::imessage_router& sender, const Message4& msg) + void on_receive(etl::imessage_router& sender, const Message4&) { ++message4_count; etl::send_message(sender, message5); } - void on_receive(etl::imessage_router& sender, const Message5& msg) + void on_receive(etl::imessage_router&, const Message5&) { ++callback_count; } - void on_receive_unknown(etl::imessage_router& sender, const etl::imessage& msg) + void on_receive_unknown(etl::imessage_router&, const etl::imessage&) { ++message_unknown_count; } @@ -160,30 +160,30 @@ namespace } - void on_receive(etl::imessage_router& sender, const Message1& msg) + void on_receive(etl::imessage_router& sender, const Message1&) { ++message1_count; etl::send_message(sender, message5); } - void on_receive(etl::imessage_router& sender, const Message2& msg) + void on_receive(etl::imessage_router& sender, const Message2&) { ++message2_count; etl::send_message(sender, message5); } - void on_receive(etl::imessage_router& sender, const Message4& msg) + void on_receive(etl::imessage_router& sender, const Message4&) { ++message4_count; etl::send_message(sender, message5); } - void on_receive(etl::imessage_router& sender, const Message5& msg) + void on_receive(etl::imessage_router&, const Message5&) { ++callback_count; } - void on_receive_unknown(etl::imessage_router& sender, const etl::imessage& msg) + void on_receive_unknown(etl::imessage_router& sender, const etl::imessage&) { ++message_unknown_count; etl::send_message(sender, message5); diff --git a/test/test_message_timer.cpp b/test/test_message_timer.cpp index b3a9ddda..b8b3488c 100644 --- a/test/test_message_timer.cpp +++ b/test/test_message_timer.cpp @@ -92,22 +92,22 @@ namespace } - void on_receive(etl::imessage_router& sender, const Message1& msg) + void on_receive(etl::imessage_router&, const Message1&) { message1.push_back(ticks); } - void on_receive(etl::imessage_router& sender, const Message2& msg) + void on_receive(etl::imessage_router&, const Message2&) { message2.push_back(ticks); } - void on_receive(etl::imessage_router& sender, const Message3& msg) + void on_receive(etl::imessage_router&, const Message3&) { message3.push_back(ticks); } - void on_receive_unknown(etl::imessage_router& sender, const etl::imessage& msg) + void on_receive_unknown(etl::imessage_router&, const etl::imessage&) { } @@ -516,7 +516,7 @@ namespace etl::message_timer<3> timer_controller; etl::timer::id::type id1 = timer_controller.register_timer(message1, router1, 5, etl::timer::mode::SINGLE_SHOT); - + router1.clear(); timer_controller.start(id1); diff --git a/test/test_packet.cpp b/test/test_packet.cpp index 90f70c67..010754a7 100644 --- a/test/test_packet.cpp +++ b/test/test_packet.cpp @@ -64,8 +64,8 @@ namespace struct derived_1 : public base { - derived_1(int value) - : base(value) + derived_1(int value_) + : base(value_) { } @@ -79,8 +79,8 @@ namespace struct derived_2 : public base { - derived_2(int value) - : base(value) + derived_2(int value_) + : base(value_) { } @@ -143,14 +143,14 @@ namespace derived_2 db(2); derived_1 dc(3); derived_2 dd(4); - + etl::queue queue; queue.emplace(da); queue.emplace(db); queue.emplace(dc); queue.emplace(dd); - + CHECK_EQUAL(da.value(), queue.front().get().value()); queue.pop(); diff --git a/test/test_string_char.cpp b/test/test_string_char.cpp index 376a0005..1e8968dd 100644 --- a/test/test_string_char.cpp +++ b/test/test_string_char.cpp @@ -41,7 +41,7 @@ SOFTWARE. #define STR(x) x namespace -{ +{ SUITE(test_string_char) { static const size_t SIZE = 11; @@ -142,7 +142,7 @@ namespace CHECK(!text.empty()); - bool is_equal = Equal(compare_text, text); + bool is_equal = Equal(compare_text, text); CHECK(is_equal); } @@ -167,7 +167,7 @@ namespace Text text(initial_text.c_str(), initial_text.size() / 2); CHECK(!text.empty()); - + bool is_equal = Equal(compare_text, text); CHECK(is_equal); } @@ -448,7 +448,7 @@ namespace { Compare_Text compare_text(initial_text.c_str()); Text text(initial_text.c_str()); - + CHECK(text.back() == compare_text.back()); } @@ -559,7 +559,7 @@ namespace CHECK(is_equal); } - + //************************************************************************* TEST_FIXTURE(SetupFixture, test_assign_size_value_excess) { @@ -673,9 +673,9 @@ namespace text.insert(text.begin() + offset, INITIAL_VALUE); compare_text.insert(compare_text.begin() + offset, INITIAL_VALUE); compare_text.erase(compare_text.end() - 1); - + CHECK(text.truncated()); - + bool is_equal = Equal(compare_text, text); CHECK(is_equal); @@ -709,12 +709,9 @@ namespace const size_t INITIAL_SIZE = 5; const size_t INSERT_SIZE = 3; const value_t INITIAL_VALUE = STR('A'); - + for (size_t offset = 0; offset <= INITIAL_SIZE; ++offset) { - Compare_Text compare_text; - Text text; - text.assign(initial_text.begin(), initial_text.begin() + INITIAL_SIZE); compare_text.assign(initial_text.begin(), initial_text.begin() + INITIAL_SIZE); text.insert(text.begin() + offset, INSERT_SIZE, INITIAL_VALUE); @@ -874,7 +871,7 @@ namespace text.insert(offset, insert); compare_text.insert(offset, insert_text); compare_text.resize(std::min(compare_text.size(), SIZE)); - + bool is_equal = Equal(compare_text, text); CHECK(is_equal); } @@ -1672,7 +1669,7 @@ namespace is_equal = Equal(compare_text, text); CHECK(is_equal); } - + //************************************************************************* TEST_FIXTURE(SetupFixture, test_replace_first_last_n_c) { @@ -1798,7 +1795,7 @@ namespace bool is_equal = Equal(compare_text, text); CHECK(is_equal); } - + //************************************************************************* TEST_FIXTURE(SetupFixture, test_clear) { @@ -1903,7 +1900,7 @@ namespace CHECK((initial < initial) == (initial_text < initial_text)); CHECK((initial < initial) == (initial_text < initial_text)); - // String-Pointer Pointer-String + // String-Pointer Pointer-String CHECK((less < pinitial_text) == (less_text < pinitial_text)); CHECK((pinitial_text < less) == (pinitial_text < less_text)); @@ -1938,7 +1935,7 @@ namespace CHECK((initial <= initial) == (initial_text <= initial_text)); CHECK((initial <= initial) == (initial_text <= initial_text)); - // String-Pointer Pointer-String + // String-Pointer Pointer-String CHECK((less <= pinitial_text) == (less_text <= pinitial_text)); CHECK((pinitial_text <= less) == (pinitial_text <= less_text)); @@ -1973,7 +1970,7 @@ namespace CHECK((initial > initial) == (initial_text > initial_text)); CHECK((initial > initial) == (initial_text > initial_text)); - // String-Pointer Pointer-String + // String-Pointer Pointer-String CHECK((less > pinitial_text) == (less_text > pinitial_text)); CHECK((pinitial_text > less) == (pinitial_text > less_text)); @@ -2008,7 +2005,7 @@ namespace CHECK((initial >= initial) == (initial_text >= initial_text)); CHECK((initial >= initial) == (initial_text >= initial_text)); - // String-Pointer Pointer-String + // String-Pointer Pointer-String CHECK((less >= pinitial_text) == (less_text >= pinitial_text)); CHECK((pinitial_text >= less) == (pinitial_text >= less_text)); @@ -2049,7 +2046,7 @@ namespace TEST_FIXTURE(SetupFixture, test_find_string) { const value_t* the_haystack = STR("A haystack with a needle and another needle"); - + std::string compare_needle(STR("needle")); etl::string<50> needle(STR("needle")); @@ -2062,7 +2059,7 @@ namespace position1 = compare_haystack.find(compare_needle, position1); position2 = haystack.find(needle, position2); CHECK_EQUAL(position1, position2); - + position1 = compare_haystack.find(compare_needle, position1 + 1); position2 = haystack.find(needle, position2 + 1); CHECK_EQUAL(position1, position2); diff --git a/test/test_string_u16.cpp b/test/test_string_u16.cpp index 58595485..09b93293 100644 --- a/test/test_string_u16.cpp +++ b/test/test_string_u16.cpp @@ -702,9 +702,6 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_insert_position_n_value) { - Compare_Text compare_text; - Text text; - const size_t INITIAL_SIZE = 5; const size_t INSERT_SIZE = 3; const value_t INITIAL_VALUE = STR('A'); @@ -1902,7 +1899,7 @@ namespace CHECK((initial < initial) == (initial_text < initial_text)); CHECK((initial < initial) == (initial_text < initial_text)); - // String-Pointer Pointer-String + // String-Pointer Pointer-String CHECK((less < pinitial_text) == (less_text < pinitial_text)); CHECK((pinitial_text < less) == (pinitial_text < less_text)); @@ -1937,7 +1934,7 @@ namespace CHECK((initial <= initial) == (initial_text <= initial_text)); CHECK((initial <= initial) == (initial_text <= initial_text)); - // String-Pointer Pointer-String + // String-Pointer Pointer-String CHECK((less <= pinitial_text) == (less_text <= pinitial_text)); CHECK((pinitial_text <= less) == (pinitial_text <= less_text)); @@ -1972,7 +1969,7 @@ namespace CHECK((initial > initial) == (initial_text > initial_text)); CHECK((initial > initial) == (initial_text > initial_text)); - // String-Pointer Pointer-String + // String-Pointer Pointer-String CHECK((less > pinitial_text) == (less_text > pinitial_text)); CHECK((pinitial_text > less) == (pinitial_text > less_text)); @@ -2007,7 +2004,7 @@ namespace CHECK((initial >= initial) == (initial_text >= initial_text)); CHECK((initial >= initial) == (initial_text >= initial_text)); - // String-Pointer Pointer-String + // String-Pointer Pointer-String CHECK((less >= pinitial_text) == (less_text >= pinitial_text)); CHECK((pinitial_text >= less) == (pinitial_text >= less_text)); diff --git a/test/test_string_u32.cpp b/test/test_string_u32.cpp index 0f2cac87..ce1579b0 100644 --- a/test/test_string_u32.cpp +++ b/test/test_string_u32.cpp @@ -702,9 +702,6 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_insert_position_n_value) { - Compare_Text compare_text; - Text text; - const size_t INITIAL_SIZE = 5; const size_t INSERT_SIZE = 3; const value_t INITIAL_VALUE = STR('A'); @@ -1902,7 +1899,7 @@ namespace CHECK((initial < initial) == (initial_text < initial_text)); CHECK((initial < initial) == (initial_text < initial_text)); - // String-Pointer Pointer-String + // String-Pointer Pointer-String CHECK((less < pinitial_text) == (less_text < pinitial_text)); CHECK((pinitial_text < less) == (pinitial_text < less_text)); @@ -1937,7 +1934,7 @@ namespace CHECK((initial <= initial) == (initial_text <= initial_text)); CHECK((initial <= initial) == (initial_text <= initial_text)); - // String-Pointer Pointer-String + // String-Pointer Pointer-String CHECK((less <= pinitial_text) == (less_text <= pinitial_text)); CHECK((pinitial_text <= less) == (pinitial_text <= less_text)); @@ -1972,7 +1969,7 @@ namespace CHECK((initial > initial) == (initial_text > initial_text)); CHECK((initial > initial) == (initial_text > initial_text)); - // String-Pointer Pointer-String + // String-Pointer Pointer-String CHECK((less > pinitial_text) == (less_text > pinitial_text)); CHECK((pinitial_text > less) == (pinitial_text > less_text)); @@ -2007,7 +2004,7 @@ namespace CHECK((initial >= initial) == (initial_text >= initial_text)); CHECK((initial >= initial) == (initial_text >= initial_text)); - // String-Pointer Pointer-String + // String-Pointer Pointer-String CHECK((less >= pinitial_text) == (less_text >= pinitial_text)); CHECK((pinitial_text >= less) == (pinitial_text >= less_text)); @@ -3032,7 +3029,7 @@ namespace hash = etl::hash()(itext); CHECK_EQUAL(compare_hash, hash); } - + TEST_FIXTURE(SetupFixture, test_memcpy_repair) { Text text; diff --git a/test/test_string_wchar_t.cpp b/test/test_string_wchar_t.cpp index aa7b045e..191f53d3 100644 --- a/test/test_string_wchar_t.cpp +++ b/test/test_string_wchar_t.cpp @@ -40,7 +40,7 @@ SOFTWARE. #define STR(x) L##x namespace -{ +{ SUITE(test_string_wchar_t) { static const size_t SIZE = 11; @@ -702,9 +702,6 @@ namespace //************************************************************************* TEST_FIXTURE(SetupFixture, test_insert_position_n_value) { - Compare_Text compare_text; - Text text; - const size_t INITIAL_SIZE = 5; const size_t INSERT_SIZE = 3; const value_t INITIAL_VALUE = STR('A'); @@ -1902,7 +1899,7 @@ namespace CHECK((initial < initial) == (initial_text < initial_text)); CHECK((initial < initial) == (initial_text < initial_text)); - // String-Pointer Pointer-String + // String-Pointer Pointer-String CHECK((less < pinitial_text) == (less_text < pinitial_text)); CHECK((pinitial_text < less) == (pinitial_text < less_text)); @@ -1937,7 +1934,7 @@ namespace CHECK((initial <= initial) == (initial_text <= initial_text)); CHECK((initial <= initial) == (initial_text <= initial_text)); - // String-Pointer Pointer-String + // String-Pointer Pointer-String CHECK((less <= pinitial_text) == (less_text <= pinitial_text)); CHECK((pinitial_text <= less) == (pinitial_text <= less_text)); @@ -1972,7 +1969,7 @@ namespace CHECK((initial > initial) == (initial_text > initial_text)); CHECK((initial > initial) == (initial_text > initial_text)); - // String-Pointer Pointer-String + // String-Pointer Pointer-String CHECK((less > pinitial_text) == (less_text > pinitial_text)); CHECK((pinitial_text > less) == (pinitial_text > less_text)); @@ -2007,7 +2004,7 @@ namespace CHECK((initial >= initial) == (initial_text >= initial_text)); CHECK((initial >= initial) == (initial_text >= initial_text)); - // String-Pointer Pointer-String + // String-Pointer Pointer-String CHECK((less >= pinitial_text) == (less_text >= pinitial_text)); CHECK((pinitial_text >= less) == (pinitial_text >= less_text)); diff --git a/test/test_task_scheduler.cpp b/test/test_task_scheduler.cpp index 7680e37f..38f505c6 100644 --- a/test/test_task_scheduler.cpp +++ b/test/test_task_scheduler.cpp @@ -80,10 +80,10 @@ class Task : public etl::task public: //********************************************* - Task(etl::task_priority_t priority, WorkList_t& work, Common& common) - : task(priority), - work(work), - common(common), + Task(etl::task_priority_t priority_, WorkList_t& work_, Common& common_) + : task(priority_), + work(work_), + common(common_), workIndex(0), addAtIndex(0), workToAdd(""), From 7d75859add70ca211840f45eead1770004f4f280 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Wed, 1 Nov 2017 10:04:25 +0000 Subject: [PATCH 2/2] Update to 10.3.1 --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index 94441b1b..32e1e807 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library -version=10.3.0 +version=10.3.1 author= John Wellbelove maintainer=John Wellbelove sentence=A C++ template library tailored for embedded systems.