From 0663f3e9e9616a0d23593d971169950b2a93b61b Mon Sep 17 00:00:00 2001 From: Calcitem Date: Sun, 13 Dec 2020 22:00:29 +0800 Subject: [PATCH] =?UTF-8?q?sq=20=E8=87=AA=E5=A2=9E=E7=94=B1=20i=3Di+1=20?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=20++i?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/position.cpp | 4 ++-- src/types.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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,