From 55604f156b2293e870984c6bb57c1954ad5a9517 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 26 Apr 2014 09:20:37 +0200 Subject: [PATCH] Fix issues detected by Coverity Scan Most of Coverity Scan reports are false positives, but in rare cases we have confirmed (very small) issues. No functional change. --- src/movepick.cpp | 2 ++ src/notation.cpp | 2 +- src/thread.h | 2 +- src/uci.cpp | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/movepick.cpp b/src/movepick.cpp index 3f0837d9..95172b94 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -283,6 +283,8 @@ void MovePicker::generate_next_stage() { case EVASION: case QSEARCH_0: case QSEARCH_1: case PROBCUT: case RECAPTURE: stage = STOP; + /* Fall through */ + case STOP: end = cur + 1; // Avoid another next_phase() call return; diff --git a/src/notation.cpp b/src/notation.cpp index 9893569c..944cca19 100644 --- a/src/notation.cpp +++ b/src/notation.cpp @@ -138,7 +138,7 @@ const string move_to_san(Position& pos, Move m) { } if (!others) - { /* disambiguation is not needed */ } + { /* Disambiguation is not needed */ } else if (!(others & file_bb(from))) san += to_char(file_of(from)); diff --git a/src/thread.h b/src/thread.h index 046980d2..44aa6883 100644 --- a/src/thread.h +++ b/src/thread.h @@ -91,7 +91,7 @@ struct SplitPoint { struct ThreadBase { - ThreadBase() : exit(false) {} + ThreadBase() : handle(NativeHandle()), exit(false) {} virtual ~ThreadBase() {} virtual void idle_loop() = 0; void notify_one(); diff --git a/src/uci.cpp b/src/uci.cpp index e4a4393c..af940ce0 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -188,7 +188,7 @@ void UCI::loop(int argc, char* argv[]) { << "position key: " << setw(16) << pos.key() << "\nmaterial key: " << setw(16) << pos.material_key() << "\npawn key: " << setw(16) << pos.pawn_key() - << dec << sync_endl; + << dec << nouppercase << setfill(' ') << sync_endl; else if (token == "uci") sync_cout << "id name " << engine_info(true) -- 2.39.2