Author: sveinung
Date: Sun Sep  6 13:36:30 2015
New Revision: 29792

URL: http://svn.gna.org/viewcvs/freeciv?rev=29792&view=rev
Log:
Declare act prob parameters const

The parameters of the action probability functions shouldn't be modified
during action probability calculation.

See patch #6320

Modified:
    branches/S2_6/common/actions.c
    branches/S2_6/common/actions.h

Modified: branches/S2_6/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/actions.c?rev=29792&r1=29791&r2=29792&view=diff
==============================================================================
--- branches/S2_6/common/actions.c      (original)
+++ branches/S2_6/common/actions.c      Sun Sep  6 13:36:30 2015
@@ -1168,9 +1168,9 @@
   Get the actor unit's probability of successfully performing the chosen
   action on the target city.
 **************************************************************************/
-action_probability action_prob_vs_city(struct unit* actor_unit,
-                                       int action_id,
-                                       struct city* target_city)
+action_probability action_prob_vs_city(const struct unit* actor_unit,
+                                       const int action_id,
+                                       const struct city* target_city)
 {
   if (actor_unit == NULL || target_city == NULL) {
     /* Can't do an action when actor or target are missing. */
@@ -1203,9 +1203,9 @@
   Get the actor unit's probability of successfully performing the chosen
   action on the target unit.
 **************************************************************************/
-action_probability action_prob_vs_unit(struct unit* actor_unit,
-                                       int action_id,
-                                       struct unit* target_unit)
+action_probability action_prob_vs_unit(const struct unit* actor_unit,
+                                       const int action_id,
+                                       const struct unit* target_unit)
 {
   if (actor_unit == NULL || target_unit == NULL) {
     /* Can't do an action when actor or target are missing. */

Modified: branches/S2_6/common/actions.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/actions.h?rev=29792&r1=29791&r2=29792&view=diff
==============================================================================
--- branches/S2_6/common/actions.h      (original)
+++ branches/S2_6/common/actions.h      Sun Sep  6 13:36:30 2015
@@ -206,11 +206,13 @@
                                     const struct unit *actor_unit,
                                     const struct unit *target_unit);
 
-action_probability action_prob_vs_city(struct unit* actor, int action_id,
-                                       struct city* victim);
-
-action_probability action_prob_vs_unit(struct unit* actor, int action_id,
-                                       struct unit* victim);
+action_probability action_prob_vs_city(const struct unit* actor,
+                                       const int action_id,
+                                       const struct city* victim);
+
+action_probability action_prob_vs_unit(const struct unit* actor,
+                                       const int action_id,
+                                       const struct unit* victim);
 
 bool action_prob_possible(action_probability probability);
 


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

Reply via email to