summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/json.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-06-08 20:29:11 +0200
committerAdam Borowski <kilobyte@angband.pl>2013-06-08 20:29:11 +0200
commitae1dc47dc5b5f48957eb44396ab153acc38ef712 (patch)
treedb3ffa00832ac001005b52002abc1650cd7f426b /crawl-ref/source/json.cc
parent258af752a1d6f6dc337c97e8ceabf26bcb974f31 (diff)
downloadcrawl-ref-ae1dc47dc5b5f48957eb44396ab153acc38ef712.tar.gz
crawl-ref-ae1dc47dc5b5f48957eb44396ab153acc38ef712.zip
ASSERT_RANGEs other than >= <.
Committing separately as I'm not sure whether checking, for example, ASSERT_RANGE(level, 1, 28) is that nice. Perhaps 27 + 1 could be better? Perhaps some other syntax?
Diffstat (limited to 'crawl-ref/source/json.cc')
-rw-r--r--crawl-ref/source/json.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/crawl-ref/source/json.cc b/crawl-ref/source/json.cc
index 510268187a..4eb9327c82 100644
--- a/crawl-ref/source/json.cc
+++ b/crawl-ref/source/json.cc
@@ -345,8 +345,7 @@ static void to_surrogate_pair(uchar_t unicode, uint16_t *uc, uint16_t *lc)
{
uchar_t n;
- ASSERT(unicode >= 0x10000);
- ASSERT(unicode <= 0x10FFFF);
+ ASSERT_RANGE(unicode, 0x10000, 0x10FFFF + 1);
n = unicode - 0x10000;
*uc = ((n >> 10) & 0x3FF) | 0xD800;