Repository navigation
api: Obsolete spacing and stop passing it to liblouis - #32
Merged
henrikottesorensen merged 1 commit intoOct 9, 2026
Merged
Conversation
henrikottesorensen
force-pushed
the
feature/obsolete-spacing
branch
from
October 9, 2026 13:45
c49bfb8 to
ab2a809
Compare
nanchen2483
approved these changes
Oct 9, 2026
henrikottesorensen
force-pushed
the
feature/obsolete-spacing
branch
from
October 9, 2026 13:58
ab2a809 to
3d02593
Compare
liblouis 3.39.0 deprecated the spacing parameter of lou_translate, lou_translateString, lou_backTranslate and lou_backTranslateString, and in practice ignores it: each function now only logs "the spacing parameter is deprecated and ignored; pass NULL" and never touches the buffer. The release notes say deprecated, the source says ignored. That broke Notalib#19 on 3.39.0. OutputSpacing was read back from a buffer liblouis no longer writes, so it reported the caller's own request as if it were liblouis's answer, and every call with a spacing argument logged the warning. Two SpacingTests failed on main as a result. C# cannot obsolete a single parameter, so each of the four public methods gains an overload without spacing, which now holds the body, and the existing overloads are marked [Obsolete] and forward to it, dropping spacing. liblouis is always handed NULL, so nothing is logged. The obsolete overloads no longer check the length of spacing either, since there is nothing left for a mismatch to break. The spacing buffer helpers and TranslatedString.OutputSpacing from Notalib#19 are removed. OutputSpacing never shipped in a release, and it could only ever be null now. SpacingTests is rewritten for the new contract: the obsolete overloads give the same results as the new ones, and liblouis logs no spacing warning. The rest of the tests move to the new overloads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
henrikottesorensen
force-pushed
the
feature/obsolete-spacing
branch
from
October 9, 2026 14:07
3d02593 to
df3f843
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
main, which has been red since #31 merged.liblouis 3.39.0 deprecated the
spacingparameter oflou_translate,lou_translateString,lou_backTranslateandlou_backTranslateString, and in practice it now ignores it. Each function only logs "the spacing parameter is deprecated and ignored; pass NULL" and never writes to the buffer. The release notes only say deprecated; the source shows it's ignored.That breaks #19 on 3.39.0:
OutputSpacingreads back from a buffer liblouis no longer writes, so it returned the caller's own request as if it were liblouis's answer.spacinglogged the warning.Spacing_ReportsTheRequestedDigits_AgainstTheOutputCellsTheyProducedandSpacing_BackTranslation_CoversTheWholeOutputfail onmain.Changes
[Obsolete]on a parameter, so each of the four publicTranslate/BackTranslatemethods gets a new overload withoutspacing. The new overload holds the body.spacingare marked[Obsolete]and call the new ones without it. Callers keep compiling, get a CS0618 warning, and get the same results.spacing, so nothing gets logged. The P/Invoke declarations are unchanged apart from their docs.spacing's length doesn't match the input, since the value is never used.PrepareSpacingBuffer,ExtractOutputSpacingandTranslatedString.OutputSpacingfrom Marshal spacing as the output buffer it is #19.OutputSpacingnever shipped in a release (no tags or packages exist) and would always be null now.SpacingTestsnow covers the new behaviour:spacingof the wrong length is accepted.Testing
lou_translateStringmakes it fail.🤖 Generated with Claude Code