Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libraries/AsyncUDP/src/AsyncUDP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ static QueueHandle_t _udp_queue;
static volatile TaskHandle_t _udp_task_handle = NULL;

static void _udp_task(void *pvParameters) {
(void)pvParameters;
lwip_event_packet_t *e = NULL;
for (;;) {
if (xQueueReceive(_udp_queue, &e, portMAX_DELAY) == pdTRUE) {
Expand Down
2 changes: 1 addition & 1 deletion libraries/DNSServer/src/DNSServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ bool DNSServer::requestIncludesOnlyOneQuestion(DNSHeader &dnsHeader) {
String DNSServer::getDomainNameWithoutWwwPrefix(const unsigned char *start, size_t len) {
String parsedDomainName(start, --len); // exclude trailing null byte from labels length, String constructor will add it anyway

int pos = 0;
size_t pos = 0;
while (pos < len) {
parsedDomainName.setCharAt(pos, 0x2e); // replace label len byte with dot char "."
pos += *(start + pos);
Expand Down
5 changes: 4 additions & 1 deletion libraries/Ethernet/src/ETH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static ETHClass *_ethernets[NUM_SUPPORTED_ETH_PORTS] = {NULL, NULL, NULL};
static esp_event_handler_instance_t _eth_ev_instance = NULL;

static void _eth_event_cb(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data) {

(void)arg;
if (event_base == ETH_EVENT) {
esp_eth_handle_t eth_handle = *((esp_eth_handle_t *)event_data);
for (int i = 0; i < NUM_SUPPORTED_ETH_PORTS; ++i) {
Expand Down Expand Up @@ -146,6 +146,9 @@ ETHClass::ETHClass(uint8_t eth_index)
ETHClass::~ETHClass() {}

bool ETHClass::ethDetachBus(void *bus_pointer) {
if (!bus_pointer) {
return true;
}
ETHClass *bus = (ETHClass *)bus_pointer;
bus->end();
return true;
Expand Down
2 changes: 2 additions & 0 deletions libraries/Hash/src/PBKDF2_HMACBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ void PBKDF2_HMACBuilder::add(const uint8_t *data, size_t len) {

bool PBKDF2_HMACBuilder::addStream(Stream &stream, const size_t maxLen) {
log_e("PBKDF2_HMACBuilder does not support addStream. Use setPassword() and setSalt() instead.");
(void)stream;
(void)maxLen;
return false;
}

Expand Down
1 change: 1 addition & 0 deletions libraries/LittleFS/src/LittleFS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ LittleFSFS::~LittleFSFS() {
}

bool LittleFSFS::begin(bool formatOnFail, const char *basePath, uint8_t maxOpenFiles, const char *partitionLabel) {
(void)maxOpenFiles;

if (partitionLabel_) {
free(partitionLabel_);
Expand Down
1 change: 1 addition & 0 deletions libraries/Network/src/NetworkInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ extern "C" int lwip_hook_ip6_input(struct pbuf *p, struct netif *inp) {
#endif

static void _ip_event_cb(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data) {
(void)arg;
if (event_base == IP_EVENT) {
NetworkInterface *netif = NULL;
if (event_id == IP_EVENT_STA_GOT_IP || event_id == IP_EVENT_ETH_GOT_IP || event_id == IP_EVENT_PPP_GOT_IP) {
Expand Down
13 changes: 7 additions & 6 deletions libraries/NetworkClientSecure/src/ssl_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,10 @@ int start_ssl_client(
log_e("pre-shared key not valid hex or too long");
return -1;
}
unsigned char psk[MBEDTLS_PSK_MAX_LEN];
size_t psk_len = strlen(psKey) / 2;
for (int j = 0; j < strlen(psKey); j += 2) {
unsigned char pskBytes[MBEDTLS_PSK_MAX_LEN];
size_t pskStrLen = strlen(psKey);
size_t pskByteLen = pskStrLen / 2;
for (int j = 0; j < pskStrLen; j += 2) {
char c = psKey[j];
if (c >= '0' && c <= '9') {
c -= '0';
Expand All @@ -236,7 +237,7 @@ int start_ssl_client(
} else {
return -1;
}
psk[j / 2] = c << 4;
pskBytes[j / 2] = c << 4;
c = psKey[j + 1];
if (c >= '0' && c <= '9') {
c -= '0';
Expand All @@ -247,10 +248,10 @@ int start_ssl_client(
} else {
return -1;
}
psk[j / 2] |= c;
pskBytes[j / 2] |= c;
}
// set mbedtls config
ret = mbedtls_ssl_conf_psk(&ssl_client->ssl_conf, psk, psk_len, (const unsigned char *)pskIdent, strlen(pskIdent));
ret = mbedtls_ssl_conf_psk(&ssl_client->ssl_conf, pskBytes, pskByteLen, (const unsigned char *)pskIdent, strlen(pskIdent));
if (ret != 0) {
log_e("mbedtls_ssl_conf_psk returned %d", ret);
return handle_error(ret);
Expand Down
2 changes: 2 additions & 0 deletions libraries/Update/src/Updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ bool UpdateClass::rollBack() {
}

bool UpdateClass::begin(size_t size, int command, int ledPin, uint8_t ledOn, const char *label) {
(void)label;

if (_size > 0) {
log_w("already running");
return false;
Expand Down
14 changes: 7 additions & 7 deletions libraries/WebServer/src/Parsing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ bool WebServer::_parseRequest(NetworkClient &client) {
_currentHandler->raw(*this, _currentUri, *_currentRaw);
_currentRaw->status = RAW_WRITE;

while (_currentRaw->totalSize < _clientContentLength) {
size_t read_len = std::min(_clientContentLength - _currentRaw->totalSize, (size_t)HTTP_RAW_BUFLEN);
while (_currentRaw->totalSize < (size_t)_clientContentLength) {
size_t read_len = std::min((size_t)_clientContentLength - _currentRaw->totalSize, (size_t)HTTP_RAW_BUFLEN);
_currentRaw->currentSize = client.readBytes(_currentRaw->buf, read_len);
_currentRaw->totalSize += _currentRaw->currentSize;
if (_currentRaw->currentSize == 0) {
Expand All @@ -206,7 +206,7 @@ bool WebServer::_parseRequest(NetworkClient &client) {
} else if (!isForm) {
size_t plainLength;
char *plainBuf = readBytesWithTimeout(client, _clientContentLength, plainLength, HTTP_MAX_POST_WAIT);
if (plainLength < _clientContentLength) {
if (plainLength < (size_t)_clientContentLength) {
free(plainBuf);
return false;
}
Expand Down Expand Up @@ -407,7 +407,7 @@ int WebServer::_uploadReadByte(NetworkClient &client) {

bool WebServer::_parseForm(NetworkClient &client, const String &boundary, uint32_t len) {
(void)len;
log_v("Parse Form: Boundary: %s Length: %d", boundary.c_str(), len);
log_v("Parse Form: Boundary: %s Length: %u", boundary.c_str(), len);
String line;
int retry = 0;
do {
Expand All @@ -432,7 +432,7 @@ bool WebServer::_parseForm(NetworkClient &client, const String &boundary, uint32

line = client.readStringUntil('\r');
client.readStringUntil('\n');
if (line.length() > 19 && line.substring(0, 19).equalsIgnoreCase(F("Content-Disposition"))) {
if (line.length() > (size_t)19 && line.substring(0, 19).equalsIgnoreCase(F("Content-Disposition"))) {
int nameStart = line.indexOf('=');
if (nameStart != -1) {
argName = line.substring(nameStart + 2);
Expand All @@ -455,7 +455,7 @@ bool WebServer::_parseForm(NetworkClient &client, const String &boundary, uint32
line = client.readStringUntil('\r');
client.readStringUntil('\n');
while (line.length() > 0) {
if (line.length() > 12 && line.substring(0, 12).equalsIgnoreCase(FPSTR(Content_Type))) {
if (line.length() > (size_t)12 && line.substring(0, 12).equalsIgnoreCase(FPSTR(Content_Type))) {
argType = line.substring(line.indexOf(':') + 2);
}
//skip over any other headers
Expand All @@ -470,7 +470,7 @@ bool WebServer::_parseForm(NetworkClient &client, const String &boundary, uint32
if (line.startsWith("--" + boundary)) {
break;
}
if (argValue.length() > 0) {
if (argValue.length() > (size_t)0) {
argValue += "\n";
}
argValue += line;
Expand Down
2 changes: 2 additions & 0 deletions libraries/WebServer/src/WebServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ bool WebServer::authenticateBasicSHA1(const char *_username, const char *_sha1Ba

bool WebServer::authenticate(const char *_username, const char *_password) {
return WebServer::authenticate([_username, _password](HTTPAuthMethod mode, String username, String params[]) -> String * {
(void)mode;
(void)params;
return username.equalsConstantTime(_username) ? new String(_password) : NULL;
});
}
Expand Down
3 changes: 3 additions & 0 deletions libraries/WebServer/src/detail/RequestHandlersImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ RequestHandler &RequestHandler::removeMiddleware(Middleware *middleware) {
bool RequestHandler::process(WebServer &server, HTTPMethod requestMethod, String requestUri) {
if (_chain) {
return _chain->runChain(server, [this, &server, &requestMethod, &requestUri]() {
(void)requestUri;
return handle(server, requestMethod, requestUri);
});
} else {
Expand Down Expand Up @@ -71,6 +72,7 @@ class FunctionRequestHandler : public RequestHandler {
}

bool canRaw(const String &requestUri) override {
(void)requestUri;
if (!_ufn || _method == HTTP_GET) {
return false;
}
Expand All @@ -95,6 +97,7 @@ class FunctionRequestHandler : public RequestHandler {
}

bool canRaw(WebServer &server, const String &requestUri) override {
(void)requestUri;
if (!_ufn || _method == HTTP_GET || (_filter != NULL ? _filter(server) == false : false)) {
return false;
}
Expand Down
1 change: 1 addition & 0 deletions libraries/WebServer/src/middleware/Middleware.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Middleware {
virtual ~Middleware() {}

virtual bool run(WebServer &server, Callback next) {
(void)server;
return next();
};

Expand Down
1 change: 1 addition & 0 deletions libraries/WiFi/src/WiFiGeneric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ esp_netif_t *get_esp_interface_netif(esp_interface_t interface) {
}

static void _arduino_event_cb(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data) {
(void)arg;
arduino_event_t arduino_event;
arduino_event.event_id = ARDUINO_EVENT_MAX;

Expand Down
Loading