Skip to content

Conversation

nicolasnoble
Copy link
Member

No description provided.

Copy link
Contributor

coderabbitai bot commented Aug 31, 2025

Walkthrough

Replaces 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

Cohort / File(s) Summary
API type change: TPageAttr ↔ TPageLoc
src/mips/psyqo/primitives/common.hh
Added private TPageLoc(uint8_t) for controlled construction; updated PrimPieces::TPageAttr::getPageLoc() to return TPageLoc instead of uint8_t, constructing from info & 0x001f; no changes to getPageX/getPageY/getSemiTrans.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

size/M

Poem

A nibble of bits in a tidy lock,
I hop through pages—tick, tock, tick, tock.
No raw bytes loose, a wrapper snug,
Encapsulated fields, warm as a hug.
With ears up high, I stamp and log:
TPageLoc now leads the prog. 🐇

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 Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 construction

Make 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 bits

Even 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 cast

No 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.

📥 Commits

Reviewing files that changed from the base of the PR and between a285e14 and 6de0f09.

📒 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

Copy link

codecov bot commented Sep 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 9.30%. Comparing base (a11e5ed) to head (acdc7e5).
⚠️ Report is 3 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nicolasnoble nicolasnoble merged commit 87f8e86 into grumpycoders:main Sep 1, 2025
24 checks passed
@nicolasnoble nicolasnoble deleted the tpageloc-fix branch September 2, 2025 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant