Author: cazfi
Date: Sun Sep  6 00:25:38 2015
New Revision: 29786

URL: http://svn.gna.org/viewcvs/freeciv?rev=29786&view=rev
Log:
Turned extra_base_get() & extra_road_get() to macros.

See patch #6304

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

Modified: branches/S2_6/common/extras.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/extras.c?rev=29786&r1=29785&r2=29786&view=diff
==============================================================================
--- branches/S2_6/common/extras.c       (original)
+++ branches/S2_6/common/extras.c       Sun Sep  6 00:25:38 2015
@@ -217,22 +217,6 @@
   } extra_type_iterate_end;
 
   return NULL;
-}
-
-/**************************************************************************
-  Returns base type of extra.
-**************************************************************************/
-struct base_type *extra_base_get(const struct extra_type *pextra)
-{
-  return pextra->data.base;
-}
-
-/**************************************************************************
-  Returns road type of extra.
-**************************************************************************/
-struct road_type *extra_road_get(const struct extra_type *pextra)
-{
-  return pextra->data.road;
 }
 
 /**************************************************************************

Modified: branches/S2_6/common/extras.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/common/extras.h?rev=29786&r1=29785&r2=29786&view=diff
==============================================================================
--- branches/S2_6/common/extras.h       (original)
+++ branches/S2_6/common/extras.h       Sun Sep  6 00:25:38 2015
@@ -145,8 +145,8 @@
 struct extra_type *extra_type_by_rule_name(const char *name);
 struct extra_type *extra_type_by_translated_name(const char *name);
 
-struct base_type *extra_base_get(const struct extra_type *pextra);
-struct road_type *extra_road_get(const struct extra_type *pextra);
+#define extra_base_get(_e_) (_e_)->data.base
+#define extra_road_get(_e_) (_e_)->data.road
 
 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);


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

Reply via email to