diff options
author | Eugene Sandulenko | 2004-08-12 21:33:59 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2004-08-12 21:33:59 +0000 |
commit | e31aa607306b7b32891d4dd65efe0c06e1c71793 (patch) | |
tree | 1430eded88cf461b2ec927c2c3aaea49f3d227e1 /common/stack.h | |
parent | bca746e80211d1b28cddcb7a5791d8dd20984f11 (diff) | |
download | scummvm-rg350-e31aa607306b7b32891d4dd65efe0c06e1c71793.tar.gz scummvm-rg350-e31aa607306b7b32891d4dd65efe0c06e1c71793.tar.bz2 scummvm-rg350-e31aa607306b7b32891d4dd65efe0c06e1c71793.zip |
Fix compilation of remove_at() in array.h. It was never tested before.
Make stacks' pop() return top value, not just move stack pointer.
svn-id: r14565
Diffstat (limited to 'common/stack.h')
-rw-r--r-- | common/stack.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/common/stack.h b/common/stack.h index acc8ae6c89..add790d695 100644 --- a/common/stack.h +++ b/common/stack.h @@ -54,9 +54,12 @@ public: else return 0; } - void pop() { + T pop() { + T tmp; assert(_size > 0); + tmp = _stack[_size]; _stack[--_size] = 0; + return tmp; } int size() const { return _size; @@ -94,8 +97,10 @@ public: else return 0; } - void pop() { + T pop() { + T tmp = top(); _stack.remove_at(size() - 1); + return tmp; } int size() const { return _stack.size(); |