diff --git a/examples/Blink/Blink1/__vm/.gitignore b/examples/Blink/Blink1/__vm/.gitignore new file mode 100644 index 00000000..2532f6f4 --- /dev/null +++ b/examples/Blink/Blink1/__vm/.gitignore @@ -0,0 +1,2 @@ +*.vsarduino.h +*.vmps.xml diff --git a/examples/BlinkList/BlinkList.ino b/examples/BlinkList/BlinkList.ino index af93b104..fa013563 100644 --- a/examples/BlinkList/BlinkList.ino +++ b/examples/BlinkList/BlinkList.ino @@ -5,7 +5,6 @@ #undef min #undef max -#include // Contains platform macros for Arduino. #include #include diff --git a/examples/BlinkList/VisualMicro/BlinkList.sln b/examples/BlinkList/VisualMicro/BlinkList.sln new file mode 100644 index 00000000..dd9fc4f7 --- /dev/null +++ b/examples/BlinkList/VisualMicro/BlinkList.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.24720.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BlinkList", "BlinkList.vcxproj", "{C5F80730-F44F-4478-BDAE-6634EFC2CA88}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C5F80730-F44F-4478-BDAE-6634EFC2CA88}.Debug|x86.ActiveCfg = Debug|Win32 + {C5F80730-F44F-4478-BDAE-6634EFC2CA88}.Debug|x86.Build.0 = Debug|Win32 + {C5F80730-F44F-4478-BDAE-6634EFC2CA88}.Release|x86.ActiveCfg = Release|Win32 + {C5F80730-F44F-4478-BDAE-6634EFC2CA88}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/examples/BlinkList/VisualMicro/BlinkList.vcxproj b/examples/BlinkList/VisualMicro/BlinkList.vcxproj new file mode 100644 index 00000000..4e62a984 --- /dev/null +++ b/examples/BlinkList/VisualMicro/BlinkList.vcxproj @@ -0,0 +1,86 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {C5F80730-F44F-4478-BDAE-6634EFC2CA88} + BlinkList + BlinkList + + + + Application + true + v140 + MultiByte + + + Application + false + v140 + true + MultiByte + + + + + + + + + + + + + + + Level3 + Disabled + true + C:\Users\John\AppData\Local\arduino15\packages\arduino\hardware\samd\1.6.4\cores\arduino;C:\Users\John\AppData\Local\arduino15\packages\arduino\hardware\samd\1.6.4\variants\arduino_zero;D:\Users\John\Documents\Programming\GitHub\etl\examples\BlinkList;D:\Users\John\Documents\Programming\Arduino\libraries\etl\src;D:\Users\John\Documents\Programming\Arduino\libraries\etl\src\utility;C:\Program Files (x86)\Arduino\libraries;C:\Users\John\AppData\Local\arduino15\packages\arduino\hardware\samd\1.6.4\libraries;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\ljgwsum3.rbu\Micro Platforms\default\debuggers;D:\Users\John\Documents\Programming\Arduino\libraries;C:\Users\John\AppData\Local\arduino15\packages\arduino\tools\CMSIS\4.0.0-atmel/CMSIS/Include/;C:\Users\John\AppData\Local\arduino15\packages\arduino\tools\CMSIS\4.0.0-atmel/Device/ATMEL/;C:\Users\John\AppData\Local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3;C:\Users\John\AppData\Local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\arm-none-eabi;C:\Users\John\AppData\Local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\bits;C:\Users\John\AppData\Local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include;C:\Users\John\AppData\Local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\sys;C:\Users\John\AppData\Local\arduino15\packages\arduino\hardware\samd\1.6.4\system;C:\Users\John\AppData\Local\arduino15\packages\arduino\hardware\samd/avr;C:\Users\John\AppData\Local\arduino15\packages\arduino\hardware\samd/usb;C:\Users\John\AppData\Local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\lib\gcc\arm-none-eabi\4.8.3\include;C:\Users\John\AppData\Local\arduino15\packages\arduino\tools\CMSIS\4.0.0-atmel;C:\Users\John\AppData\Local\arduino15\packages\arduino\tools\CMSIS\4.0.0-atmel\Device\ATMEL\samd21\include;C:\Users\John\AppData\Local\arduino15\packages\arduino\tools\CMSIS\4.0.0-atmel\CMSIS\include;C:\Users\John\AppData\Local\arduino15\packages\arduino\tools\CMSIS\4.0.0-atmel\Device\ATMEL\samd21\include\component;C:\Users\John\AppData\Local\arduino15\packages\arduino\tools\CMSIS\4.0.0-atmel\Device\ATMEL\samd21\include\instance;C:\Users\John\AppData\Local\arduino15\packages\arduino\tools\CMSIS\4.0.0-atmel\Device\ATMEL\samd21\include\pio;C:\Users\John\AppData\Local\arduino15\packages\arduino\tools\CMSIS\4.0.0-atmel\Device\ATMEL\samd21\include\component;%(AdditionalIncludeDirectories) + D:\Users\John\Documents\Programming\GitHub\etl\examples\BlinkList\VisualMicro\__vm\.BlinkList.vsarduino.h;%(ForcedIncludeFiles) + false + _VMDEBUG=1;F_CPU=48000000L;ARDUINO=10607;ARDUINO_SAMD_ZERO;ARDUINO_ARCH_SAMD;__SAMD21G18A__;USB_VID=0x2341;USB_PID=0x804d;USBCON;__cplusplus=201103L;%(PreprocessorDefinitions) + + + true + + + + + Level3 + MaxSpeed + true + true + true + + + true + true + true + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/BlinkList/VisualMicro/BlinkList.vcxproj.filters b/examples/BlinkList/VisualMicro/BlinkList.vcxproj.filters new file mode 100644 index 00000000..c7b8efb2 --- /dev/null +++ b/examples/BlinkList/VisualMicro/BlinkList.vcxproj.filters @@ -0,0 +1,28 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + Header Files + + + Header Files + + + \ No newline at end of file diff --git a/examples/BlinkList/VisualMicro/__vm/.gitignore b/examples/BlinkList/VisualMicro/__vm/.gitignore new file mode 100644 index 00000000..435f8fdf --- /dev/null +++ b/examples/BlinkList/VisualMicro/__vm/.gitignore @@ -0,0 +1 @@ +*.vsarduino.h diff --git a/examples/BlinkList/__vm/.gitignore b/examples/BlinkList/__vm/.gitignore new file mode 100644 index 00000000..c572b2d9 --- /dev/null +++ b/examples/BlinkList/__vm/.gitignore @@ -0,0 +1 @@ +*.vmps.xml diff --git a/library.properties b/library.properties index 1bc048c2..e0e13cc2 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Embedded Template Library -version=8.0.2 +version=8.0.3 author= John Wellbelove maintainer=John Wellbelove sentence=A C++ template library tailored for embedded systems. diff --git a/src/bitset.h b/src/bitset.h index 3f5d41b3..764e9d4c 100644 --- a/src/bitset.h +++ b/src/bitset.h @@ -36,6 +36,7 @@ SOFTWARE. #include #include +#include "platform.h" #include "integral_limits.h" #include "algorithm.h" #include "nullptr.h" @@ -45,7 +46,7 @@ SOFTWARE. #define ETL_NO_CHECKS #include "error_handler.h" -#if defined(COMPILER_KEIL) +#if defined(ETL_COMPILER_KEIL) #pragma diag_suppress 1300 #endif diff --git a/src/crc16.h b/src/crc16.h index 5c20f6d1..18dc88e6 100644 --- a/src/crc16.h +++ b/src/crc16.h @@ -34,9 +34,10 @@ SOFTWARE. #include #include +#include "platform.h" #include "frame_check_sequence.h" -#if defined(COMPILER_KEIL) +#if defined(ETL_COMPILER_KEIL) #pragma diag_suppress 1300 #endif diff --git a/src/crc16_ccitt.h b/src/crc16_ccitt.h index e991bc8c..3cedd827 100644 --- a/src/crc16_ccitt.h +++ b/src/crc16_ccitt.h @@ -34,9 +34,10 @@ SOFTWARE. #include #include +#include "platform.h" #include "frame_check_sequence.h" -#if defined(COMPILER_KEIL) +#if defined(ETL_COMPILER_KEIL) #pragma diag_suppress 1300 #endif diff --git a/src/crc16_kermit.h b/src/crc16_kermit.h index 5334054b..146b8504 100644 --- a/src/crc16_kermit.h +++ b/src/crc16_kermit.h @@ -34,9 +34,10 @@ SOFTWARE. #include #include +#include "platform.h" #include "frame_check_sequence.h" -#if defined(COMPILER_KEIL) +#if defined(ETL_COMPILER_KEIL) #pragma diag_suppress 1300 #endif diff --git a/src/crc32.h b/src/crc32.h index 43412ee5..477fdfa6 100644 --- a/src/crc32.h +++ b/src/crc32.h @@ -34,9 +34,10 @@ SOFTWARE. #include #include +#include "platform.h" #include "frame_check_sequence.h" -#if defined(COMPILER_KEIL) +#if defined(ETL_COMPILER_KEIL) #pragma diag_suppress 1300 #endif diff --git a/src/crc64_ecma.h b/src/crc64_ecma.h index a97c81c3..c098d611 100644 --- a/src/crc64_ecma.h +++ b/src/crc64_ecma.h @@ -34,9 +34,10 @@ SOFTWARE. #include #include +#include "platform.h" #include "frame_check_sequence.h" -#if defined(COMPILER_KEIL) +#if defined(ETL_COMPILER_KEIL) #pragma diag_suppress 1300 #endif diff --git a/src/crc8_ccitt.h b/src/crc8_ccitt.h index 0a4721bc..112b2945 100644 --- a/src/crc8_ccitt.h +++ b/src/crc8_ccitt.h @@ -34,9 +34,10 @@ SOFTWARE. #include #include +#include "platform.h" #include "frame_check_sequence.h" -#if defined(COMPILER_KEIL) +#if defined(ETL_COMPILER_KEIL) #pragma diag_suppress 1300 #endif diff --git a/src/fnv_1.h b/src/fnv_1.h index 5ed5217d..5ae00dac 100644 --- a/src/fnv_1.h +++ b/src/fnv_1.h @@ -33,11 +33,12 @@ SOFTWARE. #include +#include "platform.h" #include "static_assert.h" #include "type_traits.h" #include "ihash.h" -#if defined(COMPILER_KEIL) +#if defined(ETL_COMPILER_KEIL) #pragma diag_suppress 1300 #endif diff --git a/src/ideque.h b/src/ideque.h index 935bb4ef..a700904d 100644 --- a/src/ideque.h +++ b/src/ideque.h @@ -101,7 +101,7 @@ namespace etl //*************************************************** iterator& operator ++() { - index = (index == p_deque->BUFFER_SIZE - 1) ? 0 : index + 1; + index = (static_cast(index) == p_deque->BUFFER_SIZE - 1) ? 0 : index + 1; return *this; } @@ -110,7 +110,7 @@ namespace etl iterator operator ++(int) { iterator previous(*this); - index = (index == p_deque->BUFFER_SIZE - 1) ? 0 : index + 1; + index = (static_cast(index) == p_deque->BUFFER_SIZE - 1) ? 0 : index + 1; return previous; } @@ -304,7 +304,7 @@ namespace etl const_iterator operator ++(int) { const_iterator previous(*this); - index = (index == p_deque->BUFFER_SIZE - 1) ? 0 : index + 1; + index = (static_cast(index) == p_deque->BUFFER_SIZE - 1) ? 0 : index + 1; return previous; } @@ -781,7 +781,6 @@ namespace etl // Are we closer to the front? if (distance(_begin, insert_position) <= difference_type(current_size / 2)) { - size_t insert_index = std::distance(begin(), position); size_t n_insert = n; size_t n_move = std::distance(begin(), position); size_t n_create_copy = std::min(n_insert, n_move); diff --git a/src/imultimap.h b/src/imultimap.h index 9ace711c..628e1239 100644 --- a/src/imultimap.h +++ b/src/imultimap.h @@ -708,11 +708,6 @@ namespace etl } } - void print() const - { - print_tree(root_node); - } - //********************************************************************* /// Returns an iterator pointing to the first element in the container /// whose key is not considered to go before the key provided or end() diff --git a/src/imultiset.h b/src/imultiset.h index b1e126b5..f25d4808 100644 --- a/src/imultiset.h +++ b/src/imultiset.h @@ -644,7 +644,7 @@ namespace etl // Obtain the inserted node (might be nullptr if node was a duplicate) inserted_node = insert_node(root_node, node); - + // Insert node into tree and return iterator to new node location in tree return iterator(*this, inserted_node); } @@ -689,11 +689,6 @@ namespace etl } } - void print() const - { - print_tree(root_node); - } - //********************************************************************* /// Returns an iterator pointing to the first element in the container /// whose key is not considered to go before the key provided or end() diff --git a/src/intrusive_links.h b/src/intrusive_links.h index f72e99a7..6bfbfbbc 100644 --- a/src/intrusive_links.h +++ b/src/intrusive_links.h @@ -291,8 +291,8 @@ namespace etl { node.etl_next = node.etl_next->etl_next; - if ((TLink::OPTION == etl::link_option::AUTO) || - (TLink::OPTION == etl::link_option::CHECKED)) + if ((int(TLink::OPTION) == etl::link_option::AUTO) || + (int(TLink::OPTION) == etl::link_option::CHECKED)) { node.clear(); } @@ -306,8 +306,8 @@ namespace etl { before.etl_next = last.etl_next; - if ((TLink::OPTION == etl::link_option::AUTO) || - (TLink::OPTION == etl::link_option::CHECKED)) + if ((int(TLink::OPTION) == etl::link_option::AUTO) || + (int(TLink::OPTION) == etl::link_option::CHECKED)) { last.clear(); } @@ -638,7 +638,7 @@ namespace etl } if ((TLink::OPTION == etl::link_option::AUTO) || - (TLink::OPTION == etl::link_option::CHECKED)) + (int(TLink::OPTION) == etl::link_option::CHECKED)) { first.etl_previous = nullptr; last.etl_next = nullptr; diff --git a/src/intrusive_list.h b/src/intrusive_list.h index 1fcb7954..e08c3a49 100644 --- a/src/intrusive_list.h +++ b/src/intrusive_list.h @@ -77,7 +77,7 @@ namespace etl 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) - { + { } }; @@ -445,7 +445,7 @@ namespace etl //************************************************************************* /// Assigns a range of values to the intrusive_list. - /// If ETL_THROW_EXCEPTIONS & _DEBUG are defined emits a + /// If ETL_THROW_EXCEPTIONS & _DEBUG are defined emits a /// intrusive_list_iterator_exception if the iterators are reversed. //************************************************************************* template @@ -922,7 +922,7 @@ namespace etl void splice(iterator position, list_type& list, iterator isource) { link_type& before = *position.p_value->link_type::etl_previous; - + etl::unlink(*isource.p_value); etl::link_splice(before, *isource.p_value); @@ -1008,9 +1008,9 @@ namespace etl { 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(*begin->link_type::etl_previous, *value); } - } + } } // Any left over? @@ -1037,14 +1037,16 @@ namespace etl //************************************************************************* /// Counter type based on count option. //************************************************************************* - template - class counter_type; + template + class counter_type + { + }; //************************************************************************* /// Slow type. //************************************************************************* - template <> - class counter_type + template + class counter_type { public: @@ -1077,8 +1079,8 @@ namespace etl //************************************************************************* /// Fast type. //************************************************************************* - template <> - class counter_type + template + class counter_type { public: diff --git a/src/ivector.h b/src/ivector.h index 1725cf98..5ce7374c 100644 --- a/src/ivector.h +++ b/src/ivector.h @@ -37,13 +37,14 @@ SOFTWARE. #include #include +#include "platform.h" #include "algorithm.h" #include "private/vector_base.h" #include "type_traits.h" #include "parameter_type.h" #include "error_handler.h" -#ifdef COMPILER_GCC +#ifdef ETL_COMPILER_GCC #pragma GCC diagnostic ignored "-Wunused-variable" #endif diff --git a/src/jenkins.h b/src/jenkins.h index 3e3c2157..7dace164 100644 --- a/src/jenkins.h +++ b/src/jenkins.h @@ -34,12 +34,13 @@ SOFTWARE. #include #include +#include "platform.h" #include "static_assert.h" #include "type_traits.h" #include "error_handler.h" #include "ihash.h" -#if defined(COMPILER_KEIL) +#if defined(ETL_COMPILER_KEIL) #pragma diag_suppress 1300 #endif diff --git a/src/multiset.h b/src/multiset.h index e3ba00e0..0668f9a8 100644 --- a/src/multiset.h +++ b/src/multiset.h @@ -49,7 +49,7 @@ namespace etl //************************************************************************* /// A templated multiset implementation that uses a fixed size buffer. //************************************************************************* - template > + template > class multiset : public imultiset { public: diff --git a/src/murmur3.h b/src/murmur3.h index 39f22e48..8300c253 100644 --- a/src/murmur3.h +++ b/src/murmur3.h @@ -33,11 +33,12 @@ SOFTWARE. #include +#include "platform.h" #include "ihash.h" #include "binary.h" #include "error_handler.h" -#if defined(COMPILER_KEIL) +#if defined(ETL_COMPILER_KEIL) #pragma diag_suppress 1300 #endif diff --git a/src/nullptr.h b/src/nullptr.h index 7b34b34b..e14da878 100644 --- a/src/nullptr.h +++ b/src/nullptr.h @@ -31,11 +31,13 @@ SOFTWARE. #ifndef __ETL_NULLPTR__ #define __ETL_NULLPTR__ +#include "platform.h" + ///\defgroup nullptr nullptr /// A definition of nullptr for compilers that don't support it as standard. ///\ingroup utilities -#if (defined(_MSC_VER) && (_MSC_VER < 1600)) || defined(COMPILER_KEIL) || defined(COMPILER_IAR) +#if defined(NO_NULLPTR_SUPPORT) namespace std { //***************************************************************************** diff --git a/src/pearson.h b/src/pearson.h index fd37fe1c..4952d889 100644 --- a/src/pearson.h +++ b/src/pearson.h @@ -33,6 +33,7 @@ SOFTWARE. #include +#include "platform.h" #include "static_assert.h" #include "type_traits.h" #include "endian.h" @@ -40,8 +41,8 @@ SOFTWARE. #include "array.h" #include "container.h" -#if defined(COMPILER_KEIL) -#pragma diag_suppress 1300 +#if defined(ETL_COMPILER_KEIL) +#pragma diag_suppress 1300 #endif ///\defgroup pearson Pearson hash calculation @@ -122,7 +123,7 @@ namespace etl { if (first) { - for (size_t i = 0; i < HASH_SIZE; ++i) + for (size_t i = 0; i < HASH_LENGTH; ++i) { hash[i] = PEARSON_LOOKUP[(uint32_t(value) + i) % 256]; } @@ -131,7 +132,7 @@ namespace etl } else { - for (size_t i = 0; i < HASH_SIZE; ++i) + for (size_t i = 0; i < HASH_LENGTH; ++i) { hash[i] = PEARSON_LOOKUP[hash[i] ^ value]; } diff --git a/src/platform.h b/src/platform.h new file mode 100644 index 00000000..9d4d7e1f --- /dev/null +++ b/src/platform.h @@ -0,0 +1,69 @@ +///\file + +/****************************************************************************** +The MIT License(MIT) + +Embedded Template Library. +https://github.com/ETLCPP/etl +http://www.etlcpp.com + +Copyright(c) 2016 jwellbelove + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files(the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions : + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +******************************************************************************/ + +#if defined(__linux__) +#define ETL_PLATFORM_LINUX +#endif + +#if defined(__WIN32) || defined(__WIN64) +#define ETL_PLATFORM_WINDOWS +#endif + +#if defined(__IAR_SYSTEMS_ICC__) +#define ETL_COMPILER_IAR +#endif + +#if defined(__KEIL__) && !defined(__GNUC__) +#define ETL_COMPILER_KEIL +#endif + +#if defined(__ghs__) +#define ETL_COMPILER_GREEN_HILLS +#endif + +#if defined(__INTEL_COMPILER) +#define ETL_COMPILER_INTEL +#endif + +#if defined(_MSC_VER) +#define ETL_COMPILER_MICROSOFT +#endif + +#if defined(__GNUC__) +#define ETL_COMPILER_GCC +#endif + +#if (defined(ETL_COMPILER_MICROSOFT) && (_MSC_VER < 1600)) || \ + defined(ETL_COMPILER_KEIL) || \ + defined(ETL_COMPILER_IAR) || \ + (defined(ETL_COMPILER_GCC) && (__cplusplus < 201103L)) + #define NO_NULLPTR_SUPPORT +#endif + diff --git a/src/static_assert.h b/src/static_assert.h index f49606c8..b5a6a6bb 100644 --- a/src/static_assert.h +++ b/src/static_assert.h @@ -29,9 +29,11 @@ SOFTWARE. #ifndef __ETL_STATIC_ASSERT__ #define __ETL_STATIC_ASSERT__ -#if defined(COMPILER_MICROSOFT) +#include "platform.h" + +#if defined(ETL_COMPILER_MICROSOFT) #define STATIC_ASSERT(Condition, Message) static_assert(Condition, Message) -#elif defined(COMPILER_GCC) +#elif defined(ETL_COMPILER_GCC) #define STATIC_ASSERT(Condition, Message) static_assert(Condition, Message) #else template diff --git a/src/type_traits.h b/src/type_traits.h index 4d8a12f0..ea21fe81 100644 --- a/src/type_traits.h +++ b/src/type_traits.h @@ -33,6 +33,7 @@ SOFTWARE. #include +#include "platform.h" #include "nullptr.h" ///\defgroup type_traits type_traits @@ -240,7 +241,7 @@ namespace etl template struct make_signed { typedef T type; }; template <> struct make_signed { typedef signed char type; }; template <> struct make_signed { typedef signed char type; }; -#if defined(COMPILER_GCC) +#if defined(ETL_COMPILER_GCC) template <> struct make_signed { typedef wchar_t type; @@ -267,7 +268,7 @@ namespace etl template <> struct make_unsigned { typedef unsigned char type; }; template <> struct make_unsigned { typedef unsigned char type; }; template <> struct make_unsigned { typedef unsigned short type; }; -#if defined(COMPILER_GCC) && !defined(PLATFORM_LINUX) +#if defined(ETL_COMPILER_GCC) && !defined(ETL_PLATFORM_LINUX) template <> struct make_unsigned { typedef wchar_t type; @@ -341,19 +342,19 @@ namespace etl /// Alignment templates. /// These require compiler specific intrinsics. ///\ingroup type_traits -#ifdef COMPILER_MICROSOFT +#ifdef ETL_COMPILER_MICROSOFT template struct alignment_of : integral_constant {}; #endif -#ifdef COMPILER_GCC +#ifdef ETL_COMPILER_GCC template struct alignment_of : integral_constant {}; #endif -#ifdef COMPILER_KEIL +#ifdef ETL_COMPILER_KEIL template struct alignment_of : integral_constant {}; #endif -#ifdef COMPILER_IAR +#ifdef ETL_COMPILER_IAR template struct alignment_of : integral_constant {}; #endif diff --git a/src/variant.h b/src/variant.h index 3cad72d7..4c63c6f6 100644 --- a/src/variant.h +++ b/src/variant.h @@ -33,6 +33,7 @@ SOFTWARE. #include +#include "platform.h" #include "array.h" #include "largest.h" #include "exception.h" @@ -42,7 +43,7 @@ SOFTWARE. #include "alignment.h" #include "error_handler.h" -#if defined(COMPILER_KEIL) +#if defined(ETL_COMPILER_KEIL) #pragma diag_suppress 940 #pragma diag_suppress 111 #endif diff --git a/test/codeblocks/ETL.cbp b/test/codeblocks/ETL.cbp index 7ddc1a0d..7f58fb61 100644 --- a/test/codeblocks/ETL.cbp +++ b/test/codeblocks/ETL.cbp @@ -15,9 +15,6 @@ - - - @@ -32,9 +29,6 @@ - - - @@ -46,12 +40,13 @@ - + - + + @@ -203,6 +198,7 @@ + @@ -213,6 +209,12 @@ + + + + @@ -222,13 +224,17 @@ + + + + @@ -240,6 +246,8 @@ + + @@ -249,24 +257,36 @@ + + + + + + + + + + + + diff --git a/test/codeblocks/ETL.depend b/test/codeblocks/ETL.depend index 341eb761..22211a47 100644 --- a/test/codeblocks/ETL.depend +++ b/test/codeblocks/ETL.depend @@ -2629,9 +2629,9 @@ "HelperMacros.h" -1414845610 d:\users\john\documents\programming\github\unittest-cpp\unittest++\config.h +1457468069 d:\users\john\documents\programming\github\unittest-cpp\unittest++\config.h -1414845610 d:\users\john\documents\programming\github\unittest-cpp\unittest++\helpermacros.h +1457468069 d:\users\john\documents\programming\github\unittest-cpp\unittest++\helpermacros.h "Config.h" 1414845610 source:d:\users\john\documents\programming\github\unittest-cpp\unittest++\checks.cpp @@ -2694,7 +2694,7 @@ "DeferredTestResult.h" -1414845610 source:d:\users\john\documents\programming\github\unittest-cpp\unittest++\memoryoutstream.cpp +1457468069 source:d:\users\john\documents\programming\github\unittest-cpp\unittest++\memoryoutstream.cpp "MemoryOutStream.h" @@ -2725,7 +2725,7 @@ 1414845610 d:\users\john\documents\programming\github\unittest-cpp\unittest++\reportassert.h "HelperMacros.h" -1414845610 d:\users\john\documents\programming\github\unittest-cpp\unittest++\reportassertimpl.h +1457468069 d:\users\john\documents\programming\github\unittest-cpp\unittest++\reportassertimpl.h "Config.h" "HelperMacros.h" @@ -2771,7 +2771,7 @@ 1414845610 source:d:\users\john\documents\programming\github\unittest-cpp\unittest++\testreporter.cpp "TestReporter.h" -1414845610 source:d:\users\john\documents\programming\github\unittest-cpp\unittest++\testreporterstdout.cpp +1457465178 source:d:\users\john\documents\programming\github\unittest-cpp\unittest++\testreporterstdout.cpp "TestReporterStdout.h" "TestDetails.h" @@ -3029,14 +3029,14 @@ "exception.h" "error_handler.h" -1456669289 source:d:\users\john\documents\programming\github\etl\test\test_bitset.cpp +1457468093 source:d:\users\john\documents\programming\github\etl\test\test_bitset.cpp "../src/bitset.h" -1456669289 source:d:\users\john\documents\programming\github\etl\test\test_bloom_filter.cpp +1457378733 source:d:\users\john\documents\programming\github\etl\test\test_bloom_filter.cpp @@ -3188,7 +3188,7 @@ "../src/enum_type.h" -1456669289 source:d:\users\john\documents\programming\github\etl\test\test_error_handler.cpp +1457468158 source:d:\users\john\documents\programming\github\etl\test\test_error_handler.cpp @@ -3419,7 +3419,7 @@ 1450265856 d:\users\john\documents\programming\github\etl\largest.h "type_traits.h" -1456964521 source:d:\users\john\documents\programming\github\etl\test\test_list.cpp +1457468249 source:d:\users\john\documents\programming\github\etl\test\test_list.cpp "ExtraCheckMacros.h" "../src/list.h" @@ -3536,7 +3536,7 @@ "exception.h" -1456953182 source:d:\users\john\documents\programming\github\etl\test\test_vector.cpp +1457027610 source:d:\users\john\documents\programming\github\etl\test\test_vector.cpp @@ -3558,7 +3558,7 @@ 1450265856 d:\users\john\documents\programming\github\etl\fixed_iterator.h -1414845610 source:d:\users\john\documents\programming\github\unittest-cpp\unittest++\win32\timehelpers.cpp +1457468069 source:d:\users\john\documents\programming\github\unittest-cpp\unittest++\win32\timehelpers.cpp "TimeHelpers.h" @@ -3635,7 +3635,7 @@ "../exception.h" "../error_handler.h" -1456669289 source:d:\users\john\documents\programming\github\etl\test\test_optional.cpp +1457464314 source:d:\users\john\documents\programming\github\etl\test\test_optional.cpp @@ -3702,7 +3702,7 @@ "../exception.h" "../error_handler.h" -1456669289 source:d:\users\john\documents\programming\github\etl\test\test_type_traits.cpp +1457463236 source:d:\users\john\documents\programming\github\etl\test\test_type_traits.cpp "../src/type_traits.h" @@ -4784,7 +4784,7 @@ 1452516033 /home/jwellbelove/Programming/etl/visitor.h -1456669289 source:d:\users\john\documents\programming\github\etl\test\test_intrusive_forward_list.cpp +1457468232 source:d:\users\john\documents\programming\github\etl\test\test_intrusive_forward_list.cpp "ExtraCheckMacros.h" "data.h" @@ -4840,7 +4840,8 @@ 1456669289 d:\users\john\documents\programming\github\etl\src\function.h -1456669289 d:\users\john\documents\programming\github\etl\src\nullptr.h +1457547753 d:\users\john\documents\programming\github\etl\src\nullptr.h + "platform.h" 1456669289 source:d:\users\john\documents\programming\github\etl\src\pearson.cpp @@ -4853,8 +4854,9 @@ "type_traits.h" -1456669289 d:\users\john\documents\programming\github\etl\src\type_traits.h +1457559890 d:\users\john\documents\programming\github\etl\src\type_traits.h + "platform.h" "nullptr.h" 1456669289 d:\users\john\documents\programming\github\etl\src\container.h @@ -4866,7 +4868,8 @@ "type_traits.h" "static_assert.h" -1456669289 d:\users\john\documents\programming\github\etl\src\static_assert.h +1457463503 d:\users\john\documents\programming\github\etl\src\static_assert.h + "platform.h" 1456669289 d:\users\john\documents\programming\github\etl\src\array.h @@ -4887,7 +4890,7 @@ "type_traits.h" -1456953182 d:\users\john\documents\programming\github\etl\src\binary.h +1457027659 d:\users\john\documents\programming\github\etl\src\binary.h "type_traits.h" @@ -4908,11 +4911,12 @@ "integral_limits.h" -1456669289 d:\users\john\documents\programming\github\etl\src\bitset.h +1457463503 d:\users\john\documents\programming\github\etl\src\bitset.h + "platform.h" "integral_limits.h" "algorithm.h" "nullptr.h" @@ -4929,8 +4933,9 @@ "binary.h" "algorithm.h" -1456669289 d:\users\john\documents\programming\github\etl\src\fnv_1.h +1457463503 d:\users\john\documents\programming\github\etl\src\fnv_1.h + "platform.h" "static_assert.h" "type_traits.h" "ihash.h" @@ -4949,9 +4954,10 @@ "log.h" "power.h" -1456953131 d:\users\john\documents\programming\github\etl\src\crc16.h +1457463503 d:\users\john\documents\programming\github\etl\src\crc16.h + "platform.h" "frame_check_sequence.h" 1456669289 d:\users\john\documents\programming\github\etl\src\frame_check_sequence.h @@ -4960,14 +4966,16 @@ "type_traits.h" "binary.h" -1456953131 d:\users\john\documents\programming\github\etl\src\crc16_ccitt.h +1457463503 d:\users\john\documents\programming\github\etl\src\crc16_ccitt.h + "platform.h" "frame_check_sequence.h" -1456953131 d:\users\john\documents\programming\github\etl\src\crc32.h +1457463503 d:\users\john\documents\programming\github\etl\src\crc32.h + "platform.h" "frame_check_sequence.h" 1456953131 d:\users\john\documents\programming\github\etl\src\checksum.h @@ -4981,19 +4989,22 @@ 1456669289 d:\users\john\documents\programming\github\etl\src\enum_type.h -1456953131 d:\users\john\documents\programming\github\etl\src\crc8_ccitt.h +1457463503 d:\users\john\documents\programming\github\etl\src\crc8_ccitt.h + "platform.h" "frame_check_sequence.h" -1456953131 d:\users\john\documents\programming\github\etl\src\crc16_kermit.h +1457463503 d:\users\john\documents\programming\github\etl\src\crc16_kermit.h + "platform.h" "frame_check_sequence.h" -1456953131 d:\users\john\documents\programming\github\etl\src\crc64_ecma.h +1457463503 d:\users\john\documents\programming\github\etl\src\crc64_ecma.h + "platform.h" "frame_check_sequence.h" 1456669289 d:\users\john\documents\programming\github\etl\src\cyclic_value.h @@ -5012,7 +5023,7 @@ "alignment.h" "array.h" -1456669289 d:\users\john\documents\programming\github\etl\src\ideque.h +1457468266 d:\users\john\documents\programming\github\etl\src\ideque.h "algorithm.h" @@ -5054,11 +5065,12 @@ "../ivector.h" "../error_handler.h" -1456953131 d:\users\john\documents\programming\github\etl\src\ivector.h +1457595336 d:\users\john\documents\programming\github\etl\src\ivector.h + "platform.h" "algorithm.h" "private/vector_base.h" "type_traits.h" @@ -5167,7 +5179,7 @@ "intrusive_links.h" "algorithm.h" -1456953131 d:\users\john\documents\programming\github\etl\src\intrusive_links.h +1457466644 d:\users\john\documents\programming\github\etl\src\intrusive_links.h "nullptr.h" "type_traits.h" @@ -5354,8 +5366,9 @@ "exception.h" "error_handler.h" -1456669289 d:\users\john\documents\programming\github\etl\src\variant.h +1457463503 d:\users\john\documents\programming\github\etl\src\variant.h + "platform.h" "array.h" "largest.h" "exception.h" @@ -5367,3 +5380,401 @@ 1456669289 d:\users\john\documents\programming\github\etl\src\visitor.h +1457570381 d:\users\john\documents\programming\github\etl\src\platform.h + +1457463956 source:d:\users\john\documents\programming\github\etl\test\murmurhash3.cpp + "MurmurHash3.h" + + +1457464314 d:\users\john\documents\programming\github\etl\test\murmurhash3.h + "../src/platform.h" + + +1457508036 source:d:\users\john\documents\programming\github\etl\test\test_bsd_checksum.cpp + + + + + + "../src/checksum.h" + +1456669289 source:d:\users\john\documents\programming\github\etl\test\test_flat_multimap.cpp + + + + + + + + + "data.h" + "../src/flat_multimap.h" + +1456669289 d:\users\john\documents\programming\github\etl\src\flat_multimap.h + + + + "iflat_multimap.h" + "vector.h" + +1456669289 d:\users\john\documents\programming\github\etl\src\iflat_multimap.h + + + + + + "private/flat_multimap_base.h" + "type_traits.h" + "parameter_type.h" + "ivector.h" + "error_handler.h" + +1456669289 d:\users\john\documents\programming\github\etl\src\private\flat_multimap_base.h + + "../exception.h" + "../ivector.h" + "../error_handler.h" + +1456669289 source:d:\users\john\documents\programming\github\etl\test\test_flat_multiset.cpp + + + + + + + + + "data.h" + "../src/flat_multiset.h" + +1456669289 d:\users\john\documents\programming\github\etl\src\flat_multiset.h + + + + "iflat_multiset.h" + "vector.h" + +1456669289 d:\users\john\documents\programming\github\etl\src\iflat_multiset.h + + + + + + "private/flat_multiset_base.h" + "type_traits.h" + "parameter_type.h" + "ivector.h" + "error_handler.h" + +1456669289 d:\users\john\documents\programming\github\etl\src\private\flat_multiset_base.h + + "../exception.h" + "../ivector.h" + "../error_handler.h" + +1456669289 source:d:\users\john\documents\programming\github\etl\test\test_intrusive_links.cpp + + "ExtraCheckMacros.h" + "data.h" + "../src/intrusive_links.h" + +1456669289 source:d:\users\john\documents\programming\github\etl\test\test_intrusive_list.cpp + + "ExtraCheckMacros.h" + "data.h" + "../src/intrusive_list.h" + + + + + + +1457547716 d:\users\john\documents\programming\github\etl\src\intrusive_list.h + + + + + "nullptr.h" + "type_traits.h" + "exception.h" + "error_handler.h" + "intrusive_links.h" + "static_assert.h" + "algorithm.h" + +1456669289 source:d:\users\john\documents\programming\github\etl\test\test_jenkins.cpp + + "murmurhash3.h" + + + + + "../src/jenkins.h" + "../src/endian.h" + +1457463503 d:\users\john\documents\programming\github\etl\src\jenkins.h + + + "platform.h" + "static_assert.h" + "type_traits.h" + "error_handler.h" + "ihash.h" + +1456669289 source:d:\users\john\documents\programming\github\etl\test\test_multimap.cpp + + + + + + + + "../src/multimap.h" + +1456669289 d:\users\john\documents\programming\github\etl\src\multimap.h + + + + "imultimap.h" + "container.h" + "pool.h" + +1457548955 d:\users\john\documents\programming\github\etl\src\imultimap.h + + + + + "nullptr.h" + "private/multimap_base.h" + "type_traits.h" + "parameter_type.h" + "pool.h" + +1456669289 d:\users\john\documents\programming\github\etl\src\private\multimap_base.h + + "../exception.h" + "../error_handler.h" + +1456669289 source:d:\users\john\documents\programming\github\etl\test\test_multiset.cpp + + + + + + + + "../src/multiset.h" + +1457548976 d:\users\john\documents\programming\github\etl\src\multiset.h + + + + "imultiset.h" + "container.h" + "pool.h" + +1457548988 d:\users\john\documents\programming\github\etl\src\imultiset.h + + + + + "nullptr.h" + "private/multiset_base.h" + "type_traits.h" + "parameter_type.h" + "pool.h" + +1456669289 d:\users\john\documents\programming\github\etl\src\private\multiset_base.h + + "../exception.h" + "../error_handler.h" + +1456669289 source:d:\users\john\documents\programming\github\etl\test\test_murmur3.cpp + + "murmurhash3.h" + + + + + "../src/murmur3.h" + "../src/endian.h" + +1457463503 d:\users\john\documents\programming\github\etl\src\murmur3.h + + "platform.h" + "ihash.h" + "binary.h" + "error_handler.h" + +1456669289 source:d:\users\john\documents\programming\github\etl\test\test_pearson.cpp + + + + + + + "../src/pearson.h" + "../src/endian.h" + +1457549034 d:\users\john\documents\programming\github\etl\src\pearson.h + + "platform.h" + "static_assert.h" + "type_traits.h" + "endian.h" + "ihash.h" + "array.h" + "container.h" + +1456669289 source:d:\users\john\documents\programming\github\etl\test\test_priority_queue.cpp + + + "../src/priority_queue.h" + +1456669289 d:\users\john\documents\programming\github\etl\src\priority_queue.h + + + "ipriority_queue.h" + "container.h" + "vector.h" + +1456669289 d:\users\john\documents\programming\github\etl\src\ipriority_queue.h + + + "type_traits.h" + "parameter_type.h" + "error_handler.h" + "exception.h" + +1456669289 source:d:\users\john\documents\programming\github\etl\test\test_unordered_multimap.cpp + + + + + + + + + + "data.h" + "../src/unordered_multimap.h" + +1456669289 d:\users\john\documents\programming\github\etl\src\unordered_multimap.h + + + + "iunordered_multimap.h" + "container.h" + "pool.h" + "vector.h" + "intrusive_forward_list.h" + "hash.h" + +1456669289 d:\users\john\documents\programming\github\etl\src\iunordered_multimap.h + + + + + + "type_traits.h" + "parameter_type.h" + "hash.h" + "nullptr.h" + "ipool.h" + "ivector.h" + "error_handler.h" + "intrusive_forward_list.h" + "exception.h" + "error_handler.h" + +1456669289 source:d:\users\john\documents\programming\github\etl\test\test_unordered_multiset.cpp + + + + + + + + + + "data.h" + "../src/unordered_multiset.h" + "../src/checksum.h" + +1456669289 d:\users\john\documents\programming\github\etl\src\unordered_multiset.h + + + + "iunordered_multiset.h" + "container.h" + "pool.h" + "vector.h" + "intrusive_forward_list.h" + "hash.h" + +1456669289 d:\users\john\documents\programming\github\etl\src\iunordered_multiset.h + + + + + + "type_traits.h" + "parameter_type.h" + "hash.h" + "nullptr.h" + "ipool.h" + "ivector.h" + "error_handler.h" + "intrusive_forward_list.h" + "exception.h" + "error_handler.h" + +1457378530 source:d:\users\john\documents\programming\github\etl\test\test_unordered_set.cpp + + + + + + + + + "data.h" + "../src/unordered_set.h" + "../src/checksum.h" + +1456669289 d:\users\john\documents\programming\github\etl\src\unordered_set.h + + + + "iunordered_set.h" + "container.h" + "pool.h" + "vector.h" + "intrusive_forward_list.h" + "hash.h" + +1456669289 d:\users\john\documents\programming\github\etl\src\iunordered_set.h + + + + + + "type_traits.h" + "parameter_type.h" + "hash.h" + "nullptr.h" + "ipool.h" + "ivector.h" + "error_handler.h" + "intrusive_forward_list.h" + "exception.h" + "error_handler.h" + +1456669289 source:d:\users\john\documents\programming\github\etl\test\test_xor_checksum.cpp + + + + + + "../src/checksum.h" + diff --git a/test/codeblocks/ETL.layout b/test/codeblocks/ETL.layout index 4a8973c4..8fa3ea47 100644 --- a/test/codeblocks/ETL.layout +++ b/test/codeblocks/ETL.layout @@ -1,109 +1,10 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -111,59 +12,14 @@ - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -171,74 +27,14 @@ - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -246,29 +42,44 @@ - - - - - - - - - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -276,4 +87,269 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/murmurhash3.cpp b/test/murmurhash3.cpp index 284774f5..75a6110e 100644 --- a/test/murmurhash3.cpp +++ b/test/murmurhash3.cpp @@ -14,7 +14,7 @@ // Microsoft Visual Studio -#if defined(_MSC_VER) +#if defined(ETL_COMPILER_MICROSOFT) #define FORCE_INLINE __forceinline @@ -27,7 +27,7 @@ // Other compilers -#else // defined(_MSC_VER) +#else // defined(ETL_COMPILER_MICROSOFT) #define FORCE_INLINE inline __attribute__((always_inline)) @@ -46,7 +46,7 @@ inline uint64_t rotl64(uint64_t x, int8_t r) #define BIG_CONSTANT(x) (x##LLU) -#endif // !defined(_MSC_VER) +#endif // !defined(ETL_COMPILER_MICROSOFT) //----------------------------------------------------------------------------- // Block read - if your platform needs to do endian-swapping or can only diff --git a/test/murmurhash3.h b/test/murmurhash3.h index a32a3a0f..004eb056 100644 --- a/test/murmurhash3.h +++ b/test/murmurhash3.h @@ -10,7 +10,9 @@ // Microsoft Visual Studio -#if defined(_MSC_VER) && (_MSC_VER < 1600) +#include "../src/platform.h" + +#if defined(ETL_COMPILER_MICROSOFT) && (_MSC_VER < 1600) typedef unsigned char uint8_t; typedef unsigned int uint32_t; @@ -18,11 +20,11 @@ typedef unsigned __int64 uint64_t; // Other compilers -#else // defined(_MSC_VER) +#else // defined(ETL_COMPILER_MICROSOFT) #include -#endif // !defined(_MSC_VER) +#endif // !defined(ETL_COMPILER_MICROSOFT) //----------------------------------------------------------------------------- diff --git a/test/test_bsd_checksum.cpp b/test/test_bsd_checksum.cpp index 6f17c0ae..554d6ed1 100644 --- a/test/test_bsd_checksum.cpp +++ b/test/test_bsd_checksum.cpp @@ -47,7 +47,7 @@ namespace { value_type value = *begin++; - for (int i = 0; i < sizeof(value_type); ++i) + for (size_t i = 0; i < sizeof(value_type); ++i) { uint8_t byte = (value >> (i * 8)) & 0xFF; checksum = etl::rotate_right(checksum) + byte; @@ -81,7 +81,7 @@ namespace { checksum_calculator.add(data[i]); } - + uint8_t sum = checksum_calculator; uint8_t compare = reference_checksum(data.begin(), data.end()); diff --git a/test/test_compile.cpp b/test/test_compile.cpp index e2dd17d8..eae13644 100644 --- a/test/test_compile.cpp +++ b/test/test_compile.cpp @@ -1,3 +1,5 @@ + + #include "algorithm.h" #include "alignment.h" #include "array.h" @@ -35,7 +37,7 @@ struct Test d(d) { } - + int i; double d; }; @@ -54,15 +56,15 @@ void test_algorithm() int y = 1; int* p; bool b; - + // minmax_element result1 = etl::minmax_element(etl::begin(data), etl::end(data)); result1 = etl::minmax_element(etl::begin(data), etl::end(data), std::greater()); - + // minmax result2 = etl::minmax(x, y); result2 = etl::minmax(x, y, std::greater()); - + // is_sorted_until p = etl::is_sorted_until(etl::begin(data), etl::end(data)); p = etl::is_sorted_until(etl::begin(data), etl::end(data), std::greater()); @@ -70,37 +72,37 @@ void test_algorithm() // is_sorted b = etl::is_sorted(etl::begin(data), etl::end(data)); b = etl::is_sorted(etl::begin(data), etl::end(data), std::greater()); - + // copy_n p = etl::copy_n(etl::begin(data), 5, etl::begin(data2)); // copy_if p = etl::copy_if(etl::begin(data), etl::end(data), etl::begin(data2), std::bind2nd(std::greater(), 4)); - + // find_if_not p = etl::find_if_not(etl::begin(data), etl::end(data), std::bind2nd(std::greater(), 4)); - + // all_of b = etl::all_of(etl::begin(data), etl::end(data), std::bind2nd(std::greater(), 4)); - + // any_of b = etl::any_of(etl::begin(data), etl::end(data), std::bind2nd(std::greater(), 4)); - + // none_of b = etl::none_of(etl::begin(data), etl::end(data), std::bind2nd(std::greater(), 4)); - + // is_permutation b = etl::is_permutation(etl::begin(data), etl::end(data), etl::begin(data2)); b = etl::is_permutation(etl::begin(data), etl::end(data), etl::begin(data2), std::equal_to()); b = etl::is_permutation(etl::begin(data), etl::end(data), etl::begin(data2), etl::end(data2)); b = etl::is_permutation(etl::begin(data), etl::end(data), etl::begin(data2), etl::end(data2), std::equal_to()); - + // is_partitioned b = etl::is_partitioned(etl::begin(data), etl::end(data), std::bind2nd(std::greater(), 4)); - + // partition_point p = etl::partition_point(etl::begin(data), etl::end(data), std::bind2nd(std::greater(), 4)); - + // partition_copy result1 = etl::partition_copy(etl::begin(data), etl::end(data), etl::begin(data2), etl::begin(data3), std::bind2nd(std::greater(), 4)); } @@ -114,12 +116,12 @@ etl::aligned_storage_as<100, double>::type data10; void test_alignment() { int a = static_cast(data9); - + etl::aligned_storage<1, 1>::type data1; etl::aligned_storage<1, 2>::type data2; etl::aligned_storage<1, 4>::type data3; etl::aligned_storage<1, 8>::type data4; - + etl::aligned_storage_as<1, char>::type data5; etl::aligned_storage_as<1, short>::type data6; etl::aligned_storage_as<1, int>::type data7; @@ -132,7 +134,7 @@ void test_alignment() void test_array() { etl::array a; - + int i = a[4]; int s = a.size(); a.fill(45); @@ -155,7 +157,7 @@ void test_bitset() etl::bitset<63> b63; etl::bitset<64> b64; etl::bitset<65> b65; - + b65.set(); b65.set(4, true); b65.reset(); @@ -165,9 +167,9 @@ void test_bitset() b = b65[64]; b65.flip(); b65.flip(5); - + etl::ibitset& ib = b65; - + ib.set(); ib.set(4, true); ib.reset(); @@ -184,24 +186,24 @@ void test_bitset() void test_crc() { char data[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; - + uint8_t crc1 = etl::crc8_ccitt(etl::begin(data), etl::end(data)); uint8_t crc2 = etl::crc8_ccitt(etl::begin(data), etl::end(data)); uint16_t crc3 = etl::crc16(etl::begin(data), etl::end(data)); uint16_t crc4 = etl::crc16(etl::begin(data), etl::end(data)); - + uint16_t crc5 = etl::crc16_ccitt(etl::begin(data), etl::end(data)); uint16_t crc6 = etl::crc16_ccitt(etl::begin(data), etl::end(data)); uint16_t crc7 = etl::crc16_kermit(etl::begin(data), etl::end(data)); uint16_t crc8 = etl::crc16_kermit(etl::begin(data), etl::end(data)); - + uint32_t crc9 = etl::crc32(etl::begin(data), etl::end(data)); uint32_t crc10 = etl::crc32(etl::begin(data), etl::end(data)); - + uint64_t crc11 = etl::crc64_ecma(etl::begin(data), etl::end(data)); - uint64_t crc12 = etl::crc64_ecma(etl::begin(data), etl::end(data)); + uint64_t crc12 = etl::crc64_ecma(etl::begin(data), etl::end(data)); } //***************************************************************************** @@ -210,14 +212,14 @@ void test_crc() void test_cyclic_value() { etl::cyclic_value cv1; - + etl::cyclic_value cv2; cv2.set(3, 8); - + cv1.advance(3); cv1.to_first(); cv1.to_last(); - + --cv1; ++cv1; int f = cv1.first(); @@ -226,7 +228,7 @@ void test_cyclic_value() int v = cv1; cv1 = v; cv1 = cv2; - + bool b; b = cv1 == cv2; b = cv1 != cv2; @@ -258,7 +260,7 @@ struct dynamic_serial_port etl::io_port_rw control; etl::io_port_ro status; etl::io_port_wos control2; -}; +}; //***************************************************************************** // io_port @@ -266,17 +268,17 @@ struct dynamic_serial_port void test_io_port() { serial_port<0x1234> port1; - + uint8_t rxdata = port1.rxdata; port1.txdata = 0x34; port1.control = 0x5678; // Little endian. uint16_t status = port1.status; port1.control2 = 0xDE; int control2 = port1.control2; - + uint8_t memory[7]; dynamic_serial_port port2(memory); - + uint8_t rxdata2 = port2.rxdata; port2.txdata = 0x34; port2.control = 0x5678; // Little endian. @@ -291,15 +293,15 @@ void test_io_port() void test_variant() { typedef etl::variant Data; - + Data data; data = int(1); int i = data; - + data = double(2.2); double d = data; - + data = Test(3, 3.3); Test test(data); } @@ -310,14 +312,14 @@ void test_variant() void test_deque() { typedef etl::deque Data; - + Data data; - + data.push_back(Test(1, 1.1)); data.push_back(Test(2, 2.2)); - + Data::iterator it = data.begin(); - data.erase(it); + data.erase(it); } //***************************************************************************** @@ -326,12 +328,12 @@ void test_deque() void test_vector() { typedef etl::vector Data; - + Data data; - + data.push_back(Test(1, 1.1)); data.push_back(Test(2, 2.2)); - + Data::iterator it = data.begin(); data.erase(it); } @@ -343,21 +345,21 @@ void test_list() { typedef etl::list Data; typedef etl::list Data2; - + Data data; Data2 data2; - + data.push_back(Test(1, 1.1)); data.push_front(Test(3, 3.3)); data.reverse(); - + Data::iterator it = data.begin(); data.erase(it); - + data2.push_back(1); data2.push_front(3); data2.reverse(); - + Data2::iterator it2 = data2.begin(); data2.erase(it2); } @@ -368,14 +370,14 @@ void test_list() void test_map() { typedef etl::map Data; - + Data data; - + data.insert(std::pair(1, 2)); data.insert(std::pair(3, 4)); - + Data::iterator it = data.begin(); - data.erase(it); + data.erase(it); } //***************************************************************************** diff --git a/test/test_error_handler.cpp b/test/test_error_handler.cpp index 5da95e13..68f3ff6f 100644 --- a/test/test_error_handler.cpp +++ b/test/test_error_handler.cpp @@ -27,7 +27,7 @@ SOFTWARE. ******************************************************************************/ #include -#if defined(PLATFORM_WINDOWS) +#if defined(ETL_PLATFORM_WINDOWS) #include #endif #include @@ -61,7 +61,7 @@ void receive_error(const etl::exception& e) std::ostringstream oss; oss << "Error '" << e.what() << "' in " << e.file_name() << " at line " << e.line_number() << "\n"; -#if defined(PLATFORM_WINDOWS) && defined(COMPILER_MICROSOFT) +#if defined(ETL_PLATFORM_WINDOWS) && defined(ETL_COMPILER_MICROSOFT) std::string stext = oss.str(); WCHAR text[200]; @@ -86,7 +86,7 @@ public: std::ostringstream oss; oss << "Error '" << e.what() << "' in " << e.file_name() << " at line " << e.line_number() << "\n"; -#if defined(PLATFORM_WINDOWS) && defined(COMPILER_MICROSOFT) +#if defined(ETL_PLATFORM_WINDOWS) && defined(ETL_COMPILER_MICROSOFT) std::string stext = oss.str(); WCHAR text[200]; diff --git a/test/test_intrusive_forward_list.cpp b/test/test_intrusive_forward_list.cpp index 796d41c6..ea22d215 100644 --- a/test/test_intrusive_forward_list.cpp +++ b/test/test_intrusive_forward_list.cpp @@ -85,26 +85,12 @@ namespace }; //*************************************************************************** - bool operator ==(const ItemDCNode& lhs, const ItemDCNode& rhs) - { - return lhs.data == rhs.data; - } bool operator ==(const ItemNDCNode& lhs, const ItemNDCNode& rhs) { return lhs.data == rhs.data; } - bool operator !=(const ItemDCNode& lhs, const ItemDCNode& rhs) - { - return lhs.data != rhs.data; - } - - bool operator !=(const ItemNDCNode& lhs, const ItemNDCNode& rhs) - { - return lhs.data != rhs.data; - } - std::ostream& operator << (std::ostream& os, const ItemNDCNode& node) { os << node.data; @@ -137,10 +123,10 @@ namespace typedef std::vector InitialDataNDC; } -namespace -{ +namespace +{ SUITE(test_forward_list) - { + { InitialDataNDC unsorted_data; InitialDataNDC sorted_data; InitialDataNDC sorted_data2; diff --git a/test/test_optional.cpp b/test/test_optional.cpp index 8b894453..222698c5 100644 --- a/test/test_optional.cpp +++ b/test/test_optional.cpp @@ -176,7 +176,7 @@ namespace TEST(test_optional_container) { // The indexed access doesn't work in Linux for some reason!!! -#ifndef PLATFORM_LINUX +#ifndef ETL_PLATFORM_LINUX etl::optional> container; CHECK(!bool(container));// diff --git a/test/test_type_traits.cpp b/test/test_type_traits.cpp index a7be3bad..207fc468 100644 --- a/test/test_type_traits.cpp +++ b/test/test_type_traits.cpp @@ -28,7 +28,7 @@ SOFTWARE. #include -#if defined(COMPILER_GCC) +#if defined(ETL_COMPILER_GCC) namespace std { template diff --git a/test/test_unordered_set.cpp b/test/test_unordered_set.cpp index 854200d0..1436c177 100644 --- a/test/test_unordered_set.cpp +++ b/test/test_unordered_set.cpp @@ -28,7 +28,6 @@ SOFTWARE. #include -#include #include #include #include diff --git a/test/vs2015/etl.vcxproj b/test/vs2015/etl.vcxproj index 4ce36fbd..fce953d3 100644 --- a/test/vs2015/etl.vcxproj +++ b/test/vs2015/etl.vcxproj @@ -70,7 +70,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;ETL_THROW_EXCEPTIONS;PLATFORM_WINDOWS;COMPILER_MICROSOFT;ETL_VERBOSE_ERRORS;ETL_CHECK_PUSH_POP;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;ETL_THROW_EXCEPTIONS;ETL_VERBOSE_ERRORS;ETL_CHECK_PUSH_POP;%(PreprocessorDefinitions) ../../../unittest-cpp @@ -89,7 +89,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;ETL_THROW_EXCEPTIONS;PLATFORM_WINDOWS;COMPILER_MICROSOFT;ETL_VERBOSE_ERRORS;ETL_CHECK_PUSH_POP;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;ETL_THROW_EXCEPTIONS;ETL_VERBOSE_ERRORS;ETL_CHECK_PUSH_POP;%(PreprocessorDefinitions) ../../../unittest-cpp @@ -111,7 +111,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;ETL_THROW_EXCEPTIONS;PLATFORM_WINDOWS;COMPILER_MICROSOFT;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;_LIB;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;ETL_THROW_EXCEPTIONS;%(PreprocessorDefinitions) ../../../unittest-cpp @@ -214,6 +214,7 @@ + @@ -255,6 +256,7 @@ + @@ -263,6 +265,9 @@ + + + diff --git a/test/vs2015/etl.vcxproj.filters b/test/vs2015/etl.vcxproj.filters index 76df9f3d..5449213a 100644 --- a/test/vs2015/etl.vcxproj.filters +++ b/test/vs2015/etl.vcxproj.filters @@ -477,6 +477,21 @@ ETL\Containers + + ETL\Containers + + + ETL\Private + + + ETL\Containers + + + Header Files + + + Header Files +