summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/items.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-01 14:47:53 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-01 14:47:53 +0000
commit106fb6de1cf3523c10197dc8e02ec44e94523f18 (patch)
treebe6eba2338470be1467fc89131f20d80878a4906 /crawl-ref/source/items.cc
parent83043ea070b1f45c5cad9c7ad1f1844a01079809 (diff)
downloadcrawl-ref-106fb6de1cf3523c10197dc8e02ec44e94523f18.tar.gz
crawl-ref-106fb6de1cf3523c10197dc8e02ec44e94523f18.zip
Type safety, cast cleanups, etc.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1401 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r--crawl-ref/source/items.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index 2922877e12..1d9075b82c 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -1507,10 +1507,10 @@ int move_item_to_player( int obj, int quant_got, bool quiet )
// multiply both constants * 10
- if ((int) you.burden + imass > carrying_capacity())
+ if (you.burden + imass > carrying_capacity())
{
// calculate quantity we can actually pick up
- int part = (carrying_capacity() - (int)you.burden) / unit_mass;
+ int part = (carrying_capacity() - you.burden) / unit_mass;
if (part < 1)
return (0);
@@ -2010,7 +2010,7 @@ void update_corpses(double elapsedTime)
if (elapsedTime <= 0.0)
return;
- const long rot_time = (long) (elapsedTime / 20.0);
+ const long rot_time = static_cast<long>(elapsedTime / 20.0);
for (int c = 0; c < MAX_ITEMS; c++)
{
@@ -2063,8 +2063,8 @@ void update_corpses(double elapsedTime)
}
}
- int fountain_checks = (int)(elapsedTime / 1000.0);
- if (random2(1000) < (int)(elapsedTime) % 1000)
+ int fountain_checks = static_cast<int>(elapsedTime / 1000.0);
+ if (random2(1000) < static_cast<int>(elapsedTime) % 1000)
fountain_checks += 1;
// dry fountains may start flowing again
@@ -2101,7 +2101,7 @@ void update_corpses(double elapsedTime)
void update_level( double elapsedTime )
{
int m, i;
- int turns = (int) (elapsedTime / 10.0);
+ const int turns = static_cast<int>(elapsedTime / 10.0);
#if DEBUG_DIAGNOSTICS
int mons_total = 0;