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

@@ -9,14 +9,13 @@
#if defined(_WIN32) && !defined(DEDICATED)
extern bool _window_maximize;
static const SettingDesc _win32_settings[] = {
static const SettingTable _win32_settings{
[post-amble]
};
#endif /* _WIN32 */
[templates]
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");
@@ -42,6 +41,3 @@ name = ""window_maximize""
var = _window_maximize
def = false
cat = SC_BASIC
[SDTG_END]