summaryrefslogtreecommitdiff
path: root/src/randart.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:56 +0100
committerBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:56 +0100
commit61e8cfc1d553b2bc0cce6b0dd56b03f51f187423 (patch)
tree4988afbe6ad84804444d0dc3151d300e22d1a80e /src/randart.cc
parentb1f5178bdabafde20eb65df6256b53dc5968b2e2 (diff)
Clean up warnings about signed/unsigned comparisons
Diffstat (limited to 'src/randart.cc')
-rw-r--r--src/randart.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/randart.cc b/src/randart.cc
index 43f7d256..2acba543 100644
--- a/src/randart.cc
+++ b/src/randart.cc
@@ -28,20 +28,19 @@
*/
static bool_ grab_one_power(int *ra_idx, object_type *o_ptr, bool_ good, s16b *max_times)
{
- int i = 0, j;
bool_ ret = FALSE;
u32b f1, f2, f3, f4, f5, esp;
- std::vector<int> ok_ra;
+ std::vector<size_t> ok_ra;
/* Grab the ok randart */
- for (i = 0; i < max_ra_idx; i++)
+ for (size_t i = 0; i < max_ra_idx; i++)
{
randart_part_type *ra_ptr = &ra_info[i];
bool_ ok = FALSE;
/* Must have the correct fields */
- for (j = 0; j < 20; j++)
+ for (size_t j = 0; j < 20; j++)
{
if (ra_ptr->tval[j] == o_ptr->tval)
{
@@ -77,12 +76,10 @@ static bool_ grab_one_power(int *ra_idx, object_type *o_ptr, bool_ good, s16b *m
}
/* Now test them a few times */
- for (i = 0; i < ok_ra.size() * 10; i++)
+ for (size_t count = 0; count < ok_ra.size() * 10; count++)
{
- randart_part_type *ra_ptr;
-
- i = ok_ra[rand_int(ok_ra.size())];
- ra_ptr = &ra_info[i];
+ size_t i = ok_ra[rand_int(ok_ra.size())];
+ randart_part_type *ra_ptr = &ra_info[i];
/* XXX XXX Enforce minimum player level (loosely) */
if (ra_ptr->level > p_ptr->lev)