minor changes to make the test suite green again

This commit is contained in:
Zahary Karadjov
2012-04-15 02:54:12 +03:00
parent 57fe3e8c41
commit 1ba31f8df7
3 changed files with 7 additions and 14 deletions

View File

@@ -29,19 +29,14 @@ 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))
template satPlus(a, b: expr): expr =
# saturated plus:
block:
var result = a +% b
if result > 255: result = 255
result
template satMinus(a, b: expr): expr =
block:
var result = a -% b
if result < 0: result = 0
result
proc satPlus(a, b: int): int {.inline.} =
result = a +% b
if result > 255: result = 255
proc satMinus(a, b: int): int {.inline.} =
result = a -% b
if result < 0: result = 0
proc `+`*(a, b: TColor): TColor =
## adds two colors: This uses saturated artithmetic, so that each color

View File

@@ -1738,7 +1738,6 @@ when isMainModule:
else:
assert false
var matches: array[0..5, string]
if match("abcdefg", peg"c {d} ef {g}", matches, 2):
assert matches[0] == "d"
assert matches[1] == "g"

View File

@@ -1734,7 +1734,6 @@ when isMainModule:
else:
doAssert false
var matches: array[0..5, string]
if match("abcdefg", peg"c {d} ef {g}", matches, 2):
doAssert matches[0] == "d"
doAssert matches[1] == "g"