diff options
Diffstat (limited to 'adapter')
-rw-r--r-- | adapter/img/sixel.nim | 4 | ||||
-rw-r--r-- | adapter/protocol/lcgi.nim | 12 | ||||
-rw-r--r-- | adapter/protocol/man.nim | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/adapter/img/sixel.nim b/adapter/img/sixel.nim index 61227edd..d3d04033 100644 --- a/adapter/img/sixel.nim +++ b/adapter/img/sixel.nim @@ -149,7 +149,7 @@ proc trim(trimMap: var TrimMap; K: var uint) = proc quantize(img: openArray[RGBAColorBE]; outk: var uint; outTransparent: var bool): NodeChildren = - var root = default(NodeChildren) + var root = NodeChildren.default if outk <= 2: # monochrome; not much we can do with an octree... root[0] = cast[Node](alloc0(sizeof(NodeObj))) root[0].u.leaf.c = rgb(0, 0, 0) @@ -209,7 +209,7 @@ type proc getColor(nodes: seq[Node]; c: ARGBColor; diff: var DitherDiff): Node = var child: Node = nil var minDist = uint32.high - var mdiff = default(DitherDiff) + var mdiff = DitherDiff.default for node in nodes: let ic = node.u.leaf.c let ad = int32(c.a) - 100 diff --git a/adapter/protocol/lcgi.nim b/adapter/protocol/lcgi.nim index a2da4cc8..fbaa6aa2 100644 --- a/adapter/protocol/lcgi.nim +++ b/adapter/protocol/lcgi.nim @@ -64,7 +64,7 @@ proc authenticateSocks5(os, ps: PosixStream; buf: array[2, uint8]; os.die("InternalError", "username or password too long") let sbuf = "\x01" & char(user.len) & user & char(pass.len) & pass ps.sendDataLoop(sbuf) - var rbuf = default(array[2, uint8]) + var rbuf = array[2, uint8].default ps.recvDataLoop(rbuf) if rbuf[0] != 1: os.die("ProxyInvalidResponse", "wrong auth version") @@ -86,7 +86,7 @@ proc sendSocks5Domain(os, ps: PosixStream; host, port: string; let port = x.get let sbuf = "\x05\x01\x00" & dstaddr & char(port shr 8) & char(port and 0xFF) ps.sendDataLoop(sbuf) - var rbuf = default(array[4, uint8]) + var rbuf = array[4, uint8].default ps.recvDataLoop(rbuf) if rbuf[0] != 5: os.die("ProxyInvalidResponse") @@ -94,7 +94,7 @@ proc sendSocks5Domain(os, ps: PosixStream; host, port: string; os.die("ProxyRefusedToConnect") case rbuf[3] of 0x01: - var ipv4 = default(array[4, uint8]) + var ipv4 = array[4, uint8].default ps.recvDataLoop(ipv4) outIpv6 = false of 0x03: @@ -105,12 +105,12 @@ proc sendSocks5Domain(os, ps: PosixStream; host, port: string; # we don't really know, so just assume it's ipv4. outIpv6 = false of 0x04: - var ipv6 = default(array[16, uint8]) + var ipv6 = array[16, uint8].default ps.recvDataLoop(ipv6) outIpv6 = true else: os.die("ProxyInvalidResponse") - var bndport = default(array[2, uint8]) + var bndport = array[2, uint8].default ps.recvDataLoop(bndport) proc connectSocks5Socket(os: PosixStream; host, port, proxyHost, proxyPort, @@ -121,7 +121,7 @@ proc connectSocks5Socket(os: PosixStream; host, port, proxyHost, proxyPort, const NoAuth = "\x05\x01\x00" const WithAuth = "\x05\x02\x00\x02" ps.sendDataLoop(if proxyUser != "": NoAuth else: WithAuth) - var buf = default(array[2, uint8]) + var buf = array[2, uint8].default ps.recvDataLoop(buf) os.authenticateSocks5(ps, buf, proxyUser, proxyPass) os.sendSocks5Domain(ps, host, port, outIpv6) diff --git a/adapter/protocol/man.nim b/adapter/protocol/man.nim index 1b0724ad..265862bb 100644 --- a/adapter/protocol/man.nim +++ b/adapter/protocol/man.nim @@ -236,8 +236,8 @@ proc processManpage(ofile, efile: File; header, keyword: string) = efile.close() proc myOpen(cmd: string): tuple[ofile, efile: File] = - var opipe = default(array[2, cint]) - var epipe = default(array[2, cint]) + var opipe = array[2, cint].default + var epipe = array[2, cint].default if pipe(opipe) == -1 or pipe(epipe) == -1: return (nil, nil) case fork() |