gambatte: fix a few msvcisms and other warnings

This commit is contained in:
goyuken 2014-05-13 02:51:20 +00:00
parent 92f32c568c
commit 2c68aa81c6
6 changed files with 11 additions and 8 deletions

View File

@ -148,19 +148,23 @@ void MemPtrs::disconnectOamDmaAreas() {
SYNCFUNC(MemPtrs)
{
/*
int memchunk_len_old = memchunk_len;
int memchunk_saveoffs_old = memchunk_saveoffs;
int memchunk_savelen_old = memchunk_savelen;
*/
NSS(memchunk_len);
NSS(memchunk_saveoffs);
NSS(memchunk_savelen);
/*
if (isReader)
{
if (memchunk_len != memchunk_len_old || memchunk_saveoffs != memchunk_saveoffs_old || memchunk_savelen != memchunk_savelen_old)
__debugbreak();
}
*/
PSS(memchunk_ + memchunk_saveoffs, memchunk_savelen);

View File

@ -26,10 +26,10 @@
namespace gambatte {
Memory::Memory(const Interrupter &interrupter_in)
: getInput(0),
readCallback(0),
: readCallback(0),
writeCallback(0),
execCallback(0),
getInput(0),
divLastUpdate(0),
lastOamDmaUpdate(DISABLED_TIME),
display(ioamhram, 0, VideoInterruptRequester(&intreq)),

View File

@ -17,14 +17,13 @@ void NewStateDummy::Load(void *ptr, size_t size, const char *name)
}
NewStateExternalBuffer::NewStateExternalBuffer(char *buffer, long maxlength)
:buffer(buffer), maxlength(maxlength), length(0)
:buffer(buffer), length(0), maxlength(maxlength)
{
}
void NewStateExternalBuffer::Save(const void *ptr, size_t size, const char *name)
{
const char *src = static_cast<const char *>(ptr);
if (maxlength - length >= size)
if (maxlength - length >= (long)size)
{
std::memcpy(buffer + length, ptr, size);
}
@ -34,7 +33,7 @@ void NewStateExternalBuffer::Save(const void *ptr, size_t size, const char *name
void NewStateExternalBuffer::Load(void *ptr, size_t size, const char *name)
{
char *dst = static_cast<char *>(ptr);
if (maxlength - length >= size)
if (maxlength - length >= (long)size)
{
std::memcpy(dst, buffer + length, size);
}

View File

@ -81,7 +81,7 @@ public:
#define EES(x,d) else if (isReader) (x) = (d); if (!isReader) ns->Save(&_ttmp, sizeof(_ttmp), #x); } while (0)
#define RSS(x,b) do { if (isReader)\
{ ptrdiff_t _ttmp; ns->Load(&_ttmp, sizeof(_ttmp), #x); (x) = (_ttmp == 0xdeadbeef ? 0 : (b) + _ttmp); }\
{ ptrdiff_t _ttmp; ns->Load(&_ttmp, sizeof(_ttmp), #x); (x) = (_ttmp == (ptrdiff_t)0xdeadbeef ? 0 : (b) + _ttmp); }\
else\
{ ptrdiff_t _ttmp = (x) == 0 ? 0xdeadbeef : (x) - (b); ns->Save(&_ttmp, sizeof(_ttmp), #x); } } while (0)

View File

@ -708,7 +708,7 @@ inline void LCD::event() {
case LY_COUNT:
ppu.doLyCountEvent();
eventTimes_.set<LY_COUNT>(ppu.lyCounter().time());
if (scanlinecallback && ppu.lyCounter().ly() == scanlinecallbacksl)
if (scanlinecallback && ppu.lyCounter().ly() == (unsigned)scanlinecallbacksl)
scanlinecallback();
break;
}

Binary file not shown.