mirror of
https://github.com/logos-messaging/nim-ffi.git
synced 2026-08-05 22:43:17 +00:00
style: apply nph 0.7.0 formatting
Keeps the linter green; the long C-literal lines added for RET_STALE_WARN were over nph's width. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
0d1abb4ced
commit
ccaf04c1ca
@ -433,7 +433,9 @@ proc emitReplyTrampolineHead(lines: var seq[string], tramp, boxType, fallback: s
|
||||
"static void " & tramp & "(int ret, const char* msg, size_t len, void* ud) {"
|
||||
)
|
||||
lines.add(" " & boxType & "* box = (" & boxType & "*)ud;")
|
||||
lines.add(" /* Non-terminal progress ping: keep the box for the terminal reply. */")
|
||||
lines.add(
|
||||
" /* Non-terminal progress ping: keep the box for the terminal reply. */"
|
||||
)
|
||||
lines.add(" if (ret == NIMFFI_RET_STALE_WARN) return;")
|
||||
lines.add(" if (!box->fn) {")
|
||||
lines.add(" free(box);")
|
||||
|
||||
@ -271,7 +271,9 @@ proc emitCtxAndCtor(
|
||||
)
|
||||
lines.add(" " & createBox & "* box = (" & createBox & "*)ud;")
|
||||
lines.add(" if (!box) return;")
|
||||
lines.add(" /* Non-terminal progress ping: keep the box for the terminal reply. */")
|
||||
lines.add(
|
||||
" /* Non-terminal progress ping: keep the box for the terminal reply. */"
|
||||
)
|
||||
lines.add(" if (ret == NIMFFI_RET_STALE_WARN) return;")
|
||||
lines.add(" if (!box->fn) { free(box); return; }")
|
||||
lines.add(" if (ret != 0) {")
|
||||
@ -404,9 +406,7 @@ proc generateCAbiLibHeader*(
|
||||
lines.add("#define NIMFFI_RET_OK 0")
|
||||
lines.add("#define NIMFFI_RET_ERR 1")
|
||||
lines.add("#define NIMFFI_RET_MISSING_CALLBACK 2")
|
||||
lines.add(
|
||||
"/* Non-terminal: the request is still running. Fires every ~5s with `msg`"
|
||||
)
|
||||
lines.add("/* Non-terminal: the request is still running. Fires every ~5s with `msg`")
|
||||
lines.add(
|
||||
" carrying the elapsed milliseconds as decimal text; always followed by a"
|
||||
)
|
||||
|
||||
@ -68,8 +68,7 @@ proc resolveFFISpecs(specs: seq[NimNode]): ABIFormat {.compileTime.} =
|
||||
for override in specs:
|
||||
if override.kind notin {nnkStrLit, nnkRStrLit, nnkTripleStrLit}:
|
||||
error(
|
||||
"FFI override must be a string literal like \"abi = c\", got: " &
|
||||
override.repr
|
||||
"FFI override must be a string literal like \"abi = c\", got: " & override.repr
|
||||
)
|
||||
case overrideKey($override)
|
||||
of "abi":
|
||||
@ -1519,9 +1518,7 @@ macro ffiCtor*(args: varargs[untyped]): untyped =
|
||||
# The flat-struct exported wrapper is emitted at genBindings() time (see
|
||||
# flushCAbiDispatch); the CBOR `ffiProc` is not.
|
||||
registerCAbiCtor(cExportName, libTypeName, reqTypeName, paramNames, paramTypes)
|
||||
newStmtList(
|
||||
typeDef, ffiNewReqProc, helperProc, processProc, addToReg, poolDecl
|
||||
)
|
||||
newStmtList(typeDef, ffiNewReqProc, helperProc, processProc, addToReg, poolDecl)
|
||||
else:
|
||||
newStmtList(
|
||||
typeDef, ffiNewReqProc, helperProc, processProc, addToReg, poolDecl, ffiProc
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user