From 58cacc3b1ca3655e82d5cefe70a45ca711c0c23a Mon Sep 17 00:00:00 2001 From: "gregory.hainaut" Date: Sat, 29 Jun 2013 12:02:03 +0000 Subject: [PATCH] gsdx: use size_t for loop index when it used countof macro * fix override_GL_ARB_copy_image typo git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5687 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GLLoader.cpp | 2 +- plugins/GSdx/GPUState.cpp | 2 +- plugins/GSdx/GS.cpp | 2 +- plugins/GSdx/GSCrc.cpp | 2 +- plugins/GSdx/GSDevice.cpp | 4 ++-- plugins/GSdx/GSDevice11.cpp | 8 ++++---- plugins/GSdx/GSDevice9.cpp | 10 ++++----- plugins/GSdx/GSDeviceOGL.cpp | 6 +++--- plugins/GSdx/GSLocalMemory.cpp | 36 ++++++++++++++++----------------- plugins/GSdx/GSPerfMon.cpp | 2 +- plugins/GSdx/GSRendererCS.cpp | 4 ++-- plugins/GSdx/GSRendererSW.cpp | 6 +++--- plugins/GSdx/GSTextureCache.cpp | 6 +++--- plugins/GSdx/GSVertexList.h | 2 +- 14 files changed, 46 insertions(+), 46 deletions(-) diff --git a/plugins/GSdx/GLLoader.cpp b/plugins/GSdx/GLLoader.cpp index 2894a2c638..2f83173199 100644 --- a/plugins/GSdx/GLLoader.cpp +++ b/plugins/GSdx/GLLoader.cpp @@ -193,7 +193,7 @@ namespace GLLoader { found_GL_ARB_separate_shader_objects = !!theApp.GetConfig("override_GL_ARB_separate_shader_objects", -1); fprintf(stderr, "Override GL_ARB_separate_shader_objects detection\n"); } - if (theApp.GetConfig("ovveride_GL_ARB_copy_image", -1) != -1) { + if (theApp.GetConfig("override_GL_ARB_copy_image", -1) != -1) { // Same extension so override both found_GL_ARB_copy_image = !!theApp.GetConfig("override_GL_ARB_copy_image", -1); found_GL_NV_copy_image = !!theApp.GetConfig("override_GL_ARB_copy_image", -1); diff --git a/plugins/GSdx/GPUState.cpp b/plugins/GSdx/GPUState.cpp index 93c7e32b15..90feb5adf8 100644 --- a/plugins/GSdx/GPUState.cpp +++ b/plugins/GSdx/GPUState.cpp @@ -27,7 +27,7 @@ GPUState::GPUState() { memset(m_status, 0, sizeof(m_status)); - for(uint32 i = 0; i < countof(m_fpGPUStatusCommandHandlers); i++) + for(size_t i = 0; i < countof(m_fpGPUStatusCommandHandlers); i++) { m_fpGPUStatusCommandHandlers[i] = &GPUState::SCH_Null; } diff --git a/plugins/GSdx/GS.cpp b/plugins/GSdx/GS.cpp index deef8427e5..14e4476bc8 100644 --- a/plugins/GSdx/GS.cpp +++ b/plugins/GSdx/GS.cpp @@ -1219,7 +1219,7 @@ EXPORT_C GSBenchmark(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow fprintf(file, "%d x %d\n\n", w, h); - for(int i = 0; i < countof(s_format); i++) + for(size_t i = 0; i < countof(s_format); i++) { const GSLocalMemory::psm_t& psm = GSLocalMemory::m_psm[s_format[i].psm]; diff --git a/plugins/GSdx/GSCrc.cpp b/plugins/GSdx/GSCrc.cpp index 51560e55fb..f589f6ba8f 100644 --- a/plugins/GSdx/GSCrc.cpp +++ b/plugins/GSdx/GSCrc.cpp @@ -531,7 +531,7 @@ CRC::Game CRC::Lookup(uint32 crc) printf( "GSdx: CrcHacksExclusions: %s\n", exclusions.c_str() ); int crcDups = 0; - for(uint32 i = 0; i < countof(m_games); i++) + for(size_t i = 0; i < countof(m_games); i++) { if( !IsCrcExcluded( exclusions, m_games[i].crc ) ){ if(m_map[m_games[i].crc]){ diff --git a/plugins/GSdx/GSDevice.cpp b/plugins/GSdx/GSDevice.cpp index 93c77e3e06..748ca7e996 100644 --- a/plugins/GSdx/GSDevice.cpp +++ b/plugins/GSdx/GSDevice.cpp @@ -226,7 +226,7 @@ void GSDevice::Merge(GSTexture* st[2], GSVector4* sr, GSVector4* dr, const GSVec { GSTexture* tex[2] = {NULL, NULL}; - for(uint32 i = 0; i < countof(tex); i++) + for(size_t i = 0; i < countof(tex); i++) { if(st[i] != NULL) { @@ -236,7 +236,7 @@ void GSDevice::Merge(GSTexture* st[2], GSVector4* sr, GSVector4* dr, const GSVec DoMerge(tex, sr, m_merge, dr, slbg, mmod, c); - for(uint32 i = 0; i < countof(tex); i++) + for(size_t i = 0; i < countof(tex); i++) { if(tex[i] != st[i]) { diff --git a/plugins/GSdx/GSDevice11.cpp b/plugins/GSdx/GSDevice11.cpp index 988d167ad3..a501226c4c 100644 --- a/plugins/GSdx/GSDevice11.cpp +++ b/plugins/GSdx/GSDevice11.cpp @@ -170,7 +170,7 @@ bool GSDevice11::Create(GSWnd* wnd) CompileShader(IDR_CONVERT_FX, "vs_main", NULL, &m_convert.vs, il_convert, countof(il_convert), &m_convert.il); - for(int i = 0; i < countof(m_convert.ps); i++) + for(size_t i = 0; i < countof(m_convert.ps); i++) { CompileShader(IDR_CONVERT_FX, format("ps_main%d", i).c_str(), NULL, &m_convert.ps[i]); } @@ -198,7 +198,7 @@ bool GSDevice11::Create(GSWnd* wnd) hr = m_dev->CreateBuffer(&bd, NULL, &m_merge.cb); - for(int i = 0; i < countof(m_merge.ps); i++) + for(size_t i = 0; i < countof(m_merge.ps); i++) { CompileShader(IDR_MERGE_FX, format("ps_main%d", i).c_str(), NULL, &m_merge.ps[i]); } @@ -226,7 +226,7 @@ bool GSDevice11::Create(GSWnd* wnd) hr = m_dev->CreateBuffer(&bd, NULL, &m_interlace.cb); - for(int i = 0; i < countof(m_interlace.ps); i++) + for(size_t i = 0; i < countof(m_interlace.ps); i++) { CompileShader(IDR_INTERLACE_FX, format("ps_main%d", i).c_str(), NULL, &m_interlace.ps[i]); } @@ -1003,7 +1003,7 @@ void GSDevice11::PSSetShaderResources(GSTexture* sr0, GSTexture* sr1) PSSetShaderResource(0, sr0); PSSetShaderResource(1, sr1); - for(int i = 2; i < countof(m_state.ps_srv); i++) + for(size_t i = 2; i < countof(m_state.ps_srv); i++) { PSSetShaderResource(i, NULL); } diff --git a/plugins/GSdx/GSDevice9.cpp b/plugins/GSdx/GSDevice9.cpp index 24e6af94f6..6d50548010 100644 --- a/plugins/GSdx/GSDevice9.cpp +++ b/plugins/GSdx/GSDevice9.cpp @@ -136,7 +136,7 @@ static D3DFORMAT BestD3dFormat(IDirect3D9* d3d, UINT adapter, D3DDEVTYPE devtype if(1 == msaaCount) msaaCount = 0; - for(int i = 0; i < countof(fmts); i++) + for(size_t i = 0; i < countof(fmts); i++) { if(TestDepthFormat(d3d, adapter, devtype, fmts[i]) && (!msaaCount || IsMsaaSupported(d3d, adapter, devtype, fmts[i], msaaCount, msaa_desc))) { @@ -288,7 +288,7 @@ bool GSDevice9::Create(GSWnd* wnd) CompileShader(IDR_CONVERT_FX, "vs_main", NULL, &m_convert.vs, il_convert, countof(il_convert), &m_convert.il); - for(int i = 0; i < countof(m_convert.ps); i++) + for(size_t i = 0; i < countof(m_convert.ps); i++) { CompileShader(IDR_CONVERT_FX, format("ps_main%d", i), NULL, &m_convert.ps[i]); } @@ -315,7 +315,7 @@ bool GSDevice9::Create(GSWnd* wnd) // merge - for(int i = 0; i < countof(m_merge.ps); i++) + for(size_t i = 0; i < countof(m_merge.ps); i++) { CompileShader(IDR_MERGE_FX, format("ps_main%d", i), NULL, &m_merge.ps[i]); } @@ -331,7 +331,7 @@ bool GSDevice9::Create(GSWnd* wnd) // interlace - for(int i = 0; i < countof(m_interlace.ps); i++) + for(size_t i = 0; i < countof(m_interlace.ps); i++) { CompileShader(IDR_INTERLACE_FX, format("ps_main%d", i), NULL, &m_interlace.ps[i]); } @@ -863,7 +863,7 @@ void GSDevice9::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dt, c {GSVector4(right, bottom, 0.5f, 1.0f), GSVector2(sr.z, sr.w)}, }; - for(int i = 0; i < countof(vertices); i++) + for(size_t i = 0; i < countof(vertices); i++) { vertices[i].p.x -= 1.0f / ds.x; vertices[i].p.y += 1.0f / ds.y; diff --git a/plugins/GSdx/GSDeviceOGL.cpp b/plugins/GSdx/GSDeviceOGL.cpp index 538b1dbec0..b3a567c52f 100644 --- a/plugins/GSdx/GSDeviceOGL.cpp +++ b/plugins/GSdx/GSDeviceOGL.cpp @@ -225,7 +225,7 @@ bool GSDeviceOGL::Create(GSWnd* wnd) // convert // **************************************************************** CompileShaderFromSource("convert.glsl", "vs_main", GL_VERTEX_SHADER, &m_convert.vs, convert_glsl); - for(uint32 i = 0; i < countof(m_convert.ps); i++) + for(size_t i = 0; i < countof(m_convert.ps); i++) CompileShaderFromSource("convert.glsl", format("ps_main%d", i), GL_FRAGMENT_SHADER, &m_convert.ps[i], convert_glsl); // Note the following object are initialized to 0 so disabled. @@ -258,7 +258,7 @@ bool GSDeviceOGL::Create(GSWnd* wnd) // **************************************************************** m_merge_obj.cb = new GSUniformBufferOGL(g_merge_cb_index, sizeof(MergeConstantBuffer)); - for(uint32 i = 0; i < countof(m_merge_obj.ps); i++) + for(size_t i = 0; i < countof(m_merge_obj.ps); i++) CompileShaderFromSource("merge.glsl", format("ps_main%d", i), GL_FRAGMENT_SHADER, &m_merge_obj.ps[i], merge_glsl); m_merge_obj.bs = new GSBlendStateOGL(); @@ -270,7 +270,7 @@ bool GSDeviceOGL::Create(GSWnd* wnd) // **************************************************************** m_interlace.cb = new GSUniformBufferOGL(g_interlace_cb_index, sizeof(InterlaceConstantBuffer)); - for(uint32 i = 0; i < countof(m_interlace.ps); i++) + for(size_t i = 0; i < countof(m_interlace.ps); i++) CompileShaderFromSource("interlace.glsl", format("ps_main%d", i), GL_FRAGMENT_SHADER, &m_interlace.ps[i], interlace_glsl); // **************************************************************** // Shade boost diff --git a/plugins/GSdx/GSLocalMemory.cpp b/plugins/GSdx/GSLocalMemory.cpp index d835a6a62b..407ef2716f 100644 --- a/plugins/GSdx/GSLocalMemory.cpp +++ b/plugins/GSdx/GSLocalMemory.cpp @@ -116,89 +116,89 @@ GSLocalMemory::GSLocalMemory() } } - for(uint32 x = 0; x < countof(rowOffset32); x++) + for(size_t x = 0; x < countof(rowOffset32); x++) { rowOffset32[x] = (int)PixelAddress32(x & 0x7ff, 0, 0, 32) - (int)PixelAddress32(0, 0, 0, 32); } - for(uint32 x = 0; x < countof(rowOffset32Z); x++) + for(size_t x = 0; x < countof(rowOffset32Z); x++) { rowOffset32Z[x] = (int)PixelAddress32Z(x & 0x7ff, 0, 0, 32) - (int)PixelAddress32Z(0, 0, 0, 32); } - for(uint32 x = 0; x < countof(rowOffset16); x++) + for(size_t x = 0; x < countof(rowOffset16); x++) { rowOffset16[x] = (int)PixelAddress16(x & 0x7ff, 0, 0, 32) - (int)PixelAddress16(0, 0, 0, 32); } - for(uint32 x = 0; x < countof(rowOffset16S); x++) + for(size_t x = 0; x < countof(rowOffset16S); x++) { rowOffset16S[x] = (int)PixelAddress16S(x & 0x7ff, 0, 0, 32) - (int)PixelAddress16S(0, 0, 0, 32); } - for(uint32 x = 0; x < countof(rowOffset16Z); x++) + for(size_t x = 0; x < countof(rowOffset16Z); x++) { rowOffset16Z[x] = (int)PixelAddress16Z(x & 0x7ff, 0, 0, 32) - (int)PixelAddress16Z(0, 0, 0, 32); } - for(uint32 x = 0; x < countof(rowOffset16SZ); x++) + for(size_t x = 0; x < countof(rowOffset16SZ); x++) { rowOffset16SZ[x] = (int)PixelAddress16SZ(x & 0x7ff, 0, 0, 32) - (int)PixelAddress16SZ(0, 0, 0, 32); } - for(uint32 x = 0; x < countof(rowOffset8[0]); x++) + for(size_t x = 0; x < countof(rowOffset8[0]); x++) { rowOffset8[0][x] = (int)PixelAddress8(x & 0x7ff, 0, 0, 32) - (int)PixelAddress8(0, 0, 0, 32); rowOffset8[1][x] = (int)PixelAddress8(x & 0x7ff, 2, 0, 32) - (int)PixelAddress8(0, 2, 0, 32); } - for(uint32 x = 0; x < countof(rowOffset4[0]); x++) + for(size_t x = 0; x < countof(rowOffset4[0]); x++) { rowOffset4[0][x] = (int)PixelAddress4(x & 0x7ff, 0, 0, 32) - (int)PixelAddress4(0, 0, 0, 32); rowOffset4[1][x] = (int)PixelAddress4(x & 0x7ff, 2, 0, 32) - (int)PixelAddress4(0, 2, 0, 32); } - for(uint32 x = 0; x < countof(blockOffset32); x++) + for(size_t x = 0; x < countof(blockOffset32); x++) { blockOffset32[x] = (short)((int)BlockNumber32(x << 3, 0, 0, 32) - (int)BlockNumber32(0, 0, 0, 32)); } - for(uint32 x = 0; x < countof(blockOffset32Z); x++) + for(size_t x = 0; x < countof(blockOffset32Z); x++) { blockOffset32Z[x] = (short)((int)BlockNumber32Z(x << 3, 0, 0, 32) - (int)BlockNumber32Z(0, 0, 0, 32)); } - for(uint32 x = 0; x < countof(blockOffset16); x++) + for(size_t x = 0; x < countof(blockOffset16); x++) { blockOffset16[x] = (short)((int)BlockNumber16(x << 3, 0, 0, 32) - (int)BlockNumber16(0, 0, 0, 32)); } - for(uint32 x = 0; x < countof(blockOffset16S); x++) + for(size_t x = 0; x < countof(blockOffset16S); x++) { blockOffset16S[x] = (short)((int)BlockNumber16S(x << 3, 0, 0, 32) - (int)BlockNumber16S(0, 0, 0, 32)); } - for(uint32 x = 0; x < countof(blockOffset16Z); x++) + for(size_t x = 0; x < countof(blockOffset16Z); x++) { blockOffset16Z[x] = (short)((int)BlockNumber16Z(x << 3, 0, 0, 32) - (int)BlockNumber16Z(0, 0, 0, 32)); } - for(uint32 x = 0; x < countof(blockOffset16SZ); x++) + for(size_t x = 0; x < countof(blockOffset16SZ); x++) { blockOffset16SZ[x] = (short)((int)BlockNumber16SZ(x << 3, 0, 0, 32) - (int)BlockNumber16SZ(0, 0, 0, 32)); } - for(uint32 x = 0; x < countof(blockOffset8); x++) + for(size_t x = 0; x < countof(blockOffset8); x++) { blockOffset8[x] = (short)((int)BlockNumber8(x << 3, 0, 0, 32) - (int)BlockNumber8(0, 0, 0, 32)); } - for(uint32 x = 0; x < countof(blockOffset4); x++) + for(size_t x = 0; x < countof(blockOffset4); x++) { blockOffset4[x] = (short)((int)BlockNumber4(x << 3, 0, 0, 32) - (int)BlockNumber4(0, 0, 0, 32)); } - for(uint32 i = 0; i < countof(m_psm); i++) + for(size_t i = 0; i < countof(m_psm); i++) { m_psm[i].pa = &GSLocalMemory::PixelAddress32; m_psm[i].bn = &GSLocalMemory::BlockNumber32; @@ -408,7 +408,7 @@ GSLocalMemory::GSLocalMemory() m_psm[PSM_PSMT8].pal = m_psm[PSM_PSMT8H].pal = 256; m_psm[PSM_PSMT4].pal = m_psm[PSM_PSMT4HL].pal = m_psm[PSM_PSMT4HH].pal = 16; - for(uint32 i = 0; i < countof(m_psm); i++) m_psm[i].fmt = 3; + for(size_t i = 0; i < countof(m_psm); i++) m_psm[i].fmt = 3; m_psm[PSM_PSMCT32].fmt = m_psm[PSM_PSMZ32].fmt = 0; m_psm[PSM_PSMCT24].fmt = m_psm[PSM_PSMZ24].fmt = 1; m_psm[PSM_PSMCT16].fmt = m_psm[PSM_PSMZ16].fmt = 2; diff --git a/plugins/GSdx/GSPerfMon.cpp b/plugins/GSdx/GSPerfMon.cpp index 7cf130bce3..80019c7b2d 100644 --- a/plugins/GSdx/GSPerfMon.cpp +++ b/plugins/GSdx/GSPerfMon.cpp @@ -58,7 +58,7 @@ void GSPerfMon::Update() { if(m_count > 0) { - for(uint32 i = 0; i < countof(m_counters); i++) + for(size_t i = 0; i < countof(m_counters); i++) { m_stats[i] = m_counters[i] / m_count; } diff --git a/plugins/GSdx/GSRendererCS.cpp b/plugins/GSdx/GSRendererCS.cpp index 88df839e65..2e1bd92d16 100644 --- a/plugins/GSdx/GSRendererCS.cpp +++ b/plugins/GSdx/GSRendererCS.cpp @@ -38,7 +38,7 @@ GSRendererCS::GSRendererCS() GSRendererCS::~GSRendererCS() { - for(int i = 0; i < countof(m_texture); i++) + for(size_t i = 0; i < countof(m_texture); i++) { delete m_texture[i]; } @@ -322,7 +322,7 @@ bool GSRendererCS::CreateDevice(GSDevice* dev_unk) void GSRendererCS::ResetDevice() { - for(int i = 0; i < countof(m_texture); i++) + for(size_t i = 0; i < countof(m_texture); i++) { delete m_texture[i]; diff --git a/plugins/GSdx/GSRendererSW.cpp b/plugins/GSdx/GSRendererSW.cpp index f5bc169de9..deb4db37f5 100644 --- a/plugins/GSdx/GSRendererSW.cpp +++ b/plugins/GSdx/GSRendererSW.cpp @@ -64,7 +64,7 @@ GSRendererSW::~GSRendererSW() { delete m_tc; - for(uint32 i = 0; i < countof(m_texture); i++) + for(size_t i = 0; i < countof(m_texture); i++) { delete m_texture[i]; } @@ -196,7 +196,7 @@ void GSRendererSW::VSync(int field) /* int draw[8], sum = 0; - for(int i = 0; i < countof(draw); i++) + for(size_t i = 0; i < countof(draw); i++) { draw[i] = m_perfmon.CPU(GSPerfMon::WorkerDraw0 + i); sum += draw[i]; @@ -219,7 +219,7 @@ void GSRendererSW::VSync(int field) void GSRendererSW::ResetDevice() { - for(uint32 i = 0; i < countof(m_texture); i++) + for(size_t i = 0; i < countof(m_texture); i++) { delete m_texture[i]; diff --git a/plugins/GSdx/GSTextureCache.cpp b/plugins/GSdx/GSTextureCache.cpp index 8cc52a1d2c..ac6f505655 100644 --- a/plugins/GSdx/GSTextureCache.cpp +++ b/plugins/GSdx/GSTextureCache.cpp @@ -1177,7 +1177,7 @@ void GSTextureCache::SourceMap::Add(Source* s, const GIFRegTEX0& TEX0, const GSO } } - for(uint32 i = 0; i < countof(m_pages); i++) + for(size_t i = 0; i < countof(m_pages); i++) { if(uint32 p = m_pages[i]) { @@ -1203,7 +1203,7 @@ void GSTextureCache::SourceMap::RemoveAll() m_surfaces.clear(); - for(uint32 i = 0; i < countof(m_map); i++) + for(size_t i = 0; i < countof(m_map); i++) { m_map[i].clear(); } @@ -1213,7 +1213,7 @@ void GSTextureCache::SourceMap::RemoveAt(Source* s) { m_surfaces.erase(s); - for(uint32 start = s->m_TEX0.TBP0 >> 5, end = s->m_target ? start : countof(m_map) - 1; start <= end; start++) + for(size_t start = s->m_TEX0.TBP0 >> 5, end = s->m_target ? start : countof(m_map) - 1; start <= end; start++) { list& m = m_map[start]; diff --git a/plugins/GSdx/GSVertexList.h b/plugins/GSdx/GSVertexList.h index 33261f4bc3..bd0b016d4c 100644 --- a/plugins/GSdx/GSVertexList.h +++ b/plugins/GSdx/GSVertexList.h @@ -33,7 +33,7 @@ public: { m_base = _aligned_malloc(sizeof(Vertex) * countof(m_v), 32); - for(unsigned int i = 0; i < countof(m_v); i++) + for(size_t i = 0; i < countof(m_v); i++) { m_v[i] = &((Vertex*)m_base)[i]; }