From b4861b52285725822220daf0ff92900ca9ea8fb8 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 6 Dec 2021 02:06:25 +0100 Subject: [PATCH] menue_options.h: auto-calculate structs Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8eba953d48aba201659066d2377b9935652e8ef8 Author: vanhofen Date: 2021-12-06 (Mon, 06 Dec 2021) Origin message was: ------------------ - menue_options.h: auto-calculate structs --- src/gui/widget/menue_options.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gui/widget/menue_options.h b/src/gui/widget/menue_options.h index e780e8da3..64619bd61 100644 --- a/src/gui/widget/menue_options.h +++ b/src/gui/widget/menue_options.h @@ -1,27 +1,27 @@ -#define OPTIONS_OFF0_ON1_OPTION_COUNT 2 -const CMenuOptionChooser::keyval OPTIONS_OFF0_ON1_OPTIONS[OPTIONS_OFF0_ON1_OPTION_COUNT] = +const CMenuOptionChooser::keyval OPTIONS_OFF0_ON1_OPTIONS[] = { { 0, LOCALE_OPTIONS_OFF }, { 1, LOCALE_OPTIONS_ON } }; +#define OPTIONS_OFF0_ON1_OPTION_COUNT (sizeof(OPTIONS_OFF0_ON1_OPTIONS)/sizeof(CMenuOptionChooser::keyval)) -#define OPTIONS_OFF1_ON0_OPTION_COUNT 2 -const CMenuOptionChooser::keyval OPTIONS_OFF1_ON0_OPTIONS[OPTIONS_OFF1_ON0_OPTION_COUNT] = +const CMenuOptionChooser::keyval OPTIONS_OFF1_ON0_OPTIONS[] = { { 1, LOCALE_OPTIONS_OFF }, { 0, LOCALE_OPTIONS_ON } }; +#define OPTIONS_OFF1_ON0_OPTION_COUNT (sizeof(OPTIONS_OFF1_ON0_OPTIONS)/sizeof(CMenuOptionChooser::keyval)) -#define MESSAGEBOX_NO_YES_OPTION_COUNT 2 -const CMenuOptionChooser::keyval MESSAGEBOX_NO_YES_OPTIONS[MESSAGEBOX_NO_YES_OPTION_COUNT] = +const CMenuOptionChooser::keyval MESSAGEBOX_NO_YES_OPTIONS[] = { { 0, LOCALE_MESSAGEBOX_NO }, { 1, LOCALE_MESSAGEBOX_YES } }; +#define MESSAGEBOX_NO_YES_OPTION_COUNT (sizeof(MESSAGEBOX_NO_YES_OPTIONS)/sizeof(CMenuOptionChooser::keyval)) -#define OPTIONS_START0_STOP1_OPTION_COUNT 2 -const CMenuOptionChooser::keyval OPTIONS_START0_STOP1_OPTIONS[OPTIONS_START0_STOP1_OPTION_COUNT] = +const CMenuOptionChooser::keyval OPTIONS_START0_STOP1_OPTIONS[] = { { 0, LOCALE_OPTIONS_START }, { 1, LOCALE_OPTIONS_STOP } }; +#define OPTIONS_START0_STOP1_OPTION_COUNT (sizeof(OPTIONS_START0_STOP1_OPTIONS)/sizeof(CMenuOptionChooser::keyval))