Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compiler warnings #1807

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix compiler warnings
oltolm committed Jan 6, 2025
commit fdcde242070bc186cca36dd1f2047d5c071d0a6f
20 changes: 10 additions & 10 deletions core/cfg/option.cpp
Original file line number Diff line number Diff line change
@@ -179,19 +179,19 @@ std::array<Option<MapleDeviceType>, 4> MapleMainDevices {
Option<MapleDeviceType>("device3", MDT_None, "input"),
Option<MapleDeviceType>("device4", MDT_None, "input"),
};
std::array<std::array<Option<MapleDeviceType>, 2>, 4> MapleExpansionDevices {
Option<MapleDeviceType>("device1.1", MDT_SegaVMU, "input"),
Option<MapleDeviceType>("device1.2", MDT_SegaVMU, "input"),
std::array<std::array<Option<MapleDeviceType>, 2>, 4> MapleExpansionDevices {{
{{Option<MapleDeviceType>("device1.1", MDT_SegaVMU, "input"),
Option<MapleDeviceType>("device1.2", MDT_SegaVMU, "input")}},

Option<MapleDeviceType>("device2.1", MDT_None, "input"),
Option<MapleDeviceType>("device2.2", MDT_None, "input"),
{{Option<MapleDeviceType>("device2.1", MDT_None, "input"),
Option<MapleDeviceType>("device2.2", MDT_None, "input")}},

Option<MapleDeviceType>("device3.1", MDT_None, "input"),
Option<MapleDeviceType>("device3.2", MDT_None, "input"),
{{Option<MapleDeviceType>("device3.1", MDT_None, "input"),
Option<MapleDeviceType>("device3.2", MDT_None, "input")}},

Option<MapleDeviceType>("device4.1", MDT_None, "input"),
Option<MapleDeviceType>("device4.2", MDT_None, "input"),
};
{{Option<MapleDeviceType>("device4.1", MDT_None, "input"),
Option<MapleDeviceType>("device4.2", MDT_None, "input")}},
}};
Option<bool> PerGameVmu("PerGameVmu", false, "config");
#ifdef _WIN32
Option<bool, false> UseRawInput("RawInput", false, "input");
7 changes: 7 additions & 0 deletions core/hw/arm7/arm7.cpp
Original file line number Diff line number Diff line change
@@ -368,7 +368,14 @@ void DYNACALL interpret(u32 opcode)
u32 clockTicks = 0;

#define NO_OPCODE_READ
#ifndef _MSC_VER
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
#include "arm-new.h"
#ifndef _MSC_VER
#pragma GCC diagnostic pop
#endif
#undef NO_OPCODE_READ

reg[CYCL_CNT].I -= clockTicks;
2 changes: 1 addition & 1 deletion core/hw/modem/modem.cpp
Original file line number Diff line number Diff line change
@@ -276,7 +276,7 @@ static int modem_sched_func(int tag, int cycles, int jitter, void *arg)
if (!mem_dumped)
{
mem_dumped = true;
for (int i = 0 ; i < sizeof(modem_regs); i++)
for (size_t i = 0 ; i < sizeof(modem_regs); i++)
LOG("modem_regs %02x == %02x", i, modem_regs.ptr[i]);
}
#endif
2 changes: 1 addition & 1 deletion core/rend/dx11/dx11context.cpp
Original file line number Diff line number Diff line change
@@ -348,7 +348,7 @@ void DX11Context::handleDeviceLost()
}
else
{
Renderer* rend_norend();
Renderer* rend_norend(void);
renderer = rend_norend();
renderer->Init();
}
8 changes: 4 additions & 4 deletions core/rend/dx9/d3d_overlay.cpp
Original file line number Diff line number Diff line change
@@ -25,10 +25,10 @@ void D3DOverlay::drawQuad(const RECT& rect, D3DCOLOR color)
{
device->SetTextureStageState(0, D3DTSS_CONSTANT, color);
Vertex quad[] {
{ (float)(rect.left), (float)(rect.top), 0.5f, 0.f, 0.f },
{ (float)(rect.left), (float)(rect.bottom), 0.5f, 0.f, 1.f },
{ (float)(rect.right), (float)(rect.top), 0.5f, 1.f, 0.f },
{ (float)(rect.right), (float)(rect.bottom), 0.5f, 1.f, 1.f }
{ {(float)(rect.left), (float)(rect.top), 0.5f}, {0.f, 0.f} },
{ {(float)(rect.left), (float)(rect.bottom), 0.5f}, {0.f, 1.f} },
{ {(float)(rect.right), (float)(rect.top), 0.5f}, {1.f, 0.f} },
{ {(float)(rect.right), (float)(rect.bottom), 0.5f}, {1.f, 1.f} }
};
device->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, quad, sizeof(Vertex));
}
2 changes: 1 addition & 1 deletion core/rend/vulkan/drawer.cpp
Original file line number Diff line number Diff line change
@@ -80,7 +80,7 @@ void BaseDrawer::SetBaseScissor(const vk::Extent2D& viewport)
}
else
{
baseScissor = { 0, 0, (u32)viewport.width, (u32)viewport.height };
baseScissor = vk::Rect2D{ {0, 0}, {(u32)viewport.width, (u32)viewport.height} };
}
}

7 changes: 7 additions & 0 deletions core/rend/vulkan/vmallocator.h
Original file line number Diff line number Diff line change
@@ -21,7 +21,14 @@
#pragma once
#include <cinttypes>
#include "vulkan.h"
#ifndef _MSC_VER
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#endif
#include "vk_mem_alloc.h"
#ifndef _MSC_VER
#pragma GCC diagnostic pop
#endif

#if !defined(PRIu64) && defined(_WIN32)
#define PRIu64 "I64u"
9 changes: 9 additions & 0 deletions core/windows/winmain.cpp
Original file line number Diff line number Diff line change
@@ -453,8 +453,17 @@ void os_SetThreadName(const char *name)
}

#ifdef VIDEO_ROUTING
#ifndef _MSC_VER
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-variable"
#endif
#include "SpoutSender.h"
#include "SpoutDX.h"
#ifndef _MSC_VER
#pragma GCC diagnostic pop
#endif

static SpoutSender* spoutSender;
static spoutDX* spoutDXSender;