From a4a0ffce711962c0b04b35998c3c06491be373bf Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sun, 11 Apr 2010 17:03:03 +0100 Subject: [PATCH] Fix some warnings under +w1 HP-UX compile This is the world's fussiest compiler with +w1 Warnings reported by Richard Lloyd. No functional change. Signed-off-by: Marco Costalba --- src/evaluate.cpp | 2 +- src/move.h | 4 ++-- src/movepick.cpp | 2 +- src/movepick.h | 2 +- src/pawns.h | 2 +- src/piece.cpp | 2 +- src/position.h | 10 +++++----- src/search.cpp | 4 ++-- src/thread.h | 3 +-- src/value.h | 2 +- 10 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 503bed29..2f8e63e5 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -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) - + (Us != pos.side_to_move()); + + int(Us != pos.side_to_move()); if (d < 0) { diff --git a/src/move.h b/src/move.h index 0eb7b18b..76532871 100644 --- a/src/move.h +++ b/src/move.h @@ -101,11 +101,11 @@ inline void sort_moves(T* firstMove, T* lastMove, T** lastPositive) // Split positives vs non-positives do { - while ((++p)->score > 0); + while ((++p)->score > 0) {} if (p != d) { - while (--d != p && d->score <= 0); + while (--d != p && d->score <= 0) {} tmp = *p; *p = *d; diff --git a/src/movepick.cpp b/src/movepick.cpp index 10835e68..19785b64 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -111,7 +111,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, searchTT = ttMoves[0].move = MOVE_NONE; } - phasePtr += !searchTT - 1; + phasePtr += int(!searchTT) - 1; go_next_phase(); } diff --git a/src/movepick.h b/src/movepick.h index ebb78787..f989121f 100644 --- a/src/movepick.h +++ b/src/movepick.h @@ -61,11 +61,11 @@ private: 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; - Bitboard pinned; MoveStack moves[256], badCaptures[64]; }; diff --git a/src/pawns.h b/src/pawns.h index 528bc873..2dc86684 100644 --- a/src/pawns.h +++ b/src/pawns.h @@ -64,10 +64,10 @@ private: Key key; Bitboard passedPawns; Bitboard pawnAttacks[2]; + Square kingSquares[2]; Score value; int16_t ksStormValue[2], qsStormValue[2]; uint8_t halfOpenFiles[2]; - Square kingSquares[2]; uint8_t kingShelters[2]; }; diff --git a/src/piece.cpp b/src/piece.cpp index 1fdc4dbe..b2879949 100644 --- a/src/piece.cpp +++ b/src/piece.cpp @@ -38,7 +38,7 @@ static const string PieceChars(" pnbrqk PNBRQK"); 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) { diff --git a/src/position.h b/src/position.h index 71f821b2..0aac1c36 100644 --- a/src/position.h +++ b/src/position.h @@ -70,9 +70,9 @@ struct CheckInfo { CheckInfo(const Position&); - Square ksq; Bitboard dcCandidates; Bitboard checkSq[8]; + Square ksq; }; /// Castle rights, encoded as bit fields @@ -105,8 +105,8 @@ struct StateInfo { Score value; Value npMaterial[2]; - Key key; PieceType capture; + Key key; Bitboard checkersBB; StateInfo* previous; }; @@ -329,8 +329,8 @@ private: int gamePly; Key history[MaxGameLength]; int castleRightsMask[64]; - File initialKFile, initialKRFile, initialQRFile; StateInfo startState; + File initialKFile, initialKRFile, initialQRFile; StateInfo* st; // Static variables @@ -412,8 +412,8 @@ inline int Position::piece_count(Color c, PieceType pt) const { 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 { diff --git a/src/search.cpp b/src/search.cpp index 79813013..efdb287f 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -2774,7 +2774,7 @@ namespace { } // 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; - 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; } diff --git a/src/thread.h b/src/thread.h index 86977840..87b78136 100644 --- a/src/thread.h +++ b/src/thread.h @@ -51,9 +51,8 @@ struct SplitPoint { // Const data after splitPoint has been setup SplitPoint* parent; const Position* pos; - bool pvNode; Depth depth; - bool mateThreat; + bool pvNode, mateThreat; Value beta; int ply, master, slaves[MAX_THREADS]; SearchStack sstack[MAX_THREADS][PLY_MAX_PLUS_2]; diff --git a/src/value.h b/src/value.h index 4b620272..dd2c3941 100644 --- a/src/value.h +++ b/src/value.h @@ -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_NS_LO = VALUE_TYPE_NULL | VALUE_TYPE_LOWER, + VALUE_TYPE_NS_LO = VALUE_TYPE_NULL | VALUE_TYPE_LOWER }; -- 2.39.2