Merge pull request #3106 from def-/deprecation

Fix a few deprecation warnings
This commit is contained in:
Andreas Rumpf 2016-02-06 15:22:19 +01:00
commit 03f4aa23d7
30 changed files with 46 additions and 62 deletions

View file

@ -1,6 +1,6 @@
#nim c -t:-march=i686 --cpu:amd64 --threads:on -d:release lockfreehash.nim
import unsigned, math, hashes
import math, hashes
#------------------------------------------------------------------------------
## Memory Utility Functions

View file

@ -328,10 +328,10 @@ proc distinguishedSlave(w: ptr Worker) {.thread.} =
if w.q.len != 0: w.cleanFlowVars
var
workers: array[MaxThreadPoolSize, TThread[ptr Worker]]
workers: array[MaxThreadPoolSize, Thread[ptr Worker]]
workersData: array[MaxThreadPoolSize, Worker]
distinguished: array[MaxDistinguishedThread, TThread[ptr Worker]]
distinguished: array[MaxDistinguishedThread, Thread[ptr Worker]]
distinguishedData: array[MaxDistinguishedThread, Worker]
when defined(nimPinToCpu):
@ -468,7 +468,7 @@ proc nimSpawn3(fn: WorkerProc; data: pointer) {.compilerProc.} =
await(gSomeReady)
var
distinguishedLock: TLock
distinguishedLock: Lock
initLock distinguishedLock

View file

@ -1,5 +1,3 @@
import unsigned
type
MersenneTwister* = object
mt: array[0..623, uint32]

View file

@ -876,7 +876,7 @@ elif not defined(useNimRtl):
let sizeRead = read(data.pErrorPipe[readIdx], addr error, sizeof(error))
if sizeRead == sizeof(error):
raiseOSError("Could not find command: '$1'. OS error: $2" %
[$data.sysCommand, $strerror(error)])
[$data.sysCommand, $strerror(error)])
return pid

View file

@ -9,7 +9,7 @@
# TODO: Docs.
import os, unsigned, hashes
import os, hashes
when defined(linux):
import posix, epoll
@ -118,7 +118,7 @@ elif defined(linux):
# are therefore constantly ready. (leading to 100% CPU usage).
if epoll_ctl(s.epollFD, EPOLL_CTL_DEL, fd, nil) != 0:
raiseOSError(osLastError())
s.fds.mget(fd).events = events
s.fds[fd].events = events
else:
var event = createEventStruct(events, fd)
if s.fds[fd].events == {}:
@ -129,7 +129,7 @@ elif defined(linux):
else:
if epoll_ctl(s.epollFD, EPOLL_CTL_MOD, fd, addr(event)) != 0:
raiseOSError(osLastError())
s.fds.mget(fd).events = events
s.fds[fd].events = events
proc unregister*(s: var Selector, fd: SocketHandle) =
if epoll_ctl(s.epollFD, EPOLL_CTL_DEL, fd, nil) != 0:
@ -229,7 +229,7 @@ elif defined(macosx) or defined(freebsd) or defined(openbsd) or defined(netbsd):
modifyKQueue(s.kqFD, fd, event, EV_ADD)
for event in previousEvents-events:
modifyKQueue(s.kqFD, fd, event, EV_DELETE)
s.fds.mget(fd).events = events
s.fds[fd].events = events
proc unregister*(s: var Selector, fd: SocketHandle) =
for event in s.fds[fd].events:
@ -298,7 +298,7 @@ elif not defined(nimdoc):
proc update*(s: var Selector, fd: SocketHandle, events: set[Event]) =
#if not s.fds.hasKey(fd):
# raise newException(ValueError, "File descriptor not found.")
s.fds.mget(fd).events = events
s.fds[fd].events = events
proc unregister*(s: var Selector, fd: SocketHandle) =
s.fds.del(fd)