Core: Linux warning fixes

This commit is contained in:
Connor McLaughlin 2020-01-09 08:46:52 +10:00
parent 06d26084fb
commit c52040434a
14 changed files with 29 additions and 26 deletions

View File

@ -1,7 +1,5 @@
#include "audio_stream.h"
#include "YBaseLib/Assert.h"
#include "YBaseLib/Log.h"
Log_SetChannel(Audio);
AudioStream::AudioStream() = default;

View File

@ -33,8 +33,10 @@ bool Texture::Create(u32 width, u32 height, GLenum format, GLenum type, const vo
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, linear_filter ? GL_LINEAR : GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 1);
if (glGetError() != GL_NO_ERROR)
GLenum error = glGetError();
if (error != GL_NO_ERROR)
{
Log_ErrorPrintf("Failed to create texture: 0x%X", error);
glDeleteTextures(1, &id);
return false;
}

View File

@ -1419,6 +1419,11 @@ static void ResampleXAADPCM(const s16* samples_in, u32 num_samples_in, SPU* spu,
const s16 left = *(samples_in++);
const s16 right = STEREO ? *(samples_in++) : left;
if constexpr (!STEREO)
{
UNREFERENCED_PARAMETER(right);
}
for (u32 sample_dup = 0; sample_dup < (SAMPLE_RATE ? 2 : 1); sample_dup++)
{
left_ringbuf[p] = left;

View File

@ -932,7 +932,7 @@ void CodeGenerator::AddPendingCycles(bool commit)
return;
EmitAddCPUStructField(offsetof(Core, m_pending_ticks), Value::FromConstantU32(m_delayed_cycles_add));
if (commit)
m_delayed_cycles_add = 0;
}
@ -981,7 +981,6 @@ bool CodeGenerator::Compile_Bitwise(const CodeBlockInstruction& cbi)
InstructionPrologue(cbi, 1);
const InstructionOp op = cbi.instruction.op;
const InstructionFunct funct = cbi.instruction.r.funct;
Value lhs;
Value rhs;
Reg dest;

View File

@ -1,8 +1,6 @@
#include "YBaseLib/Log.h"
#include "cpu_core.h"
#include "cpu_recompiler_code_generator.h"
#include "cpu_recompiler_thunks.h"
#include "cpu_core.h"
Log_SetChannel(CPU::Recompiler);
namespace CPU::Recompiler {

View File

@ -1,6 +1,5 @@
#include "digital_controller.h"
#include "YBaseLib/Log.h"
Log_SetChannel(DigitalController);
#include "YBaseLib/Assert.h"
DigitalController::DigitalController() = default;

View File

@ -445,7 +445,7 @@ void GPU::Execute(TickCount ticks)
else
{
m_GPUSTAT.drawing_even_line =
ConvertToBoolUnchecked(m_crtc_state.regs.Y + m_crtc_state.current_scanline & u32(1));
ConvertToBoolUnchecked((m_crtc_state.regs.Y + m_crtc_state.current_scanline) & u32(1));
}
}
@ -754,7 +754,7 @@ void GPU::SetDrawMode(u16 value)
// Bits 0..10 are returned in the GPU status register.
m_GPUSTAT.bits =
m_GPUSTAT.bits & ~(DrawMode::Reg::GPUSTAT_MASK) | (ZeroExtend32(new_mode_reg.bits) & DrawMode::Reg::GPUSTAT_MASK);
(m_GPUSTAT.bits & ~(DrawMode::Reg::GPUSTAT_MASK)) | (ZeroExtend32(new_mode_reg.bits) & DrawMode::Reg::GPUSTAT_MASK);
m_GPUSTAT.texture_disable = m_draw_mode.mode_reg.texture_disable;
}

View File

