Skip to content

Commit

Permalink
Remove unnecessary macros
Browse files Browse the repository at this point in the history
and fix documentation
  • Loading branch information
psampathkumar committed Jul 10, 2022
1 parent 34fdde9 commit aaefc67
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 46 deletions.
2 changes: 0 additions & 2 deletions ai/default/daicity.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
struct adv_data;
struct tech_vector;

// defined and only used within aicity.c

// Who's coming to kill us, for attack co-ordination
struct ai_invasion {
int attack; // Units capable of attacking city
Expand Down
2 changes: 0 additions & 2 deletions client/cityrep.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
#include "cityrepdata.h"
#include "climisc.h"

#define NEG_VAL(x) ((x) < 0 ? (x) : (-x))
#define CMA_NONE (10000)
#define CMA_CUSTOM (10001)

class QHBoxLayout;
class QItemSelection;
Expand Down
1 change: 0 additions & 1 deletion client/climisc.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ cid cid_encode_building(const struct impr_type *pimprove);
cid cid_encode_from_city(const struct city *pcity);

struct universal cid_decode(cid cid);
#define cid_production cid_decode

bool city_unit_supported(const struct city *pcity,
const struct universal *target);
Expand Down
1 change: 0 additions & 1 deletion client/mapview_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ extern struct view mapview;
* reenabled afterwards. */
extern bool can_slide;

#define BORDER_WIDTH 2
#define GOTO_WIDTH 2

/*
Expand Down
2 changes: 0 additions & 2 deletions client/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ extern const struct option_set *server_optset;

struct option *optset_option_by_number(const struct option_set *poptset,
int id);
#define optset_option_by_index optset_option_by_number
struct option *optset_option_by_name(const struct option_set *poptset,
const char *name);
struct option *optset_option_first(const struct option_set *poptset);
Expand All @@ -212,7 +211,6 @@ const char *optset_category_name(const struct option_set *poptset,
// Common option functions.
const struct option_set *option_optset(const struct option *poption);
int option_number(const struct option *poption);
#define option_index option_number
const char *option_name(const struct option *poption);
const char *option_description(const struct option *poption);
QString option_help_text(const struct option *poption);
Expand Down
3 changes: 0 additions & 3 deletions common/clientutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ struct actcalc {

/**
Calculate completion time for all unit activities on tile.
If pmodunit is supplied, take into account the effect if it changed to
doing new_act on new_tgt instead of whatever it's currently doing (if
anything).
*/
static void calc_activity(struct actcalc *calc, const struct tile *ptile,
Activity_type_id new_act)
Expand Down
1 change: 0 additions & 1 deletion common/extras.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ struct extra_type *extra_type_by_translated_name(const char *name);

#define extra_base_get(_e_) (_e_)->data.base
#define extra_road_get(_e_) (_e_)->data.road
#define extra_resource_get(_e_) (_e_)->data.resource

void extra_to_caused_by_list(struct extra_type *pextra,
enum extra_cause cause);
Expand Down
4 changes: 0 additions & 4 deletions common/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -763,10 +763,6 @@ extern struct world wld;
#define RS_MIN_CITY_CENTER_OUTPUT 0
#define RS_MAX_CITY_CENTER_OUTPUT RS_MAX_VALUE

#define RS_DEFAULT_CITIES_MIN_DIST 2
#define RS_MIN_CITIES_MIN_DIST 1
#define RS_MAX_CITIES_MIN_DIST RS_MAX_VALUE

// the constants CITY_MAP_*_RADIUS are defined in city.c
#define RS_DEFAULT_CITY_RADIUS_SQ CITY_MAP_DEFAULT_RADIUS_SQ
#define RS_MIN_CITY_RADIUS_SQ CITY_MAP_MIN_RADIUS_SQ
Expand Down
17 changes: 0 additions & 17 deletions common/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,21 +136,6 @@ bool map_startpos_remove(struct tile *ptile);
*(pnat_x) = 2 * (map_x) - *(pnat_y)) \
: (*(pnat_x) = (map_x), *(pnat_y) = (map_y)))

/* Provide a block to convert from map to native coordinates. This allows
* you to use a native version of the map position within the block. Note
* that the native position is declared as const and can't be changed
* inside the block. */
#define do_in_native_pos(nat_x, nat_y, map_x, map_y) \
{ \
int _nat_x, _nat_y; \
MAP_TO_NATIVE_POS(&_nat_x, &_nat_y, map_x, map_y); \
{ \
const int nat_x = _nat_x, nat_y = _nat_y;

#define do_in_native_pos_end \
} \
}

/* Provide a block to convert from map to natural coordinates. This allows
* you to use a natural version of the map position within the block. Note
* that the natural position is declared as const and can't be changed
Expand All @@ -167,8 +152,6 @@ bool map_startpos_remove(struct tile *ptile);
}

// Width and height of the map, in native coordinates.
#define NATIVE_WIDTH wld.map.xsize
#define NATIVE_HEIGHT wld.map.ysize

// Width and height of the map, in natural coordinates.
#define NATURAL_WIDTH (MAP_IS_ISOMETRIC ? 2 * wld.map.xsize : wld.map.xsize)
Expand Down
13 changes: 0 additions & 13 deletions common/requirements.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,19 +305,6 @@ bool universal_is_relevant_to_requirement(const struct requirement *req,
sv_universal_fulfills_requirements( \
false, (_rqs_), \
(struct universal){.value = {.utype = (_ut_)}, .kind = VUT_UTYPE})
#define requirement_fulfilled_by_extra(_ex_, _rqs_) \
sv_universal_fulfills_requirements( \
false, (_rqs_), \
(struct universal){.value = {.extra = (_ex_)}, .kind = VUT_EXTRA})
#define requirement_fulfilled_by_output_type(_o_, _rqs_) \
sv_universal_fulfills_requirements( \
false, (_rqs_), \
(struct universal){.value = {.outputtype = (_o_)}, \
.kind = VUT_OTYPE})
#define requirement_fulfilled_by_action(_act_, _rqs_) \
sv_universal_fulfills_requirements( \
false, (_rqs_), \
(struct universal){.value = {.action = (_act_)}, .kind = VUT_ACTION})

#define requirement_needs_improvement(_imp_, _rqs_) \
sv_universal_fulfills_requirements( \
Expand Down

0 comments on commit aaefc67

Please sign in to comment.