summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-03-17 08:01:54 +0000
committerDarkvater <darkvater@openttd.org>2006-03-17 08:01:54 +0000
commit583a52bd6f3fd24fadb75571eeee6663c94d7025 (patch)
tree435e2476979a7d39f84953c9118d9754ec479fd1
parent27d7d42404f98afeaeb62aef31408200cdf6ae7c (diff)
downloadopenttd-583a52bd6f3fd24fadb75571eeee6663c94d7025.tar.xz
(svn r3914) - Properly implement SDT(G)_CONDNULL macro's without special cases (add flag SLF_CONFIG_NO and empty string as name)
-rw-r--r--saveload.h4
-rw-r--r--settings.c6
2 files changed, 4 insertions, 6 deletions
diff --git a/saveload.h b/saveload.h
index 95a839fcc..fd815fc3a 100644
--- a/saveload.h
+++ b/saveload.h
@@ -179,7 +179,7 @@ typedef SaveLoad SaveLoadGlobVarList;
#define SLE_ARR(base, variable, type, length) SLE_CONDARR(base, variable, type, length, 0, SL_MAX_VERSION)
#define SLE_STR(base, variable, type, length) SLE_CONDSTR(base, variable, type, length, 0, SL_MAX_VERSION)
-#define SLE_CONDNULL(length, from, to) SLE_CONDARR(NullStruct, null, SLE_FILE_U8 | SLE_VAR_NULL, length, from, to)
+#define SLE_CONDNULL(length, from, to) SLE_CONDARR(NullStruct, null, SLE_FILE_U8 | SLE_VAR_NULL | SLF_CONFIG_NO, length, from, to)
/* Translate values ingame to different values in the savegame and vv */
#define SLE_WRITEBYTE(base, variable, game_value, file_value) SLE_GENERAL(SL_WRITEBYTE, base, variable, 0, 0, game_value, file_value)
@@ -213,7 +213,7 @@ typedef SaveLoad SaveLoadGlobVarList;
#define SLEG_ARR(variable, type) SLEG_CONDARR(variable, type, lengthof(variable), 0, SL_MAX_VERSION)
#define SLEG_STR(variable, type) SLEG_CONDSTR(variable, type, lengthof(variable), 0, SL_MAX_VERSION)
-#define SLEG_CONDNULL(length, from, to) {SL_ARR, SLE_FILE_U8 | SLE_VAR_NULL, length, from, to, (void*)NULL}
+#define SLEG_CONDNULL(length, from, to) {SL_ARR, SLE_FILE_U8 | SLE_VAR_NULL | SLF_CONFIG_NO, length, from, to, (void*)NULL}
#define SLEG_END() {SL_END, 0, 0, 0, 0, NULL}
diff --git a/settings.c b/settings.c
index 943824f9d..e51eb440a 100644
--- a/settings.c
+++ b/settings.c
@@ -615,7 +615,6 @@ static void ini_load_settings(IniFile *ini, const SettingDesc *sd, const char *g
const SaveLoad *sld = &sd->save;
if (!SlIsObjectCurrentlyValid(sld->version_from, sld->version_to)) continue;
- if (sd->desc.name == NULL) continue;
// XXX - wtf is this?? (group override?)
s = strchr(sdb->name, '.');
@@ -683,7 +682,6 @@ static void ini_save_settings(IniFile *ini, const SettingDesc *sd, const char *g
* file, just continue with the next setting */
if (!SlIsObjectCurrentlyValid(sld->version_from, sld->version_to)) continue;
if (sld->conv & SLF_CONFIG_NO) continue;
- if (sd->desc.name == NULL) continue;
// XXX - wtf is this?? (group override?)
s = strchr(sdb->name, '.');
@@ -882,7 +880,7 @@ static void ini_save_setting_list(IniFile *ini, const char *grpname, char **list
SDTG_CONDMMANY(name, type, flags, guiflags, var, def, full, str, proc, 0, SL_MAX_VERSION)
#define SDTG_CONDNULL(length, from, to)\
- {{NULL, NULL, 0, 0, 0, 0, NULL, STR_NULL, NULL}, SLEG_CONDNULL(length, from, to)}
+ {{"", NULL, 0, 0, 0, 0, NULL, STR_NULL, NULL}, SLEG_CONDNULL(length, from, to)}
#define SDTG_END() {{NULL, NULL, 0, 0, 0, 0, NULL, STR_NULL, NULL}, SLEG_END()}
@@ -931,7 +929,7 @@ static void ini_save_setting_list(IniFile *ini, const char *grpname, char **list
SDT_CONDMMANY(base, var, type, 0, SL_MAX_VERSION, flags, guiflags, def, full, str, proc)
#define SDT_CONDNULL(length, from, to)\
- {{NULL, NULL, 0, 0, 0, 0, NULL, STR_NULL, NULL}, SLE_CONDNULL(length, from, to)}
+ {{"", NULL, 0, 0, 0, 0, NULL, STR_NULL, NULL}, SLE_CONDNULL(length, from, to)}
#define SDT_END() {{NULL, NULL, 0, 0, 0, 0, NULL, STR_NULL, NULL}, SLE_END()}