Fix errors/warnings in scudo build.

This commit is contained in:
Peter Collingbourne 2020-02-11 08:29:16 -08:00
parent 509bac030a
commit 515e19ae7b
2 changed files with 4 additions and 4 deletions

View File

@ -24,7 +24,7 @@ inline uptr scaledLog2(uptr Size, uptr ZeroLog, uptr LogBits) {
template <typename Config> struct SizeClassMapBase {
static u32 getMaxCachedHint(uptr Size) {
DCHECK_LE(Size, MaxSize);
DCHECK_LE(Size, (1UL << Config::MaxSizeLog) + Chunk::getHeaderSize());
DCHECK_NE(Size, 0);
u32 N;
// Force a 32-bit division if the template parameters allow for it.
@ -119,9 +119,9 @@ class TableSizeClassMap : public SizeClassMapBase<Config> {
constexpr static u8 computeClassId(uptr Size) {
for (uptr i = 0; i != ClassesSize; ++i) {
if (Size <= Config::Classes[i])
return i + 1;
return static_cast<u8>(i + 1);
}
return -1;
return static_cast<u8>(-1);
}
constexpr static uptr getTableSize() {

View File

@ -79,7 +79,7 @@ template <class Allocator, u32 MaxTSDCount> struct TSDRegistrySharedT {
}
void enable() {
for (s32 I = NumberOfTSDs - 1; I >= 0; I--)
for (s32 I = static_cast<s32>(NumberOfTSDs - 1); I >= 0; I--)
TSDs[I].unlock();
Mutex.unlock();
}