Improvement: Replace use of deprecated functions and improve compilation warnings (#817)

* Change deprecated Send_P to send function

* Fix compilation warnings in Wifi files

* Change warnings into compilation errors

* Add -Wall -Wextra -Wpedantic -Werror to github actions
This commit is contained in:
Daniel Öster 2025-01-24 18:40:08 +03:00 committed by GitHub
parent 854e9093fd
commit 275eaa9be8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 24 additions and 24 deletions

View file

@ -37,26 +37,26 @@ void init_webserver() {
server.on("/GetFirmwareInfo", HTTP_GET, [](AsyncWebServerRequest* request) {
if (WEBSERVER_AUTH_REQUIRED && !request->authenticate(http_username, http_password))
return request->requestAuthentication();
request->send_P(200, "application/json", get_firmware_info_html, get_firmware_info_processor);
request->send(200, "application/json", get_firmware_info_html, get_firmware_info_processor);
});
// Route for root / web page
server.on("/", HTTP_GET, [](AsyncWebServerRequest* request) {
if (WEBSERVER_AUTH_REQUIRED && !request->authenticate(http_username, http_password))
return request->requestAuthentication();
request->send_P(200, "text/html", index_html, processor);
request->send(200, "text/html", index_html, processor);
});
// Route for going to settings web page
server.on("/settings", HTTP_GET, [](AsyncWebServerRequest* request) {
if (WEBSERVER_AUTH_REQUIRED && !request->authenticate(http_username, http_password))
return request->requestAuthentication();
request->send_P(200, "text/html", index_html, settings_processor);
request->send(200, "text/html", index_html, settings_processor);
});
// Route for going to advanced battery info web page
server.on("/advanced", HTTP_GET, [](AsyncWebServerRequest* request) {
request->send_P(200, "text/html", index_html, advanced_battery_processor);
request->send(200, "text/html", index_html, advanced_battery_processor);
});
// Route for going to CAN logging web page
@ -76,7 +76,7 @@ void init_webserver() {
// Define the handler to stop can logging
server.on("/stop_can_logging", HTTP_GET, [](AsyncWebServerRequest* request) {
datalayer.system.info.can_logging_active = false;
request->send_P(200, "text/plain", "Logging stopped");
request->send(200, "text/plain", "Logging stopped");
});
#ifndef LOG_CAN_TO_SD
@ -119,7 +119,7 @@ void init_webserver() {
// Define the handler to delete can log
server.on("/delete_can_log", HTTP_GET, [](AsyncWebServerRequest* request) {
delete_can_log();
request->send_P(200, "text/plain", "Log file deleted");
request->send(200, "text/plain", "Log file deleted");
});
#endif
@ -127,7 +127,7 @@ void init_webserver() {
// Define the handler to delete log file
server.on("/delete_log", HTTP_GET, [](AsyncWebServerRequest* request) {
delete_log();
request->send_P(200, "text/plain", "Log file deleted");
request->send(200, "text/plain", "Log file deleted");
});
// Define the handler to export debug log
@ -171,14 +171,14 @@ void init_webserver() {
server.on("/cellmonitor", HTTP_GET, [](AsyncWebServerRequest* request) {
if (WEBSERVER_AUTH_REQUIRED && !request->authenticate(http_username, http_password))
return request->requestAuthentication();
request->send_P(200, "text/html", index_html, cellmonitor_processor);
request->send(200, "text/html", index_html, cellmonitor_processor);
});
// Route for going to event log web page
server.on("/events", HTTP_GET, [](AsyncWebServerRequest* request) {
if (WEBSERVER_AUTH_REQUIRED && !request->authenticate(http_username, http_password))
return request->requestAuthentication();
request->send_P(200, "text/html", index_html, events_processor);
request->send(200, "text/html", index_html, events_processor);
});
// Route for clearing all events