Author: sveinung
Date: Sun Oct 23 04:19:47 2016
New Revision: 34210

URL: http://svn.gna.org/viewcvs/freeciv?rev=34210&view=rev
Log:
Declare action_blocked_by_situation_*() const.

The action argument of the functions action_blocked_by_situation_act() and
action_blocked_by_situation_tgt() shouldn't modify their action argument.
Declare it const.

See patch #7860

Modified:
    trunk/common/actions.c
    trunk/common/actions.h

Modified: trunk/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=34210&r1=34209&r2=34210&view=diff
==============================================================================
--- trunk/common/actions.c      (original)
+++ trunk/common/actions.c      Sun Oct 23 04:19:47 2016
@@ -3356,10 +3356,10 @@
   Returns TRUE if the specified action never can be performed when the
   situation requirement is fulfilled for the actor.
 **************************************************************************/
-bool action_blocked_by_situation_act(struct action *action,
+bool action_blocked_by_situation_act(const struct action *paction,
                                      const struct requirement *situation)
 {
-  action_enabler_list_iterate(action_enablers_for_action(action->id),
+  action_enabler_list_iterate(action_enablers_for_action(paction->id),
                               enabler) {
     if (!does_req_contradicts_reqs(situation, &enabler->actor_reqs)) {
       return FALSE;
@@ -3373,10 +3373,10 @@
   Returns TRUE if the specified action never can be performed when the
   situation requirement is fulfilled for the target.
 **************************************************************************/
-bool action_blocked_by_situation_tgt(struct action *action,
+bool action_blocked_by_situation_tgt(const struct action *paction,
                                      const struct requirement *situation)
 {
-  action_enabler_list_iterate(action_enablers_for_action(action->id),
+  action_enabler_list_iterate(action_enablers_for_action(paction->id),
                               enabler) {
     if (!does_req_contradicts_reqs(situation, &enabler->target_reqs)) {
       return FALSE;

Modified: trunk/common/actions.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.h?rev=34210&r1=34209&r2=34210&view=diff
==============================================================================
--- trunk/common/actions.h      (original)
+++ trunk/common/actions.h      Sun Oct 23 04:19:47 2016
@@ -448,12 +448,12 @@
 /* Reasoning about actions */
 bool action_immune_government(struct government *gov, int act);
 
-bool action_blocked_by_situation_act(struct action *action,
+bool action_blocked_by_situation_act(const struct action *paction,
                                      const struct requirement *situation);
 #define action_id_blocked_by_situation_act(action_id, situation)          \
   action_blocked_by_situation_act(action_by_number(action_id), situation)
 
-bool action_blocked_by_situation_tgt(struct action *action,
+bool action_blocked_by_situation_tgt(const struct action *paction,
                                      const struct requirement *situation);
 #define action_id_blocked_by_situation_tgt(action_id, situation)          \
   action_blocked_by_situation_tgt(action_by_number(action_id), situation)


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to