Use concrete types instead of auto when convenient and not redundant (#1757)

This commit is contained in:
Rangi
2025-07-17 14:59:51 -04:00
committed by GitHub
parent 9dddd87893
commit 0c96234532
16 changed files with 67 additions and 68 deletions

View File

@@ -133,7 +133,7 @@ std::string Diagnostics<L, W>::processWarningFlag(char const *flag) {
// Try to match the flag against a parametric warning
// If there was an equals sign, it will have set `param`; if not, `param` will be 0, which
// applies to all levels
for (auto const &paramWarning : paramWarnings) {
for (ParamWarning<W> const &paramWarning : paramWarnings) {
W baseID = paramWarning.firstID;
uint8_t maxParam = paramWarning.lastID - baseID + 1;
assume(paramWarning.defaultLevel <= maxParam);

View File

@@ -110,7 +110,7 @@ struct Palette {
};
// Flipping tends to happen fairly often, so take a bite out of dcache to speed it up
static constexpr auto flipTable = ([]() constexpr {
static std::array<uint16_t, 256> flipTable = ([]() constexpr {
std::array<uint16_t, 256> table{};
for (uint16_t i = 0; i < table.size(); i++) {
// To flip all the bits, we'll flip both nibbles, then each nibble half, etc.

View File

@@ -33,7 +33,9 @@ struct Rgba {
// Returns this RGBA as a 32-bit number that can be printed in hex (`%08x`) to yield its CSS
// representation
uint32_t toCSS() const {
auto shl = [](uint8_t val, unsigned shift) { return static_cast<uint32_t>(val) << shift; };
constexpr auto shl = [](uint8_t val, unsigned shift) {
return static_cast<uint32_t>(val) << shift;
};
return shl(red, 24) | shl(green, 16) | shl(blue, 8) | shl(alpha, 0);
}

View File

@@ -22,7 +22,7 @@ class EnumSeq {
return *this;
}
auto operator*() const { return _value; }
T operator*() const { return _value; }
bool operator==(Iterator const &rhs) const { return _value == rhs._value; }
};