Skip to content

Conversation

@sbhutch
Copy link

@sbhutch sbhutch commented Jul 18, 2025

As mentioned in the discussion tab, I have spent some time adding const qualifiers to a large portion of the public API to try and cut down on const_cast in C++ projects. I took the following approach:

  • Break public API into modules
  • For each module:
    • Add const qualifiers to initialization parameters in public API (coefficient arrays)
    • Add const qualifiers to input parameters in public API (input arrays)
    • Compile-and-fix loop to propagate const through the private APIs
    • Run autotests

Known issues:

  • I could only compile for my system architecture, some SIMD implementations may have been missed
  • I am not sure if cmake supports find-libfec yet, so may have missed the fun algorithms
  • Breaking change: The user callback functions used in the framing module now need const qualifiers
  • Not implemented for FFT run function as fft plan struct would need to be modified
  • Not implemented for MRESAMP2 execute function as input array is used as ping pong buffer

Please let me know if you have any requests or concerns

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