From fc8ad68015466de722a6368cb4f0a00652de11ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Wed, 20 Dec 2023 10:07:07 +0100 Subject: [PATCH 1/3] CMakeLists.txt: remove some unused compile flags --- CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 56123ae..ad79d4c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,9 +19,6 @@ add_subdirectory(ulog_cpp) if(MAIN_PROJECT) add_compile_options( - # always enable debug symbols (for stack trace) - -g - # Warnings -Wall -Wextra @@ -30,7 +27,6 @@ if(MAIN_PROJECT) # disabled warnings -Wno-missing-field-initializers -Wno-unused-parameter - -Wno-float-equal # TODO: this is required for cli11 2.3.2 ) # compiler specific flags From 09b6349c3298f8adffc5867452f2f056d18ce4ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Wed, 20 Dec 2023 10:10:01 +0100 Subject: [PATCH 2/3] messages: init TypeAttributes members --- ulog_cpp/messages.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ulog_cpp/messages.hpp b/ulog_cpp/messages.hpp index c319827..5c07e19 100644 --- a/ulog_cpp/messages.hpp +++ b/ulog_cpp/messages.hpp @@ -107,9 +107,9 @@ class Field { * the attributes are dynamically computed in nested type resolution. */ struct TypeAttributes { - std::string name; ///< name of the type - BasicType type; ///< type as an enum - int size; ///< size in bytes. Recursively computed for nested types + std::string name; ///< name of the type + BasicType type{BasicType::NESTED}; ///< type as an enum + int size{0}; ///< size in bytes. Recursively computed for nested types std::shared_ptr nested_message{nullptr}; /// < nested message format TypeAttributes() = default; From 9c93706aa1d2a625349e6b86cd9db310d4abe402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Wed, 20 Dec 2023 10:10:05 +0100 Subject: [PATCH 3/3] simple_writer: allow writeInfo() also in data section --- ulog_cpp/simple_writer.hpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ulog_cpp/simple_writer.hpp b/ulog_cpp/simple_writer.hpp index 348e85b..3ddfe7c 100644 --- a/ulog_cpp/simple_writer.hpp +++ b/ulog_cpp/simple_writer.hpp @@ -36,7 +36,7 @@ class SimpleWriter { ~SimpleWriter(); /** - * Write a key-value info to the header. Typically used for versioning information. + * Write a key-value info. Typically used for versioning information and written to the header. * @tparam T one of std::string, int32_t, float * @param key (unique) name, e.g. sys_name * @param value @@ -44,9 +44,6 @@ class SimpleWriter { template void writeInfo(const std::string& key, const T& value) { - if (_header_complete) { - throw UsageException("Header already complete"); - } _writer->messageInfo(ulog_cpp::MessageInfo(key, value)); }