Fix some warnings reported from LGTM

This commit is contained in:
negativeExponent
2020-10-26 06:51:20 +08:00
parent 4e2c5468e4
commit 9f46517792
4 changed files with 9 additions and 7 deletions

View File

@@ -80,7 +80,7 @@ static uint8 unscrambleCHR(uint8 data) {
}
void Mapper269_Init(CartInfo *info) {
uint8 i;
uint32 i;
GenMMC3_Init(info, 512, 0, 8, 0);
cwrap = M269CW;
pwrap = M269PW;

View File

@@ -66,7 +66,7 @@ static void FP_FASTAPASS(3) ZapperFrapper(uint8 * bg, uint8 * spr, uint32 linets
sum = palo[a1].r + palo[a1].g + palo[a1].b;
if (sum >= 100 * 3) {
ZD.zaphit = ((uint64)linets + (xs + 16) * (PAL ? 15 : 16)) / 48 + timestampbase;
ZD.zaphit = ((uint64)linets + (uint64)(xs + 16) * (PAL ? 15 : 16)) / 48 + timestampbase;
goto endo;
}
}

View File

@@ -82,7 +82,7 @@ static void FP_FASTAPASS(3) ZapperFrapper(int w, uint8 * bg, uint8 * spr, uint32
sum = palo[a1].r + palo[a1].g + palo[a1].b;
if (sum >= 100 * 3) {
ZD[w].zaphit = ((uint64)linets + (xs + 16) * (PAL ? 15 : 16)) / 48 + timestampbase;
ZD[w].zaphit = ((uint64)linets + (uint64)(xs + 16) * (PAL ? 15 : 16)) / 48 + timestampbase;
goto endo;
}
}

View File

@@ -1254,7 +1254,7 @@ void FCEUSND_LoadState(int version) {
/* minimal validation */
for (i = 0; i < 5; i++)
{
int BC_max = 15;
uint32 BC_max = 15;
if (FSettings.soundq == 2)
{
@@ -1264,7 +1264,7 @@ void FCEUSND_LoadState(int version) {
{
BC_max = 485;
}
if (ChannelBC[i] < 0 || ChannelBC[i] > BC_max)
if (/* ChannelBC[i] < 0 || */ ChannelBC[i] > BC_max)
{
ChannelBC[i] = 0;
}
@@ -1283,14 +1283,16 @@ void FCEUSND_LoadState(int version) {
RectDutyCount[i] = 7;
}
}
if (sound_timestamp < 0)
/* Comparison is always false because access to array >= 0. */
/* if (sound_timestamp < 0)
{
sound_timestamp = 0;
}
if (soundtsoffs < 0)
{
soundtsoffs = 0;
}
} */
if (soundtsoffs + sound_timestamp >= soundtsinc)
{
soundtsoffs = 0;