Author: cazfi
Date: Thu Mar  3 07:38:13 2016
New Revision: 32163

URL: http://svn.gna.org/viewcvs/freeciv?rev=32163&view=rev
Log:
Fixed warnings about unused helpdata entries when setting up help system 
without ruleset
specific information.

See patch #7020

Modified:
    trunk/client/helpdata.c

Modified: trunk/client/helpdata.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/helpdata.c?rev=32163&r1=32162&r2=32163&view=diff
==============================================================================
--- trunk/client/helpdata.c     (original)
+++ trunk/client/helpdata.c     Thu Mar  3 07:38:13 2016
@@ -2974,14 +2974,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;
@@ -2992,6 +2991,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

Reply via email to