From 41d4a8dae0f0f5f665bf7eccdfc1a59632c1ae2a Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 27 Jun 2022 04:01:13 +0300 Subject: [PATCH 29/29] Savegame: Silence "unused entry" warnings about activities order That information is saved for the benefit of future versions. Freeciv-3.0 itself does not need it when loading the savegame. See osdn #44958 Signed-off-by: Marko Lindqvist --- server/savegame3.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/server/savegame3.c b/server/savegame3.c index 57744dc223..4cd5522a42 100644 --- a/server/savegame3.c +++ b/server/savegame3.c @@ -1281,6 +1281,7 @@ static void sg_load_savefile(struct loaddata *loading) const char *terr_name; const char *ruleset = NULL; bool current_ruleset_rejected; + size_t dummy_size; /* Check status and return if not OK (sg_success FALSE). */ sg_check_ret(); @@ -1395,6 +1396,19 @@ static void sg_load_savefile(struct loaddata *loading) secfile_error()); } + /* Freeciv-3.0 savegame format contains activities order, for the + * benefit of future versions. Freeciv-3.0 itself does not need it. + * Just lookup the entries to avoid warnings about unused entries. */ + dummy_size = secfile_lookup_int_default(loading->file, 0, + "savefile.activities_size"); + if (dummy_size > 0) { + const char **order = secfile_lookup_str_vec(loading->file, &dummy_size, + "savefile.activities_vector"); + if (order != NULL) { + free(order); + } + } + /* Load traits. */ loading->trait.size = secfile_lookup_int_default(loading->file, 0, -- 2.35.1