comments, removal useless Makefile CFLAGS, etc...
This commit is contained in:
7
Makefile
7
Makefile
@@ -70,15 +70,14 @@ CPPFLAGS += -DWARN_ON # brlib bug.h
|
||||
#CPPFLAGS += -DDEBUG_FEN # FEN decoding
|
||||
|
||||
# attack.c
|
||||
#CPPFLAGS += -DDEBUG_ATTACK_ATTACKERS1 # sq_attackers details
|
||||
CPPFLAGS += -DDEBUG_ATTACK_ATTACKERS # sq_attackers
|
||||
CPPFLAGS += -DDEBUG_ATTACK_PINNERS # sq_pinners details
|
||||
#CPPFLAGS += -DDEBUG_ATTACK_ATTACKERS # sq_attackers
|
||||
#CPPFLAGS += -DDEBUG_ATTACK_PINNERS # sq_pinners details
|
||||
|
||||
#CPPFLAGS += -DDEBUG_EVAL # eval functions
|
||||
#CPPFLAGS += -DDEBUG_PIECE # piece list management
|
||||
#CPPFLAGS += -DDEBUG_SEARCH # move search
|
||||
|
||||
CPPFLAGS += -DDIAGRAM_SYM # diagram with symbols
|
||||
CPPFLAGS += -DDIAGRAM_SYM # UTF8 symbols in diagrams
|
||||
|
||||
# remove extraneous spaces (due to spaces before comments)
|
||||
CPPFLAGS := $(strip $(CPPFLAGS))
|
||||
|
12
src/attack.c
12
src/attack.c
@@ -108,12 +108,12 @@ bitboard_t sq_attackers(const pos_t *pos, const bitboard_t occ, const square_t s
|
||||
to = pos->bb[c][PAWN];
|
||||
tmp = pawn_shift_upleft(sqbb, opp) & to;
|
||||
attackers |= tmp;
|
||||
# ifdef DEBUG_ATTACK_ATTACKERS1
|
||||
# ifdef DEBUG_ATTACK_ATTACKERS
|
||||
bb_print("att pawn upleft", tmp);
|
||||
# endif
|
||||
tmp = pawn_shift_upright(sqbb, opp) & to;
|
||||
attackers |= tmp;
|
||||
# ifdef DEBUG_ATTACK_ATTACKERS1
|
||||
# ifdef DEBUG_ATTACK_ATTACKERS
|
||||
bb_print("att pawn upright", tmp);
|
||||
# endif
|
||||
|
||||
@@ -121,13 +121,13 @@ bitboard_t sq_attackers(const pos_t *pos, const bitboard_t occ, const square_t s
|
||||
to = pos->bb[c][KNIGHT];
|
||||
tmp = bb_knight_moves(to, sq);
|
||||
attackers |= tmp;
|
||||
# ifdef DEBUG_ATTACK_ATTACKERS1
|
||||
# ifdef DEBUG_ATTACK_ATTACKERS
|
||||
bb_print("att knight", tmp);
|
||||
# endif
|
||||
to = pos->bb[c][KING];
|
||||
tmp = bb_king_moves(to, sq);
|
||||
attackers |= tmp;
|
||||
# ifdef DEBUG_ATTACK_ATTACKERS1
|
||||
# ifdef DEBUG_ATTACK_ATTACKERS
|
||||
bb_print("att king", tmp);
|
||||
# endif
|
||||
|
||||
@@ -135,7 +135,7 @@ bitboard_t sq_attackers(const pos_t *pos, const bitboard_t occ, const square_t s
|
||||
to = pos->bb[c][BISHOP] | pos->bb[c][QUEEN];
|
||||
tmp = hyperbola_bishop_moves(occ, sq) & to;
|
||||
attackers |= tmp;
|
||||
# ifdef DEBUG_ATTACK_ATTACKERS1
|
||||
# ifdef DEBUG_ATTACK_ATTACKERS
|
||||
bb_print("att bishop/queen", tmp);
|
||||
# endif
|
||||
|
||||
@@ -143,7 +143,7 @@ bitboard_t sq_attackers(const pos_t *pos, const bitboard_t occ, const square_t s
|
||||
to = pos->bb[c][ROOK] | pos->bb[c][QUEEN];
|
||||
tmp = hyperbola_rook_moves(occ, sq) & to;
|
||||
attackers |= tmp;
|
||||
# ifdef DEBUG_ATTACK_ATTACKERS1
|
||||
# ifdef DEBUG_ATTACK_ATTACKERS
|
||||
bb_print("att rook/queen", tmp);
|
||||
bb_print("ATTACKERS", attackers);
|
||||
printf("attackers=%lx\n", attackers);
|
||||
|
@@ -18,8 +18,8 @@
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "brlib.h"
|
||||
#include "bitops.h"
|
||||
#include <brlib.h>
|
||||
#include <bitops.h>
|
||||
|
||||
#include "chessdefs.h"
|
||||
#include "position.h"
|
||||
@@ -65,6 +65,7 @@ pos_t *pos_dup(const pos_t *pos)
|
||||
/**
|
||||
* pos_del() - delete a position.
|
||||
* @pos: &position.
|
||||
*
|
||||
*/
|
||||
void pos_del(pos_t *pos)
|
||||
{
|
||||
@@ -158,7 +159,7 @@ end:
|
||||
* Get a bitboard of all checkers on @color king.
|
||||
* Just a wrapper over @sq_attackers().
|
||||
*
|
||||
* @return: a bitboard of attackers.
|
||||
* @return: a bitboard of checkers.
|
||||
*/
|
||||
bitboard_t pos_checkers(const pos_t *pos, const color_t color)
|
||||
{
|
||||
@@ -171,7 +172,7 @@ bitboard_t pos_checkers(const pos_t *pos, const color_t color)
|
||||
* @pos: &position
|
||||
*
|
||||
* Set position checkers, pinners and blockers on player-to-play king.
|
||||
* It should be faster than @pos_checkers + @pos_set_pinners_blockers, as
|
||||
* It should be slightly faster than @pos_checkers + @pos_set_pinners_blockers, as
|
||||
* some calculation will be done once.
|
||||
*/
|
||||
void pos_set_checkers_pinners_blockers(pos_t *pos)
|
||||
|
Reference in New Issue
Block a user