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!
Cond* = SysCond ## Nim condition variable
{.deprecated: [TLock: Lock, TCond: Cond].}
{.push stackTrace: off.}
proc initLock*(lock: var Lock) {.inline.} =

View file

@ -418,8 +418,6 @@ type
## if not ambiguous (this cannot be achieved with
## any other means in the language currently)
{.deprecated: [TBindSymRule: BindSymRule].}
proc bindSym*(ident: string | NimNode, rule: BindSymRule = brClosed): NimNode {.
magic: "NBindSym", noSideEffect.}
## 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) =
x.rawTypePtr = cast[pointer](p)
{.deprecated: [TAny: Any, TAnyKind: AnyKind].}
when defined(gogc):
const GenericSeqSize = (3 * sizeof(int))
else:

View file

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

View file

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

View file

@ -108,11 +108,6 @@ type
ReplyError* = 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

View file

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

View file

@ -70,9 +70,6 @@ when defined(ssl):
SSLAcceptResult* = enum
AcceptNoClient = 0, AcceptNoHandshake, AcceptSuccess
{.deprecated: [ESSL: SSLError, TSSLCVerifyMode: SSLCVerifyMode,
TSSLProtVersion: SSLProtVersion, PSSLContext: SSLContext,
TSSLAcceptResult: SSLAcceptResult].}
const
BufferSize*: int = 4000 ## size of a buffered socket's buffer
@ -147,12 +144,6 @@ type
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):
let invalidSocket*: Socket = nil ## invalid socket
else:

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -27,13 +27,10 @@ type
DIR* {.importc: "DIR", header: "<dirent.h>",
incompleteStruct.} = object
## A type representing a directory stream.
{.deprecated: [TDIR: DIR].}
type
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
const SIG_HOLD* = cast[SigHandler](2)
@ -375,29 +372,6 @@ type
## context is active.
# 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
Taiocb* {.importc: "struct aiocb", header: "<aio.h>",
final, pure.} = object ## struct aiocb
@ -587,13 +561,6 @@ type
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
errno* {.importc, header: "<errno.h>".}: cint ## error variable
h_errno* {.importc, header: "<netdb.h>".}: cint

View file

@ -26,13 +26,10 @@ type
DIR* {.importc: "DIR", header: "<dirent.h>",
incompleteStruct.} = object
## A type representing a directory stream.
{.deprecated: [TDIR: DIR].}
type
SocketHandle* = distinct cint # The type used to represent socket descriptors
{.deprecated: [TSocketHandle: SocketHandle].}
type
Time* {.importc: "time_t", header: "<time.h>".} = distinct clong
@ -356,31 +353,7 @@ type
uc_stack*: Stack ## The stack used by this context.
uc_mcontext*: Mcontext ## A machine-specific representation of the saved
## 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:
type
Taiocb* {.importc: "struct aiocb", header: "<aio.h>",
@ -553,13 +526,6 @@ type
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
errno* {.importc, header: "<errno.h>".}: cint ## error variable
h_errno* {.importc, header: "<netdb.h>".}: cint

View file

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

View file

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

View file

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

View file

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

View file

@ -44,8 +44,6 @@ type
data: TrunkSeq
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.} =
assert(length > counter)
result = (length * 2 < counter * 3) or (length - counter < 4)

View file

@ -45,15 +45,6 @@ type
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] =
## creates a new singly linked list that is empty.
discard

View file

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

View file

@ -39,8 +39,6 @@ type
data: KeyValuePairSeq[A]
counter: int
{.deprecated: [TSet: HashSet].}
template default[T](t: typedesc[T]): T =
## Used by clear methods to get a default value.
var v: T
@ -631,8 +629,6 @@ type
data: OrderedKeyValuePairSeq[A]
counter, first, last: int
{.deprecated: [TOrderedSet: OrderedSet].}
proc clear*[A](s: var OrderedSet[A]) =
## 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.

View file

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

View file

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

View file

