remove ArrayDummySize with unchecked arrays (#5818)
This commit is contained in:
parent
b2aae477d1
commit
22684370b0
11 changed files with 25 additions and 28 deletions
|
|
@ -30,13 +30,12 @@ type
|
|||
key: ByteAddress # start address at bit 0
|
||||
bits: array[BitIndex, int] # a bit vector
|
||||
|
||||
PPageDescArray = ptr array[ArrayDummySize, PPageDesc]
|
||||
PPageDescArray = ptr UncheckedArray[PPageDesc]
|
||||
CellSet {.final, pure.} = object
|
||||
counter, max: int
|
||||
head: PPageDesc
|
||||
data: PPageDescArray
|
||||
|
||||
PCellArray = ptr array[ArrayDummySize, PCell]
|
||||
PCellArray = ptr UncheckedArray[PCell]
|
||||
CellSeq {.final, pure.} = object
|
||||
len, cap: int
|
||||
d: PCellArray
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ const
|
|||
|
||||
type
|
||||
PPointer = ptr pointer
|
||||
ByteArray = array[0..ArrayDummySize, byte]
|
||||
ByteArray = UncheckedArray[byte]
|
||||
PByte = ptr ByteArray
|
||||
PString = ptr string
|
||||
{.deprecated: [TByteArray: ByteArray].}
|
||||
|
|
|
|||
|
|
@ -86,11 +86,11 @@ proc writeBuffer(f: File, buffer: pointer, len: Natural): int =
|
|||
checkErr(f)
|
||||
|
||||
proc writeBytes(f: File, a: openArray[int8|uint8], start, len: Natural): int =
|
||||
var x = cast[ptr array[ArrayDummySize, int8]](a)
|
||||
result = writeBuffer(f, addr(x[start]), len)
|
||||
var x = cast[ptr UncheckedArray[int8]](a)
|
||||
result = writeBuffer(f, addr(x[int(start)]), len)
|
||||
proc writeChars(f: File, a: openArray[char], start, len: Natural): int =
|
||||
var x = cast[ptr array[ArrayDummySize, int8]](a)
|
||||
result = writeBuffer(f, addr(x[start]), len)
|
||||
var x = cast[ptr UncheckedArray[int8]](a)
|
||||
result = writeBuffer(f, addr(x[int(start)]), len)
|
||||
|
||||
proc write(f: File, s: string) =
|
||||
if writeBuffer(f, cstring(s), s.len) != s.len:
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ when not declared(NimString):
|
|||
|
||||
type
|
||||
Utf16Char* = distinct int16
|
||||
WideCString* = ref array[ArrayDummySize, Utf16Char]
|
||||
WideCString* = ref UncheckedArray[Utf16Char]
|
||||
{.deprecated: [TUtf16Char: Utf16Char].}
|
||||
|
||||
proc len*(w: WideCString): int =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue