From 67929a19bcc8e3fca81f895c2eb2a0881c330606 Mon Sep 17 00:00:00 2001 From: Thomas Stoddard Date: Mon, 6 Apr 2026 14:17:16 +0000 Subject: [PATCH] Example: Fix type casting for MSVC warnings --- examples/cpp/t1s/src/T1SSettingsExample.cpp | 9 +++++---- examples/cpp/t1s/src/T1SSymbolDecodingExample.cpp | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/examples/cpp/t1s/src/T1SSettingsExample.cpp b/examples/cpp/t1s/src/T1SSettingsExample.cpp index cd8b2ca..805f938 100644 --- a/examples/cpp/t1s/src/T1SSettingsExample.cpp +++ b/examples/cpp/t1s/src/T1SSettingsExample.cpp @@ -24,7 +24,7 @@ bool getUserConfirmation(const std::string& prompt) { std::cout << prompt << " (y/n): " << std::flush; std::getline(std::cin, input); if (!input.empty()) { - char c = std::tolower(input[0]); + char c = static_cast(std::tolower(input[0])); return (c == 'y'); } return false; @@ -48,7 +48,8 @@ std::vector selectNetworks(const std::vector(std::tolower(c)); }); if (input == "all") { return availableNetworks; @@ -166,10 +167,10 @@ void configureT1SNetwork(std::shared_ptr& device, icsneo::Networ uint8_t txOppTimer = getUint8Input("TX Opportunity Timer (0-255)", 20); device->settings->setT1STxOppTimerFor(netId, txOppTimer); - uint16_t maxBurst = getUint16Input("Max Burst (0-65535)", 128); + uint8_t maxBurst = getUint8Input("Max Burst (0-255)", 128); device->settings->setT1SMaxBurstFor(netId, maxBurst); - uint16_t burstTimer = getUint16Input("Burst Timer (0-65535)", 64); + uint8_t burstTimer = getUint8Input("Burst Timer (0-255)", 64); device->settings->setT1SBurstTimerFor(netId, burstTimer); if (device->settings->isT1STerminationEnabledFor(netId).has_value()) { diff --git a/examples/cpp/t1s/src/T1SSymbolDecodingExample.cpp b/examples/cpp/t1s/src/T1SSymbolDecodingExample.cpp index 0625617..9f85c96 100644 --- a/examples/cpp/t1s/src/T1SSymbolDecodingExample.cpp +++ b/examples/cpp/t1s/src/T1SSymbolDecodingExample.cpp @@ -98,7 +98,7 @@ bool getUserConfirmation(const std::string& prompt) { std::cout << prompt << " (y/n): " << std::flush; std::getline(std::cin, input); if (!input.empty()) { - char c = std::tolower(input[0]); + char c = static_cast(std::tolower(input[0])); return (c == 'y'); } return false;