From b47c0a6c9bbedc8f6eec7c00999391847983f6db Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sat, 15 Sep 2018 09:56:54 +0100 Subject: [PATCH 1/6] Merge remote-tracking branch 'origin/development' --- include/etl/private/ivectorpointer.h | 18 --------- include/etl/state_chart.h | 60 ++++++++++++++++++++++------ include/etl/version.h | 12 +++--- support/Release notes.txt | 4 ++ test/codeblocks/ETL.cbp | 1 + test/test_state_chart.cpp | 4 +- 6 files changed, 60 insertions(+), 39 deletions(-) diff --git a/include/etl/private/ivectorpointer.h b/include/etl/private/ivectorpointer.h index 4a24a186..a24f2bad 100644 --- a/include/etl/private/ivectorpointer.h +++ b/include/etl/private/ivectorpointer.h @@ -335,15 +335,6 @@ namespace etl base_t::clear(); } - //************************************************************************* - /// Increases the size of the vector by one, but does not initialise the new element. - /// If asserts or exceptions are enabled, throws a vector_full if the vector is already full. - //************************************************************************* - void push_back() - { - base_t::push_back(); - } - //********************************************************************* /// Inserts a value at the end of the vector. /// If asserts or exceptions are enabled, emits vector_full if the vector is already full. @@ -737,15 +728,6 @@ namespace etl base_t::clear(); } - //************************************************************************* - /// Increases the size of the vector by one, but does not initialise the new element. - /// If asserts or exceptions are enabled, throws a vector_full if the vector is already full. - //************************************************************************* - void push_back() - { - base_t::push_back(); - } - //********************************************************************* /// Inserts a value at the end of the vector. /// If asserts or exceptions are enabled, emits vector_full if the vector is already full. diff --git a/include/etl/state_chart.h b/include/etl/state_chart.h index 18fab61b..486316a1 100644 --- a/include/etl/state_chart.h +++ b/include/etl/state_chart.h @@ -127,31 +127,65 @@ namespace etl //************************************************************************* /// Constructor. - /// \tparam TRANSITION_TABLE_SIZE The transition table size. - /// \param object_ A reference to the implementation object. - /// \param transition_table_ The table of transitions. - /// \param state_id_ The initial state id. + /// \param object_ A reference to the implementation object. + /// \param transition_table_begin_ The start of the table of transitions. + /// \param transition_table_end_ The end of the table of transitions. + /// \param state_id_ The initial state id. //************************************************************************* - template state_chart(TObject& object_, - const etl::array& transition_table_, + const transition* transition_table_begin_, + const transition* transition_table_end_, const state_id_t state_id_) : istate_chart(state_id_), object(object_), - transition_table(transition_table_.begin(), transition_table_.end()), + transition_table(transition_table_begin_, transition_table_end_), started(false) { } //************************************************************************* - /// Sets the state table. - /// \tparam STATE_TABLE_SIZE The state table size. - /// \param state_table_ A reference to the state table. + /// Constructor. + /// \param object_ A reference to the implementation object. + /// \param transition_table_begin_ The start of the table of transitions. + /// \param transition_table_end_ The end of the table of transitions. + /// \param state_table_begin_ The start of the state table. + /// \param state_table_end_ The end of the state table. + /// \param state_id_ The initial state id. //************************************************************************* - template - void set_state_table(const etl::array& state_table_) + state_chart(TObject& object_, + const transition* transition_table_begin_, + const transition* transition_table_end_, + const state* state_table_begin_, + const state* state_table_end_, + const state_id_t state_id_) + : istate_chart(state_id_), + object(object_), + transition_table(transition_table_begin_, transition_table_end_), + state_table(state_table_begin_, state_table_end_), + started(false) { - state_table.assign(state_table_.begin(), state_table_.end()); + } + + //************************************************************************* + /// Sets the transition table. + /// \param state_table_begin_ The start of the state table. + /// \param state_table_end_ The end of the state table. + //************************************************************************* + void set_transition_table(const transition* transition_table_begin_, + const transition* transition_table_end_) + { + transition_table.assign(transition_table_begin_, transition_table_end_); + } + + //************************************************************************* + /// Sets the state table. + /// \param state_table_begin_ The start of the state table. + /// \param state_table_end_ The end of the state table. + //************************************************************************* + void set_state_table(const state* state_table_begin_, + const state* state_table_end_) + { + state_table.assign(state_table_begin_, state_table_end_); } //************************************************************************* diff --git a/include/etl/version.h b/include/etl/version.h index 64ee56ab..569fe3f8 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -37,12 +37,12 @@ SOFTWARE. /// Definitions of the ETL version ///\ingroup utilities -#define ETL_VERSION "11.19.0" -#define ETL_VERSION_W L"11.19.0" -#define ETL_VERSION_U16 u"11.19.0" -#define ETL_VERSION_U32 U"11.19.0" -#define ETL_VERSION_MAJOR 11 -#define ETL_VERSION_MINOR 19 +#define ETL_VERSION "12.0.0" +#define ETL_VERSION_W L"12.0.0" +#define ETL_VERSION_U16 u"12.0.0" +#define ETL_VERSION_U32 U"12.0.0" +#define ETL_VERSION_MAJOR 12 +#define ETL_VERSION_MINOR 0 #define ETL_VERSION_PATCH 0 #define ETL_VERSION_VALUE ((ETL_VERSION_MAJOR * 10000) + (ETL_VERSION_MINOR * 100) + ETL_VERSION_PATCH) diff --git a/support/Release notes.txt b/support/Release notes.txt index 762780bf..7c2f5f3f 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,7 @@ +=============================================================================== +12.0.0 +Modified the API of etl::state_chart constructors. + =============================================================================== 11.19.0 Removed push(void) push_back(void) and push_front(void) function for containers. diff --git a/test/codeblocks/ETL.cbp b/test/codeblocks/ETL.cbp index b4a78c2f..8c0190fe 100644 --- a/test/codeblocks/ETL.cbp +++ b/test/codeblocks/ETL.cbp @@ -323,6 +323,7 @@ + diff --git a/test/test_state_chart.cpp b/test/test_state_chart.cpp index 6cfb651c..2760afd0 100644 --- a/test/test_state_chart.cpp +++ b/test/test_state_chart.cpp @@ -86,9 +86,9 @@ namespace public: MotorControl() - : state_chart(*this, transitionTable, StateId::IDLE) + : state_chart(*this, transitionTable.begin(), transitionTable.end(), StateId::IDLE) { - this->set_state_table(stateTable); + this->set_state_table(stateTable.begin(), stateTable.end()); ClearStatistics(); } From 65c0de91108bbec1b3c957278a15fa36d0457dac Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Tue, 18 Sep 2018 18:39:35 +0100 Subject: [PATCH 2/6] Merge remote-tracking branch 'origin/development' # Conflicts: # include/etl/version.h # support/Release notes.txt --- include/etl/state_chart.h | 15 ++++++++++----- include/etl/version.h | 10 +++++----- support/Release notes.txt | 5 +++++ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/include/etl/state_chart.h b/include/etl/state_chart.h index 486316a1..ba8badfa 100644 --- a/include/etl/state_chart.h +++ b/include/etl/state_chart.h @@ -45,9 +45,10 @@ namespace etl { public: - typedef uint32_t state_id_t; - typedef uint32_t event_id_t; + typedef int state_id_t; + typedef int event_id_t; + virtual void start(const bool on_entry_initial = true) = 0; virtual void process_event(const event_id_t event_id) = 0; //************************************************************************* @@ -71,6 +72,7 @@ namespace etl } state_id_t current_state_id; ///< The current state id. + state_id_t next_state_id; ///< The next state id. }; //*************************************************************************** @@ -273,6 +275,9 @@ namespace etl // Shall we execute the transition? if ((t->guard == nullptr) || ((object.*t->guard)())) { + // Remember the next state. + next_state_id = t->next_state_id; + // Shall we execute the action? if (t->action != nullptr) { @@ -280,7 +285,7 @@ namespace etl } // Changing state? - if (current_state_id != t->next_state_id) + if (current_state_id != next_state_id) { const state* s; @@ -294,7 +299,7 @@ namespace etl } // See if we have a state item for the next state. - s = find_state(t->next_state_id); + s = find_state(next_state_id); // If the new state has an 'on_entry' then call it. if ((s != state_table.end()) && (s->on_entry != nullptr)) @@ -302,7 +307,7 @@ namespace etl (object.*(s->on_entry))(); } - current_state_id = t->next_state_id; + current_state_id = next_state_id; } t = transition_table.end(); diff --git a/include/etl/version.h b/include/etl/version.h index 569fe3f8..12c1c595 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -37,13 +37,13 @@ SOFTWARE. /// Definitions of the ETL version ///\ingroup utilities -#define ETL_VERSION "12.0.0" -#define ETL_VERSION_W L"12.0.0" -#define ETL_VERSION_U16 u"12.0.0" -#define ETL_VERSION_U32 U"12.0.0" +#define ETL_VERSION "12.0.1" +#define ETL_VERSION_W L"12.0.1" +#define ETL_VERSION_U16 u"12.0.1" +#define ETL_VERSION_U32 U"12.0.1" #define ETL_VERSION_MAJOR 12 #define ETL_VERSION_MINOR 0 -#define ETL_VERSION_PATCH 0 +#define ETL_VERSION_PATCH 1 #define ETL_VERSION_VALUE ((ETL_VERSION_MAJOR * 10000) + (ETL_VERSION_MINOR * 100) + ETL_VERSION_PATCH) #endif diff --git a/support/Release notes.txt b/support/Release notes.txt index 7c2f5f3f..7e8d147c 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,8 @@ +=============================================================================== +12.0.1 +Modified state_chart to accept recursive events. +Made start() virtual. + =============================================================================== 12.0.0 Modified the API of etl::state_chart constructors. From ece332630dc4d426906e62b27821bbafaae60c91 Mon Sep 17 00:00:00 2001 From: Arek Sredzki Date: Thu, 20 Sep 2018 04:51:48 -0700 Subject: [PATCH 3/6] Use `deleter` in `etl::unique_ptr::reset(...)` (#98) --- include/etl/memory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/etl/memory.h b/include/etl/memory.h index fca5ff44..0be98a1b 100644 --- a/include/etl/memory.h +++ b/include/etl/memory.h @@ -864,7 +864,7 @@ namespace etl pointer value = p; p = p_; - delete value; + deleter(value); } void swap(unique_ptr& value) From fb3d4d78fa0173035b97e5a2a85c94c8f30ad9de Mon Sep 17 00:00:00 2001 From: Austin Morton Date: Fri, 21 Sep 2018 02:34:16 -0400 Subject: [PATCH 4/6] Use diagnostic push and pop when suppressing GCC warnings to prevent suppressions from impacting code outside of ETL (#99) --- include/etl/basic_string.h | 5 +++++ include/etl/private/pvoidvector.h | 5 +++++ include/etl/vector.h | 7 ++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/etl/basic_string.h b/include/etl/basic_string.h index b823293d..d7536fea 100644 --- a/include/etl/basic_string.h +++ b/include/etl/basic_string.h @@ -54,6 +54,7 @@ SOFTWARE. #define ETL_FILE "27" #ifdef ETL_COMPILER_GCC +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-variable" #endif @@ -2232,6 +2233,10 @@ namespace etl #include "private/minmax_pop.h" +#ifdef ETL_COMPILER_GCC +#pragma GCC diagnostic pop +#endif + #undef ETL_FILE #endif diff --git a/include/etl/private/pvoidvector.h b/include/etl/private/pvoidvector.h index 1a03fb43..28fe1bd3 100644 --- a/include/etl/private/pvoidvector.h +++ b/include/etl/private/pvoidvector.h @@ -45,6 +45,7 @@ SOFTWARE. #include "../stl/iterator.h" #ifdef ETL_COMPILER_GCC +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-variable" #endif @@ -204,6 +205,10 @@ namespace etl #include "minmax_pop.h" +#ifdef ETL_COMPILER_GCC +#pragma GCC diagnostic pop +#endif + #undef ETL_IN_PVOIDVECTOR #endif diff --git a/include/etl/vector.h b/include/etl/vector.h index 12059dd0..3e0f9a2d 100644 --- a/include/etl/vector.h +++ b/include/etl/vector.h @@ -59,7 +59,8 @@ SOFTWARE. #endif #ifdef ETL_COMPILER_GCC - #pragma GCC diagnostic ignored "-Wunused-variable" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" #endif //***************************************************************************** @@ -1223,4 +1224,8 @@ namespace etl #include "private/ivectorpointer.h" +#ifdef ETL_COMPILER_GCC +#pragma GCC diagnostic pop +#endif + #endif From df842eacec2b6f9a2ca218de43704f9a4756d812 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Sat, 22 Sep 2018 13:37:25 +0100 Subject: [PATCH 5/6] Merge remote-tracking branch 'origin/development' # Conflicts: # include/etl/version.h # support/Release notes.txt --- include/etl/random.h | 23 +++++++++++++++ include/etl/version.h | 10 +++---- src/random.cpp | 61 +++++++++++++++++++++++++++++++++++++++ support/Release notes.txt | 4 +++ test/test_random.cpp | 57 ++++++++++++++++++++++++++++++++++-- test/vs2017/.gitignore | 1 + 6 files changed, 149 insertions(+), 7 deletions(-) diff --git a/include/etl/random.h b/include/etl/random.h index f94774f2..63ee1603 100644 --- a/include/etl/random.h +++ b/include/etl/random.h @@ -162,6 +162,29 @@ namespace etl uint32_t value1; uint32_t value2; }; + + //*************************************************************************** + /// A 32 bit random number generator. + /// Uses a permuted congruential generator calculation. + /// https://en.wikipedia.org/wiki/Permuted_congruential_generator + //*************************************************************************** + class random_pcg : public random + { + public: + + random_pcg(); + explicit random_pcg(uint32_t seed); + void initialise(uint32_t seed); + uint32_t operator()(); + uint32_t range(uint32_t low, uint32_t high); + + private: + + static const uint64_t multiplier = 6364136223846793005ULL; + static const uint64_t increment = 1ULL; + + uint64_t value; + }; } #endif diff --git a/include/etl/version.h b/include/etl/version.h index 12c1c595..365eebfd 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -37,12 +37,12 @@ SOFTWARE. /// Definitions of the ETL version ///\ingroup utilities -#define ETL_VERSION "12.0.1" -#define ETL_VERSION_W L"12.0.1" -#define ETL_VERSION_U16 u"12.0.1" -#define ETL_VERSION_U32 U"12.0.1" +#define ETL_VERSION "12.1.1" +#define ETL_VERSION_W L"12.1.1" +#define ETL_VERSION_U16 u"12.1.1" +#define ETL_VERSION_U32 U"12.1.1" #define ETL_VERSION_MAJOR 12 -#define ETL_VERSION_MINOR 0 +#define ETL_VERSION_MINOR 1 #define ETL_VERSION_PATCH 1 #define ETL_VERSION_VALUE ((ETL_VERSION_MAJOR * 10000) + (ETL_VERSION_MINOR * 100) + ETL_VERSION_PATCH) diff --git a/src/random.cpp b/src/random.cpp index ba1b0ba9..d754cf79 100644 --- a/src/random.cpp +++ b/src/random.cpp @@ -30,6 +30,7 @@ SOFTWARE. #include "etl/platform.h" #include "etl/random.h" +#include "etl/binary.h" namespace etl { @@ -349,4 +350,64 @@ namespace etl return n; } + + //*************************************************************************** + // Permuted congruential generator. + //*************************************************************************** + + //*************************************************************************** + /// Default constructor. + /// Attempts to come up with a unique non-zero seed. + //*************************************************************************** + random_pcg::random_pcg() + { + // An attempt to come up with a unique non-zero seed, + // based on the address of the instance. + uintptr_t n = reinterpret_cast(this); + value = static_cast(n); + } + + //*************************************************************************** + /// Constructor with seed value. + ///\param seed The new seed value. + //*************************************************************************** + random_pcg::random_pcg(uint32_t seed) + { + initialise(seed); + } + + //*************************************************************************** + /// Initialises the sequence with a new seed value. + ///\param seed The new seed value. + //*************************************************************************** + void random_pcg::initialise(uint32_t seed) + { + value = uint64_t(seed) | (uint64_t(seed) << 32); + } + + //*************************************************************************** + /// Get the next random_lsfr number. + //*************************************************************************** + uint32_t random_pcg::operator()() + { + uint64_t x = value; + unsigned count = (unsigned)(value >> 59); + + value = (x * multiplier) + increment; + x ^= x >> 18; + return etl::rotate_right((uint32_t)(x >> 27), count); + } + + //*************************************************************************** + /// Get the next random_lsfr number in a specified inclusive range. + //*************************************************************************** + uint32_t random_pcg::range(uint32_t low, uint32_t high) + { + uint32_t r = high - low + 1; + uint32_t n = operator()(); + n %= r; + n += low; + + return n; + } } diff --git a/support/Release notes.txt b/support/Release notes.txt index 7e8d147c..4be3e53c 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,7 @@ +=============================================================================== +12.1.1 +Added random_pcg Permuted Congruential Generator + =============================================================================== 12.0.1 Modified state_chart to accept recursive events. diff --git a/test/test_random.cpp b/test/test_random.cpp index 4c77912b..4166c184 100644 --- a/test/test_random.cpp +++ b/test/test_random.cpp @@ -253,7 +253,7 @@ namespace } //========================================================================= - TEST(test_random_fast_sequence) + TEST(test_random_mwc_sequence) { std::vector out1(10000); etl::random_mwc r; @@ -289,7 +289,7 @@ namespace } //========================================================================= - TEST(test_random_fast_range) + TEST(test_random_mwc_range) { etl::random_mwc r; @@ -304,5 +304,58 @@ namespace CHECK(n <= high); } } + + //========================================================================= + TEST(test_random_pcg_sequence) + { + std::vector out1(10000); + etl::random_pcg r; + + struct generator + { + generator(etl::random& r_) + : r(r_) + { + } + + uint32_t operator()() + { + return r(); + } + + etl::random& r; + }; + + std::generate(out1.begin(), out1.end(), generator(r)); + + std::ofstream file("random_pcg.csv"); + + if (!file.fail()) + { + for (size_t i = 0; i < out1.size(); i += 2) + { + file << out1[i] << "," << out1[i + 1] << "\n"; + } + } + + file.close(); + } + + //========================================================================= + TEST(test_random_pcg_range) + { + etl::random_pcg r; + + uint32_t low = 1234; + uint32_t high = 9876; + + for (int i = 0; i < 100000; ++i) + { + uint32_t n = r.range(low, high); + + CHECK(n >= low); + CHECK(n <= high); + } + } }; } diff --git a/test/vs2017/.gitignore b/test/vs2017/.gitignore index c1a708db..ba0b1b50 100644 --- a/test/vs2017/.gitignore +++ b/test/vs2017/.gitignore @@ -3,3 +3,4 @@ /random_lsfr.csv /random_mwc.csv /random_xorshift.csv +/random_pcg.csv From c505e9a52238133256dc130c2a7cf28a78061bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Burdukiewicz?= Date: Sat, 29 Sep 2018 20:23:45 +0200 Subject: [PATCH 6/6] Removed repeated semicolon, this helps to compile etl without errors (#100) with -pedantic/-pedantic-errors flags. --- include/etl/flat_multimap.h | 2 +- include/etl/intrusive_forward_list.h | 4 ++-- include/etl/intrusive_list.h | 4 ++-- include/etl/queue_mpmc_mutex.h | 2 +- include/etl/queue_spsc_isr.h | 2 +- include/etl/reference_flat_multiset.h | 2 +- include/etl/reference_flat_set.h | 2 +- include/etl/stl/alternate/limits.h | 2 +- include/etl/string_view.h | 12 ++++++------ 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/etl/flat_multimap.h b/include/etl/flat_multimap.h index d6c3aefc..8244862f 100644 --- a/include/etl/flat_multimap.h +++ b/include/etl/flat_multimap.h @@ -499,7 +499,7 @@ namespace etl //********************************************************************* size_t count(key_parameter_t key) const { - return refmap_t::count(key);; + return refmap_t::count(key); } //********************************************************************* diff --git a/include/etl/intrusive_forward_list.h b/include/etl/intrusive_forward_list.h index 49ec0e97..57d0c565 100644 --- a/include/etl/intrusive_forward_list.h +++ b/include/etl/intrusive_forward_list.h @@ -248,7 +248,7 @@ namespace etl //************************************************************************* bool is_trivial_list() const { - return (start_link.link_type::etl_next == nullptr) || (start_link.link_type::etl_next->etl_next == nullptr);; + return (start_link.link_type::etl_next == nullptr) || (start_link.link_type::etl_next->etl_next == nullptr); } //************************************************************************* @@ -598,7 +598,7 @@ namespace etl //************************************************************************* const_reference front() const { - return static_cast(*(this->get_head()));; + return static_cast(*(this->get_head())); } //************************************************************************* diff --git a/include/etl/intrusive_list.h b/include/etl/intrusive_list.h index 9c5c2ef0..b7b575b1 100644 --- a/include/etl/intrusive_list.h +++ b/include/etl/intrusive_list.h @@ -667,7 +667,7 @@ namespace etl //************************************************************************* const_reference front() const { - return *static_cast(this->get_head());; + return *static_cast(this->get_head()); } //************************************************************************* @@ -683,7 +683,7 @@ namespace etl //************************************************************************* const_reference back() const { - return *static_cast(this->get_tail());; + return *static_cast(this->get_tail()); } //************************************************************************* diff --git a/include/etl/queue_mpmc_mutex.h b/include/etl/queue_mpmc_mutex.h index 16ec5e53..35279d11 100644 --- a/include/etl/queue_mpmc_mutex.h +++ b/include/etl/queue_mpmc_mutex.h @@ -308,7 +308,7 @@ namespace etl value = p_buffer[read_index]; p_buffer[read_index].~T(); - read_index = get_next_index(read_index, MAX_SIZE);; + read_index = get_next_index(read_index, MAX_SIZE); --current_size; diff --git a/include/etl/queue_spsc_isr.h b/include/etl/queue_spsc_isr.h index dc5922cb..d09f6c37 100644 --- a/include/etl/queue_spsc_isr.h +++ b/include/etl/queue_spsc_isr.h @@ -193,7 +193,7 @@ namespace etl value = p_buffer[read_index]; p_buffer[read_index].~T(); - read_index = get_next_index(read_index, MAX_SIZE);; + read_index = get_next_index(read_index, MAX_SIZE); --current_size; diff --git a/include/etl/reference_flat_multiset.h b/include/etl/reference_flat_multiset.h index 1cf5ca32..8c63f6ff 100644 --- a/include/etl/reference_flat_multiset.h +++ b/include/etl/reference_flat_multiset.h @@ -548,7 +548,7 @@ namespace etl //********************************************************************* void erase(iterator first, iterator last) { - lookup.erase(first.ilookup, last.ilookup);; + lookup.erase(first.ilookup, last.ilookup); } //************************************************************************* diff --git a/include/etl/reference_flat_set.h b/include/etl/reference_flat_set.h index cfbc4793..7e934307 100644 --- a/include/etl/reference_flat_set.h +++ b/include/etl/reference_flat_set.h @@ -528,7 +528,7 @@ namespace etl //********************************************************************* void erase(iterator first, iterator last) { - lookup.erase(first.ilookup, last.ilookup);; + lookup.erase(first.ilookup, last.ilookup); } //************************************************************************* diff --git a/include/etl/stl/alternate/limits.h b/include/etl/stl/alternate/limits.h index 231d7736..5d9677d5 100644 --- a/include/etl/stl/alternate/limits.h +++ b/include/etl/stl/alternate/limits.h @@ -121,7 +121,7 @@ SOFTWARE. template const bool etl_integral_type::is_specialized = true; template const int etl_integral_type::digits = (CHAR_BIT * sizeof(T)) - (etl::is_signed::value ? 1 : 0); - template const int etl_integral_type::digits10 = ETL_LOG2(digits);; + template const int etl_integral_type::digits10 = ETL_LOG2(digits); template const int etl_integral_type::max_digits10 = 0; template const bool etl_integral_type::is_signed = etl::is_signed::value; template const bool etl_integral_type::is_integer = true; diff --git a/include/etl/string_view.h b/include/etl/string_view.h index 10240fed..39ccd7ff 100644 --- a/include/etl/string_view.h +++ b/include/etl/string_view.h @@ -630,17 +630,17 @@ namespace etl size_type find_last_of(T c, size_type position = npos) const { - return find_last_of(etl::basic_string_view(&c, 1), position);; + return find_last_of(etl::basic_string_view(&c, 1), position); } size_type find_last_of(const T* text, size_type position, size_type count) const { - return find_last_of(etl::basic_string_view(text, count), position);; + return find_last_of(etl::basic_string_view(text, count), position); } size_type find_last_of(const T* text, size_type position = npos) const { - return find_last_of(etl::basic_string_view(text), position);; + return find_last_of(etl::basic_string_view(text), position); } //************************************************************************* @@ -733,17 +733,17 @@ namespace etl size_type find_last_not_of(T c, size_type position = npos) const { - return find_last_not_of(etl::basic_string_view(&c, 1), position);; + return find_last_not_of(etl::basic_string_view(&c, 1), position); } size_type find_last_not_of(const T* text, size_type position, size_type count) const { - return find_last_not_of(etl::basic_string_view(text, count), position);; + return find_last_not_of(etl::basic_string_view(text, count), position); } size_type find_last_not_of(const T* text, size_type position = npos) const { - return find_last_not_of(etl::basic_string_view(text), position);; + return find_last_not_of(etl::basic_string_view(text), position); } //*************************************************************************