fixed errors and warnings when building as C++ - fixes #1

This commit is contained in:
Gregory Pakosz
2015-12-28 16:19:52 +01:00
parent 946b114876
commit d0fc4161e8
4 changed files with 19 additions and 9 deletions

View File

@@ -258,7 +258,7 @@ int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length)
char* begin;
char* p;
begin = mmap(0, offset, PROT_READ, MAP_SHARED, fd, 0);
begin = (char*)mmap(0, offset, PROT_READ, MAP_SHARED, fd, 0);
p = begin + offset;
while (p >= begin) // scan backwards
@@ -267,7 +267,7 @@ int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length)
{
uint16_t length_ = *((uint16_t*)(p + 26));
if (length + 2 + length_ < sizeof(buffer))
if (length + 2 + length_ < (int)sizeof(buffer))
{
memcpy(&buffer[length], "!/", 2);
memcpy(&buffer[length + 2], p + 30, length_);