]> git.sesse.net Git - stockfish/commitdiff
Fix some warnings under +w1 HP-UX compile
authorMarco Costalba <mcostalba@gmail.com>
Sun, 11 Apr 2010 16:03:03 +0000 (17:03 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 11 Apr 2010 16:03:03 +0000 (17:03 +0100)
This is the world's fussiest compiler with +w1

Warnings reported by Richard Lloyd.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/evaluate.cpp
src/move.h
src/movepick.cpp
src/movepick.h
src/pawns.h
src/piece.cpp
src/position.h
src/search.cpp
src/thread.h
src/value.h

index 503bed29e6806712769ce4855a84664e566c96dc..2f8e63e5125e7a8f8feb67a90ec1acbb27f74e83 100644 (file)
@@ -961,7 +961,7 @@ namespace {
             qsq = relative_square(Us, make_square(square_file(s), RANK_8));
             d =  square_distance(s, qsq)
                - square_distance(theirKingSq, qsq)
             qsq = relative_square(Us, make_square(square_file(s), RANK_8));
             d =  square_distance(s, qsq)
                - square_distance(theirKingSq, qsq)
-               + (Us != pos.side_to_move());
+               + int(Us != pos.side_to_move());
 
             if (d < 0)
             {
 
             if (d < 0)
             {
index 0eb7b18b4cc97d8653bba9517d2db40dd7727d5d..765328713a7201d4a49770752b5fe86b805d8693 100644 (file)
@@ -101,11 +101,11 @@ inline void sort_moves(T* firstMove, T* lastMove, T** lastPositive)
 
     // Split positives vs non-positives
     do {
 
     // Split positives vs non-positives
     do {
-        while ((++p)->score > 0);
+        while ((++p)->score > 0) {}
 
         if (p != d)
         {
 
         if (p != d)
         {
-            while (--d != p && d->score <= 0);
+            while (--d != p && d->score <= 0) {}
 
             tmp = *p;
             *p = *d;
 
             tmp = *p;
             *p = *d;
index 10835e6872e832a06d36e51e77f22c93757c2d64..19785b64ab027606e138a44da71c16f8d12442b7 100644 (file)
@@ -111,7 +111,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d,
           searchTT = ttMoves[0].move = MOVE_NONE;
   }
 
           searchTT = ttMoves[0].move = MOVE_NONE;
   }
 
-  phasePtr += !searchTT - 1;
+  phasePtr += int(!searchTT) - 1;
   go_next_phase();
 }
 
   go_next_phase();
 }
 
index ebb78787702a9d0b9c3538aedb978e8d99118126..f989121f378f474551227f7c173d6ec3d3cc9a98 100644 (file)
@@ -61,11 +61,11 @@ private:
 
   const Position& pos;
   const History& H;
 
   const Position& pos;
   const History& H;
+  Bitboard pinned;
   MoveStack ttMoves[2], killers[2];
   int badCaptureThreshold, phase;
   const uint8_t* phasePtr;
   MoveStack *curMove, *lastMove, *lastGoodNonCapture, *lastBadCapture;
   MoveStack ttMoves[2], killers[2];
   int badCaptureThreshold, phase;
   const uint8_t* phasePtr;
   MoveStack *curMove, *lastMove, *lastGoodNonCapture, *lastBadCapture;
-  Bitboard pinned;
   MoveStack moves[256], badCaptures[64];
 };
 
   MoveStack moves[256], badCaptures[64];
 };
 
index 528bc873fd98b443f562434955c5600e40d2bd01..2dc866848aa0cc3adb210ec24ef528caa7fdcc7f 100644 (file)
@@ -64,10 +64,10 @@ private:
   Key key;
   Bitboard passedPawns;
   Bitboard pawnAttacks[2];
   Key key;
   Bitboard passedPawns;
   Bitboard pawnAttacks[2];
+  Square kingSquares[2];
   Score value;
   int16_t ksStormValue[2], qsStormValue[2];
   uint8_t halfOpenFiles[2];
   Score value;
   int16_t ksStormValue[2], qsStormValue[2];
   uint8_t halfOpenFiles[2];
-  Square kingSquares[2];
   uint8_t kingShelters[2];
 };
 
   uint8_t kingShelters[2];
 };
 
