mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-25 00:35:26 +00:00
remove redundant void return in stdlib (#17464)
This commit is contained in:
@@ -31,7 +31,7 @@ const
|
||||
CLONE_IO* = 0x80000000'i32
|
||||
CLONE_STOPPED* {.deprecated.} = 0x02000000'i32
|
||||
|
||||
# fn should be of type proc (a2: pointer): void {.cdecl.}
|
||||
# fn should be of type proc (a2: pointer) {.cdecl.}
|
||||
proc clone*(fn: pointer; child_stack: pointer; flags: cint;
|
||||
arg: pointer; ptid: ptr Pid; tls: pointer;
|
||||
ctid: ptr Pid): cint {.importc, header: "<sched.h>".}
|
||||
|
||||
@@ -447,7 +447,7 @@ proc pthread_spin_unlock*(a1: ptr Pthread_spinlock): cint {.
|
||||
proc pthread_testcancel*() {.importc, header: "<pthread.h>".}
|
||||
|
||||
|
||||
proc exitnow*(code: int): void {.importc: "_exit", header: "<unistd.h>".}
|
||||
proc exitnow*(code: int) {.importc: "_exit", header: "<unistd.h>".}
|
||||
proc access*(a1: cstring, a2: cint): cint {.importc, header: "<unistd.h>".}
|
||||
proc alarm*(a1: cint): cint {.importc, header: "<unistd.h>".}
|
||||
proc chdir*(a1: cstring): cint {.importc, header: "<unistd.h>".}
|
||||
|
||||
@@ -451,14 +451,14 @@ proc preferSpawn*(): bool =
|
||||
## <#spawnX.t>`_ instead.
|
||||
result = gSomeReady.counter > 0
|
||||
|
||||
proc spawn*(call: sink typed): void {.magic: "Spawn".}
|
||||
proc spawn*(call: sink typed) {.magic: "Spawn".}
|
||||
## Always spawns a new task, so that the `call` is never executed on
|
||||
## the calling thread.
|
||||
##
|
||||
## `call` has to be a proc call `p(...)` where `p` is gcsafe and has a
|
||||
## return type that is either `void` or compatible with `FlowVar[T]`.
|
||||
|
||||
proc pinnedSpawn*(id: ThreadId; call: sink typed): void {.magic: "Spawn".}
|
||||
proc pinnedSpawn*(id: ThreadId; call: sink typed) {.magic: "Spawn".}
|
||||
## Always spawns a new task on the worker thread with `id`, so that
|
||||
## the `call` is **always** executed on the thread.
|
||||
##
|
||||
|
||||
@@ -273,8 +273,7 @@ proc start*(c: proc(), stacksize: int = defaultStackSize): CoroutineRef {.discar
|
||||
coro = cast[CoroutinePtr](alloc0(sizeof(Coroutine)))
|
||||
coro.execContext = CreateFiberEx(stacksize, stacksize,
|
||||
FIBER_FLAG_FLOAT_SWITCH,
|
||||
(proc(p: pointer): void {.stdcall.} = runCurrentTask()),
|
||||
nil)
|
||||
(proc(p: pointer) {.stdcall.} = runCurrentTask()), nil)
|
||||
coro.stack.size = stacksize
|
||||
else:
|
||||
coro = cast[CoroutinePtr](alloc0(sizeof(Coroutine) + stacksize))
|
||||
|
||||
@@ -1165,7 +1165,7 @@ when defined(nimFixedForwardGeneric):
|
||||
proc initFromJson[T: distinct](dst: var T; jsonNode: JsonNode; jsonPath: var string) =
|
||||
assignDistinctImpl(dst, jsonNode, jsonPath)
|
||||
|
||||
proc detectIncompatibleType(typeExpr, lineinfoNode: NimNode): void =
|
||||
proc detectIncompatibleType(typeExpr, lineinfoNode: NimNode) =
|
||||
if typeExpr.kind == nnkTupleConstr:
|
||||
error("Use a named tuple instead of: " & typeExpr.repr, lineinfoNode)
|
||||
|
||||
|
||||
@@ -200,7 +200,7 @@ when defined(nimHasStyleChecks):
|
||||
|
||||
proc socketError*(socket: Socket, err: int = -1, async = false,
|
||||
lastError = (-1).OSErrorCode,
|
||||
flags: set[SocketFlag] = {}): void {.gcsafe.}
|
||||
flags: set[SocketFlag] = {}) {.gcsafe.}
|
||||
|
||||
proc isDisconnectionError*(flags: set[SocketFlag],
|
||||
lastError: OSErrorCode): bool =
|
||||
|
||||
@@ -1030,7 +1030,7 @@ const
|
||||
PROCESS_QUERY_LIMITED_INFORMATION* = 0x00001000'i32
|
||||
PROCESS_SET_LIMITED_INFORMATION* = 0x00002000'i32
|
||||
type
|
||||
WAITORTIMERCALLBACK* = proc(para1: pointer, para2: int32): void {.stdcall.}
|
||||
WAITORTIMERCALLBACK* = proc(para1: pointer, para2: int32) {.stdcall.}
|
||||
|
||||
proc postQueuedCompletionStatus*(CompletionPort: Handle,
|
||||
dwNumberOfBytesTransferred: DWORD,
|
||||
@@ -1112,7 +1112,7 @@ else:
|
||||
{.stdcall, dynlib: "kernel32", importc: "ReadConsoleInputW".}
|
||||
|
||||
type
|
||||
LPFIBER_START_ROUTINE* = proc (param: pointer): void {.stdcall.}
|
||||
LPFIBER_START_ROUTINE* = proc (param: pointer) {.stdcall.}
|
||||
|
||||
const
|
||||
FIBER_FLAG_FLOAT_SWITCH* = 0x01
|
||||
@@ -1121,8 +1121,8 @@ proc CreateFiber*(stackSize: int, fn: LPFIBER_START_ROUTINE, param: pointer): po
|
||||
proc CreateFiberEx*(stkCommit: int, stkReserve: int, flags: int32, fn: LPFIBER_START_ROUTINE, param: pointer): pointer {.stdcall, discardable, dynlib: "kernel32", importc.}
|
||||
proc ConvertThreadToFiber*(param: pointer): pointer {.stdcall, discardable, dynlib: "kernel32", importc.}
|
||||
proc ConvertThreadToFiberEx*(param: pointer, flags: int32): pointer {.stdcall, discardable, dynlib: "kernel32", importc.}
|
||||
proc DeleteFiber*(fiber: pointer): void {.stdcall, discardable, dynlib: "kernel32", importc.}
|
||||
proc SwitchToFiber*(fiber: pointer): void {.stdcall, discardable, dynlib: "kernel32", importc.}
|
||||
proc DeleteFiber*(fiber: pointer) {.stdcall, discardable, dynlib: "kernel32", importc.}
|
||||
proc SwitchToFiber*(fiber: pointer) {.stdcall, discardable, dynlib: "kernel32", importc.}
|
||||
proc GetCurrentFiber*(): pointer {.stdcall, importc, header: "windows.h".}
|
||||
|
||||
proc toFILETIME*(t: int64): FILETIME =
|
||||
|
||||
Reference in New Issue
Block a user