convert color_vars to std::array

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 <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2025-05-27 15:09:24 -07:00
committed by Jari Sundell
parent 897a6face2
commit a4ab0112dc
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -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"
+3 -2
View File
@@ -1,6 +1,7 @@
#ifndef RTORRENT_DISPLAY_COLOR_MAP_H
#define RTORRENT_DISPLAY_COLOR_MAP_H
#include <array>
#include <map>
#include <curses.h>
@@ -26,8 +27,8 @@ enum ColorKind {
RCOLOR_MAX,
};
static const char* color_vars[RCOLOR_MAX] = {
0,
static const std::array<const char*, RCOLOR_MAX> color_vars{
nullptr,
"ui.color.title",
"ui.color.footer",
"ui.color.focus",