aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzqqw2020-07-19 14:44:34 +0000
committerzqqw2020-07-19 14:44:34 +0000
commitb2321b0ded6f4a9803daf9dbcbd88d56321a9305 (patch)
tree3a2768d9da3cc4349628974c5dd8cd3316656789
parentd2030e0bf79d8a2252ae4750dbb0086bd06b72cb (diff)
Fix map error & some warnings
-rw-r--r--src/args.nim2
-rw-r--r--src/utils.nim6
-rw-r--r--src/wrapper/curl.nim6
3 files changed, 7 insertions, 7 deletions
diff --git a/src/args.nim b/src/args.nim
index 9aca7aa..6da84fd 100644
--- a/src/args.nim
+++ b/src/args.nim
@@ -132,7 +132,7 @@ proc splitArgs*(params: seq[string],
else:
input
- let cycle: ParseCycle = (params.map(some) & none(string))
+ let cycle: ParseCycle = (params.mapIt(some(it)) & none(string))
.foldl(buildArgs(a, b), (newSeq[ParseArgument](), false, false))
if cycle.stdinConsumed:
diff --git a/src/utils.nim b/src/utils.nim
index c329b68..25d1b83 100644
--- a/src/utils.nim
+++ b/src/utils.nim
@@ -2,10 +2,10 @@ import
hashes, options, os, posix, sequtils, strutils, sugar, tables
type
- HaltError* = object of Exception
+ HaltError* = object of CatchableError
code*: int
- CommandError* = object of Exception
+ CommandError* = object of CatchableError
color*: Option[bool]
error*: bool
@@ -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: int, groups: ptr cint): cint
{.importc, header: "<grp.h>".}
proc getUser(uid: int): User =
diff --git a/src/wrapper/curl.nim b/src/wrapper/curl.nim
index 98d6880..5597ef1 100644
--- a/src/wrapper/curl.nim
+++ b/src/wrapper/curl.nim
@@ -18,7 +18,7 @@ type
url = 10002,
writeFunction = 20011
- CurlError* = object of Exception
+ CurlError* = object of CatchableError
{.passL: "-lcurl".}
@@ -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[int.high, char], size: int, nmemb: int,
+ userdata: ref CurlInstance): int {.cdecl.} =
let total = size * nmemb
if total > 0:
userData.data &= mem[0 .. total - 1]