Author: cazfi Date: Thu Mar 3 07:38:19 2016 New Revision: 32164 URL: http://svn.gna.org/viewcvs/freeciv?rev=32164&view=rev Log: Fixed warnings about unused helpdata entries when setting up help system without ruleset specific information.
See patch #7020 Modified: branches/S2_6/client/helpdata.c Modified: branches/S2_6/client/helpdata.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/helpdata.c?rev=32164&r1=32163&r2=32164&view=diff ============================================================================== --- branches/S2_6/client/helpdata.c (original) +++ branches/S2_6/client/helpdata.c Thu Mar 3 07:38:19 2016 @@ -2927,14 +2927,13 @@ char help_text_buffer[MAX_LEN_PACKET]; const char *sec_name = section_name(psection); const char *gen_str = secfile_lookup_str(sf, "%s.generate", sec_name); - + if (gen_str) { enum help_page_type current_type = HELP_ANY; int level = strspn(gen_str, " "); + gen_str += level; - if (!booted) { - continue; /* on initial boot data tables are empty */ - } + for (i = 2; help_type_names[i]; i++) { if (strcmp(gen_str, help_type_names[i]) == 0) { current_type = i; @@ -2945,6 +2944,19 @@ log_error("bad help-generate category \"%s\"", gen_str); continue; } + + if (!booted) { + if (current_type == HELP_EXTRA) { + size_t ncats; + + /* Avoid warnings about entries unused on this round, + * when the entries in question are valid once help system has been booted */ + (void) secfile_lookup_str_vec(sf, &ncats, + "%s.categories", sec_name); + } + continue; /* on initial boot data tables are empty */ + } + { /* Note these should really fill in pitem->text from auto-gen data instead of doing it later on the fly, but I don't want _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits