summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/menu.cc
diff options
context:
space:
mode:
authorBrendan Hickey <brendan@bhickey.net>2013-04-28 23:26:25 -0700
committerBrendan Hickey <brendan@bhickey.net>2013-04-28 23:54:23 -0700
commit23222fdd521c999d61b2cbdee7fe4d87a234cf8c (patch)
treeb23dd3877fd266625ceb389873a9bd94d7379951 /crawl-ref/source/menu.cc
parent926959ac5bd809f4014e5ad2f47bbe778e5760e8 (diff)
downloadcrawl-ref-23222fdd521c999d61b2cbdee7fe4d87a234cf8c.tar.gz
crawl-ref-23222fdd521c999d61b2cbdee7fe4d87a234cf8c.zip
Refactor ASSERT(a && b) -> ASSERT(a); ASSERT(b);
Convert conjunctive assertions into separate assertions. This ought to be correctness preserving. I ran the stress tests and didn't notice anything unusual. While I have confidence in it, if you are the slightest bit suspicious of this, please roll it back. Found instances with `ASSERT(\([^(|]*\) && \([^)|]*\))` Manually inspected each instance.
Diffstat (limited to 'crawl-ref/source/menu.cc')
-rw-r--r--crawl-ref/source/menu.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc
index 0e22a0d3f4..eddb7012d8 100644
--- a/crawl-ref/source/menu.cc
+++ b/crawl-ref/source/menu.cc
@@ -1118,7 +1118,8 @@ bool PlayerMenuEntry::get_tiles(vector<tile_def>& tileset) const
if (idx == 0 || idx == TILEP_SHOW_EQUIP || flags[p] == TILEP_FLAG_HIDE)
continue;
- ASSERT(idx >= TILE_MAIN_MAX && idx < TILEP_PLAYER_MAX);
+ ASSERT(idx >= TILE_MAIN_MAX);
+ ASSERT(idx < TILEP_PLAYER_MAX);
int ymax = TILE_Y;
@@ -1694,7 +1695,8 @@ void column_composer::add_formatted(int ncol,
bool (*tfilt)(const string &),
int margin)
{
- ASSERT(ncol >= 0 && ncol < (int) columns.size());
+ ASSERT(ncol >= 0);
+ ASSERT(ncol < (int) columns.size());
column &col = columns[ncol];
vector<string> segs = split_string("\n", s, false, true);
@@ -3050,7 +3052,8 @@ void SaveMenuItem::_pack_doll()
if (idx == 0 || idx == TILEP_SHOW_EQUIP || flags[p] == TILEP_FLAG_HIDE)
continue;
- ASSERT(idx >= TILE_MAIN_MAX && idx < TILEP_PLAYER_MAX);
+ ASSERT(idx >= TILE_MAIN_MAX);
+ ASSERT(idx < TILEP_PLAYER_MAX);
int ymax = TILE_Y;