diff options
author | Vladimir Menshakov | 2011-06-15 22:02:18 +0400 |
---|---|---|
committer | Vladimir Menshakov | 2011-06-15 22:02:18 +0400 |
commit | 4b3f775efa628db08f93630e20cf50f7fbb32f4d (patch) | |
tree | 067b20438e31194408c5a0338a755c9262c3feac /engines/dreamweb/runtime.h | |
parent | dfe83466b56a6bf382903c37aa520f282052b47f (diff) | |
download | scummvm-rg350-4b3f775efa628db08f93630e20cf50f7fbb32f4d.tar.gz scummvm-rg350-4b3f775efa628db08f93630e20cf50f7fbb32f4d.tar.bz2 scummvm-rg350-4b3f775efa628db08f93630e20cf50f7fbb32f4d.zip |
DREAMWEB: removed asserts, added STACK_CHECK as suggested by Max
Diffstat (limited to 'engines/dreamweb/runtime.h')
-rw-r--r-- | engines/dreamweb/runtime.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/engines/dreamweb/runtime.h b/engines/dreamweb/runtime.h index e9caf37368..1fb232c187 100644 --- a/engines/dreamweb/runtime.h +++ b/engines/dreamweb/runtime.h @@ -505,6 +505,21 @@ inline void SegmentRef::reset(uint16 value) { *this = _context->getSegment(value); } +class StackChecker { + const Context &_context; + const uint _stackDepth; + +public: + StackChecker(const Context &context): _context(context), _stackDepth(context.stack.size()) {} + ~StackChecker() { assert(_context.stack.size() == _stackDepth); } +}; + +#ifndef NDEBUG +# define STACK_CHECK(context) StackChecker checker(context) +#else +# define STACK_CHECK(context) do {} while (0) +#endif + } #endif |