Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

const-qualify interp_instance structs in interpolation functions #133

Closed
escherstair opened this issue Dec 6, 2023 · 1 comment
Closed
Labels
bug Something isn't working DONE Issue done but not yet closed

Comments

@escherstair
Copy link

escherstair commented Dec 6, 2023

Interpolation functions take as an input an interp_instance struct.
As an example,

float32_t arm_linear_interp_f32(
arm_linear_interp_instance_f32 * S,
float32_t x)

As far as I understand, this interp_instance is not modified by the function, and so the pointer can be declared as pointer to const.

float32_t arm_linear_interp_f32(
  const arm_linear_interp_instance_f32 * S,
  float32_t x)

In this way the code is more expressive, and a const struct can be passed as an input without any warning about casting-away its const-ness.

@christophe0606 christophe0606 added the bug Something isn't working label Dec 6, 2023
@christophe0606
Copy link
Contributor

Corrected in latest commit

@christophe0606 christophe0606 added the DONE Issue done but not yet closed label Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working DONE Issue done but not yet closed
Projects
None yet
Development

No branches or pull requests

2 participants