From 3cd0f706626f4292678abf9da97281200b9ce5cc Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 7 May 2020 18:53:48 -0700 Subject: [PATCH] remove stars from auto * is pointless for auto. It's also confusing. Case in point, the variables used in map are now actually const. There's a difference between const X* and const * X const. Signed-off-by: Rosen Penev --- include/fmt/core.h | 4 ++-- include/fmt/format.h | 2 +- test/fuzzing/one_arg.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index b6e36d48..46eac899 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -1024,11 +1024,11 @@ template struct arg_mapper { return reinterpret_cast(val); } FMT_CONSTEXPR const char* map(signed char* val) { - const auto* const_val = val; + const auto const_val = val; return map(const_val); } FMT_CONSTEXPR const char* map(unsigned char* val) { - const auto* const_val = val; + const auto const_val = val; return map(const_val); } diff --git a/include/fmt/format.h b/include/fmt/format.h index 5e938c31..ce82eb24 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1375,7 +1375,7 @@ inline OutputIt write_padded(OutputIt out, static_assert(align == align::left || align == align::right, ""); unsigned spec_width = to_unsigned(specs.width); size_t padding = spec_width > width ? spec_width - width : 0; - auto* shifts = align == align::left ? data::left_padding_shifts + auto shifts = align == align::left ? data::left_padding_shifts : data::right_padding_shifts; size_t left_padding = padding >> shifts[specs.align]; auto it = reserve(out, size + padding * specs.fill.size()); diff --git a/test/fuzzing/one_arg.cpp b/test/fuzzing/one_arg.cpp index 3a1bf5cc..d28947da 100644 --- a/test/fuzzing/one_arg.cpp +++ b/test/fuzzing/one_arg.cpp @@ -58,7 +58,7 @@ void invoke_fmt_time(const uint8_t* Data, size_t Size) { #else auto fmtstring = fmt::string_view(fmt_fuzzer::as_chars(Data), Size); #endif - auto* b = std::localtime(&item); + auto b = std::localtime(&item); if (b) { #if FMT_FUZZ_FORMAT_TO_STRING std::string message = fmt::format(fmtstring, *b);