Assorted warning fixes

This commit is contained in:
Henrik Rydgard 2017-03-04 13:56:15 +01:00
parent 7b3f84aae8
commit d64f367e1d
5 changed files with 8 additions and 8 deletions

View file

@ -91,7 +91,7 @@ size_t CachingFileLoader::ReadAt(s64 absolutePos, size_t bytes, void *data, Flag
if (absolutePos >= filesize_) { if (absolutePos >= filesize_) {
bytes = 0; bytes = 0;
} else if (absolutePos + (s64)bytes >= filesize_) { } else if (absolutePos + (s64)bytes >= filesize_) {
bytes = filesize_ - absolutePos; bytes = (size_t)(filesize_ - absolutePos);
} }
size_t readSize = 0; size_t readSize = 0;

View file

@ -155,7 +155,7 @@ size_t RamCachingFileLoader::ReadFromCache(s64 pos, size_t bytes, void *data) {
if (pos >= filesize_) { if (pos >= filesize_) {
return 0; return 0;
} }
bytes = filesize_ - pos; bytes = (size_t)(filesize_ - pos);
} }
std::lock_guard<std::mutex> guard(blocksMutex_); std::lock_guard<std::mutex> guard(blocksMutex_);

View file

@ -652,7 +652,7 @@ std::vector<PSPFileInfo> ISOFileSystem::GetDirListing(std::string path) {
x.isOnSectorSystem = true; x.isOnSectorSystem = true;
x.startSector = e->startingPosition/2048; x.startSector = e->startingPosition/2048;
x.sectorSize = sectorSize; x.sectorSize = sectorSize;
x.numSectors = (e->size + sectorSize - 1) / sectorSize; x.numSectors = (u32)((e->size + sectorSize - 1) / sectorSize);
memset(&x.atime, 0, sizeof(x.atime)); memset(&x.atime, 0, sizeof(x.atime));
memset(&x.mtime, 0, sizeof(x.mtime)); memset(&x.mtime, 0, sizeof(x.mtime));
memset(&x.ctime, 0, sizeof(x.ctime)); memset(&x.ctime, 0, sizeof(x.ctime));

View file

@ -152,7 +152,7 @@ unsigned int StereoResampler::Mix(short* samples, unsigned int numSamples, bool
samples[currentSample + 1] = r1; samples[currentSample + 1] = r1;
indexR += 2; indexR += 2;
} }
sample_rate_ = sample_rate; sample_rate_ = (float)sample_rate;
} else { } else {
// Drift prevention mechanism // Drift prevention mechanism
float numLeft = (float)(((indexW - indexR) & INDEX_MASK) / 2); float numLeft = (float)(((indexW - indexR) & INDEX_MASK) / 2);
@ -161,7 +161,7 @@ unsigned int StereoResampler::Mix(short* samples, unsigned int numSamples, bool
if (offset > MAX_FREQ_SHIFT) offset = MAX_FREQ_SHIFT; if (offset > MAX_FREQ_SHIFT) offset = MAX_FREQ_SHIFT;
if (offset < -MAX_FREQ_SHIFT) offset = -MAX_FREQ_SHIFT; if (offset < -MAX_FREQ_SHIFT) offset = -MAX_FREQ_SHIFT;
sample_rate_ = m_input_sample_rate + offset; sample_rate_ = (float)(m_input_sample_rate + offset);
const u32 ratio = (u32)(65536.0 * sample_rate_ / (double)sample_rate); const u32 ratio = (u32)(65536.0 * sample_rate_ / (double)sample_rate);
// TODO: consider a higher-quality resampling algorithm. // TODO: consider a higher-quality resampling algorithm.
@ -248,7 +248,7 @@ void StereoResampler::GetAudioDebugStats(AudioDebugStats *stats) {
overrunCount_ = 0; overrunCount_ = 0;
stats->watermark = m_lowwatermark; stats->watermark = m_lowwatermark;
stats->bufsize = m_bufsize * 2; stats->bufsize = m_bufsize * 2;
stats->instantSampleRate = sample_rate_; stats->instantSampleRate = (int)sample_rate_;
stats->lastPushSize = lastPushSize_; stats->lastPushSize = lastPushSize_;
} }

View file

@ -156,7 +156,7 @@ namespace MIPSComp
} else { } else {
fpr.MapRegV(vregs[i], MAP_DIRTY | MAP_NOINIT); fpr.MapRegV(vregs[i], MAP_DIRTY | MAP_NOINIT);
fpr.SpillLockV(vregs[i]); fpr.SpillLockV(vregs[i]);
MOVI2F(fpr.V(vregs[i]), constantArray[regnum + (abs<<2)], SCRATCHREG1, (bool)negate); MOVI2F(fpr.V(vregs[i]), constantArray[regnum + (abs<<2)], SCRATCHREG1, negate != 0);
} }
} }
} }
@ -653,7 +653,7 @@ namespace MIPSComp
VectorSize sz = GetVecSize(op); VectorSize sz = GetVecSize(op);
// TODO: Force read one of them into regs? probably not. // TODO: Force read one of them into regs? probably not.
u8 sregs[4], tregs[4], dregs[1]; u8 sregs[4], dregs[1];
GetVectorRegsPrefixS(sregs, sz, vs); GetVectorRegsPrefixS(sregs, sz, vs);
GetVectorRegsPrefixD(dregs, V_Single, vd); GetVectorRegsPrefixD(dregs, V_Single, vd);