stockfish
13 years agoFix a couple of bugs (fallout from previous patches)
Marco Costalba [Mon, 1 Sep 2008 20:05:23 +0000 (22:05 +0200)]
Fix a couple of bugs (fallout from previous patches)

After testing and comparing output with standard Glaurung
a couple of issues arised.

A default value was wrong and init_uci_options() missed a couple
of stringify() calls. Also storing bool values as "false" and "true"
needs some care.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
13 years agoucioptions: Fix stringification of a bool
Marco Costalba [Mon, 1 Sep 2008 14:58:02 +0000 (16:58 +0200)]
ucioptions: Fix stringification of a bool

We want stringify a bool as "true" and "false",
not "1" and "0".

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
13 years agoPreserve options order when printed
Marco Costalba [Mon, 1 Sep 2008 14:03:01 +0000 (16:03 +0200)]
Preserve options order when printed

Use a vector instead of a map so that options
are printed according to their original order.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
13 years agoRewrite ucioptions.cpp to use C++
Marco Costalba [Mon, 1 Sep 2008 12:05:02 +0000 (14:05 +0200)]
Rewrite ucioptions.cpp to use C++

Instead of old-style C string functions use standard
library to greatly streamline the implementation.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
13 years agoFinally remove UCIInputParser class altogether
Marco Costalba [Mon, 1 Sep 2008 06:16:17 +0000 (08:16 +0200)]
Finally remove UCIInputParser class altogether

Class UCIInputParser is now a typedef of a std::istringstream,
this greatly simplifies the code, especially the many conversions
from string to integer are now handled automatically by the
stream instead of relying on a chunk of C-style atoi() calls.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
13 years agoUse a string stream in UCIInputParser
Marco Costalba [Mon, 1 Sep 2008 06:06:34 +0000 (08:06 +0200)]
Use a string stream in UCIInputParser

Use a std::istringstream instead of an home
grown string tokenizer code.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
13 years agoAvoid casts to handle isspace() arguments
Marco Costalba [Mon, 1 Sep 2008 06:03:21 +0000 (08:03 +0200)]
Avoid casts to handle isspace() arguments

Use proper standard conversion to deal
with negative values of a char.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
13 years agoInitial import of Glaurung 2.1
Marco Costalba [Mon, 1 Sep 2008 05:59:13 +0000 (07:59 +0200)]
Initial import of Glaurung 2.1