8000 Replace ancient "boolean" with "bool" (#1908) · BritvaBo/arduino-pico@1160d7c · GitHub
[go: up one dir, main page]

Skip to content

Commit 1160d7c

Browse files
Replace ancient "boolean" with "bool" (earlephilhower#1908)
1 parent 2aa85e3 commit 1160d7c

File tree

7 files changed

+34
-34
lines changed

7 files changed

+34
-34
lines changed

libraries/DNSServer/examples/CaptivePortalAdvanced/CaptivePortalAdvanced.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ IPAddress netMsk(255, 255, 255, 0);
4646

4747

4848
/** Should I connect to WLAN asap? */
49-
boolean connect;
49+
bool connect;
5050

5151
/** Last time I tried to connect to WLAN */
5252
unsigned long lastConnectTry = 0;

libraries/DNSServer/examples/CaptivePortalAdvanced/handleHttp.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ void handleRoot() {
2424
}
2525

2626
/** Redirect to captive portal if we got a request for another domain. Return true in that case so the page handler do not try to handle the request again. */
27-
boolean captivePortal() {
27+
bool captivePortal() {
2828
if (!isIp(server.hostHeader()) && server.hostHeader() != (String(myHostname) + ".local")) {
2929
Serial.println("Request redirected to captive portal");
3030
server.sendHeader("Location", String("http://") + toStringIp(server.client().localIP()), true);

libraries/DNSServer/examples/CaptivePortalAdvanced/tools.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** Is this an IP? */
2-
boolean isIp(String str) {
2+
bool isIp(String str) {
33
for (size_t i = 0; i < str.length(); i++) {
44
int c = str.charAt(i);
55
if (c != '.' && (c < '0' || c > '9')) {

libraries/SD/src/SD.h

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131

3232
class SDClass {
3333
public:
34-
boolean begin(uint8_t csPin, HardwareSPI &spi) {
34+
bool begin(uint8_t csPin, HardwareSPI &spi) {
3535
SDFS.setConfig(SDFSConfig(csPin, SPI_HALF_SPEED, spi));
36-
return (boolean)SDFS.begin();
36+
return SDFS.begin();
3737
}
38-
boolean begin(uint8_t csPin, uint32_t cfg = SPI_HALF_SPEED, HardwareSPI &spi = SPI) {
38+
bool begin(uint8_t csPin, uint32_t cfg = SPI_HALF_SPEED, HardwareSPI &spi = SPI) {
3939
SDFS.setConfig(SDFSConfig(csPin, cfg, spi));
40-
return (boolean)SDFS.begin();
40+
return SDFS.begin();
4141
}
4242

4343
void end(bool endSPI = true) {
@@ -63,43 +63,43 @@ class SDClass {
6363
return open(filename.c_str(), mode);
6464
}
6565

66-
boolean exists(const char *filepath) {
67-
return (boolean)SDFS.exists(filepath);
66+
bool exists(const char *filepath) {
67+
return SDFS.exists(filepath);
6868
}
6969

70-
boolean exists(const String &filepath) {
71-
return (boolean)SDFS.exists(filepath.c_str());
70+
bool exists(const String &filepath) {
71+
return SDFS.exists(filepath.c_str());
7272
}
7373

74-
boolean rename(const char* filepathfrom, const char* filepathto) {
75-
return (boolean)SDFS.rename(filepathfrom, filepathto);
74+
bool rename(const char* filepathfrom, const char* filepathto) {
75+
return SDFS.rename(filepathfrom, filepathto);
7676
}
7777

78-
boolean rename(const String &filepathfrom, const String &filepathto) {
79-
return (boolean)rename(filepathfrom.c_str(), filepathto.c_str());
78+
bool rename(const String &filepathfrom, const String &filepathto) {
79+
return rename(filepathfrom.c_str(), filepathto.c_str());
8080
}
8181

82-
boolean mkdir(const char *filepath) {
83-
return (boolean)SDFS.mkdir(filepath);
82+
bool mkdir(const char *filepath) {
83+
return SDFS.mkdir(filepath);
8484
}
8585

86-
boolean mkdir(const String &filepath) {
87-
return (boolean)SDFS.mkdir(filepath.c_str());
86+
bool mkdir(const String &filepath) {
87+
return SDFS.mkdir(filepath.c_str());
8888
}
8989

90-
boolean remove(const char *filepath) {
91-
return (boolean)SDFS.remove(filepath);
90+
bool remove(const char *filepath) {
91+
return SDFS.remove(filepath);
9292
}
9393

94-
boolean remove(const String &filepath) {
94+
bool remove(const String &filepath) {
9595
return remove(filepath.c_str());
9696
}
9797

98-
boolean rmdir(const char *filepath) {
99-
return (boolean)SDFS.rmdir(filepath);
98+
bool rmdir(const char *filepath) {
99+
return SDFS.rmdir(filepath);
100100
}
101101

102-
boolean rmdir(const String &filepath) {
102+
bool rmdir(const String &filepath) {
103103
return rmdir(filepath.c_str());
104104
}
105105

libraries/WebServer/src/HTTPServer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,15 +262,15 @@ void HTTPServer::setContentLength(const size_t contentLength) {
262262
_contentLength = contentLength;
263263
}
264264

265-
void HTTPServer::enableDelay(boolean value) {
265+
void HTTPServer::enableDelay(bool value) {
266266
_nullDelay = value;
267267
}
268268

269-
void HTTPServer::enableCORS(boolean value) {
269+
void HTTPServer::enableCORS(bool value) {
270270
_corsEnabled = value;
271271
}
272272

273-
void HTTPServer::enableCrossOrigin(boolean value) {
273+
void HTTPServer::enableCrossOrigin(bool value) {
274274
enableCORS(value);
275275
}
276276

libraries/WebServer/src/HTTPServer.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ class HTTPServer {
146146
send(code, content_type, (const char *)content, contentLength);
147147
}
148148

149-
void enableDelay(boolean value);
150-
void enableCORS(boolean value = true);
151-
void enableCrossOrigin(boolean value = true);
149+
void enableDelay(bool value);
150+
void enableCORS(bool value = true);
151+
void enableCrossOrigin(bool value = true);
152152

153153
void setContentLength(const size_t contentLength);
154154
void sendHeader(const String& name, const String& value, bool first = false);
@@ -235,15 +235,15 @@ class HTTPServer {
235235
String value;
236236
};
237237

238-
boolean _corsEnabled;
238+
bool _corsEnabled;
239239

240240
WiFiClient *_currentClient;
241241
HTTPMethod _currentMethod;
242242
String _currentUri;
243243
uint8_t _currentVersion;
244244
HTTPClientStatus _currentStatus;
245245
unsigned long _statusChange;
246-
boolean _nullDelay;
246+
bool _nullDelay;
247247

248248
RequestHandler* _currentHandler;
249249
RequestHandler* _firstHandler;

libraries/WebServer/src/Parsing.cpp

Lines changed: 1 addition & 1 deletion
< 5FA7 td data-grid-cell-id="diff-ed2804967c26d7144c27cd6183397061f13617f5eb801a598f07ec7c881a08d9-339-339-2" data-line-anchor="diff-ed2804967c26d7144c27cd6183397061f13617f5eb801a598f07ec7c881a08d9R339" data-selected="false" role="gridcell" style="background-color:var(--bgColor-default);padding-right:24px" tabindex="-1" valign="top" class="focusable-grid-cell diff-text-cell right-side-diff-cell left-side">
// keep trying until you either read a valid byte or timeout
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ int HTTPServer::_uploadReadByte(WiFiClient* client) {
339339
340340
unsigned long startMillis = millis();
341341
unsigned long timeoutIntervalMillis = client->getTimeout();
342-
boolean timedOut = false;
342+
bool timedOut = false;
343343
for (;;) {
344344
if (!client->connected()) {
345345
return -1;

0 commit comments

Comments
 (0)
0