Spell the uint32_t canonical as the typedef, not "unsigned int"#71
Open
estebanzimanyi wants to merge 1 commit into
Open
Spell the uint32_t canonical as the typedef, not "unsigned int"#71estebanzimanyi wants to merge 1 commit into
estebanzimanyi wants to merge 1 commit into
Conversation
libclang resolves a uint32_t slot's `canonical` to the platform builtin `unsigned int` while `cType` keeps the typedef, so the same 32-bit width was spelled two ways across the catalog (uint64_t already normalizes to `uint64_t`). Add the `uint32_t` self-mapping to `_TYPE_MAP` so normalize_canonical re-derives `canonical` back to `uint32_t` -- the uint32 sibling of the recovered-uint64 normalization. Binding generators key on `canonical`; before this, every `*_hash` (a uint32 return) was silently dropped by generators that map their scalar types on the canonical spelling. Regenerating turns 44 slots from `unsigned int` back to `uint32_t`; genuine `unsigned int` params (PG `Oid`) keep their spelling. Guarded by test_uint32_canonical_normalized.
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.
libclang resolves a
uint32_tslot'scanonicalto the platform builtinunsigned intwhilecTypekeeps the typedef, so the same 32-bit width is spelled two ways across the catalog —uint64_tnormalizes touint64_t, butuint32_tstaysunsigned int.Adds the
uint32_tself-mapping to_TYPE_MAPsonormalize_canonicalre-derivescanonicalback to the typedef — the uint32 sibling of the recovered-uint64 normalization.Binding generators key on
canonical; aunsigned intspelling there drops every*_hash(a uint32 return) in generators that map their scalar types by the canonical name. The fix re-spells 44 slots fromunsigned inttouint32_t(temporal/span/set/spanset/tbox_hash, geo_cluster counts, …); the onlyunsigned intremaining is the genuine PGOid(cTypeunsigned int).test_uint32_canonical_normalizedguards it.Two unrelated tests (
test_core_structs_have_real_offsetsforMvtGeom.geom,test_enums_match_source) are red on current master independent of this diff — out of scope.