diff options
author | pauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-02 05:14:31 +0000 |
---|---|---|
committer | pauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-02 05:14:31 +0000 |
commit | 9ddee55cb06790b2d7ddf07666390614c92bc71d (patch) | |
tree | 93b4528b40167b3aeed13ee210e65b5637a3007a /crawl-ref/source/acr.cc | |
parent | 26302842887cde2a029061396d4f9a4df9e312ce (diff) | |
download | crawl-ref-9ddee55cb06790b2d7ddf07666390614c92bc71d.tar.gz crawl-ref-9ddee55cb06790b2d7ddf07666390614c92bc71d.zip |
Fix [ 1902141 ] Documentation wrong
- changed number comments on a few enums
- added a few COMPILE_CHECKs so they'll get caught
Other:
- Fix COMPILE_CHECK macro so it doesn't cause a warning in gcc.
- Replace ASSERT(...) with COMPILE_CHECK(...) where possible.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3501 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/acr.cc')
-rw-r--r-- | crawl-ref/source/acr.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 4023971c9a..d3c9e1bf70 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -189,6 +189,8 @@ static void startup_tutorial(); static void read_messages(); #endif +static void compile_time_asserts(); + /* It all starts here. Some initialisations are run first, then straight to new_game and then input. @@ -199,6 +201,7 @@ int old_main( int argc, char *argv[] ) int main( int argc, char *argv[] ) #endif { + compile_time_asserts(); // just to quiet "unused static function" warning // Load in the system environment variables get_system_environment(); @@ -4360,3 +4363,20 @@ static void update_replay_state() if (!is_processing_macro()) repeat_again_rec.clear(); } + + +void compile_time_asserts() +{ + // Check that the numbering comments in enum.h haven't been + // disturbed accidentally. + COMPILE_CHECK(SK_UNARMED_COMBAT == 19 , c1); + COMPILE_CHECK(SK_EVOCATIONS == 39 , c2); + COMPILE_CHECK(SP_MERFOLK == 35 , c3); + COMPILE_CHECK(SPELL_BOLT_OF_MAGMA == 18 , c4); + COMPILE_CHECK(SPELL_POISON_ARROW == 94 , c5); + COMPILE_CHECK(SPELL_SUMMON_MUSHROOMS == 221 , c6); + + //jmf: NEW ASSERTS: we ought to do a *lot* of these + COMPILE_CHECK(NUM_SPELLS < SPELL_NO_SPELL , c7); + COMPILE_CHECK(NUM_JOBS < JOB_UNKNOWN , c8); +} |