Merge pull request #3106 from def-/deprecation

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

View file

@ -6,7 +6,7 @@ proc threadMain(a: int) {.thread.} =
discard
proc main() =
var thread: TThread[int]
var thread: Thread[int]
thread.createThread(threadMain, 0)
thread.joinThreads()

View file

@ -3,20 +3,20 @@ discard """
"""
type
TThreadFuncArgs[T] = object of RootObj
ThreadFuncArgs[T] = object of RootObj
a: proc(): T {.thread.}
b: proc(val: T) {.thread.}
proc handleThreadFunc(arg: TThreadFuncArgs[int]){.thread.} =
proc handleThreadFunc(arg: ThreadFuncArgs[int]){.thread.} =
var fn = arg.a
var callback = arg.b
var output = fn()
callback(output)
proc `@||->`*[T](fn: proc(): T {.thread.},
callback: proc(val: T){.thread.}): TThread[TThreadFuncArgs[T]] =
var thr: TThread[TThreadFuncArgs[T]]
var args: TThreadFuncArgs[T]
callback: proc(val: T){.thread.}): Thread[ThreadFuncArgs[T]] =
var thr: Thread[ThreadFuncArgs[T]]
var args: ThreadFuncArgs[T]
args.a = fn
args.b = callback
createThread(thr, handleThreadFunc, args)

View file

@ -1,5 +1,5 @@
import
streams, md5, sockets, unsigned,
streams, md5, sockets,
sg_packets, zlib_helpers, idgen
type
TClientType* = enum

View file

@ -1,5 +1,5 @@
import
sockets, times, streams, streams_enh, tables, json, os, unsigned,
sockets, times, streams, streams_enh, tables, json, os,
sg_packets, sg_assets, md5, server_utils, client_helpers
var
dirServer: PServer

View file

@ -8,10 +8,6 @@ from strutils import
`%`,
ffDecimal
from unsigned import
`shr`,
`and`
type
TColor* = tuple[r, g, b, a: TR]

View file

@ -1,8 +1,6 @@
# bug #1638
import unsigned
let v1 = 7
let v2 = 7'u64

View file

@ -5,8 +5,6 @@ true'''
"""
# bug 1420
import unsigned
var x = 40'u32
var y = 30'u32
echo x > y # works

View file

@ -1,6 +1,4 @@
import unsigned
# Tests unsigned literals and implicit conversion between uints and ints
# Passes if it compiles

View file

@ -1,5 +1,3 @@
import unsigned
discard """
errormsg: "number 0x123'u8 out of valid range"
"""

View file

@ -1,6 +1,6 @@
when false:
template lock(a, b: ptr TLock; body: stmt) =
template lock(a, b: ptr Lock; body: stmt) =
if cast[ByteAddress](a) < cast[ByteAddress](b):
pthread_mutex_lock(a)
pthread_mutex_lock(b)

View file

@ -11,7 +11,7 @@ type
of mLine: data: string
var
producer, consumer: TThread[void]
producer, consumer: Thread[void]
chan: TChannel[TMsg]
printedLines = 0

View file

@ -8,7 +8,7 @@ discard """
import os
var
thr: array [0..5, TThread[tuple[a, b: int]]]
thr: array [0..5, Thread[tuple[a, b: int]]]
proc doNothing() = discard

View file

@ -8,7 +8,7 @@ discard """
import os
var
thr: array [0..5, TThread[tuple[a, b: int]]]
thr: array [0..5, Thread[tuple[a, b: int]]]
proc doNothing() = discard

View file

@ -6,7 +6,7 @@ discard """
var
global: string = "test string"
t: TThread[void]
t: Thread[void]
proc horrible() {.thread.} =
global = "string in thread local heap!"

View file

@ -15,7 +15,7 @@ proc doAction(outC: PComm) {.thread.} =
send(outC[], i)
var
thr: TThread[PComm]
thr: Thread[PComm]
chan: TChannel[int]
open(chan)

View file

@ -1,7 +1,7 @@
import db_sqlite
var db: TDbConn
var db: DbConn
exec(db, sql"create table blabla()")

View file

@ -52,7 +52,7 @@ proc Connect*(irc: var TIRC, nick: string, host: string, port: int = 6667) =
connect(irc.Socket, host, TPort(port), TDomain.AF_INET)
send(irc.Socket,"USER " & nick & " " & nick & " " & nick & " " & nick & "\r\L")
send(irc.Socket,"NICK " & nick & "\r\L")
var thread: TThread[TIRC]
var thread: Thread[TIRC]
createThread(thread, handleData, irc)
irc.Thread = thread