From 51e7da6751673ce879d2bade6455956071b35586 Mon Sep 17 00:00:00 2001 From: OV2 Date: Sat, 23 Feb 2019 15:00:57 +0100 Subject: [PATCH] Get rid of some more warnings --- libretro/libretro.cpp | 12 ++++++------ shaders/glsl.cpp | 20 ++++++++++---------- spc7110dec.cpp | 2 +- spc7110dec.h | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/libretro/libretro.cpp b/libretro/libretro.cpp index eb13615e..2b2f1369 100644 --- a/libretro/libretro.cpp +++ b/libretro/libretro.cpp @@ -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 { @@ -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) diff --git a/shaders/glsl.cpp b/shaders/glsl.cpp index b7906afd..315a487b 100644 --- a/shaders/glsl.cpp +++ b/shaders/glsl.cpp @@ -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; @@ -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); diff --git a/spc7110dec.cpp b/spc7110dec.cpp index ab7521b3..5d8cde36 100644 --- a/spc7110dec.cpp +++ b/spc7110dec.cpp @@ -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 diff --git a/spc7110dec.h b/spc7110dec.h index 3a9c7ce3..85f1d9cc 100644 --- a/spc7110dec.h +++ b/spc7110dec.h @@ -56,7 +56,7 @@ public: 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];