From fbbe7309354a63a4b97a280e302031175bc9ca9d Mon Sep 17 00:00:00 2001 From: Louis Moureaux Date: Sun, 4 Feb 2024 03:18:06 +0100 Subject: [PATCH] Remove freeciv_datafile_version() It was always equal to freeciv21_version(). --- server/savegame/savegame3.cpp | 3 +-- tools/civmanual.cpp | 2 +- tools/ruleutil/rulesave.cpp | 2 +- utility/version.cpp | 15 --------------- utility/version.h | 1 - 5 files changed, 3 insertions(+), 20 deletions(-) diff --git a/server/savegame/savegame3.cpp b/server/savegame/savegame3.cpp index c315d65afe..119f4471df 100644 --- a/server/savegame/savegame3.cpp +++ b/server/savegame/savegame3.cpp @@ -1574,8 +1574,7 @@ static void sg_save_savefile(struct savedata *saving) secfile_insert_str(saving->file, saving->save_reason, "savefile.reason"); // Save as accurate freeciv revision information as possible - secfile_insert_str(saving->file, freeciv_datafile_version(), - "savefile.revision"); + secfile_insert_str(saving->file, freeciv21_version(), "savefile.revision"); /* Save rulesetdir at this point as this ruleset is required by this * savefile. */ diff --git a/tools/civmanual.cpp b/tools/civmanual.cpp index 8bf358986f..13af8e3364 100644 --- a/tools/civmanual.cpp +++ b/tools/civmanual.cpp @@ -188,7 +188,7 @@ static bool manual_command(struct tag_types *tag_info) fprintf(doc, "%s", tag_info->header); fprintf(doc, "\n\n", - freeciv_datafile_version()); + freeciv21_version()); switch (manuals) { case MANUAL_SETTINGS: diff --git a/tools/ruleutil/rulesave.cpp b/tools/ruleutil/rulesave.cpp index 52fdfaaa07..5d8b53b329 100644 --- a/tools/ruleutil/rulesave.cpp +++ b/tools/ruleutil/rulesave.cpp @@ -64,7 +64,7 @@ static struct section_file *create_ruleset_file(const char *rsname, } secfile_insert_str(sfile, buf, "datafile.description"); - secfile_insert_str(sfile, freeciv_datafile_version(), "datafile.ruledit"); + secfile_insert_str(sfile, freeciv21_version(), "datafile.ruledit"); secfile_insert_str(sfile, RULESET_CAPABILITIES, "datafile.options"); secfile_insert_int(sfile, FORMAT_VERSION, "datafile.format_version"); diff --git a/utility/version.cpp b/utility/version.cpp index ce94912aef..f72c3d3c9c 100644 --- a/utility/version.cpp +++ b/utility/version.cpp @@ -40,18 +40,3 @@ const char *freeciv_name_version() return msgbuf; } - -/** - Return version string in a format suitable to be written to created - datafiles as human readable information. - */ -const char *freeciv_datafile_version() -{ - static char buf[500] = {'\0'}; - - if (buf[0] == '\0') { - fc_snprintf(buf, sizeof(buf), "%s", freeciv21_version()); - } - - return buf; -} diff --git a/utility/version.h b/utility/version.h index 5b38a8bdf6..17db52af7e 100644 --- a/utility/version.h +++ b/utility/version.h @@ -15,4 +15,3 @@ // version informational strings const char *freeciv21_version(); const char *freeciv_name_version(); -const char *freeciv_datafile_version();