refactor: migrate to C++11

This commit is contained in:
CLARATION committed 2026-07-22 00:59:14 -07:00
1 parent ef3644b684
commit cc45e0a40c
7 files changed
+35 -28

No files matched your search

+3 -3
View File
@@ -74,13 +74,13 @@ void TuiExploitPanel::draw(int sy, int sx, int selected) {
mvprintw(sy + 8, content_x, "%.*s", kExploitContentWidth, status_text.empty() ? stage_to_string(STAGE_RESET) : status_text.c_str());
const int bar_width = 50;
const int filled = (std::clamp(progress, 0, 100) * bar_width) / 100;
const int filled = (std::min(std::max(progress, 0), 100) * bar_width) / 100;
std::string bar(static_cast<size_t>(bar_width), '-');
for (int i = 0; i < filled; ++i) {
bar[static_cast<size_t>(i)] = '#';
}
mvprintw(sy + 10, sx + 2, "[%s] %3d%%", bar.c_str(), std::clamp(progress, 0, 100));
mvprintw(sy + 10, sx + 2, "[%s] %3d%%", bar.c_str(), std::min(std::max(progress, 0), 100));
}
void TuiExploitPanel::handle_enter(int selected, int sy, int sx) {
@@ -105,7 +105,7 @@ bool TuiExploitPanel::is_button_enabled(int btn_idx) const {
void TuiExploitPanel::set_status(const std::string& status, int progress) {
std::lock_guard<std::mutex> lock(m_status_mutex);
m_status_text = status;
m_progress = std::clamp(progress, 0, 100);
m_progress = std::min(std::max(progress, 0), 100);
}
void TuiExploitPanel::exploit()