Fixing compiler warnings exposed with -Wall and -Wextra: (#159)

AsyncWebHandler::setAuthentication: return is required.
AsyncWebSocketMultiMessage::~AsyncWebSocketMultiMessage: error: enumeral and non-enumeral type in conditional expression.
This commit is contained in:
Trygve Laugstøl 2017-04-20 10:14:00 +02:00 committed by Me No Dev
parent 2c4128c7cd
commit be12e0c171
2 changed files with 3 additions and 3 deletions

View File

@ -339,7 +339,7 @@ AsyncWebSocketBasicMessage::~AsyncWebSocketBasicMessage() {
size_t toSend = _len - _sent;
if(window < toSend) toSend = window;
bool final = ((toSend + _sent) == _len);
size_t sent = webSocketSendFrame(client, final, (_sent == 0)?_opcode:WS_CONTINUATION, _mask, (uint8_t*)(_data+_sent), toSend);
size_t sent = webSocketSendFrame(client, final, (_sent == 0)?_opcode:(int)WS_CONTINUATION, _mask, (uint8_t*)(_data+_sent), toSend);
_sent += sent;
uint8_t headLen = ((sent < 126)?2:4)+(_mask*4);
_ack += sent + headLen;
@ -416,7 +416,7 @@ AsyncWebSocketMultiMessage::~AsyncWebSocketMultiMessage() {
size_t toSend = _len - _sent;
if(window < toSend) toSend = window;
bool final = ((toSend + _sent) == _len);
size_t sent = webSocketSendFrame(client, final, (_sent == 0)?_opcode:WS_CONTINUATION, _mask, (uint8_t*)(_data+_sent), toSend);
size_t sent = webSocketSendFrame(client, final, (_sent == 0)?_opcode:(int)WS_CONTINUATION, _mask, (uint8_t*)(_data+_sent), toSend);
_sent += sent;
uint8_t headLen = ((sent < 126)?2:4)+(_mask*4);
_ack += sent + headLen;

View File

@ -306,7 +306,7 @@ class AsyncWebHandler {
public:
AsyncWebHandler():_username(""), _password(""){}
AsyncWebHandler& setFilter(ArRequestFilterFunction fn) { _filter = fn; return *this; }
AsyncWebHandler& setAuthentication(const char *username, const char *password){ _username = String(username);_password = String(password);};
AsyncWebHandler& setAuthentication(const char *username, const char *password){ _username = String(username);_password = String(password); return *this; };
bool filter(AsyncWebServerRequest *request){ return _filter == NULL || _filter(request); }
virtual ~AsyncWebHandler(){}
virtual bool canHandle(AsyncWebServerRequest *request __attribute__((unused))){