about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-09-20 01:21:50 +0200
committerbptato <nincsnevem662@gmail.com>2023-09-20 01:21:50 +0200
commitda326ead89287b50e06817025160681235df7a1f (patch)
tree1ac3709d5b7710174c82dd2c4e74738affbae02c
parentecfdd90f7947b65db1046cb2eeeaa8f1953b119f (diff)
downloadchawan-da326ead89287b50e06817025160681235df7a1f.tar.gz
fix compilation on 1.6.14
-rw-r--r--src/loader/file.nim2
-rw-r--r--src/loader/ftp.nim6
-rw-r--r--src/loader/gopher.nim2
-rw-r--r--src/loader/response.nim2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/loader/file.nim b/src/loader/file.nim
index 40a19981..e9668713 100644
--- a/src/loader/file.nim
+++ b/src/loader/file.nim
@@ -58,7 +58,7 @@ proc loadDir(handle: LoaderHandle, url: URL, path: string) =
         t: ITEM_FILE,
         name: file,
         modified: modified,
-        nsize: info.size
+        nsize: int(info.size)
       ))
     of pcLinkToDir, pcLinkToFile:
       var target = expandSymlink(fullpath)
diff --git a/src/loader/ftp.nim b/src/loader/ftp.nim
index 49d4a39c..bf69afff 100644
--- a/src/loader/ftp.nim
+++ b/src/loader/ftp.nim
@@ -33,7 +33,7 @@ proc curlWriteHeader(p: cstring, size: csize_t, nitems: csize_t,
   var line = newString(nitems)
   if nitems > 0:
     prepareMutation(line)
-    copyMem(addr line[0], addr p[0], nitems)
+    copyMem(addr line[0], p, nitems)
 
   let op = cast[FtpHandle](userdata)
 
@@ -93,7 +93,7 @@ proc curlWriteBody(p: cstring, size: csize_t, nmemb: csize_t,
       let i = op.buffer.len
       op.buffer.setLen(op.buffer.len + int(nmemb))
       prepareMutation(op.buffer)
-      copyMem(addr op.buffer[i], addr p[0], nmemb)
+      copyMem(addr op.buffer[i], p, nmemb)
     else:
       if not op.handle.sendData(p, int(nmemb)):
         return 0
@@ -161,7 +161,7 @@ proc finish(op: CurlHandle) =
         t: ITEM_FILE,
         name: name,
         modified: dates,
-        nsize: nsize
+        nsize: int(nsize)
       ))
   discard op.handle.sendData(makeDirlist(items))
   discard op.handle.sendData("\n</PRE>\n</BODY>\n</HTML>\n")
diff --git a/src/loader/gopher.nim b/src/loader/gopher.nim
index 3ccfc72a..fddc7f7c 100644
--- a/src/loader/gopher.nim
+++ b/src/loader/gopher.nim
@@ -199,7 +199,7 @@ proc curlWriteBody(p: cstring, size: csize_t, nmemb: csize_t,
       let i = op.buffer.len
       op.buffer.setLen(op.buffer.len + int(nmemb))
       prepareMutation(op.buffer)
-      copyMem(addr op.buffer[i], addr p[0], nmemb)
+      copyMem(addr op.buffer[i], p, nmemb)
       if not op.onSendChunk(i):
         return 0
     else:
diff --git a/src/loader/response.nim b/src/loader/response.nim
index a25ea476..1133a5e4 100644
--- a/src/loader/response.nim
+++ b/src/loader/response.nim
@@ -79,7 +79,7 @@ proc blob(response: Response): Promise[JSResult[Blob]] {.jsfunc.} =
     GC_ref(s)
     let deallocFun = proc() =
       GC_unref(s)
-    let blob = newBlob(addr s[0], s.len, response.contenttype, deallocFun)
+    let blob = newBlob(unsafeAddr s[0], s.len, response.contenttype, deallocFun)
     ok(blob))
 
 proc json(ctx: JSContext, this: Response): Promise[JSResult[JSValue]]