mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 07:27:46 +00:00
Fixed non UCI compliance
print `<empty>` and accept `<empty>` for UCI string options, accepting empty strings as well. Internally use empty strings (`""`). closes https://github.com/official-stockfish/Stockfish/pull/5474 No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
8d1e41458e
commit
42aae5fe8b
+11
-3
@@ -166,7 +166,9 @@ Option& Option::operator=(const std::string& v) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
if (type != "button")
|
||||
if (type == "string")
|
||||
currentValue = v == "<empty>" ? "" : v;
|
||||
else if (type != "button")
|
||||
currentValue = v;
|
||||
|
||||
if (on_change)
|
||||
@@ -188,10 +190,16 @@ std::ostream& operator<<(std::ostream& os, const OptionsMap& om) {
|
||||
const Option& o = it.second;
|
||||
os << "\noption name " << it.first << " type " << o.type;
|
||||
|
||||
if (o.type == "string" || o.type == "check" || o.type == "combo")
|
||||
if (o.type == "check" || o.type == "combo")
|
||||
os << " default " << o.defaultValue;
|
||||
|
||||
if (o.type == "spin")
|
||||
else if (o.type == "string")
|
||||
{
|
||||
std::string defaultValue = o.defaultValue.empty() ? "<empty>" : o.defaultValue;
|
||||
os << " default " << defaultValue;
|
||||
}
|
||||
|
||||
else if (o.type == "spin")
|
||||
os << " default " << int(stof(o.defaultValue)) << " min " << o.min << " max "
|
||||
<< o.max;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user