1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

second part of c++11 update. gcc 4.5 and VS 2010 are no longer supported

- BOOST_FOREACH -> for
- replaced several boost classes with std (e.g. unordered)
- removed gcc-4.5 workarounds
- ran clang c++11 migration tool to detect some cases:
- - pointer initialized with "0" to nullptr
- - replace for with iterators with range-based for
- - use auto in some situations (type name specified twice, avoid long iterators type names)
This commit is contained in:
Ivan Savenko
2013-06-29 13:05:48 +00:00
parent 262f956a16
commit f82122d9be
88 changed files with 2065 additions and 2062 deletions

View File

@@ -46,18 +46,18 @@ void CIntObject::onTimer(int timePassed)
void CIntObject::show(SDL_Surface * to)
{
if(defActions & UPDATE)
for(size_t i = 0; i < children.size(); i++)
if(children[i]->recActions & UPDATE)
children[i]->show(to);
for(auto & elem : children)
if(elem->recActions & UPDATE)
elem->show(to);
}
void CIntObject::showAll(SDL_Surface * to)
{
if(defActions & SHOWALL)
{
for(size_t i = 0; i < children.size(); i++)
if(children[i]->recActions & SHOWALL)
children[i]->showAll(to);
for(auto & elem : children)
if(elem->recActions & SHOWALL)
elem->showAll(to);
}
}
@@ -79,9 +79,9 @@ void CIntObject::activate()
activate(used);
if(defActions & ACTIVATE)
for(size_t i = 0; i < children.size(); i++)
if(children[i]->recActions & ACTIVATE)
children[i]->activate();
for(auto & elem : children)
if(elem->recActions & ACTIVATE)
elem->activate();
}
void CIntObject::activate(ui16 what)
@@ -100,9 +100,9 @@ void CIntObject::deactivate()
assert(!active_m);
if(defActions & DEACTIVATE)
for(size_t i = 0; i < children.size(); i++)
if(children[i]->recActions & DEACTIVATE)
children[i]->deactivate();
for(auto & elem : children)
if(elem->recActions & DEACTIVATE)
elem->deactivate();
}
void CIntObject::deactivate(ui16 what)
@@ -219,8 +219,8 @@ void CIntObject::moveBy( const Point &p, bool propagate /*= true*/ )
pos.x += p.x;
pos.y += p.y;
if(propagate)
for(size_t i = 0; i < children.size(); i++)
children[i]->moveBy(p, propagate);
for(auto & elem : children)
elem->moveBy(p, propagate);
}
void CIntObject::moveTo( const Point &p, bool propagate /*= true*/ )