Fixed warnings and function signatures (x86)
This commit is contained in:
parent
acc2d7eee9
commit
127f9f2ee4
6 changed files with 11 additions and 11 deletions
|
@ -53,7 +53,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
//truncate all strings to 255 characters + null
|
//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));
|
strings[i] = strings[i].substr(0, std::min((int)strings[i].size(), 255));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -337,7 +337,7 @@ namespace InteropEmu {
|
||||||
NsfMapper::GetInstance()->SelectTrack(trackNumber);
|
NsfMapper::GetInstance()->SelectTrack(trackNumber);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DllExport int32_t __stdcall NsfGetCurrentTrack(uint8_t trackNumber) {
|
DllExport int32_t __stdcall NsfGetCurrentTrack() {
|
||||||
if(NsfMapper::GetInstance()) {
|
if(NsfMapper::GetInstance()) {
|
||||||
return NsfMapper::GetInstance()->GetCurrentTrack();
|
return NsfMapper::GetInstance()->GetCurrentTrack();
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
void __stdcall InitializeEmu(char* homeFolder, void*, void*);
|
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 Run();
|
||||||
void __stdcall Stop();
|
void __stdcall Stop();
|
||||||
}
|
}
|
||||||
|
@ -33,13 +33,13 @@ int main(int argc, char* argv[])
|
||||||
};
|
};
|
||||||
|
|
||||||
InitializeEmu("C:\\Windows\\Temp\\Mesen", nullptr, nullptr);
|
InitializeEmu("C:\\Windows\\Temp\\Mesen", nullptr, nullptr);
|
||||||
LoadROM(testRoms[0]);
|
LoadROM(testRoms[0], -1);
|
||||||
std::cout << "Running: " << testRoms[0] << std::endl;
|
std::cout << "Running: " << testRoms[0] << std::endl;
|
||||||
thread testThread([testRoms] {
|
thread testThread([testRoms] {
|
||||||
for(size_t i = 1; i < testRoms.size(); i++) {
|
for(size_t i = 1; i < testRoms.size(); i++) {
|
||||||
std::this_thread::sleep_for(std::chrono::duration<int, std::milli>(5000));
|
std::this_thread::sleep_for(std::chrono::duration<int, std::milli>(5000));
|
||||||
std::cout << "Running: " << testRoms[i] << std::endl;
|
std::cout << "Running: " << testRoms[i] << std::endl;
|
||||||
LoadROM(testRoms[i]);
|
LoadROM(testRoms[i], -1);
|
||||||
}
|
}
|
||||||
Stop();
|
Stop();
|
||||||
});
|
});
|
||||||
|
|
|
@ -8,7 +8,7 @@ WRes MemBuffer_Read(CSzMemBuffer *p, void *data, size_t *size)
|
||||||
if(originalSize == 0)
|
if(originalSize == 0)
|
||||||
return 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);
|
memcpy(data, (char*)(p->buffer) + p->pos, length);
|
||||||
p->pos += length;
|
p->pos += length;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -9,8 +9,8 @@ EXTERN_C_BEGIN
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
void* buffer;
|
void* buffer;
|
||||||
size_t size;
|
Int64 size;
|
||||||
size_t pos;
|
Int64 pos;
|
||||||
} CSzMemBuffer;
|
} CSzMemBuffer;
|
||||||
|
|
||||||
/* reads max(*size, remain file's size) bytes */
|
/* reads max(*size, remain file's size) bytes */
|
||||||
|
|
|
@ -61,7 +61,7 @@ bool ArchiveReader::LoadArchive(string filename)
|
||||||
ifstream in(filename, std::ios::binary | std::ios::in);
|
ifstream in(filename, std::ios::binary | std::ios::in);
|
||||||
if(in) {
|
if(in) {
|
||||||
in.seekg(0, std::ios::end);
|
in.seekg(0, std::ios::end);
|
||||||
size_t filesize = in.tellg();
|
std::streampos filesize = in.tellg();
|
||||||
in.seekg(0, std::ios::beg);
|
in.seekg(0, std::ios::beg);
|
||||||
|
|
||||||
if(_buffer) {
|
if(_buffer) {
|
||||||
|
@ -69,9 +69,9 @@ bool ArchiveReader::LoadArchive(string filename)
|
||||||
_buffer = nullptr;
|
_buffer = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
_buffer = new uint8_t[filesize];
|
_buffer = new uint8_t[(uint32_t)filesize];
|
||||||
in.read((char*)_buffer, filesize);
|
in.read((char*)_buffer, filesize);
|
||||||
bool result = LoadArchive(_buffer, filesize);
|
bool result = LoadArchive(_buffer, (size_t)filesize);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue