Skip to content

Commit

Permalink
Get rid of some more warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
OV2 committed Feb 23, 2019
1 parent 80956bd commit 51e7da6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions libretro/libretro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,11 +654,11 @@ float get_aspect_ratio(unsigned width, unsigned height)
}

// OV2: not sure if these really make sense - NTSC is similar to 4:3, PAL looks weird
float sample_frequency_ntsc = 135000000.0f / 11.0f;
float sample_frequency_pal = 14750000.0;
double sample_frequency_ntsc = 135000000.0f / 11.0f;
double sample_frequency_pal = 14750000.0;

float sample_freq = retro_get_region() == RETRO_REGION_NTSC ? sample_frequency_ntsc : sample_frequency_pal;
float dot_rate = SNES::cpu.frequency / 4.0;
double sample_freq = retro_get_region() == RETRO_REGION_NTSC ? sample_frequency_ntsc : sample_frequency_pal;
double dot_rate = SNES::cpu.frequency / 4.0;

if (aspect_ratio_mode == ASPECT_RATIO_NTSC) // ntsc
{
Expand All @@ -671,8 +671,8 @@ float get_aspect_ratio(unsigned width, unsigned height)
dot_rate = PAL_MASTER_CLOCK / 4.0;
}

float par = sample_freq / 2.0 / dot_rate;
return (float)width * par / (float)height;
double par = sample_freq / 2.0 / dot_rate;
return (float)(width * par / height);
}

void retro_get_system_av_info(struct retro_system_av_info *info)
Expand Down
20 changes: 10 additions & 10 deletions shaders/glsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,37 +713,37 @@ void GLSLShader::render(GLuint &orig,
switch (pass[i].scale_type_x)
{
case GLSL_ABSOLUTE:
pass[i].width = pass[i].scale_x;
pass[i].width = (GLuint)pass[i].scale_x;
break;
case GLSL_SOURCE:
pass[i].width = pass[i-1].width * pass[i].scale_x;
pass[i].width = (GLuint)(pass[i-1].width * pass[i].scale_x);
break;
case GLSL_VIEWPORT:
pass[i].width = viewport_width * pass[i].scale_x;
pass[i].width = (GLuint)(viewport_width * pass[i].scale_x);
break;
default:
if (lastpass)
pass[i].width = viewport_width;
else
pass[i].width = pass[i - 1].width * pass[i].scale_x;
pass[i].width = (GLuint)(pass[i - 1].width * pass[i].scale_x);
}

switch (pass[i].scale_type_y)
{
case GLSL_ABSOLUTE:
pass[i].height = pass[i].scale_y;
pass[i].height = (GLuint)pass[i].scale_y;
break;
case GLSL_SOURCE:
pass[i].height = pass[i - 1].height * pass[i].scale_y;
pass[i].height = (GLuint)(pass[i - 1].height * pass[i].scale_y);
break;
case GLSL_VIEWPORT:
pass[i].height = viewport_height * pass[i].scale_y;
pass[i].height = (GLuint)(viewport_height * pass[i].scale_y);
break;
default:
if (lastpass)
pass[i].height = viewport_height;
else
pass[i].height = pass[i - 1].height * pass[i].scale_y;
pass[i].height = (GLuint)(pass[i - 1].height * pass[i].scale_y);
}

bool direct_lastpass = true;
Expand Down Expand Up @@ -1073,8 +1073,8 @@ void GLSLShader::set_shader_vars(unsigned int p, bool inverted)
unsigned int shaderFrameCnt = frame_count;
if (pass[p].frame_count_mod)
shaderFrameCnt %= pass[p].frame_count_mod;
setUniform1i(u->FrameCount, (float)shaderFrameCnt);
setUniform1i(u->FrameDirection, Settings.Rewinding ? -1.0f : 1.0f);
setUniform1i(u->FrameCount, shaderFrameCnt);
setUniform1i(u->FrameDirection, Settings.Rewinding ? -1 : 1);

setTexCoords(u->TexCoord);
setTexCoords(u->LUTTexCoord);
Expand Down
2 changes: 1 addition & 1 deletion spc7110dec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ const uint8 SPC7110Decomp::mode2_context_table[32][2] = {
uint8 SPC7110Decomp::probability (unsigned n) { return evolution_table[context[n].index][0]; }
uint8 SPC7110Decomp::next_lps (unsigned n) { return evolution_table[context[n].index][1]; }
uint8 SPC7110Decomp::next_mps (unsigned n) { return evolution_table[context[n].index][2]; }
bool SPC7110Decomp::toggle_invert(unsigned n) { return evolution_table[context[n].index][3]; }
uint8 SPC7110Decomp::toggle_invert(unsigned n) { return evolution_table[context[n].index][3]; }

unsigned SPC7110Decomp::morton_2x8(unsigned data) {
//reverse morton lookup: de-interleave two 8-bit values
Expand Down
2 changes: 1 addition & 1 deletion spc7110dec.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class SPC7110Decomp {
uint8 probability(unsigned n);
uint8 next_lps(unsigned n);
uint8 next_mps(unsigned n);
bool toggle_invert(unsigned n);
uint8 toggle_invert(unsigned n);

unsigned morton16[2][256];
unsigned morton32[4][256];
Expand Down

2 comments on commit 51e7da6

@OV2
Copy link
Collaborator Author

@OV2 OV2 commented on 51e7da6 Feb 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bearoso if you don't like all the casts in glsl.cpp I could also just pragma disable the warnings.

@bearoso
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Casts are fine.

Please sign in to comment.