Remove expr/stmt (#5857)
This commit is contained in:
parent
52ff244d5d
commit
000b8afd26
168 changed files with 497 additions and 529 deletions
|
|
@ -20,10 +20,10 @@ proc cmpPoint(a, b: Point): int =
|
|||
if result == 0:
|
||||
result = cmp(a.y, b.y)
|
||||
|
||||
template cross[T](o, a, b: T): expr =
|
||||
template cross[T](o, a, b: T): untyped =
|
||||
(a.x - o.x) * (b.y - o.y) - (a.y - o.y) * (b.x - o.x)
|
||||
|
||||
template pro(): expr =
|
||||
template pro(): untyped =
|
||||
while lr1 > 0 and cross(result[lr1 - 1], result[lr1], p[i]) <= 0:
|
||||
discard result.pop
|
||||
lr1 -= 1
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ var
|
|||
|
||||
c.i = 89
|
||||
|
||||
template atomicRead(L, x): expr =
|
||||
template atomicRead(L, x): untyped =
|
||||
{.locks: [L].}:
|
||||
x
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ var
|
|||
|
||||
c.i = 89
|
||||
|
||||
template atomicRead(L, x): expr =
|
||||
template atomicRead(L, x): untyped =
|
||||
{.locks: [L].}:
|
||||
x
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ type
|
|||
processes {.guard: lock.}: array[0..MAX_WORKERS-1, foreign ptr Process]
|
||||
|
||||
# Hold a lock for a statement.
|
||||
template hold(lock: Lock, body: stmt) =
|
||||
template hold(lock: Lock, body: untyped) =
|
||||
lock.acquire
|
||||
defer: lock.release
|
||||
{.locks: [lock].}:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue