tyInt tyUint fit target int bit width (#20829)
This commit is contained in:
parent
a70d3abd37
commit
658b28dc57
17 changed files with 306 additions and 267 deletions
|
|
@ -573,7 +573,7 @@ proc readAllFile(file: File, len: int64): string =
|
|||
result = newString(len)
|
||||
let bytes = readBuffer(file, addr(result[0]), len)
|
||||
if endOfFile(file):
|
||||
if bytes < len:
|
||||
if bytes.int64 < len:
|
||||
result.setLen(bytes)
|
||||
else:
|
||||
# We read all the bytes but did not reach the EOF
|
||||
|
|
@ -717,7 +717,7 @@ proc open*(f: var File, filename: string,
|
|||
|
||||
result = true
|
||||
f = cast[File](p)
|
||||
if bufSize > 0 and bufSize <= high(cint).int:
|
||||
if bufSize > 0 and bufSize.uint <= high(uint):
|
||||
discard c_setvbuf(f, nil, IOFBF, cast[csize_t](bufSize))
|
||||
elif bufSize == 0:
|
||||
discard c_setvbuf(f, nil, IONBF, 0)
|
||||
|
|
@ -821,7 +821,7 @@ when defined(windows) and appType == "console" and
|
|||
proc getConsoleCP(): cuint {.stdcall, dynlib: "kernel32",
|
||||
importc: "GetConsoleCP".}
|
||||
|
||||
const Utf8codepage = 65001
|
||||
const Utf8codepage = 65001'u32
|
||||
|
||||
let
|
||||
consoleOutputCP = getConsoleOutputCP()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue