mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-08 19:22:29 +00:00
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:
committed by
Jari Sundell
parent
897a6face2
commit
a4ab0112dc
@@ -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"
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user