Still some remain, but are really the silly ones.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
////
inline Color operator+ (Color c, int i) { return Color(int(c) + i); }
////
inline Color operator+ (Color c, int i) { return Color(int(c) + i); }
-inline void operator++ (Color &c, int i) { c = Color(int(c) + 1); }
+inline void operator++ (Color &c, int) { c = Color(int(c) + 1); }
inline Color opposite_color(Color c) {
return Color(int(c) ^ 1);
inline Color opposite_color(Color c) {
return Color(int(c) ^ 1);
-Value EvaluationFunction<KmmKm>::apply(const Position &pos) {
+Value EvaluationFunction<KmmKm>::apply(const Position&) {
+ MovePicker& operator=(const MovePicker&); // Silence a warning under MSVC
+
public:
enum MovegenPhase {
public:
enum MovegenPhase {
};
// Pawn storm open file bonuses by file
};
// Pawn storm open file bonuses by file
- const int KStormOpenFileBonus[8] = { 45, 45, 30, 0, 0, 0, 0, 0 };
- const int QStormOpenFileBonus[8] = { 0, 0, 0, 0, 0, 30, 45, 30 };
+ const int16_t KStormOpenFileBonus[8] = { 45, 45, 30, 0, 0, 0, 0, 0 };
+ const int16_t QStormOpenFileBonus[8] = { 0, 0, 0, 0, 0, 30, 45, 30 };
// Pawn storm lever bonuses by file
const int StormLeverBonus[8] = { 20, 20, 10, 0, 0, 10, 20, 20 };
// Pawn storm lever bonuses by file
const int StormLeverBonus[8] = { 20, 20, 10, 0, 0, 10, 20, 20 };
static const char PieceChars[] = " pnbrqk";
static const char PieceChars[] = " pnbrqk";
-int piece_type_to_char(PieceType pt, bool upcase) {
- return upcase? toupper(PieceChars[pt]) : PieceChars[pt];
+char piece_type_to_char(PieceType pt, bool upcase) {
+ return char(upcase? toupper(PieceChars[pt]) : PieceChars[pt]);
}
PieceType piece_type_from_char(char c) {
}
PieceType piece_type_from_char(char c) {
-extern int piece_type_to_char(PieceType pt, bool upcase = false);
+extern char piece_type_to_char(PieceType pt, bool upcase = false);
extern PieceType piece_type_from_char(char c);
extern PieceType piece_type_from_char(char c);
st->capture = type_of_piece_on(to);
if (st->capture)
st->capture = type_of_piece_on(to);
if (st->capture)
- do_capture_move(m, st->capture, them, to);
+ do_capture_move(st->capture, them, to);
// Move the piece
clear_bit(&(byColorBB[us]), from);
// Move the piece
clear_bit(&(byColorBB[us]), from);
/// Position::do_capture_move() is a private method used to update captured
/// piece info. It is called from the main Position::do_move function.
/// Position::do_capture_move() is a private method used to update captured
/// piece info. It is called from the main Position::do_move function.
-void Position::do_capture_move(Move m, PieceType capture, Color them, Square to) {
+void Position::do_capture_move(PieceType capture, Color them, Square to) {
st->capture = type_of_piece_on(to);
if (st->capture)
st->capture = type_of_piece_on(to);
if (st->capture)
- do_capture_move(m, st->capture, them, to);
+ do_capture_move(st->capture, them, to);
// Remove pawn
clear_bit(&(byColorBB[us]), from);
// Remove pawn
clear_bit(&(byColorBB[us]), from);
// Forcing value to bool 'true' or 'false' (performance warning)
#pragma warning(disable: 4800)
// Forcing value to bool 'true' or 'false' (performance warning)
#pragma warning(disable: 4800)
+// Conditional expression is constant
+#pragma warning(disable: 4127)
+
+
void allow_ooo(Color c);
// Helper functions for doing and undoing moves
void allow_ooo(Color c);
// Helper functions for doing and undoing moves
- void do_capture_move(Move m, PieceType capture, Color them, Square to);
+ void do_capture_move(PieceType capture, Color them, Square to);
void do_castle_move(Move m);
void do_promotion_move(Move m);
void do_ep_move(Move m);
void do_castle_move(Move m);
void do_promotion_move(Move m);
void do_ep_move(Move m);
Depth depth, int ply, int threadID);
void sp_search(SplitPoint *sp, int threadID);
void sp_search_pv(SplitPoint *sp, int threadID);
Depth depth, int ply, int threadID);
void sp_search(SplitPoint *sp, int threadID);
void sp_search_pv(SplitPoint *sp, int threadID);
- void init_node(const Position &pos, SearchStack ss[], int ply, int threadID);
+ void init_node(SearchStack ss[], int ply, int threadID);
void update_pv(SearchStack ss[], int ply);
void sp_update_pv(SearchStack *pss, SearchStack ss[], int ply);
bool connected_moves(const Position &pos, Move m1, Move m2);
void update_pv(SearchStack ss[], int ply);
void sp_update_pv(SearchStack *pss, SearchStack ss[], int ply);
bool connected_moves(const Position &pos, Move m1, Move m2);
// Initialize, and make an early exit in case of an aborted search,
// an instant draw, maximum ply reached, etc.
// Initialize, and make an early exit in case of an aborted search,
// an instant draw, maximum ply reached, etc.
- init_node(pos, ss, ply, threadID);
+ init_node(ss, ply, threadID);
// After init_node() that calls poll()
if (AbortSearch || thread_should_stop(threadID))
// After init_node() that calls poll()
if (AbortSearch || thread_should_stop(threadID))
// Initialize, and make an early exit in case of an aborted search,
// an instant draw, maximum ply reached, etc.
// Initialize, and make an early exit in case of an aborted search,
// an instant draw, maximum ply reached, etc.
- init_node(pos, ss, ply, threadID);
+ init_node(ss, ply, threadID);
// After init_node() that calls poll()
if (AbortSearch || thread_should_stop(threadID))
// After init_node() that calls poll()
if (AbortSearch || thread_should_stop(threadID))
// Initialize, and make an early exit in case of an aborted search,
// an instant draw, maximum ply reached, etc.
// Initialize, and make an early exit in case of an aborted search,
// an instant draw, maximum ply reached, etc.
- init_node(pos, ss, ply, threadID);
+ init_node(ss, ply, threadID);
// After init_node() that calls poll()
if (AbortSearch || thread_should_stop(threadID))
// After init_node() that calls poll()
if (AbortSearch || thread_should_stop(threadID))
EvalInfo ei;
Value staticValue;
bool isCheck = pos.is_check();
EvalInfo ei;
Value staticValue;
bool isCheck = pos.is_check();
+ ei.futilityMargin = Value(0); // Manually initialize futilityMargin
if (isCheck)
staticValue = -VALUE_INFINITE;
if (isCheck)
staticValue = -VALUE_INFINITE;
assert(ei.futilityMargin == Value(0));
staticValue = tte->value();
assert(ei.futilityMargin == Value(0));
staticValue = tte->value();
- ei.futilityMargin = Value(0); // manually initialize futilityMargin
}
else
staticValue = evaluate(pos, ei, threadID);
}
else
staticValue = evaluate(pos, ei, threadID);
// NodesBetweenPolls nodes, init_node() also calls poll(), which polls
// for user input and checks whether it is time to stop the search.
// NodesBetweenPolls nodes, init_node() also calls poll(), which polls
// for user input and checks whether it is time to stop the search.
- void init_node(const Position &pos, SearchStack ss[], int ply, int threadID) {
+ void init_node(SearchStack ss[], int ply, int threadID) {
assert(ply >= 0 && ply < PLY_MAX);
assert(threadID >= 0 && threadID < ActiveThreads);
assert(ply >= 0 && ply < PLY_MAX);
assert(threadID >= 0 && threadID < ActiveThreads);
return File(c - 'a') + FILE_A;
}
return File(c - 'a') + FILE_A;
}
-inline int file_to_char(File f) {
- return int(f - FILE_A) + 'a';
+inline char file_to_char(File f) {
+ return char(f - FILE_A) + 'a';
}
inline Rank rank_from_char(char c) {
return Rank(c - '1') + RANK_1;
}
}
inline Rank rank_from_char(char c) {
return Rank(c - '1') + RANK_1;
}
-inline int rank_to_char(Rank r) {
- return int(r - RANK_1) + '1';
+inline char rank_to_char(Rank r) {
+ return char(r - RANK_1) + '1';
}
inline Square square_from_string(const std::string& str) {
}
inline Square square_from_string(const std::string& str) {
#include <time.h>
#include "dos.h"
#include <time.h>
#include "dos.h"
-int gettimeofday(struct timeval* tp, struct timezone* tzp)
+int gettimeofday(struct timeval* tp, struct timezone*)