38 Commits

Author SHA1 Message Date
David Hebbeker
3392a6cd88
add static assert with auto message (#740)
* Resolve all C++ -O2 warnings

Resolve all C++ -O2 warnings

Resolve all C++ -O2 warnings

* Updated release notes and version

* Made unit test suite names unique

* Added etl::bit_v for C++17

* add stringify macro (#741)

* Add include/linux/stringify.h from Linux kernel 2.6.12-rc2

(cherry picked from commit 1da177e4c3)

* Make __stringify support variable argument macros too

For example:

  __stringify(__entry->irq, __entry->ret)

will now convert it to:

  "REC->irq, REC->ret"

It also still supports single arguments as the old macro did.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <49DC6751.30308@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
(cherry picked from commit 8f7c2c3731)

* Add documentation.

* Adjust names in order to satisfy naming convention.

* Use __VA_ARGS__ instead a GNU extension as this works with more compilers.

Works with the newest versions of ICCAVR, GCC, CLANG and MSCV. C++11 may be required.

* Adjust to ETL folder structure.

* Change include guard to the one usual in ETL.

* Add definition guard for STRINGIFY.

---------

Co-authored-by: Linus Torvalds <torvalds@ppc970.osdl.org>
Co-authored-by: Zhaolei <zhaolei@cn.fujitsu.com>

* Updated stringify macro for variadic parameters

* Edited comments

* Added multi char type strcmp, strncmp, strcpy & strncpy

* Added support for self transitions

* Remove some unreachable code in bitset_new.h (#743)

Warning[Pe111]: statement is unreachable

* Re-enabled tests for etl::string_ext

* Changes require for non-virtual messages

* MutexMessageRouter example

* Allow C++03 delegate in etl::callback_timer

* #745 Assertion triggered in hash.h when compiling for MSP430

* Removed redundant #includes

* Removed unused variable

Minor format edit

* Added time_to_next() status function

* Added 'sentence case' versions of constants

* Added C++03 compatible etl::move or etl::move_backward

* Added c++03 zero parameter emplace member functions

* Fix issue of release of an object on empty an pool

* Remove used variable

* Remove used variable

* Change to require semicolons after debug count macros.

Added error assert for vector reserve greater than capacity.

* Added destructor to CMSIS_RTOS2 mutex

* Updated version and release notes

* Removed semicolon warnings

* Updated vesrion and release notes

* #753 [porting] IAR's overload resolution struggles with etl::span::span(etl::array&)

#754 ambiguous etl::bit_stream_reader::bit_stream_reader() for some etl::span

* #755 warning about constexpr in array.h

* Re-enabled tests

* const_reference at(size_t i) const is only constexpr from C++14

* Added conversion operators to std::span

* MacOS clang span issue

* MacOS clang span issue

* MacOS clang span issue

* MacOS clang span issue

* MacOS clang span issue

* Updated version and release notes

* Possible fix for #756

* Fixed: move assignment not working for non-empty containers (#759)

* Updated release notes

* Make "private" includes relativ (#761)

Avoid "include not found" when indirectly including etl-header

Co-authored-by: Andreas Pelczer <pelczer@stoerk-tronic.com>

* Make "private" includes relativ (#761)

Avoid "include not found" when indirectly including etl-header

Co-authored-by: Andreas Pelczer <pelczer@stoerk-tronic.com>

* Remove BOM from random.h (#762)

random.h is the only file with UTF8-BOM and IAR can not handle it.
For compatibility reasons it should be removed.

Co-authored-by: Andreas Pelczer <pelczer@stoerk-tronic.com>

* Enabled etl::overload for C++11 & C++14

* Added conversion operators to std::span

MacOS clang span issue

MacOS clang span issue

MacOS clang span issue

MacOS clang span issue

MacOS clang span issue

* Updated version and release notes

* Possible fix for #756

* Fixed: move assignment not working for non-empty containers (#759)

* Updated release notes

* Make "private" includes relativ (#761)

Avoid "include not found" when indirectly including etl-header

Co-authored-by: Andreas Pelczer <pelczer@stoerk-tronic.com>

* Remove BOM from random.h (#762)

random.h is the only file with UTF8-BOM and IAR can not handle it.
For compatibility reasons it should be removed.

Co-authored-by: Andreas Pelczer <pelczer@stoerk-tronic.com>

* Enabled etl::overload for C++11 & C++14

* Commets added

* #766 etl::unique_ptr::reset() can call deleter with nullptr argument

* Refactored storage for etl::optional

* Updated release notes

* Updated release notes

* Test name updates

* Fixed alignment functionality

* Updated versions

* Updated versions

* Initial code

* Final changes

* Fix maybe-uninitialized warning

* Fix maybe-uninitialized warning

* Added etl::string::fill()

* Added etl::string interface to etl::base64

* static_cast for string_view & array_view size() member functions

* Return raw pointer for `etl::multi_span::operator->()`. (#773)

- using `operator*()` in case getting the current element is changed one day
- using `&` to get the address

Simply returning `p_value` may break in case the internal type of `p_value` would change. This way it is more robust to changes.

* Added -> operator test

* #773 Return raw pointer for etl::multi_span::operator->()

* static_cast for string_view & array_view size() member functions

* Initial code

* Final changes

* Fix maybe-uninitialized warning

* Added etl::string::fill()

* Added etl::string interface to etl::base64

* Add missing semicolons (#776)

* #776 Add missing semicolons

* moved BUILD_TESTS check outside of root cmake check to allow building tests in submodules (#777)

added check for GNUC >= 11 for -Wstringop-overread ignore pragma since it isn't introduced until gcc/g++-11

Co-authored-by: Josh <joshua.martens@magna.com>

* Try to fix library error for Github Actions for Clang C++20

* Try to fix library error for Github Actions for Clang C++20

* Added pul-request branches to CI

* Removed temporary fix

* Refactored swap

* Added add_lvalue_reference for rvalue reference

* Revert "Added add_lvalue_reference for rvalue reference"

This reverts commit a09efffb8fadb0c25923fe5435b7b1f9bdd673f1.

* Updated  version and release notes

* Updated  version and release notes

* Try to fix library error for Github Actions for Clang C++20

(cherry picked from commit f208eb4073c98b3c190b17a73db3b61aa35fae25)

The line got lost in 95c7f44cc61d51406a70ccb9048724f9fbdd78f9.

* Add helper macro which enables function-like macro overload with 1 or 2 arguments.

Inspired by https://stackoverflow.com/a/11763277/

Warning: This requires support for variadic macros (`__VA_ARGS__`). These were officially added in C99 and C++11.

* Add unit test for static_assert.h

(cherry picked from commit 91e7f46effac2884de80a12ab0c7eda5ade5cabe)

* Add static assert overload for only 1 argument.

(cherry picked from commit ae8c19e8cba69ca209a13109a7225ce6281d945d)

* Add test case for static_assert with only 1 argument.

(cherry picked from commit 4d6e7a63094221feec22fe3addcccd903b2d81de)

* Spelling.

---------

Co-authored-by: John Wellbelove <jwellbelove@users.noreply.github.com>
Co-authored-by: David Hebbeker <dhebbeker@users.noreply.github.com>
Co-authored-by: Linus Torvalds <torvalds@ppc970.osdl.org>
Co-authored-by: Zhaolei <zhaolei@cn.fujitsu.com>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.com>
Co-authored-by: Soma Veszelovszki <soma.veszelovszki@gmail.com>
Co-authored-by: Andreas <and1p@web.de>
Co-authored-by: Andreas Pelczer <pelczer@stoerk-tronic.com>
Co-authored-by: H1MSK <ksda47832338@Outlook.com>
Co-authored-by: jmartens-42 <jmartens@jayhawk.us>
Co-authored-by: Josh <joshua.martens@magna.com>
Co-authored-by: John Wellbelove <john.wellbelove@etlcpp.co.uk>
2024-02-22 19:11:38 +00:00
John Wellbelove
9f4c5bbb94 C++11 unit tests - Work in progress 2023-04-30 11:06:23 +01:00
John Wellbelove
e78e7b474a Added etl:lsb_mask, etl::make_lsb_mask, etl::msb_mask and etl::make_msb_mask 2022-09-11 00:55:55 +01:00
John Wellbelove
baa47d1c33 Updated copyright notice 2022-06-10 21:45:37 +01:00
John Wellbelove
c99d984453 Updates to bin.h, binary.h and endian.h 2022-01-08 11:38:04 +00:00
John Wellbelove
dc563239e5 Added all permutations of leading/trailing bit tests 2022-01-03 18:21:19 +00:00
CanastraRF
7c0f169b66
literal with suffix (#416) 2021-08-23 11:01:18 +01:00
John Wellbelove
dbfa71944f Abstracted unit test framework header 2021-03-05 13:52:34 +00:00
John Wellbelove
5d4d111671 Added iterator API to all etl::frame_check_sequence based template classes, such as CRCs and checksums 2020-10-07 11:06:10 +01:00
John Wellbelove
0180a7c9bd Reduced warnings from cppcheck v2.2 2020-10-04 14:24:52 +01:00
John Wellbelove
e323f2267f Changed http://www.etlcpp.com to https://www.etlcpp.com 2020-05-01 10:22:36 +01:00
John Wellbelove
bff480b9a2 Removed ETL's implementation of nullptr for pre C++11 compilers.
Created the macro ETL_NULLPTR for internal use. Equates to NULL or nullptr, dependent on the compiler version and project profile.
Added partial compile time versions of binary_fill and has_zero_byte.
2020-03-28 19:16:55 +00:00
John Wellbelove
d59f53fe25 C++98/03 compatibility changes 2020-03-27 13:11:17 +00:00
John Wellbelove
83347ccfdd Work in progress 2020-01-09 11:15:50 +00:00
John Wellbelove
fc50557003 Work in progress 2020-01-04 11:20:29 +00:00
John Wellbelove
d6f8b69326 Merge remote-tracking branch 'origin/feature/determine_compiler_versions' into development
# Conflicts:
#	examples/ArmTimerCallbacks - C++/ArmTimerCallbacks.uvprojx
#	examples/ArmTimerCallbacks - C++/main.cpp
#	include/etl/algorithm.h
#	include/etl/platform.h
#	include/etl/stl/alternate/limits.h
#	include/etl/version.h
#	library.json
#	library.properties
#	support/Release notes.txt
#	test/codeblocks/ETL.cbp
#	test/etl_profile.h
#	test/vs2017/etl.vcxproj
#	test/vs2017/etl.vcxproj.filters
2019-12-27 12:57:34 +00:00
John Wellbelove
bd008350a2 Merge remote-tracking branch 'origin/feature/changed_include_paths' into development
# Conflicts:
#	include/etl/version.h
2018-07-28 21:55:27 +01:00
John Wellbelove
83d495bc21 Added binary_merge, binary_interleave, is_odd, is_even 2018-05-20 09:16:20 +01:00
John Wellbelove
27aa3a2ab3 Added new binary utilities 2018-04-29 19:59:46 +01:00
Austin Morton
dcd42ee17e Fix assumption that min/max macros will always be defined on a Microsoft compiler (#72)
Merge in min-max changes to a feature branch
2018-04-24 14:27:18 +01:00
John Wellbelove
39ad0fe808 Added sign_extend functions with shift parameter. 2017-12-15 13:59:03 +00:00
John Wellbelove
c0169188ca Made some templates into normal functions and moved to binary.cpp
Added bit<> template constant
Added bit enumerations
2017-12-05 18:49:50 +00:00
John Wellbelove
26b7326d72 Updated Code::Blocks project.
Changed test project include paths to use unittest++ as sub-module.
2017-05-08 20:48:22 +01:00
John Wellbelove
dfbd0391a2 Added various tests 2016-05-03 19:17:26 +01:00
John Wellbelove
f1c5c20ba7 Changed folder structure to be compatible with Arduino library specifications 2016-02-28 14:04:22 +00:00
John Wellbelove
85c60f5407 Added more sign_extend tests for unsigned values. 2016-02-28 13:51:09 +00:00
John Wellbelove
da8a31c19e Added sign_extend template 2016-02-27 16:54:51 +00:00
jwellbelove
01ff869fb5 Fixed test compile warnings 2016-01-13 16:10:15 +00:00
John Wellbelove
16a1978f43 Added link to www.etlcpp.com in licence header. 2015-12-16 11:09:56 +00:00
John Wellbelove
2645cdf3e0 Casts to keep GCC happy 2015-12-11 19:06:33 +00:00
John Wellbelove
7bea827b94 Modified tests due to hash changes 2015-09-28 18:30:32 +01:00
John Wellbelove
16117d9a5c Added etl::max_value_for_nbits
Fixed etl::fold_bits by using etl::max_value_for_nbits in while loop.
2015-09-25 12:00:18 +01:00
John Wellbelove
690a68610b Added 'fold_bits' functionality. 2015-09-13 20:57:12 +01:00
jwellbelove
1777bb5f33 Added count_bits & parity. 2015-02-23 21:11:34 +00:00
jwellbelove
ae385d5561 Added Github link to copyright notice. 2015-02-22 13:23:18 +00:00
jwellbelove
a72fb6ddc2 Added binary / gray code conversions. 2015-02-21 21:19:25 +00:00
jwellbelove
d4ae5c9775 Added rotate (+- distance) 2015-02-15 10:22:01 +00:00
jwellbelove
e6435b4cb4 Binary utlities 2015-02-15 09:57:21 +00:00