2.2 KiB
2.2 KiB
Handoff — the pointer arm agrees already promised
lib/cimport.ml's agrees decides whether a hand-written declare-c and the C header
say the same thing. Its comment has always listed three differences that are "expected and
are not reported"; the code implements two of them. The missing one — a (Ptr T) where
the header says T * — is what ../PORTING.md §A.1 and §A.2 ran into, and it is why
GetCodepointPrevious cannot be bound honestly and why UpdateTexture has to be handed
(addr (.r (at (slice-from-ptr pixels n) 0))).
This file is the running record of building that arm.
The plan
- A
ptr_agreesbesideagrees, consulted only at the twodeclare-csites indiff_bound, where the C spelling is still in hand.agreesitself is left alone:check_structsuses it for field widths, and loosening it there is the hazard the check exists to catch. - Breadth, decided rather than fallen into — see "What it accepts" below.
- Rewrite the comment at
lib/cimport.ml:1291so it describes the code instead of promising it, and take the rotting binding count out of it. - Use it:
get-codepoint-previous-rawinvendor/raylib/raylib.flan, and the(Ptr Color)binding forUpdateTexture. Delete both workarounds. docs/PORTING.md§A.1 and §A.2 annotated closed in the file's existing style.
What it accepts (to be confirmed as it is built)
(Ptr T)against a CT *for the sameT.(Ptr u8)againstchar *— a byte is a byte, and the two spellings of one are not a width disagreement. Scoped to the pointee, never toagreesat large.(Ptr T)for anyTagainstvoid *.value_tyalready invents(Ptr u8)for avoid *, so the check as it stands enforces cimport's own guess as if the header had said it.constdoes not enter into it, because a non-constchar *parameter makesparam_tyrefuse anddiff_boundskips a parameter it cannot render at all.
What it still refuses
(Ptr A)againstB *for different namedAandB.- Anything that is not a pointer on the Flan side against a C pointer, and the reverse.
Status
- the arm
- the comment
- tests, positive and negative
- the two raylib bindings
- PORTING.md