Fix linter messages

This commit is contained in:
Stefan Müller 2025-05-22 16:13:48 +02:00
parent 0b70db7670
commit 99c31bc0ea
3 changed files with 4 additions and 4 deletions

View File

@ -134,7 +134,7 @@ int64_t ChronospatialComputer::findQuineState()
// number (from 'program_'). The target output numbers are considered in reverse order. // number (from 'program_'). The target output numbers are considered in reverse order.
while (i > 0) while (i > 0)
{ {
auto patterns = outputPatterns[program_[i - 1]]; auto& patterns = outputPatterns[program_[i - 1]];
auto it = std::find_if(patterns.begin(), patterns.end(), auto it = std::find_if(patterns.begin(), patterns.end(),
[&lastAppend, &result, &masks](auto& x) { [&lastAppend, &result, &masks](auto& x) {
return lastAppend < x.first && (result & masks[x.first]) == x.second; }); return lastAppend < x.first && (result & masks[x.first]) == x.second; });

View File

@ -94,7 +94,7 @@ int64_t ClawContraption::calcTokenCost(const Point2& buttonA, const Point2& butt
const int64_t offset) const int64_t offset)
{ {
int64_t p{ (prize.y + offset) * buttonB.x - (prize.x + offset) * buttonB.y }; int64_t p{ (prize.y + offset) * buttonB.x - (prize.x + offset) * buttonB.y };
int64_t q{ buttonA.y * buttonB.x - buttonA.x * buttonB.y }; int64_t q{ static_cast<int64_t>(buttonA.y) * buttonB.x - static_cast<int64_t>(buttonA.x) * buttonB.y };
int64_t a{ p / q }; int64_t a{ p / q };
if (a * q != p || (offset == 0 && a > getNMaxButtonPushes())) if (a * q != p || (offset == 0 && a > getNMaxButtonPushes()))
{ {

View File

@ -110,7 +110,7 @@ void DiskFragmenter::moveWholeFiles(const std::string& line)
// Contains indices of the next empty space with at least as many blocks as their index. 'emptySpaceIndices[0]' is // Contains indices of the next empty space with at least as many blocks as their index. 'emptySpaceIndices[0]' is
// not used, but included for convenience of accessing the other values by index. // not used, but included for convenience of accessing the other values by index.
DigitIndexArray emptySpaceIndices; DigitIndexArray emptySpaceIndices{};
emptySpaceIndices.fill(0); emptySpaceIndices.fill(0);
while (back > 0) while (back > 0)
@ -121,7 +121,7 @@ void DiskFragmenter::moveWholeFiles(const std::string& line)
{ {
if (front >= back) if (front >= back)
{ {
position -= getDigit(line, back) + getDigit(line, back - 1); position -= getDigit(line, back) + static_cast<size_t>(getDigit(line, back - 1));
} }
moveBackFileForward(back, backIdNumber, nBackBlocks, emptySpaces[emptySpaceIndices[nBackBlocks]]); moveBackFileForward(back, backIdNumber, nBackBlocks, emptySpaces[emptySpaceIndices[nBackBlocks]]);
UpdateEmptySpaceIndices(emptySpaces, emptySpaceIndices); UpdateEmptySpaceIndices(emptySpaces, emptySpaceIndices);