Remove redundant condition in is_dangerous()

A pawn on 7th is always passed so retire
this redundant condition.

No funtional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Merge exclusion search conditions

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Include castle moves in 'dangerous' flag

Simplifies the code and seems more natural.

We have a very small fucntional change becuase now
at PV nodes castles are extended one ply anyhow.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Rewrite pv_info_xxx() signatures

Use the helpers to format the PV info but without
writing to output stream (file or cout). Message
formatting and sending are two logically different
task.

Incidentaly reintroduce the pretty_pv() name,
from Glaurung memories :-)

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Introduce notation.h

And group there all the formatting functions but
uci_pv() that requires access to search.cpp variables.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Fix regression in move_to_san()

Broken since commit 628808a11382a3ac

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Readme.txt: grammar/stylistic fixes
Readme.txt: more grammar/style fixes
Fix UCI promotion move notation

Regression introduced by revision
f0db6a6c0b82a586

Spotted by Joona.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Added Haiku-specific changes to Makefile

First change: If Haiku is host platform, change
installation prefix to /boot/common/bin

Second change: Only link in pthreads if Haiku isn't
host platform.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Guard against 'divide by zero' in bench

Also remove an useless cast.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Retire MovePickerExt struct

Templetize MovePicker::next_move() member function instead. It
is easier and we also avoid the forwarding of MovePicker() c'tor
arguments in the common case.

Suggested by Rein Halbersma.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Explicitly qualify STL functions

Suggested by Rein Halbersma.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Retire struct OptionsMap

Directly use the underlying std::map instead and avoid
a useless inheritance.

As a nice side-effect Options global object has now a
default c'tor avoiding possible issues with globals
initializations.

Suggested by Rein Halbersma.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Introduce namespace UCI

Ater previous patch it comes naturally to take this
extra step.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Introduce namespace Bitbases

Let's continue this namespace galore...

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Prefer size_t over int for array sizes

Align to standard library conventions.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Simplify idle_loop() signature

We can detect the split point master also from within idle_loop,
so we can call the function without parameters and remove an
overloaded member hack in Thread class.

Note that we don't need to take a lock around curSplitPoint
when entering idle_loop() because if we are the master then
curSplitPoint cannot change under our feet (because is_searching
is set and so we cannot be reallocated), if we are a slave
we enter idle_loop() only upon Thread creation and in that case
is always splitPointsCnt == 0. This is true even in the very rare
case that curSplitPoint != NULL, if we have been already allocated
even before entering idle_loop().

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Avoid wake up master thread when useless

Check we are the last slave of the split point
before to wake up the master. This should avoid
spurious wakes up.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Document De Bruijn sequences

Insted of raw magic numbers.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>