Feature #541 ยป 0006-Remove-MAX_NUM_REQS.patch
| client/gui-gtk-3.22/helpdlg.c | ||
|---|---|---|
| 
         sprintf(buf, "%d", imp->upkeep); 
   | 
||
| 
         gtk_label_set_text(GTK_LABEL(help_ilabel[3]), buf); 
   | 
||
| 
         /* FIXME: this should show ranges, negated reqs, and all the 
   | 
||
| 
          * MAX_NUM_REQS reqs.  
   | 
||
| 
         /* FIXME: this should show ranges, negated reqs, and all the reqs. 
   | 
||
| 
          * Currently it's limited to 1 req but this code is partially prepared 
   | 
||
| 
          * to be extended.  Remember MAX_NUM_REQS is a compile-time 
   | 
||
| 
          * definition. */ 
   | 
||
| 
          * to be extended. */ 
   | 
||
| 
         help_impr_req.u.req = NULL; 
   | 
||
| 
         requirement_vector_iterate(&imp->reqs, preq) { 
   | 
||
| 
           if (!preq->present) { 
   | 
||
| ... | ... | |
| 
         sprintf(buf, "%d", impr_base_build_shield_cost(imp)); 
   | 
||
| 
         gtk_label_set_text(GTK_LABEL(help_wlabel[1]), buf); 
   | 
||
| 
         /* FIXME: this should show ranges, negated reqs, and all the 
   | 
||
| 
          * MAX_NUM_REQS reqs.  
   | 
||
| 
         /* FIXME: this should show ranges, negated reqs, and all the reqs. 
   | 
||
| 
          * Currently it's limited to 1 req but this code is partially prepared 
   | 
||
| 
          * to be extended.  Remember MAX_NUM_REQS is a compile-time 
   | 
||
| 
          * definition. */ 
   | 
||
| 
          * to be extended. */ 
   | 
||
| 
         i = 0; 
   | 
||
| 
         help_wndr_req.u.req = NULL; 
   | 
||
| 
         requirement_vector_iterate(&imp->reqs, preq) { 
   | 
||
| client/gui-gtk-4.0/helpdlg.c | ||
|---|---|---|
| 
         sprintf(buf, "%d", imp->upkeep); 
   | 
||
| 
         gtk_label_set_text(GTK_LABEL(help_ilabel[3]), buf); 
   | 
||
| 
         /* FIXME: this should show ranges, negated reqs, and all the 
   | 
||
| 
          * MAX_NUM_REQS reqs. 
   | 
||
| 
         /* FIXME: this should show ranges, negated reqs, and all the reqs. 
   | 
||
| 
          * Currently it's limited to 1 req but this code is partially prepared 
   | 
||
| 
          * to be extended. Remember MAX_NUM_REQS is a compile-time 
   | 
||
| 
          * definition. */ 
   | 
||
| 
          * to be extended. */ 
   | 
||
| 
         help_impr_req.u.req = NULL; 
   | 
||
| 
         requirement_vector_iterate(&imp->reqs, preq) { 
   | 
||
| 
           if (!preq->present) { 
   | 
||
| ... | ... | |
| 
         sprintf(buf, "%d", impr_base_build_shield_cost(imp)); 
   | 
||
| 
         gtk_label_set_text(GTK_LABEL(help_wlabel[1]), buf); 
   | 
||
| 
         /* FIXME: this should show ranges, negated reqs, and all the 
   | 
||
| 
          * MAX_NUM_REQS reqs. 
   | 
||
| 
         /* FIXME: this should show ranges, negated reqs, and all the reqs. 
   | 
||
| 
          * Currently it's limited to 1 req but this code is partially prepared 
   | 
||
| 
          * to be extended. Remember MAX_NUM_REQS is a compile-time 
   | 
||
| 
          * definition. */ 
   | 
||
| 
          * to be extended. */ 
   | 
||
| 
         i = 0; 
   | 
||
| 
         help_wndr_req.u.req = NULL; 
   | 
||
| 
         requirement_vector_iterate(&imp->reqs, preq) { 
   | 
||
| client/gui-gtk-5.0/helpdlg.c | ||
|---|---|---|
| 
         sprintf(buf, "%d", imp->upkeep); 
   | 
||
| 
         gtk_label_set_text(GTK_LABEL(help_ilabel[3]), buf); 
   | 
||
| 
         /* FIXME: this should show ranges, negated reqs, and all the 
   | 
||
| 
          * MAX_NUM_REQS reqs. 
   | 
||
| 
         /* FIXME: this should show ranges, negated reqs, and all the reqs. 
   | 
||
| 
          * Currently it's limited to 1 req but this code is partially prepared 
   | 
||
| 
          * to be extended. Remember MAX_NUM_REQS is a compile-time 
   | 
||
| 
          * definition. */ 
   | 
||
| 
          * to be extended. */ 
   | 
||
| 
         help_impr_req.u.req = NULL; 
   | 
||
| 
         requirement_vector_iterate(&imp->reqs, preq) { 
   | 
||
| 
           if (!preq->present) { 
   | 
||
| ... | ... | |
| 
         sprintf(buf, "%d", impr_base_build_shield_cost(imp)); 
   | 
||
| 
         gtk_label_set_text(GTK_LABEL(help_wlabel[1]), buf); 
   | 
||
| 
         /* FIXME: this should show ranges, negated reqs, and all the 
   | 
||
| 
          * MAX_NUM_REQS reqs. 
   | 
||
| 
         /* FIXME: this should show ranges, negated reqs, and all the reqs. 
   | 
||
| 
          * Currently it's limited to 1 req but this code is partially prepared 
   | 
||
| 
          * to be extended. Remember MAX_NUM_REQS is a compile-time 
   | 
||
| 
          * definition. */ 
   | 
||
| 
          * to be extended. */ 
   | 
||
| 
         i = 0; 
   | 
||
| 
         help_wndr_req.u.req = NULL; 
   | 
||
| 
         requirement_vector_iterate(&imp->reqs, preq) { 
   | 
||
| client/gui-sdl2/helpdlg.c | ||
|---|---|---|
| 
       widget_add_as_prev(requirement_label, dock); 
   | 
||
| 
       dock = requirement_label; 
   | 
||
| 
       /* FIXME: this should show ranges, negated reqs, and all the 
   | 
||
| 
        * MAX_NUM_REQS reqs. 
   | 
||
| 
        * Currently it's limited to 1 req. Remember MAX_NUM_REQS is a compile-time 
   | 
||
| 
        * definition. */ 
   | 
||
| 
       /* FIXME: this should show ranges, negated reqs, and all the reqs. 
   | 
||
| 
        * Currently it's limited to 1 req. */ 
   | 
||
| 
       requirement_vector_iterate(&pimpr_type->reqs, preq) { 
   | 
||
| 
         if (!preq->present) { 
   | 
||
| 
           continue; 
   | 
||
| ... | ... | |
| 
       imp_count = 0; 
   | 
||
| 
       improvement_iterate(pimprove) { 
   | 
||
| 
         if (valid_improvement(pimprove)) { 
   | 
||
| 
           /* FIXME: this should show ranges and all the MAX_NUM_REQS reqs. 
   | 
||
| 
            * Currently it's limited to 1 req. Remember MAX_NUM_REQS is a compile-time 
   | 
||
| 
            * definition. */ 
   | 
||
| 
           /* FIXME: this should show ranges and all the reqs. 
   | 
||
| 
            * Currently it's limited to 1 req. */ 
   | 
||
| 
           requirement_vector_iterate(&(pimprove->reqs), preq) { 
   | 
||
| 
             if (VUT_ADVANCE == preq->source.kind 
   | 
||
| 
                 && advance_number(preq->source.value.advance) == tech) { 
   | 
||
| client/gui-sdl3/helpdlg.c | ||
|---|---|---|
| 
       widget_add_as_prev(requirement_label, dock); 
   | 
||
| 
       dock = requirement_label; 
   | 
||
| 
       /* FIXME: this should show ranges, negated reqs, and all the 
   | 
||
| 
        * MAX_NUM_REQS reqs. 
   | 
||
| 
        * Currently it's limited to 1 req. Remember MAX_NUM_REQS is a compile-time 
   | 
||
| 
        * definition. */ 
   | 
||
| 
       /* FIXME: this should show ranges, negated reqs, and all the reqs. 
   | 
||
| 
        * Currently it's limited to 1 req. */ 
   | 
||
| 
       requirement_vector_iterate(&pimpr_type->reqs, preq) { 
   | 
||
| 
         if (!preq->present) { 
   | 
||
| 
           continue; 
   | 
||
| ... | ... | |
| 
       imp_count = 0; 
   | 
||
| 
       improvement_iterate(pimprove) { 
   | 
||
| 
         if (valid_improvement(pimprove)) { 
   | 
||
| 
           /* FIXME: this should show ranges and all the MAX_NUM_REQS reqs. 
   | 
||
| 
            * Currently it's limited to 1 req. Remember MAX_NUM_REQS is a compile-time 
   | 
||
| 
            * definition. */ 
   | 
||
| 
           /* FIXME: this should show ranges and all the reqs. 
   | 
||
| 
            * Currently it's limited to 1 req. */ 
   | 
||
| 
           requirement_vector_iterate(&(pimprove->reqs), preq) { 
   | 
||
| 
             if (VUT_ADVANCE == preq->source.kind 
   | 
||
| 
                 && advance_number(preq->source.value.advance) == tech) { 
   | 
||
| common/fc_types.h | ||
|---|---|---|
| 
     struct action; 
   | 
||
| 
     /* Changing these will break network compatibility. 
   | 
||
| 
      * If changing MAX_NUM_REQS, also update user documentation in README.effects. */ 
   | 
||
| 
     /* Changing these will break network compatibility. */ 
   | 
||
| 
     #define SP_MAX 20 
   | 
||
| 
     #define MAX_NUM_REQS 40 
   | 
||
| 
     #define MAX_NUM_RULESETS 63 /* Used in the network protocol. */ 
   | 
||
| 
     #define MAX_RULESET_NAME_LENGTH 64 /* Used in the network protocol. */ 
   | 
||
| doc/README.effects | ||
|---|---|---|
| 
     you want to describe the requirement in your own words. The 'quiet' 
   | 
||
| 
     field has no effect on the game rules. 
   | 
||
| 
     Single requirement vector can have up to 40 requirements. 
   | 
||
| 
     A requirement vector may have any number of requirements (in theory; 
   | 
||
| 
     in practice whatever it's part of won't fit in a network packet anymore 
   | 
||
| 
     beyond a few hundred requirements). 
   | 
||
| 
     Requirement types and supported ranges 
   | 
||
| server/ruleset/ruleload.c | ||
|---|---|---|
| 
         requirement_vector_append(&reqs_list, req); 
   | 
||
| 
       } 
   | 
||
| 
       if (j > MAX_NUM_REQS) { 
   | 
||
| 
         ruleset_error(NULL, LOG_ERROR, 
   | 
||
| 
                       "Too many (%d) requirements for %s. Max is %d", 
   | 
||
| 
                       j, rfor, MAX_NUM_REQS); 
   | 
||
| 
         return NULL; 
   | 
||
| 
       } 
   | 
||
| 
       return &reqs_list; 
   | 
||
| 
     } 
   | 
||