1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

Fix warnings (#2881)

* Suppressed -Wunused-parameter and -Wunused-function by casting to void unused identifiers.

* Explicit initialization of all fields to suppress -Wmissing-field-initializers.

* Fixed signed/unsigned integer comparison.

* memset initialization of structs.

* More -Wunused-parameter fixes.
This commit is contained in:
Rodion Kvashnin
2017-01-31 13:07:59 +06:00
committed by Ivan Grokhotkov
parent d85e783806
commit 2126146e20
27 changed files with 92 additions and 12 deletions

View File

@ -361,7 +361,7 @@ uint8_t ESP8266WebServer::_uploadReadByte(WiFiClient& client){
}
bool ESP8266WebServer::_parseForm(WiFiClient& client, String boundary, uint32_t len){
(void) len;
#ifdef DEBUG_ESP_HTTP_SERVER
DEBUG_OUTPUT.print("Parse Form: Boundary: ");
DEBUG_OUTPUT.print(boundary);

View File

@ -4,10 +4,10 @@
class RequestHandler {
public:
virtual ~RequestHandler() { }
virtual bool canHandle(HTTPMethod method, String uri) { return false; }
virtual bool canUpload(String uri) { return false; }
virtual bool handle(ESP8266WebServer& server, HTTPMethod requestMethod, String requestUri) { return false; }
virtual void upload(ESP8266WebServer& server, String requestUri, HTTPUpload& upload) {}
virtual bool canHandle(HTTPMethod method, String uri) { (void) method; (void) uri; return false; }
virtual bool canUpload(String uri) { (void) uri; return false; }
virtual bool handle(ESP8266WebServer& server, HTTPMethod requestMethod, String requestUri) { (void) server; (void) requestMethod; (void) requestUri; return false; }
virtual void upload(ESP8266WebServer& server, String requestUri, HTTPUpload& upload) { (void) server; (void) requestUri; (void) upload; }
RequestHandler* next() { return _next; }
void next(RequestHandler* r) { _next = r; }

View File

@ -31,6 +31,7 @@ public:
}
bool handle(ESP8266WebServer& server, HTTPMethod requestMethod, String requestUri) override {
(void) server;
if (!canHandle(requestMethod, requestUri))
return false;
@ -39,6 +40,8 @@ public:
}
void upload(ESP8266WebServer& server, String requestUri, HTTPUpload& upload) override {
(void) server;
(void) upload;
if (canUpload(requestUri))
_ufn();
}