diff options
-rw-r--r-- | tests/macros/tvtable.nim | 4 | ||||
-rw-r--r-- | tests/misc/tmandelbrot.nim | 22 |
2 files changed, 13 insertions, 13 deletions
diff --git a/tests/macros/tvtable.nim b/tests/macros/tvtable.nim index cc5d7a5d9..dc07a726b 100644 --- a/tests/macros/tvtable.nim +++ b/tests/macros/tvtable.nim @@ -58,10 +58,10 @@ proc create(T: typedesc): T = result.vtbl = getVTable(T) proc baseFoo(o: var TBase): int = - return cast[fooProc[TBase]](o.vtbl[0]) (o) + return cast[fooProc[TBase]](o.vtbl[0])(o) proc baseBar(o: var TBase) = - cast[barProc[TBase]](o.vtbl[1]) (o) + cast[barProc[TBase]](o.vtbl[1])(o) var a = TUserObject1.create var b = TUserObject2.create diff --git a/tests/misc/tmandelbrot.nim b/tests/misc/tmandelbrot.nim index e9b7a3e5a..504628313 100644 --- a/tests/misc/tmandelbrot.nim +++ b/tests/misc/tmandelbrot.nim @@ -20,38 +20,38 @@ proc `*` (a, b: TComplex): TComplex = proc abs2 (a: TComplex): float = return a.re * a.re + a.im * a.im -var size = parseInt (paramStr (1)) +var size = parseInt(paramStr(1)) var bit = 128 var byteAcc = 0 -stdout.writeLine ("P4") -stdout.write ($size) -stdout.write (" ") -stdout.writeLine ($size) +stdout.writeLine("P4") +stdout.write($size) +stdout.write(" ") +stdout.writeLine($size) -var fsize = float (size) +var fsize = float(size) for y in 0 .. size-1: - var fy = 2.0 * float (y) / fsize - 1.0 + var fy = 2.0 * float(y) / fsize - 1.0 for x in 0 .. size-1: var z = (0.0, 0.0) - var c = (float (2*x) / fsize - 1.5, fy) + var c = (float(2*x) / fsize - 1.5, fy) block iter: for i in 0 .. 49: z = z*z + c - if abs2 (z) >= 4.0: + if abs2(z) >= 4.0: break iter byteAcc = byteAcc + bit if bit > 1: bit = bit div 2 else: - stdout.write (chr (byteAcc)) + stdout.write(chr(byteAcc)) bit = 128 byteAcc = 0 if bit != 128: - stdout.write (chr (byteAcc)) + stdout.write(chr(byteAcc)) bit = 128 byteAcc = 0 |