X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmaterial.cpp;h=f2e501c1d862091545806cbc07b148e82e2754b5;hp=fc2f4b7cf35e454687c4ec2ead6a7276ea0546bd;hb=bc0c1c8d7b1ef10bb917f3da8b5ba272ee6401fc;hpb=cb9399445f5ce6f9e209a7ae35ad00ce45dc9c0d diff --git a/src/material.cpp b/src/material.cpp index fc2f4b7c..f2e501c1 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -72,7 +72,7 @@ namespace { const Color Them = (Us == WHITE ? BLACK : WHITE); return pos.non_pawn_material(Them) == Value(0) && pos.piece_count(Them, PAWN) == 0 - && pos.non_pawn_material(Us) >= RookValueMidgame; + && pos.non_pawn_material(Us) >= RookValueMidgame; } template bool is_KBPsK(const Position& pos) { @@ -182,7 +182,7 @@ Phase MaterialInfoTable::game_phase(const Position& pos) { MaterialInfo* MaterialInfoTable::get_material_info(const Position& pos) { Key key = pos.get_material_key(); - int index = key & (size - 1); + unsigned index = unsigned(key & (size - 1)); MaterialInfo* mi = entries + index; // If mi->key matches the position's material hash key, it means that we @@ -229,10 +229,8 @@ MaterialInfo* MaterialInfoTable::get_material_info(const Position& pos) { // OK, we didn't find any special evaluation function for the current // material configuration. Is there a suitable scaling function? // - // The code below is rather messy, and it could easily get worse later, - // if we decide to add more special cases. We face problems when there - // are several conflicting applicable scaling functions and we need to - // decide which one to use. + // We face problems when there are several conflicting applicable + // scaling functions and we need to decide which one to use. SF* sf; if ((sf = funcs->get(key)) != NULL) @@ -405,7 +403,7 @@ Key EndgameFunctions::buildKey(const string& keyCode) { s << char(upcase? toupper(keyCode[i]) : tolower(keyCode[i])); } s << 8 - keyCode.length() << "/8/8/8/8/8/8/8 w -"; - return Position(s.str()).get_material_key(); + return Position(s.str(), 0).get_material_key(); } const string EndgameFunctions::swapColors(const string& keyCode) {