removes deprecated T/P types

This commit is contained in:
Araq 2018-11-16 13:27:46 +01:00
commit 3f6168b337
64 changed files with 43 additions and 276 deletions

View file

@ -17,8 +17,6 @@ type
## or not is unspecified! ## or not is unspecified!
Cond* = SysCond ## Nim condition variable Cond* = SysCond ## Nim condition variable
{.deprecated: [TLock: Lock, TCond: Cond].}
{.push stackTrace: off.} {.push stackTrace: off.}
proc initLock*(lock: var Lock) {.inline.} = proc initLock*(lock: var Lock) {.inline.} =

View file

@ -418,8 +418,6 @@ type
## if not ambiguous (this cannot be achieved with ## if not ambiguous (this cannot be achieved with
## any other means in the language currently) ## any other means in the language currently)
{.deprecated: [TBindSymRule: BindSymRule].}
proc bindSym*(ident: string | NimNode, rule: BindSymRule = brClosed): NimNode {. proc bindSym*(ident: string | NimNode, rule: BindSymRule = brClosed): NimNode {.
magic: "NBindSym", noSideEffect.} magic: "NBindSym", noSideEffect.}
## creates a node that binds `ident` to a symbol node. The bound symbol ## creates a node that binds `ident` to a symbol node. The bound symbol

View file

@ -83,8 +83,6 @@ when not defined(js):
template `rawType=`(x: var Any, p: PNimType) = template `rawType=`(x: var Any, p: PNimType) =
x.rawTypePtr = cast[pointer](p) x.rawTypePtr = cast[pointer](p)
{.deprecated: [TAny: Any, TAnyKind: AnyKind].}
when defined(gogc): when defined(gogc):
const GenericSeqSize = (3 * sizeof(int)) const GenericSeqSize = (3 * sizeof(int))
else: else:

View file

@ -111,7 +111,6 @@ type
actors: seq[PActor[In, Out]] actors: seq[PActor[In, Out]]
when Out isnot void: when Out isnot void:
outputs: Channel[Out] outputs: Channel[Out]
{.deprecated: [TActorPool: ActorPool].}
proc `^`*[T](f: ptr Channel[T]): T = proc `^`*[T](f: ptr Channel[T]): T =
## alias for 'recv'. ## alias for 'recv'.

View file

@ -147,11 +147,6 @@ type
SockIdle, SockConnecting, SockConnected, SockListening, SockClosed, SockIdle, SockConnecting, SockConnected, SockListening, SockClosed,
SockUDPBound SockUDPBound
{.deprecated: [TDelegate: DelegateObj, PDelegate: Delegate,
TInfo: SocketStatus, PAsyncSocket: AsyncSocket, TAsyncSocket: AsyncSocketObj,
TDispatcher: DispatcherObj, PDispatcher: Dispatcher,
].}
proc newDelegate*(): Delegate = proc newDelegate*(): Delegate =
## Creates a new delegate. ## Creates a new delegate.

View file

@ -108,11 +108,6 @@ type
ReplyError* = object of IOError ReplyError* = object of IOError
FTPError* = object of IOError FTPError* = object of IOError
{.deprecated: [
TFTPClient: FTPClientObj, TFTPJob: FTPJob, PAsyncFTPClient: AsyncFTPClient,
TAsyncFTPClient: AsyncFTPClientObj, TFTPEvent: FTPEvent,
EInvalidReply: ReplyError, EFTP: FTPError
].}
const multiLineLimit = 10000 const multiLineLimit = 10000

View file

@ -22,8 +22,6 @@ type
scheme, username, password, scheme, username, password,
hostname, port, path, query, anchor: string] hostname, port, path, query, anchor: string]
{.deprecated: [TUrl: Url].}
proc parseUrl*(url: string): Url {.deprecated.} = proc parseUrl*(url: string): Url {.deprecated.} =
var i = 0 var i = 0

View file

@ -70,9 +70,6 @@ when defined(ssl):
SSLAcceptResult* = enum SSLAcceptResult* = enum
AcceptNoClient = 0, AcceptNoHandshake, AcceptSuccess AcceptNoClient = 0, AcceptNoHandshake, AcceptSuccess
{.deprecated: [ESSL: SSLError, TSSLCVerifyMode: SSLCVerifyMode,
TSSLProtVersion: SSLProtVersion, PSSLContext: SSLContext,
TSSLAcceptResult: SSLAcceptResult].}
const const
BufferSize*: int = 4000 ## size of a buffered socket's buffer BufferSize*: int = 4000 ## size of a buffered socket's buffer
@ -147,12 +144,6 @@ type
TimeoutError* = object of Exception TimeoutError* = object of Exception
{.deprecated: [TSocket: Socket, TType: SockType, TPort: Port, TDomain: Domain,
TProtocol: Protocol, TServent: Servent, THostent: Hostent,
TSOBool: SOBool, TRecvLineResult: RecvLineResult,
TReadLineResult: ReadLineResult, ETimeout: TimeoutError,
TSocketImpl: SocketImpl].}
when defined(booting): when defined(booting):
let invalidSocket*: Socket = nil ## invalid socket let invalidSocket*: Socket = nil ## invalid socket
else: else:

View file

@ -96,7 +96,6 @@ type
## column text on demand ## column text on demand
row: cstringArray row: cstringArray
len: int len: int
{.deprecated: [TRow: Row, TDbConn: DbConn].}
proc dbError*(db: DbConn) {.noreturn.} = proc dbError*(db: DbConn) {.noreturn.} =
## raises a DbError exception. ## raises a DbError exception.

View file

@ -101,8 +101,6 @@ type
## used to get a row's ## used to get a row's
## column text on demand ## column text on demand
{.deprecated: [TRow: Row, TSqlQuery: SqlQuery, TDbConn: DbConn].}
var var
buf: array[0..4096, char] buf: array[0..4096, char]

View file

@ -76,7 +76,6 @@ type
res: PPGresult ## used to get a row's res: PPGresult ## used to get a row's
line: int ## column text on demand line: int ## column text on demand
SqlPrepared* = distinct string ## a identifier for the prepared queries SqlPrepared* = distinct string ## a identifier for the prepared queries
{.deprecated: [TRow: Row, TDbConn: DbConn, TSqlPrepared: SqlPrepared].}
proc dbError*(db: DbConn) {.noreturn.} = proc dbError*(db: DbConn) {.noreturn.} =
## raises a DbError exception. ## raises a DbError exception.

View file

@ -94,7 +94,6 @@ type
## converted to nil. ## converted to nil.
InstantRow* = Pstmt ## a handle that can be used to get a row's column InstantRow* = Pstmt ## a handle that can be used to get a row's column
## text on demand ## text on demand
{.deprecated: [TRow: Row, TDbConn: DbConn].}
proc dbError*(db: DbConn) {.noreturn.} = proc dbError*(db: DbConn) {.noreturn.} =
## raises a DbError exception. ## raises a DbError exception.

View file

@ -21,7 +21,6 @@ type
SecureSocket* = object SecureSocket* = object
ssl: SslPtr ssl: SslPtr
bio: BIO bio: BIO
{.deprecated: [TSecureSocket: SecureSocket].}
proc connect*(sock: var SecureSocket, address: string, proc connect*(sock: var SecureSocket, address: string,
port: int): int = port: int): int =

View file

@ -19,7 +19,6 @@ type
cookie*{.importc: "cookie".}: uint32 # Cookie to synchronize two events. cookie*{.importc: "cookie".}: uint32 # Cookie to synchronize two events.
len*{.importc: "len".}: uint32 # Length (including NULs) of name. len*{.importc: "len".}: uint32 # Length (including NULs) of name.
name*{.importc: "name".}: char # Name. name*{.importc: "name".}: char # Name.
{.deprecated: [Tinotify_event: InotifyEvent].}
# Supported events suitable for MASK parameter of INOTIFY_ADD_WATCH. # Supported events suitable for MASK parameter of INOTIFY_ADD_WATCH.
const const

View file

@ -100,7 +100,6 @@ else:
include posix_other include posix_other
# There used to be this name in posix.nim a long time ago, not sure why! # There used to be this name in posix.nim a long time ago, not sure why!
{.deprecated: [cSIG_HOLD: SIG_HOLD].}
when StatHasNanoseconds: when StatHasNanoseconds:
proc st_atime*(s: Stat): Time {.inline.} = proc st_atime*(s: Stat): Time {.inline.} =

View file

