fix some compiler warnings
All checks were successful
Linux arm64 / Build (push) Successful in 2m27s

This commit is contained in:
2025-07-20 23:02:45 +02:00
parent ecc035c972
commit 4095103843
11 changed files with 67 additions and 67 deletions

View File

@@ -20,10 +20,10 @@ Board::Board(int width, int height) :
}
void Board::changeBlock(const Position& position, Block block) {
if (position.x < 0 || position.x >= this->width || position.y < 0) return;
if (position.x < 0 || static_cast<unsigned>(position.x) >= this->width || position.y < 0) return;
// resize the grid if needed
if (position.y >= this->grid.size()) {
if (static_cast<unsigned>(position.y) >= this->grid.size()) {
for (int j = this->grid.size(); j <= position.y; j++) {
this->grid.push_back(this->emptyRow);
}
@@ -34,7 +34,7 @@ void Board::changeBlock(const Position& position, Block block) {
void Board::insertRow(int height, int holePosition, Block blockType) {
std::vector<Block> insertedRow;
for (int i = 0; i < this->width; i++) {
for (unsigned i = 0; i < this->width; i++) {
if (i == holePosition) {
insertedRow.push_back(NOTHING);
}
@@ -51,7 +51,7 @@ int Board::clearRows() {
int clearedLines = 0;
for (int j = this->grid.size() - 1; j >= 0; j--) {
bool lineIsFull = true;
int i = 0;
unsigned i = 0;
while (lineIsFull && (i < width)) {
if (this->grid.at(j).at(i) == NOTHING) {
lineIsFull = false;