summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-06-21 00:47:58 +0200
committerAraq <rumpf_a@web.de>2011-06-21 00:47:58 +0200
commitcfb107f3466b185f97c2d33d09a9e6dfa0b6e6b6 (patch)
tree514423de2be57d74dbccb6a674761b1d77a19f54 /lib/pure
parentf1100356b1dc08558f51a6d360d272c000e1c4bd (diff)
downloadNim-cfb107f3466b185f97c2d33d09a9e6dfa0b6e6b6.tar.gz
implemented write access to s[i] for macros
Diffstat (limited to 'lib/pure')
-rwxr-xr-xlib/pure/algorithm.nim6
-rwxr-xr-xlib/pure/osproc.nim4
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/pure/algorithm.nim b/lib/pure/algorithm.nim
index 517819e1c..b08770e30 100755
--- a/lib/pure/algorithm.nim
+++ b/lib/pure/algorithm.nim
@@ -40,7 +40,7 @@ proc merge[T](a, b: var openArray[T], lo, m, hi: int,
               cmp: proc (x, y: T): int, order: TSortOrder) =
   template `<-` (a, b: expr) = 
     when onlySafeCode:
-      a = b
+      shallowCopy(a, b)
     else:
       copyMem(addr(a), addr(b), sizeof(T))
   # optimization: If max(left) <= min(right) there is nothing to do!
@@ -54,7 +54,7 @@ proc merge[T](a, b: var openArray[T], lo, m, hi: int,
   when onlySafeCode:
     var bb = 0
     while j <= m:
-      b[bb] = a[j]
+      b[bb] <- a[j]
       inc(bb)
       inc(j)
   else:
@@ -74,7 +74,7 @@ proc merge[T](a, b: var openArray[T], lo, m, hi: int,
   # copy rest of b:
   when onlySafeCode:
     while k < j:
-      a[k] = b[i]
+      a[k] <- b[i]
       inc(k)
       inc(i)
   else:
diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim
index de5317717..60bef813d 100755
--- a/lib/pure/osproc.nim
+++ b/lib/pure/osproc.nim
@@ -475,9 +475,9 @@ elif not defined(useNimRtl):
     result.exitCode = -3 # for ``waitForExit``
     if pipe(p_stdin) != 0'i32 or pipe(p_stdout) != 0'i32 or
        pipe(p_stderr) != 0'i32:
-      OSError("failed to create a pipe")
+      OSError()
     var Pid = fork()
-    if Pid < 0: OSError("failed to fork process")
+    if Pid < 0: OSError()
 
     if pid == 0:
       ## child process: