Fix some warnings

This commit is contained in:
negativeExponent
2020-10-25 08:31:41 +08:00
parent 2a317f27b3
commit 565f60c0f2
7 changed files with 15 additions and 18 deletions

View File

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

View File

@@ -26,7 +26,7 @@
*/
/* 2020-3-6 - update mirroring (negativeExponent)
/* PRG-ROM Bank Select #1/Mirroring Select ($8000-$8FFF, write)
* PRG-ROM Bank Select #1/Mirroring Select ($8000-$8FFF, write)
* A~FEDC BA98 7654 3210
* -------------------
* 1000 .... .... MBBB

View File

@@ -570,7 +570,7 @@ void FCEUI_CheatSearchBegin(void) {
}
static int INLINE CAbs(int x) {
static INLINE int CAbs(int x) {
if (x < 0)
return(0 - x);
return x;

View File

@@ -1123,7 +1123,6 @@ static void set_apu_channels(int chan)
static void check_variables(bool startup)
{
struct retro_variable var = {0};
bool palette_updated = false;
char key[256];
int i, enable_apu;
@@ -1886,9 +1885,8 @@ static void retro_run_blit(uint8_t *gfx)
void retro_run(void)
{
unsigned i;
uint8_t *gfx;
int32_t ssize = 0;
int32_t i, ssize = 0;
bool updated = false;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated)
@@ -1955,7 +1953,7 @@ static int checkGG(char c)
static int GGisvalid(const char *code)
{
size_t len = strlen(code);
int i;
uint32 i;
if (len != 6 && len != 8)
return 0;
@@ -1980,7 +1978,6 @@ void retro_cheat_set(unsigned index, bool enabled, const char *code)
uint8 v;
int c;
int type = 1;
int ret = 0;
if (code == NULL)
return;

View File

@@ -69,22 +69,22 @@ void FCEUI_SetDirOverride(int which, char *n)
char *FCEU_MakeFName(int type, int id1, char *cd1)
{
char tmp[2048] = {0};
char tmp[4096 + 512] = {0}; /* +512 for no reason :D */
char *ret = 0;
switch (type)
{
case FCEUMKF_GGROM:
sprintf(tmp, "%s"PSS "gg.rom", BaseDirectory);
sprintf(tmp, "%s%c%s", BaseDirectory, PS, "gg.rom");
break;
case FCEUMKF_FDSROM:
sprintf(tmp, "%s"PSS "disksys.rom", BaseDirectory);
sprintf(tmp, "%s%c%s", BaseDirectory, PS, "disksys.rom");
break;
case FCEUMKF_PALETTE:
sprintf(tmp, "%s"PSS "nes.pal", BaseDirectory);
sprintf(tmp, "%s%c%s", BaseDirectory, PS, "nes.pal");
break;
case FCEUMKF_FDS:
sprintf(tmp, "%s"PSS "%s.sav", SaveDirectory, FileBase);
sprintf(tmp, "%s%c%s%s", SaveDirectory, PS, FileBase, ".sav");
break;
default:
break;

View File

@@ -28,7 +28,7 @@
#define MAX_TOLERANCE 20
static uint32 targetExpansion[MAX_TOLERANCE+1];
#endif
static int tolerance;
static uint32 tolerance;
typedef struct {
uint32 mzx, mzy, mzb;
@@ -167,7 +167,7 @@ static uint32 InefficientSqrt(uint32 z) {
void FCEU_ZapperSetTolerance(int t)
{
#ifdef ROUNDED_TARGET
uint32_t y;
uint32 y;
tolerance = t <= MAX_TOLERANCE ? t : MAX_TOLERANCE;
for (y = 0; y <= tolerance; y++)
targetExpansion[y] = InefficientSqrt(tolerance*tolerance-y*y);

View File

@@ -85,7 +85,7 @@ static int SubWrite(memstream_t *mem, SFORMAT *sf)
while(sf->v)
{
if(sf->s == ~0) /* Link to another struct. */
if(sf->s == (~(uint32)0)) /* Link to another struct. */
{
uint32 tmp;
@@ -140,7 +140,7 @@ static SFORMAT *CheckS(SFORMAT *sf, uint32 tsize, char *desc)
{
while (sf->v)
{
if (sf->s == ~0)
if (sf->s == (~(uint32)0))
{ /* Link to another SFORMAT structure. */
SFORMAT *tmp;
if ((tmp = CheckS((SFORMAT*)sf->v, tsize, desc)))
@@ -162,7 +162,7 @@ static SFORMAT *CheckS(SFORMAT *sf, uint32 tsize, char *desc)
static int ReadStateChunk(memstream_t *mem, SFORMAT *sf, int size)
{
SFORMAT *tmp;
int temp;
uint64 temp;
temp = memstream_pos(mem);
while(memstream_pos(mem) < (temp + size))