use auto type when assigning from cast or using new

This commit is contained in:
Axel Kohlmeyer
2022-04-10 18:16:36 -04:00
parent 6071376d42
commit 39b316729b
365 changed files with 1195 additions and 1233 deletions

View File

@ -744,7 +744,7 @@ int utils::expand_args(const char *file, int line, int narg, char **arg, int mod
char *utils::strdup(const std::string &text)
{
char *tmp = new char[text.size() + 1];
auto tmp = new char[text.size() + 1];
strcpy(tmp, text.c_str()); // NOLINT
return tmp;
}
@ -814,7 +814,7 @@ std::string utils::star_subst(const std::string &name, bigint step, int pad)
std::string utils::utf8_subst(const std::string &line)
{
const unsigned char *const in = (const unsigned char *) line.c_str();
const auto *const in = (const unsigned char *) line.c_str();
const int len = line.size();
std::string out;