X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Ftypes.h;h=c21b55be4f4c992d9b23c5eff77c051b884f1318;hp=dae86db310d6d80bc715e99c7aafd9ca482225e4;hb=bc02cc0c8afdc9c7f6588c28a3ad859a5fc3e5a5;hpb=481eda4ca0121cfa16f5a29f364ca30ee2852409 diff --git a/src/types.h b/src/types.h index dae86db3..c21b55be 100644 --- a/src/types.h +++ b/src/types.h @@ -213,7 +213,7 @@ enum Depth { DEPTH_ZERO = 0 * ONE_PLY, DEPTH_QS_CHECKS = -1 * ONE_PLY, DEPTH_QS_NO_CHECKS = -2 * ONE_PLY, - DEPTH_QS_RECAPTURES = -5 * ONE_PLY, + DEPTH_QS_RECAPTURES = -7 * ONE_PLY, DEPTH_NONE = -127 * ONE_PLY }; @@ -268,7 +268,7 @@ inline Score make_score(int mg, int eg) { return Score((mg << 16) + eg); } /// Extracting the signed lower and upper 16 bits it not so trivial because /// according to the standard a simple cast to short is implementation defined /// and so is a right shift of a signed integer. -inline Value mg_value(Score s) { return Value(((s + 32768) & ~0xffff) / 0x10000); } +inline Value mg_value(Score s) { return Value(((s + 0x8000) & ~0xffff) / 0x10000); } /// On Intel 64 bit we have a small speed regression with the standard conforming /// version, so use a faster code in this case that, although not 100% standard @@ -325,12 +325,6 @@ inline Score operator/(Score s, int i) { return make_score(mg_value(s) / i, eg_value(s) / i); } -/// Weight score v by score w trying to prevent overflow -inline Score apply_weight(Score v, Score w) { - return make_score((int(mg_value(v)) * mg_value(w)) / 0x100, - (int(eg_value(v)) * eg_value(w)) / 0x100); -} - #undef ENABLE_OPERATORS_ON #undef ENABLE_SAFE_OPERATORS_ON