summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2012-03-16 05:33:21 +0200
committerZahary Karadjov <zahary@gmail.com>2012-03-16 05:33:21 +0200
commit72f2a6e2755cdeaf1db85a9b119b694b9a2cb472 (patch)
treecb4dc5c42656a876337dbfce21e176d204ee35f6 /lib
parent84806e6a61da2641b6e8cb34800c874dc74b90af (diff)
downloadNim-72f2a6e2755cdeaf1db85a9b119b694b9a2cb472.tar.gz
the test suite is mostly green again
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/collections/sequtils.nim2
-rwxr-xr-xlib/pure/colors.nim6
-rwxr-xr-xlib/pure/os.nim4
-rwxr-xr-xlib/wrappers/sdl/sdl.nim4
4 files changed, 8 insertions, 8 deletions
diff --git a/lib/pure/collections/sequtils.nim b/lib/pure/collections/sequtils.nim
index b7a57ac0c..e3034d635 100644
--- a/lib/pure/collections/sequtils.nim
+++ b/lib/pure/collections/sequtils.nim
@@ -50,7 +50,7 @@ proc filter*[T](seq1: seq[T], pred: proc(item: T): bool): seq[T] =
   ## Returns all items in a sequence that fulfilled the predicate.
   accumulateResult(filter(seq1, pred))
 
-template filterIt*(seq1, pred: expr): expr =
+template filterIt*(seq1, pred: expr): expr {.immediate.} =
   ## Finds a specific item in a sequence as long as the 
   ## predicate returns true. The predicate needs to be an expression
   ## containing ``it``: ``filterIt("abcxyz", it == 'x')``.
diff --git a/lib/pure/colors.nim b/lib/pure/colors.nim
index 6a86a43c4..00edaad9c 100755
--- a/lib/pure/colors.nim
+++ b/lib/pure/colors.nim
@@ -17,15 +17,15 @@ type
 proc `==` *(a, b: TColor): bool {.borrow.}
   ## compares two colors.
   
-template extract(a: TColor, r, g, b: expr) =
+template extract(a: TColor, r, g, b: expr) {.immediate.}=
   var r = a.int shr 16 and 0xff
   var g = a.int shr 8 and 0xff
   var b = a.int and 0xff
   
-template rawRGB(r, g, b: expr): expr =
+template rawRGB(r, g, b: int): expr =
   TColor(r shl 16 or g shl 8 or b)
   
-template colorOp(op: expr) =
+template colorOp(op: expr) {.immediate.} =
   extract(a, ar, ag, ab)
   extract(b, br, bg, bb)
   result = rawRGB(op(ar, br), op(ag, bg), op(ab, bb))
diff --git a/lib/pure/os.nim b/lib/pure/os.nim
index 76f934c04..5ea93eb06 100755
--- a/lib/pure/os.nim
+++ b/lib/pure/os.nim
@@ -242,12 +242,12 @@ proc UnixToNativePath*(path: string): string {.
         inc(i)
 
 when defined(windows):
-  template wrapUnary(varname, winApiProc, arg: expr) =
+  template wrapUnary(varname, winApiProc, arg: expr) {.immediate.} =
     var tmp = allocWideCString(arg)
     var varname = winApiProc(tmp)
     dealloc tmp
 
-  template wrapBinary(varname, winApiProc, arg, arg2: expr) =
+  template wrapBinary(varname, winApiProc, arg, arg2: expr) {.immediate.} =
     var tmp2 = allocWideCString(arg)
     var varname = winApiProc(tmp2, arg2)
     dealloc tmp2
diff --git a/lib/wrappers/sdl/sdl.nim b/lib/wrappers/sdl/sdl.nim
index 8ddab49dd..cf4eb452d 100755
--- a/lib/wrappers/sdl/sdl.nim
+++ b/lib/wrappers/sdl/sdl.nim
@@ -1284,9 +1284,9 @@ type                          # This is the system-independent thread info struc
   TProcedure* = proc ()
 
 type TEventSeq = set[TEventKind]
-template evconv(procName: expr, ptrName: typeDesc, assertions: TEventSeq): stmt =
+template evconv(procName: expr, ptrName: typeDesc, assertions: TEventSeq): stmt {.immediate.} =
   proc `procName`*(event: PEvent): ptrName =
-    assert(assertions.contains(event.kind))
+    assert(contains(assertions, event.kind))
     result = cast[ptrName](event)
 
 evconv(EvActive, PActiveEvent, {ACTIVEEVENT})