From e6a241eae894fdc2d6c4ebfd2bf36879e1b91ee1 Mon Sep 17 00:00:00 2001 From: Holden <68555040+HTRamsey@users.noreply.github.com> Date: Thu, 8 Aug 2024 16:15:33 -0400 Subject: [PATCH 1/5] Update messages.cpp Fix portability of vector iterator --- ulog_cpp/messages.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ulog_cpp/messages.cpp b/ulog_cpp/messages.cpp index 776b5f0..c5c82fd 100644 --- a/ulog_cpp/messages.cpp +++ b/ulog_cpp/messages.cpp @@ -278,7 +278,7 @@ Value::NativeTypeVariant Value::asNativeTypeVariant() const if (_backing_ref_end - string_start_iterator < _field_ref.arrayLength()) { throw AccessException("Decoding fault, memory too short"); } - int string_length = strnlen(string_start_iterator.base(), _field_ref.arrayLength()); + const int string_length = strnlen(&(*string_start_iterator), _field_ref.arrayLength()); return std::string(string_start_iterator, string_start_iterator + string_length); } From 35fb28f14de4923d70e746aa9f7da7de7cdc82e0 Mon Sep 17 00:00:00 2001 From: Holden <68555040+HTRamsey@users.noreply.github.com> Date: Thu, 8 Aug 2024 16:21:25 -0400 Subject: [PATCH 2/5] Update simple_writer.cpp Fix Windows Check --- ulog_cpp/simple_writer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ulog_cpp/simple_writer.cpp b/ulog_cpp/simple_writer.cpp index 0651859..a4841fb 100644 --- a/ulog_cpp/simple_writer.cpp +++ b/ulog_cpp/simple_writer.cpp @@ -5,7 +5,7 @@ #include "simple_writer.hpp" -#ifdef WINDOWS +#ifdef _WIN32 #include #else #include @@ -112,7 +112,7 @@ void SimpleWriter::fsync() { if (_file) { fflush(_file); -#ifdef WINDOWS +#ifdef _WIN32 FlushFileBuffers(static_cast(_fileno(_file))); #else ::fsync(fileno(_file)); From d3c8503a38a6dc7fe30ec113c98ec27bd79e6d4f Mon Sep 17 00:00:00 2001 From: Holden <68555040+HTRamsey@users.noreply.github.com> Date: Thu, 8 Aug 2024 16:25:02 -0400 Subject: [PATCH 3/5] Update simple_writer.cpp Import windows for target architecture --- ulog_cpp/simple_writer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ulog_cpp/simple_writer.cpp b/ulog_cpp/simple_writer.cpp index a4841fb..9da33e6 100644 --- a/ulog_cpp/simple_writer.cpp +++ b/ulog_cpp/simple_writer.cpp @@ -6,6 +6,7 @@ #include "simple_writer.hpp" #ifdef _WIN32 +#include #include #else #include From df9d1c1989520d475009d69db24f0efe10aaaf59 Mon Sep 17 00:00:00 2001 From: Holden <68555040+HTRamsey@users.noreply.github.com> Date: Thu, 8 Aug 2024 16:32:19 -0400 Subject: [PATCH 4/5] Update simple_writer.cpp Fix casting to HANDLE --- ulog_cpp/simple_writer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ulog_cpp/simple_writer.cpp b/ulog_cpp/simple_writer.cpp index 9da33e6..a0e8580 100644 --- a/ulog_cpp/simple_writer.cpp +++ b/ulog_cpp/simple_writer.cpp @@ -114,7 +114,7 @@ void SimpleWriter::fsync() if (_file) { fflush(_file); #ifdef _WIN32 - FlushFileBuffers(static_cast(_fileno(_file))); + FlushFileBuffers(reinterpret_cast(static_cast(_fileno(_file)))); #else ::fsync(fileno(_file)); #endif From 9ac787090269a7259b9df2975c1685cdf59d3b82 Mon Sep 17 00:00:00 2001 From: Holden <68555040+HTRamsey@users.noreply.github.com> Date: Sat, 17 Aug 2024 13:41:27 -0400 Subject: [PATCH 5/5] Update simple_writer.cpp Fix Lint Error --- ulog_cpp/simple_writer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ulog_cpp/simple_writer.cpp b/ulog_cpp/simple_writer.cpp index a0e8580..5331147 100644 --- a/ulog_cpp/simple_writer.cpp +++ b/ulog_cpp/simple_writer.cpp @@ -6,7 +6,7 @@ #include "simple_writer.hpp" #ifdef _WIN32 -#include +#include // NOLINT #include #else #include