mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-02 14:01: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
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user