Fix some compiler warnings

This commit is contained in:
WaluigiWare64 2021-01-25 14:12:13 +00:00
parent b9a56bc4e4
commit 43348210f9
12 changed files with 26 additions and 19 deletions

View File

@ -122,4 +122,4 @@ add_subdirectory(src)
if (BUILD_QT_SDL)
add_subdirectory(src/frontend/qt_sdl)
endif()
endif()

View File

@ -26,9 +26,9 @@
#include "NDSCart.h"
#include "ARMJIT_x64/ARMJIT_Offsets.h"
static_assert(offsetof(ARM, CPSR) == ARM_CPSR_offset);
static_assert(offsetof(ARM, Cycles) == ARM_Cycles_offset);
static_assert(offsetof(ARM, StopExecution) == ARM_StopExecution_offset);
static_assert(offsetof(ARM, CPSR) == ARM_CPSR_offset, "");
static_assert(offsetof(ARM, Cycles) == ARM_Cycles_offset, "");
static_assert(offsetof(ARM, StopExecution) == ARM_StopExecution_offset, "");
namespace ARMJIT
{

View File

@ -35,7 +35,7 @@ u8* Compiler::RewriteMemAccess(u8* pc)
return pc + (ptrdiff_t)patch.Offset;
}
printf("this is a JIT bug %llx\n", pc);
printf("this is a JIT bug %sx\n", pc);
abort();
}

View File

@ -446,7 +446,7 @@ bool LoadNAND()
fread(&ConsoleID, 1, 8, SDMMCFile);
printf("eMMC CID: "); printhex(eMMC_CID, 16);
printf("Console ID: %016llX\n", ConsoleID);
printf("Console ID: %016lX\n", ConsoleID);
}
memset(ITCMInit, 0, 0x8000);

View File

@ -187,7 +187,7 @@ void DSi_NWifi::Reset()
break;
default:
printf("NWifi: unknown hardware type %02X, assuming AR6002\n");
printf("NWifi: unknown hardware type, assuming AR6002\n");
ROMID = 0x20000188;
ChipID = 0x02000001;
HostIntAddr = 0x00500400;
@ -691,7 +691,7 @@ void DSi_NWifi::WriteBlock()
len = Host->GetTransferrableLen(len);
u8 data[0x200];
if (len = Host->DataTX(data, len))
if ((len = Host->DataTX(data, len)))
{
for (u32 i = 0; i < len; i++)
{

View File

@ -956,7 +956,7 @@ u32 DSi_MMCStorage::WriteBlock(u64 addr)
len = Host->GetTransferrableLen(len);
u8 data[0x200];
if (len = Host->DataTX(data, len))
if ((len = Host->DataTX(data, len)))
{
if (File)
{

View File

@ -1196,7 +1196,7 @@ NonStupidBitField<Size/VRAMDirtyGranularity> VRAMTrackingSet<Size, MappingGranul
// hack for **speed**
// this could probably be done less ugly but then we would rely
// on the compiler for vectorisation
static_assert(VRAMDirtyGranularity == 512);
static_assert(VRAMDirtyGranularity == 512, "");
if (MappingGranularity == 16*1024)
{
u32 dirty = ((u32*)VRAMDirty[num].Data)[i & (VRAMMask[num] >> 14)];
@ -1388,4 +1388,4 @@ bool MakeVRAMFlat_BOBJExtPalCoherent(NonStupidBitField<8*1024/VRAMDirtyGranulari
return CopyLinearVRAM<8*1024>(VRAMFlat_BOBJExtPal, &VRAMMap_BOBJExtPal, dirty, ReadVRAM_BOBJExtPal<u64>);
}
}
}

View File

@ -464,7 +464,7 @@ void GPU2D_Soft::DoCapture(u32 line, u32 width)
dstaddr &= 0xFFFF;
srcBaddr &= 0xFFFF;
static_assert(GPU::VRAMDirtyGranularity == 512);
static_assert(GPU::VRAMDirtyGranularity == 512, "");
GPU::VRAMDirty[dstvram][(dstaddr * 2) / GPU::VRAMDirtyGranularity] = true;
switch ((CaptureCnt >> 29) & 0x3)
@ -661,7 +661,10 @@ void GPU2D_Soft::DrawScanlineBGMode(u32 line)
}
}
if ((DispCnt & 0x1000) && NumSprites)
{
DoInterleaveSprites(0x40000 | (i<<16));
}
}
}
@ -685,7 +688,9 @@ void GPU2D_Soft::DrawScanlineBGMode6(u32 line)
}
}
if ((DispCnt & 0x1000) && NumSprites)
{
DoInterleaveSprites(0x40000 | (i<<16))
}
}
}
@ -713,7 +718,9 @@ void GPU2D_Soft::DrawScanlineBGMode7(u32 line)
}
}
if ((DispCnt & 0x1000) && NumSprites)
{
DoInterleaveSprites(0x40000 | (i<<16))
}
}
}
@ -2037,7 +2044,7 @@ void GPU2D_Soft::DrawSprite_Normal(u32 num, u32 width, u32 height, s32 xpos, s32
if (attrib[1] & 0x1000) // xflip
{
pixelsaddr += (width-1 << 1);
pixelsaddr += ((width-1) << 1);
pixelsaddr -= (xoff << 1);
pixelstride = -2;
}

View File

@ -284,7 +284,7 @@ bool Init()
glGenBuffers(1, &ShaderConfigUBO);
glBindBuffer(GL_UNIFORM_BUFFER, ShaderConfigUBO);
static_assert((sizeof(ShaderConfig) & 15) == 0);
static_assert((sizeof(ShaderConfig) & 15) == 0, "");
glBufferData(GL_UNIFORM_BUFFER, sizeof(ShaderConfig), &ShaderConfig, GL_STATIC_DRAW);
glBindBufferBase(GL_UNIFORM_BUFFER, 0, ShaderConfigUBO);

View File

@ -82,7 +82,7 @@ QVector<QString> ExtractFileFromArchive(const char* path, const char* wantedFile
if (bytesRead < 0)
{
printf(archive_error_string(a));
printf("Error whilst reading archive: %s", archive_error_string(a));
return QVector<QString> {"Err", archive_error_string(a)};
}

View File

@ -276,7 +276,7 @@ void CheatsDialog::onCheatEntryModified(QStandardItem* item)
if (item->text().isEmpty())
{
QString oldname = QString(cat.Name);
item->setText(oldname.isEmpty() ? "(blank category name??)" : oldname);
item->setText(oldname.isEmpty() ? "(blank category name?)" : oldname);
}
else
{
@ -291,7 +291,7 @@ void CheatsDialog::onCheatEntryModified(QStandardItem* item)
if (item->text().isEmpty())
{
QString oldname = QString(code.Name);
item->setText(oldname.isEmpty() ? "(blank code name??)" : oldname);
item->setText(oldname.isEmpty() ? "(blank code name?)" : oldname);
}
else
{

View File

@ -102,11 +102,11 @@ ssize_t SlirpCbSendPacket(const void* buf, size_t len, void* opaque)
{
if (len > 2048)
{
printf("slirp: packet too big (%d)\n", len);
printf("slirp: packet too big (%zu)\n", len);
return 0;
}
printf("slirp: response packet of %d bytes, type %04X\n", len, ntohs(((u16*)buf)[6]));
printf("slirp: response packet of %zu bytes, type %04X\n", len, ntohs(((u16*)buf)[6]));
RXEnqueue(buf, len);