remove blank line between function and it's description

- remove the blank line between the declaration of the function and it's
  comment, leads to better IDE support when hovering over a function to see it's
  description
- remove the unnecessary duplication of the function name in the functions
  description
- slightly refactored code for lsb, msb in bitboard.h There are still a few
  things we can be improved later on, move the description of a function where
  it was declared (instead of implemented) and add descriptions to functions
  which are behind macros ifdefs

closes https://github.com/official-stockfish/Stockfish/pull/4840

No functional change
This commit is contained in:
Disservin
2023-10-22 20:20:53 +02:00
parent b187622233
commit a105978bbd
24 changed files with 175 additions and 271 deletions
+3 -3
View File
@@ -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) {
+1 -1
View File
@@ -50,7 +50,7 @@ void HalfKAv2_hm::append_active_indices(const Position& pos, IndexList& active)
template void HalfKAv2_hm::append_active_indices<WHITE>(const Position& pos, IndexList& active);
template void HalfKAv2_hm::append_active_indices<BLACK>(const Position& pos, IndexList& active);
// append_changed_indices() : get a list of indices for recently changed features
// Get a list of indices for recently changed features
template<Color Perspective>
void HalfKAv2_hm::append_changed_indices(Square ksq,
const DirtyPiece& dp,
+6 -6
View File
@@ -85,7 +85,7 @@ constexpr IntType ceil_to_multiple(IntType n, IntType base) {
}
// read_little_endian() is our utility to read an integer (signed or unsigned, any size)
// Utility to read an integer (signed or unsigned, any size)
// from a stream in little-endian order. We swap the byte order after the read if
// necessary to return a result with the byte ordering of the compiling machine.
template<typename IntType>
@@ -110,7 +110,7 @@ inline IntType read_little_endian(std::istream& stream) {
}
// write_little_endian() is our utility to write an integer (signed or unsigned, any size)
// Utility to write an integer (signed or unsigned, any size)
// to a stream in little-endian order. We swap the byte order before the write if
// necessary to always write in little endian order, independently of the byte
// ordering of the compiling machine.
@@ -141,7 +141,7 @@ inline void write_little_endian(std::ostream& stream, IntType value) {
}
// read_little_endian(s, out, N) : read integers in bulk from a little indian stream.
// Read integers in bulk from a little indian stream.
// This reads N integers from stream s and put them in array out.
template<typename IntType>
inline void read_little_endian(std::istream& stream, IntType* out, std::size_t count) {
@@ -153,7 +153,7 @@ inline void read_little_endian(std::istream& stream, IntType* out, std::size_t c
}
// write_little_endian(s, values, N) : write integers in bulk to a little indian stream.
// Write integers in bulk to a little indian stream.
// This takes N integers from array values and writes them on stream s.
template<typename IntType>
inline void write_little_endian(std::ostream& stream, const IntType* values, std::size_t count) {
@@ -165,7 +165,7 @@ inline void write_little_endian(std::ostream& stream, const IntType* values, std
}
// read_leb_128(s, out, N) : read N signed integers from the stream s, putting them in
// Read N signed integers from the stream s, putting them in
// the array out. The stream is assumed to be compressed using the signed LEB128 format.
// See https://en.wikipedia.org/wiki/LEB128 for a description of the compression scheme.
template<typename IntType>
@@ -215,7 +215,7 @@ inline void read_leb_128(std::istream& stream, IntType* out, std::size_t count)
}
// write_leb_128(s, values, N) : write signed integers to a stream with LEB128 compression.
// Write signed integers to a stream with LEB128 compression.
// This takes N integers from array values, compress them with the LEB128 algorithm and
// writes the result on the stream s.
// See https://en.wikipedia.org/wiki/LEB128 for a description of the compression scheme.