diff options
| author | Quietust | 2012-01-31 10:55:38 -0600 |
|---|---|---|
| committer | Quietust | 2012-01-31 10:55:38 -0600 |
| commit | 9afcea3debd7588e897eea21b33b8a86e9adcc4d (patch) | |
| tree | 3db1c6e2a1613eef4d8ebac243b5353e18db654b /plugins/getplants.cpp | |
| parent | a82f4c913803038d20b4c92e65b53f9fea9555dc (diff) | |
| download | dfhack-9afcea3debd7588e897eea21b33b8a86e9adcc4d.tar.gz dfhack-9afcea3debd7588e897eea21b33b8a86e9adcc4d.tar.bz2 dfhack-9afcea3debd7588e897eea21b33b8a86e9adcc4d.tar.xz | |
In all loops that iterate across a vector, use a size_t as the index
Diffstat (limited to 'plugins/getplants.cpp')
| -rw-r--r-- | plugins/getplants.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/getplants.cpp b/plugins/getplants.cpp index 46dee0f4..d925f4b6 100644 --- a/plugins/getplants.cpp +++ b/plugins/getplants.cpp @@ -54,7 +54,7 @@ DFhackCExport command_result df_getplants (Core * c, vector <string> & parameter CoreSuspender suspend(c); - for (int i = 0; i < world->raws.plants.all.size(); i++) + for (size_t i = 0; i < world->raws.plants.all.size(); i++) { df::plant_raw *plant = world->raws.plants.all[i]; if (plantNames.find(plant->id) != plantNames.end()) @@ -75,7 +75,7 @@ DFhackCExport command_result df_getplants (Core * c, vector <string> & parameter if (plantIDs.size() == 0) { c->con.print("Valid plant IDs:\n"); - for (int i = 0; i < world->raws.plants.all.size(); i++) + for (size_t i = 0; i < world->raws.plants.all.size(); i++) { df::plant_raw *plant = world->raws.plants.all[i]; if (plant->flags.is_set(plant_raw_flags::GRASS)) @@ -86,11 +86,11 @@ DFhackCExport command_result df_getplants (Core * c, vector <string> & parameter } count = 0; - for (int i = 0; i < world->map.map_blocks.size(); i++) + for (size_t i = 0; i < world->map.map_blocks.size(); i++) { df::map_block *cur = world->map.map_blocks[i]; bool dirty = false; - for (int j = 0; j < cur->plants.size(); j++) + for (size_t j = 0; j < cur->plants.size(); j++) { const df::plant *plant = cur->plants[i]; int x = plant->pos.x % 16; |
