This fixes the werror from https://lab.llvm.org/buildbot/#/builders/165/builds/38829
Reviewed By: enh
Differential Revision: https://reviews.llvm.org/D154733
// TODO(chiahungduan): Avoid the use of push_back() in `Batches` of
// BatchClassId.
BG->Batches.push_front(CurBatch);
- UnusedSlots = BG->MaxCachedPerBatch - 1;
+ UnusedSlots = static_cast<u16>(BG->MaxCachedPerBatch - 1);
}
// `UnusedSlots` is u16 so the result will be also fit in u16.
const u16 AppendSize = static_cast<u16>(Min<u32>(UnusedSlots, Size - I));
// TODO(chiahungduan): Avoid the use of push_back() in `Batches` of
// BatchClassId.
BG->Batches.push_front(CurBatch);
- UnusedSlots = BG->MaxCachedPerBatch - 1;
+ UnusedSlots = static_cast<u16>(BG->MaxCachedPerBatch - 1);
}
// `UnusedSlots` is u16 so the result will be also fit in u16.
const u16 AppendSize = static_cast<u16>(Min<u32>(UnusedSlots, Size - I));