Author: cazfi Date: Thu Sep 3 05:07:01 2015 New Revision: 29757 URL: http://svn.gna.org/viewcvs/freeciv?rev=29757&view=rev Log: Dropped no longer needed separate 'const' variants of extra_base_get() and extra_road_get().
See patch #6312 Modified: trunk/client/tilespec.c trunk/common/extras.c trunk/common/extras.h trunk/common/movement.c trunk/common/road.c Modified: trunk/client/tilespec.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/tilespec.c?rev=29757&r1=29756&r2=29757&view=diff ============================================================================== --- trunk/client/tilespec.c (original) +++ trunk/client/tilespec.c Thu Sep 3 05:07:01 2015 @@ -3928,7 +3928,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: trunk/common/extras.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/extras.c?rev=29757&r1=29756&r2=29757&view=diff ============================================================================== --- trunk/common/extras.c (original) +++ trunk/common/extras.c Thu Sep 3 05:07:01 2015 @@ -240,22 +240,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) @@ -389,12 +373,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; } @@ -530,7 +514,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: trunk/common/extras.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/extras.h?rev=29757&r1=29756&r2=29757&view=diff ============================================================================== --- trunk/common/extras.h (original) +++ trunk/common/extras.h Thu Sep 3 05:07:01 2015 @@ -151,8 +151,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: trunk/common/movement.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/movement.c?rev=29757&r1=29756&r2=29757&view=diff ============================================================================== --- trunk/common/movement.c (original) +++ trunk/common/movement.c Thu Sep 3 05:07:01 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: trunk/common/road.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/road.c?rev=29757&r1=29756&r2=29757&view=diff ============================================================================== --- trunk/common/road.c (original) +++ trunk/common/road.c Thu Sep 3 05:07:01 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