From a6425d2eed1980665b3cacfa22266ff1ce8b168f Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 21 Oct 2023 14:44:24 +0300 Subject: [PATCH 40/40] Drop support for "prefered" entries That spelling has been deprecated for a long time already. See osdn #48881 Signed-off-by: Marko Lindqvist --- client/tilespec.c | 18 ++++-------------- server/ruleset.c | 21 +++------------------ 2 files changed, 7 insertions(+), 32 deletions(-) diff --git a/client/tilespec.c b/client/tilespec.c index ae9141eec3..c7401459f6 100644 --- a/client/tilespec.c +++ b/client/tilespec.c @@ -2607,19 +2607,9 @@ static struct tileset *tileset_read_toplevel(const char *tileset_name, t->color_system = color_system_read(file); - /* FIXME: remove this hack. */ - t->preferred_themes = - (char **) secfile_lookup_str_vec(file, &num_preferred_themes, - "tilespec.preferred_themes"); - if (num_preferred_themes <= 0) { - t->preferred_themes = - (char **) secfile_lookup_str_vec(file, &num_preferred_themes, - "tilespec.prefered_themes"); - if (num_preferred_themes > 0) { - log_deprecation("Entry tilespec.prefered_themes in tilespec." - " Use correct spelling tilespec.preferred_themes instead"); - } - } + t->preferred_themes + = (char **) secfile_lookup_str_vec(file, &num_preferred_themes, + "tilespec.preferred_themes"); t->num_preferred_themes = num_preferred_themes; for (i = 0; i < t->num_preferred_themes; i++) { t->preferred_themes[i] = fc_strdup(t->preferred_themes[i]); @@ -2627,7 +2617,7 @@ static struct tileset *tileset_read_toplevel(const char *tileset_name, secfile_check_unused(file); secfile_destroy(file); - log_verbose("finished reading \"%s\".", fname); + log_verbose("Finished reading \"%s\".", fname); free(fname); return t; diff --git a/server/ruleset.c b/server/ruleset.c index 1ef4ab36dc..9d911c391b 100644 --- a/server/ruleset.c +++ b/server/ruleset.c @@ -6527,12 +6527,7 @@ static bool load_ruleset_game(struct section_file *file, bool act, } /* Section: tileset */ - pref_text = secfile_lookup_str_default(file, "", "tileset.prefered"); - if (pref_text[0] != '\0') { - log_deprecation("Entry tileset.prefered in game.ruleset." - " Use correct spelling tileset.preferred instead"); - } - pref_text = secfile_lookup_str_default(file, pref_text, "tileset.preferred"); + pref_text = secfile_lookup_str_default(file, "", "tileset.preferred"); if (pref_text[0] != '\0') { /* There was tileset suggestion */ sz_strlcpy(game.control.preferred_tileset, pref_text); @@ -6542,12 +6537,7 @@ static bool load_ruleset_game(struct section_file *file, bool act, } /* Section: soundset */ - pref_text = secfile_lookup_str_default(file, "", "soundset.prefered"); - if (pref_text[0] != '\0') { - log_deprecation("Entry soundset.prefered in game.ruleset." - " Use correct spelling soundset.preferred instead"); - } - pref_text = secfile_lookup_str_default(file, pref_text, "soundset.preferred"); + pref_text = secfile_lookup_str_default(file, "", "soundset.preferred"); if (pref_text[0] != '\0') { /* There was soundset suggestion */ sz_strlcpy(game.control.preferred_soundset, pref_text); @@ -6557,12 +6547,7 @@ static bool load_ruleset_game(struct section_file *file, bool act, } /* Section: musicset */ - pref_text = secfile_lookup_str_default(file, "", "musicset.prefered"); - if (pref_text[0] != '\0') { - log_deprecation("Entry musicset.prefered in game.ruleset." - " Use correct spelling musicset.preferred instead"); - } - pref_text = secfile_lookup_str_default(file, pref_text, "musicset.preferred"); + pref_text = secfile_lookup_str_default(file, "", "musicset.preferred"); if (pref_text[0] != '\0') { /* There was musicset suggestion */ sz_strlcpy(game.control.preferred_musicset, pref_text); -- 2.42.0