Skip to content

Commit

Permalink
fix some compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lumiZGorlic committed Mar 16, 2021
1 parent eb74bcf commit 25ab78a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions board.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 +1306,7 @@ void openBook(){
move tryBook(){
std::vector<std::string> possibleMoves;

int sz=playedMoves.size();
auto sz=playedMoves.size();

for (std::string o: openings){
if (o.size() > sz && o.substr(0, sz) == playedMoves){
Expand All @@ -1328,7 +1328,7 @@ move tryBook(){
std::string from = ms.substr(0,2), to = ms.substr(2,2);
int fromI = -1, toI = -1;

for (int i = 0; i < sizeof(intToStr)/sizeof(intToStr[0]); i++)
for (int i = 0, max = sizeof(intToStr)/sizeof(intToStr[0]); i < max; i++)
if (from == intToStr[i]) fromI = i;
else if (to == intToStr[i]) toI = i;

Expand Down
2 changes: 1 addition & 1 deletion testUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void bratkoKopec()
"f2 f4"
};

for (int i = 0; i < sizeof(bestMoves)/sizeof(bestMoves[0]); i++){
for (int i = 0, max = sizeof(bestMoves)/sizeof(bestMoves[0]); i < max; i++){
chessBoard board;
searchEngine searchEn;
move m(0,0,0);
Expand Down
2 changes: 1 addition & 1 deletion uci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ move tokenToMove(const chessBoard& board, const std::string& token){
int fromI, toI;
char flag = 0;

for (int i = 0; i < sizeof(mp)/sizeof(mp[0]); i++)
for (int i = 0, max = sizeof(mp)/sizeof(mp[0]); i < max; i++)
if (from == mp[i]) fromI = i;
else if (to == mp[i]) toI = i;

Expand Down

0 comments on commit 25ab78a

Please sign in to comment.