index 1fdc4dbea4e7493ace1723e873c3d9ca975e4597..b287994975cbd5360d8f531758fa82931e4cb96b 100644 (file)
@@ -38,7 +38,7 @@ static const string PieceChars(" pnbrqk PNBRQK");
 
 char piece_type_to_char(PieceType pt, bool upcase) {
 
 
 char piece_type_to_char(PieceType pt, bool upcase) {
 
-  return PieceChars[pt + upcase * 7];
+  return PieceChars[pt + int(upcase) * 7];
 }
 
 PieceType piece_type_from_char(char c) {
 }
 
 PieceType piece_type_from_char(char c) {
index 71f821b2b3183144849d200242b4250743d71f57..0aac1c36609a19c5dcaba5e9e0f739209c9c4bdf 100644 (file)
@@ -70,9 +70,9 @@ struct CheckInfo {
 
     CheckInfo(const Position&);
 
 
     CheckInfo(const Position&);
 
-    Square ksq;
     Bitboard dcCandidates;
     Bitboard checkSq[8];
     Bitboard dcCandidates;
     Bitboard checkSq[8];
+    Square ksq;
 };
 
 /// Castle rights, encoded as bit fields
 };
 
 /// Castle rights, encoded as bit fields
@@ -105,8 +105,8 @@ struct StateInfo {
   Score value;
   Value npMaterial[2];
 
   Score value;
   Value npMaterial[2];
 
-  Key key;
   PieceType capture;
   PieceType capture;
+  Key key;
   Bitboard checkersBB;
   StateInfo* previous;
 };
   Bitboard checkersBB;
   StateInfo* previous;
 };
@@ -329,8 +329,8 @@ private:
   int gamePly;
   Key history[MaxGameLength];
   int castleRightsMask[64];
   int gamePly;
   Key history[MaxGameLength];
   int castleRightsMask[64];
-  File initialKFile, initialKRFile, initialQRFile;
   StateInfo startState;
   StateInfo startState;
+  File initialKFile, initialKRFile, initialQRFile;
   StateInfo* st;
 
   // Static variables
   StateInfo* st;
 
   // Static variables
@@ -412,8 +412,8 @@ inline int Position::piece_count(Color c, PieceType pt) const {
   return pieceCount[c][pt];
 }
 
   return pieceCount[c][pt];
 }
 
-inline Square Position::piece_list(Color c, PieceType pt, int index) const {
-  return pieceList[c][pt][index];
+inline Square Position::piece_list(Color c, PieceType pt, int idx) const {
+  return pieceList[c][pt][idx];
 }
 
 inline const Square* Position::piece_list_begin(Color c, PieceType pt) const {
 }
 
 inline const Square* Position::piece_list_begin(Color c, PieceType pt) const {
index 79813013d989408a123d2177ce26a611482fd10b..efdb287fa740a3325c73771f6b43492345b5dd5e 100644 (file)
@@ -2774,7 +2774,7 @@ namespace {
         }
 
         // Wait until the thread has finished launching and is gone to sleep
         }
 
         // Wait until the thread has finished launching and is gone to sleep
-        while (threads[i].state != THREAD_SLEEPING);
+        while (threads[i].state != THREAD_SLEEPING) {}
     }
   }
 
     }
   }
 
@@ -2815,7 +2815,7 @@ namespace {
 
     SplitPoint* sp;
 
 
     SplitPoint* sp;
 
-    for (sp = threads[threadID].splitPoint; sp && !sp->stopRequest; sp = sp->parent);
+    for (sp = threads[threadID].splitPoint; sp && !sp->stopRequest; sp = sp->parent) {}
     return sp != NULL;
   }
 
     return sp != NULL;
   }
 
index 869778401585bac199b98a1a39f28d82ca218d10..87b78136f5c7851b992327cdc03d65205c7becc2 100644 (file)
@@ -51,9 +51,8 @@ struct SplitPoint {
   // Const data after splitPoint has been setup
   SplitPoint* parent;
   const Position* pos;
   // Const data after splitPoint has been setup
   SplitPoint* parent;
   const Position* pos;
-  bool pvNode;
   Depth depth;
   Depth depth;
-  bool mateThreat;
+  bool pvNode, mateThreat;
   Value beta;
   int ply, master, slaves[MAX_THREADS];
   SearchStack sstack[MAX_THREADS][PLY_MAX_PLUS_2];
   Value beta;
   int ply, master, slaves[MAX_THREADS];
   SearchStack sstack[MAX_THREADS][PLY_MAX_PLUS_2];
index 4b62027267847592c63ef4a50895dc5b292625e4..dd2c39412267b94efa9d065fd5ade03b830dc5d2 100644 (file)
@@ -42,7 +42,7 @@ enum ValueType {
 
   VALUE_TYPE_EV_UP = VALUE_TYPE_EVAL | VALUE_TYPE_UPPER,
   VALUE_TYPE_EV_LO = VALUE_TYPE_EVAL | VALUE_TYPE_LOWER,
 
   VALUE_TYPE_EV_UP = VALUE_TYPE_EVAL | VALUE_TYPE_UPPER,
   VALUE_TYPE_EV_LO = VALUE_TYPE_EVAL | VALUE_TYPE_LOWER,
-  VALUE_TYPE_NS_LO = VALUE_TYPE_NULL | VALUE_TYPE_LOWER,
+  VALUE_TYPE_NS_LO = VALUE_TYPE_NULL | VALUE_TYPE_LOWER
 };
 
 
 };