From 980124c6094f90741a250a40c160efb593244ffb Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 9 May 2009 12:01:00 +0200 Subject: [PATCH] Fix some Intel compilers warnings Also a compile fix due to Makefile missing new application.cpp file. No functional change. Signed-off-by: Marco Costalba --- src/Makefile | 2 +- src/evaluate.cpp | 34 +++++++++++++++++----------------- src/movegen.cpp | 30 +++++++++++++++--------------- src/movepick.h | 2 ++ src/position.cpp | 2 -- src/san.cpp | 1 - 6 files changed, 35 insertions(+), 36 deletions(-) diff --git a/src/Makefile b/src/Makefile index f36de8d8..f700a444 100644 --- a/src/Makefile +++ b/src/Makefile @@ -24,7 +24,7 @@ EXE = stockfish -OBJS = bitboard.o pawns.o material.o endgame.o evaluate.o main.o \ +OBJS = application.o bitboard.o pawns.o material.o endgame.o evaluate.o main.o \ misc.o move.o movegen.o history.o movepick.o search.o piece.o \ position.o direction.o tt.o value.o uci.o ucioption.o \ mersenne.o book.o bitbase.o san.o benchmark.o diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 36a9b10a..59b605ec 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -571,25 +571,25 @@ namespace { ei.egMobility += Sign[us] * EgBonus[Piece][mob]; // Bishop and Knight outposts - if ( (Piece != BISHOP && Piece != KNIGHT) // compile time condition - || !p.square_is_weak(s, them)) - return mob; - - // Initial bonus based on square - Value v, bonus; - v = bonus = OutpostBonus[Piece][relative_square(us, s)]; - - // Increase bonus if supported by pawn, especially if the opponent has - // no minor piece which can exchange the outpost piece - if (v && (p.pawn_attacks(them, s) & p.pawns(us))) + if ( (Piece == BISHOP || Piece == KNIGHT) // compile time condition + && p.square_is_weak(s, them)) { - bonus += v / 2; - if ( p.piece_count(them, KNIGHT) == 0 - && (SquaresByColorBB[square_color(s)] & p.bishops(them)) == EmptyBoardBB) - bonus += v; + // Initial bonus based on square + Value v, bonus; + v = bonus = OutpostBonus[Piece][relative_square(us, s)]; + + // Increase bonus if supported by pawn, especially if the opponent has + // no minor piece which can exchange the outpost piece + if (v && (p.pawn_attacks(them, s) & p.pawns(us))) + { + bonus += v / 2; + if ( p.piece_count(them, KNIGHT) == 0 + && (SquaresByColorBB[square_color(s)] & p.bishops(them)) == EmptyBoardBB) + bonus += v; + } + ei.mgValue += Sign[us] * bonus; + ei.egValue += Sign[us] * bonus; } - ei.mgValue += Sign[us] * bonus; - ei.egValue += Sign[us] * bonus; return mob; } diff --git a/src/movegen.cpp b/src/movegen.cpp index cbb71688..a783a625 100644 --- a/src/movegen.cpp +++ b/src/movegen.cpp @@ -835,23 +835,23 @@ namespace { // Direct checks b = target & ~dc; - if (Piece == KING || !b) - return mlist; - - Bitboard checkSqs = pos.piece_attacks(ksq) & pos.empty_squares(); - if (!checkSqs) - return mlist; - - while (b) + if (Piece != KING || b) { - Square from = pop_1st_bit(&b); - if ( (Piece == QUEEN && !(QueenPseudoAttacks[from] & checkSqs)) - || (Piece == ROOK && !(RookPseudoAttacks[from] & checkSqs)) - || (Piece == BISHOP && !(BishopPseudoAttacks[from] & checkSqs))) - continue; + Bitboard checkSqs = pos.piece_attacks(ksq) & pos.empty_squares(); + if (!checkSqs) + return mlist; - Bitboard bb = pos.piece_attacks(from) & checkSqs; - SERIALIZE_MOVES(bb); + while (b) + { + Square from = pop_1st_bit(&b); + if ( (Piece == QUEEN && !(QueenPseudoAttacks[from] & checkSqs)) + || (Piece == ROOK && !(RookPseudoAttacks[from] & checkSqs)) + || (Piece == BISHOP && !(BishopPseudoAttacks[from] & checkSqs))) + continue; + + Bitboard bb = pos.piece_attacks(from) & checkSqs; + SERIALIZE_MOVES(bb); + } } return mlist; } diff --git a/src/movepick.h b/src/movepick.h index 8e7f6651..0ac4bb6c 100644 --- a/src/movepick.h +++ b/src/movepick.h @@ -37,6 +37,8 @@ struct EvalInfo; struct SearchStack; +extern SearchStack EmptySearchStack; + /// MovePicker is a class which is used to pick one legal move at a time from /// the current position. It is initialized with a Position object and a few /// moves we have reason to believe are good. The most important method is diff --git a/src/position.cpp b/src/position.cpp index ce48e33f..1c1ceed2 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -40,8 +40,6 @@ //// Variables //// -extern SearchStack EmptySearchStack; - int Position::castleRightsMask[64]; Key Position::zobrist[2][8][64]; diff --git a/src/san.cpp b/src/san.cpp index d8d051d8..3f706b20 100644 --- a/src/san.cpp +++ b/src/san.cpp @@ -31,7 +31,6 @@ #include "movepick.h" #include "san.h" -extern SearchStack EmptySearchStack; //// //// Local definitions -- 2.39.2