mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-25 18:31:20 -03:00
[clang-tidy] use auto when casting
Found with modernize-use-auto Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
committed by
Fabian Homborg
parent
b42445e675
commit
220f0a132d
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user