Merge pull request #3106 from def-/deprecation
Fix a few deprecation warnings
This commit is contained in:
commit
03f4aa23d7
30 changed files with 46 additions and 62 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
import unsigned
|
||||
|
||||
type
|
||||
MersenneTwister* = object
|
||||
mt: array[0..623, uint32]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue