diff --git a/src/position.cpp b/src/position.cpp index 58650913..43bf53c8 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1153,7 +1153,7 @@ int Position::get_mobility_diff(bool includeFobidden) int diff = 0; int n = 0; - for (Square i = SQ_BEGIN; i < SQ_END; i = static_cast(i + 1)) { + for (Square i = SQ_BEGIN; i < SQ_END; ++i) { n = surrounded_empty_squares_count(i, includeFobidden); if (board[i] & B_STONE) { @@ -1488,7 +1488,7 @@ int Position::add_mills(Square s) bool Position::is_all_in_mills(Color c) { - for (Square i = SQ_BEGIN; i < SQ_END; i = static_cast(i + 1)) { + for (Square i = SQ_BEGIN; i < SQ_END; ++i) { if (board[i] & ((uint8_t)make_piece(c))) { if (!in_how_many_mills(i, NOBODY)) { return false; diff --git a/src/types.h b/src/types.h index 95d83abc..dfa2a96f 100644 --- a/src/types.h +++ b/src/types.h @@ -294,7 +294,7 @@ enum : int DEPTH_OFFSET = DEPTH_NONE }; -enum Square : int32_t +enum Square : int { SQ_0 = 0, SQ_1 = 1, SQ_2 = 2, SQ_3 = 3, SQ_4 = 4, SQ_5 = 5, SQ_6 = 6, SQ_7 = 7, SQ_8 = 8, SQ_9 = 9, SQ_10 = 10, SQ_11 = 11, SQ_12 = 12, SQ_13 = 13, SQ_14 = 14, SQ_15 = 15,