Skip to content

Commit

Permalink
Mark event arrays const
Browse files Browse the repository at this point in the history
  • Loading branch information
cgzones committed Dec 20, 2020
1 parent 6b100b0 commit 7e7a53c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions IncSet.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void IncSet_reset(IncSet* this, IncType type) {

static const char* const searchFunctions[] = {"Next ", "Cancel ", " Search: ", NULL};
static const char* const searchKeys[] = {"F3", "Esc", " "};
static int searchEvents[] = {KEY_F(3), 27, ERR};
static const int searchEvents[] = {KEY_F(3), 27, ERR};

static inline void IncMode_initSearch(IncMode* search) {
memset(search, 0, sizeof(IncMode));
Expand All @@ -41,7 +41,7 @@ static inline void IncMode_initSearch(IncMode* search) {

static const char* const filterFunctions[] = {"Done ", "Clear ", " Filter: ", NULL};
static const char* const filterKeys[] = {"Enter", "Esc", " "};
static int filterEvents[] = {13, 27, ERR};
static const int filterEvents[] = {13, 27, ERR};

static inline void IncMode_initFilter(IncMode* filter) {
memset(filter, 0, sizeof(IncMode));
Expand Down
2 changes: 1 addition & 1 deletion InfoScreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static const char* const InfoScreenFunctions[] = {"Search ", "Filter ", "Refresh

static const char* const InfoScreenKeys[] = {"F3", "F4", "F5", "Esc"};

static int InfoScreenEvents[] = {KEY_F(3), KEY_F(4), KEY_F(5), 27};
static const int InfoScreenEvents[] = {KEY_F(3), KEY_F(4), KEY_F(5), 27};

InfoScreen* InfoScreen_init(InfoScreen* this, const Process* process, FunctionBar* bar, int height, const char* panelHeader) {
this->process = process;
Expand Down
4 changes: 2 additions & 2 deletions MetersPanel.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ in the source distribution for its full text.
// we call them "Styles".
static const char* const MetersFunctions[] = {"Style ", "Move ", " ", "Delete", "Done ", NULL};
static const char* const MetersKeys[] = {"Space", "Enter", " ", "Del", "F10"};
static int MetersEvents[] = {' ', 13, ERR, KEY_DC, KEY_F(10)};
static const int MetersEvents[] = {' ', 13, ERR, KEY_DC, KEY_F(10)};

// We avoid UTF-8 arrows ← → here as they might display full-width on Chinese
// terminals, breaking our aligning.
// In <http:https://unicode.org/reports/tr11/>, arrows (U+2019..U+2199) are
// considered "Ambiguous characters".
static const char* const MetersMovingFunctions[] = {"Style ", "Lock ", "Up ", "Down ", "Left ", "Right ", " ", "Delete", "Done ", NULL};
static const char* const MetersMovingKeys[] = {"Space", "Enter", "Up", "Dn", "<-", "->", " ", "Del", "F10"};
static int MetersMovingEvents[] = {' ', 13, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, ERR, KEY_DC, KEY_F(10)};
static const int MetersMovingEvents[] = {' ', 13, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, ERR, KEY_DC, KEY_F(10)};
static FunctionBar* Meters_movingBar = NULL;

void MetersPanel_cleanup() {
Expand Down
2 changes: 1 addition & 1 deletion TraceScreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static const char* const TraceScreenFunctions[] = {"Search ", "Filter ", "AutoSc

static const char* const TraceScreenKeys[] = {"F3", "F4", "F8", "F9", "Esc"};

static int TraceScreenEvents[] = {KEY_F(3), KEY_F(4), KEY_F(8), KEY_F(9), 27};
static const int TraceScreenEvents[] = {KEY_F(3), KEY_F(4), KEY_F(8), KEY_F(9), 27};

const InfoScreenClass TraceScreen_class = {
.super = {
Expand Down

0 comments on commit 7e7a53c

Please sign in to comment.