Codechange: use initializer_lists for the settings tables

Not using vectors as those require copying from the initializer list and that
makes unique_ptrs to the actual SettingDesc objects later impossible.
This commit is contained in:
rubidium42
2021-05-18 21:01:42 +02:00
committed by rubidium42
parent 425d50372f
commit 3bb6ce8827
11 changed files with 107 additions and 117 deletions

View File

@@ -16,7 +16,7 @@ extern bool _allow_hidpi_window;
#define WITHOUT_COCOA
#endif
static const SettingDesc _misc_settings[] = {
static const SettingTable _misc_settings{
[post-amble]
};
[templates]
@@ -26,7 +26,6 @@ SDTG_OMANY = SDTG_OMANY($name, $type, $flags, $guiflags, $var, $def,
SDTG_SSTR = SDTG_SSTR($name, $type, $flags, $guiflags, $var, $def, $str, $strhelp, $strval, $proc, $from, $to, $cat, $extra, $startup),
SDTG_BOOL = SDTG_BOOL($name, $flags, $guiflags, $var, $def, $str, $strhelp, $strval, $proc, $from, $to, $cat, $extra, $startup),
SDTG_VAR = SDTG_VAR($name, $type, $flags, $guiflags, $var, $def, $min, $max, $interval, $str, $strhelp, $strval, $proc, $from, $to, $cat, $extra, $startup),
SDTG_END = SDTG_END()
[validation]
SDTG_VAR = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
@@ -353,6 +352,3 @@ ifdef = WITH_COCOA
name = ""allow_hidpi""
var = _allow_hidpi_window
def = true
[SDTG_END]