]> git.sesse.net Git - stockfish/blobdiff - src/nnue/evaluate_nnue.cpp
Fix compilation after recent merge.
[stockfish] / src / nnue / evaluate_nnue.cpp
index 679192d471047a96ea331786a54cbcdc83aa8dbc..e7339c10ae982be1200b0c519ecfab9c673eb074 100644 (file)
@@ -116,7 +116,7 @@ static bool read_header(std::istream& stream, std::uint32_t* hashValue, std::str
 static bool write_header(std::ostream& stream, std::uint32_t hashValue, const std::string& desc) {
     write_little_endian<std::uint32_t>(stream, Version);
     write_little_endian<std::uint32_t>(stream, hashValue);
-    write_little_endian<std::uint32_t>(stream, (std::uint32_t) desc.size());
+    write_little_endian<std::uint32_t>(stream, std::uint32_t(desc.size()));
     stream.write(&desc[0], desc.size());
     return !stream.fail();
 }
@@ -180,7 +180,7 @@ Value evaluate(const Position& pos, bool adjusted, int* complexity) {
     const auto positional = network[bucket]->propagate(transformedFeatures);
 
     if (complexity)
-        *complexity = abs(psqt - positional) / OutputScale;
+        *complexity = std::abs(psqt - positional) / OutputScale;
 
     // Give more value to positional evaluation when adjusted flag is set
     if (adjusted)
@@ -233,7 +233,7 @@ static NnueEvalTrace trace_evaluate(const Position& pos) {
 constexpr std::string_view PieceToChar(" PNBRQK  pnbrqk");
 
 
-// format_cp_compact() converts a Value into (centi)pawns and writes it in a buffer.
+// Converts a Value into (centi)pawns and writes it in a buffer.
 // The buffer must have capacity for at least 5 chars.
 static void format_cp_compact(Value v, char* buffer) {
 
@@ -270,7 +270,7 @@ static void format_cp_compact(Value v, char* buffer) {
 }
 
 
-// format_cp_aligned_dot() converts a Value into pawns, always keeping two decimals
+// Converts a Value into pawns, always keeping two decimals
 static void format_cp_aligned_dot(Value v, std::stringstream& stream) {
 
     const double pawns = std::abs(0.01 * UCI::to_cp(v));
@@ -282,7 +282,7 @@ static void format_cp_aligned_dot(Value v, std::stringstream& stream) {
 }
 
 
-// trace() returns a string with the value of each piece on a board,
+// Returns a string with the value of each piece on a board,
 // and a table for (PSQT, Layers) values bucket by bucket.
 std::string trace(Position& pos) {
 
@@ -407,8 +407,8 @@ bool save_eval(const std::optional<std::string>& filename) {
     {
         if (currentEvalFileName != EvalFileDefaultName)
         {
-            msg =
-              "Failed to export a net. A non-embedded net can only be saved if the filename is specified";
+            msg = "Failed to export a net. "
+                  "A non-embedded net can only be saved if the filename is specified";
 
             sync_cout << msg << sync_endl;
             return false;