aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-12-22 22:32:56 +0100
committerbptato <nincsnevem662@gmail.com>2024-12-22 22:32:56 +0100
commit1feefd7580233b365a7437a6f24f01c74c2b2230 (patch)
treea48058b84591b1fff7c0e44a478cf6833a1c1acf
parent9d16f9fc4d39aae0968b6fa1702fae91b616d077 (diff)
downloadchawan-1feefd7580233b365a7437a6f24f01c74c2b2230.tar.gz
Strict def fixes
-rw-r--r--adapter/format/ansi2html.nim2
-rw-r--r--adapter/format/md2html.nim2
-rw-r--r--adapter/protocol/lcgi.nim2
-rw-r--r--adapter/protocol/man.nim2
-rw-r--r--src/types/path.nim4
5 files changed, 7 insertions, 5 deletions
diff --git a/adapter/format/ansi2html.nim b/adapter/format/ansi2html.nim
index 28217b8d..460df7b4 100644
--- a/adapter/format/ansi2html.nim
+++ b/adapter/format/ansi2html.nim
@@ -33,6 +33,7 @@ type
params: string
proc getParam(parser: AnsiCodeParser; i: var int; colon = false): string =
+ result = ""
while i < parser.params.len and
not (parser.params[i] == ';' or colon and parser.params[i] == ':'):
result &= parser.params[i]
@@ -70,6 +71,7 @@ proc parseSGRDefColor(parser: AnsiCodeParser; format: var Format;
set_color ANSIColor(param0).cellColor()
else:
return false
+ return true
proc parseSGRColor(parser: AnsiCodeParser; format: var Format;
i: var int; u: uint8): bool =
diff --git a/adapter/format/md2html.nim b/adapter/format/md2html.nim
index 2a864762..3b032dd9 100644
--- a/adapter/format/md2html.nim
+++ b/adapter/format/md2html.nim
@@ -663,7 +663,7 @@ proc readLine(state: var ParseState; line: var string): bool =
return hadLine # add one last iteration with a blank after EOF
proc main() =
- var line: string
+ var line = ""
var state = ParseState()
while state.reprocess or state.readLine(line):
state.reprocess = false
diff --git a/adapter/protocol/lcgi.nim b/adapter/protocol/lcgi.nim
index fbaa6aa2..4f495b91 100644
--- a/adapter/protocol/lcgi.nim
+++ b/adapter/protocol/lcgi.nim
@@ -49,7 +49,7 @@ proc connectSocket(os: PosixStream; host, port, resFail, connFail: string;
ps.sclose()
os.die(connFail)
outIpv6 = res.ai_family == AF_INET6
- freeaddrinfo(res)
+ freeAddrInfo(res)
return ps
proc authenticateSocks5(os, ps: PosixStream; buf: array[2, uint8];
diff --git a/adapter/protocol/man.nim b/adapter/protocol/man.nim
index 265862bb..4b26379c 100644
--- a/adapter/protocol/man.nim
+++ b/adapter/protocol/man.nim
@@ -113,7 +113,7 @@ proc readErrorMsg(efile: File; line: var string): string =
return msg
proc processManpage(ofile, efile: File; header, keyword: string) =
- var line: string
+ var line = ""
# The "right thing" would be to check for the error code and output error
# messages accordingly. Unfortunately that would prevent us from streaming
# the output, so what we do instead is:
diff --git a/src/types/path.nim b/src/types/path.nim
index 8f21a891..4bf14adc 100644
--- a/src/types/path.nim
+++ b/src/types/path.nim
@@ -251,7 +251,7 @@ func `[]`*(pl: PathLines; i: BackwardsIndex): LineSegment = pl.lines[i]
func len*(pl: PathLines): int = pl.lines.len
iterator quadraticLines(a, b, c: Vector2D): Line {.inline.} =
- var points: Deque[tuple[a, b, c: Vector2D]]
+ var points = initDeque[tuple[a, b, c: Vector2D]]()
let tup = (a, b, c)
points.addFirst(tup)
while points.len > 2:
@@ -266,7 +266,7 @@ iterator quadraticLines(a, b, c: Vector2D): Line {.inline.} =
points.addFirst((s, b, mid2))
iterator bezierLines(p0, p1, c0, c1: Vector2D): Line {.inline.} =
- var points: Deque[tuple[p0, p1, c0, c1: Vector2D]]
+ var points = initDeque[tuple[p0, p1, c0, c1: Vector2D]]()
let tup = (p0, p1, c0, c1)
points.addLast(tup)
while points.len > 0: