From 814ceb35fc61c57823f0159a4d2661c8af28b3c8 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 26 Jun 2020 11:01:47 +0200 Subject: [PATCH] glcdsetup: auto-count structs Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b69984aeb69b2cc82e996020ed73ee8102b40afb Author: vanhofen Date: 2020-06-26 (Fri, 26 Jun 2020) Origin message was: ------------------ - glcdsetup: auto-count structs ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/glcdsetup.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gui/glcdsetup.cpp b/src/gui/glcdsetup.cpp index 96c5e0b61..ab0b698cb 100644 --- a/src/gui/glcdsetup.cpp +++ b/src/gui/glcdsetup.cpp @@ -39,8 +39,7 @@ #include #include "glcdthemes.h" -#define ONOFFSEC_OPTION_COUNT 6 -static const CMenuOptionChooser::keyval ONOFFSEC_OPTIONS[ONOFFSEC_OPTION_COUNT] = { +static const CMenuOptionChooser::keyval ONOFFSEC_OPTIONS[] = { { cGLCD::CLOCK_OFF, LOCALE_OPTIONS_OFF }, { cGLCD::CLOCK_SIMPLE, LOCALE_GLCD_STANDBY_SIMPLE_CLOCK }, { cGLCD::CLOCK_LED, LOCALE_GLCD_STANDBY_LED_CLOCK }, @@ -48,14 +47,15 @@ static const CMenuOptionChooser::keyval ONOFFSEC_OPTIONS[ONOFFSEC_OPTION_COUNT] { cGLCD::CLOCK_DIGITAL, LOCALE_GLCD_STANDBY_DIGITAL_CLOCK }, { cGLCD::CLOCK_ANALOG, LOCALE_GLCD_STANDBY_ANALOG_CLOCK } }; +#define ONOFFSEC_OPTION_COUNT (sizeof(ONOFFSEC_OPTIONS)/sizeof(CMenuOptionChooser::keyval)) -#define ONOFFPRI_OPTION_COUNT 4 -static const CMenuOptionChooser::keyval ONOFFPRI_OPTIONS[ONOFFPRI_OPTION_COUNT] = { - { 0, LOCALE_GLCD_ALIGN_NONE }, - { 1, LOCALE_GLCD_ALIGN_LEFT }, - { 2, LOCALE_GLCD_ALIGN_CENTER }, - { 3, LOCALE_GLCD_ALIGN_RIGHT }, +static const CMenuOptionChooser::keyval ONOFFPRI_OPTIONS[] = { + { cGLCD::ALIGN_NONE, LOCALE_GLCD_ALIGN_NONE }, + { cGLCD::ALIGN_LEFT, LOCALE_GLCD_ALIGN_LEFT }, + { cGLCD::ALIGN_CENTER, LOCALE_GLCD_ALIGN_CENTER }, + { cGLCD::ALIGN_RIGHT, LOCALE_GLCD_ALIGN_RIGHT } }; +#define ONOFFPRI_OPTION_COUNT (sizeof(ONOFFPRI_OPTIONS)/sizeof(CMenuOptionChooser::keyval)) #if 0 #define KEY_GLCD_BLACK 0