diff options
author | nlanza <nlanza@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-15 01:04:56 +0000 |
---|---|---|
committer | nlanza <nlanza@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-15 01:04:56 +0000 |
commit | 691fc9eefb19e33ea74df2719ae5c2dbf0e39620 (patch) | |
tree | d2e3d946ac4c5685483cf97ac391946a84c6f02a /crawl-ref/source/store.cc | |
parent | f89c4cc97945de00160e20de8eab29a5f491674e (diff) | |
download | crawl-ref-691fc9eefb19e33ea74df2719ae5c2dbf0e39620.tar.gz crawl-ref-691fc9eefb19e33ea74df2719ae5c2dbf0e39620.zip |
Squash unused-variable warnings by only declaring variables that exist solely
for ASSERT when we're defining DEBUG.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2462 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/store.cc')
-rw-r--r-- | crawl-ref/source/store.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crawl-ref/source/store.cc b/crawl-ref/source/store.cc index a212a3da19..0ffa96e194 100644 --- a/crawl-ref/source/store.cc +++ b/crawl-ref/source/store.cc @@ -470,6 +470,7 @@ CrawlHashTable &CrawlStoreValue::new_table(store_flags _flags) CrawlHashTable &CrawlStoreValue::new_table(store_val_type _type, store_flags _flags) { +#if DEBUG CrawlHashTable* old_table = static_cast<CrawlHashTable*>(val.ptr); ASSERT(flags & SFLAG_UNSET); @@ -478,6 +479,7 @@ CrawlHashTable &CrawlStoreValue::new_table(store_val_type _type, && old_table->size() == 0 && old_table->get_type() == SV_NONE && old_table->get_default_flags() == 0)); +#endif CrawlHashTable &table = get_table(); @@ -503,6 +505,7 @@ CrawlVector &CrawlStoreValue::new_vector(store_val_type _type, store_flags _flags, vec_size _max_size) { +#if DEBUG CrawlVector* old_vector = static_cast<CrawlVector*>(val.ptr); ASSERT(flags & SFLAG_UNSET); @@ -512,6 +515,7 @@ CrawlVector &CrawlStoreValue::new_vector(store_val_type _type, && old_vector->get_type() == SV_NONE && old_vector->get_default_flags() == 0 && old_vector->get_max_size() == VEC_MAX_SIZE)); +#endif CrawlVector &vector = get_vector(); @@ -1188,9 +1192,10 @@ void CrawlHashTable::erase(const std::string key) if (i != hash_map.end()) { +#if DEBUG CrawlStoreValue &val = i->second; - ASSERT(!(val.flags & SFLAG_NO_ERASE)); +#endif hash_map.erase(i); } |