Skip to content

Spell the uint32_t canonical as the typedef, not "unsigned int"#71

Open
estebanzimanyi wants to merge 1 commit into
MobilityDB:masterfrom
estebanzimanyi:fix/uint32-canonical-typedef
Open

Spell the uint32_t canonical as the typedef, not "unsigned int"#71
estebanzimanyi wants to merge 1 commit into
MobilityDB:masterfrom
estebanzimanyi:fix/uint32-canonical-typedef

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

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 is spelled two ways across the catalog — uint64_t normalizes to uint64_t, but uint32_t stays unsigned int.

Adds the uint32_t self-mapping to _TYPE_MAP so normalize_canonical re-derives canonical back to the typedef — the uint32 sibling of the recovered-uint64 normalization.

Binding generators key on canonical; a unsigned int spelling there drops every *_hash (a uint32 return) in generators that map their scalar types by the canonical name. The fix re-spells 44 slots from unsigned int to uint32_t (temporal/span/set/spanset/tbox _hash, geo_cluster counts, …); the only unsigned int remaining is the genuine PG Oid (cType unsigned int). test_uint32_canonical_normalized guards it.

Two unrelated tests (test_core_structs_have_real_offsets for MvtGeom.geom, test_enums_match_source) are red on current master independent of this diff — out of scope.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant