Author: sveinung
Date: Fri Mar 11 12:43:44 2016
New Revision: 32230

URL: http://svn.gna.org/viewcvs/freeciv?rev=32230&view=rev
Log:
Make are_requirements_opposites() static.

The function are_requirements_contradictions() checks if two requirements
contradict each other. The function are_requirements_opposites() tests if
two requirements are the exact negation of each other. The function
are_requirements_opposites() has no users outside requirements.c.

Make it less likely that someone accidentally uses
are_requirements_opposites() in a situation where they also want other
contradictions. Make it static.

See patch #7050

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

Modified: branches/S2_6/common/requirements.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/requirements.c?rev=32230&r1=32229&r2=32230&view=diff
==============================================================================
--- branches/S2_6/common/requirements.c (original)
+++ branches/S2_6/common/requirements.c Fri Mar 11 12:43:44 2016
@@ -900,8 +900,8 @@
 /****************************************************************************
   Returns TRUE if req1 and req2 directly negate each other.
 ****************************************************************************/
-bool are_requirements_opposites(const struct requirement *req1,
-                                const struct requirement *req2)
+static bool are_requirements_opposites(const struct requirement *req1,
+                                       const struct requirement *req2)
 {
   return (are_universals_equal(&req1->source, &req2->source)
           && req1->range == req2->range

Modified: branches/S2_6/common/requirements.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/requirements.h?rev=32230&r1=32229&r2=32230&view=diff
==============================================================================
--- branches/S2_6/common/requirements.h (original)
+++ branches/S2_6/common/requirements.h Fri Mar 11 12:43:44 2016
@@ -91,9 +91,6 @@
 
 bool are_requirements_equal(const struct requirement *req1,
                            const struct requirement *req2);
-
-bool are_requirements_opposites(const struct requirement *req1,
-                                const struct requirement *req2);
 
 bool are_requirements_contradictions(const struct requirement *req1,
                                      const struct requirement *req2);


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

Reply via email to