X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmaterial.cpp;h=845519bc41648cedd2a7933564d4307b5ceafffa;hp=c1c3c3c27545653737f2865ef193d04ef8f44b55;hb=03f524c591c90120302e127cd0c1adba4c498806;hpb=27619830d428693b4871ce58770705b30ba84c99 diff --git a/src/material.cpp b/src/material.cpp index c1c3c3c2..845519bc 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -23,7 +23,6 @@ //// #include -#include #include #include @@ -37,6 +36,7 @@ using std::string; namespace { + // Values modified by Joona Kiiski const Value BishopPairMidgameBonus = Value(109); const Value BishopPairEndgameBonus = Value(97); @@ -93,7 +93,6 @@ MaterialInfoTable::MaterialInfoTable(unsigned int numOfEntries) { << " bytes for material hash table." << std::endl; Application::exit_with_failure(); } - clear(); } @@ -101,17 +100,8 @@ MaterialInfoTable::MaterialInfoTable(unsigned int numOfEntries) { MaterialInfoTable::~MaterialInfoTable() { - delete [] entries; delete funcs; -} - - -/// MaterialInfoTable::clear() clears a material hash table by setting -/// all entries to 0. - -void MaterialInfoTable::clear() { - - memset(entries, 0, size * sizeof(MaterialInfo)); + delete [] entries; } @@ -153,14 +143,14 @@ MaterialInfo* MaterialInfoTable::get_material_info(const Position& pos) { else if ( pos.non_pawn_material(BLACK) == Value(0) && pos.piece_count(BLACK, PAWN) == 0 - && pos.non_pawn_material(WHITE) >= RookValueEndgame) + && pos.non_pawn_material(WHITE) >= RookValueMidgame) { mi->evaluationFunction = &EvaluateKXK; return mi; } else if ( pos.non_pawn_material(WHITE) == Value(0) && pos.piece_count(WHITE, PAWN) == 0 - && pos.non_pawn_material(BLACK) >= RookValueEndgame) + && pos.non_pawn_material(BLACK) >= RookValueMidgame) { mi->evaluationFunction = &EvaluateKKX; return mi;