summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-util.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-06-08 20:22:21 +0200
committerAdam Borowski <kilobyte@angband.pl>2013-06-08 20:22:21 +0200
commit258af752a1d6f6dc337c97e8ceabf26bcb974f31 (patch)
treedd0a724b9c936b2fc8c497a6d8089d5afcf7c68d /crawl-ref/source/spl-util.cc
parenta2c649a2645682eb974353707775e599f1f2ce96 (diff)
downloadcrawl-ref-258af752a1d6f6dc337c97e8ceabf26bcb974f31.tar.gz
crawl-ref-258af752a1d6f6dc337c97e8ceabf26bcb974f31.zip
Turn pairs of assertions with x > min, x <= max into ASSERT_RANGE.
The perl regexp to do so is: s&ASSERT\(([^\n]+) >= ([^\n]+)\);\s*ASSERT\(\1 < ([^\n]+)\);&ASSERT_RANGE($1, $2, $3);&sg;
Diffstat (limited to 'crawl-ref/source/spl-util.cc')
-rw-r--r--crawl-ref/source/spl-util.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc
index 6d6adc8b95..57b3e89113 100644
--- a/crawl-ref/source/spl-util.cc
+++ b/crawl-ref/source/spl-util.cc
@@ -318,8 +318,7 @@ bool add_spell_to_memory(spell_type spell)
bool del_spell_from_memory_by_slot(int slot)
{
- ASSERT(slot >= 0);
- ASSERT(slot < MAX_KNOWN_SPELLS);
+ ASSERT_RANGE(slot, 0, MAX_KNOWN_SPELLS);
int j;
if (you.last_cast_spell == you.spells[slot])
@@ -894,8 +893,7 @@ skill_type spell_type2skill(unsigned int spelltype)
//jmf: Simplified; moved init code to top function, init_spell_descs().
static const spell_desc *_seekspell(spell_type spell)
{
- ASSERT(spell >= 0);
- ASSERT(spell < NUM_SPELLS);
+ ASSERT_RANGE(spell, 0, NUM_SPELLS);
const int index = spell_list[spell];
ASSERT(index != -1);