From dbf763d908117335a30718f5e573ddc039f2754a Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 16 Apr 2021 05:06:45 +0300 Subject: [PATCH 55/55] Clean out VUT_UNUSED See osdn #42011 Signed-off-by: Marko Lindqvist --- ai/default/daieffects.c | 1 - common/fc_types.h | 100 ++++++++++++++++++------------------- common/reqtext.c | 1 - common/requirements.c | 12 ----- fc_version | 2 +- server/cityturn.c | 1 - server/rssanity.c | 1 - tools/ruledit/univ_value.c | 2 - 8 files changed, 49 insertions(+), 71 deletions(-) diff --git a/ai/default/daieffects.c b/ai/default/daieffects.c index b0ce514ce0..157e177889 100644 --- a/ai/default/daieffects.c +++ b/ai/default/daieffects.c @@ -819,7 +819,6 @@ bool dai_can_requirement_be_met_in_city(const struct requirement *preq, case VUT_GOOD: case VUT_MINCALFRAG: case VUT_COUNT: - case VUT_UNUSED: /* No sensible implementation possible with data available. */ break; } diff --git a/common/fc_types.h b/common/fc_types.h index b99d5dc859..157cf43704 100644 --- a/common/fc_types.h +++ b/common/fc_types.h @@ -699,58 +699,54 @@ typedef union { #define SPECENUM_VALUE19NAME "TerrainFlag" #define SPECENUM_VALUE20 VUT_NATIONALITY #define SPECENUM_VALUE20NAME "Nationality" - -#define SPECENUM_VALUE21 VUT_UNUSED -#define SPECENUM_VALUE21NAME "Unused" - -#define SPECENUM_VALUE22 VUT_ROADFLAG -#define SPECENUM_VALUE22NAME "RoadFlag" -#define SPECENUM_VALUE23 VUT_EXTRA -#define SPECENUM_VALUE23NAME "Extra" -#define SPECENUM_VALUE24 VUT_TECHFLAG -#define SPECENUM_VALUE24NAME "TechFlag" -#define SPECENUM_VALUE25 VUT_ACHIEVEMENT -#define SPECENUM_VALUE25NAME "Achievement" -#define SPECENUM_VALUE26 VUT_DIPLREL -#define SPECENUM_VALUE26NAME "DiplRel" -#define SPECENUM_VALUE27 VUT_MAXTILEUNITS -#define SPECENUM_VALUE27NAME "MaxUnitsOnTile" -#define SPECENUM_VALUE28 VUT_STYLE -#define SPECENUM_VALUE28NAME "Style" -#define SPECENUM_VALUE29 VUT_MINCULTURE -#define SPECENUM_VALUE29NAME "MinCulture" -#define SPECENUM_VALUE30 VUT_UNITSTATE -#define SPECENUM_VALUE30NAME "UnitState" -#define SPECENUM_VALUE31 VUT_MINMOVES -#define SPECENUM_VALUE31NAME "MinMoveFrags" -#define SPECENUM_VALUE32 VUT_MINVETERAN -#define SPECENUM_VALUE32NAME "MinVeteran" -#define SPECENUM_VALUE33 VUT_MINHP -#define SPECENUM_VALUE33NAME "MinHitPoints" -#define SPECENUM_VALUE34 VUT_AGE -#define SPECENUM_VALUE34NAME "Age" -#define SPECENUM_VALUE35 VUT_NATIONGROUP -#define SPECENUM_VALUE35NAME "NationGroup" -#define SPECENUM_VALUE36 VUT_TOPO -#define SPECENUM_VALUE36NAME "Topology" -#define SPECENUM_VALUE37 VUT_IMPR_GENUS -#define SPECENUM_VALUE37NAME "BuildingGenus" -#define SPECENUM_VALUE38 VUT_ACTION -#define SPECENUM_VALUE38NAME "Action" -#define SPECENUM_VALUE39 VUT_MINTECHS -#define SPECENUM_VALUE39NAME "MinTechs" -#define SPECENUM_VALUE40 VUT_EXTRAFLAG -#define SPECENUM_VALUE40NAME "ExtraFlag" -#define SPECENUM_VALUE41 VUT_MINCALFRAG -#define SPECENUM_VALUE41NAME "MinCalFrag" -#define SPECENUM_VALUE42 VUT_SERVERSETTING -#define SPECENUM_VALUE42NAME "ServerSetting" -#define SPECENUM_VALUE43 VUT_CITYSTATUS -#define SPECENUM_VALUE43NAME "CityStatus" -#define SPECENUM_VALUE44 VUT_MINFOREIGNPCT -#define SPECENUM_VALUE44NAME "MinForeignPct" -#define SPECENUM_VALUE45 VUT_ACTIVITY -#define SPECENUM_VALUE45NAME "Activity" +#define SPECENUM_VALUE21 VUT_ROADFLAG +#define SPECENUM_VALUE21NAME "RoadFlag" +#define SPECENUM_VALUE22 VUT_EXTRA +#define SPECENUM_VALUE22NAME "Extra" +#define SPECENUM_VALUE23 VUT_TECHFLAG +#define SPECENUM_VALUE23NAME "TechFlag" +#define SPECENUM_VALUE24 VUT_ACHIEVEMENT +#define SPECENUM_VALUE24NAME "Achievement" +#define SPECENUM_VALUE25 VUT_DIPLREL +#define SPECENUM_VALUE25NAME "DiplRel" +#define SPECENUM_VALUE26 VUT_MAXTILEUNITS +#define SPECENUM_VALUE26NAME "MaxUnitsOnTile" +#define SPECENUM_VALUE27 VUT_STYLE +#define SPECENUM_VALUE27NAME "Style" +#define SPECENUM_VALUE28 VUT_MINCULTURE +#define SPECENUM_VALUE28NAME "MinCulture" +#define SPECENUM_VALUE29 VUT_UNITSTATE +#define SPECENUM_VALUE29NAME "UnitState" +#define SPECENUM_VALUE30 VUT_MINMOVES +#define SPECENUM_VALUE30NAME "MinMoveFrags" +#define SPECENUM_VALUE31 VUT_MINVETERAN +#define SPECENUM_VALUE31NAME "MinVeteran" +#define SPECENUM_VALUE32 VUT_MINHP +#define SPECENUM_VALUE32NAME "MinHitPoints" +#define SPECENUM_VALUE33 VUT_AGE +#define SPECENUM_VALUE33NAME "Age" +#define SPECENUM_VALUE34 VUT_NATIONGROUP +#define SPECENUM_VALUE34NAME "NationGroup" +#define SPECENUM_VALUE35 VUT_TOPO +#define SPECENUM_VALUE35NAME "Topology" +#define SPECENUM_VALUE36 VUT_IMPR_GENUS +#define SPECENUM_VALUE36NAME "BuildingGenus" +#define SPECENUM_VALUE37 VUT_ACTION +#define SPECENUM_VALUE37NAME "Action" +#define SPECENUM_VALUE38 VUT_MINTECHS +#define SPECENUM_VALUE38NAME "MinTechs" +#define SPECENUM_VALUE39 VUT_EXTRAFLAG +#define SPECENUM_VALUE39NAME "ExtraFlag" +#define SPECENUM_VALUE40 VUT_MINCALFRAG +#define SPECENUM_VALUE40NAME "MinCalFrag" +#define SPECENUM_VALUE41 VUT_SERVERSETTING +#define SPECENUM_VALUE41NAME "ServerSetting" +#define SPECENUM_VALUE42 VUT_CITYSTATUS +#define SPECENUM_VALUE42NAME "CityStatus" +#define SPECENUM_VALUE43 VUT_MINFOREIGNPCT +#define SPECENUM_VALUE43NAME "MinForeignPct" +#define SPECENUM_VALUE44 VUT_ACTIVITY +#define SPECENUM_VALUE44NAME "Activity" /* Keep this last. */ #define SPECENUM_COUNT VUT_COUNT #include "specenum_gen.h" diff --git a/common/reqtext.c b/common/reqtext.c index 8b93f85206..38b4edd92f 100644 --- a/common/reqtext.c +++ b/common/reqtext.c @@ -2658,7 +2658,6 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, } case VUT_COUNT: - case VUT_UNUSED: break; } diff --git a/common/requirements.c b/common/requirements.c index 338b4d1a94..fb99c0cba0 100644 --- a/common/requirements.c +++ b/common/requirements.c @@ -375,7 +375,6 @@ void universal_value_from_str(struct universal *source, const char *value) } break; case VUT_COUNT: - case VUT_UNUSED: break; } @@ -573,7 +572,6 @@ struct universal universal_by_number(const enum universals_n kind, source.value.citystatus = value; return source; case VUT_COUNT: - case VUT_UNUSED: break; } @@ -693,7 +691,6 @@ int universal_number(const struct universal *source) case VUT_CITYSTATUS: return source->value.citystatus; case VUT_COUNT: - case VUT_UNUSED: break; } @@ -750,7 +747,6 @@ struct requirement req_from_str(const char *type, const char *range, switch (req.source.kind) { case VUT_NONE: case VUT_COUNT: - case VUT_UNUSED: break; case VUT_IMPROVEMENT: case VUT_IMPR_GENUS: @@ -918,7 +914,6 @@ struct requirement req_from_str(const char *type, const char *range, invalid = FALSE; break; case VUT_COUNT: - case VUT_UNUSED: break; } if (invalid) { @@ -983,7 +978,6 @@ struct requirement req_from_str(const char *type, const char *range, break; case VUT_NONE: case VUT_COUNT: - case VUT_UNUSED: break; } if (invalid) { @@ -3333,7 +3327,6 @@ bool is_req_active(const struct player *target_player, } break; case VUT_COUNT: - case VUT_UNUSED: log_error("is_req_active(): invalid source kind %d.", req->source.kind); return FALSE; } @@ -3459,7 +3452,6 @@ bool is_req_unchanging(const struct requirement *req) /* Once year is reached, it does not change again */ return req->source.value.minyear > game.info.year; case VUT_COUNT: - case VUT_UNUSED: break; } fc_assert_msg(FALSE, "Invalid source kind %d.", req->source.kind); @@ -3558,7 +3550,6 @@ bool universal_never_there(const struct universal *source) case VUT_TERRAINALTER: case VUT_MINYEAR: case VUT_NONE: - case VUT_UNUSED: case VUT_COUNT: /* Not implemented. */ break; @@ -4168,7 +4159,6 @@ bool are_universals_equal(const struct universal *psource1, case VUT_CITYSTATUS: return psource1->value.citystatus == psource2->value.citystatus; case VUT_COUNT: - case VUT_UNUSED: break; } @@ -4298,7 +4288,6 @@ const char *universal_rule_name(const struct universal *psource) case VUT_TERRAINALTER: return terrain_alteration_name(psource->value.terrainalter); case VUT_COUNT: - case VUT_UNUSED: break; } @@ -4597,7 +4586,6 @@ const char *universal_name_translation(const struct universal *psource, } return buf; case VUT_COUNT: - case VUT_UNUSED: break; } diff --git a/fc_version b/fc_version index 698ea17d91..26d70e8c7e 100755 --- a/fc_version +++ b/fc_version @@ -56,7 +56,7 @@ DEFAULT_FOLLOW_TAG=S3_2 # - No new mandatory capabilities can be added to the release branch; doing # so would break network capability of supposedly "compatible" releases. # -NETWORK_CAPSTRING="+Freeciv.Devel-3.2-2021.Apr.08b" +NETWORK_CAPSTRING="+Freeciv.Devel-3.2-2021.Apr.16b" FREECIV_DISTRIBUTOR="" diff --git a/server/cityturn.c b/server/cityturn.c index 21d23f2759..d1dea48020 100644 --- a/server/cityturn.c +++ b/server/cityturn.c @@ -1822,7 +1822,6 @@ static bool worklist_item_postpone_req_vec(struct universal *target, break; case VUT_NONE: case VUT_COUNT: - case VUT_UNUSED: fc_assert_ret_val_msg(FALSE, TRUE, "worklist_change_build_target() " "called with invalid preq"); diff --git a/server/rssanity.c b/server/rssanity.c index 65dfa49498..32f17fd68b 100644 --- a/server/rssanity.c +++ b/server/rssanity.c @@ -377,7 +377,6 @@ static bool sanity_check_req_set(int reqs_of_type[], int local_reqs_of_type[], /* Can have multiple requirements of these types */ break; case VUT_COUNT: - case VUT_UNUSED: /* Should never be in requirement vector */ fc_assert(FALSE); return FALSE; diff --git a/tools/ruledit/univ_value.c b/tools/ruledit/univ_value.c index ed0f69333d..111a931be4 100644 --- a/tools/ruledit/univ_value.c +++ b/tools/ruledit/univ_value.c @@ -212,7 +212,6 @@ bool universal_value_initial(struct universal *src) case VUT_EXTRAFLAG: src->value.extraflag = EF_NATIVE_TILE; return TRUE; - case VUT_UNUSED: case VUT_COUNT: fc_assert(src->kind != VUT_COUNT); return FALSE; @@ -430,7 +429,6 @@ void universal_kind_values(struct universal *univ, /* Requirement types having numerical value */ cb(NULL, FALSE, data); break; - case VUT_UNUSED: case VUT_COUNT: fc_assert(univ->kind != VUT_COUNT); break; -- 2.30.2