Fixed warnings and function signatures (x86)

This commit is contained in:
Souryo 2016-06-26 16:31:29 -04:00
parent acc2d7eee9
commit 127f9f2ee4
6 changed files with 11 additions and 11 deletions

View file

@ -53,7 +53,7 @@ private:
}
//truncate all strings to 255 characters + null
for(int i = 0; i < strings.size(); i++) {
for(size_t i = 0; i < strings.size(); i++) {
strings[i] = strings[i].substr(0, std::min((int)strings[i].size(), 255));
}

View file

@ -337,7 +337,7 @@ namespace InteropEmu {
NsfMapper::GetInstance()->SelectTrack(trackNumber);
}
}
DllExport int32_t __stdcall NsfGetCurrentTrack(uint8_t trackNumber) {
DllExport int32_t __stdcall NsfGetCurrentTrack() {
if(NsfMapper::GetInstance()) {
return NsfMapper::GetInstance()->GetCurrentTrack();
}

View file

@ -5,7 +5,7 @@
extern "C" {
void __stdcall InitializeEmu(char* homeFolder, void*, void*);
void __stdcall LoadROM(const char* filename);
void __stdcall LoadROM(const char* filename, int32_t archiveFileIndex);
void __stdcall Run();
void __stdcall Stop();
}
@ -33,13 +33,13 @@ int main(int argc, char* argv[])
};
InitializeEmu("C:\\Windows\\Temp\\Mesen", nullptr, nullptr);
LoadROM(testRoms[0]);
LoadROM(testRoms[0], -1);
std::cout << "Running: " << testRoms[0] << std::endl;
thread testThread([testRoms] {
for(size_t i = 1; i < testRoms.size(); i++) {
std::this_thread::sleep_for(std::chrono::duration<int, std::milli>(5000));
std::cout << "Running: " << testRoms[i] << std::endl;
LoadROM(testRoms[i]);
LoadROM(testRoms[i], -1);
}
Stop();
});

View file

@ -8,7 +8,7 @@ WRes MemBuffer_Read(CSzMemBuffer *p, void *data, size_t *size)
if(originalSize == 0)
return 0;
size_t length = p->pos + *size > p->size ? p->size - p->pos - 1 : *size;
size_t length = (size_t)(p->pos + *size > p->size ? p->size - p->pos - 1 : *size);
memcpy(data, (char*)(p->buffer) + p->pos, length);
p->pos += length;
return 0;

View file

@ -9,8 +9,8 @@ EXTERN_C_BEGIN
typedef struct
{
void* buffer;
size_t size;
size_t pos;
Int64 size;
Int64 pos;
} CSzMemBuffer;
/* reads max(*size, remain file's size) bytes */

View file

@ -61,7 +61,7 @@ bool ArchiveReader::LoadArchive(string filename)
ifstream in(filename, std::ios::binary | std::ios::in);
if(in) {
in.seekg(0, std::ios::end);
size_t filesize = in.tellg();
std::streampos filesize = in.tellg();
in.seekg(0, std::ios::beg);
if(_buffer) {
@ -69,9 +69,9 @@ bool ArchiveReader::LoadArchive(string filename)
_buffer = nullptr;
}
_buffer = new uint8_t[filesize];
_buffer = new uint8_t[(uint32_t)filesize];
in.read((char*)_buffer, filesize);
bool result = LoadArchive(_buffer, filesize);
bool result = LoadArchive(_buffer, (size_t)filesize);
return result;
}
return false;