summaryrefslogtreecommitdiff
path: root/src/settings.cpp
diff options
context:
space:
mode:
authorrubidium42 <rubidium@openttd.org>2021-05-23 10:29:38 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-05-27 18:49:43 +0200
commitcf6b91f30f2e923b0084255e4082605803d2fd32 (patch)
treef70edadc09cda36e0f67e2ec1dfcafceda6de86c /src/settings.cpp
parent3bb6ce8827b71ae1dcfde4a7836fb6c636fb5a67 (diff)
downloadopenttd-cf6b91f30f2e923b0084255e4082605803d2fd32.tar.xz
Codechange: do not use SettingDescBase directly when not needed
Diffstat (limited to 'src/settings.cpp')
-rw-r--r--src/settings.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index 746e477da..15d90f312 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -379,7 +379,7 @@ static void MakeManyOfMany(char *buf, const char *last, const char *many, uint32
* @param orig_str input string that will be parsed based on the type of desc
* @return return the parsed value of the setting
*/
-static const void *StringToVal(const SettingDescBase *desc, const char *orig_str)
+static const void *StringToVal(const SettingDesc *desc, const char *orig_str)
{
const char *str = orig_str == nullptr ? "" : orig_str;
@@ -456,7 +456,7 @@ static const void *StringToVal(const SettingDescBase *desc, const char *orig_str
*/
static void Write_ValidateSetting(void *ptr, const SettingDesc *sd, int32 val)
{
- const SettingDescBase *sdb = sd;
+ const SettingDesc *sdb = sd;
if (sdb->cmd != SDT_BOOLX &&
sdb->cmd != SDT_NUMX &&
@@ -563,8 +563,8 @@ static void IniLoadSettings(IniFile *ini, const SettingTable &settings_table, co
IniGroup *group_def = ini->GetGroup(grpname);
for (auto &sd : settings_table) {
- const SettingDescBase *sdb = &sd;
- const SaveLoad *sld = &sd.save;
+ const SettingDesc *sdb = &sd;
+ const SaveLoad *sld = &sd.save;
if (!SlIsObjectCurrentlyValid(sld->version_from, sld->version_to)) continue;
if (sd.startup != only_startup) continue;
@@ -645,8 +645,8 @@ static void IniSaveSettings(IniFile *ini, const SettingTable &settings_table, co
void *ptr;
for (auto &sd : settings_table) {
- const SettingDescBase *sdb = &sd;
- const SaveLoad *sld = &sd.save;
+ const SettingDesc *sdb = &sd;
+ const SaveLoad *sld = &sd.save;
/* If the setting is not saved to the configuration
* file, just continue with the next setting */