1
0
Fork 0

Clean functions returning by const values

The codebase contains multiple functions returning by const-value.
This patch is a small cleanup making those function returns
by value instead, removing the const specifier.

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

No functional change
pull/3390/head
Antoine Champion 2021-01-30 09:50:04 +01:00 committed by Joost VandeVondele
parent 0f3f5d85fb
commit 9b1274aba3
7 changed files with 9 additions and 8 deletions

View File

@ -24,6 +24,7 @@ Ali AlZhrani (Cooffe)
Andrew Grant (AndyGrant)
Andrey Neporada (nepal)
Andy Duplain
Antoine Champion (antoinechampion)
Aram Tumanian (atumanian)
Arjun Temurnikar
Auguste Pop

View File

@ -55,7 +55,7 @@ inline Bitboard safe_destination(Square s, int step) {
/// Bitboards::pretty() returns an ASCII representation of a bitboard suitable
/// to be printed to standard output. Useful for debugging.
const std::string Bitboards::pretty(Bitboard b) {
std::string Bitboards::pretty(Bitboard b) {
std::string s = "+---+---+---+---+---+---+---+---+\n";

View File

@ -33,7 +33,7 @@ bool probe(Square wksq, Square wpsq, Square bksq, Color us);
namespace Bitboards {
void init();
const std::string pretty(Bitboard b);
std::string pretty(Bitboard b);
}

View File

@ -138,7 +138,7 @@ public:
/// the program was compiled) or "Stockfish <Version>", depending on whether
/// Version is empty.
const string engine_info(bool to_uci) {
string engine_info(bool to_uci) {
const string months("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec");
string month, day, year;
@ -161,7 +161,7 @@ const string engine_info(bool to_uci) {
/// compiler_info() returns a string trying to describe the compiler we use
const std::string compiler_info() {
std::string compiler_info() {
#define stringify2(x) #x
#define stringify(x) stringify2(x)

View File

@ -28,8 +28,8 @@
#include "types.h"
const std::string engine_info(bool to_uci = false);
const std::string compiler_info();
std::string engine_info(bool to_uci = false);
std::string compiler_info();
void prefetch(void* addr);
void start_logger(const std::string& fname);
void* std_aligned_alloc(size_t alignment, size_t size);

View File

@ -408,7 +408,7 @@ Position& Position::set(const string& code, Color c, StateInfo* si) {
/// Position::fen() returns a FEN representation of the position. In case of
/// Chess960 the Shredder-FEN notation is used. This is mainly a debugging function.
const string Position::fen() const {
string Position::fen() const {
int emptyCnt;
std::ostringstream ss;

View File

@ -87,7 +87,7 @@ public:
// FEN string input/output
Position& set(const std::string& fenStr, bool isChess960, StateInfo* si, Thread* th);
Position& set(const std::string& code, Color c, StateInfo* si);
const std::string fen() const;
std::string fen() const;
// Position representation
Bitboard pieces(PieceType pt) const;