X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Ftypes.h;h=eea31e3b6f229cf8cc72b1abcdb8c363fce88216;hp=d4ebec9f06fe977fa0d5df482fecab850af063f3;hb=96d3b1c92b8db7d2238fc4993a4f3da49f04d614;hpb=e40b06a0503b44bae5508a371d961914828214b6 diff --git a/src/types.h b/src/types.h index d4ebec9f..eea31e3b 100644 --- a/src/types.h +++ b/src/types.h @@ -130,6 +130,12 @@ enum MoveType { CASTLE = 3 << 14 }; +enum CheckType { + NO_CHECK, + DIRECT_CHECK, + DISCO_CHECK +}; + enum CastleRight { // Defined as in PolyGlot book hash key CASTLES_NONE = 0, WHITE_OO = 1, @@ -440,11 +446,11 @@ inline int square_distance(Square s1, Square s2) { } inline char file_to_char(File f) { - return char(f - FILE_A + int('a')); + return char(f - FILE_A + 'a'); } inline char rank_to_char(Rank r) { - return char(r - RANK_1 + int('1')); + return char(r - RANK_1 + '1'); } inline Square pawn_push(Color c) { @@ -490,15 +496,15 @@ inline const std::string square_to_string(Square s) { /// Our insertion sort implementation, works with pointers and iterators and is /// guaranteed to be stable, as is needed. template -void sort(K first, K last) +void sort(K begin, K end) { T tmp; K p, q; - for (p = first + 1; p < last; p++) + for (p = begin + 1; p < end; p++) { tmp = *p; - for (q = p; q != first && *(q-1) < tmp; --q) + for (q = p; q != begin && *(q-1) < tmp; --q) *q = *(q-1); *q = tmp; }