summaryrefslogtreecommitdiff
path: root/plugins/jobutils.cpp
diff options
context:
space:
mode:
authorQuietust2012-01-31 10:55:38 -0600
committerQuietust2012-01-31 10:55:38 -0600
commit9afcea3debd7588e897eea21b33b8a86e9adcc4d (patch)
tree3db1c6e2a1613eef4d8ebac243b5353e18db654b /plugins/jobutils.cpp
parenta82f4c913803038d20b4c92e65b53f9fea9555dc (diff)
downloaddfhack-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/jobutils.cpp')
-rw-r--r--plugins/jobutils.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/jobutils.cpp b/plugins/jobutils.cpp
index 47462bbc..34d71168 100644
--- a/plugins/jobutils.cpp
+++ b/plugins/jobutils.cpp
@@ -154,7 +154,7 @@ static command_result job_material_in_job(Core *c, MaterialInfo &new_mat)
return CR_FAILURE;
}
- for (unsigned i = 0; i < job->job_items.size(); i++)
+ for (size_t i = 0; i < job->job_items.size(); i++)
{
df::job_item *item = job->job_items[i];
MaterialInfo item_mat(item);
@@ -178,7 +178,7 @@ static command_result job_material_in_job(Core *c, MaterialInfo &new_mat)
job->mat_type = new_mat.type;
job->mat_index = new_mat.index;
- for (unsigned i = 0; i < job->job_items.size(); i++)
+ for (size_t i = 0; i < job->job_items.size(); i++)
{
df::job_item *item = job->job_items[i];
item->mat_type = new_mat.type;
@@ -224,10 +224,10 @@ static command_result job_material_in_build(Core *c, MaterialInfo &new_mat)
// Loop through matching choices
bool matches = build_choice_matches(req, sel->choices[sel->sel_index], new_mat, true);
- int size = sel->choices.size();
+ size_t size = sel->choices.size();
int base = (matches ? sel->sel_index + 1 : 0);
- for (unsigned i = 0; i < size; i++)
+ for (size_t i = 0; i < size; i++)
{
int idx = (base + i) % size;
@@ -335,7 +335,7 @@ static command_result job_cmd(Core * c, vector <string> & parameters)
return CR_WRONG_USAGE;
df::building *selected = world->selected_building;
- for (unsigned i = 0; i < selected->jobs.size(); i++)
+ for (size_t i = 0; i < selected->jobs.size(); i++)
printJobDetails(c, selected->jobs[i]);
}
}