1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 08:43:09 +00:00

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 <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2010-04-11 17:03:03 +01:00
parent e81108a855
commit a4a0ffce71
10 changed files with 16 additions and 17 deletions

View file

@ -961,7 +961,7 @@ namespace {
qsq = relative_square(Us, make_square(square_file(s), RANK_8)); qsq = relative_square(Us, make_square(square_file(s), RANK_8));
d = square_distance(s, qsq) d = square_distance(s, qsq)
- square_distance(theirKingSq, qsq) - square_distance(theirKingSq, qsq)
+ (Us != pos.side_to_move()); + int(Us != pos.side_to_move());
if (d < 0) if (d < 0)
{ {

View file

@ -101,11 +101,11 @@ inline void sort_moves(T* firstMove, T* lastMove, T** lastPositive)
// Split positives vs non-positives // Split positives vs non-positives
do { 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; tmp = *p;
*p = *d; *p = *d;

View 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();
} }

View file

@ -61,11 +61,11 @@ private:
const Position& pos; const Position& pos;
const History& H; const History& H;
Bitboard pinned;
MoveStack ttMoves[2], killers[2]; MoveStack ttMoves[2], killers[2];
int badCaptureThreshold, phase; int badCaptureThreshold, phase;
const uint8_t* phasePtr; const uint8_t* phasePtr;
MoveStack *curMove, *lastMove, *lastGoodNonCapture, *lastBadCapture; MoveStack *curMove, *lastMove, *lastGoodNonCapture, *lastBadCapture;
Bitboard pinned;
MoveStack moves[256], badCaptures[64]; MoveStack moves[256], badCaptures[64];
}; };

View file

@ -64,10 +64,10 @@ private:
Key key; Key key;
Bitboard passedPawns; Bitboard passedPawns;
Bitboard pawnAttacks[2]; Bitboard pawnAttacks[2];
Square kingSquares[2];
Score value; Score value;
int16_t ksStormValue[2], qsStormValue[2]; int16_t ksStormValue[2], qsStormValue[2];
uint8_t halfOpenFiles[2]; uint8_t halfOpenFiles[2];
Square kingSquares[2];
uint8_t kingShelters[2]; uint8_t kingShelters[2];
}; };

View 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) {

View file

@ -70,9 +70,9 @@ struct CheckInfo {
CheckInfo(const Position&); CheckInfo(const Position&);
Square ksq;
Bitboard dcCandidates; Bitboard dcCandidates;
Bitboard checkSq[8]; 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; Score value;
Value npMaterial[2]; Value npMaterial[2];
Key key;
PieceType capture; PieceType capture;
Key key;
Bitboard checkersBB; Bitboard checkersBB;
StateInfo* previous; StateInfo* previous;
}; };
@ -329,8 +329,8 @@ private:
int gamePly; int gamePly;
Key history[MaxGameLength]; Key history[MaxGameLength];
int castleRightsMask[64]; int castleRightsMask[64];
File initialKFile, initialKRFile, initialQRFile;
StateInfo startState; StateInfo startState;
File initialKFile, initialKRFile, initialQRFile;
StateInfo* st; StateInfo* st;
// Static variables // 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 { inline Square Position::piece_list(Color c, PieceType pt, int idx) const {
return pieceList[c][pt][index]; 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 {

View 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;
} }

View file

@ -51,9 +51,8 @@ struct SplitPoint {
// Const data after splitPoint has been setup // Const data after splitPoint has been setup
SplitPoint* parent; SplitPoint* parent;
const Position* pos; const Position* pos;
bool pvNode;
Depth depth; Depth depth;
bool mateThreat; bool pvNode, mateThreat;
Value beta; Value beta;
int ply, master, slaves[MAX_THREADS]; int ply, master, slaves[MAX_THREADS];
SearchStack sstack[MAX_THREADS][PLY_MAX_PLUS_2]; SearchStack sstack[MAX_THREADS][PLY_MAX_PLUS_2];

View file

@ -42,7 +42,7 @@ enum ValueType {
VALUE_TYPE_EV_UP = VALUE_TYPE_EVAL | VALUE_TYPE_UPPER, VALUE_TYPE_EV_UP = VALUE_TYPE_EVAL | VALUE_TYPE_UPPER,
VALUE_TYPE_EV_LO = VALUE_TYPE_EVAL | VALUE_TYPE_LOWER, 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
}; };