gsdx: use prefix increment operator for non-primitive type

I think compiler is clever enough to optimize the code but it won't hurt
and it reduces the number of cpp check warning.
This commit is contained in:
Gregory Hainaut 2016-08-12 23:11:26 +02:00
parent dc2864ad7a
commit 0a1454ff6c
7 changed files with 19 additions and 19 deletions

View File

@ -32,7 +32,7 @@ GSCodeBuffer::GSCodeBuffer(size_t blocksize)
GSCodeBuffer::~GSCodeBuffer()
{
for(list<void*>::iterator i = m_buffers.begin(); i != m_buffers.end(); i++)
for(list<void*>::iterator i = m_buffers.begin(); i != m_buffers.end(); ++i)
{
vmfree(*i, m_blocksize);
}

View File

@ -132,7 +132,7 @@ GSTexture* GSDevice::FetchSurface(int type, int w, int h, bool msaa, int format)
{
GSVector2i size(w, h);
for(list<GSTexture*>::iterator i = m_pool.begin(); i != m_pool.end(); i++)
for(list<GSTexture*>::iterator i = m_pool.begin(); i != m_pool.end(); ++i)
{
GSTexture* t = *i;

View File

@ -68,7 +68,7 @@ GSVector4i GSDirtyRectList::GetDirtyRectAndClear(const GIFRegTEX0& TEX0, const G
{
GSVector4i r(INT_MAX, INT_MAX, 0, 0);
for(list<GSDirtyRect>::iterator i = begin(); i != end(); i++)
for(list<GSDirtyRect>::iterator i = begin(); i != end(); ++i)
{
r = r.runion(i->GetDirtyRect(TEX0));
}

View File

@ -108,7 +108,7 @@ public:
typename hash_map<KEY, ActivePtr*>::iterator i;
for(i = m_map_active.begin(); i != m_map_active.end(); i++)
for(i = m_map_active.begin(); i != m_map_active.end(); ++i)
{
ActivePtr* p = i->second;
@ -120,7 +120,7 @@ public:
printf("GS stats\n");
for(i = m_map_active.begin(); i != m_map_active.end(); i++)
for(i = m_map_active.begin(); i != m_map_active.end(); ++i)
{
KEY key = i->first;
ActivePtr* p = i->second;

View File

@ -463,7 +463,7 @@ GSLocalMemory::~GSLocalMemory()
for_each(m_pomap.begin(), m_pomap.end(), aligned_free_second());
for_each(m_po4map.begin(), m_po4map.end(), aligned_free_second());
for(hash_map<uint64, vector<GSVector2i>*>::iterator i = m_p2tmap.begin(); i != m_p2tmap.end(); i++)
for(hash_map<uint64, vector<GSVector2i>*>::iterator i = m_p2tmap.begin(); i != m_p2tmap.end(); ++i)
{
delete [] i->second;
}
@ -640,7 +640,7 @@ vector<GSVector2i>* GSLocalMemory::GetPage2TileMap(const GIFRegTEX0& TEX0)
vector<GSVector2i>* p2t = new vector<GSVector2i>[MAX_PAGES];
for(hash_map<uint32, hash_set<uint32> >::iterator i = tmp.begin(); i != tmp.end(); i++)
for(hash_map<uint32, hash_set<uint32> >::iterator i = tmp.begin(); i != tmp.end(); ++i)
{
uint32 page = i->first;
@ -648,7 +648,7 @@ vector<GSVector2i>* GSLocalMemory::GetPage2TileMap(const GIFRegTEX0& TEX0)
hash_map<uint32, uint32> m;
for(hash_set<uint32>::iterator j = tiles.begin(); j != tiles.end(); j++)
for(hash_set<uint32>::iterator j = tiles.begin(); j != tiles.end(); ++j)
{
uint32 addr = *j;
@ -669,7 +669,7 @@ vector<GSVector2i>* GSLocalMemory::GetPage2TileMap(const GIFRegTEX0& TEX0)
// sort by x and flip the mask (it will be used to erase a lot of bits in a loop, [x] &= ~y)
for(hash_map<uint32, uint32>::iterator j = m.begin(); j != m.end(); j++)
for(hash_map<uint32, uint32>::iterator j = m.begin(); j != m.end(); ++j)
{
p2t[page].push_back(GSVector2i(j->first, ~j->second));
}

View File

@ -197,7 +197,7 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con
list<Source*>& m = m_src.m_map[TEX0.TBP0 >> 5];
for(list<Source*>::iterator i = m.begin(); i != m.end(); i++)
for(list<Source*>::iterator i = m.begin(); i != m.end(); ++i)
{
Source* s = *i;
@ -244,7 +244,7 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con
// (Simply not doing this code at all makes a lot of previsouly missing stuff show (but breaks pretty much everything
// else.)
for(list<Target*>::iterator i = m_dst[RenderTarget].begin(); i != m_dst[RenderTarget].end(); i++)
for(list<Target*>::iterator i = m_dst[RenderTarget].begin(); i != m_dst[RenderTarget].end(); ++i)
{
Target* t = *i;
@ -307,7 +307,7 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con
// Unfortunately, I don't have any Arc the Lad testcase
//
// 1/ Check only current frame, I guess it is only used as a postprocessing effect
for(list<Target*>::iterator i = m_dst[DepthStencil].begin(); i != m_dst[DepthStencil].end(); i++) {
for(list<Target*>::iterator i = m_dst[DepthStencil].begin(); i != m_dst[DepthStencil].end(); ++i) {
Target* t = *i;
if(!t->m_age && t->m_used && t->m_dirty.empty() && GSUtil::HasSharedBits(bp, psm, t->m_TEX0.TBP0, t->m_TEX0.PSM))
@ -372,7 +372,7 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
Target* dst = NULL;
for(list<Target*>::iterator i = m_dst[type].begin(); i != m_dst[type].end(); i++)
for(list<Target*>::iterator i = m_dst[type].begin(); i != m_dst[type].end(); ++i)
{
Target* t = *i;
@ -405,7 +405,7 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
// Depth stencil/RT can be an older RT/DS but only check recent RT/DS to avoid to pick
// some bad data.
for(list<Target*>::iterator i = m_dst[rev_type].begin(); i != m_dst[rev_type].end(); i++)
for(list<Target*>::iterator i = m_dst[rev_type].begin(); i != m_dst[rev_type].end(); ++i)
{
Target* t = *i;
@ -614,7 +614,7 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
// must invalidate the Target/Depth respectively
void GSTextureCache::InvalidateVideoMemType(int type, uint32 bp)
{
for(list<Target*>::iterator i = m_dst[type].begin(); i != m_dst[type].end(); i++)
for(list<Target*>::iterator i = m_dst[type].begin(); i != m_dst[type].end(); ++i)
{
Target* t = *i;
@ -720,7 +720,7 @@ void GSTextureCache::InvalidateVideoMem(GSOffset* off, const GSVector4i& rect, b
// Note: very hot path on snowbling engine game
vector<GSVector2i>& l = s->m_p2t[page];
for(vector<GSVector2i>::iterator k = l.begin(); k != l.end(); k++)
for(vector<GSVector2i>::iterator k = l.begin(); k != l.end(); ++k)
{
valid[k->x] &= k->y;
}

View File

@ -40,7 +40,7 @@ GSTextureCacheSW::Texture* GSTextureCacheSW::Lookup(const GIFRegTEX0& TEX0, cons
list<Texture*>& m = m_map[TEX0.TBP0 >> 5];
for(list<Texture*>::iterator i = m.begin(); i != m.end(); i++)
for(list<Texture*>::iterator i = m.begin(); i != m.end(); ++i)
{
Texture* t2 = *i;
@ -91,7 +91,7 @@ void GSTextureCacheSW::InvalidatePages(const uint32* pages, uint32 psm)
const list<Texture*>& map = m_map[page];
for(list<Texture*>::const_iterator i = map.begin(); i != map.end(); i++)
for(list<Texture*>::const_iterator i = map.begin(); i != map.end(); ++i)
{
Texture* t = *i;
@ -103,7 +103,7 @@ void GSTextureCacheSW::InvalidatePages(const uint32* pages, uint32 psm)
{
vector<GSVector2i>& l = t->m_p2t[page];
for(vector<GSVector2i>::iterator j = l.begin(); j != l.end(); j++)
for(vector<GSVector2i>::iterator j = l.begin(); j != l.end(); ++j)
{
valid[j->x] &= j->y;
}