summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/store.cc
diff options
context:
space:
mode:
authorSteven Noonan <steven@uplinklabs.net>2009-10-13 03:05:10 -0700
committerSteven Noonan <steven@uplinklabs.net>2009-10-13 06:23:13 -0700
commit997a4469a2022461f5fe011bd7d0843d6dd6c5de (patch)
tree96e1c6a217e1c15852ab651361e8085d0a27e911 /crawl-ref/source/store.cc
parent3f6c3a3969efce77a980fdf7e3c76183bcad2db3 (diff)
downloadcrawl-ref-997a4469a2022461f5fe011bd7d0843d6dd6c5de.tar.gz
crawl-ref-997a4469a2022461f5fe011bd7d0843d6dd6c5de.zip
fix 'DEBUG' macro usage consistency
Sometimes we were doing #if DEBUG and others we were doing #ifdef DEBUG. If we mix both, we have problems: If the DEBUG macro isn't defined, the statement '#if DEBUG' doesn't really make sense logically, because 'DEBUG' has no value. And if we '#define DEBUG 0', then the '#ifdef DEBUG's become true statements. The easiest fix is to swap out the #ifs with #ifdefs. Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Diffstat (limited to 'crawl-ref/source/store.cc')
-rw-r--r--crawl-ref/source/store.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/crawl-ref/source/store.cc b/crawl-ref/source/store.cc
index 7ace5e40d9..8d74d75cca 100644
--- a/crawl-ref/source/store.cc
+++ b/crawl-ref/source/store.cc
@@ -518,7 +518,7 @@ CrawlHashTable &CrawlStoreValue::new_table(store_flags _flags)
CrawlHashTable &CrawlStoreValue::new_table(store_val_type _type,
store_flags _flags)
{
-#if DEBUG
+#ifdef DEBUG
CrawlHashTable* old_table = static_cast<CrawlHashTable*>(val.ptr);
ASSERT(flags & SFLAG_UNSET);
@@ -553,7 +553,7 @@ CrawlVector &CrawlStoreValue::new_vector(store_val_type _type,
store_flags _flags,
vec_size _max_size)
{
-#if DEBUG
+#ifdef DEBUG
CrawlVector* old_vector = static_cast<CrawlVector*>(val.ptr);
ASSERT(flags & SFLAG_UNSET);
@@ -1139,7 +1139,7 @@ bool CrawlHashTable::exists(const std::string &key) const
void CrawlHashTable::assert_validity() const
{
-#if DEBUG
+#ifdef DEBUG
ASSERT(!(default_flags & SFLAG_UNSET));
hash_map_type::const_iterator i = hash_map.begin();
@@ -1255,7 +1255,7 @@ void CrawlHashTable::erase(const std::string key)
if (i != hash_map.end())
{
-#if DEBUG
+#ifdef DEBUG
CrawlStoreValue &val = i->second;
ASSERT(!(val.flags & SFLAG_NO_ERASE));
#endif
@@ -1422,7 +1422,7 @@ store_val_type CrawlVector::get_type() const
void CrawlVector::assert_validity() const
{
-#if DEBUG
+#ifdef DEBUG
ASSERT(!(default_flags & SFLAG_UNSET));
ASSERT(max_size > 0);
ASSERT(max_size >= size());