summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglx22 <glx22@users.noreply.github.com>2019-10-26 01:34:19 +0200
committerGitHub <noreply@github.com>2019-10-26 01:34:19 +0200
commit880680304dfe8443e1d7d98f1fe46733e88e4301 (patch)
tree1747444a9e28b173e1fe482c673d9dbd125a52a6
parentf52e605b51a1a033f2877492b87050308fd20502 (diff)
downloadopenttd-880680304dfe8443e1d7d98f1fe46733e88e4301.tar.xz
Fix 53f8d0b81: signed/unsigned warnings (#7803)
-rw-r--r--src/industry_cmd.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp
index 4171d72db..4f11d1deb 100644
--- a/src/industry_cmd.cpp
+++ b/src/industry_cmd.cpp
@@ -2019,7 +2019,7 @@ CommandCost CmdBuildIndustry(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
/* Start with a random layout */
size_t layout = RandomRange((uint32)num_layouts);
/* Check now each layout, starting with the random one */
- for (int j = 0; j < num_layouts; j++) {
+ for (size_t j = 0; j < num_layouts; j++) {
layout = (layout + 1) % num_layouts;
ret = CreateNewIndustryHelper(tile, it, flags, indspec, layout, random_var8f, random_initial_bits, cur_company.GetOriginalValue(), _current_company == OWNER_DEITY ? IACT_RANDOMCREATION : IACT_PROSPECTCREATION, &ind);
if (ret.Succeeded()) break;
@@ -2030,11 +2030,11 @@ CommandCost CmdBuildIndustry(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
cur_company.Restore();
}
} else {
- int layout = GB(p1, 8, 8);
+ size_t layout = GB(p1, 8, 8);
if (layout >= num_layouts) return CMD_ERROR;
/* Check subsequently each layout, starting with the given layout in p1 */
- for (int i = 0; i < num_layouts; i++) {
+ for (size_t i = 0; i < num_layouts; i++) {
layout = (layout + 1) % num_layouts;
ret = CreateNewIndustryHelper(tile, it, flags, indspec, layout, random_var8f, random_initial_bits, _current_company, _current_company == OWNER_DEITY ? IACT_RANDOMCREATION : IACT_USERCREATION, &ind);
if (ret.Succeeded()) break;