Misc: Fix a slew of less-than-important warnings

This commit is contained in:
Vicki Pfau 2024-04-25 01:03:08 -07:00
parent 87653b7b19
commit aae9c502f0
7 changed files with 22 additions and 16 deletions

View File

@ -282,14 +282,14 @@ bool mCheatParseFile(struct mCheatDevice* device, struct VFile* vf) {
StringListDeinit(&directives);
return false;
}
while (isspace((int) cheat[i])) {
while (isspace((unsigned) cheat[i])) {
++i;
}
switch (cheat[i]) {
case '#':
do {
++i;
} while (isspace((int) cheat[i]));
} while (isspace((unsigned) cheat[i]));
newSet = device->createSet(device, &cheat[i]);
newSet->enabled = !nextDisabled;
nextDisabled = false;
@ -305,7 +305,7 @@ bool mCheatParseFile(struct mCheatDevice* device, struct VFile* vf) {
case '!':
do {
++i;
} while (isspace((int) cheat[i]));
} while (isspace((unsigned) cheat[i]));
if (strcasecmp(&cheat[i], "disabled") == 0) {
nextDisabled = true;
break;
@ -384,7 +384,7 @@ bool mCheatParseLibretroFile(struct mCheatDevice* device, struct VFile* vf) {
return false;
}
++eq;
while (isspace((int) eq[0])) {
while (isspace((unsigned) eq[0])) {
if (eq[0] == '\0') {
return false;
}
@ -393,7 +393,7 @@ bool mCheatParseLibretroFile(struct mCheatDevice* device, struct VFile* vf) {
char* end;
unsigned long nCheats = strtoul(eq, &end, 10);
if (end[0] != '\0' && !isspace(end[0])) {
if (end[0] != '\0' && !isspace((unsigned) end[0])) {
return false;
}
@ -423,7 +423,7 @@ bool mCheatParseLibretroFile(struct mCheatDevice* device, struct VFile* vf) {
return false;
}
++eq;
while (isspace((int) eq[0])) {
while (isspace((unsigned) eq[0])) {
if (eq[0] == '\0') {
return false;
}

View File

@ -217,6 +217,9 @@ void mArgumentsApply(const struct mArguments* args, struct mSubParser* subparser
}
bool mArgumentsApplyDebugger(const struct mArguments* args, struct mCore* core, struct mDebugger* debugger) {
UNUSED(args);
UNUSED(core);
UNUSED(debugger);
bool hasDebugger = false;
#ifdef USE_EDITLINE

View File

@ -602,7 +602,7 @@ void GBAudioRun(struct GBAudio* audio, int32_t timestamp, int channels) {
int32_t last = 0;
int samples = 0;
int positiveSamples = 0;
int lsb;
int lsb = 0;
int coeff;
if (audio->ch4.power) {
// TODO: Can this be batched too?

View File

@ -371,7 +371,7 @@ void GBACartEReaderScan(struct GBACartEReader* ereader, const void* data, size_t
memset(ereader->dots, 0, EREADER_DOTCODE_SIZE);
uint8_t blockRS[44][0x10];
uint8_t block0[0x30];
uint8_t block0[0x30] = {0};
bool parsed = false;
bool bitmap = false;
bool reducedHeader = false;

View File

@ -202,7 +202,7 @@ bool GBASavedataExportSharkPort(const struct GBA* gba, struct VFile* vf) {
char c[0x1C];
int32_t i;
} buffer;
uint32_t size = strlen(SHARKPORT_HEADER);
int32_t size = strlen(SHARKPORT_HEADER);
STORE_32(size, 0, &buffer.i);
if (vf->write(vf, &buffer.i, 4) < 4) {
return false;
@ -271,7 +271,7 @@ bool GBASavedataExportSharkPort(const struct GBA* gba, struct VFile* vf) {
}
uint32_t checksum = 0;
size_t i;
ssize_t i;
for (i = 0; i < 0x1C; ++i) {
checksum += buffer.c[i] << (checksum % 24);
}

View File

@ -904,9 +904,9 @@ uint32_t mColorConvert(uint32_t color, enum mColorFormat from, enum mColorFormat
return color;
}
int r;
int g;
int b;
int r = 0;
int g = 0;
int b = 0;
int a = 0xFF;
switch (from) {

View File

@ -62,7 +62,7 @@ static png_infop _pngWriteHeader(png_structp png, unsigned width, unsigned heigh
}
png_infop PNGWriteHeader(png_structp png, unsigned width, unsigned height, enum mColorFormat fmt) {
int type;
int type = -1;
switch (fmt) {
case mCOLOR_XBGR8:
case mCOLOR_XRGB8:
@ -94,6 +94,9 @@ png_infop PNGWriteHeader(png_structp png, unsigned width, unsigned height, enum
type = PNG_COLOR_TYPE_PALETTE;
break;
}
if (type < 0) {
return NULL;
}
return _pngWriteHeader(png, width, height, NULL, 0, type);
}
@ -373,6 +376,7 @@ bool PNGWritePixels(png_structp png, unsigned width, unsigned height, unsigned s
} else {
depth = 3;
}
stride *= mColorFormatBytes(fmt);
png_bytep row = malloc(sizeof(png_byte) * width * depth);
if (!row) {
return false;
@ -383,7 +387,6 @@ bool PNGWritePixels(png_structp png, unsigned width, unsigned height, unsigned s
return false;
}
const png_byte* pixelRow = pixelData;
stride *= mColorFormatBytes(fmt);
unsigned i;
for (i = 0; i < height; ++i, pixelRow += stride) {
switch (fmt) {