diff options
| author | bptato <nincsnevem662@gmail.com> | 2024-12-20 16:38:01 +0100 |
|---|---|---|
| committer | bptato <nincsnevem662@gmail.com> | 2024-12-20 16:38:01 +0100 |
| commit | 4128dac7695a46f65e4dbb284a6e469d4338194a (patch) | |
| tree | 46c9842985b73209da47081e15963806d475dd21 | |
| parent | 92aab607b238d41c4b33f0920ca36fa5454bf323 (diff) | |
| download | chawan-4128dac7695a46f65e4dbb284a6e469d4338194a.tar.gz | |
nanosvg, myaddr: fix obuf type and myaddr shim
this is exactly why I shimmed in unsafeAddr, but the compiler isn't
cooperating... :(
well, it seems to work with auto.
| -rw-r--r-- | adapter/img/nanosvg.nim | 2 | ||||
| -rw-r--r-- | src/utils/myaddr.nim | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/adapter/img/nanosvg.nim b/adapter/img/nanosvg.nim index d1bf7c18..af554c5e 100644 --- a/adapter/img/nanosvg.nim +++ b/adapter/img/nanosvg.nim @@ -54,7 +54,7 @@ proc main() = if hdr.until(':') == "Cha-Image-Info-Only" and v == "1": return let r = nsvgCreateRasterizer() - let obuf = newSeqUninitialized[uint8](width * height * 4) + var obuf = newSeqUninitialized[uint8](width * height * 4) r.nsvgRasterize(image, 0, 0, 1, addr obuf[0], width, height, width * 4) os.sendDataLoop(obuf) r.nsvgDeleteRasterizer() diff --git a/src/utils/myaddr.nim b/src/utils/myaddr.nim index 4405e0c4..6eee071f 100644 --- a/src/utils/myaddr.nim +++ b/src/utils/myaddr.nim @@ -11,8 +11,8 @@ when NimMajor >= 2: const msg = "expression has no address; maybe use `unsafeAddr'" - template addr(x: untyped): untyped {.used, error: msg.} = + template addr(x: auto): auto {.used, error: msg.} = discard - template addr(x: var untyped): untyped {.used.} = + template addr(x: var auto): auto {.used.} = system.addr x |