All: Fix several warnings

This commit is contained in:
Vicki Pfau 2023-06-01 00:12:32 -07:00
parent 294470d940
commit e7bbc60e79
5 changed files with 6 additions and 6 deletions

View File

@ -292,7 +292,7 @@ struct GBMemory {
int currentSramBank1; int currentSramBank1;
uint8_t* sramBank1; uint8_t* sramBank1;
unsigned cartBusDecay; int cartBusDecay;
uint16_t cartBusPc; uint16_t cartBusPc;
uint8_t cartBus; uint8_t cartBus;

View File

@ -219,7 +219,7 @@ static enum GBMemoryBankControllerType _detectUnlMBC(const uint8_t* mem, size_t
if (cart->type == 0x01) { // Make sure we're not using a "fixed" version if (cart->type == 0x01) { // Make sure we're not using a "fixed" version
return GB_UNL_LI_CHENG; return GB_UNL_LI_CHENG;
} }
if ((0x8000 << cart->romSize) != size) { if ((0x8000U << cart->romSize) != size) {
return GB_UNL_LI_CHENG; return GB_UNL_LI_CHENG;
} }
break; break;

View File

@ -1499,7 +1499,7 @@ bool EReaderScanCard(struct EReaderScan* scan) {
size_t i; size_t i;
for (i = 0; i < blocks; ++i) { for (i = 0; i < blocks; ++i) {
EReaderScanDetectBlockThreshold(scan, i); EReaderScanDetectBlockThreshold(scan, i);
int errors = 36 * 36; unsigned errors = 36 * 36;
while (!EReaderScanScanBlock(scan, i, true)) { while (!EReaderScanScanBlock(scan, i, true)) {
if (errors < EReaderBlockListGetPointer(&scan->blocks, i)->errors) { if (errors < EReaderBlockListGetPointer(&scan->blocks, i)->errors) {
return false; return false;

View File

@ -1790,7 +1790,7 @@ void Window::setupMenu(QMenuBar* menubar) {
void Window::setupOptions() { void Window::setupOptions() {
ConfigOption* videoSync = m_config->addOption("videoSync"); ConfigOption* videoSync = m_config->addOption("videoSync");
videoSync->connect([this](const QVariant& variant) { videoSync->connect([this](const QVariant&) {
reloadConfig(); reloadConfig();
}, this); }, this);

View File

@ -84,7 +84,7 @@ M_TEST_DEFINE(resizeMem) {
} }
M_TEST_DEFINE(resizeConstMem) { M_TEST_DEFINE(resizeConstMem) {
uint8_t bytes[32]; uint8_t bytes[32] = {0};
struct VFile* vf = VFileFromConstMemory(bytes, 32); struct VFile* vf = VFileFromConstMemory(bytes, 32);
assert_non_null(vf); assert_non_null(vf);
assert_int_equal(vf->size(vf), 32); assert_int_equal(vf->size(vf), 32);
@ -96,7 +96,7 @@ M_TEST_DEFINE(resizeConstMem) {
} }
M_TEST_DEFINE(resizeMemChunk) { M_TEST_DEFINE(resizeMemChunk) {
uint8_t bytes[32]; uint8_t bytes[32] = {0};
struct VFile* vf = VFileMemChunk(bytes, 32); struct VFile* vf = VFileMemChunk(bytes, 32);
assert_non_null(vf); assert_non_null(vf);
assert_int_equal(vf->size(vf), 32); assert_int_equal(vf->size(vf), 32);