summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/store.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/store.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/store.cc')
-rw-r--r--crawl-ref/source/store.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/crawl-ref/source/store.cc b/crawl-ref/source/store.cc
index 89f1198bd7..ea067115c1 100644
--- a/crawl-ref/source/store.cc
+++ b/crawl-ref/source/store.cc
@@ -34,7 +34,8 @@ CrawlStoreValue::CrawlStoreValue()
CrawlStoreValue::CrawlStoreValue(const CrawlStoreValue &other)
{
- ASSERT(other.type >= SV_NONE && other.type < NUM_STORE_VAL_TYPES);
+ ASSERT(other.type >= SV_NONE);
+ ASSERT(other.type < NUM_STORE_VAL_TYPES);
val.ptr = NULL;
@@ -142,7 +143,8 @@ CrawlStoreValue::CrawlStoreValue(const store_flags _flags,
const store_val_type _type)
: type(_type), flags(_flags)
{
- ASSERT(type >= SV_NONE && type < NUM_STORE_VAL_TYPES);
+ ASSERT(type >= SV_NONE);
+ ASSERT(type < NUM_STORE_VAL_TYPES);
ASSERT(!(flags & SFLAG_UNSET));
flags |= SFLAG_UNSET;
@@ -392,7 +394,8 @@ void CrawlStoreValue::unset(bool force)
CrawlStoreValue &CrawlStoreValue::operator = (const CrawlStoreValue &other)
{
- ASSERT(other.type >= SV_NONE && other.type < NUM_STORE_VAL_TYPES);
+ ASSERT(other.type >= SV_NONE);
+ ASSERT(other.type < NUM_STORE_VAL_TYPES);
ASSERT(other.type != SV_NONE || type == SV_NONE);
// NOTE: We don't bother checking SFLAG_CONST_VAL, since the
@@ -1563,7 +1566,8 @@ CrawlVector::CrawlVector(store_val_type _type, store_flags flags,
vec_size _max_size)
: type(_type), default_flags(flags), max_size(_max_size)
{
- ASSERT(type >= SV_NONE && type < NUM_STORE_VAL_TYPES);
+ ASSERT(type >= SV_NONE);
+ ASSERT(type < NUM_STORE_VAL_TYPES);
ASSERT(!(default_flags & SFLAG_UNSET));
ASSERT(max_size > 0);
}