Normalize the canonical spelling of recovered 64-bit typedefs#58
Merged
estebanzimanyi merged 1 commit intoJul 16, 2026
Conversation
When a fixed-width integer typedef (H3Index from libh3, or the int64/uint64 family) reaches libclang already resolved to its platform builtin spelling (uint64_t -> "unsigned long" on LP64), typerecover rewrites the c-type to the typedef but leaves the canonical field at the platform spelling. The same underlying type then spells inconsistently across the catalog -- e.g. the Tcell<T> cell-id accessors th3index_start_value (H3Index) and tquadbin_start_value (Quadbin) read "unsigned long" and "uint64_t" respectively, though both are uint64 cell ids. Normalize the canonical field to the recovered typedef spelling via a platform-alias set, so identical underlying types are spelled identically.
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.
When a fixed-width integer typedef (
H3Indexfrom libh3, or theint64/uint64family) reaches libclang already resolved to its platform builtin spelling (uint64_t→unsigned longon LP64),typerecoverrewrites the c-type to the typedef but leaves thecanonicalfield at the platform spelling. The same underlying type then spells inconsistently across the catalog — e.g. theTcell<T>cell-id accessorsth3index_start_value(H3Index) andtquadbin_start_value(Quadbin) carrycanonicalunsigned longvsuint64_t, though both are uint64 cell ids and must be identical.Normalizes the
canonicalfield to the recovered typedef spelling via a platform-alias set, so identical underlying types are spelled identically (90unsigned long→uint64_tand 3long→int64_tcanonical flips on the current catalog; no other slots change). Guarded bytests/test_typerecover.py::test_cell_id_canonical_normalized_uniform.