Unverified Commit 1160d7cd authored by Earle F. Philhower, III's avatar Earle F. Philhower, III Committed by GitHub

Replace ancient "boolean" with "bool" (#1908)

parent 2aa85e32
...@@ -46,7 +46,7 @@ IPAddress netMsk(255, 255, 255, 0); ...@@ -46,7 +46,7 @@ IPAddress netMsk(255, 255, 255, 0);
/** Should I connect to WLAN asap? */ /** Should I connect to WLAN asap? */
boolean connect; bool connect;
/** Last time I tried to connect to WLAN */ /** Last time I tried to connect to WLAN */
unsigned long lastConnectTry = 0; unsigned long lastConnectTry = 0;
......
...@@ -24,7 +24,7 @@ void handleRoot() { ...@@ -24,7 +24,7 @@ void handleRoot() {
} }
/** 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. */ /** 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. */
boolean captivePortal() { bool captivePortal() {
if (!isIp(server.hostHeader()) && server.hostHeader() != (String(myHostname) + ".local")) { if (!isIp(server.hostHeader()) && server.hostHeader() != (String(myHostname) + ".local")) {
Serial.println("Request redirected to captive portal"); Serial.println("Request redirected to captive portal");
server.sendHeader("Location", String("http://") + toStringIp(server.client().localIP()), true); server.sendHeader("Location", String("http://") + toStringIp(server.client().localIP()), true);
......
/** Is this an IP? */ /** Is this an IP? */
boolean isIp(String str) { bool isIp(String str) {
for (size_t i = 0; i < str.length(); i++) { for (size_t i = 0; i < str.length(); i++) {
int c = str.charAt(i); int c = str.charAt(i);
if (c != '.' && (c < '0' || c > '9')) { if (c != '.' && (c < '0' || c > '9')) {
......
...@@ -31,13 +31,13 @@ ...@@ -31,13 +31,13 @@
class SDClass { class SDClass {
public: public:
boolean begin(uint8_t csPin, HardwareSPI &spi) { bool begin(uint8_t csPin, HardwareSPI &spi) {
SDFS.setConfig(SDFSConfig(csPin, SPI_HALF_SPEED, spi)); SDFS.setConfig(SDFSConfig(csPin, SPI_HALF_SPEED, spi));
return (boolean)SDFS.begin(); return SDFS.begin();
} }
boolean begin(uint8_t csPin, uint32_t cfg = SPI_HALF_SPEED, HardwareSPI &spi = SPI) { bool begin(uint8_t csPin, uint32_t cfg = SPI_HALF_SPEED, HardwareSPI &spi = SPI) {
SDFS.setConfig(SDFSConfig(csPin, cfg, spi)); SDFS.setConfig(SDFSConfig(csPin, cfg, spi));
return (boolean)SDFS.begin(); return SDFS.begin();
} }
void end(bool endSPI = true) { void end(bool endSPI = true) {
...@@ -63,43 +63,43 @@ public: ...@@ -63,43 +63,43 @@ public:
return open(filename.c_str(), mode); return open(filename.c_str(), mode);
} }
boolean exists(const char *filepath) { bool exists(const char *filepath) {
return (boolean)SDFS.exists(filepath); return SDFS.exists(filepath);
} }
boolean exists(const String &filepath) { bool exists(const String &filepath) {
return (boolean)SDFS.exists(filepath.c_str()); return SDFS.exists(filepath.c_str());
} }
boolean rename(const char* filepathfrom, const char* filepathto) { bool rename(const char* filepathfrom, const char* filepathto) {
return (boolean)SDFS.rename(filepathfrom, filepathto); return SDFS.rename(filepathfrom, filepathto);
} }
boolean rename(const String &filepathfrom, const String &filepathto) { bool rename(const String &filepathfrom, const String &filepathto) {
return (boolean)rename(filepathfrom.c_str(), filepathto.c_str()); return rename(filepathfrom.c_str(), filepathto.c_str());
} }
boolean mkdir(const char *filepath) { bool mkdir(const char *filepath) {
return (boolean)SDFS.mkdir(filepath); return SDFS.mkdir(filepath);
} }
boolean mkdir(const String &filepath) { bool mkdir(const String &filepath) {
return (boolean)SDFS.mkdir(filepath.c_str()); return SDFS.mkdir(filepath.c_str());
} }
boolean remove(const char *filepath) { bool remove(const char *filepath) {
return (boolean)SDFS.remove(filepath); return SDFS.remove(filepath);
} }
boolean remove(const String &filepath) { bool remove(const String &filepath) {
return remove(filepath.c_str()); return remove(filepath.c_str());
} }
boolean rmdir(const char *filepath) { bool rmdir(const char *filepath) {
return (boolean)SDFS.rmdir(filepath); return SDFS.rmdir(filepath);
} }
boolean rmdir(const String &filepath) { bool rmdir(const String &filepath) {
return rmdir(filepath.c_str()); return rmdir(filepath.c_str());
} }
......
...@@ -262,15 +262,15 @@ void HTTPServer::setContentLength(const size_t contentLength) { ...@@ -262,15 +262,15 @@ void HTTPServer::setContentLength(const size_t contentLength) {
_contentLength = contentLength; _contentLength = contentLength;
} }
void HTTPServer::enableDelay(boolean value) { void HTTPServer::enableDelay(bool value) {
_nullDelay = value; _nullDelay = value;
} }
void HTTPServer::enableCORS(boolean value) { void HTTPServer::enableCORS(bool value) {
_corsEnabled = value; _corsEnabled = value;
} }
void HTTPServer::enableCrossOrigin(boolean value) { void HTTPServer::enableCrossOrigin(bool value) {
enableCORS(value); enableCORS(value);
} }
......
...@@ -146,9 +146,9 @@ public: ...@@ -146,9 +146,9 @@ public:
send(code, content_type, (const char *)content, contentLength); send(code, content_type, (const char *)content, contentLength);
} }
void enableDelay(boolean value); void enableDelay(bool value);
void enableCORS(boolean value = true); void enableCORS(bool value = true);
void enableCrossOrigin(boolean value = true); void enableCrossOrigin(bool value = true);
void setContentLength(const size_t contentLength); void setContentLength(const size_t contentLength);
void sendHeader(const String& name, const String& value, bool first = false); void sendHeader(const String& name, const String& value, bool first = false);
...@@ -235,7 +235,7 @@ protected: ...@@ -235,7 +235,7 @@ protected:
String value; String value;
}; };
boolean _corsEnabled; bool _corsEnabled;
WiFiClient *_currentClient; WiFiClient *_currentClient;
HTTPMethod _currentMethod; HTTPMethod _currentMethod;
...@@ -243,7 +243,7 @@ protected: ...@@ -243,7 +243,7 @@ protected:
uint8_t _currentVersion; uint8_t _currentVersion;
HTTPClientStatus _currentStatus; HTTPClientStatus _currentStatus;
unsigned long _statusChange; unsigned long _statusChange;
boolean _nullDelay; bool _nullDelay;
RequestHandler* _currentHandler; RequestHandler* _currentHandler;
RequestHandler* _firstHandler; RequestHandler* _firstHandler;
......
...@@ -339,7 +339,7 @@ int HTTPServer::_uploadReadByte(WiFiClient* client) { ...@@ -339,7 +339,7 @@ int HTTPServer::_uploadReadByte(WiFiClient* client) {
// keep trying until you either read a valid byte or timeout // keep trying until you either read a valid byte or timeout
unsigned long startMillis = millis(); unsigned long startMillis = millis();
unsigned long timeoutIntervalMillis = client->getTimeout(); unsigned long timeoutIntervalMillis = client->getTimeout();
boolean timedOut = false; bool timedOut = false;
for (;;) { for (;;) {
if (!client->connected()) { if (!client->connected()) {
return -1; return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment