-
-
Notifications
You must be signed in to change notification settings - Fork 129
Properly returning a TPageLoc on TPageAttr::getPageLoc #1964
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
Conversation
WalkthroughReplaces TPageAttr::getPageLoc() return type from uint8_t to TPageLoc and adds a private TPageLoc(uint8_t) constructor. TPageAttr constructs TPageLoc from info & 0x001f. Other bitwise accessors remain unchanged. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
src/mips/psyqo/primitives/common.hh (3)
168-171
: Enforce invariants and allow constexpr constructionMake the private raw-bits constructor constexpr/explicit and mask to 5 bits so upper bits can never leak in; this also enables a constexpr getter below.
- TPageLoc(uint8_t i) : info(i) {} + constexpr explicit TPageLoc(uint8_t i) : info(static_cast<uint8_t>(i & 0x1f)) {}
215-219
: Mask loc before OR to prevent bleeding into SemiTrans/ColorMode bitsEven though TPageLoc’s setters only touch the low 5 bits, defensively mask here to make this robust against future changes.
- info |= loc.info; + info |= static_cast<uint16_t>(loc.info & 0x1f);
250-250
: Annotate getPageLoc as [[nodiscard]], constexpr, noexcept and add explicit castNo call sites were found outside its own definition; safe to apply:
- TPageLoc getPageLoc() const { return TPageLoc(info & 0x001f); } + [[nodiscard]] constexpr TPageLoc getPageLoc() const noexcept { + return TPageLoc{static_cast<uint8_t>(info & 0x001f)}; + }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
src/mips/psyqo/primitives/common.hh
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: pcsx-redux (x86_64-linux)
- GitHub Check: pcsx-redux (aarch64-linux)
- GitHub Check: build-openbios
- GitHub Check: asan
- GitHub Check: coverage
- GitHub Check: aur-build
- GitHub Check: macos-build-and-test-toolchain
- GitHub Check: toolchain
- GitHub Check: cross-arm64
- GitHub Check: build
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1964 +/- ##
=======================================
Coverage 9.30% 9.30%
=======================================
Files 469 469
Lines 145164 145164
=======================================
Hits 13513 13513
Misses 131651 131651 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.