Author: cazfi
Date: Thu Sep  3 05:07:11 2015
New Revision: 29758

URL: http://svn.gna.org/viewcvs/freeciv?rev=29758&view=rev
Log:
Dropped no longer needed separate 'const' variants of extra_base_get() and 
extra_road_get().

See patch #6312

Modified:
    branches/S2_6/client/tilespec.c
    branches/S2_6/common/extras.c
    branches/S2_6/common/extras.h
    branches/S2_6/common/movement.c
    branches/S2_6/common/road.c

Modified: branches/S2_6/client/tilespec.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/tilespec.c?rev=29758&r1=29757&r2=29758&view=diff
==============================================================================
--- branches/S2_6/client/tilespec.c     (original)
+++ branches/S2_6/client/tilespec.c     Thu Sep  3 05:07:11 2015
@@ -3951,7 +3951,7 @@
   int extra_idx = -1;
   bool cl = FALSE;
   enum extrastyle_id extrastyle;
-  const struct road_type *proad = extra_road_get_const(pextra);
+  const struct road_type *proad = extra_road_get(pextra);
 
   extra_idx = extra_index(pextra);
 

Modified: branches/S2_6/common/extras.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/extras.c?rev=29758&r1=29757&r2=29758&view=diff
==============================================================================
--- branches/S2_6/common/extras.c       (original)
+++ branches/S2_6/common/extras.c       Thu Sep  3 05:07:11 2015
@@ -236,22 +236,6 @@
 }
 
 /**************************************************************************
-  Returns base type of extra. Uses const parameter.
-**************************************************************************/
-const struct base_type *extra_base_get_const(const struct extra_type *pextra)
-{
-  return pextra->data.base;
-}
-
-/**************************************************************************
-  Returns road type of extra. Uses const parameter.
-**************************************************************************/
-const struct road_type *extra_road_get_const(const struct extra_type *pextra)
-{
-  return pextra->data.road;
-}
-
-/**************************************************************************
   Returns extra type for given cause.
 **************************************************************************/
 struct extra_type_list *extra_type_list_by_cause(enum extra_cause cause)
@@ -385,12 +369,12 @@
                                  const struct tile *ptile)
 {
   if (is_extra_caused_by(pextra, EC_BASE)
-      && !base_can_be_built(extra_base_get_const(pextra), ptile)) {
+      && !base_can_be_built(extra_base_get(pextra), ptile)) {
     return FALSE;
   }
 
   if (is_extra_caused_by(pextra, EC_ROAD)
-      && !can_build_road_base(extra_road_get_const(pextra), pplayer, ptile)) {
+      && !can_build_road_base(extra_road_get(pextra), pplayer, ptile)) {
     return FALSE;
   }
 
@@ -526,7 +510,7 @@
     if (pterr->base_time == 0) {
       return FALSE;
     }
-    if (tile_city(ptile) != NULL && extra_base_get_const(pextra)->border_sq >= 
0) {
+    if (tile_city(ptile) != NULL && extra_base_get(pextra)->border_sq >= 0) {
       return FALSE;
     }
   }

Modified: branches/S2_6/common/extras.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/extras.h?rev=29758&r1=29757&r2=29758&view=diff
==============================================================================
--- branches/S2_6/common/extras.h       (original)
+++ branches/S2_6/common/extras.h       Thu Sep  3 05:07:11 2015
@@ -147,8 +147,6 @@
 
 struct base_type *extra_base_get(const struct extra_type *pextra);
 struct road_type *extra_road_get(const struct extra_type *pextra);
-const struct base_type *extra_base_get_const(const struct extra_type *pextra);
-const struct road_type *extra_road_get_const(const struct extra_type *pextra);
 
 void extra_to_caused_by_list(struct extra_type *pextra, enum extra_cause 
cause);
 struct extra_type_list *extra_type_list_by_cause(enum extra_cause cause);

Modified: branches/S2_6/common/movement.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/movement.c?rev=29758&r1=29757&r2=29758&view=diff
==============================================================================
--- branches/S2_6/common/movement.c     (original)
+++ branches/S2_6/common/movement.c     Thu Sep  3 05:07:11 2015
@@ -356,7 +356,7 @@
       return TRUE;
     }
 
-    proad = extra_road_get_const(pextra);
+    proad = extra_road_get(pextra);
     road_type_list_iterate(proad->integrators, iroad) {
       if (!tile_has_road(src_tile, iroad)) {
         continue;

Modified: branches/S2_6/common/road.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/road.c?rev=29758&r1=29757&r2=29758&view=diff
==============================================================================
--- branches/S2_6/common/road.c (original)
+++ branches/S2_6/common/road.c Thu Sep  3 05:07:11 2015
@@ -535,7 +535,7 @@
     return FALSE;
   }
 
-  proad = extra_road_get_const(pextra);
+  proad = extra_road_get(pextra);
 
   return proad->move_mode == RMM_CARDINAL || proad->move_mode == RMM_RELAXED;
 }


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

Reply via email to