From 214b2279427dbd1fea6acac6a04e5b9deefe7b46 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Wed, 15 Jul 2020 10:50:54 +0200 Subject: [PATCH] Better fix GCC 10.1 warnings --- tasmota/support_network.ino | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/tasmota/support_network.ino b/tasmota/support_network.ino index 7bf7df30c..da6512acb 100644 --- a/tasmota/support_network.ino +++ b/tasmota/support_network.ino @@ -89,44 +89,34 @@ void MdnsUpdate(void) { \*********************************************************************************************/ char* NetworkHostname(void) { - if (global_state.eth_down) { - return my_hostname; - } #ifdef ESP32 #ifdef USE_ETHERNET - else { + if (!global_state.eth_down) { return EthernetHostname(); } #endif #endif - return nullptr; // Never reached. Fix GCC10 warning + return my_hostname; } IPAddress NetworkAddress(void) { - IPAddress result; - if (global_state.eth_down) { - result = WiFi.localIP(); - } #ifdef ESP32 #ifdef USE_ETHERNET - else { - result = EthernetLocalIP(); + if (!global_state.eth_down) { + return EthernetLocalIP(); } #endif #endif - return result; + return WiFi.localIP(); } String NetworkMacAddress(void) { - if (global_state.eth_down) { - return WiFi.macAddress(); - } #ifdef ESP32 #ifdef USE_ETHERNET - else { + if (!global_state.eth_down) { return EthernetMacAddress(); } #endif #endif - return String(""); // Never reached. Fix GCC10 warning + return WiFi.macAddress(); }