From a4ab0112dc999eaef3c0bf355a5fa6ddfdc78a0b Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 27 May 2025 15:09:24 -0700 Subject: [PATCH] convert color_vars to std::array MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: warning: ‘display::color_vars’ defined but not used Could also add const to it. Do the same with color_names. Signed-off-by: Rosen Penev --- src/display/canvas.cc | 2 +- src/display/color_map.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/display/canvas.cc b/src/display/canvas.cc index 49d1e124..93f3e86d 100644 --- a/src/display/canvas.cc +++ b/src/display/canvas.cc @@ -106,7 +106,7 @@ Canvas::build_colors() { return; // basic color names, index maps to ncurses COLOR_* - static const char* color_names[] = { + static constexpr std::array color_names{ "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"}; // Those hold the background colors of "odd" and "even" diff --git a/src/display/color_map.h b/src/display/color_map.h index 3a9fb1e0..d91133ab 100644 --- a/src/display/color_map.h +++ b/src/display/color_map.h @@ -1,6 +1,7 @@ #ifndef RTORRENT_DISPLAY_COLOR_MAP_H #define RTORRENT_DISPLAY_COLOR_MAP_H +#include #include #include @@ -26,8 +27,8 @@ enum ColorKind { RCOLOR_MAX, }; -static const char* color_vars[RCOLOR_MAX] = { - 0, +static const std::array color_vars{ + nullptr, "ui.color.title", "ui.color.footer", "ui.color.focus",