More int comparison sign mismatch compiler warning fixes.

This commit is contained in:
harry 2023-01-28 14:05:21 -05:00
parent 4434974350
commit c075cdca4f
6 changed files with 7 additions and 8 deletions

View File

@ -2286,7 +2286,7 @@ void COOLGIRL_Init(CartInfo *info) {
}
CFI = (uint8*)FCEU_gmalloc(sizeof(cfi_data) * 2);
for (int i = 0; i < sizeof(cfi_data); i++)
for (size_t i = 0; i < sizeof(cfi_data); i++)
{
CFI[i * 2] = CFI[i * 2 + 1] = cfi_data[i];
}

View File

@ -307,8 +307,7 @@ cartdata MMC5CartList[] =
#define MMC5_NOCARTS (sizeof(MMC5CartList) / sizeof(MMC5CartList[0]))
int DetectMMC5WRAMSize(uint32 crc32) {
int x;
for (x = 0; x < MMC5_NOCARTS; x++) {
for (size_t x = 0; x < MMC5_NOCARTS; x++) {
if (crc32 == MMC5CartList[x].crc32) {
if(MMC5CartList[x].size > 1)
FCEU_printf(" >8KB external WRAM present. Use UNIF if you hack the ROM image.\n");

View File

@ -604,7 +604,7 @@ void GamePadConfDialog_t::loadMapList(void)
mapSel->addItem(tr("default"), 0);
n = 1;
for (size_t i = 0; i < fileList.size(); i++)
for (ssize_t i = 0; i < fileList.size(); i++)
{
size_t suffixIdx;
std::string fileName = fileList[i].toStdString();

View File

@ -888,9 +888,9 @@ int fceuWrapperInit( int argc, char *argv[] )
extern std::vector<std::string> subtitleMessages;
float fps = (md.palFlag == 0 ? 60.0988 : 50.0069); // NTSC vs PAL
float subduration = 3; // seconds for the subtitles to be displayed
for (int i = 0; i < subtitleFrames.size(); i++)
for (size_t i = 0; i < subtitleFrames.size(); i++)
{
fprintf(srtfile, "%i\n", i+1); // starts with 1, not 0
fprintf(srtfile, "%zi\n", i+1); // starts with 1, not 0
double seconds, ms, endseconds, endms;
seconds = subtitleFrames[i]/fps;
if (i+1 < subtitleFrames.size()) // there's another subtitle coming after this one

View File

@ -223,7 +223,7 @@ InitSound()
i = 0;
while (supportedSampleRates[i] != 0)
{
if (soundrate == supportedSampleRates[i])
if ( static_cast<unsigned int>(soundrate) == supportedSampleRates[i])
{
sampleRateIsSupported = true;
break;

View File

@ -641,7 +641,7 @@ Config::_load()
int
Config::_loadFile(const char* fname)
{
signed int pos, eqPos;
size_t pos=0, eqPos=0;
std::fstream config;
std::map<std::string, int>::iterator int_i;
std::map<std::string, double>::iterator dbl_i;