You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
chore(api): audit mutable pointer shape for set_input_gamut #3234
FastLED generally shies away from mutable pointer parameters when the parameter is required. A mutable pointer implies nullable / optional semantics and forces every call path to reason about nullptr. Where mutation is required and null is not meaningful, a mutable reference (DiodeProfile&) is usually clearer. Where mutation is not required, const DiodeProfile& is preferred.
This follow-up should decide whether set_input_gamut really needs nullable pointer semantics or whether the public/internal API should be tightened.
Proposal
Audit set_input_gamut(DiodeProfile* profile, ...) and related CFastLED wrappers/callers.
Questions to answer:
Is nullptr an intentional no-op API contract, or just defensive implementation detail?
If null is not a meaningful user-facing operation, should the API become DiodeProfile& profile?
If the function only needs read access in any overload, should that path use const DiodeProfile& instead?
Should the CFastLED wrapper keep nullable behavior while an internal helper uses references?
What migration path avoids breaking sketches unnecessarily?
Acceptance criteria
All set_input_gamut declarations, definitions, wrappers, and call sites are audited.
The issue is resolved by either:
converting required mutable profile parameters to DiodeProfile&, or
documenting why nullable DiodeProfile* is intentional and keeping the current shape.
Tests or compile coverage are updated if the API shape changes.
Agent review docs are updated if this becomes a broader FastLED rule for mutable pointer parameters.
Activity
chore(api): take DiodeProfile by reference in set_input_gamut (FastLE…