Skip to content

Commit 4e0b627

Browse files
committed
Fixed an ambiguous type call to IPAddress. #480
1 parent 8b73002 commit 4e0b627

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

src/AutoConnect.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* AutoConnect class implementation.
33
* @file AutoConnect.cpp
44
5-
* @version 1.3.4
6-
* @date 2022-02-09
5+
* @version 1.3.5
6+
* @date 2022-04-24
77
* @copyright MIT license.
88
*/
99

@@ -324,7 +324,7 @@ bool AutoConnect::config(AutoConnectConfig& Config) {
324324
* by Config method.
325325
*/
326326
bool AutoConnect::_configAP(void) {
327-
if (static_cast<uint32_t>(_apConfig.apip) == 0U || static_cast<uint32_t>(_apConfig.gateway) == 0U || static_cast<uint32_t>(_apConfig.netmask) == 0U) {
327+
if ((uint32_t)_apConfig.apip == static_cast<uint32_t>(0) || (uint32_t)_apConfig.gateway == static_cast<uint32_t>(0) || (uint32_t)_apConfig.netmask == static_cast<uint32_t>(0)) {
328328
AC_DBG("Warning: Contains invalid SoftAPIP address(es).\n");
329329
}
330330
bool rc = WiFi.softAPConfig(_apConfig.apip, _apConfig.gateway, _apConfig.netmask);

src/AutoConnect.h

+12-12
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* Declaration of AutoConnect class and accompanying AutoConnectConfig class.
33
* @file AutoConnect.h
44
5-
* @version 1.3.4
6-
* @date 2022-02-09
5+
* @version 1.3.5
6+
* @date 2022-04-24
77
* @copyright MIT license.
88
*/
99

@@ -87,11 +87,11 @@ class AutoConnectConfig {
8787
homeUri(AUTOCONNECT_HOMEURI),
8888
title(AUTOCONNECT_MENU_TITLE),
8989
otaExtraCaption(nullptr),
90-
staip(0U),
91-
staGateway(0U),
92-
staNetmask(0U),
93-
dns1(0U),
94-
dns2(0U) {}
90+
staip(static_cast<uint32_t>(0)),
91+
staGateway(static_cast<uint32_t>(0)),
92+
staNetmask(static_cast<uint32_t>(0)),
93+
dns1(static_cast<uint32_t>(0)),
94+
dns2(static_cast<uint32_t>(0)) {}
9595
/**
9696
* Configure by SSID for the captive portal access point and password.
9797
*/
@@ -131,11 +131,11 @@ class AutoConnectConfig {
131131
homeUri(AUTOCONNECT_HOMEURI),
132132
title(AUTOCONNECT_MENU_TITLE),
133133
otaExtraCaption(nullptr),
134-
staip(0U),
135-
staGateway(0U),
136-
staNetmask(0U),
137-
dns1(0U),
138-
dns2(0U) {}
134+
staip(static_cast<uint32_t>(0)),
135+
staGateway(static_cast<uint32_t>(0)),
136+
staNetmask(static_cast<uint32_t>(0)),
137+
dns1(static_cast<uint32_t>(0)),
138+
dns2(static_cast<uint32_t>(0)) {}
139139

140140
~AutoConnectConfig() {}
141141

src/AutoConnectCredential.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* AutoConnectCredential class dispatcher.
33
* @file AutoConnectCredential.cpp
44
5-
* @version 1.3.0
6-
* @date 2021-03-25
5+
* @version 1.3.3
6+
* @date 2022-04-24
77
* @copyright MIT license.
88
*/
99

@@ -515,7 +515,7 @@ size_t AutoConnectCredential::_commit(void) {
515515
ssid = credt.first;
516516
credtBody = credt.second;
517517
sz += ssid.length() + sizeof('\0') + credtBody.password.length() + sizeof('\0') + sizeof(AC_CREDTBODY_t::bssid) + sizeof(AC_CREDTBODY_t::dhcp);
518-
if (credtBody.dhcp == (uint32_t)STA_STATIC) {
518+
if (credtBody.dhcp == static_cast<uint8_t>(STA_STATIC)) {
519519
for (uint8_t e = 0; e < sizeof(AC_CREDTBODY_t::ip) / sizeof(uint32_t); e++)
520520
sz += sizeof(uint32_t);
521521
}

0 commit comments

Comments
 (0)