From 77513730e09b742a2fc9ad5ecb0ebb7b78b54a7f Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Thu, 25 Jan 2024 14:22:26 +0000 Subject: [PATCH] Fixed shadow warnings in all files #823 Multiple variable shadowing warnings in private/bitset_new.h --- include/etl/basic_string_stream.h | 68 +++---- include/etl/byte_stream.h | 48 ++--- include/etl/frame_check_sequence.h | 2 +- include/etl/fsm.h | 4 +- include/etl/generators/fsm_generator.h | 4 +- .../etl/generators/message_router_generator.h | 12 +- include/etl/message_broker.h | 4 +- include/etl/message_bus.h | 22 +-- include/etl/message_router.h | 12 +- include/etl/multi_range.h | 14 +- include/etl/private/bitset_legacy.h | 2 +- include/etl/private/bitset_new.h | 102 +++++++---- include/etl/queue_spsc_locked.h | 6 +- include/etl/radix.h | 20 +-- include/etl/to_arithmetic.h | 6 +- include/etl/unordered_map.h | 22 +-- include/etl/unordered_multimap.h | 28 +-- include/etl/unordered_multiset.h | 28 +-- include/etl/unordered_set.h | 32 ++-- test/CMakeLists.txt | 2 + test/UnitTest++/CheckMacros.h | 40 ++--- test/UnitTest++/ExecuteTest.h | 8 +- test/run-tests.sh | 2 +- test/test_algorithm.cpp | 6 +- test/test_bitset_new_default_element_type.cpp | 12 +- ...itset_new_explicit_single_element_type.cpp | 12 +- ...st_bitset_new_ext_default_element_type.cpp | 17 +- ...t_new_ext_explicit_single_element_type.cpp | 20 +-- test/test_callback_service.cpp | 24 +-- test/test_callback_timer.cpp | 82 ++++----- test/test_callback_timer_atomic.cpp | 82 ++++----- test/test_callback_timer_interrupt.cpp | 74 ++++---- test/test_callback_timer_locked.cpp | 82 ++++----- test/test_circular_buffer_external_buffer.cpp | 63 ++++++- test/test_circular_iterator.cpp | 40 ++--- test/test_compare.cpp | 18 +- test/test_delegate.cpp | 166 +++++++++--------- test/test_delegate_cpp03.cpp | 106 +++++------ test/test_delegate_service.cpp | 24 +-- test/test_delegate_service_compile_time.cpp | 8 +- test/test_delegate_service_cpp03.cpp | 10 +- test/test_deque.cpp | 133 +++++++------- test/test_fixed_iterator.cpp | 14 +- test/test_function.cpp | 66 +++---- test/test_indirect_vector.cpp | 8 +- test/test_indirect_vector_external_buffer.cpp | 8 +- test/test_intrusive_forward_list.cpp | 58 +++--- test/test_memory.cpp | 38 ++-- test/test_parameter_type.cpp | 18 +- test/test_pool.cpp | 4 +- test/test_pool_external_buffer.cpp | 4 +- test/test_set.cpp | 9 +- test/test_shared_message.cpp | 50 +++--- test/test_type_traits.cpp | 6 +- test/test_vector.cpp | 4 +- test/test_vector_external_buffer.cpp | 4 +- test/test_vector_non_trivial.cpp | 3 - test/vs2022/etl.vcxproj | 24 +-- 58 files changed, 928 insertions(+), 857 deletions(-) diff --git a/include/etl/basic_string_stream.h b/include/etl/basic_string_stream.h index e91ee1fe..2b466055 100644 --- a/include/etl/basic_string_stream.h +++ b/include/etl/basic_string_stream.h @@ -58,28 +58,28 @@ namespace etl } //************************************************************************* - /// Construct from text and format spec. + /// Construct from text and format fmt. //************************************************************************* basic_string_stream(TIString& text_, const TFormat& spec_) : text(text_) - , spec(spec_) + , format(spec_) { } //************************************************************************* - /// Set the format spec. + /// Set the format fmt. //************************************************************************* void set_format(const TFormat& spec_) { - spec = spec_; + format = spec_; } //************************************************************************* - /// Get a const reference to the format spec. + /// Get a const reference to the format fmt. //************************************************************************* const TFormat& get_format() const { - return spec; + return format; } //************************************************************************* @@ -121,27 +121,27 @@ namespace etl //********************************* /// TFormat //********************************* - friend basic_string_stream& operator <<(basic_string_stream& ss, const TFormat& spec) + friend basic_string_stream& operator <<(basic_string_stream& ss, const TFormat& fmt) { - ss.spec = spec; + ss.format = fmt; return ss; } //********************************* /// etl::base_spec from etl::setbase, etl::bin, etl::oct, etl::dec & etl::hex stream manipulators //********************************* - friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::base_spec spec) + friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::base_spec fmt) { - ss.spec.base(spec.base); + ss.format.base(fmt.base); return ss; } //********************************* /// etl::width_spec from etl::setw stream manipulator //********************************* - friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::width_spec spec) + friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::width_spec fmt) { - ss.spec.width(spec.width); + ss.format.width(fmt.width); return ss; } @@ -149,63 +149,63 @@ namespace etl /// etl::fill_spec from etl::setfill stream manipulator //********************************* template - friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::fill_spec spec) + friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::fill_spec fmt) { - ss.spec.fill(spec.fill); + ss.format.fill(fmt.fill); return ss; } //********************************* /// etl::precision_spec from etl::setprecision stream manipulator //********************************* - friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::precision_spec spec) + friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::precision_spec fmt) { - ss.spec.precision(spec.precision); + ss.format.precision(fmt.precision); return ss; } //********************************* /// etl::boolalpha_spec from etl::boolalpha & etl::noboolalpha stream manipulators //********************************* - friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::boolalpha_spec spec) + friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::boolalpha_spec fmt) { - ss.spec.boolalpha(spec.boolalpha); + ss.format.boolalpha(fmt.boolalpha); return ss; } //********************************* /// etl::uppercase_spec from etl::uppercase & etl::nouppercase stream manipulators //********************************* - friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::uppercase_spec spec) + friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::uppercase_spec fmt) { - ss.spec.upper_case(spec.upper_case); + ss.format.upper_case(fmt.upper_case); return ss; } //********************************* /// etl::showbase_spec from etl::showbase & etl::noshowbase stream manipulators //********************************* - friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::showbase_spec spec) + friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::showbase_spec fmt) { - ss.spec.show_base(spec.show_base); + ss.format.show_base(fmt.show_base); return ss; } //********************************* /// etl::left_spec from etl::left stream manipulator //********************************* - friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::left_spec /*spec*/) + friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::left_spec /*fmt*/) { - ss.spec.left(); + ss.format.left(); return ss; } //********************************* /// etl::right_spec from etl::left stream manipulator //********************************* - friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::right_spec /*spec*/) + friend basic_string_stream& operator <<(basic_string_stream& ss, etl::private_basic_format_spec::right_spec /*fmt*/) { - ss.spec.right(); + ss.format.right(); return ss; } @@ -214,7 +214,7 @@ namespace etl //********************************* friend basic_string_stream& operator <<(basic_string_stream& ss, TStringView view) { - etl::to_string(view, ss.text, ss.spec, true); + etl::to_string(view, ss.text, ss.format, true); return ss; } @@ -241,9 +241,9 @@ namespace etl //********************************* /// From a string interface //********************************* - friend basic_string_stream& operator <<(basic_string_stream& ss, const TIString& text) + friend basic_string_stream& operator <<(basic_string_stream& ss, const TIString& t) { - etl::to_string(text, ss.text, ss.spec, true); + etl::to_string(t, ss.text, ss.format, true); return ss; } @@ -251,9 +251,9 @@ namespace etl /// From a string //********************************* template