@ -848,8 +848,6 @@ proc newHttpClient*(userAgent = defUserAgent,
type
AsyncHttpClient* = HttpClientBase[AsyncSocket]
{.deprecated: [PAsyncHttpClient: AsyncHttpClient].}
proc newAsyncHttpClient*(userAgent = defUserAgent,
maxRedirects = 5, sslContext = getDefaultSSL(),
proxy: Proxy = nil): AsyncHttpClient =
@ -1163,7 +1161,7 @@ proc requestAux(client: HttpClient | AsyncHttpClient, url: string,
{.multisync.} =
# Helper that actually makes the request. Does not handle redirects.
let requestUrl = parseUri(url)
if requestUrl.scheme == "":
raise newException(ValueError, "No uri scheme supplied.")

View file

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

View file

@ -90,19 +90,19 @@ proc kind*(p: Peg): PegKind = p.kind
## Returns the *PegKind* of a given *Peg* object.
proc term*(p: Peg): string = p.term
## Returns the *string* representation of a given *Peg* variant object
## Returns the *string* representation of a given *Peg* variant object
## where present.
proc ch*(p: Peg): char = p.ch
## Returns the *char* representation of a given *Peg* variant object
## Returns the *char* representation of a given *Peg* variant object
## where present.
proc charChoice*(p: Peg): ref set[char] = p.charChoice
## Returns the *charChoice* field of a given *Peg* variant object
## Returns the *charChoice* field of a given *Peg* variant object
## where present.
proc nt*(p: Peg): NonTerminal = p.nt
## Returns the *NonTerminal* object of a given *Peg* variant object
## Returns the *NonTerminal* object of a given *Peg* variant object
## where present.
proc index*(p: Peg): range[0..MaxSubpatterns] = p.index
@ -137,7 +137,7 @@ proc flags*(nt: NonTerminal): set[NonTerminalFlag] = nt.flags
proc rule*(nt: NonTerminal): Peg = nt.rule
## Gets the *Peg* object representing the rule definition of the parent *Peg*
## object variant of a given *NonTerminal*.
## object variant of a given *NonTerminal*.
proc term*(t: string): Peg {.nosideEffect, rtl, extern: "npegs$1Str".} =
## constructs a PEG from a terminal string
@ -553,8 +553,6 @@ type
ml: int
origStart: int
{.deprecated: [TCaptures: Captures].}
proc bounds*(c: Captures,
i: range[0..MaxSubpatterns-1]): tuple[first, last: int] =
## returns the bounds ``[first..last]`` of the `i`'th capture.
@ -885,7 +883,7 @@ proc rawMatch*(s: string, p: Peg, start: int, c: var Captures): int
macro mkHandlerTplts(handlers: untyped): untyped =
# Transforms the handler spec in *handlers* into handler templates.
# The AST structure of *handlers[0]*:
#
#
# .. code-block::
# StmtList
# Call
@ -1009,7 +1007,7 @@ template eventParser*(pegAst, handlers: untyped): (proc(s: string): int) =
## echo opStack
##
## let pLen = parseArithExpr(txt)
##
##
## The *handlers* parameter consists of code blocks for *PegKinds*,
## which define the grammar elements of interest. Each block can contain
## handler code to be executed when the parser enters and leaves text

View file

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

View file

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

View file

@ -481,9 +481,6 @@ type
styleHidden, ## hidden text
styleStrikethrough ## strikethrough
{.deprecated: [TStyle: Style].}
{.deprecated: [styleUnknown: styleItalic].}
when not defined(windows):
var
gFG {.threadvar.}: int
@ -556,9 +553,6 @@ type
bg8Bit, ## 256-color (not supported, see ``enableTrueColors`` instead.)
bgDefault ## default terminal background color
{.deprecated: [TForegroundColor: ForegroundColor,
TBackgroundColor: BackgroundColor].}
when defined(windows):
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
TimesMutableTypes = DateTime | Time | Duration | TimeInterval
{.deprecated: [TMonth: Month, TWeekDay: WeekDay, TTime: Time,
TTimeInterval: TimeInterval, TTimeInfo: DateTime, TimeInfo: DateTime].}
const
secondsInMin = 60
secondsInHour = 60*60

View file

@ -18,8 +18,6 @@ type
Rune* = distinct RuneImpl ## type that can hold any 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)

View file

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

View file

@ -106,8 +106,6 @@ type
SomeNumber* = SomeInteger|SomeFloat
## type class matching all number types
{.deprecated: [SomeReal: SomeFloat].}
proc defined*(x: untyped): bool {.magic: "Defined", noSideEffect, compileTime.}
## Special compile-time procedure that checks whether `x` is
## defined.
@ -4039,8 +4037,6 @@ type
NimNode* {.magic: "PNimrodNode".} = ref NimNodeObj
## represents a Nim AST node. Macros operate on this type.
{.deprecated: [PNimrodNode: NimNode].}
when false:
template eval*(blk: typed): typed =
## 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
AtomType* = SomeNumber|pointer|ptr|char|bool
## Type Class representing valid types for use with atomic procs
{.deprecated: [TAtomType: AtomType].}
proc atomicLoadN*[T: AtomType](p: ptr T, mem: AtomMemModel): T {.
importc: "__atomic_load_n", nodecl.}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -22,10 +22,8 @@ const
when useWinUnicode:
type WinChar* = Utf16Char
{.deprecated: [TWinChar: WinChar].}
else:
type WinChar* = char
{.deprecated: [TWinChar: WinChar].}
type
Handle* = int
@ -96,10 +94,6 @@ type
dwPlatformId*: DWORD
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
STARTF_USESHOWWINDOW* = 1'i32
STARTF_USESTDHANDLES* = 256'i32
@ -327,7 +321,6 @@ type
dwReserved1: int32
cFileName*: array[0..(MAX_PATH) - 1, WinChar]
cAlternateFileName*: array[0..13, WinChar]
{.deprecated: [TWIN32_FIND_DATA: WIN32_FIND_DATA].}
when useWinUnicode:
proc findFirstFileW*(lpFileName: WideCString,
@ -453,7 +446,6 @@ proc wsaGetLastError*(): cint {.importc: "WSAGetLastError", dynlib: ws2dll.}
type
SocketHandle* = distinct int
{.deprecated: [TSocketHandle: SocketHandle].}
type
WSAData* {.importc: "WSADATA", header: "winsock2.h".} = object
@ -538,11 +530,6 @@ type
ai_next*: ptr AddrInfo ## Pointer to next in list.
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
@ -668,7 +655,6 @@ const
type
WOHandleArray* = array[0..MAXIMUM_WAIT_OBJECTS - 1, Handle]
PWOHandleArray* = ptr WOHandleArray
{.deprecated: [TWOHandleArray: WOHandleArray].}
proc waitForMultipleObjects*(nCount: DWORD, lpHandles: PWOHandleArray,
bWaitAll: WINBOOL, dwMilliseconds: DWORD): DWORD{.
@ -798,7 +784,6 @@ type
D2*: int16
D3*: int16
D4*: array[0..7, int8]
{.deprecated: [TOVERLAPPED: OVERLAPPED, TGUID: GUID].}
const
ERROR_IO_PENDING* = 997 # a.k.a WSA_IO_PENDING

View file

@ -60,17 +60,6 @@ type
PSQLDOUBLE* = ptr TSqlDouble
PSQLFLOAT* = ptr TSqlFloat
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
SQL_UNKNOWN_TYPE* = 0

View file

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

View file

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

View file

@ -152,10 +152,6 @@ type
length*: int32
isint*: int32
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,
importc: "PQconnectStart".}

View file

@ -121,12 +121,6 @@ type
para4: int32, para5: pointer): int32{.cdecl.}
Collation_needed_func* = proc (para1: pointer, para2: PSqlite3, eTextRep: int32,
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
SQLITE_STATIC* = nil

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -222,7 +222,7 @@ template cacheImpl(procName, cacheName, resultType, body: untyped) {.dirty.} =
template checkFile(path: untyped) {.dirty.} =
if not existsFile(path):
errors.add("File missing: "& path)
errors.add("File missing: " & path)
cacheImpl newSprite, SpriteSheets, PSpriteSheet:
result.file = filename
@ -231,7 +231,7 @@ cacheImpl newSprite, SpriteSheets, PSpriteSheet:
result.frameh = strutils.parseInt(matches[1])
checkFile("data/gfx"/result.file)
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
cacheImpl newSound, SoundCache, PSoundRecord:
@ -314,10 +314,10 @@ proc validateSettings*(settings: JsonNode, errors: var seq[string]): bool =
else:
var id = 0
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[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
inc id
@ -332,10 +332,10 @@ proc loadSettings*(rawJson: string, errors: var seq[string]): bool =
try:
settings = parseJson(rawJson)
except JsonParsingError:
errors.add("JSON parsing error: "& getCurrentExceptionMsg())
errors.add("JSON parsing error: " & getCurrentExceptionMsg())
return
except:
errors.add("Unknown exception: "& getCurrentExceptionMsg())
errors.add("Unknown exception: " & getCurrentExceptionMsg())
return
if not validateSettings(settings, errors):
return
@ -378,7 +378,7 @@ proc loadSettings*(rawJson: string, errors: var seq[string]): bool =
inc vID
if itm.kind == Projectile:
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:
## this item has an anonymous bullet, fix the ID and name
itm.bullet.id = bID

View file

@ -260,7 +260,7 @@ proc update*(m: PMessageArea) =
m.texts.add messageProto.copy()
elif m.texts.len > m.sizeVisible:
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()
let nmsgs = m.messages.len()
if m.sizeVisible == 0 or nmsgs == 0:

View file

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

View file

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

View file

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