fix: исправил предупреждения компилятора в релизной версии вебки

This commit is contained in:
2025-09-17 14:54:32 +03:00
parent 4c9b713c4e
commit 9efddd9930
2 changed files with 10 additions and 10 deletions

View File

@@ -569,7 +569,7 @@ void api_driver::obj::TerminalRxTxSettings::storeMainSettings(proxy::CpProxy &cp
#endif
}
#if defined(MODEM_IS_SCPC) || defined(MODEM_IS_SHPS)
struct ModcodDef_t {const char* modulation; const char* speed;};
const static ModcodDef_t ModcodDefs[] = {
{.modulation = "dummy", .speed = "0"},
@@ -637,7 +637,7 @@ static uint32_t buildModcodFromJson(const nlohmann::json& data, uint32_t modcod,
}
return (modcod << 2)| (isNormalFrame ? 0 : 2) | (isPilots ? 1 : 0);
}
#endif
void api_driver::obj::TerminalRxTxSettings::updateMainSettings(const nlohmann::json &data) {
// для модулятора
@@ -1011,8 +1011,8 @@ std::string api_driver::obj::TerminalManagerLogs::loadPreview() {
// Читаем файл с конца для эффективности
file.seekg(0, std::ios::end);
size_t size = file.tellg();
std::string content(size, '\0');
auto size = file.tellg();
std::string content(static_cast<size_t>(size), '\0');
file.seekg(0);
file.read(&content[0], size);
@@ -1041,7 +1041,7 @@ std::string api_driver::obj::TerminalManagerLogs::loadPreview() {
}
std::string api_driver::obj::TerminalManagerLogs::loadPreviewWithFilter(const std::string& logLevel) {
return "Logs filtering not supported yet...";
return "Logs level " + logLevel + " filtering not supported yet...";
}
void api_driver::obj::TerminalManagerLogs::loadFullLog(std::vector<char>& destData) {
@@ -1052,11 +1052,11 @@ void api_driver::obj::TerminalManagerLogs::loadFullLog(std::vector<char>& destDa
std::ifstream stream(logsFileDir + file, std::ios::binary | std::ios::ate);
if (!stream) continue;
std::streamsize size = stream.tellg();
auto size = stream.tellg();
stream.seekg(0, std::ios::beg);
size_t currentSize = destData.size();
destData.resize(currentSize + size);
destData.resize(currentSize + static_cast<size_t>(size));
stream.read(destData.data() + currentSize, size);
}
}

View File

@@ -81,7 +81,7 @@ class ServerResources {
std::string cmd(UPGRADE_COMMAND);
cmd += " ";
cmd += FIRMWARE_LOCATION;
system(cmd.c_str());
std::ignore = system(cmd.c_str());
cp.setDmaDebug("save_config", "");
});
}
@@ -479,7 +479,7 @@ public:
const std::string result = R"({"status":"ok"})";
rep.content.insert(rep.content.end(), result.c_str(), result.c_str() + result.size());
this->upgradeOrRebootRunning = true;
system(REBOOT_COMMAND);
std::ignore = system(REBOOT_COMMAND);
}));
s.resources.emplace_back(std::make_unique<http::auth::AuthRequiredResource>("/api/resetSettings", this->auth, http::auth::User::EDIT_SETTINGS, [this](const auto& req, auto& rep) {
if (req.method != "POST") {
@@ -491,7 +491,7 @@ public:
const std::string result = R"({"status":"ok"})";
rep.content.insert(rep.content.end(), result.c_str(), result.c_str() + result.size());
api->resetDefaultSettings();
system(REBOOT_COMMAND);
std::ignore = system(REBOOT_COMMAND);
}));
s.resources.emplace_back(std::make_unique<http::auth::AuthRequiredResource>("/api/firmwareUpdate", this->auth, http::auth::User::UPDATE_FIRMWARE, [this](const auto& req, auto& rep) {