summary refs log tree commit diff stats
path: root/lib/system
diff options
context:
space:
mode:
Diffstat (limited to 'lib/system')
-rw-r--r--lib/system/dyncalls.nim2
-rw-r--r--lib/system/excpt.nim4
-rw-r--r--lib/system/repr.nim2
-rw-r--r--lib/system/strmantle.nim2
-rw-r--r--lib/system/strs_v2.nim2
-rw-r--r--lib/system/sysstr.nim2
6 files changed, 7 insertions, 7 deletions
diff --git a/lib/system/dyncalls.nim b/lib/system/dyncalls.nim
index d5ebe3c19..de22f7cbb 100644
--- a/lib/system/dyncalls.nim
+++ b/lib/system/dyncalls.nim
@@ -161,7 +161,7 @@ elif defined(windows) or defined(dos):
         dec(m)
         k = k div 10
         if k == 0: break
-      result = getProcAddress(cast[THINSTANCE](lib), addr decorated)
+      result = getProcAddress(cast[THINSTANCE](lib), cast[cstring](addr decorated))
       if result != nil: return
     procAddrError(name)
 
diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim
index c76be554f..86cfff9cd 100644
--- a/lib/system/excpt.nim
+++ b/lib/system/excpt.nim
@@ -397,9 +397,9 @@ proc reportUnhandledErrorAux(e: ref Exception) {.nodestroy, gcsafe.} =
     xadd(buf, e.name, e.name.len)
     add(buf, "]\n")
     if onUnhandledException != nil:
-      onUnhandledException($buf.addr)
+      onUnhandledException($cast[cstring](buf.addr))
     else:
-      showErrorMessage(buf.addr, L)
+      showErrorMessage(cast[cstring](buf.addr), L)
 
 proc reportUnhandledError(e: ref Exception) {.nodestroy, gcsafe.} =
   if unhandledExceptionHook != nil:
diff --git a/lib/system/repr.nim b/lib/system/repr.nim
index e049d18fa..e47220656 100644
--- a/lib/system/repr.nim
+++ b/lib/system/repr.nim
@@ -17,7 +17,7 @@ proc reprFloat(x: float): string {.compilerproc.} = return $x
 
 proc reprPointer(x: pointer): string {.compilerproc.} =
   result = newString(60)
-  let n = c_sprintf(addr result[0], "%p", x)
+  let n = c_sprintf(cast[cstring](addr result[0]), "%p", x)
   setLen(result, n)
 
 proc reprStrAux(result: var string, s: cstring; len: int) =
diff --git a/lib/system/strmantle.nim b/lib/system/strmantle.nim
index cb67185ab..3c6ac718b 100644
--- a/lib/system/strmantle.nim
+++ b/lib/system/strmantle.nim
@@ -232,7 +232,7 @@ proc nimParseBiggestFloat(s: openArray[char], number: var BiggestFloat,
   t[ti-2] = ('0'.ord + absExponent mod 10).char
   absExponent = absExponent div 10
   t[ti-3] = ('0'.ord + absExponent mod 10).char
-  number = c_strtod(addr t, nil)
+  number = c_strtod(cast[cstring](addr t), nil)
 
 when defined(nimHasInvariant):
   {.pop.} # staticBoundChecks
diff --git a/lib/system/strs_v2.nim b/lib/system/strs_v2.nim
index 74b9e7cd9..e5ab236d2 100644
--- a/lib/system/strs_v2.nim
+++ b/lib/system/strs_v2.nim
@@ -89,7 +89,7 @@ proc cstrToNimstr(str: cstring): NimStringV2 {.compilerRtl.} =
 
 proc nimToCStringConv(s: NimStringV2): cstring {.compilerproc, nonReloadable, inline.} =
   if s.len == 0: result = cstring""
-  else: result = cstring(unsafeAddr s.p.data)
+  else: result = cast[cstring](unsafeAddr s.p.data)
 
 proc appendString(dest: var NimStringV2; src: NimStringV2) {.compilerproc, inline.} =
   if src.len > 0:
diff --git a/lib/system/sysstr.nim b/lib/system/sysstr.nim
index 7655d9004..be32652d8 100644
--- a/lib/system/sysstr.nim
+++ b/lib/system/sysstr.nim
@@ -91,7 +91,7 @@ proc copyStr(s: NimString, start: int): NimString {.compilerproc.} =
 
 proc nimToCStringConv(s: NimString): cstring {.compilerproc, nonReloadable, inline.} =
   if s == nil or s.len == 0: result = cstring""
-  else: result = cstring(addr s.data)
+  else: result = cast[cstring](addr s.data)
 
 proc toNimStr(str: cstring, len: int): NimString {.compilerproc.} =
   result = rawNewStringNoInit(len)