mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
Fixing -Wtype-limits warnings with the asserts (the expression would always evaluate to true). Also fixing a -Wcast-qual warning, where the cast expression isn't required.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221888 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -59,9 +59,9 @@ uint64_t RawMemoryObject::readBytes(uint8_t *Buf, uint64_t Size,
|
|||||||
if (End > BufferSize)
|
if (End > BufferSize)
|
||||||
End = BufferSize;
|
End = BufferSize;
|
||||||
|
|
||||||
|
assert(static_cast<int64_t>(End - Address) >= 0);
|
||||||
Size = End - Address;
|
Size = End - Address;
|
||||||
assert(Size >= 0);
|
memcpy(Buf, Address + FirstChar, Size);
|
||||||
memcpy(Buf, (uint8_t *)(Address + FirstChar), Size);
|
|
||||||
return Size;
|
return Size;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,8 +96,8 @@ uint64_t StreamingMemoryObject::readBytes(uint8_t *Buf, uint64_t Size,
|
|||||||
uint64_t End = Address + Size;
|
uint64_t End = Address + Size;
|
||||||
if (End > BytesRead)
|
if (End > BytesRead)
|
||||||
End = BytesRead;
|
End = BytesRead;
|
||||||
|
assert(static_cast<int64_t>(End - Address) >= 0);
|
||||||
Size = End - Address;
|
Size = End - Address;
|
||||||
assert(Size >= 0);
|
|
||||||
memcpy(Buf, &Bytes[Address + BytesSkipped], Size);
|
memcpy(Buf, &Bytes[Address + BytesSkipped], Size);
|
||||||
return Size;
|
return Size;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user