Skip to content
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

Eliminate ARRAY_LENGTH template in favor of C++17's std::size #7787

Merged
merged 1 commit into from
Feb 14, 2021

Conversation

ajrhacker
Copy link
Contributor

  • osdcomm.h: Move definition of EQUIVALENT_ARRAY to coretmpl.h

  • sharc.cpp, gt64xxx.cpp, ym2413.cpp, gb_lcd.cpp, snes_ppu.cpp: Use STRUCT_MEMBER for save state registration

  • gio/newport.cpp, megadrive/svp.cpp, nes_ctrl/bcbattle.cpp, arm7.cpp, tms9995.cpp, pckeybrd.cpp, sa1110.cpp, sa1111.cpp, jangou_blitter.cpp, vic4567.cpp: Use std::fill(_n) instead of memset

  • emucore.h: Remove obsolete typedef

Note: I'm opening this pull request to see how the CI builds deal with the changes, which affect OSD stuff which has caused some unpleasant surprises with past refactorings. I don't have total confidence that all compilers support the standard equally well.

* osdcomm.h: Move definition of EQUIVALENT_ARRAY to coretmpl.h

* sharc.cpp, gt64xxx.cpp, ym2413.cpp, gb_lcd.cpp, snes_ppu.cpp: Use STRUCT_MEMBER for save state registration

* gio/newport.cpp, megadrive/svp.cpp, nes_ctrl/bcbattle.cpp, arm7.cpp, tms9995.cpp, pckeybrd.cpp, sa1110.cpp, sa1111.cpp, jangou_blitter.cpp, vic4567.cpp: Use std::fill(_n) instead of memset

* emucore.h: Remove obsolete typedef
@ajrhacker ajrhacker merged commit bc14023 into mamedev:master Feb 14, 2021
@@ -283,8 +280,7 @@ void snes_ppu_device::device_start()
save_item(STRUCT_MEMBER(m_layer, mosaic_counter));
save_item(STRUCT_MEMBER(m_layer, mosaic_offset));

for (int i = 0; i < ARRAY_LENGTH(m_clipmasks); i++)
save_item(NAME(m_clipmasks[i]), i);
save_item(NAME(m_clipmasks));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intentionally had these as separate items because there’s a relatively small number of them (only 6) and it’s easier to find where one ends and the next starts in the debugger if they’re separate sources.

Comment on lines +254 to +259
save_item(STRUCT_MEMBER(m_scanlines, enable));
save_item(STRUCT_MEMBER(m_scanlines, clip));
save_item(STRUCT_MEMBER(m_scanlines, buffer));
save_item(STRUCT_MEMBER(m_scanlines, priority));
save_item(STRUCT_MEMBER(m_scanlines, layer));
save_item(STRUCT_MEMBER(m_scanlines, blend_exception));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise, I didn’t use STRUCT_MEMBER for these because there are only two, and it’s easier to find the start/end of each if they’re separate sources.

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.

3 participants