diff options
author | Benjamin Shirley-Quirk | 2020-08-04 21:29:42 +0000 |
---|---|---|
committer | Benjamin Shirley-Quirk | 2020-08-04 21:29:42 +0000 |
commit | 31108f15f5d1e9cc88ff4207658bf5155b184108 (patch) | |
tree | 518597af77ad280d5dd2fb9884f6660877059ec2 | |
parent | b47df19c354e6b1c3c438b57eb463bbfaa8fd08d (diff) |
removed csize_t warnings, required casting a len to csize_t
-rw-r--r-- | src/utils.nim | 6 | ||||
-rw-r--r-- | src/wrapper/curl.nim | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/utils.nim b/src/utils.nim index 8ca68d4..6fb0470 100644 --- a/src/utils.nim +++ b/src/utils.nim @@ -211,7 +211,7 @@ proc forkWaitRedirect*(call: () -> int): tuple[output: seq[string], code: int] = proc getgrouplist*(user: cstring, group: Gid, groups: ptr cint, ngroups: var cint): cint {.importc, header: "<grp.h>".} -proc setgroups*(size: csize, groups: ptr cint): cint +proc setgroups*(size: csize_t, groups: ptr cint): cint {.importc, header: "<grp.h>".} proc getUser(uid: int): User = @@ -257,8 +257,8 @@ proc dropPrivileges*(): bool = if initialUser.isSome: let user = initialUser.unsafeGet var groups = user.groups.map(x => x.cint) - - if setgroups(user.groups.len, addr(groups[0])) < 0: + + if setgroups(cast[csize_t](user.groups.len), addr(groups[0])) < 0: return false if setgid((Gid) user.gid) != 0: return false diff --git a/src/wrapper/curl.nim b/src/wrapper/curl.nim index 98d6880..79468a9 100644 --- a/src/wrapper/curl.nim +++ b/src/wrapper/curl.nim @@ -58,8 +58,8 @@ proc escape*(instance: ref CurlInstance, s: string): string = else: "" -proc curlWriteMemory(mem: array[csize.high, char], size: csize, nmemb: csize, - userdata: ref CurlInstance): csize {.cdecl.} = +proc curlWriteMemory(mem: array[csize_t.high, char], size: csize_t, nmemb: csize_t, + userdata: ref CurlInstance): csize_t {.cdecl.} = let total = size * nmemb if total > 0: userData.data &= mem[0 .. total - 1] |