diff options
author | Bung <crc32@qq.com> | 2022-12-01 20:34:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-01 13:34:00 +0100 |
commit | 658b28dc5707601b39d9aad4b6bf79a9afff1e92 (patch) | |
tree | b8e10d4d1f2666c45c3b1dec23e7c03d5ba23be9 /lib/std/syncio.nim | |
parent | a70d3abd37819e7562f80f0c808788c3f5c62c55 (diff) | |
download | Nim-658b28dc5707601b39d9aad4b6bf79a9afff1e92.tar.gz |
tyInt tyUint fit target int bit width (#20829)
Diffstat (limited to 'lib/std/syncio.nim')
-rw-r--r-- | lib/std/syncio.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/syncio.nim b/lib/std/syncio.nim index dcbed9cdd..2b5ea6a3c 100644 --- a/lib/std/syncio.nim +++ b/lib/std/syncio.nim @@ -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() |