diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-06-08 20:22:21 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-06-08 20:22:21 +0200 |
commit | 258af752a1d6f6dc337c97e8ceabf26bcb974f31 (patch) | |
tree | dd0a724b9c936b2fc8c497a6d8089d5afcf7c68d /crawl-ref/source/message.cc | |
parent | a2c649a2645682eb974353707775e599f1f2ce96 (diff) | |
download | crawl-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/message.cc')
-rw-r--r-- | crawl-ref/source/message.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crawl-ref/source/message.cc b/crawl-ref/source/message.cc index e9e6940f86..1bd95acd13 100644 --- a/crawl-ref/source/message.cc +++ b/crawl-ref/source/message.cc @@ -177,15 +177,13 @@ class circ_vec static void inc(int* index) { - ASSERT(*index >= 0); - ASSERT(*index < SIZE); + ASSERT_RANGE(*index, 0, SIZE); *index = _mod(*index + 1, SIZE); } static void dec(int* index) { - ASSERT(*index >= 0); - ASSERT(*index < SIZE); + ASSERT_RANGE(*index, 0, SIZE); *index = _mod(*index - 1, SIZE); } |