@ -110,8 +110,11 @@ void GPU_HW::LoadVertices(RenderCommand rc, u32 num_vertices, const u32* command
}
// Cull polygons which are too large.
if ((max_x - min_x) > MAX_PRIMITIVE_WIDTH || (max_y - min_y) > MAX_PRIMITIVE_HEIGHT)
if (static_cast<u32>(max_x - min_x) > MAX_PRIMITIVE_WIDTH ||
static_cast<u32>(max_y - min_y) > MAX_PRIMITIVE_HEIGHT)
{
m_batch_current_vertex_ptr = old_vertex_ptr;
}
}
break;
@ -199,8 +202,11 @@ void GPU_HW::LoadVertices(RenderCommand rc, u32 num_vertices, const u32* command
(m_batch_current_vertex_ptr++)->Set(x, y, color, 0, 0);
}
if ((max_x - min_x) > MAX_PRIMITIVE_WIDTH || (max_y - min_y) > MAX_PRIMITIVE_HEIGHT)
if (static_cast<u32>(max_x - min_x) > MAX_PRIMITIVE_WIDTH ||
static_cast<u32>(max_y - min_y) > MAX_PRIMITIVE_HEIGHT)
{
m_batch_current_vertex_ptr = old_vertex_ptr;
}
}
break;

View File

@ -1,11 +1,8 @@
#include "gpu_sw.h"
#include "YBaseLib/Log.h"
#include "YBaseLib/Timer.h"
#include "common/gl/texture.h"
#include "YBaseLib/Assert.h"
#include "host_display.h"
#include "system.h"
#include <algorithm>
Log_SetChannel(GPU_SW);
GPU_SW::GPU_SW()
{
@ -350,7 +347,7 @@ void GPU_SW::DrawTriangle(const SWVertex* v0, const SWVertex* v1, const SWVertex
s32 max_y = std::max(py0, std::max(py1, py2));
// reject triangles which cover the whole vram area
if ((max_x - min_x) > MAX_PRIMITIVE_WIDTH || (max_y - min_y) > MAX_PRIMITIVE_HEIGHT)
if (static_cast<u32>(max_x - min_x) > MAX_PRIMITIVE_WIDTH || static_cast<u32>(max_y - min_y) > MAX_PRIMITIVE_HEIGHT)
return;
// clip to drawing area
@ -594,6 +591,10 @@ void GPU_SW::ShadePixel(u32 x, u32 y, u8 color_r, u8 color_g, u8 color_b, u8 tex
#undef BLEND_AVERAGE
}
}
else
{
UNREFERENCED_PARAMETER(transparent);
}
const u16 mask_and = m_GPUSTAT.GetMaskAND();
if ((color.bits & mask_and) != mask_and)

View File

@ -1,8 +1,6 @@
#include "gte.h"
#include "YBaseLib/Log.h"
#include <algorithm>
#include <array>
Log_SetChannel(GTE);
// TODO: Optimize, intrinsics?
static inline constexpr u32 CountLeadingZeros(u16 value)

View File

@ -179,7 +179,6 @@ void Pad::WriteRegister(u32 offset, u32 value)
case 0x0A: // JOY_CTRL
{
Log_DebugPrintf("JOY_CTRL <- 0x%04X", value);
const bool old_select = m_JOY_CTRL.SELECT;
m_JOY_CTRL.bits = Truncate16(value);
if (m_JOY_CTRL.RESET)

View File

@ -1,8 +1,6 @@
#include "settings.h"
#include "YBaseLib/Log.h"
#include <array>
#include <string.h>
Log_SetChannel(Settings);
#ifdef _MSC_VER
#define strcasecmp stricmp

View File

@ -91,7 +91,7 @@ public:
return static_cast<int>(ge.region);
case Column_Size:
return ge.total_size;
return static_cast<qulonglong>(ge.total_size);
default:
return {};

View File

@ -1563,7 +1563,7 @@ void SDLHostInterface::DoToggleSoftwareRendering()
m_settings.gpu_renderer = m_display->GetRenderAPI() == HostDisplay::RenderAPI::D3D11 ? GPURenderer::HardwareD3D11 :
GPURenderer::HardwareOpenGL;
#else
m_settings.gpu_renderer = GPURenderer::HardwareD3D11;
m_settings.gpu_renderer = GPURenderer::HardwareOpenGL;
#endif
AddOSDMessage("Switched to hardware GPU renderer.");