From 707ed75138cb17c5bbd4b299972ede38c83398d8 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Mon, 8 Mar 2021 15:20:43 +0800 Subject: [PATCH] fix warnings found in nrf52 build --- src/RedirectablePrint.cpp | 2 +- src/mesh/Channels.cpp | 2 +- src/plugins/ExternalNotificationPlugin.cpp | 3 ++- src/plugins/SerialPlugin.cpp | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/RedirectablePrint.cpp b/src/RedirectablePrint.cpp index c60b8a502..fd634a99f 100644 --- a/src/RedirectablePrint.cpp +++ b/src/RedirectablePrint.cpp @@ -38,7 +38,7 @@ size_t RedirectablePrint::vprintf(const char *format, va_list arg) va_end(arg); return 0; }; - if (len >= printBufLen) { + if (len >= (int) printBufLen) { delete[] printBuf; printBufLen *= 2; printBuf = new char[printBufLen]; diff --git a/src/mesh/Channels.cpp b/src/mesh/Channels.cpp index 414930182..ab0a64b37 100644 --- a/src/mesh/Channels.cpp +++ b/src/mesh/Channels.cpp @@ -13,7 +13,7 @@ Channels channels; uint8_t xorHash(const uint8_t *p, size_t len) { uint8_t code = 0; - for (int i = 0; i < len; i++) + for (size_t i = 0; i < len; i++) code ^= p[i]; return code; } diff --git a/src/plugins/ExternalNotificationPlugin.cpp b/src/plugins/ExternalNotificationPlugin.cpp index 42865f3cc..0320c7b30 100644 --- a/src/plugins/ExternalNotificationPlugin.cpp +++ b/src/plugins/ExternalNotificationPlugin.cpp @@ -114,7 +114,8 @@ int32_t ExternalNotificationPlugin::runOnce() return (INT32_MAX); } - +#else + return INT32_MAX; #endif } diff --git a/src/plugins/SerialPlugin.cpp b/src/plugins/SerialPlugin.cpp index c93bf8521..9aab876f9 100644 --- a/src/plugins/SerialPlugin.cpp +++ b/src/plugins/SerialPlugin.cpp @@ -124,7 +124,8 @@ int32_t SerialPlugin::runOnce() return (INT32_MAX); } - +#else + return INT32_MAX; #endif }