[NFC] Automatic fixes from clang-tidy.

This commit is contained in:
David Chisnall
2019-04-29 11:33:07 +01:00
parent e6325e5cd2
commit 4bafca9be7
12 changed files with 92 additions and 91 deletions

View File

@@ -57,11 +57,12 @@ namespace snmalloc
if ((kind != Medium) || (sizeclass != sc))
{
sizeclass = sc;
uint16_t ssize = (uint16_t)(rsize >> 8);
uint16_t ssize = static_cast<uint16_t>(rsize >> 8);
kind = Medium;
free = medium_slab_free(sc);
for (uint16_t i = free; i > 0; i--)
stack[free - i] = (uint16_t)((SUPERSLAB_SIZE >> 8) - (i * ssize));
stack[free - i] =
static_cast<uint16_t>((SUPERSLAB_SIZE >> 8) - (i * ssize));
}
else
{
@@ -80,7 +81,7 @@ namespace snmalloc
assert(!full());
uint16_t index = stack[head++];
void* p = (void*)((size_t)this + ((size_t)index << 8));
void* p = (void*)((size_t)this + (static_cast<size_t>(index) << 8));
free--;
assert(bits::is_aligned_block<OS_PAGE_SIZE>(p, OS_PAGE_SIZE));
@@ -124,7 +125,7 @@ namespace snmalloc
uint16_t pointer_to_index(void* p)
{
// Get the offset from the slab for a memory location.
return (uint16_t)(((size_t)p - (size_t)this) >> 8);
return static_cast<uint16_t>(((size_t)p - (size_t)this) >> 8);
}
};
}