summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/branch.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2010-10-04 12:58:11 +0200
committerAdam Borowski <kilobyte@angband.pl>2010-10-04 13:02:46 +0200
commit155ff773191782c6c88c3a638bdacf328172e46c (patch)
treec6353a32f21e070ff49ed962133041b194952baf /crawl-ref/source/branch.cc
parent185dc20a7ed60ad6ac3b28b8e1ab108fe9bf2676 (diff)
downloadcrawl-ref-155ff773191782c6c88c3a638bdacf328172e46c.tar.gz
crawl-ref-155ff773191782c6c88c3a638bdacf328172e46c.zip
Get rid of some more insidious longs.
Especially constructs like: long foo = x.props[].get_int() can get you by surprise on 32 bit arches -- even worse now that most devs are on amd64. Item flags I typedeffed as iflags_t, as it's likely we'll have to extend it soon, yet defining it as uint64_t now would be misleading since there are so many places it's used in a 32 bit manner.
Diffstat (limited to 'crawl-ref/source/branch.cc')
-rw-r--r--crawl-ref/source/branch.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/crawl-ref/source/branch.cc b/crawl-ref/source/branch.cc
index a2ae8cbfcf..c4e4ecf826 100644
--- a/crawl-ref/source/branch.cc
+++ b/crawl-ref/source/branch.cc
@@ -140,8 +140,7 @@ level_area_type str_to_level_area_type(const std::string &s)
return (LEVEL_DUNGEON);
}
-bool set_branch_flags(unsigned long flags, bool silent,
- branch_type branch)
+bool set_branch_flags(uint32_t flags, bool silent, branch_type branch)
{
if (branch == NUM_BRANCHES)
branch = you.where_are_you;
@@ -149,7 +148,7 @@ bool set_branch_flags(unsigned long flags, bool silent,
bool could_control = allow_control_teleport(true);
bool could_map = player_in_mappable_area();
- unsigned long old_flags = branches[branch].branch_flags;
+ uint32_t old_flags = branches[branch].branch_flags;
branches[branch].branch_flags |= flags;
bool can_control = allow_control_teleport(true);
@@ -172,8 +171,7 @@ bool set_branch_flags(unsigned long flags, bool silent,
return (old_flags != branches[branch].branch_flags);
}
-bool unset_branch_flags(unsigned long flags, bool silent,
- branch_type branch)
+bool unset_branch_flags(uint32_t flags, bool silent, branch_type branch)
{
if (branch == NUM_BRANCHES)
branch = you.where_are_you;
@@ -181,7 +179,7 @@ bool unset_branch_flags(unsigned long flags, bool silent,
const bool could_control = allow_control_teleport(true);
const bool could_map = player_in_mappable_area();
- unsigned long old_flags = branches[branch].branch_flags;
+ uint32_t old_flags = branches[branch].branch_flags;
branches[branch].branch_flags &= ~flags;
const bool can_control = allow_control_teleport(true);
@@ -206,7 +204,7 @@ bool unset_branch_flags(unsigned long flags, bool silent,
return (old_flags != branches[branch].branch_flags);
}
-unsigned long get_branch_flags(branch_type branch)
+uint32_t get_branch_flags(branch_type branch)
{
if (branch == NUM_BRANCHES)
{