Make casting consistent

This commit is contained in:
2026-07-28 18:23:05 +01:00
parent 4c35f57199
commit 784d2736e2
+3 -3
View File
@@ -13,7 +13,7 @@ LineIterator::~LineIterator() {
void LineIterator::descend(Shard *s) { void LineIterator::descend(Shard *s) {
while (s->kind == Shard::ShardKind::Branch) { while (s->kind == Shard::ShardKind::Branch) {
auto *b = static_cast<Branch *>(s); auto *b = (Branch *)s;
stack.push_back(b); stack.push_back(b);
s = b->left; s = b->left;
} }
@@ -42,7 +42,7 @@ void LineIterator::seek_line(uint32_t line_index) {
uint32_t nth = line_index; uint32_t nth = line_index;
Shard *s = root; Shard *s = root;
while (s->kind == Shard::ShardKind::Branch) { while (s->kind == Shard::ShardKind::Branch) {
auto *b = static_cast<Branch *>(s); auto *b = (Branch *)s;
if (nth <= b->left->lines) { if (nth <= b->left->lines) {
stack.push_back(b); stack.push_back(b);
s = b->left; s = b->left;
@@ -51,7 +51,7 @@ void LineIterator::seek_line(uint32_t line_index) {
s = b->right; s = b->right;
} }
} }
petal = static_cast<Petal *>(s); petal = (Petal *)s;
uint32_t nl_pos = petal->source->nth_newline(petal->pos, nth); uint32_t nl_pos = petal->source->nth_newline(petal->pos, nth);
petal_offset = (nl_pos - petal->pos) + 1; petal_offset = (nl_pos - petal->pos) + 1;
if (petal_offset >= petal->length) if (petal_offset >= petal->length)