Skip to content

Commit 30acde2

Browse files
committed
fixed linting
1 parent 3abccbf commit 30acde2

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

include/bitbishop/movegen/pins.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Distinguishes between rook-like and bishop-like rays,
1212
* determining which enemy sliders can produce a pin.
1313
*/
14-
enum class RayType {
14+
enum class RayType : std::uint8_t {
1515
ROOK, ///< Orthogonal rays (rook / queen)
1616
BISHOP ///< Diagonal rays (bishop / queen)
1717
};
@@ -22,7 +22,7 @@ enum class RayType {
2222
* Used to determine ray orientation and correct blocker ordering
2323
* (LSB vs MSB) when scanning occupied squares.
2424
*/
25-
enum class RayDir {
25+
enum class RayDir : std::uint8_t {
2626
N,
2727
S,
2828
E,
@@ -55,7 +55,7 @@ struct PinRay {
5555
* @param bb Bitboard of occupied squares along the ray
5656
* @return Square of the closest blocker to the king
5757
*/
58-
[[nodiscard]] Square first_blocker(Bitboard bb) const {
58+
[[nodiscard]] Square first_blocker(const Bitboard& bb) const {
5959
switch (dir) {
6060
case RayDir::N:
6161
case RayDir::NE:
@@ -78,7 +78,7 @@ struct PinRay {
7878
* @param them Enemy color
7979
* @return true if the piece can create a pin along this ray
8080
*/
81-
[[nodiscard]] bool matches_slider(Bitboard piece, const Board& board, Color them) const {
81+
[[nodiscard]] bool matches_slider(const Bitboard& piece, const Board& board, Color them) const {
8282
return (type == RayType::BISHOP) ? (piece & (board.bishops(them) | board.queens(them)))
8383
: (piece & (board.rooks(them) | board.queens(them)));
8484
}

src/bitbishop/movegen/pins.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ PinResult compute_pins(Square king_sq, const Board& board, Color us) {
3838
PinResult result;
3939

4040
const std::array<PinRay, 8> ray_infos = {{
41-
{Lookups::ROOK_NORTH_RAYS[king_sq.value()], RayType::ROOK, RayDir::N},
42-
{Lookups::ROOK_SOUTH_RAYS[king_sq.value()], RayType::ROOK, RayDir::S},
43-
{Lookups::ROOK_EAST_RAYS[king_sq.value()], RayType::ROOK, RayDir::E},
44-
{Lookups::ROOK_WEST_RAYS[king_sq.value()], RayType::ROOK, RayDir::W},
45-
{Lookups::BISHOP_NORTHEAST_RAYS[king_sq.value()], RayType::BISHOP, RayDir::NE},
46-
{Lookups::BISHOP_NORTHWEST_RAYS[king_sq.value()], RayType::BISHOP, RayDir::NW},
47-
{Lookups::BISHOP_SOUTHEAST_RAYS[king_sq.value()], RayType::BISHOP, RayDir::SE},
48-
{Lookups::BISHOP_SOUTHWEST_RAYS[king_sq.value()], RayType::BISHOP, RayDir::SW},
41+
PinRay{.ray = Lookups::ROOK_NORTH_RAYS[king_sq.value()], .type = RayType::ROOK, .dir = RayDir::N},
42+
PinRay{.ray = Lookups::ROOK_SOUTH_RAYS[king_sq.value()], .type = RayType::ROOK, .dir = RayDir::S},
43+
PinRay{.ray = Lookups::ROOK_EAST_RAYS[king_sq.value()], .type = RayType::ROOK, .dir = RayDir::E},
44+
PinRay{.ray = Lookups::ROOK_WEST_RAYS[king_sq.value()], .type = RayType::ROOK, .dir = RayDir::W},
45+
PinRay{.ray = Lookups::BISHOP_NORTHEAST_RAYS[king_sq.value()], .type = RayType::BISHOP, .dir = RayDir::NE},
46+
PinRay{.ray = Lookups::BISHOP_NORTHWEST_RAYS[king_sq.value()], .type = RayType::BISHOP, .dir = RayDir::NW},
47+
PinRay{.ray = Lookups::BISHOP_SOUTHEAST_RAYS[king_sq.value()], .type = RayType::BISHOP, .dir = RayDir::SE},
48+
PinRay{.ray = Lookups::BISHOP_SOUTHWEST_RAYS[king_sq.value()], .type = RayType::BISHOP, .dir = RayDir::SW},
4949
}};
5050

5151
for (const auto& ray_info : ray_infos) {

0 commit comments

Comments
 (0)