diff options
author | Lars Persson | 2005-07-09 23:07:46 +0000 |
---|---|---|
committer | Lars Persson | 2005-07-09 23:07:46 +0000 |
commit | b3aac821fd57389eff367ea8f7e55ed5a03a2531 (patch) | |
tree | 60b7d02ffc024100047a65ae0732529ff015451e /saga/list.h | |
parent | 02d28a96ceb5c8c60aea82166b1ad92f83d660d2 (diff) | |
download | scummvm-rg350-b3aac821fd57389eff367ea8f7e55ed5a03a2531.tar.gz scummvm-rg350-b3aac821fd57389eff367ea8f7e55ed5a03a2531.tar.bz2 scummvm-rg350-b3aac821fd57389eff367ea8f7e55ed5a03a2531.zip |
1. Fixed divide by zero defect (exception on my symbian target, Windows just return max val)
2. Fixed so Saga compiles for VC6.
3. Added GCC_PACK & pragma pack to gfx.h
svn-id: r18527
Diffstat (limited to 'saga/list.h')
-rw-r--r-- | saga/list.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/saga/list.h b/saga/list.h index 17106bdfcd..03cc7e5cd4 100644 --- a/saga/list.h +++ b/saga/list.h @@ -33,7 +33,8 @@ public: typedef typename Common::List<T>::iterator iterator; typedef typename Common::List<T>::const_iterator const_iterator; - + typedef typename Common::List<T> Common_List; + public: iterator pushFront(const T& element) { @@ -41,20 +42,20 @@ public: } iterator pushBack(const T& element) { - return insert(Common::List<T>::end(), element); + return insert(Common_List::end(), element); } iterator insert(iterator pos, const T& element) { - Common::List<T>::insert(pos, element); + Common_List::insert(pos, element); return --pos; } iterator pushFront() { - return insert(Common::List<T>::begin()); + return insert(Common_List::begin()); } iterator pushBack() { - return insert(Common::List<T>::end()); + return insert(Common_List::end()); } iterator insert(iterator pos) { @@ -67,13 +68,13 @@ public: } iterator pushBack(const T& element, CompareFunction compareFunction) { - return insert(Common::List<T>::end(), element, compareFunction); + return insert(Common_List::end(), element, compareFunction); } iterator insert(iterator pos, const T& element, CompareFunction compareFunction) { int res; - for (iterator i = Common::List<T>::begin(); i != Common::List<T>::end(); ++i) { + for (iterator i = Common_List::begin(); i != Common_List::end(); ++i) { res = compareFunction(element, i.operator*()); if (res < 0) { return insert(i, element); @@ -120,7 +121,7 @@ public: } iterator eraseAndPrev(iterator pos) { - assert(pos != Common::List<T>::end()); + assert(pos != Common_List::end()); iterator res(pos); --res; @@ -129,7 +130,7 @@ public: } void remove(const T* val) { - for (iterator i = Common::List<T>::begin(); i != Common::List<T>::end(); ++i) + for (iterator i = Common_List::begin(); i != Common_List::end(); ++i) if (val == i.operator->()) { erase(i); return; |