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
This commit is contained in:
gregory.hainaut 2013-06-29 12:02:03 +00:00
parent aec05e8b60
commit 58cacc3b1c
14 changed files with 46 additions and 46 deletions

View File

@ -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);

View File

@ -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;
}

View File

@ -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];

View File

@ -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]){

View File

@ -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])
{

View File

@ -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);
}

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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;
}

View File

@ -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];

View File

@ -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];

View File

@ -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<Source*>& m = m_map[start];

View File

@ -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];
}