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
+1 -5
View File
@@ -59,7 +59,7 @@ static bool UpdateClientConfigValues(int32 p1);
* assigns its own value. If the setting was company-based, that would mean that
* vehicles could decide on different moments that they are heading back to a
* service depot, causing desyncs on a massive scale. */
const SettingDesc _settings[] = {
const SettingTable _settings{
[post-amble]
};
[templates]
@@ -76,7 +76,6 @@ SDT_OMANY = SDT_OMANY($base, $var, $type, $flags, $guiflags, $def,
SDT_SSTR = SDT_SSTR($base, $var, $type, $flags, $guiflags, $def, $str, $strhelp, $strval, $proc, $from, $to, $cat, $extra, $startup),
SDT_VAR = SDT_VAR($base, $var, $type, $flags, $guiflags, $def, $min, $max, $interval, $str, $strhelp, $strval, $proc, $from, $to, $cat, $extra, $startup),
SDT_NULL = SDT_NULL($length, $from, $to),
SDT_END = SDT_END()
[validation]
SDTG_VAR = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
@@ -4112,6 +4111,3 @@ str = STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU
strhelp = STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_HELPTEXT
strval = STR_CONFIG_SETTING_RIGHT_MOUSE_BTN_EMU_COMMAND
cat = SC_BASIC
[SDT_END]