fix(mt): keep C declarations before statements

The MT job callback added state publication before its Rust job-construction
call, which left the result declaration after executable statements and emitted
the repository's C90 mixed-declaration warning on every CLI/test build.

Declare the result alongside the other callback-local projections and assign it
at the existing call site.  This is a warning-only cleanup with no runtime or
ABI change.

Test Plan:
- `cc -fsyntax-only -Werror=incompatible-pointer-types -Ilib -Ilib/common -Ilib/compress -Ilib/decompress -Ilib/dict -Ilib/legacy lib/compress/zstdmt_compress.c` -- passed
- `git diff --check` and `git diff --cached --check` -- passed
- The prior capped suite reached `rustLibSmoke`; a fresh root library build is
  required because its archive predates the display-hook fix
This commit is contained in:
2026-07-20 15:27:31 +02:00
parent a57e0f83e1
commit 66b04980eb
+2 -1
View File
@@ -2724,6 +2724,7 @@ static size_t ZSTDMT_createCompressionJob(void* opaque, size_t srcSize, unsigned
ZSTDMT_CCtx* const mtctx = (ZSTDMT_CCtx*)opaque;
ZSTD_EndDirective const endOp = (ZSTD_EndDirective)end;
ZSTDMT_RustCreateJobProjection projection;
ZSTDMT_RustCreateJobResult result;
/* Rust fills the reusable input range in its local projection before
* calling this C-owned job-construction callback. Publish that count
* before the callback prepares a job and checks the C context. */
@@ -2743,7 +2744,7 @@ static size_t ZSTDMT_createCompressionJob(void* opaque, size_t srcSize, unsigned
(unsigned)(endOp == ZSTD_e_end),
(unsigned)mtctx->params.fParams.checksumFlag
};
ZSTDMT_RustCreateJobResult const result = ZSTDMT_rust_createCompressionJob(
result = ZSTDMT_rust_createCompressionJob(
&projection, mtctx, ZSTDMT_prepareCompressionJob,
ZSTDMT_writeEmptyCompressionJob, ZSTDMT_tryAddCompressionJob);