From 1931c2cd2759a13bcc968685a1bddfd87aed30f8 Mon Sep 17 00:00:00 2001 From: Michal Paszta Date: Fri, 23 Nov 2018 10:07:32 +0100 Subject: [PATCH] Fix compilation warnings (apart from nanostack) --- .../802.15.4_RF/stm-s2lp-rf-driver/source/rf_configuration.c | 2 +- components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp | 2 +- features/cellular/framework/AT/ATHandler.cpp | 2 +- features/nanostack/mbed-mesh-api/source/wisun_tasklet.c | 1 + platform/mbed_board.c | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/components/802.15.4_RF/stm-s2lp-rf-driver/source/rf_configuration.c b/components/802.15.4_RF/stm-s2lp-rf-driver/source/rf_configuration.c index 0e0045784a..fee60bd667 100644 --- a/components/802.15.4_RF/stm-s2lp-rf-driver/source/rf_configuration.c +++ b/components/802.15.4_RF/stm-s2lp-rf-driver/source/rf_configuration.c @@ -101,7 +101,7 @@ void rf_conf_calculate_rx_filter_bandwidth_registers(uint32_t rx_bandwidth, uint uint8_t chflt_e_tmp = 0; uint8_t chflt_m_tmp = 0; - while (rx_bandwidth < 900000 / (2 << chflt_e_tmp)) { + while (rx_bandwidth < 900000u / (2 << chflt_e_tmp)) { chflt_e_tmp++; } uint32_t rx_bandwidth_tmp = rx_bandwidth; diff --git a/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp b/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp index f579dde2c1..7b666ebcc2 100644 --- a/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp +++ b/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.cpp @@ -791,7 +791,7 @@ int SDBlockDevice::_cmd(SDBlockDevice::cmdSupported cmd, uint32_t arg, bool isAc switch (cmd) { case CMD8_SEND_IF_COND: // Response R7 debug_if(_dbg, "V2-Version Card\n"); - _card_type = SDCARD_V2; + _card_type = SDCARD_V2; // fallthrough // Note: No break here, need to read rest of the response case CMD58_READ_OCR: // Response R3 response = (_spi.write(SPI_FILL_CHAR) << 24); diff --git a/features/cellular/framework/AT/ATHandler.cpp b/features/cellular/framework/AT/ATHandler.cpp index b1463f5d58..bbb278be81 100644 --- a/features/cellular/framework/AT/ATHandler.cpp +++ b/features/cellular/framework/AT/ATHandler.cpp @@ -467,7 +467,7 @@ ssize_t ATHandler::read_string(char *buf, size_t size, bool read_even_stop_tag) return -1; } - int len = 0; + unsigned int len = 0; size_t match_pos = 0; bool delimiter_found = false; diff --git a/features/nanostack/mbed-mesh-api/source/wisun_tasklet.c b/features/nanostack/mbed-mesh-api/source/wisun_tasklet.c index 194c9bb851..6cdec8aa59 100644 --- a/features/nanostack/mbed-mesh-api/source/wisun_tasklet.c +++ b/features/nanostack/mbed-mesh-api/source/wisun_tasklet.c @@ -27,6 +27,7 @@ #include "multicast_api.h" #include "mac_api.h" #include "sw_mac.h" +#include "ws_management_api.h" //ws_management_node_init // For tracing we need to define flag, have include and define group //#define HAVE_DEBUG diff --git a/platform/mbed_board.c b/platform/mbed_board.c index 143772a67c..d882f6ec1c 100644 --- a/platform/mbed_board.c +++ b/platform/mbed_board.c @@ -59,7 +59,7 @@ void mbed_error_vprintf(const char *format, va_list arg) { char buffer[132]; int size = vsnprintf(buffer, sizeof buffer, format, arg); - if (size >= sizeof buffer) { + if ((unsigned int)size >= sizeof buffer) { /* Output was truncated - indicate by overwriting tail of buffer * with ellipsis, newline and null terminator. */