Skip to content

Commit f1aed44

Browse files
committed
Apply clang-tidy fixes
1 parent e5b6551 commit f1aed44

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+249
-976
lines changed

src/openvic-simulation/dataloader/Dataloader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Dataloader::path_vector_t Dataloader::_lookup_files_in_dir(
149149
path_vector_t ret;
150150
struct file_entry_t {
151151
fs::path file;
152-
fs::path const* root;
152+
fs::path const* root = nullptr;
153153
};
154154
string_map_t<file_entry_t> found_files;
155155
for (fs::path const& root : roots) {

src/openvic-simulation/dataloader/NodeTools.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,10 @@ using namespace std::string_view_literals;
249249
ONE_OR_MORE = _MUST_APPEAR | _CAN_REPEAT
250250
} expected_count;
251251
node_callback_t callback;
252-
size_t count;
252+
size_t count = 0;
253253

254254
dictionary_entry_t(expected_count_t new_expected_count, node_callback_t&& new_callback)
255-
: expected_count { new_expected_count }, callback { MOV(new_callback) }, count { 0 } {}
255+
: expected_count { new_expected_count }, callback { MOV(new_callback) } {}
256256

257257
constexpr bool must_appear() const {
258258
return static_cast<uint8_t>(expected_count) & static_cast<uint8_t>(expected_count_t::_MUST_APPEAR);

src/openvic-simulation/defines/AIDefines.cpp

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,7 @@
33
using namespace OpenVic;
44
using namespace OpenVic::NodeTools;
55

6-
AIDefines::AIDefines()
7-
: colony_weight {},
8-
administrator_weight {},
9-
industryworker_weight {},
10-
educator_weight {},
11-
soldier_weight {},
12-
soldier_fraction {},
13-
capitalist_fraction {},
14-
production_weight {},
15-
spam_penalty {},
16-
one_side_max_warscore {},
17-
pop_project_investment_max_budget_factor {},
18-
relation_limit_no_alliance_offer {},
19-
naval_supply_penalty_limit {},
20-
chance_build_railroad {},
21-
chance_build_naval_base {},
22-
chance_build_fort {},
23-
chance_invest_pop_proj {},
24-
chance_foreign_invest {},
25-
tws_awareness_score_low_cap {},
26-
tws_awareness_score_aspect {},
27-
peace_base_reluctance {},
28-
peace_time_duration {},
29-
peace_time_factor {},
30-
peace_time_factor_no_goals {},
31-
peace_war_exhaustion_factor {},
32-
peace_war_direction_factor {},
33-
peace_war_direction_winning_mult {},
34-
peace_force_balance_factor {},
35-
peace_ally_base_reluctance_mult {},
36-
peace_ally_time_mult {},
37-
peace_ally_war_exhaustion_mult {},
38-
peace_ally_war_direction_mult {},
39-
peace_ally_force_balance_mult {},
40-
aggression_base {},
41-
aggression_unciv_bonus {},
42-
fleet_size {},
43-
min_fleets {},
44-
max_fleets {},
45-
time_before_disband {} {}
6+
AIDefines::AIDefines() {}
467

478
std::string_view AIDefines::get_name() const {
489
return "ai";

src/openvic-simulation/defines/AIDefines.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ namespace OpenVic {
4747
fixed_point_t PROPERTY(peace_ally_force_balance_mult);
4848
fixed_point_t PROPERTY(aggression_base);
4949
fixed_point_t PROPERTY(aggression_unciv_bonus);
50-
size_t PROPERTY(fleet_size);
51-
size_t PROPERTY(min_fleets);
52-
size_t PROPERTY(max_fleets);
50+
size_t PROPERTY(fleet_size, 0);
51+
size_t PROPERTY(min_fleets, 0);
52+
size_t PROPERTY(max_fleets, 0);
5353
Timespan PROPERTY(time_before_disband);
5454

5555
AIDefines();

src/openvic-simulation/defines/CountryDefines.cpp

Lines changed: 1 addition & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -3,94 +3,7 @@
33
using namespace OpenVic;
44
using namespace OpenVic::NodeTools;
55

6-
CountryDefines::CountryDefines()
7-
: nationalism_duration {},
8-
rebels_hold_capital_success_duration {}, // NOT USED
9-
rebel_success_duration {},
10-
base_country_tax_efficiency {},
11-
base_country_admin_efficiency {},
12-
gold_to_cash_rate {},
13-
gold_to_worker_pay_rate {},
14-
great_power_rank {},
15-
lose_great_power_grace_days {},
16-
infamy_containment_limit {},
17-
max_bureaucracy_percentage {},
18-
bureaucracy_percentage_increment {},
19-
min_crimefight_percent {},
20-
max_crimefight_percent {},
21-
admin_efficiency_crimefight_percent {},
22-
conservative_increase_after_reform {},
23-
campaign_event_base_duration {},
24-
campaign_event_min_duration {}, // NOT USED
25-
campaign_event_state_duration_modifier {}, // NOT USED
26-
campaign_duration {},
27-
secondary_power_rank {},
28-
colony_to_state_prestige_gain {},
29-
colonial_liferating {},
30-
base_greatpower_daily_influence {},
31-
ai_support_reform {},
32-
base_monthly_diplopoints {},
33-
diplomat_travel_duration {},
34-
province_overseas_penalty {},
35-
noncore_tax_penalty {},
36-
base_tariff_efficiency {},
37-
colony_formed_prestige {},
38-
created_cb_valid_time {},
39-
loyalty_boost_on_party_win {},
40-
movement_radicalism_base {},
41-
movement_radicalism_passed_reform_effect {},
42-
movement_radicalism_nationalism_factor {},
43-
suppression_points_gain_base {},
44-
suppress_bureaucrat_factor {},
45-
wrong_reform_militancy_impact {},
46-
suppression_radicalisation_hit {},
47-
country_investment_industrial_score_factor {},
48-
unciv_tech_spread_max {},
49-
unciv_tech_spread_min {},
50-
min_delay_duration_between_reforms {},
51-
economic_reform_uh_factor {},
52-
military_reform_uh_factor {},
53-
wrong_reform_radical_impact {},
54-
tech_year_span {},
55-
tech_factor_vassal {},
56-
max_suppression {},
57-
prestige_hit_on_break_country {},
58-
min_mobilize_limit {},
59-
pop_growth_country_cache_days {},
60-
newspaper_printing_frequency {},
61-
newspaper_timeout_period {},
62-
newspaper_max_tension {},
63-
naval_base_supply_score_base {},
64-
naval_base_supply_score_empty {},
65-
naval_base_non_core_supply_score {},
66-
colonial_points_from_supply_factor {},
67-
colonial_points_for_non_core_base {},
68-
mobilization_speed_base {},
69-
mobilization_speed_rails_mult {},
70-
colonization_interest_lead {},
71-
colonization_influence_lead {},
72-
colonization_duration {},
73-
colonization_days_between_investment {},
74-
colonization_days_for_initial_investment {},
75-
colonization_protectorate_province_maintenance {},
76-
colonization_colony_province_maintenance {},
77-
colonization_colony_industry_maintenance {},
78-
colonization_colony_railway_maintenance {},
79-
colonization_interest_cost_initial {},
80-
colonization_interest_cost_neighbor_modifier {},
81-
colonization_interest_cost {},
82-
colonization_influence_cost {},
83-
colonization_extra_guard_cost {},
84-
colonization_release_dominion_cost {},
85-
colonization_create_state_cost {},
86-
colonization_create_protectorate_cost {},
87-
colonization_create_colony_cost {},
88-
colonization_colony_state_distance {},
89-
colonization_influence_temperature_per_day {},
90-
colonization_influence_temperature_per_level {},
91-
party_loyalty_hit_on_war_loss {},
92-
research_points_on_conquer_mult {},
93-
max_research_points {} {}
6+
CountryDefines::CountryDefines() {}
947

958
std::string_view CountryDefines::get_name() const {
969
return "country";

src/openvic-simulation/defines/CountryDefines.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace OpenVic {
2020
fixed_point_t PROPERTY(base_country_admin_efficiency);
2121
fixed_point_t PROPERTY(gold_to_cash_rate);
2222
fixed_point_t PROPERTY(gold_to_worker_pay_rate);
23-
size_t PROPERTY(great_power_rank);
23+
size_t PROPERTY(great_power_rank, 0);
2424
Timespan PROPERTY(lose_great_power_grace_days);
2525
fixed_point_t PROPERTY(infamy_containment_limit);
2626
fixed_point_t PROPERTY(max_bureaucracy_percentage);
@@ -33,9 +33,9 @@ namespace OpenVic {
3333
Timespan PROPERTY(campaign_event_min_duration); // NOT USED
3434
Timespan PROPERTY(campaign_event_state_duration_modifier); // NOT USED
3535
Timespan PROPERTY(campaign_duration);
36-
size_t PROPERTY(secondary_power_rank);
36+
size_t PROPERTY(secondary_power_rank, 0);
3737
fixed_point_t PROPERTY(colony_to_state_prestige_gain);
38-
ProvinceInstance::life_rating_t PROPERTY(colonial_liferating);
38+
ProvinceInstance::life_rating_t PROPERTY(colonial_liferating, 0);
3939
fixed_point_t PROPERTY(base_greatpower_daily_influence);
4040
fixed_point_t PROPERTY(ai_support_reform);
4141
fixed_point_t PROPERTY(base_monthly_diplopoints);
@@ -64,7 +64,7 @@ namespace OpenVic {
6464
fixed_point_t PROPERTY(tech_factor_vassal);
6565
fixed_point_t PROPERTY(max_suppression);
6666
fixed_point_t PROPERTY(prestige_hit_on_break_country);
67-
size_t PROPERTY(min_mobilize_limit);
67+
size_t PROPERTY(min_mobilize_limit, 0);
6868
Timespan PROPERTY(pop_growth_country_cache_days);
6969
Timespan PROPERTY(newspaper_printing_frequency);
7070
Timespan PROPERTY(newspaper_timeout_period);

src/openvic-simulation/defines/Define.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using namespace OpenVic;
66
using namespace OpenVic::NodeTools;
77

8-
DefineManager::DefineManager() : start_date {}, end_date {} {}
8+
DefineManager::DefineManager() {}
99

1010
bool DefineManager::load_defines_file(ast::NodeCPtr root) {
1111
bool ret = expect_dictionary_keys(

0 commit comments

Comments
 (0)