Replace unsafeAddr by baseAddr (#32)

* Replace unsafeAddr xxx[0] by baseAddr(xxx)

* Fix styleCheck:usages

* Update CI conf

* Fix charsToBytes

* Fix outputs write

* Add test
This commit is contained in:
Ludovic Chenut 2022-11-24 12:55:42 +01:00 • committed by GitHub
commit b42daf41d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 15 deletions

View file

@ -334,9 +334,7 @@ template writeByte*(span: var PageSpan, val: byte) =
span.startAddr = offset(span.startAddr, 1)
template charsToBytes*(chars: openArray[char]): untyped =
bind makeOpenArray
var charsStart = unsafeAddr chars[0]
makeOpenArray(cast[ptr byte](charsStart), chars.len)
chars.toOpenArrayByte(0, chars.len - 1)
type
ReadFlag* = enum