]> git.sesse.net Git - stockfish/blobdiff - src/types.h
Store distinct upper and lower bound scores
[stockfish] / src / types.h
index d4ebec9f06fe977fa0d5df482fecab850af063f3..2219b40becd8d929e8e73186374e2895b2411e40 100644 (file)
@@ -163,7 +163,7 @@ enum Bound {
   BOUND_NONE  = 0,
   BOUND_UPPER = 1,
   BOUND_LOWER = 2,
-  BOUND_EXACT = BOUND_UPPER | BOUND_LOWER
+  BOUND_EXACT = BOUND_UPPER | BOUND_LOWER | 4
 };
 
 enum Value {
@@ -440,11 +440,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 +490,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<typename T, typename K>
-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;
   }