@ -27,13 +27,10 @@ type
DIR* {.importc: "DIR", header: "<dirent.h>", DIR* {.importc: "DIR", header: "<dirent.h>",
incompleteStruct.} = object incompleteStruct.} = object
## A type representing a directory stream. ## A type representing a directory stream.
{.deprecated: [TDIR: DIR].}
type type
SocketHandle* = distinct cint # The type used to represent socket descriptors SocketHandle* = distinct cint # The type used to represent socket descriptors
{.deprecated: [TSocketHandle: SocketHandle].}
# not detected by detect.nim, guarded by #ifdef __USE_UNIX98 in glibc # not detected by detect.nim, guarded by #ifdef __USE_UNIX98 in glibc
const SIG_HOLD* = cast[SigHandler](2) const SIG_HOLD* = cast[SigHandler](2)
@ -375,29 +372,6 @@ type
## context is active. ## context is active.
# todo fpregds_mem # todo fpregds_mem
{.deprecated: [TOff: Off, TPid: Pid, TGid: Gid, TMode: Mode, TDev: Dev,
TNlink: Nlink, TStack: Stack, TGroup: Group, TMqd: Mqd,
TPasswd: Passwd, TClock: Clock, TClockId: ClockId, TKey: Key,
TSem: Sem, Tpthread_attr: PthreadAttr, Ttimespec: Timespec,
Tdirent: Dirent, TGlob: Glob,
# Tflock: Flock, # Naming conflict if we drop the `T`
Ticonv: Iconv, Tlconv: Lconv, TMqAttr: MqAttr, Tblkcnt: Blkcnt,
Tblksize: Blksize, Tfsblkcnt: Fsblkcnt, Tfsfilcnt: Fsfilcnt,
Tid: Id, Tino: Ino, Tpthread_barrier: Pthread_barrier,
Tpthread_barrierattr: Pthread_barrierattr, Tpthread_cond: Pthread_cond,
TPthread_condattr: Pthread_condattr, Tpthread_key: Pthread_key,
Tpthread_mutex: Pthread_mutex, Tpthread_mutexattr: Pthread_mutexattr,
Tpthread_once: Pthread_once, Tpthread_rwlock: Pthread_rwlock,
Tpthread_rwlockattr: Pthread_rwlockattr, Tpthread_spinlock: Pthread_spinlock,
Tpthread: Pthread, Tsuseconds: Suseconds, Ttimer: Timer,
Tuid: Uid, Tuseconds: Useconds, Tutsname: Utsname, Tipc_perm: Ipc_perm,
TStat: Stat, TStatvfs: Statvfs,
Ttm: Tm, titimerspec: Itimerspec, Tsig_atomic: Sig_atomic, Tsigset: Sigset,
TsigEvent: SigEvent, TsigVal: SigVal, TSigaction: Sigaction,
TSigStack: SigStack, TsigInfo: SigInfo, Tnl_item: Nl_item,
Tnl_catd: Nl_catd, Tsched_param: Sched_param,
# TFdSet: FdSet, # Naming conflict if we drop the `T`
Tmcontext: Mcontext, Tucontext: Ucontext].}
type type
Taiocb* {.importc: "struct aiocb", header: "<aio.h>", Taiocb* {.importc: "struct aiocb", header: "<aio.h>",
final, pure.} = object ## struct aiocb final, pure.} = object ## struct aiocb
@ -587,13 +561,6 @@ type
Tnfds* {.importc: "nfds_t", header: "<poll.h>".} = culong Tnfds* {.importc: "nfds_t", header: "<poll.h>".} = culong
{.deprecated: [TSockaddr_in: Sockaddr_in, TAddrinfo: AddrInfo,
TSockAddr: SockAddr, TSockLen: SockLen, TTimeval: Timeval,
Tsockaddr_storage: Sockaddr_storage, Tsockaddr_in6: Sockaddr_in6,
Thostent: Hostent, TServent: Servent,
TInAddr: InAddr, TIOVec: IOVec, TInPort: InPort, TInAddrT: InAddrT,
TIn6Addr: In6Addr, TInAddrScalar: InAddrScalar, TProtoent: Protoent].}
var var
errno* {.importc, header: "<errno.h>".}: cint ## error variable errno* {.importc, header: "<errno.h>".}: cint ## error variable
h_errno* {.importc, header: "<netdb.h>".}: cint h_errno* {.importc, header: "<netdb.h>".}: cint

View file

@ -26,13 +26,10 @@ type
DIR* {.importc: "DIR", header: "<dirent.h>", DIR* {.importc: "DIR", header: "<dirent.h>",
incompleteStruct.} = object incompleteStruct.} = object
## A type representing a directory stream. ## A type representing a directory stream.
{.deprecated: [TDIR: DIR].}
type type
SocketHandle* = distinct cint # The type used to represent socket descriptors SocketHandle* = distinct cint # The type used to represent socket descriptors
{.deprecated: [TSocketHandle: SocketHandle].}
type type
Time* {.importc: "time_t", header: "<time.h>".} = distinct clong Time* {.importc: "time_t", header: "<time.h>".} = distinct clong
@ -356,31 +353,7 @@ type
uc_stack*: Stack ## The stack used by this context. uc_stack*: Stack ## The stack used by this context.
uc_mcontext*: Mcontext ## A machine-specific representation of the saved uc_mcontext*: Mcontext ## A machine-specific representation of the saved
## context. ## context.
{.deprecated: [TOff: Off, TPid: Pid, TGid: Gid, TMode: Mode, TDev: Dev,
TNlink: Nlink, TStack: Stack, TGroup: Group, TMqd: Mqd,
TPasswd: Passwd, TClock: Clock, TClockId: ClockId, TKey: Key,
TSem: Sem, Tpthread_attr: PthreadAttr, Ttimespec: Timespec,
Tdirent: Dirent, TFTW: FTW, TGlob: Glob,
# Tflock: Flock, # Naming conflict if we drop the `T`
Ticonv: Iconv, Tlconv: Lconv, TMqAttr: MqAttr, Tblkcnt: Blkcnt,
Tblksize: Blksize, Tfsblkcnt: Fsblkcnt, Tfsfilcnt: Fsfilcnt,
Tid: Id, Tino: Ino, Tpthread_barrier: Pthread_barrier,
Tpthread_barrierattr: Pthread_barrierattr, Tpthread_cond: Pthread_cond,
TPthread_condattr: Pthread_condattr, Tpthread_key: Pthread_key,
Tpthread_mutex: Pthread_mutex, Tpthread_mutexattr: Pthread_mutexattr,
Tpthread_once: Pthread_once, Tpthread_rwlock: Pthread_rwlock,
Tpthread_rwlockattr: Pthread_rwlockattr, Tpthread_spinlock: Pthread_spinlock,
Tpthread: Pthread, Tsuseconds: Suseconds, Ttimer: Timer,
Ttrace_attr: Trace_attr, Ttrace_event_id: Trace_event_id,
Ttrace_event_set: Trace_event_set, Ttrace_id: Trace_id,
Tuid: Uid, Tuseconds: Useconds, Tutsname: Utsname, Tipc_perm: Ipc_perm,
TStat: Stat, TStatvfs: Statvfs, Tposix_typed_mem_info: Posix_typed_mem_info,
Ttm: Tm, titimerspec: Itimerspec, Tsig_atomic: Sig_atomic, Tsigset: Sigset,
TsigEvent: SigEvent, TsigVal: SigVal, TSigaction: Sigaction,
TSigStack: SigStack, TsigInfo: SigInfo, Tnl_item: Nl_item,
Tnl_catd: Nl_catd, Tsched_param: Sched_param,
# TFdSet: FdSet, # Naming conflict if we drop the `T`
Tmcontext: Mcontext, Tucontext: Ucontext].}
when hasAioH: when hasAioH:
type type
Taiocb* {.importc: "struct aiocb", header: "<aio.h>", Taiocb* {.importc: "struct aiocb", header: "<aio.h>",
@ -553,13 +526,6 @@ type
Tnfds* {.importc: "nfds_t", header: "<poll.h>".} = cint Tnfds* {.importc: "nfds_t", header: "<poll.h>".} = cint
{.deprecated: [TSockaddr_in: Sockaddr_in, TAddrinfo: AddrInfo,
TSockAddr: SockAddr, TSockLen: SockLen, TTimeval: Timeval,
Tsockaddr_storage: Sockaddr_storage, Tsockaddr_in6: Sockaddr_in6,
Thostent: Hostent, TServent: Servent,
TInAddr: InAddr, TIOVec: IOVec, TInPort: InPort, TInAddrT: InAddrT,
TIn6Addr: In6Addr, TInAddrScalar: InAddrScalar, TProtoent: Protoent].}
var var
errno* {.importc, header: "<errno.h>".}: cint ## error variable errno* {.importc, header: "<errno.h>".}: cint ## error variable
h_errno* {.importc, header: "<netdb.h>".}: cint h_errno* {.importc, header: "<netdb.h>".}: cint

View file

@ -13,7 +13,6 @@ import posix
type type
Speed* = cuint Speed* = cuint
Cflag* = cuint Cflag* = cuint
{.deprecated: [Tcflag: Cflag].}
const const
NCCS* = when defined(macosx): 20 else: 32 NCCS* = when defined(macosx): 20 else: 32

View file

@ -244,8 +244,6 @@ when defined(windows) or defined(nimdoc):
AsyncEvent* = ptr AsyncEventImpl AsyncEvent* = ptr AsyncEventImpl
Callback = proc (fd: AsyncFD): bool {.closure,gcsafe.} Callback = proc (fd: AsyncFD): bool {.closure,gcsafe.}
{.deprecated: [TCompletionKey: CompletionKey, TAsyncFD: AsyncFD,
TCustomOverlapped: CustomOverlapped, TCompletionData: CompletionData].}
proc hash(x: AsyncFD): Hash {.borrow.} proc hash(x: AsyncFD): Hash {.borrow.}
proc `==`*(x: AsyncFD, y: AsyncFD): bool {.borrow.} proc `==`*(x: AsyncFD, y: AsyncFD): bool {.borrow.}
@ -1080,7 +1078,6 @@ else:
PDispatcher* = ref object of PDispatcherBase PDispatcher* = ref object of PDispatcherBase
selector: Selector[AsyncData] selector: Selector[AsyncData]
{.deprecated: [TAsyncFD: AsyncFD, TCallback: Callback].}
proc `==`*(x, y: AsyncFD): bool {.borrow.} proc `==`*(x, y: AsyncFD): bool {.borrow.}
proc `==`*(x, y: AsyncEvent): bool {.borrow.} proc `==`*(x, y: AsyncEvent): bool {.borrow.}

View file

@ -49,13 +49,11 @@ when sizeof(int) == 4: # 32bit
Raw = range[0..1073741823] Raw = range[0..1073741823]
## The range of uint values that can be stored directly in a value slot ## The range of uint values that can be stored directly in a value slot
## when on a 32 bit platform ## when on a 32 bit platform
{.deprecated: [TRaw: Raw].}
elif sizeof(int) == 8: # 64bit elif sizeof(int) == 8: # 64bit
type type
Raw = range[0'i64..4611686018427387903'i64] Raw = range[0'i64..4611686018427387903'i64]
## The range of uint values that can be stored directly in a value slot ## The range of uint values that can be stored directly in a value slot
## when on a 64 bit platform ## when on a 64 bit platform
{.deprecated: [TRaw: Raw].}
else: else:
{.error: "unsupported platform".} {.error: "unsupported platform".}
@ -74,7 +72,6 @@ type
copyDone: int copyDone: int
next: PConcTable[K,V] next: PConcTable[K,V]
data: EntryArr data: EntryArr
{.deprecated: [TEntry: Entry, TEntryArr: EntryArr].}
proc setVal[K,V](table: var PConcTable[K,V], key: int, val: int, proc setVal[K,V](table: var PConcTable[K,V], key: int, val: int,
expVal: int, match: bool): int expVal: int, match: bool): int
@ -544,7 +541,6 @@ when not defined(testing) and isMainModule:
Data = tuple[k: string,v: TestObj] Data = tuple[k: string,v: TestObj]
PDataArr = array[0..numTests-1, Data] PDataArr = array[0..numTests-1, Data]
Dict = PConcTable[string,TestObj] Dict = PConcTable[string,TestObj]
{.deprecated: [TTestObj: TestObj, TData: Data].}
var var
thr: array[0..numThreads-1, Thread[Dict]] thr: array[0..numThreads-1, Thread[Dict]]

View file

@ -33,8 +33,6 @@ type
root: Node[T] root: Node[T]
count: int count: int
{.deprecated: [TCritBitTree: CritBitTree].}
proc len*[T](c: CritBitTree[T]): int = proc len*[T](c: CritBitTree[T]): int =
## returns the number of elements in `c` in O(1). ## returns the number of elements in `c` in O(1).
result = c.count result = c.count

View file

@ -44,8 +44,6 @@ type
data: TrunkSeq data: TrunkSeq
a: array[0..33, int] # profiling shows that 34 elements are enough a: array[0..33, int] # profiling shows that 34 elements are enough
{.deprecated: [TIntSet: IntSet, TTrunk: Trunk, TTrunkSeq: TrunkSeq].}
proc mustRehash(length, counter: int): bool {.inline.} = proc mustRehash(length, counter: int): bool {.inline.} =
assert(length > counter) assert(length > counter)
result = (length * 2 < counter * 3) or (length - counter < 4) result = (length * 2 < counter * 3) or (length - counter < 4)

View file

@ -45,15 +45,6 @@ type
SomeLinkedNode*[T] = SinglyLinkedNode[T] | DoublyLinkedNode[T] SomeLinkedNode*[T] = SinglyLinkedNode[T] | DoublyLinkedNode[T]
{.deprecated: [TDoublyLinkedNode: DoublyLinkedNodeObj,
PDoublyLinkedNode: DoublyLinkedNode,
TSinglyLinkedNode: SinglyLinkedNodeObj,
PSinglyLinkedNode: SinglyLinkedNode,
TDoublyLinkedList: DoublyLinkedList,
TSinglyLinkedRing: SinglyLinkedRing,
TDoublyLinkedRing: DoublyLinkedRing,
TSinglyLinkedList: SinglyLinkedList].}
proc initSinglyLinkedList*[T](): SinglyLinkedList[T] = proc initSinglyLinkedList*[T](): SinglyLinkedList[T] =
## creates a new singly linked list that is empty. ## creates a new singly linked list that is empty.
discard discard

View file

@ -46,8 +46,6 @@ type
data: seq[T] data: seq[T]
rd, wr, count, mask: int rd, wr, count, mask: int
{.deprecated: [TQueue: Queue].}
proc initQueue*[T](initialSize: int = 4): Queue[T] = proc initQueue*[T](initialSize: int = 4): Queue[T] =
## Create a new queue. ## Create a new queue.
## Optionally, the initial capacity can be reserved via `initialSize` as a ## Optionally, the initial capacity can be reserved via `initialSize` as a

View file

@ -39,8 +39,6 @@ type
data: KeyValuePairSeq[A] data: KeyValuePairSeq[A]
counter: int counter: int
{.deprecated: [TSet: HashSet].}
template default[T](t: typedesc[T]): T = template default[T](t: typedesc[T]): T =
## Used by clear methods to get a default value. ## Used by clear methods to get a default value.
var v: T var v: T
@ -631,8 +629,6 @@ type
data: OrderedKeyValuePairSeq[A] data: OrderedKeyValuePairSeq[A]
counter, first, last: int counter, first, last: int
{.deprecated: [TOrderedSet: OrderedSet].}
proc clear*[A](s: var OrderedSet[A]) = proc clear*[A](s: var OrderedSet[A]) =
## Clears the OrderedSet back to an empty state, without shrinking ## Clears the OrderedSet back to an empty state, without shrinking
## any of the existing storage. O(n) where n is the size of the hash bucket. ## any of the existing storage. O(n) where n is the size of the hash bucket.

View file

@ -125,8 +125,6 @@ type
counter: int counter: int
TableRef*[A,B] = ref Table[A, B] TableRef*[A,B] = ref Table[A, B]
{.deprecated: [TTable: Table, PTable: TableRef].}
template maxHash(t): untyped = high(t.data) template maxHash(t): untyped = high(t.data)
template dataLen(t): untyped = len(t.data) template dataLen(t): untyped = len(t.data)
@ -520,8 +518,6 @@ type
counter, first, last: int counter, first, last: int
OrderedTableRef*[A, B] = ref OrderedTable[A, B] OrderedTableRef*[A, B] = ref OrderedTable[A, B]
{.deprecated: [TOrderedTable: OrderedTable, POrderedTable: OrderedTableRef].}
proc len*[A, B](t: OrderedTable[A, B]): int {.inline.} = proc len*[A, B](t: OrderedTable[A, B]): int {.inline.} =
## returns the number of keys in ``t``. ## returns the number of keys in ``t``.
result = t.counter result = t.counter
@ -892,8 +888,6 @@ type
counter: int counter: int
CountTableRef*[A] = ref CountTable[A] CountTableRef*[A] = ref CountTable[A]
{.deprecated: [TCountTable: CountTable, PCountTable: CountTableRef].}
proc len*[A](t: CountTable[A]): int = proc len*[A](t: CountTable[A]): int =
## returns the number of keys in ``t``. ## returns the number of keys in ``t``.
result = t.counter result = t.counter

View file

@ -213,7 +213,6 @@ when defined(windows):
maxCharSize: int32 maxCharSize: int32
defaultChar: array[0..1, char] defaultChar: array[0..1, char]
leadByte: array[0..12-1, char] leadByte: array[0..12-1, char]
{.deprecated: [TCpInfo: CpInfo].}
proc getCPInfo(codePage: CodePage, lpCPInfo: var CpInfo): int32 {. proc getCPInfo(codePage: CodePage, lpCPInfo: var CpInfo): int32 {.
stdcall, importc: "GetCPInfo", dynlib: "kernel32".} stdcall, importc: "GetCPInfo", dynlib: "kernel32".}

View file

@ -848,8 +848,6 @@ proc newHttpClient*(userAgent = defUserAgent,
type type
AsyncHttpClient* = HttpClientBase[AsyncSocket] AsyncHttpClient* = HttpClientBase[AsyncSocket]
{.deprecated: [PAsyncHttpClient: AsyncHttpClient].}
proc newAsyncHttpClient*(userAgent = defUserAgent, proc newAsyncHttpClient*(userAgent = defUserAgent,
maxRedirects = 5, sslContext = getDefaultSSL(), maxRedirects = 5, sslContext = getDefaultSSL(),
proxy: Proxy = nil): AsyncHttpClient = proxy: Proxy = nil): AsyncHttpClient =

View file

@ -566,9 +566,6 @@ type
SqlParser* = object of SqlLexer ## SQL parser object SqlParser* = object of SqlLexer ## SQL parser object
tok: Token tok: Token
{.deprecated: [EInvalidSql: SqlParseError, PSqlNode: SqlNode,
TSqlNode: SqlNodeObj, TSqlParser: SqlParser, TSqlNodeKind: SqlNodeKind].}
proc newNode*(k: SqlNodeKind): SqlNode = proc newNode*(k: SqlNodeKind): SqlNode =
new(result) new(result)
result.kind = k result.kind = k

View file

@ -553,8 +553,6 @@ type
ml: int ml: int
origStart: int origStart: int
{.deprecated: [TCaptures: Captures].}
proc bounds*(c: Captures, proc bounds*(c: Captures,
i: range[0..MaxSubpatterns-1]): tuple[first, last: int] = i: range[0..MaxSubpatterns-1]): tuple[first, last: int] =
## returns the bounds ``[first..last]`` of the `i`'th capture. ## returns the bounds ``[first..last]`` of the `i`'th capture.

View file

@ -1987,8 +1987,6 @@ type
ffDecimal, ## use decimal floating point notation ffDecimal, ## use decimal floating point notation
ffScientific ## use scientific notation (using ``e`` character) ffScientific ## use scientific notation (using ``e`` character)
{.deprecated: [TFloatFormat: FloatFormatMode].}
proc formatBiggestFloat*(f: BiggestFloat, format: FloatFormatMode = ffDefault, proc formatBiggestFloat*(f: BiggestFloat, format: FloatFormatMode = ffDefault,
precision: range[-1..32] = 16; precision: range[-1..32] = 16;
decimalSep = '.'): string {. decimalSep = '.'): string {.

View file

@ -300,8 +300,6 @@ proc scanDollar(p: var FormatParser, a: openarray[string], s: var string) =
type type
Subex* = distinct string ## string that contains a substitution expression Subex* = distinct string ## string that contains a substitution expression
{.deprecated: [TSubex: Subex].}
proc subex*(s: string): Subex = proc subex*(s: string): Subex =
## constructs a *substitution expression* from `s`. Currently this performs ## constructs a *substitution expression* from `s`. Currently this performs
## no syntax checking but this may change in later versions. ## no syntax checking but this may change in later versions.

View file

@ -481,9 +481,6 @@ type
styleHidden, ## hidden text styleHidden, ## hidden text
styleStrikethrough ## strikethrough styleStrikethrough ## strikethrough
{.deprecated: [TStyle: Style].}
{.deprecated: [styleUnknown: styleItalic].}
when not defined(windows): when not defined(windows):
var var
gFG {.threadvar.}: int gFG {.threadvar.}: int
@ -556,9 +553,6 @@ type
bg8Bit, ## 256-color (not supported, see ``enableTrueColors`` instead.) bg8Bit, ## 256-color (not supported, see ``enableTrueColors`` instead.)
bgDefault ## default terminal background color bgDefault ## default terminal background color
{.deprecated: [TForegroundColor: ForegroundColor,
TBackgroundColor: BackgroundColor].}
when defined(windows): when defined(windows):
var defaultForegroundColor, defaultBackgroundColor: int16 = 0xFFFF'i16 # Default to an invalid value 0xFFFF var defaultForegroundColor, defaultBackgroundColor: int16 = 0xFFFF'i16 # Default to an invalid value 0xFFFF

View file

@ -298,9 +298,6 @@ type
TimeIntervalParts* = array[TimeUnit, int] # Array of Duration parts starts TimeIntervalParts* = array[TimeUnit, int] # Array of Duration parts starts
TimesMutableTypes = DateTime | Time | Duration | TimeInterval TimesMutableTypes = DateTime | Time | Duration | TimeInterval
{.deprecated: [TMonth: Month, TWeekDay: WeekDay, TTime: Time,
TTimeInterval: TimeInterval, TTimeInfo: DateTime, TimeInfo: DateTime].}
const const
secondsInMin = 60 secondsInMin = 60
secondsInHour = 60*60 secondsInHour = 60*60

View file

@ -18,8 +18,6 @@ type
Rune* = distinct RuneImpl ## type that can hold any Unicode character Rune* = distinct RuneImpl ## type that can hold any Unicode character
Rune16* = distinct int16 ## 16 bit Unicode character Rune16* = distinct int16 ## 16 bit Unicode character
{.deprecated: [TRune: Rune, TRune16: Rune16].}
proc `<=%`*(a, b: Rune): bool = return int(a) <=% int(b) proc `<=%`*(a, b: Rune): bool = return int(a) <=% int(b)
proc `<%`*(a, b: Rune): bool = return int(a) <% int(b) proc `<%`*(a, b: Rune): bool = return int(a) <% int(b)
proc `==`*(a, b: Rune): bool = return int(a) == int(b) proc `==`*(a, b: Rune): bool = return int(a) == int(b)

View file

@ -145,8 +145,6 @@ type
testStartTime: float testStartTime: float
testStackTrace: string testStackTrace: string
{.deprecated: [TTestStatus: TestStatus, TOutputLevel: OutputLevel]}
var var
abortOnError* {.threadvar.}: bool ## Set to true in order to quit abortOnError* {.threadvar.}: bool ## Set to true in order to quit
## immediately on fail. Default is false, ## immediately on fail. Default is false,

View file

@ -106,8 +106,6 @@ type
SomeNumber* = SomeInteger|SomeFloat SomeNumber* = SomeInteger|SomeFloat
## type class matching all number types ## type class matching all number types
{.deprecated: [SomeReal: SomeFloat].}
proc defined*(x: untyped): bool {.magic: "Defined", noSideEffect, compileTime.} proc defined*(x: untyped): bool {.magic: "Defined", noSideEffect, compileTime.}
## Special compile-time procedure that checks whether `x` is ## Special compile-time procedure that checks whether `x` is
## defined. ## defined.
@ -4039,8 +4037,6 @@ type
NimNode* {.magic: "PNimrodNode".} = ref NimNodeObj NimNode* {.magic: "PNimrodNode".} = ref NimNodeObj
## represents a Nim AST node. Macros operate on this type. ## represents a Nim AST node. Macros operate on this type.
{.deprecated: [PNimrodNode: NimNode].}
when false: when false:
template eval*(blk: typed): typed = template eval*(blk: typed): typed =
## executes a block of code at compile time just as if it was a macro ## executes a block of code at compile time just as if it was a macro

View file

@ -40,7 +40,6 @@ when someGcc and hasThreadSupport:
type type
AtomType* = SomeNumber|pointer|ptr|char|bool AtomType* = SomeNumber|pointer|ptr|char|bool
## Type Class representing valid types for use with atomic procs ## Type Class representing valid types for use with atomic procs
{.deprecated: [TAtomType: AtomType].}
proc atomicLoadN*[T: AtomType](p: ptr T, mem: AtomMemModel): T {. proc atomicLoadN*[T: AtomType](p: ptr T, mem: AtomMemModel): T {.
importc: "__atomic_load_n", nodecl.} importc: "__atomic_load_n", nodecl.}

View file

@ -39,8 +39,7 @@ type
CellSeq {.final, pure.} = object CellSeq {.final, pure.} = object
len, cap: int len, cap: int
d: PCellArray d: PCellArray
{.deprecated: [TCell: Cell, TBitIndex: BitIndex, TPageDesc: PageDesc,
TRefCount: RefCount, TCellSet: CellSet, TCellSeq: CellSeq].}
# ------------------- cell seq handling --------------------------------------- # ------------------- cell seq handling ---------------------------------------
proc contains(s: CellSeq, c: PCell): bool {.inline.} = proc contains(s: CellSeq, c: PCell): bool {.inline.} =

View file

@ -23,7 +23,6 @@ type
# except for the global data description. # except for the global data description.
f: TFrame f: TFrame
slots: array[0..10_000, VarSlot] slots: array[0..10_000, VarSlot]
{.deprecated: [TVarSlot: VarSlot, TExtendedFrame: ExtendedFrame].}
var var
dbgGlobalData: ExtendedFrame # this reserves much space, but dbgGlobalData: ExtendedFrame # this reserves much space, but
@ -156,7 +155,6 @@ type
address: pointer address: pointer
typ: PNimType typ: PNimType
oldValue: Hash oldValue: Hash
{.deprecated: [THash: Hash, TWatchpoint: Watchpoint].}
var var
watchpoints: array[0..99, Watchpoint] watchpoints: array[0..99, Watchpoint]

View file

@ -35,8 +35,6 @@ type
dbSkipCurrent, dbSkipCurrent,
dbQuiting, # debugger wants to quit dbQuiting, # debugger wants to quit
dbBreakpoints # debugger is only interested in breakpoints dbBreakpoints # debugger is only interested in breakpoints
{.deprecated: [TStaticStr: StaticStr, TBreakpointFilename: BreakpointFilename,
TDbgState: DbgState].}
var var
dbgUser: StaticStr # buffer for user input; first command is ``step_into`` dbgUser: StaticStr # buffer for user input; first command is ``step_into``

View file

@ -37,7 +37,6 @@ type
ByteArray = UncheckedArray[byte] ByteArray = UncheckedArray[byte]
PByte = ptr ByteArray PByte = ptr ByteArray
PString = ptr string PString = ptr string
{.deprecated: [TByteArray: ByteArray].}
# Page size of the system; in most cases 4096 bytes. For exotic OS or # Page size of the system; in most cases 4096 bytes. For exotic OS or
# CPU this needs to be changed: # CPU this needs to be changed:

View file

@ -23,7 +23,6 @@ type
lines*: array[0..MaxTraceLen-1, cstring] lines*: array[0..MaxTraceLen-1, cstring]
files*: array[0..MaxTraceLen-1, cstring] files*: array[0..MaxTraceLen-1, cstring]
ProfilerHook* = proc (st: StackTrace) {.nimcall.} ProfilerHook* = proc (st: StackTrace) {.nimcall.}
{.deprecated: [TStackTrace: StackTrace, TProfilerHook: ProfilerHook].}
proc `[]`*(st: StackTrace, i: int): cstring = st.lines[i] proc `[]`*(st: StackTrace, i: int): cstring = st.lines[i]

View file

@ -127,7 +127,6 @@ type
marked: CellSet marked: CellSet
recdepth: int # do not recurse endlessly recdepth: int # do not recurse endlessly
indent: int # indentation indent: int # indentation
{.deprecated: [TReprClosure: ReprClosure].}
when not defined(useNimRtl): when not defined(useNimRtl):
proc initReprClosure(cl: var ReprClosure) = proc initReprClosure(cl: var ReprClosure) =

View file

@ -11,7 +11,6 @@
type type
NimSet = array[0..4*2048-1, uint8] NimSet = array[0..4*2048-1, uint8]
{.deprecated: [TNimSet: NimSet].}
proc countBits32(n: int32): int {.compilerproc.} = proc countBits32(n: int32): int {.compilerproc.} =
var v = n var v = n

View file

@ -26,8 +26,6 @@ when defined(Windows):
SysCond = Handle SysCond = Handle
{.deprecated: [THandle: Handle, TSysLock: SysLock, TSysCond: SysCond].}
proc initSysLock(L: var SysLock) {.importc: "InitializeCriticalSection", proc initSysLock(L: var SysLock) {.importc: "InitializeCriticalSection",
header: "<windows.h>".} header: "<windows.h>".}
## Initializes the lock `L`. ## Initializes the lock `L`.

View file

@ -57,7 +57,6 @@ when defined(windows):
type type
SysThread* = Handle SysThread* = Handle
WinThreadProc = proc (x: pointer): int32 {.stdcall.} WinThreadProc = proc (x: pointer): int32 {.stdcall.}
{.deprecated: [TSysThread: SysThread].}
proc createThread(lpThreadAttributes: pointer, dwStackSize: int32, proc createThread(lpThreadAttributes: pointer, dwStackSize: int32,
lpStartAddress: WinThreadProc, lpStartAddress: WinThreadProc,
@ -198,8 +197,6 @@ else:
Timespec {.importc: "struct timespec", header: "<time.h>".} = object Timespec {.importc: "struct timespec", header: "<time.h>".} = object
tv_sec: Time tv_sec: Time
tv_nsec: clong tv_nsec: clong
{.deprecated: [TSysThread: SysThread, Tpthread_attr: PThreadAttr,
Ttimespec: Timespec, TThreadVarSlot: ThreadVarSlot].}
proc pthread_attr_init(a1: var PthreadAttr) {. proc pthread_attr_init(a1: var PthreadAttr) {.
importc, header: pthreadh.} importc, header: pthreadh.}
@ -277,7 +274,6 @@ type
stackSize: int stackSize: int
else: else:
nil nil
{.deprecated: [TThreadLocalStorage: ThreadLocalStorage, TGcThread: GcThread].}
when not defined(useNimRtl): when not defined(useNimRtl):
when not useStackMaskHack: when not useStackMaskHack:
@ -382,8 +378,6 @@ type
dataFn: proc (m: TArg) {.nimcall, gcsafe.} dataFn: proc (m: TArg) {.nimcall, gcsafe.}
data: TArg data: TArg
{.deprecated: [TThread: Thread].}
var var
threadDestructionHandlers {.rtlThreadVar.}: seq[proc () {.closure, gcsafe.}] threadDestructionHandlers {.rtlThreadVar.}: seq[proc () {.closure, gcsafe.}]

View file

@ -13,7 +13,6 @@
type type
Ticks = distinct int64 Ticks = distinct int64
Nanos = int64 Nanos = int64
{.deprecated: [TTicks: Ticks, TNanos: Nanos].}
when defined(windows): when defined(windows):
@ -38,7 +37,6 @@ elif defined(macosx):
importc: "mach_timebase_info_data_t", importc: "mach_timebase_info_data_t",
header: "<mach/mach_time.h>".} = object header: "<mach/mach_time.h>".} = object
numer, denom: int32 numer, denom: int32
{.deprecated: [TMachTimebaseInfoData: MachTimebaseInfoData].}
proc mach_absolute_time(): int64 {.importc, header: "<mach/mach.h>".} proc mach_absolute_time(): int64 {.importc, header: "<mach/mach.h>".}
proc mach_timebase_info(info: var MachTimebaseInfoData) {.importc, proc mach_timebase_info(info: var MachTimebaseInfoData) {.importc,
@ -61,7 +59,6 @@ elif defined(posixRealtime):
final, pure.} = object ## struct timespec final, pure.} = object ## struct timespec
tv_sec: int ## Seconds. tv_sec: int ## Seconds.
tv_nsec: int ## Nanoseconds. tv_nsec: int ## Nanoseconds.
{.deprecated: [TClockid: Clockid, TTimeSpec: TimeSpec].}
var var
CLOCK_REALTIME {.importc: "CLOCK_REALTIME", header: "<time.h>".}: Clockid CLOCK_REALTIME {.importc: "CLOCK_REALTIME", header: "<time.h>".}: Clockid
@ -89,7 +86,7 @@ else:
final, pure.} = object ## struct timeval final, pure.} = object ## struct timeval
tv_sec: Time ## Seconds. tv_sec: Time ## Seconds.
tv_usec: clong ## Microseconds. tv_usec: clong ## Microseconds.
{.deprecated: [Ttimeval: Timeval].}
proc posix_gettimeofday(tp: var Timeval, unused: pointer = nil) {. proc posix_gettimeofday(tp: var Timeval, unused: pointer = nil) {.
importc: "gettimeofday", header: "<sys/time.h>".} importc: "gettimeofday", header: "<sys/time.h>".}

View file

@ -22,10 +22,8 @@ const
when useWinUnicode: when useWinUnicode:
type WinChar* = Utf16Char type WinChar* = Utf16Char
{.deprecated: [TWinChar: WinChar].}
else: else:
type WinChar* = char type WinChar* = char
{.deprecated: [TWinChar: WinChar].}
type type
Handle* = int Handle* = int
@ -96,10 +94,6 @@ type
dwPlatformId*: DWORD dwPlatformId*: DWORD
szCSDVersion*: array[0..127, WinChar] szCSDVersion*: array[0..127, WinChar]
{.deprecated: [THandle: Handle, TSECURITY_ATTRIBUTES: SECURITY_ATTRIBUTES,
TSTARTUPINFO: STARTUPINFO, TPROCESS_INFORMATION: PROCESS_INFORMATION,
TFILETIME: FILETIME, TBY_HANDLE_FILE_INFORMATION: BY_HANDLE_FILE_INFORMATION].}
const const
STARTF_USESHOWWINDOW* = 1'i32 STARTF_USESHOWWINDOW* = 1'i32
STARTF_USESTDHANDLES* = 256'i32 STARTF_USESTDHANDLES* = 256'i32
@ -327,7 +321,6 @@ type
dwReserved1: int32 dwReserved1: int32
cFileName*: array[0..(MAX_PATH) - 1, WinChar] cFileName*: array[0..(MAX_PATH) - 1, WinChar]
cAlternateFileName*: array[0..13, WinChar] cAlternateFileName*: array[0..13, WinChar]
{.deprecated: [TWIN32_FIND_DATA: WIN32_FIND_DATA].}
when useWinUnicode: when useWinUnicode:
proc findFirstFileW*(lpFileName: WideCString, proc findFirstFileW*(lpFileName: WideCString,
@ -453,7 +446,6 @@ proc wsaGetLastError*(): cint {.importc: "WSAGetLastError", dynlib: ws2dll.}
type type
SocketHandle* = distinct int SocketHandle* = distinct int
{.deprecated: [TSocketHandle: SocketHandle].}
type type
WSAData* {.importc: "WSADATA", header: "winsock2.h".} = object WSAData* {.importc: "WSADATA", header: "winsock2.h".} = object
@ -538,11 +530,6 @@ type
ai_next*: ptr AddrInfo ## Pointer to next in list. ai_next*: ptr AddrInfo ## Pointer to next in list.
SockLen* = cuint SockLen* = cuint
{.deprecated: [TSockaddr_in: Sockaddr_in, TAddrinfo: AddrInfo,
TSockAddr: SockAddr, TSockLen: SockLen, TTimeval: Timeval,
TWSADATA: WSADATA, Thostent: Hostent, TServent: Servent,
TInAddr: InAddr, Tin6_addr: In6_addr, Tsockaddr_in6: Sockaddr_in6,
Tsockaddr_in6_old: Sockaddr_in6_old].}
var var
@ -668,7 +655,6 @@ const
type type
WOHandleArray* = array[0..MAXIMUM_WAIT_OBJECTS - 1, Handle] WOHandleArray* = array[0..MAXIMUM_WAIT_OBJECTS - 1, Handle]
PWOHandleArray* = ptr WOHandleArray PWOHandleArray* = ptr WOHandleArray
{.deprecated: [TWOHandleArray: WOHandleArray].}
proc waitForMultipleObjects*(nCount: DWORD, lpHandles: PWOHandleArray, proc waitForMultipleObjects*(nCount: DWORD, lpHandles: PWOHandleArray,
bWaitAll: WINBOOL, dwMilliseconds: DWORD): DWORD{. bWaitAll: WINBOOL, dwMilliseconds: DWORD): DWORD{.
@ -798,7 +784,6 @@ type
D2*: int16 D2*: int16
D3*: int16 D3*: int16
D4*: array[0..7, int8] D4*: array[0..7, int8]
{.deprecated: [TOVERLAPPED: OVERLAPPED, TGUID: GUID].}
const const
ERROR_IO_PENDING* = 997 # a.k.a WSA_IO_PENDING ERROR_IO_PENDING* = 997 # a.k.a WSA_IO_PENDING

View file

@ -60,17 +60,6 @@ type
PSQLDOUBLE* = ptr TSqlDouble PSQLDOUBLE* = ptr TSqlDouble
PSQLFLOAT* = ptr TSqlFloat PSQLFLOAT* = ptr TSqlFloat
PSQLHANDLE* = ptr SqlHandle PSQLHANDLE* = ptr SqlHandle
{.deprecated: [
# TSqlChar: TSqlChar, # Name conflict if we drop`T`
# TSqlSmallInt: TSqlSmallInt, # Name conflict if we drop`T`
TSqlUSmallInt: SqlUSmallInt, TSqlHandle: SqlHandle, TSqlHEnv: SqlHEnv,
TSqlHDBC: SqlHDBC, TSqlHStmt: SqlHStmt, TSqlHDesc: SqlHDesc,
# TSqlInteger: TSqlInteger, # Name conflict if we drop `T`
TSqlUInteger: SqlUInteger, TSqlPointer: SqlPointer,
# TSqlReal: TSqlReal, # Name conflict if we drop`T`
# TSqlDouble: TSqlDouble, # Name conflict if we drop`T`
# TSqlFloat: TSqlFloat, # Name conflict if we drop `T`
TSqlHWND: SqlHWND].}
const # SQL data type codes const # SQL data type codes
SQL_UNKNOWN_TYPE* = 0 SQL_UNKNOWN_TYPE* = 0

View file

@ -83,8 +83,6 @@ type
pem_password_cb* = proc(buf: cstring, size, rwflag: cint, userdata: pointer): cint {.cdecl.} pem_password_cb* = proc(buf: cstring, size, rwflag: cint, userdata: pointer): cint {.cdecl.}
{.deprecated: [PSSL: SslPtr, PSSL_CTX: SslCtx, PBIO: BIO].}
const const
SSL_SENT_SHUTDOWN* = 1 SSL_SENT_SHUTDOWN* = 1
SSL_RECEIVED_SHUTDOWN* = 2 SSL_RECEIVED_SHUTDOWN* = 2

View file

@ -466,14 +466,6 @@ proc study*(code: ptr Pcre,
{.pop.} {.pop.}
{.deprecated: [MAJOR: PCRE_MAJOR, MINOR: PCRE_MINOR,
PRERELEASE: PCRE_PRERELEASE, DATE: PCRE_DATE].}
{.deprecated: [TPcre: Pcre, TJitStack: JitStack].}
type type
PPcre* {.deprecated.} = ptr Pcre PPcre* {.deprecated.} = ptr Pcre
PJitStack* {.deprecated.} = ptr JitStack PJitStack* {.deprecated.} = ptr JitStack
{.deprecated: [TExtra: ExtraData].}
{.deprecated: [TCalloutBlock: CalloutBlock].}
{.deprecated: [TJitCallback: JitCallback].}

View file

@ -152,10 +152,6 @@ type
length*: int32 length*: int32
isint*: int32 isint*: int32
p*: pointer p*: pointer
{.deprecated: [TSockAddr: SockAddr, TPGresAttDesc: PgresAttDesc,
TPGresAttValue: PgresAttValue, TExecStatusType: ExecStatusType,
TPGlobjfuncs: Pglobjfuncs, TConnStatusType: ConnStatusType, TPGconn: Pgconn,
TPGresult: PGresult].}
proc pqconnectStart*(conninfo: cstring): PPGconn{.cdecl, dynlib: dllName, proc pqconnectStart*(conninfo: cstring): PPGconn{.cdecl, dynlib: dllName,
importc: "PQconnectStart".} importc: "PQconnectStart".}

View file

@ -121,12 +121,6 @@ type
para4: int32, para5: pointer): int32{.cdecl.} para4: int32, para5: pointer): int32{.cdecl.}
Collation_needed_func* = proc (para1: pointer, para2: PSqlite3, eTextRep: int32, Collation_needed_func* = proc (para1: pointer, para2: PSqlite3, eTextRep: int32,
para4: cstring){.cdecl.} para4: cstring){.cdecl.}
{.deprecated: [TSqlite3: Sqlite3, TContext: Context, Tvalue: Value,
Tcallback: Callback, Tcreate_function_step_func: Create_function_step_func,
Tcreate_function_func_func: Create_function_func_func,
Tcreate_function_final_func: Create_function_final_func,
Tresult_func: Result_func, Tcreate_collation_func: Create_collation_func,
Tcollation_needed_func: Collation_needed_func].}
const const
SQLITE_STATIC* = nil SQLITE_STATIC* = nil

View file

@ -12,7 +12,6 @@ type
PccState* = ptr CcState PccState* = ptr CcState
ErrorFunc* = proc (opaque: pointer, msg: cstring) {.cdecl.} ErrorFunc* = proc (opaque: pointer, msg: cstring) {.cdecl.}
{.deprecated: [TccState: CcState, TErrorFunc: ErrorFunc].}
proc openCCState*(): PccState {.importc: "tcc_new", cdecl.} proc openCCState*(): PccState {.importc: "tcc_new", cdecl.}
## create a new TCC compilation context ## create a new TCC compilation context

View file

@ -2,7 +2,7 @@ import macros, macro_dsl, estreams
from strutils import format from strutils import format
template newLenName() = template newLenName() =
let lenName {.inject.} = ^("len"& $lenNames) let lenName {.inject.} = ^("len" & $lenNames)
inc(lenNames) inc(lenNames)
template defPacketImports*() {.dirty.} = template defPacketImports*() {.dirty.} =
@ -18,7 +18,7 @@ macro defPacket*(typeNameN: untyped, typeFields: untyped): untyped =
var var
constructorParams = newNimNode(nnkFormalParams).und(typeName) constructorParams = newNimNode(nnkFormalParams).und(typeName)
constructor = newNimNode(nnkProcDef).und( constructor = newNimNode(nnkProcDef).und(
postfix(^("new"& $typeName.ident), "*"), postfix(^("new" & $typeName.ident), "*"),
emptyNode(), emptyNode(),
emptyNode(), emptyNode(),
constructorParams, constructorParams,
@ -41,7 +41,7 @@ macro defPacket*(typeNameN: untyped, typeFields: untyped): untyped =
emptyNode(), emptyNode(),
emptyNode()) emptyNode())
read = newNimNode(nnkProcDef).und( read = newNimNode(nnkProcDef).und(
newIdentNode("read"& $typeName.ident).postfix("*"), newIdentNode("read" & $typeName.ident).postfix("*"),
emptyNode(), emptyNode(),
emptyNode(), emptyNode(),
newNimNode(nnkFormalParams).und( newNimNode(nnkFormalParams).und(
@ -70,7 +70,7 @@ macro defPacket*(typeNameN: untyped, typeFields: untyped): untyped =
let let
item = ^"item" ## item name in our iterators item = ^"item" ## item name in our iterators
seqType = typeFields[i][1][1] ## type of seq seqType = typeFields[i][1][1] ## type of seq
readName = newIdentNode("read"& $seqType.ident) readName = newIdentNode("read" & $seqType.ident)
readBody.add(newNimNode(nnkLetSection).und( readBody.add(newNimNode(nnkLetSection).und(
newNimNode(nnkIdentDefs).und( newNimNode(nnkIdentDefs).und(
lenName, lenName,
@ -100,7 +100,7 @@ macro defPacket*(typeNameN: untyped, typeFields: untyped): untyped =
#set the default value to @[] (new sequence) #set the default value to @[] (new sequence)
typeFields[i][2] = "@".prefix(newNimNode(nnkBracket)) typeFields[i][2] = "@".prefix(newNimNode(nnkBracket))
else: else:
error("Unknown type: "& treeRepr(typeFields[i])) error("Unknown type: " & treeRepr(typeFields[i]))
of nnkIdent: ##normal type of nnkIdent: ##normal type
case $typeFields[i][1].ident case $typeFields[i][1].ident
of "string": # length encoded string of "string": # length encoded string
@ -109,12 +109,12 @@ macro defPacket*(typeNameN: untyped, typeFields: untyped): untyped =
of "int8", "int16", "int32", "float32", "float64", "char", "bool": of "int8", "int16", "int32", "float32", "float64", "char", "bool":
packBody.add(newCall( packBody.add(newCall(
"writeBE", streamID, dotName)) "writeBE", streamID, dotName))
readBody.add(resName := newCall("read"& $typeFields[i][1].ident, streamID)) readBody.add(resName := newCall("read" & $typeFields[i][1].ident, streamID))
else: ## hopefully the type you specified was another defpacket() type else: ## hopefully the type you specified was another defpacket() type
packBody.add(newCall("pack", streamID, dotName)) packBody.add(newCall("pack", streamID, dotName))
readBody.add(resName := newCall("read"& $typeFields[i][1].ident, streamID)) readBody.add(resName := newCall("read" & $typeFields[i][1].ident, streamID))
else: else:
error("I dont know what to do with: "& treerepr(typeFields[i])) error("I dont know what to do with: " & treerepr(typeFields[i]))
var var
toStringFunc = newNimNode(nnkProcDef).und( toStringFunc = newNimNode(nnkProcDef).und(
@ -137,7 +137,7 @@ macro defPacket*(typeNameN: untyped, typeFields: untyped): untyped =
newNimNode(nnkCall).und(# [6][0][1] newNimNode(nnkCall).und(# [6][0][1]
^"format", ## format ^"format", ## format
emptyNode())))) ## "[TypeName $1 $2]" emptyNode())))) ## "[TypeName $1 $2]"
formatStr = "["& $typeName.ident formatStr = "[" & $typeName.ident
const emptyFields = {nnkEmpty, nnkNilLit} const emptyFields = {nnkEmpty, nnkNilLit}
var objFields = newNimNode(nnkRecList) var objFields = newNimNode(nnkRecList)
@ -206,7 +206,7 @@ macro forwardPacket*(typeName: untyped, underlyingType: untyped): untyped =
streamID = ^"s" streamID = ^"s"
result = newNimNode(nnkStmtList).und( result = newNimNode(nnkStmtList).und(
newProc( newProc(
(^("read"& $typeName.ident)).postfix("*"), (^("read" & $typeName.ident)).postfix("*"),
[ iddefs("s", "PBuffer", newNimNode(nnkNilLit)) ], [ iddefs("s", "PBuffer", newNimNode(nnkNilLit)) ],
typeName), typeName),
newProc( newProc(

View file

@ -217,7 +217,7 @@ proc lobbyUpdate*(dt: float) =
gui.update(dt) gui.update(dt)
i = (i + 1) mod 60 i = (i + 1) mod 60
if i == 0: if i == 0:
fpsText.setString("FPS: "& ff(1.0/dt)) fpsText.setString("FPS: " & ff(1.0/dt))
proc lobbyDraw*(window: PRenderWindow) = proc lobbyDraw*(window: PRenderWindow) =
window.clear(Black) window.clear(Black)

View file

@ -230,7 +230,7 @@ proc explode*(b: PLiveBullet) =
proc bulletUpdate(body: PBody, gravity: TVector, damping, dt: CpFloat){.cdecl.} = proc bulletUpdate(body: PBody, gravity: TVector, damping, dt: CpFloat){.cdecl.} =
body.UpdateVelocity(gravity, damping, dt) body.UpdateVelocity(gravity, damping, dt)
template getPhysical() {.immediate.} = template getPhysical() {.dirty.} =
result.body = space.addBody(newBody( result.body = space.addBody(newBody(
record.physics.mass, record.physics.mass,
record.physics.moment)) record.physics.moment))
@ -281,7 +281,7 @@ proc draw*(window: PRenderWindow; b: PLiveBullet) {.inline.} =
proc free*(veh: PVehicle) = proc free*(veh: PVehicle) =
("Destroying vehicle "& veh.record.name).echo ("Destroying vehicle " & veh.record.name).echo
destroy(veh.sprite) destroy(veh.sprite)
if veh.shape.isNil: "Free'd vehicle's shape was NIL!".echo if veh.shape.isNil: "Free'd vehicle's shape was NIL!".echo
else: space.removeShape(veh.shape) else: space.removeShape(veh.shape)
@ -290,12 +290,12 @@ proc free*(veh: PVehicle) =
veh.body.free() veh.body.free()
veh.shape.free() veh.shape.free()
veh.sprite = nil veh.sprite = nil
veh.body = nil veh.body = nil
veh.shape = nil veh.shape = nil
proc newVehicle*(record: PVehicleRecord): PVehicle = proc newVehicle*(record: PVehicleRecord): PVehicle =
echo("Creating "& record.name) echo("Creating " & record.name)
new(result, free) new(result, free)
result.record = record result.record = record
result.sprite = result.record.anim.spriteSheet.sprite.copy() result.sprite = result.record.anim.spriteSheet.sprite.copy()

View file

@ -8,7 +8,7 @@ type
addy: enet.TAddress addy: enet.TAddress
host*: PHost host*: PHost
peer*: PPeer peer*: PPeer
handlers*: TTable[char, TScPktHandler] handlers*: Table[char, TScPktHandler]
TScPktHandler* = proc(serv: PServer; buffer: PBuffer) TScPktHandler* = proc(serv: PServer; buffer: PBuffer)
TFileTransfer = object TFileTransfer = object
fileName: string fileName: string

View file

@ -222,7 +222,7 @@ template cacheImpl(procName, cacheName, resultType, body: untyped) {.dirty.} =
template checkFile(path: untyped) {.dirty.} = template checkFile(path: untyped) {.dirty.} =
if not existsFile(path): if not existsFile(path):
errors.add("File missing: "& path) errors.add("File missing: " & path)
cacheImpl newSprite, SpriteSheets, PSpriteSheet: cacheImpl newSprite, SpriteSheets, PSpriteSheet:
result.file = filename result.file = filename
@ -231,7 +231,7 @@ cacheImpl newSprite, SpriteSheets, PSpriteSheet:
result.frameh = strutils.parseInt(matches[1]) result.frameh = strutils.parseInt(matches[1])
checkFile("data/gfx"/result.file) checkFile("data/gfx"/result.file)
else: else:
errors.add "Bad file: "&filename&" must be in format name_WxH.png" errors.add "Bad file: " & filename & " must be in format name_WxH.png"
return return
cacheImpl newSound, SoundCache, PSoundRecord: cacheImpl newSound, SoundCache, PSoundRecord:
@ -314,10 +314,10 @@ proc validateSettings*(settings: JsonNode, errors: var seq[string]): bool =
else: else:
var id = 0 var id = 0
for i in items.items: for i in items.items:
if i.kind != JArray: errors.add("Item #$1 is not an array"% $id) if i.kind != JArray: errors.add("Item #$1 is not an array" % $id)
elif i.len != 3: errors.add("($1) Item record should have 3 fields"%($id)) elif i.len != 3: errors.add("($1) Item record should have 3 fields"%($id))
elif i[0].kind != JString or i[1].kind != JString or i[2].kind != JObject: elif i[0].kind != JString or i[1].kind != JString or i[2].kind != JObject:
errors.add("($1) Item should be in form [name, type, {item: data}]"% $id) errors.add("($1) Item should be in form [name, type, {item: data}]" % $id)
result = false result = false
inc id inc id
@ -332,10 +332,10 @@ proc loadSettings*(rawJson: string, errors: var seq[string]): bool =
try: try:
settings = parseJson(rawJson) settings = parseJson(rawJson)
except JsonParsingError: except JsonParsingError:
errors.add("JSON parsing error: "& getCurrentExceptionMsg()) errors.add("JSON parsing error: " & getCurrentExceptionMsg())
return return
except: except:
errors.add("Unknown exception: "& getCurrentExceptionMsg()) errors.add("Unknown exception: " & getCurrentExceptionMsg())
return return
if not validateSettings(settings, errors): if not validateSettings(settings, errors):
return return
@ -378,7 +378,7 @@ proc loadSettings*(rawJson: string, errors: var seq[string]): bool =
inc vID inc vID
if itm.kind == Projectile: if itm.kind == Projectile:
if itm.bullet.isNil: if itm.bullet.isNil:
errors.add("Projectile #$1 has no bullet!"% $vID) errors.add("Projectile #$1 has no bullet!" % $vID)
elif itm.bullet.id == -1: elif itm.bullet.id == -1:
## this item has an anonymous bullet, fix the ID and name ## this item has an anonymous bullet, fix the ID and name
itm.bullet.id = bID itm.bullet.id = bID

View file

@ -260,7 +260,7 @@ proc update*(m: PMessageArea) =
m.texts.add messageProto.copy() m.texts.add messageProto.copy()
elif m.texts.len > m.sizeVisible: elif m.texts.len > m.sizeVisible:
echo "cutting ", m.texts.len - m.sizeVisible, " fields" echo "cutting ", m.texts.len - m.sizeVisible, " fields"
for i in m.sizeVisible.. < m.texts.len: for i in m.sizeVisible ..< m.texts.len:
m.texts.pop().destroy() m.texts.pop().destroy()
let nmsgs = m.messages.len() let nmsgs = m.messages.len()
if m.sizeVisible == 0 or nmsgs == 0: if m.sizeVisible == 0 or nmsgs == 0:

View file

@ -23,7 +23,7 @@ proc strafe_left*(obj: PVehicle, dt: float) =
VectorZero) VectorZero)
proc strafe_right*(obj: PVehicle, dt: float) = proc strafe_right*(obj: PVehicle, dt: float) =
obj.body.applyImpulse( obj.body.applyImpulse(
vectorForAngle(obj.body.getAngle()).rperp()* obj.record.handling.strafe * dt, vectorForAngle(obj.body.getAngle()).rperp() * obj.record.handling.strafe * dt,
VectorZero) VectorZero)
proc turn_right*(obj: PVehicle, dt: float) = proc turn_right*(obj: PVehicle, dt: float) =
#obj.angle = (obj.angle + (obj.record.handling.rotation.float / 10.0 * dt)) mod TAU #obj.angle = (obj.angle + (obj.record.handling.rotation.float / 10.0 * dt)) mod TAU

View file

@ -5,7 +5,7 @@ import
proc main() = proc main() =
var var
a, b: TTime a, b: Time
a = getLastModificationTime(paramStr(1)) a = getLastModificationTime(paramStr(1))
b = getLastModificationTime(paramStr(2)) b = getLastModificationTime(paramStr(2))
writeLine(stdout, $a) writeLine(stdout, $a)

View file

@ -8,14 +8,14 @@ const
data = [1, 2, 3, 4, 5, 6] data = [1, 2, 3, 4, 5, 6]
block SinglyLinkedListTest1: block SinglyLinkedListTest1:
var L: TSinglyLinkedList[int] var L: SinglyLinkedList[int]
for d in items(data): L.prepend(d) for d in items(data): L.prepend(d)
assert($L == "[6, 5, 4, 3, 2, 1]") assert($L == "[6, 5, 4, 3, 2, 1]")
assert(4 in L) assert(4 in L)
block SinglyLinkedListTest2: block SinglyLinkedListTest2:
var L: TSinglyLinkedList[string] var L: SinglyLinkedList[string]
for d in items(data): L.prepend($d) for d in items(data): L.prepend($d)
assert($L == """["6", "5", "4", "3", "2", "1"]""") assert($L == """["6", "5", "4", "3", "2", "1"]""")
@ -23,7 +23,7 @@ block SinglyLinkedListTest2:
block DoublyLinkedListTest1: block DoublyLinkedListTest1:
var L: TDoublyLinkedList[int] var L: DoublyLinkedList[int]
for d in items(data): L.prepend(d) for d in items(data): L.prepend(d)
for d in items(data): L.append(d) for d in items(data): L.append(d)
L.remove(L.find(1)) L.remove(L.find(1))
@ -32,7 +32,7 @@ block DoublyLinkedListTest1:
assert(4 in L) assert(4 in L)
block SinglyLinkedRingTest1: block SinglyLinkedRingTest1:
var L: TSinglyLinkedRing[int] var L: SinglyLinkedRing[int]
L.prepend(4) L.prepend(4)
assert($L == "[4]") assert($L == "[4]")
L.prepend(4) L.prepend(4)
@ -42,7 +42,7 @@ block SinglyLinkedRingTest1:
block DoublyLinkedRingTest1: block DoublyLinkedRingTest1:
var L: TDoublyLinkedRing[int] var L: DoublyLinkedRing[int]
L.prepend(4) L.prepend(4)
assert($L == "[4]") assert($L == "[4]")
L.prepend(4) L.prepend(4)