diff options
author | Strangerke | 2014-05-30 10:52:10 +0200 |
---|---|---|
committer | Strangerke | 2014-05-30 10:52:10 +0200 |
commit | 8a712c840d4c65edf4c1f51273d77c6c38ca80a6 (patch) | |
tree | 7cc0a8c167db1e812ff12d9ddc604253a5047578 /engines | |
parent | bea9e0532ec230c89cf76656ed4be0db3eb4bc13 (diff) | |
download | scummvm-rg350-8a712c840d4c65edf4c1f51273d77c6c38ca80a6.tar.gz scummvm-rg350-8a712c840d4c65edf4c1f51273d77c6c38ca80a6.tar.bz2 scummvm-rg350-8a712c840d4c65edf4c1f51273d77c6c38ca80a6.zip |
CGE2: Fix several signed/unsigned comparisons
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cge2/spare.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/engines/cge2/spare.cpp b/engines/cge2/spare.cpp index 650af7b273..be2fc64d23 100644 --- a/engines/cge2/spare.cpp +++ b/engines/cge2/spare.cpp @@ -38,10 +38,9 @@ void Spare::clear() { } Sprite *Spare::locate(int ref) { - for (int i = 0; i < _container.size(); i++) { - if (_container[i]->_ref == ref) { + for (uint i = 0; i < _container.size(); ++i) { + if (_container[i]->_ref == ref) return _container[i]; - } } return nullptr; } @@ -49,7 +48,7 @@ Sprite *Spare::locate(int ref) { void Spare::takeCave(int cav) { int bakRef = cav << 8; Common::Array<Sprite*> tempCont = _container; - for (int i = 0; i < tempCont.size(); i++) { + for (uint i = 0; i < tempCont.size(); ++i) { Sprite *spr = tempCont[i]; int c = spr->_scene; if ((c == _vm->_now || c == 0) && spr->_ref != bakRef) { @@ -73,7 +72,7 @@ void Spare::dispose(Sprite *spr) { _vm->_vga->_showQ->remove(spr); update(spr->contract()); if (!_vm->isHero(spr)) { - for (int i = 0; i < _container.size(); i++) { + for (uint i = 0; i < _container.size(); ++i) { if (spr == _container[i]) { _container.remove_at(i); delete spr; @@ -89,10 +88,9 @@ void Spare::dispose(int ref) { } void Spare::dispose() { - for (int i = 0; i < _container.size(); i++) { - if (_container[i]->_ref > 255) { + for (uint i = 0; i < _container.size(); ++i) { + if (_container[i]->_ref > 255) dispose(_container[i]); - } } } |