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); } diff --git a/ulog_cpp/simple_writer.cpp b/ulog_cpp/simple_writer.cpp index 0651859..5331147 100644 --- a/ulog_cpp/simple_writer.cpp +++ b/ulog_cpp/simple_writer.cpp @@ -5,7 +5,8 @@ #include "simple_writer.hpp" -#ifdef WINDOWS +#ifdef _WIN32 +#include // NOLINT #include #else #include @@ -112,8 +113,8 @@ void SimpleWriter::fsync() { if (_file) { fflush(_file); -#ifdef WINDOWS - FlushFileBuffers(static_cast(_fileno(_file))); +#ifdef _WIN32 + FlushFileBuffers(reinterpret_cast(static_cast(_fileno(_file)))); #else ::fsync(fileno(_file)); #endif