Skip to content

Commit

Permalink
fixes incorrect casting to UncheckedArray (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
ringabout authored Oct 23, 2024
1 parent 646546d commit 931b49d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion noise/lineImpl.nim
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ proc insertAtCursor(self: var Line, c: char32) =
self.add(c)

template toOpenArray(self: Line, start, stop: int): auto =
toOpenArray(cast[ptr array[0, char32]](self.data[0].unsafeAddr)[], start, stop - 1)
toOpenArray(cast[ptr UncheckedArray[char32]](self.data[0].unsafeAddr), start, stop - 1)

proc calcColPos(self: Line, len: int): int =
let width = mk_wcswidth(self.toOpenArray(0, len))
Expand Down

0 comments on commit 931b49d

Please sign in to comment.