Skip to content

Commit

Permalink
Remove the most of compiler warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
gocha committed Aug 21, 2012
1 parent efcfa51 commit 091874e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion apu/apu.cpp
Expand Up @@ -584,7 +584,7 @@ void S9xResetAPU (void)
spc::remainder = 0;

SNES::cpu.reset ();
SNES::cpu.frequency = Settings.PAL ? PAL_MASTER_CLOCK : NTSC_MASTER_CLOCK;
SNES::cpu.frequency = Settings.PAL ? (int)PAL_MASTER_CLOCK : (int)NTSC_MASTER_CLOCK;
SNES::smp.power ();
SNES::dsp.power ();
SNES::dsp.spc_dsp.set_output ((SNES::SPC_DSP::sample_t *) spc::landing_buffer, spc::buffer_size >> 1);
Expand Down
4 changes: 2 additions & 2 deletions apu/hermite_resampler.h
Expand Up @@ -80,8 +80,8 @@ class HermiteResampler : public Resampler

while (r_frac <= 1.0 && o_position < num_samples)
{
hermite_val[0] = hermite (r_frac, r_left [0], r_left [1], r_left [2], r_left [3]);
hermite_val[1] = hermite (r_frac, r_right[0], r_right[1], r_right[2], r_right[3]);
hermite_val[0] = hermite (r_frac, (float)r_left [0], (float)r_left [1], (float)r_left [2], (float)r_left [3]);
hermite_val[1] = hermite (r_frac, (float)r_right[0], (float)r_right[1], (float)r_right[2], (float)r_right[3]);
data[o_position] = SHORT_CLAMP (hermite_val[0]);
data[o_position + 1] = SHORT_CLAMP (hermite_val[1]);

Expand Down
8 changes: 4 additions & 4 deletions win32/CD3DCG.cpp
Expand Up @@ -422,7 +422,7 @@ void CD3DCG::ensureTextureSize(LPDIRECT3DTEXTURE9 &tex, D3DXVECTOR2 &texSize,
tex->Release();

hr = pDevice->CreateTexture(
wantedSize.x, wantedSize.y,
(UINT)wantedSize.x, (UINT)wantedSize.y,
1, // 1 level, no mipmaps
renderTarget?D3DUSAGE_RENDERTARGET:0,
renderTarget?D3DFMT_X8R8G8B8:D3DFMT_R5G6B5,
Expand Down Expand Up @@ -563,7 +563,7 @@ void CD3DCG::Render(LPDIRECT3DTEXTURE9 &origTex, D3DXVECTOR2 textureSize,

/* viewport defines output size
*/
setViewport(0,0,shaderPasses[i].outputSize.x,shaderPasses[i].outputSize.y);
setViewport(0,0,(DWORD)shaderPasses[i].outputSize.x,(DWORD)shaderPasses[i].outputSize.y);

pDevice->BeginScene();
pDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2);
Expand Down Expand Up @@ -598,11 +598,11 @@ void CD3DCG::Render(LPDIRECT3DTEXTURE9 &origTex, D3DXVECTOR2 textureSize,
pDevice->SetTexture(0, shaderPasses.back().tex);
pDevice->SetRenderTarget(0,pBackBuffer);
pBackBuffer->Release();
RECT displayRect=CalculateDisplayRect(shaderPasses.back().outputSize.x,shaderPasses.back().outputSize.y,windowSize.x,windowSize.y);
RECT displayRect=CalculateDisplayRect((unsigned int)shaderPasses.back().outputSize.x,(unsigned int)shaderPasses.back().outputSize.y,(unsigned int)windowSize.x,(unsigned int)windowSize.y);
setViewport(displayRect.left,displayRect.top,displayRect.right - displayRect.left,displayRect.bottom - displayRect.top);
setVertexStream(shaderPasses.back().vertexBuffer,
shaderPasses.back().outputSize,shaderPasses.back().textureSize,
D3DXVECTOR2(displayRect.right - displayRect.left,displayRect.bottom - displayRect.top));
D3DXVECTOR2((FLOAT)(displayRect.right - displayRect.left),(FLOAT)(displayRect.bottom - displayRect.top)));
pDevice->SetVertexShader(NULL);
pDevice->SetPixelShader(NULL);
}
Expand Down
8 changes: 4 additions & 4 deletions win32/CGLCG.cpp
Expand Up @@ -536,7 +536,7 @@ void CGLCG::Render(GLuint &origTex, xySize textureSize, xySize inputSize, xySize

/* viewport determines the area we render into the output texture
*/
glViewport(0,0,shaderPasses[i].outputSize.x,shaderPasses[i].outputSize.y);
glViewport(0,0,(GLsizei)shaderPasses[i].outputSize.x,(GLsizei)shaderPasses[i].outputSize.y);

/* set up framebuffer and attach output texture
*/
Expand Down Expand Up @@ -590,7 +590,7 @@ void CGLCG::Render(GLuint &origTex, xySize textureSize, xySize inputSize, xySize
memcpy(pass.texCoords,shaderPasses[1].texcoords,sizeof(pass.texCoords));
prevPasses.push_front(pass);
glBindTexture(GL_TEXTURE_2D,origTex);
glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,textureSize.x,textureSize.y,0,GL_RGB,GL_UNSIGNED_SHORT_5_6_5,NULL);
glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,(GLsizei)textureSize.x,(GLsizei)textureSize.y,0,GL_RGB,GL_UNSIGNED_SHORT_5_6_5,NULL);

/* bind output of last pass to be rendered on the backbuffer
*/
Expand All @@ -600,8 +600,8 @@ void CGLCG::Render(GLuint &origTex, xySize textureSize, xySize inputSize, xySize
/* calculate and apply viewport and texture coordinates to
that will be used in the main ogl code
*/
RECT displayRect=CalculateDisplayRect(shaderPasses.back().outputSize.x,shaderPasses.back().outputSize.y,windowSize.x,windowSize.y);
glViewport(displayRect.left,windowSize.y-displayRect.bottom,displayRect.right-displayRect.left,displayRect.bottom-displayRect.top);
RECT displayRect=CalculateDisplayRect((unsigned int)shaderPasses.back().outputSize.x,(unsigned int)shaderPasses.back().outputSize.y,(unsigned int)windowSize.x,(unsigned int)windowSize.y);
glViewport(displayRect.left,(GLint)(windowSize.y-displayRect.bottom),displayRect.right-displayRect.left,displayRect.bottom-displayRect.top);
setTexCoords(shaderPasses.size()-1,shaderPasses.back().outputSize,shaderPasses.back().textureSize,true);

/* render to backbuffer without shaders
Expand Down

0 comments on commit 091874e

Please sign in to comment.