Skip to content

Add const to function parameters where possible - #506

Merged
recp merged 1 commit into
recp:masterfrom
dpirch:const-params
Oct 26, 2026
Merged

recp merged 1 commit into
recp:masterfrom
dpirch:const-params

Conversation

@dpirch

@dpirch dpirch commented Oct 26, 2026

Copy link
Copy Markdown
Contributor
  • Adds const qualifiers to read-only pointer and array parameters.
  • Multi-dimentional array parameters use the CGLM_CONST macro instead, because for these const only works in C++ and C23 (with N2607).
  • For glm_mat4_mulN, the matrices are not const-qualified although they are read-only, but changing the pointer type would require changing application code.
  • Incorrect incorrect in/out in doc comments was fixed for glm_ray_sphere, glm_swapf, glm_quat_rotate_at.

Fixes issue #83, alternative to PR #497.

- Adds `const` qualifiers to read-only pointer and array parameters.
- Multi-dimentional array parameters use the `CGLM_CONST` macro instead,
  because for these `const` only works in C++ and C23 (with N2607).
- For `glm_mat4_mulN`, the matrices are not const-qualified although they
  are read-only, but changing the pointer type would require changing
  application code.
- Incorrect incorrect in/out in doc comments was fixed for
  `glm_ray_sphere`, `glm_swapf`, `glm_quat_rotate_at`.
@dpirch
dpirch marked this pull request as ready for review October 26, 2026 11:10
@recp
recp merged commit 5c65419 into recp:master Oct 26, 2026
145 of 188 checks passed
@recp

recp commented Oct 26, 2026

Copy link
Copy Markdown
Owner

@dpirch the PR is merged, thanks for your contributions 🚀

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.

2 participants