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:
Ivan FB 2026-07-14 14:31:43 +02:00
parent 0d1abb4ced
commit ccaf04c1ca
No known key found for this signature in database
GPG Key ID: DF0C67A04C543270
3 changed files with 9 additions and 10 deletions

View File

@ -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);")

View File

@ -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"
)

View File

@ -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