Skip to content

Commit

Permalink
Merge branch 'pull-request/#1021-Some-minor-cleanup-changes' into cle…
Browse files Browse the repository at this point in the history
…anup
  • Loading branch information
jwellbelove authored Jan 31, 2025
2 parents 5e6e683 + bbaa60b commit d2ea053
Show file tree
Hide file tree
Showing 178 changed files with 23,447 additions and 5,445 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -388,3 +388,8 @@ support/time remaining test.xlsx
test/vs2022/Debug MSVC C++20 - Force C++03
test/vs2022/Release MSVC C++20 - No STL - Optimised -O2 - Sanitiser
test/test_file_list.txt
examples/QueuedMessageRouter/vs2022/.vs/QueuedMessageRouter/CopilotIndices
examples/QueuedMessageRouter/vs2022/.vs/QueuedMessageRouter/FileContentIndex
examples/QueuedMessageRouter/vs2022/.vs/QueuedMessageRouter/v17
test/etl_error_handler/assert_errors/build-make
test/etl_error_handler/assert_function/build-make
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# How to contribute

If your are considering creating a pull request, please observe the following:

- If you are adding or modifying a feature, add *new* unit tests that test that feature.
- If you are fixing a bug, add a unit test that *fails* before the bug fix is implemented.
- Do not initiate a pull request until all of the units tests pass.
- Branches should be based on the branch `master`.

There is a project file for VS2022 for C++14, 17, 20, and bash scripts that run the tests for C++11, 14, 17, 20 under Linux with GCC and Clang.
2 changes: 1 addition & 1 deletion arduino/library-arduino.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Embedded Template Library ETL",
"version": "20.39.0",
"version": "20.39.5",
"authors": {
"name": "John Wellbelove",
"email": "john.wellbelove@etlcpp.com"
Expand Down
2 changes: 1 addition & 1 deletion arduino/library-arduino.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Embedded Template Library ETL
version=20.39.0
version=20.39.5
author= John Wellbelove <john.wellbelove@etlcpp.com>
maintainer=John Wellbelove <john.wellbelove@etlcpp.com>
license=MIT
Expand Down
2 changes: 1 addition & 1 deletion cmake/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function(determine_version_with_git)
git_describe(VERSION ${ARGN})
string(FIND ${VERSION} "." VALID_VERSION)
if(VALID_VERSION EQUAL -1)
if(PROJECT_IS_TOP_LEVEL)
if(CMAKE_CURRENT_LIST_DIR STREQUAL PROJECT_SOURCE_DIR)
# only warn if this is the top-level project, since we may be
# building from a tarball as a subproject
message(WARNING "Version string ${VERSION} retrieved with git describe is invalid")
Expand Down
2 changes: 0 additions & 2 deletions examples/QueuedMessageRouter/QueuedMessageRouter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ class Router : public etl::message_router<Router, Message1, Message2, Message3>

typedef etl::message_router<Router, Message1, Message2, Message3> Base_t;

using Base_t::receive;

//***************************************************************************
Router()
: message_router(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down
56 changes: 34 additions & 22 deletions include/etl/algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1449,16 +1449,20 @@ namespace etl
TCompare compare)
{
TIterator minimum = begin;
++begin;

while (begin != end)
if (begin != end)
{
if (compare(*begin, *minimum))
++begin;

while (begin != end)
{
minimum = begin;
}
if (compare(*begin, *minimum))
{
minimum = begin;
}

++begin;
++begin;
}
}

return minimum;
Expand Down Expand Up @@ -1493,16 +1497,20 @@ namespace etl
TCompare compare)
{
TIterator maximum = begin;
++begin;

while (begin != end)
if (begin != end)
{
if (!compare(*begin, *maximum))
++begin;

while (begin != end)
{
maximum = begin;
}
if (!compare(*begin, *maximum))
{
maximum = begin;
}

++begin;
++begin;
}
}

return maximum;
Expand Down Expand Up @@ -1538,21 +1546,25 @@ namespace etl
{
TIterator minimum = begin;
TIterator maximum = begin;
++begin;

while (begin != end)
if (begin != end)
{
if (compare(*begin, *minimum))
{
minimum = begin;
}
++begin;

if (compare(*maximum, *begin))
while (begin != end)
{
maximum = begin;
}
if (compare(*begin, *minimum))
{
minimum = begin;
}

++begin;
if (compare(*maximum, *begin))
{
maximum = begin;
}

++begin;
}
}

return ETL_OR_STD::pair<TIterator, TIterator>(minimum, maximum);
Expand Down
18 changes: 9 additions & 9 deletions include/etl/array_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,19 +239,19 @@ namespace etl
//*************************************************************************
template <typename TIterator>
ETL_CONSTEXPR array_view(const TIterator begin_, const TIterator end_)
: mbegin(etl::addressof(*begin_)),
mend(etl::addressof(*begin_) + etl::distance(begin_, end_))
: mbegin(etl::to_address(begin_)),
mend(etl::to_address(begin_) + etl::distance(begin_, end_))
{
}

//*************************************************************************
/// Construct from C array
/// Construct from iterator and size
//*************************************************************************
template <typename TIterator,
typename TSize>
ETL_CONSTEXPR array_view(const TIterator begin_, const TSize size_)
: mbegin(etl::addressof(*begin_)),
mend(etl::addressof(*begin_) + size_)
: mbegin(etl::to_address(begin_)),
mend(etl::to_address(begin_) + size_)
{
}

Expand Down Expand Up @@ -458,8 +458,8 @@ namespace etl
template <typename TIterator>
void assign(const TIterator begin_, const TIterator end_)
{
mbegin = etl::addressof(*begin_);
mend = etl::addressof(*begin_) + etl::distance(begin_, end_);
mbegin = etl::to_address(begin_);
mend = etl::to_address(begin_) + etl::distance(begin_, end_);
}

//*************************************************************************
Expand All @@ -469,8 +469,8 @@ namespace etl
typename TSize>
void assign(const TIterator begin_, const TSize size_)
{
mbegin = etl::addressof(*begin_);
mend = etl::addressof(*begin_) + size_;
mbegin = etl::to_address(begin_);
mend = etl::to_address(begin_) + size_;
}

#if defined(ETL_ARRAY_VIEW_IS_MUTABLE)
Expand Down
Loading

0 comments on commit d2ea053

Please sign in to comment.