Skip to content

Use one signature for all model constructors - #38

Merged
resetius merged 1 commit into
masterfrom
task/ctor-signature
Nov 19, 2026
Merged

resetius merged 1 commit into
masterfrom
task/ctor-signature

Conversation

@resetius

Copy link
Copy Markdown
Owner

main.c called two-parameter constructors (CreateTorus, CreateTriangle, ...) through ConstructorT, a three-parameter function pointer. Calling a function through an incompatible pointer type is undefined behaviour.

Now every model constructor takes (struct Render*, struct Config*, struct EventProducer*). The third parameter is ignored where it is not needed. The table in main.c has no casts.

Also fixed:

  • CreateGltf was declared in main.c with two parameters but defined with three.
  • The two test-mode calls (CreateTriangle, CreateTorus) pass the event producer.

Checks: clean build before and after has the same 5 warnings (none new); ctest passes (3/3). I did not run the Vulkan demos.

main.c called two-parameter constructors through a three-parameter function pointer, which is undefined behaviour. All constructors now take struct EventProducer* (unused where not needed), so the table needs no casts. Also fixes the CreateGltf and CreatePoissonTest declarations in main.c.
@github-actions

Copy link
Copy Markdown

Test Results

9 tests  ±0   9 ✅ ±0   0s ⏱️ ±0s
3 suites ±0   0 💤 ±0 
3 files   ±0   0 ❌ ±0 

Results for commit 1b67f3c. ± Comparison against base commit 7278352.

@resetius
resetius merged commit 6b87835 into master Nov 19, 2026
2 checks passed
@resetius
resetius deleted the task/ctor-signature branch November 19, 2026 18:59
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