From a1b62d68ec59aae504a9e39bfd3a7dfa4a831d29 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Tue, 30 Sep 2014 09:05:20 +0200 Subject: [PATCH 1/1] Trivial code style fixes Mainly to sync mine and official repo. No functional change. --- src/bitboard.h | 1 + src/evaluate.cpp | 4 ++-- src/position.cpp | 2 +- src/search.cpp | 1 + src/tt.h | 3 +-- src/ucioption.cpp | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/bitboard.h b/src/bitboard.h index 7330a199..6a1755b6 100644 --- a/src/bitboard.h +++ b/src/bitboard.h @@ -22,6 +22,7 @@ #define BITBOARD_H_INCLUDED #include + #include "types.h" namespace Bitboards { diff --git a/src/evaluate.cpp b/src/evaluate.cpp index ce98af6f..7892f315 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -507,7 +507,7 @@ namespace { & ei.attackedBy[Them][PAWN] & (ei.attackedBy[Us][KNIGHT] | ei.attackedBy[Us][BISHOP]); - if(protectedEnemies) + if (protectedEnemies) score += Threat[Minor][type_of(pos.piece_on(lsb(protectedEnemies)))]; // Enemies not defended by a pawn and under our attack @@ -608,7 +608,7 @@ namespace { mbonus += k * rr, ebonus += k * rr; } - else if(pos.pieces(Us) & blockSq) + else if (pos.pieces(Us) & blockSq) mbonus += rr * 3 + r * 2 + 3, ebonus += rr + r * 2; } // rr != 0 diff --git a/src/position.cpp b/src/position.cpp index db4c857b..b00bda24 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -25,12 +25,12 @@ #include "bitcount.h" #include "movegen.h" +#include "notation.h" #include "position.h" #include "psqtab.h" #include "rkiss.h" #include "thread.h" #include "tt.h" -#include "notation.h" using std::string; diff --git a/src/search.cpp b/src/search.cpp index 1317fc23..152de13c 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -126,6 +126,7 @@ void Search::init() { { double pvRed = 0.00 + log(double(hd)) * log(double(mc)) / 3.00; double nonPVRed = 0.33 + log(double(hd)) * log(double(mc)) / 2.25; + Reductions[1][1][hd][mc] = int8_t( pvRed >= 1.0 ? pvRed + 0.5: 0); Reductions[0][1][hd][mc] = int8_t(nonPVRed >= 1.0 ? nonPVRed + 0.5: 0); diff --git a/src/tt.h b/src/tt.h index 30a93897..8ec09a7c 100644 --- a/src/tt.h +++ b/src/tt.h @@ -50,8 +50,8 @@ private: move16 = (uint16_t)m; value16 = (int16_t)v; evalValue = (int16_t)ev; + genBound8 = (uint8_t)(g | b); depth8 = (uint8_t)(d - DEPTH_NONE); - genBound8 = g | (uint8_t)b; } uint16_t key16; @@ -70,7 +70,6 @@ private: const unsigned TTClusterSize = 3; struct TTCluster { - TTEntry entry[TTClusterSize]; char padding[2]; }; diff --git a/src/ucioption.cpp b/src/ucioption.cpp index 59b50d3c..94a38896 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -55,7 +55,7 @@ bool CaseInsensitiveLess::operator() (const string& s1, const string& s2) const void init(OptionsMap& o) { o["Write Debug Log"] << Option(false, on_logger); - o["Contempt"] << Option(0, -100, 100); + o["Contempt"] << Option(0, -100, 100); o["Min Split Depth"] << Option(0, 0, 12, on_threads); o["Threads"] << Option(1, 1, MAX_THREADS, on_threads); o["Hash"] << Option(16, 1, 1024 * 1024, on_hash_size); -- 2.39.2