From 2b72fac45ebd692ab49966bc2d33a844894486a2 Mon Sep 17 00:00:00 2001 From: Bruno Raoult Date: Sun, 14 Apr 2024 09:10:31 +0200 Subject: [PATCH] comments, removal useless Makefile CFLAGS, etc... --- Makefile | 7 +++---- src/attack.c | 12 ++++++------ src/position.c | 9 +++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 02ad3af..96b3fc4 100644 --- a/Makefile +++ b/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)) diff --git a/src/attack.c b/src/attack.c index 587c7fd..30f8ae8 100644 --- a/src/attack.c +++ b/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); diff --git a/src/position.c b/src/position.c index 5675a4e..518fc7e 100644 --- a/src/position.c +++ b/src/position.c @@ -18,8 +18,8 @@ #include #include -#include "brlib.h" -#include "bitops.h" +#include +#include #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)