diff --git a/src/format.cc b/src/format.cc index 9a9abf8d0a73..1e98bc802f59 100644 --- a/src/format.cc +++ b/src/format.cc @@ -29,7 +29,7 @@ struct sprintf_specs { bool alt : 1; template - constexpr sprintf_specs(basic_format_specs specs) + constexpr explicit sprintf_specs(basic_format_specs specs) : precision(specs.precision), type(specs.type), alt(specs.alt) {} constexpr bool has_precision() const { return precision >= 0; } @@ -81,7 +81,8 @@ char* sprintf_format(Double value, internal::buffer& buf, unsigned n = internal::to_unsigned(result); if (n < buf.capacity()) { // Find the decimal point. - auto p = buf.data(), end = p + n; + auto *p = buf.data(); + auto *end = p + n; if (*p == '+' || *p == '-') ++p; if (specs.type != 'a' && specs.type != 'A') { while (p < end && *p >= '0' && *p <= '9') ++p;