aboutsummaryrefslogtreecommitdiff
path: root/src/bitboard.c
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2022-09-14 17:49:07 +0300
committereug-vs <eugene@eug-vs.xyz>2022-09-14 17:50:55 +0300
commita881be4856c6d3dc7675059d5a635d34434b5797 (patch)
treede1551798279a2fa048e70c977b3c3f98f515d62 /src/bitboard.c
parent71f28db1b8e26377d56f0eb0aef01f6c6c3afbd0 (diff)
downloadj1chess-a881be4856c6d3dc7675059d5a635d34434b5797.tar.gz
refactor: use lowerCamelCase for functions
Diffstat (limited to 'src/bitboard.c')
-rw-r--r--src/bitboard.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bitboard.c b/src/bitboard.c
index cffe40f..c0abbf8 100644
--- a/src/bitboard.c
+++ b/src/bitboard.c
@@ -3,7 +3,7 @@
/* Print bitboard on screen in the same way squares appear in memory
* (i.e the board is actually flipped along X) */
-void print_bitboard(Bitboard bb) {
+void printBitboard(Bitboard bb) {
for (U64 index = 0; index < 64; index++) {
printf("%lu", (bb >> index) & 1);
if ((index + 1) % 8 == 0) printf("\n");
@@ -12,9 +12,9 @@ void print_bitboard(Bitboard bb) {
}
/* Return bitboard cardinality, aka number of elements in the set */
-inline int pop_count(Bitboard bb){
+inline int popCount(Bitboard bb){
if (bb == 0) return 0;
- return pop_count(bb >> 1) + (bb & 1);
+ return popCount(bb >> 1) + (bb & 1);
}
/* Return Bitboard with only Least Single Bit */
@@ -26,7 +26,7 @@ inline Bitboard ls1b(Bitboard bb) {
* Only works for SINGLE Bitboards
* Useful for calculating bit-index of LS1B */
inline int bitscan(Bitboard bb) {
- return pop_count(ls1b(bb) - 1);
+ return popCount(ls1b(bb) - 1);
}
/* Bitscan forward with LS1B reset */