While on the topic of asserts, I recommend using a macro similar to
the ASSERT_OR_RETURN that I wrote for Warzone2100 --
http://warzone2100.svn.sourceforge.net/viewvc/warzone2100/trunk/lib/framework/debug.h?revision=7821&view=markup

The reason for this is that 1) you avoid having to do such double
evaluations, and 2) you quickly get into the (addictive) habit of
writing defensive code that fails softly for non-debug builds.

Also a more descriptive ASSERT() macro with comments (see above link)
helps when debugging.

Feel free to copy & paste this code ;)

  - Per

_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to