Remove some useless casts

No functional change.
This commit is contained in:
Marco Costalba
2014-04-27 11:40:44 +02:00
parent c9e396b542
commit 86c20416c8
6 changed files with 10 additions and 10 deletions

View File

@@ -915,12 +915,12 @@ namespace Eval {
Weights[KingDangerUs] = weight_option("Cowardice", "Cowardice", WeightsInternal[KingDangerUs]); Weights[KingDangerUs] = weight_option("Cowardice", "Cowardice", WeightsInternal[KingDangerUs]);
Weights[KingDangerThem] = weight_option("Aggressiveness", "Aggressiveness", WeightsInternal[KingDangerThem]); Weights[KingDangerThem] = weight_option("Aggressiveness", "Aggressiveness", WeightsInternal[KingDangerThem]);
const int MaxSlope = 30; const double MaxSlope = 30;
const int Peak = 1280; const double Peak = 1280;
for (int t = 0, i = 1; i < 100; ++i) for (int t = 0, i = 1; i < 100; ++i)
{ {
t = std::min(Peak, std::min(int(0.4 * i * i), t + MaxSlope)); t = std::min(Peak, std::min(0.4 * i * i, t + MaxSlope));
KingDanger[1][i] = apply_weight(make_score(t, 0), Weights[KingDangerUs]); KingDanger[1][i] = apply_weight(make_score(t, 0), Weights[KingDangerUs]);
KingDanger[0][i] = apply_weight(make_score(t, 0), Weights[KingDangerThem]); KingDanger[0][i] = apply_weight(make_score(t, 0), Weights[KingDangerThem]);

View File

@@ -43,7 +43,7 @@ string score_to_uci(Value v, Value alpha, Value beta) {
stringstream ss; stringstream ss;
if (abs(v) < VALUE_MATE_IN_MAX_PLY) if (abs(v) < VALUE_MATE_IN_MAX_PLY)
ss << "cp " << v * 100 / int(PawnValueEg); ss << "cp " << v * 100 / PawnValueEg;
else else
ss << "mate " << (v > 0 ? VALUE_MATE - v + 1 : -VALUE_MATE - v) / 2; ss << "mate " << (v > 0 ? VALUE_MATE - v + 1 : -VALUE_MATE - v) / 2;

View File

@@ -297,7 +297,7 @@ void Position::set(const string& fenStr, bool isChess960, Thread* th) {
// Convert from fullmove starting from 1 to ply starting from 0, // Convert from fullmove starting from 1 to ply starting from 0,
// handle also common incorrect FEN with fullmove = 0. // handle also common incorrect FEN with fullmove = 0.
gamePly = std::max(2 * (gamePly - 1), 0) + int(sideToMove == BLACK); gamePly = std::max(2 * (gamePly - 1), 0) + (sideToMove == BLACK);
chess960 = isChess960; chess960 = isChess960;
thisThread = th; thisThread = th;
@@ -424,7 +424,7 @@ const string Position::fen() const {
ss << '-'; ss << '-';
ss << (ep_square() == SQ_NONE ? " - " : " " + to_string(ep_square()) + " ") ss << (ep_square() == SQ_NONE ? " - " : " " + to_string(ep_square()) + " ")
<< st->rule50 << " " << 1 + (gamePly - int(sideToMove == BLACK)) / 2; << st->rule50 << " " << 1 + (gamePly - (sideToMove == BLACK)) / 2;
return ss.str(); return ss.str();
} }

View File

@@ -146,8 +146,8 @@ void Search::init() {
// Init futility move count array // Init futility move count array
for (d = 0; d < 32; ++d) for (d = 0; d < 32; ++d)
{ {
FutilityMoveCounts[0][d] = int(2.4 + 0.222 * pow(d + 0.00, 1.8)); FutilityMoveCounts[0][d] = 2.4 + 0.222 * pow(d + 0.00, 1.8);
FutilityMoveCounts[1][d] = int(3.0 + 0.300 * pow(d + 0.98, 1.8)); FutilityMoveCounts[1][d] = 3.0 + 0.300 * pow(d + 0.98, 1.8);
} }
} }

View File

@@ -63,7 +63,7 @@ namespace {
double ratio1 = (TMaxRatio * thisMoveImportance) / (TMaxRatio * thisMoveImportance + otherMovesImportance); double ratio1 = (TMaxRatio * thisMoveImportance) / (TMaxRatio * thisMoveImportance + otherMovesImportance);
double ratio2 = (thisMoveImportance + TStealRatio * otherMovesImportance) / (thisMoveImportance + otherMovesImportance); double ratio2 = (thisMoveImportance + TStealRatio * otherMovesImportance) / (thisMoveImportance + otherMovesImportance);
return int(floor(myTime * std::min(ratio1, ratio2))); return floor(myTime * std::min(ratio1, ratio2));
} }
} // namespace } // namespace

View File

@@ -27,7 +27,7 @@ class TimeManager {
public: public:
void init(const Search::LimitsType& limits, int currentPly, Color us); void init(const Search::LimitsType& limits, int currentPly, Color us);
void pv_instability(double bestMoveChanges) { unstablePvFactor = 1 + bestMoveChanges; } void pv_instability(double bestMoveChanges) { unstablePvFactor = 1 + bestMoveChanges; }
int available_time() const { return int(optimumSearchTime * unstablePvFactor * 0.71); } int available_time() const { return optimumSearchTime * unstablePvFactor * 0.71; }
int maximum_time() const { return maximumSearchTime; } int maximum_time() const { return maximumSearchTime; }
private: private: