Skip to content

Encapsulate colors.cpp's own runtime state as static, not global - #5787

Merged
netmindz merged 1 commit into
wled:mainfrom
netmindz:refactor/colorscpp-globals
Aug 8, 2026
Merged

Encapsulate colors.cpp's own runtime state as static, not global#5787
netmindz merged 1 commit into
wled:mainfrom
netmindz:refactor/colorscpp-globals

Conversation

@netmindz

@netmindz netmindz commented Aug 8, 2026

Copy link
Copy Markdown
Member

Summary

Part of an ongoing pass identifying WLED_GLOBAL declarations that are actually only referenced in one file (see #5777-#5786 for earlier ones). lastRandomIndex turned out to be private to colors.cpp.

Converted it to file-local static, same type and initial value as before.

No behavior change — purely a storage-class change.

Test plan

  • esp32dev: builds and links cleanly via pio run -e esp32dev, no warnings.
  • Confirmed via repo-wide grep (wled00/, usermods/) that lastRandomIndex is not referenced outside colors.cpp.

🤖 Generated with Claude Code

lastRandomIndex was referenced only in colors.cpp. Converted it to
file-local `static`.

No behavior change - purely a storage-class change.

Verified: esp32dev builds and links cleanly via `pio run -e esp32dev`,
no warnings from either changed file.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@netmindz, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 42 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7e389d8b-8dd3-467f-b888-8354a203ecf6

📥 Commits

Reviewing files that changed from the base of the PR and between 0869ef4 and 6a9f8ba.

📒 Files selected for processing (2)
  • wled00/colors.cpp
  • wled00/wled.h

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@netmindz
netmindz merged commit d9b9a84 into wled:main Aug 8, 2026
30 checks passed
@netmindz
netmindz deleted the refactor/colorscpp-globals branch August 8, 2026 20: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.

2 participants