minor style changes

This commit is contained in:
Araq 2019-07-11 00:28:20 +02:00
commit cb3c3c306c
15 changed files with 134 additions and 110 deletions

View file

@ -190,7 +190,7 @@ else:
proc atomicInc*(memLoc: var int, x: int = 1): int =
when someGcc and hasThreadSupport:
result = atomic_add_fetch(memLoc.addr, x, ATOMIC_RELAXED)
result = atomicAddFetch(memLoc.addr, x, ATOMIC_RELAXED)
elif defined(vcc) and hasThreadSupport:
result = addAndFetch(memLoc.addr, x)
inc(result, x)
@ -200,10 +200,10 @@ proc atomicInc*(memLoc: var int, x: int = 1): int =
proc atomicDec*(memLoc: var int, x: int = 1): int =
when someGcc and hasThreadSupport:
when declared(atomic_sub_fetch):
result = atomic_sub_fetch(memLoc.addr, x, ATOMIC_RELAXED)
when declared(atomicSubFetch):
result = atomicSubFetch(memLoc.addr, x, ATOMIC_RELAXED)
else:
result = atomic_add_fetch(memLoc.addr, -x, ATOMIC_RELAXED)
result = atomicAddFetch(memLoc.addr, -x, ATOMIC_RELAXED)
elif defined(vcc) and hasThreadSupport:
result = addAndFetch(memLoc.addr, -x)
dec(result, x)

View file

@ -225,7 +225,7 @@ when emulatedThreadVars:
proc GetThreadLocalVars(): pointer {.compilerRtl, inl.} =
result = addr(cast[PGcThread](threadVarGetValue(globalsSlot)).tls)
proc initThreadVarsEmulation() {.compilerProc, inline.} =
proc initThreadVarsEmulation() {.compilerproc, inline.} =
when not defined(useNimRtl):
globalsSlot = threadVarAlloc()
when declared(mainThread):