Better fix GCC 10.1 warnings

This commit is contained in:
Theo Arends 2020-07-15 10:50:54 +02:00
parent 07ca4dde23
commit 214b227942
1 changed files with 7 additions and 17 deletions

View File

@ -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();
}