X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=86e5999f85cfe49fd899ee38ae34a2a5fd4309cb;hp=07a1e2102abd7a923ddbc0bbb98a055ada85ea19;hb=512a4e4ff044aeddebc0df42b7fbabb365f9a22d;hpb=000a975eafc9f509f16ebb75f3dc2c655adf84b1 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 07a1e210..86e5999f 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -253,8 +253,8 @@ namespace { // Pawn and material hash tables, indexed by the current thread id. // Note that they will be initialized at 0 being global variables. - MaterialInfoTable* MaterialTable[THREAD_MAX]; - PawnInfoTable* PawnTable[THREAD_MAX]; + MaterialInfoTable* MaterialTable[MAX_THREADS]; + PawnInfoTable* PawnTable[MAX_THREADS]; // Sizes of pawn and material hash tables const int PawnTableSize = 16384; @@ -305,7 +305,7 @@ template Value do_evaluate(const Position& pos, EvalInfo& ei, int threadID) { assert(pos.is_ok()); - assert(threadID >= 0 && threadID < THREAD_MAX); + assert(threadID >= 0 && threadID < MAX_THREADS); assert(!pos.is_check()); memset(&ei, 0, sizeof(EvalInfo)); @@ -440,9 +440,9 @@ Value do_evaluate(const Position& pos, EvalInfo& ei, int threadID) { void init_eval(int threads) { - assert(threads <= THREAD_MAX); + assert(threads <= MAX_THREADS); - for (int i = 0; i < THREAD_MAX; i++) + for (int i = 0; i < MAX_THREADS; i++) { if (i >= threads) { @@ -464,7 +464,7 @@ void init_eval(int threads) { void quit_eval() { - for (int i = 0; i < THREAD_MAX; i++) + for (int i = 0; i < MAX_THREADS; i++) { delete PawnTable[i]; delete MaterialTable[i]; @@ -860,11 +860,8 @@ namespace { // capturing a single attacking piece can therefore result in a score // change far bigger than the value of the captured piece. Score v = apply_weight(make_score(SafetyTable[attackUnits], 0), WeightKingSafety[Us]); - ei.value -= Sign[Us] * v; - - if (Us == pos.side_to_move()) - ei.futilityMargin += mg_value(v); + ei.futilityMargin[Us] += mg_value(v); } }