From ee2259bbcaf9adab827c16f9858b42cfa33935ae Mon Sep 17 00:00:00 2001 From: PatrikLundell Date: Thu, 16 Jan 2020 12:57:09 +0100 Subject: [PATCH] Replaced poor auto with actual type --- plugins/getplants.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/plugins/getplants.cpp b/plugins/getplants.cpp index 7db3b13a7..1b326b8cd 100644 --- a/plugins/getplants.cpp +++ b/plugins/getplants.cpp @@ -84,7 +84,7 @@ selectability selectablePlant(const df::plant_raw *plant) return selectability::Selectable; } - for (auto i = 0; i < plant->growths.size(); i++) + for (size_t i = 0; i < plant->growths.size(); i++) { if (plant->growths[i]->item_type == df::item_type::SEEDS || // Only trees have seed growths in vanilla, but raws can be modded... plant->growths[i]->item_type == df::item_type::PLANT_GROWTH) @@ -146,7 +146,7 @@ command_result df_getplants (color_ostream &out, vector & parameters) { string plantMatStr = ""; std::vector plantSelections; - std::vector collectionCount; + std::vector collectionCount; set plantNames; bool deselect = false, exclude = false, treesonly = false, shrubsonly = false, all = false, verbose = false; @@ -155,7 +155,7 @@ command_result df_getplants (color_ostream &out, vector & parameters) plantSelections.resize(world->raws.plants.all.size()); collectionCount.resize(world->raws.plants.all.size()); - for (auto i = 0; i < plantSelections.size(); i++) + for (size_t i = 0; i < plantSelections.size(); i++) { plantSelections[i] = selectability::Unselected; collectionCount[i] = 0; @@ -248,7 +248,7 @@ command_result df_getplants (color_ostream &out, vector & parameters) return CR_FAILURE; } - for (auto i = 0; i < plantSelections.size(); i++) + for (size_t i = 0; i < plantSelections.size(); i++) { if (plantSelections[i] == selectability::OutOfSeason || plantSelections[i] == selectability::Selectable) @@ -327,7 +327,7 @@ command_result df_getplants (color_ostream &out, vector & parameters) } if (!deselect && Designations::markPlant(plant)) { -// out.print("Designated %s at (%i, %i, %i), %i\n", world->raws.plants.all[plant->material]->id.c_str(), plant->pos.x, plant->pos.y, plant->pos.z, i); +// out.print("Designated %s at (%i, %i, %i), %d\n", world->raws.plants.all[plant->material]->id.c_str(), plant->pos.x, plant->pos.y, plant->pos.z, i); collectionCount[plant->material]++; ++count; } @@ -336,10 +336,10 @@ command_result df_getplants (color_ostream &out, vector & parameters) { if (verbose) { - for (auto i = 0; i < plantSelections.size(); i++) + for (size_t i = 0; i < plantSelections.size(); i++) { if (collectionCount[i] > 0) - out.print("Updated %i %s designations.\n", collectionCount[i], world->raws.plants.all[i]->id.c_str()); + out.print("Updated %d %s designations.\n", collectionCount[i], world->raws.plants.all[i]->id.c_str()); } out.print("\n"); } @@ -357,11 +357,11 @@ DFhackCExport command_result plugin_init ( color_ostream &out, vector