silence compiler warnings

This commit is contained in:
LazyBumHorse 2019-07-22 16:55:55 +02:00
parent 12cc7b3213
commit 2de6e9b43a
3 changed files with 4 additions and 4 deletions

View File

@ -1936,7 +1936,7 @@ private:
if (count) {
GenericValue* e = static_cast<GenericValue*>(allocator.Malloc(count * sizeof(GenericValue)));
SetElementsPointer(e);
std::memcpy(e, values, count * sizeof(GenericValue));
std::memcpy(static_cast<void*>(e), static_cast<void*>(values), count * sizeof(GenericValue));
}
else
SetElementsPointer(0);
@ -1949,7 +1949,7 @@ private:
if (count) {
Member* m = static_cast<Member*>(allocator.Malloc(count * sizeof(Member)));
SetMembersPointer(m);
std::memcpy(m, members, count * sizeof(Member));
std::memcpy(static_cast<void*>(m), static_cast<void*>(members), count * sizeof(Member));
}
else
SetMembersPointer(0);

View File

@ -26,7 +26,7 @@ Dest BitwiseCast(Src source) {
Dest dest;
static_assert(sizeof(source) == sizeof(dest),
"BitwiseCast: Source and destination must have the same size");
std::memcpy(&dest, &source, sizeof(dest));
std::memcpy(static_cast<void*>(&dest), static_cast<void*>(&source), sizeof(dest));
return dest;
}

View File

@ -175,7 +175,7 @@ static void cdrom_print_sense_data(const unsigned char *sense, size_t len)
break;
}
printf("[CDROM] Sense Key: %02X (%s)\n", key, sense_key_text);
printf("[CDROM] Sense Key: %02X (%s)\n", key, sense_key_text ? sense_key_text : "null");
printf("[CDROM] ASC: %02X\n", asc);
printf("[CDROM] ASCQ: %02X\n", ascq);