No functional change.
}
}
- Direction RookDirections[] = { NORTH, EAST, SOUTH, WEST };
+ Direction RookDirections[] = { NORTH, EAST, SOUTH, WEST };
Direction BishopDirections[] = { NORTH_EAST, SOUTH_EAST, SOUTH_WEST, NORTH_WEST };
init_magics(RookTable, RookMagics, RookDirections);
&& ttHit
&& tte->depth() >= ttDepth
&& ttValue != VALUE_NONE // Only in case of TT access race
- && (ttValue >= beta ? (tte->bound() & BOUND_LOWER)
- : (tte->bound() & BOUND_UPPER)))
+ && (ttValue >= beta ? (tte->bound() & BOUND_LOWER)
+ : (tte->bound() & BOUND_UPPER)))
return ttValue;
// Evaluate the position statically
ss->staticEval = bestValue = evaluate(pos);
// Can ttValue be used as a better position evaluation?
- if ( ttValue != VALUE_NONE
+ if ( ttValue != VALUE_NONE
&& (tte->bound() & (ttValue > bestValue ? BOUND_LOWER : BOUND_UPPER)))
bestValue = ttValue;
}
inline Value& operator-=(Value& v, int i) { return v = v - i; }
/// Additional operators to add a Direction to a Square
-inline Square operator+(Square s, Direction d) { return Square(int(s) + int(d)); }
-inline Square operator-(Square s, Direction d) { return Square(int(s) - int(d)); }
-inline Square& operator+=(Square &s, Direction d) { return s = s + d; }
-inline Square& operator-=(Square &s, Direction d) { return s = s - d; }
+constexpr Square operator+(Square s, Direction d) { return Square(int(s) + int(d)); }
+constexpr Square operator-(Square s, Direction d) { return Square(int(s) - int(d)); }
+inline Square& operator+=(Square& s, Direction d) { return s = s + d; }
+inline Square& operator-=(Square& s, Direction d) { return s = s - d; }
/// Only declared but not defined. We don't want to multiply two scores due to
/// a very high risk of overflow. So user should explicitly convert to integer.
assert(eg_value(result) == (i * eg_value(s)));
assert(mg_value(result) == (i * mg_value(s)));
- assert((i == 0) || (result / i) == s );
+ assert((i == 0) || (result / i) == s);
return result;
}
return PieceType(((m >> 12) & 3) + KNIGHT);
}
-inline Move make_move(Square from, Square to) {
+constexpr Move make_move(Square from, Square to) {
return Move((from << 6) + to);
}
Option(bool v, OnChange = nullptr);
Option(const char* v, OnChange = nullptr);
Option(double v, int minv, int maxv, OnChange = nullptr);
- Option(const char* v, const char *cur, OnChange = nullptr);
+ Option(const char* v, const char* cur, OnChange = nullptr);
Option& operator=(const std::string&);
void operator<<(const Option&);
operator double() const;
operator std::string() const;
- bool operator==(const char*);
+ bool operator==(const char*) const;
private:
friend std::ostream& operator<<(std::ostream&, const OptionsMap&);
return currentValue;
}
-bool Option::operator==(const char* s) {
+bool Option::operator==(const char* s) const {
assert(type == "combo");
return !CaseInsensitiveLess()(currentValue, s)
&& !CaseInsensitiveLess()(s, currentValue);