[clang-tidy] use auto when casting

Found with modernize-use-auto

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2020-04-02 16:04:04 -07:00
committed by Fabian Homborg
parent b42445e675
commit 220f0a132d
26 changed files with 71 additions and 73 deletions

View File

@@ -22,13 +22,13 @@ static CharT **make_null_terminated_array_helper(
}
// Now allocate their sum.
unsigned char *base =
auto base =
static_cast<unsigned char *>(malloc(pointers_allocation_len + strings_allocation_len));
if (!base) return nullptr;
// Divvy it up into the pointers and strings.
CharT **pointers = reinterpret_cast<CharT **>(base);
CharT *strings = reinterpret_cast<CharT *>(base + pointers_allocation_len);
auto pointers = reinterpret_cast<CharT **>(base);
auto strings = reinterpret_cast<CharT *>(base + pointers_allocation_len);
// Start copying.
for (size_t i = 0; i < count; i++) {