Skip to content

Commit a77e711

Browse files
committed
fix kilo-code warnings
1 parent 114b9d9 commit a77e711

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

include/pixie/bp_tree.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class BpTree {
4040
/**
4141
* @brief Returns the size of the tree
4242
*/
43-
size_t size() const { return num_bits_; }
43+
size_t size() const { return num_bits_ / 2; }
4444

4545
/**
4646
* @brief Indicates if @p node is a leaf
@@ -65,7 +65,7 @@ class BpTree {
6565
return 0;
6666
}
6767
BpNode child = first_child(node);
68-
int child_count = 1;
68+
size_t child_count = 1;
6969
while (true) {
7070
if (is_last_child(child)) {
7171
return child_count;

include/pixie/utils.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ std::vector<std::vector<size_t>> bfs_order(
3333
std::queue<std::pair<size_t, size_t>> q;
3434
bfs_adj[0].push_back(0);
3535
q.push({0, 0});
36-
int cnt = 1;
36+
size_t cnt = 1;
3737
while (!q.empty()) {
3838
size_t old_v = q.front().first;
3939
size_t cur_v = q.front().second;
@@ -92,9 +92,9 @@ std::vector<uint64_t> adj_to_bp(size_t tree_size,
9292
const std::vector<std::vector<size_t>>& adj) {
9393
size_t bp_size = tree_size * 2;
9494
std::vector<uint64_t> bp((bp_size + 63) / 64, 0);
95-
std::vector<std::pair<int, int>> stack;
95+
std::vector<std::pair<size_t, size_t>> stack;
9696
stack.push_back(std::make_pair(0, 0));
97-
int pos = 0;
97+
size_t pos = 0;
9898
bp[pos >> 6] = bp[pos >> 6] | (1ULL << (pos & 63));
9999
while (!stack.empty()) {
100100
auto& [v, p] = stack.back();

0 commit comments

Comments
 (0)