lots of small changes

This commit is contained in:
Arne Döring 2018-12-05 19:03:01 +01:00 • committed by Araq
commit a5ecbf823f
85 changed files with 180 additions and 110 deletions

View file

@ -106,7 +106,7 @@ proc readChar*(buffer: PBuffer): char {.inline.} = return readInt8(buffer).char
proc readBool*(buffer: PBuffer): bool {.inline.} = return readInt8(buffer).bool
when isMainModule:
when true:
var b = newBuffer(100)
var str = "hello there"
b.write str

View file

@ -17,7 +17,7 @@ template unless*(condition: untyped; body: untyped) {.dirty.} =
if not condition:
body
when isMainModule:
when true:
proc dumpSeq[T](x: seq[T]) =
for index, item in x.pairs:
echo index, " ", item

View file

@ -92,7 +92,7 @@ defPacket(DsMsg, tuple[msg: string])
let HVerifyClient* = 'v'
defPacket(SdVerifyClient, tuple[session: ScLogin])
when isMainModule:
when true:
var buf = newBuffer(100)
var m = toMd5("hello there")

View file

@ -20,7 +20,7 @@ proc uncompress*(source: string, destLen: var int): string =
echo "Error occurred: ", res
when isMainModule:
when true:
import strutils
var r = compress("Hello")
echo repr(r)