[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

@@ -77,7 +77,7 @@ int fish_mkstemp_cloexec(char *name_template) {
// cppcheck-suppress unusedFunction
[[gnu::unused]] static wchar_t *wcsdup_fallback(const wchar_t *in) {
size_t len = std::wcslen(in);
wchar_t *out = static_cast<wchar_t *>(malloc(sizeof(wchar_t) * (len + 1)));
auto out = static_cast<wchar_t *>(malloc(sizeof(wchar_t) * (len + 1)));
if (out == nullptr) {
return nullptr;
}
@@ -162,7 +162,7 @@ int wcsncasecmp(const wchar_t *a, const wchar_t *b, size_t n) {
#ifndef HAVE_WCSNDUP
wchar_t *wcsndup(const wchar_t *in, size_t c) {
wchar_t *res = static_cast<wchar_t *>(malloc(sizeof(wchar_t) * (c + 1)));
auto res = static_cast<wchar_t *>(malloc(sizeof(wchar_t) * (c + 1)));
if (res == nullptr) {
return nullptr;
}