From 66dc0ce1965bd033b6b52712c3db7a768ff2fba9 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Thu, 1 Jul 2021 19:59:13 +0200 Subject: Codechange: C++-ify the usage of IniFile in settings.cpp Instead of creating the object on heap and use a pointer, create the object on stack and use a guaranteed-not-null pointer. The size of IniFile doesn't warrent the forcing to heap. Additionally, use a subclass instead of a function to do some initial bookkeeping on an IniFile meant to read a configuration. --- src/settings_func.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/settings_func.h') diff --git a/src/settings_func.h b/src/settings_func.h index d1ecdbac1..9f56b6de1 100644 --- a/src/settings_func.h +++ b/src/settings_func.h @@ -24,8 +24,8 @@ void IConsoleListSettings(const char *prefilter); void LoadFromConfig(bool minimal = false); void SaveToConfig(); -void IniLoadWindowSettings(IniFile *ini, const char *grpname, void *desc); -void IniSaveWindowSettings(IniFile *ini, const char *grpname, void *desc); +void IniLoadWindowSettings(IniFile &ini, const char *grpname, void *desc); +void IniSaveWindowSettings(IniFile &ini, const char *grpname, void *desc); StringList GetGRFPresetList(); struct GRFConfig *LoadGRFPresetFromConfig(const char *config_name); -- cgit v1.2.3-54-g00ecf