From 704190dc7cdeba36cde393cbc12f167f4b21aee8 Mon Sep 17 00:00:00 2001 From: JesusPoderoso Date: Tue, 21 May 2024 14:49:44 +0200 Subject: [PATCH] Refs #20575: Fix windows build issues Signed-off-by: JesusPoderoso --- examples/cpp/configuration/CLIParser.hpp | 10 ++++++---- examples/cpp/configuration/PublisherApp.hpp | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/cpp/configuration/CLIParser.hpp b/examples/cpp/configuration/CLIParser.hpp index 32a7828fb78..3ea076963fa 100644 --- a/examples/cpp/configuration/CLIParser.hpp +++ b/examples/cpp/configuration/CLIParser.hpp @@ -249,7 +249,7 @@ class CLIParser } // max value allowed taking into account that the input is receiving millisecond values - uint32_t max_duration = floor(std::numeric_limits::max() * 1e-3); // = 4294967 + uint32_t max_duration = static_cast(floor(std::numeric_limits::max() * 1e-3)); // = 4294967 for (int i = 2; i < argc; ++i) { @@ -346,8 +346,8 @@ class CLIParser } else { - config.pub_config.ttl = static_cast(input); - config.sub_config.ttl = static_cast(input); + config.pub_config.ttl = static_cast(input); + config.sub_config.ttl = static_cast(input); } } catch (const std::invalid_argument& e) @@ -854,7 +854,7 @@ class CLIParser } else { - config.pub_config.wait = static_cast(input); + config.pub_config.wait = static_cast(input); } } catch (const std::invalid_argument& e) @@ -1098,10 +1098,12 @@ class CLIParser return "SIGINT"; case SIGTERM: return "SIGTERM"; +#ifndef _WIN32 case SIGQUIT: return "SIGQUIT"; case SIGHUP: return "SIGHUP"; +#endif // _WIN32 default: return "UNKNOWN SIGNAL"; } diff --git a/examples/cpp/configuration/PublisherApp.hpp b/examples/cpp/configuration/PublisherApp.hpp index d6c4e8f584f..e8f051d0da6 100644 --- a/examples/cpp/configuration/PublisherApp.hpp +++ b/examples/cpp/configuration/PublisherApp.hpp @@ -100,11 +100,11 @@ class PublisherApp : public Application, public DataWriterListener std::condition_variable cv_; - int16_t matched_; + int32_t matched_; std::mutex mutex_; - uint16_t period_ms_; + uint32_t period_ms_; uint16_t samples_;