mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 17:16:33 +08:00
Minor code style tweaks
No functional change.
This commit is contained in:
committed by
Stéphane Nicolet
parent
ee0f5cd303
commit
a05793517f
@@ -324,8 +324,8 @@ inline Value& operator+=(Value& v, int i) { return v = v + i; }
|
|||||||
inline Value& operator-=(Value& v, int i) { return v = v - i; }
|
inline Value& operator-=(Value& v, int i) { return v = v - i; }
|
||||||
|
|
||||||
/// Additional operators to add a Direction to a Square
|
/// Additional operators to add a Direction to a Square
|
||||||
inline 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 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; }
|
||||||
inline Square& operator-=(Square& s, Direction d) { return s = s - d; }
|
inline Square& operator-=(Square& s, Direction d) { return s = s - d; }
|
||||||
|
|
||||||
@@ -448,7 +448,7 @@ constexpr PieceType promotion_type(Move m) {
|
|||||||
return PieceType(((m >> 12) & 3) + KNIGHT);
|
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);
|
return Move((from << 6) + to);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public:
|
|||||||
void operator<<(const Option&);
|
void operator<<(const Option&);
|
||||||
operator double() const;
|
operator double() const;
|
||||||
operator std::string() const;
|
operator std::string() const;
|
||||||
bool operator==(const char*);
|
bool operator==(const char*) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend std::ostream& operator<<(std::ostream&, const OptionsMap&);
|
friend std::ostream& operator<<(std::ostream&, const OptionsMap&);
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ Option::operator std::string() const {
|
|||||||
return currentValue;
|
return currentValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Option::operator==(const char* s) {
|
bool Option::operator==(const char* s) const {
|
||||||
assert(type == "combo");
|
assert(type == "combo");
|
||||||
return !CaseInsensitiveLess()(currentValue, s)
|
return !CaseInsensitiveLess()(currentValue, s)
|
||||||
&& !CaseInsensitiveLess()(s, currentValue);
|
&& !CaseInsensitiveLess()(s, currentValue);
|
||||||
|
|||||||
Reference in New Issue
Block a user