diff --git a/.gitignore b/.gitignore index a160880..350f9a7 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,5 @@ bin/* .devcontainer/ .vscode/ -test_package/CMakeUserPresets.json \ No newline at end of file +test_package/CMakeUserPresets.json +CMakeUserPresets.json \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 336824d..5252150 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,7 +42,7 @@ cmake_minimum_required(VERSION 3.15.0 FATAL_ERROR) # Enables the CMAKE_MSVC_RUNTIME_LIBRARY property on targets cmake_policy(SET CMP0091 NEW) -project(openE57 VERSION 1.6.4 LANGUAGES C CXX DESCRIPTION "openE57 is a library for handling E57 files") +project(openE57 VERSION 1.6.6 LANGUAGES C CXX DESCRIPTION "openE57 is a library for handling E57 files") set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED TRUE) diff --git a/README.md b/README.md index 1b239d9..f3e9094 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ Building with Position indipendent code on Unix can be activated with the option git clone https://github.com/madduci/openE57.git cd open57 mkdir build && cd build -conan install .. --build=missing +conan install --output-folder . --build=missing -o with_tests=True -o with_tools=True -o with_docs=True .. cmake .. -DCMAKE_BUILD_TYPE=Release cmake --build . --config Release --target install ``` @@ -80,7 +80,7 @@ cmake --build . --config Release --target install git clone https://github.com/madduci/openE57.git cd open57 md build && cd build -conan install .. --build=missing +conan install --output-folder . --build=missing -o with_tests=True -o with_tools=True -o with_docs=True .. cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_MT=ON cmake --build . --config Release --target install ``` diff --git a/src/lib/include/openE57/impl/crc.h b/src/lib/include/openE57/impl/crc.h index 55a5349..28d8d42 100644 --- a/src/lib/include/openE57/impl/crc.h +++ b/src/lib/include/openE57/impl/crc.h @@ -1,11 +1,11 @@ /** @file CRC.h @author Daniel Bahr - @version 1.1.0.0 + @version 1.2.0.0 @copyright @parblock CRC++ - Copyright (c) 2021, Daniel Bahr + Copyright (c) 2022, Daniel Bahr All rights reserved. Redistribution and use in source and binary forms, with or without @@ -127,6 +127,12 @@ # define crcpp_constexpr const #endif +#if defined(WIN32) || defined(_WIN32) || defined(WINCE) +/* Disable warning C4127: conditional expression is constant. */ +#pragma warning(push) +#pragma warning(disable : 4127) +#endif + #ifdef CRCPP_USE_NAMESPACE namespace CRCPP { @@ -230,6 +236,7 @@ class CRC static const Parameters< crcpp_uint8, 8> & CRC_8(); #ifdef CRCPP_INCLUDE_ESOTERIC_CRC_DEFINITIONS static const Parameters< crcpp_uint8, 8> & CRC_8_EBU(); + static const Parameters< crcpp_uint8, 8> & CRC_8_HDLC(); static const Parameters< crcpp_uint8, 8> & CRC_8_MAXIM(); static const Parameters< crcpp_uint8, 8> & CRC_8_WCDMA(); static const Parameters< crcpp_uint8, 8> & CRC_8_LTE(); @@ -1216,6 +1223,24 @@ inline const CRC::Parameters & CRC::CRC_8_EBU() return parameters; } +/** + @brief Returns a set of parameters for CRC-8 HDLC (ISO/IEC 13239:2002). + @note The parameters are static and are delayed-constructed to reduce memory footprint. + @note CRC-8 HDLC has the following parameters and check value: + - polynomial = 0x07 + - initial value = 0xFF + - final XOR = 0xFF + - reflect input = true + - reflect output = true + - check value = 0x2F + @return CRC-8 HDLC parameters +*/ +inline const CRC::Parameters & CRC::CRC_8_HDLC() +{ + static const Parameters parameters = { 0x07, 0xFF, 0xFF, true, true }; + return parameters; +} + /** @brief Returns a set of parameters for CRC-8 MAXIM (aka CRC-8 DOW-CRC). @note The parameters are static and are delayed-constructed to reduce memory footprint. @@ -2082,4 +2107,8 @@ inline const CRC::Parameters & CRC::CRC_64() } #endif +#if defined(WIN32) || defined(_WIN32) || defined(WINCE) +#pragma warning(pop) +#endif + #endif // CRCPP_CRC_H_ diff --git a/src/lib/src/time_conversion.cpp b/src/lib/src/time_conversion.cpp index 89aec30..ebaee9f 100644 --- a/src/lib/src/time_conversion.cpp +++ b/src/lib/src/time_conversion.cpp @@ -101,7 +101,7 @@ constexpr const int DAYS_IN_DEC = 31; struct timeb timebuffer; #endif -#ifdef _CRT_SECURE_NO_DEPRECATE +#if defined(_CRT_SECURE_NO_DEPRECATE) if (_ftime_s(&timebuffer) != 0) { ERROR_MESSAGE("if( _ftime_s( &timebuffer ) != 0 )"); @@ -109,19 +109,19 @@ constexpr const int DAYS_IN_DEC = 31; } #else -# if defined(WIN32) && !defined(__GNUC__) - if (_ftime64_s(&timebuffer); != 0) +#if defined(WIN32) && !defined(__GNUC__) + if (_ftime64_s(&timebuffer) != 0) { ERROR_MESSAGE("ftime returned a non-zero result code"); return false; }; -# else +#else if (ftime(&timebuffer) != 0) { ERROR_MESSAGE("ftime returned a non-zero result code"); return false; }; -# endif +#endif #endif const double timebuffer_time_in_seconds = timebuffer.time + timebuffer.millitm / 1000.0; // [s] with ms resolution