From: Marco Costalba Date: Sun, 15 Mar 2009 17:07:28 +0000 (+0100) Subject: Silence a good bunch of Intel warnings X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=b870f5a091793ea423de78e74f5652b9307cfcbd Silence a good bunch of Intel warnings Note that some pawns and material info has been switched to int from int8_t. This is a waste of space but it is not clear if we have a faster or slower code (or nothing changed), some test should be needed. Few warnings still are alive. Signed-off-by: Marco Costalba --- diff --git a/src/bitbase.cpp b/src/bitbase.cpp index 36e93eea..75376d33 100644 --- a/src/bitbase.cpp +++ b/src/bitbase.cpp @@ -89,7 +89,7 @@ void generate_kpk_bitbase(uint8_t bitbase[]) { int i, j, b; for(i = 0; i < 24576; i++) { for(b = 0, j = 0; j < 8; b |= (compress_result(Bitbase[8*i+j]) << j), j++); - bitbase[i] = b; + bitbase[i] = (uint8_t)b; } // Release allocated memory: diff --git a/src/evaluate.cpp b/src/evaluate.cpp index f654b515..c22b5913 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -490,7 +490,7 @@ void init_eval(int threads) { } for (Bitboard b = 0ULL; b < 256ULL; b++) - BitCount8Bit[b] = count_1s(b); + BitCount8Bit[b] = (uint8_t)count_1s(b); } diff --git a/src/material.h b/src/material.h index 7ba3b7de..bd418315 100644 --- a/src/material.h +++ b/src/material.h @@ -65,7 +65,7 @@ private: uint8_t factor[2]; EndgameEvaluationFunctionBase* evaluationFunction; EndgameScalingFunctionBase* scalingFunction[2]; - uint8_t spaceWeight; + int spaceWeight; }; diff --git a/src/position.cpp b/src/position.cpp index 45be5df3..b8f7807b 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1854,15 +1854,14 @@ Value Position::compute_value() const { Value Position::compute_non_pawn_material(Color c) const { Value result = Value(0); - Square s; for (PieceType pt = KNIGHT; pt <= QUEEN; pt++) { Bitboard b = pieces_of_color_and_type(c, pt); - while(b) + while (b) { - s = pop_1st_bit(&b); - assert(piece_on(s) == piece_of_color_and_type(c, pt)); + assert(piece_on(first_1(b)) == piece_of_color_and_type(c, pt)); + pop_1st_bit(&b); result += piece_value_midgame(pt); } } diff --git a/src/search.cpp b/src/search.cpp index 549f19e2..03c566eb 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -193,7 +193,6 @@ namespace { // Iteration counters int Iteration; - bool LastIterations; BetaCounterType BetaCounter; // Scores and number of times the best move changed for each iteration: @@ -207,7 +206,7 @@ namespace { int SearchStartTime; int MaxNodes, MaxDepth; int MaxSearchTime, AbsoluteMaxSearchTime, ExtraSearchTime; - Move BestRootMove, PonderMove, EasyMove; + Move EasyMove; int RootMoveNumber; bool InfiniteSearch; bool PonderSearch; @@ -369,8 +368,6 @@ void think(const Position &pos, bool infinite, bool ponder, int side_to_move, // Initialize global search variables Idle = false; SearchStartTime = get_system_time(); - BestRootMove = MOVE_NONE; - PonderMove = MOVE_NONE; EasyMove = MOVE_NONE; for (int i = 0; i < THREAD_MAX; i++) { @@ -661,7 +658,6 @@ namespace { ValueByIteration[0] = Value(0); ValueByIteration[1] = rml.get_move_score(0); Iteration = 1; - LastIterations = false; EasyMove = rml.scan_for_easy_move(); @@ -716,9 +712,6 @@ namespace { ExtraSearchTime = BestMoveChangesByIteration[Iteration] * (MaxSearchTime / 2) + BestMoveChangesByIteration[Iteration-1] * (MaxSearchTime / 3); - // Try to guess if the current iteration is the last one or the last two - LastIterations = (current_search_time() > ((MaxSearchTime + ExtraSearchTime)*58) / 128); - // Stop search if most of MaxSearchTime is consumed at the end of the // iteration. We probably don't have enough time to search the first // move at the next iteration anyway. diff --git a/src/tt.cpp b/src/tt.cpp index 8911e171..185410e6 100644 --- a/src/tt.cpp +++ b/src/tt.cpp @@ -207,4 +207,4 @@ TTEntry::TTEntry() { TTEntry::TTEntry(Key k, Value v, ValueType t, Depth d, Move m, int generation) : key_ (k), data((m & 0x7FFFF) | (t << 20) | (generation << 23)), - value_(v), depth_(int16_t(d)) {} + value_(int16_t(v)), depth_(int16_t(d)) {}