]> git.sesse.net Git - stockfish/commitdiff
Fix issues detected by Coverity Scan
authorMarco Costalba <mcostalba@gmail.com>
Sat, 26 Apr 2014 07:20:37 +0000 (09:20 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 26 Apr 2014 07:33:50 +0000 (09:33 +0200)
Most of Coverity Scan reports are false
positives, but in rare cases we have
confirmed (very small) issues.

No functional change.

src/movepick.cpp
src/notation.cpp
src/thread.h
src/uci.cpp

index 3f0837d94db2f1d95843a65a6244a38df998909d..95172b944c13705182f6c1a7842deece827448e5 100644 (file)
@@ -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;
index 9893569c742378cd62a1c4bbc9d63bf86c4ea005..944cca19ea205064727c2617e4f698365029f764 100644 (file)
@@ -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));
index 046980d22a1dcc5753b19117ed864c9b03da38ee..44aa68835f892a56113f58de9a2a4f1d6ba6d2bd 100644 (file)
@@ -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();
index e4a4393cfe7280d4e3ef9bbfd77da6e86d9cba30..af940ce0634ff1d6f33330d098e7eb7fb9cc91b9 100644 (file)
@@ -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)