case consistency: next steps

This commit is contained in:
Araq 2013-12-29 01:13:51 +01:00
commit 438703f59e
77 changed files with 513 additions and 514 deletions

View file

@ -144,7 +144,7 @@ proc objectInitAux(dest: pointer, n: ptr TNimNode) =
var d = cast[TAddress](dest)
case n.kind
of nkNone: sysAssert(false, "objectInitAux")
of nkSLot: objectInit(cast[pointer](d +% n.offset), n.typ)
of nkSlot: objectInit(cast[pointer](d +% n.offset), n.typ)
of nkList:
for i in 0..n.len-1:
objectInitAux(dest, n.sons[i])

View file

@ -10,7 +10,7 @@
# Implementation of some runtime checks.
proc raiseRangeError(val: BiggestInt) {.compilerproc, noreturn, noinline.} =
when hostOs == "standalone":
when hostOS == "standalone":
sysFatal(EOutOfRange, "value out of range")
else:
sysFatal(EOutOfRange, "value out of range: ", $val)

View file

@ -573,7 +573,7 @@ proc scan(s: PCell) =
proc collectWhite(s: PCell) =
if s.color == rcWhite and s notin gch.cycleRoots:
s.setcolor(rcBlack)
s.setColor(rcBlack)
forAllChildren(s, waCollectWhite)
freeCyclicCell(gch, s)
@ -891,7 +891,7 @@ proc collectZCT(gch: var TGcHeap): bool =
const workPackage = 100
var L = addr(gch.zct.len)
when withRealtime:
when withRealTime:
var steps = workPackage
var t0: TTicks
if gch.maxPause > 0: t0 = getticks()
@ -904,7 +904,7 @@ proc collectZCT(gch: var TGcHeap): bool =
c.refcount = c.refcount and not ZctFlag
gch.zct.d[0] = gch.zct.d[L[] - 1]
dec(L[])
when withRealtime: dec steps
when withRealTime: dec steps
if c.refcount <% rcIncrement:
# It may have a RC > 0, if it is in the hardware stack or
# it has not been removed yet from the ZCT. This is because
@ -927,7 +927,7 @@ proc collectZCT(gch: var TGcHeap): bool =
else:
sysAssert(c.typ != nil, "collectZCT 2")
zeroMem(c, sizeof(TCell))
when withRealtime:
when withRealTime:
if steps == 0:
steps = workPackage
if gch.maxPause > 0:
@ -952,7 +952,7 @@ proc unmarkStackAndRegisters(gch: var TGcHeap) =
gch.decStack.len = 0
proc collectCTBody(gch: var TGcHeap) =
when withRealtime:
when withRealTime:
let t0 = getticks()
sysAssert(allocInv(gch.region), "collectCT: begin")
@ -975,7 +975,7 @@ proc collectCTBody(gch: var TGcHeap) =
unmarkStackAndRegisters(gch)
sysAssert(allocInv(gch.region), "collectCT: end")
when withRealtime:
when withRealTime:
let duration = getticks() - t0
gch.stat.maxPause = max(gch.stat.maxPause, duration)
when defined(reportMissedDeadlines):
@ -997,7 +997,7 @@ proc collectCT(gch: var TGcHeap) =
markForDebug(gch)
collectCTBody(gch)
when withRealtime:
when withRealTime:
proc toNano(x: int): TNanos {.inline.} =
result = x * 1000

View file

@ -95,7 +95,7 @@ proc write(f: TFile, i: int) =
fprintf(f, "%ld", i)
proc write(f: TFile, i: BiggestInt) =
when sizeof(Biggestint) == 8:
when sizeof(BiggestInt) == 8:
fprintf(f, "%lld", i)
else:
fprintf(f, "%ld", i)
@ -235,17 +235,17 @@ proc fwrite(buf: pointer, size, n: int, f: TFile): int {.
proc readBuffer(f: TFile, buffer: pointer, len: int): int =
result = fread(buffer, 1, len, f)
proc readBytes(f: TFile, a: var openarray[int8], start, len: int): int =
proc readBytes(f: TFile, a: var openArray[int8], start, len: int): int =
result = readBuffer(f, addr(a[start]), len)
proc readChars(f: TFile, a: var openarray[char], start, len: int): int =
proc readChars(f: TFile, a: var openArray[char], start, len: int): int =
result = readBuffer(f, addr(a[start]), len)
{.push stackTrace:off, profiler:off.}
proc writeBytes(f: TFile, a: openarray[int8], start, len: int): int =
proc writeBytes(f: TFile, a: openArray[int8], start, len: int): int =
var x = cast[ptr array[0..1000_000_000, int8]](a)
result = writeBuffer(f, addr(x[start]), len)
proc writeChars(f: TFile, a: openarray[char], start, len: int): int =
proc writeChars(f: TFile, a: openArray[char], start, len: int): int =
var x = cast[ptr array[0..1000_000_000, int8]](a)
result = writeBuffer(f, addr(x[start]), len)
proc writeBuffer(f: TFile, buffer: pointer, len: int): int =