aboutsummaryrefslogtreecommitdiff
path: root/engines/saga
diff options
context:
space:
mode:
authorMax Horn2009-03-09 22:26:02 +0000
committerMax Horn2009-03-09 22:26:02 +0000
commit5181546c639b67fa821b849ca18e37f4bf846cb1 (patch)
treebcd7a4e1302f78dc96a81f3cc9e12da04fb6d928 /engines/saga
parent6c932497151f54f31d7b6fbf34a2ee24fd362d63 (diff)
downloadscummvm-rg350-5181546c639b67fa821b849ca18e37f4bf846cb1.tar.gz
scummvm-rg350-5181546c639b67fa821b849ca18e37f4bf846cb1.tar.bz2
scummvm-rg350-5181546c639b67fa821b849ca18e37f4bf846cb1.zip
Rewrote Common::List iterator code to ensure const correctness is preserved.
We tried to implement the list iterators in a clever way, to reduce code duplication. But this is essentially impossible to do properly, sadly -- this is one of the places where the ugly drawbacks of C++ really show. As a consequence, our implementation had a bug which allowed one to convert any const_iterator to an iterator, thus allowing modifying elements of const lists. This rewrite reintroduces code duplication but at least ensures that no const list is written to accidentally. Also fix some places which incorrectly used iterator instead of const_iterator or (in the kyra code) accidentally wrote into a const list. svn-id: r39279
Diffstat (limited to 'engines/saga')
-rw-r--r--engines/saga/render.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/saga/render.cpp b/engines/saga/render.cpp
index f432dbd304..370961a869 100644
--- a/engines/saga/render.cpp
+++ b/engines/saga/render.cpp
@@ -220,7 +220,7 @@ void Render::addDirtyRect(Common::Rect rect) {
if (x2 > x1 && y2 > y1) {
Common::Rect rectClipped(x1, y1, x2, y2);
// Check if the new rectangle is contained within another in the list
- Common::List<Common::Rect>::const_iterator it;
+ Common::List<Common::Rect>::iterator it;
for (it = _dirtyRects.begin(); it != _dirtyRects.end(); ++it) {
if (it->contains(rectClipped))
return;