Skip to content

[win] debugger cleanup: use enums for m_views indices #13687

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

Merged
merged 1 commit into from
May 10, 2025

Conversation

dave-br
Copy link
Contributor

@dave-br dave-br commented May 7, 2025

For the wininfos that participate as individual panes in the main console window, their viewinfos are referenced via the m_views[] array with hard-coded indices of 0, 1, and 2.

  • Define & use enums for those indices (VIEW_IDX_DISASM, VIEW_IDX_STATE, VIEW_IDX_CONSOLE)
  • Change MAX_VIEWS from a hard-coded constant of 4 to the last enum in that list, which changes it to 3. (I don't think it should have been 4 in the first place.)
  • wininfos that NEVER appear as panes in the main console window (e.g., logwin_info, pointswin_info, etc.) continue to use m_views[0]

This cleanup was originally written as part of my large source-level debugging PR (#13444), so merging this will shrink that somewhat.

For the wininfos that participate as individual panes in the main console window, their viewinfos are referenced via the m_views[] array with hard-coded indices of 0, 1, and 2.

- Define & use enums for those indices (VIEW_IDX_DISASM, VIEW_IDX_STATE, VIEW_IDX_CONSOLE)
- Change MAX_VIEWS from a hard-coded constant of 4 to the last enum in that list, which changes it to 3.  (I don't think it should have been 4 in the first place.)
- wininfos that NEVER appear as panes in the main console window (e.g., logwin_info, pointswin_info, etc.) continue to use m_views[0]
@galibert galibert merged commit c25a4b8 into mamedev:master May 10, 2025
6 checks passed
@dave-br dave-br deleted the pr-vws branch May 10, 2025 19:33
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