From bdb9404c08908249210be53ddd640c165e6df1ed Mon Sep 17 00:00:00 2001 From: smf- Date: Thu, 15 Sep 2022 13:38:44 +0100 Subject: [PATCH] fixes for clang 15.0 on windows [smf] --- scripts/src/3rdparty.lua | 6 ++++++ src/devices/machine/s3c24xx.hxx | 6 ------ src/devices/machine/s3c44b0.cpp | 17 +---------------- src/emu/validity.cpp | 2 -- src/mame/bfm/bfm_bd1.cpp | 3 --- src/mame/bfm/bfm_bda.cpp | 3 --- src/mame/igs/pgm_v.cpp | 7 ------- src/mame/konami/cobra.cpp | 2 -- src/mame/namco/20pacgal_v.cpp | 2 -- src/mame/shared/namco_c355spr.cpp | 2 -- src/osd/modules/debugger/debugimgui.cpp | 4 ---- 11 files changed, 7 insertions(+), 47 deletions(-) diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index 1787fc09ad3..442879da9b5 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -1052,6 +1052,12 @@ end configuration { } + if string.find(_OPTIONS["gcc"], "clang") and str_to_version(_OPTIONS["gcc_version"]) >= 150000 then + buildoptions_c { + "-Wno-strict-prototypes", + } + end + files { MAME_DIR .. "3rdparty/portmidi/pm_common/portmidi.c", MAME_DIR .. "3rdparty/portmidi/pm_common/pmutil.c", diff --git a/src/devices/machine/s3c24xx.hxx b/src/devices/machine/s3c24xx.hxx index b5ad9be6312..08582806efb 100644 --- a/src/devices/machine/s3c24xx.hxx +++ b/src/devices/machine/s3c24xx.hxx @@ -1155,12 +1155,6 @@ void S3C24_CLASS_NAME::s3c24xx_check_pending_irq() temp = (m_irq.regs.srcpnd & ~m_irq.regs.intmsk) & m_irq.regs.intmod; if (temp != 0) { - uint32_t int_type = 0; - while ((temp & 1) == 0) - { - int_type++; - temp = temp >> 1; - } if (m_irq.line_fiq != ASSERT_LINE) { LOGMASKED(LOG_IRQS, "asserting FIQ line\n"); diff --git a/src/devices/machine/s3c44b0.cpp b/src/devices/machine/s3c44b0.cpp index f3ea869bdd5..2f114f2a80c 100644 --- a/src/devices/machine/s3c44b0.cpp +++ b/src/devices/machine/s3c44b0.cpp @@ -914,12 +914,6 @@ void s3c44b0_device::check_pending_irq() temp = (m_irq.regs.intpnd & ~m_irq.regs.intmsk) & m_irq.regs.intmod; if (temp != 0) { - uint32_t int_type = 0; - while ((temp & 1) == 0) - { - int_type++; - temp = temp >> 1; - } if (m_irq.line_fiq != ASSERT_LINE) { m_cpu->set_input_line(ARM7_FIRQ_LINE, ASSERT_LINE); @@ -945,17 +939,8 @@ void s3c44b0_device::request_irq(uint32_t int_type) void s3c44b0_device::check_pending_eint() { - uint32_t temp = m_gpio.regs.extintpnd; - if (temp != 0) - { - uint32_t int_type = 0; - while ((temp & 1) == 0) - { - int_type++; - temp = temp >> 1; - } + if (m_gpio.regs.extintpnd != 0) request_irq(S3C44B0_INT_EINT4_7); - } } void s3c44b0_device::request_eint(uint32_t number) diff --git a/src/emu/validity.cpp b/src/emu/validity.cpp index e2178c522f3..f76ea7d24fb 100644 --- a/src/emu/validity.cpp +++ b/src/emu/validity.cpp @@ -2082,7 +2082,6 @@ void validity_checker::validate_roms(device_t &root) u32 current_length = 0; int items_since_region = 1; int last_bios = 0, max_bios = 0; - int total_files = 0; std::unordered_map bios_names; std::unordered_map bios_descs; char const *defbios = nullptr; @@ -2153,7 +2152,6 @@ void validity_checker::validate_roms(device_t &root) { // track the last filename we found last_name = romp->name; - total_files++; max_bios = std::max(max_bios, ROM_GETBIOSFLAGS(romp)); // validate the name diff --git a/src/mame/bfm/bfm_bd1.cpp b/src/mame/bfm/bfm_bd1.cpp index cec7424bce4..3d593c4b871 100644 --- a/src/mame/bfm/bfm_bd1.cpp +++ b/src/mame/bfm/bfm_bd1.cpp @@ -228,7 +228,6 @@ void bfm_bd1_device::blank(int data) int bfm_bd1_device::write_char(int data) { - int change = 0; if ( m_user_def ) { m_user_def--; @@ -242,8 +241,6 @@ int bfm_bd1_device::write_char(int data) } setdata( m_user_data, data); - change ++; - } else { diff --git a/src/mame/bfm/bfm_bda.cpp b/src/mame/bfm/bfm_bda.cpp index a149584783f..1ff2d67b967 100644 --- a/src/mame/bfm/bfm_bda.cpp +++ b/src/mame/bfm/bfm_bda.cpp @@ -212,7 +212,6 @@ void bfm_bda_device::blank(int data) int bfm_bda_device::write_char(int data) { - int change = 0; if ( m_user_def ) { m_user_def--; @@ -226,8 +225,6 @@ int bfm_bda_device::write_char(int data) } setdata( m_user_data, data); - change ++; - } else { diff --git a/src/mame/igs/pgm_v.cpp b/src/mame/igs/pgm_v.cpp index 1d11f8574a9..e17cc2b5cb9 100644 --- a/src/mame/igs/pgm_v.cpp +++ b/src/mame/igs/pgm_v.cpp @@ -322,7 +322,6 @@ void pgm_state::draw_sprite_new_zoomed(int wide, int high, int xpos, int ypos, i void pgm_state::draw_sprite_line_basic(int wide, u16* dest, u8* destpri, const rectangle &cliprect, int flip, int xpos, int pri, int realxsize, int palt, bool draw) { - int xoffset = 0; int xdrawpos = 0; int xcntdraw = 0; @@ -340,8 +339,6 @@ void pgm_state::draw_sprite_line_basic(int wide, u16* dest, u8* destpri, const r if (draw) { - xoffset++; - if (!get_flipx(flip)) xdrawpos = xpos + xcntdraw; else @@ -355,7 +352,6 @@ void pgm_state::draw_sprite_line_basic(int wide, u16* dest, u8* destpri, const r } else { - xoffset++; xcntdraw++; } @@ -379,8 +375,6 @@ void pgm_state::draw_sprite_line_basic(int wide, u16* dest, u8* destpri, const r if (draw) { - xoffset++; - if (!get_flipx(flip)) xdrawpos = xpos + xcntdraw; else @@ -394,7 +388,6 @@ void pgm_state::draw_sprite_line_basic(int wide, u16* dest, u8* destpri, const r } else { - xoffset++; xcntdraw++; } diff --git a/src/mame/konami/cobra.cpp b/src/mame/konami/cobra.cpp index e8d61425af5..11a259457b3 100644 --- a/src/mame/konami/cobra.cpp +++ b/src/mame/konami/cobra.cpp @@ -2878,7 +2878,6 @@ void cobra_renderer::gfx_fifo_exec() } default: { - int k = 0; int c = 0; printf("gfxfifo_exec: unknown command %08X %08X\n", w1, w2); @@ -2903,7 +2902,6 @@ void cobra_renderer::gfx_fifo_exec() printf("\n"); c = 0; } - k++; }; cobra->logerror("\n"); } diff --git a/src/mame/namco/20pacgal_v.cpp b/src/mame/namco/20pacgal_v.cpp index 1d1a37c9d04..571109ab172 100644 --- a/src/mame/namco/20pacgal_v.cpp +++ b/src/mame/namco/20pacgal_v.cpp @@ -364,7 +364,6 @@ void _20pacgal_state::draw_stars(bitmap_rgb32 &bitmap, const rectangle &cliprect uint8_t feedback = (m_stars_ctrl[0] >> 6) & 1; uint16_t star_seta = (m_stars_ctrl[0] >> 3) & 0x01; uint16_t star_setb = (m_stars_ctrl[0] >> 3) & 0x02; - int cnt = 0; /* This is a guess based on galaga star sets */ star_seta = 0x3fc0 | (star_seta << 14); @@ -399,7 +398,6 @@ void _20pacgal_state::draw_stars(bitmap_rgb32 &bitmap, const rectangle &cliprect { if (y >= cliprect.min_y && y <= cliprect.max_y) bitmap.pix(y, x) = NUM_PENS + (lfsr & 0x3f); - cnt++; } } } diff --git a/src/mame/shared/namco_c355spr.cpp b/src/mame/shared/namco_c355spr.cpp index ea2780abaf9..9cc1ff6b4c9 100644 --- a/src/mame/shared/namco_c355spr.cpp +++ b/src/mame/shared/namco_c355spr.cpp @@ -560,7 +560,6 @@ void namco_c355spr_device::render_sprites(const rectangle cliprect, bitmap_ind8 temp_bitmap.fill(0xffff, cliprect); for (int no = 0; no < 2; no++) { - int i = 0; c355_sprite *sprite_ptr = m_spritelist[no].get(); while (sprite_ptr != m_sprite_end[no]) @@ -602,7 +601,6 @@ void namco_c355spr_device::render_sprites(const rectangle cliprect, bitmap_ind8 } } } - i++; sprite_ptr++; } } diff --git a/src/osd/modules/debugger/debugimgui.cpp b/src/osd/modules/debugger/debugimgui.cpp index 944ed203b79..8aed9b2c51e 100644 --- a/src/osd/modules/debugger/debugimgui.cpp +++ b/src/osd/modules/debugger/debugimgui.cpp @@ -1013,7 +1013,6 @@ void debug_imgui::refresh_filelist() std::error_condition const err = util::zippath_directory::open(m_path,dir); if(!err) { - int x = 0; // add drives for(std::string const &volume_name : osd_get_volume_names()) { @@ -1022,7 +1021,6 @@ void debug_imgui::refresh_filelist() temp.basename = volume_name; temp.fullpath = volume_name; m_filelist.emplace_back(std::move(temp)); - x++; } first = m_filelist.size(); const osd::directory::entry *dirent; @@ -1393,7 +1391,6 @@ void debug_imgui::update() //debug_area* view_ptr = view_list; std::vector::iterator view_ptr; bool opened; - int count = 0; ImGui::PushStyleColor(ImGuiCol_WindowBg,ImVec4(1.0f,1.0f,1.0f,0.9f)); ImGui::PushStyleColor(ImGuiCol_Text,ImVec4(0.0f,0.0f,0.0f,1.0f)); ImGui::PushStyleColor(ImGuiCol_TextDisabled,ImVec4(0.0f,0.0f,1.0f,1.0f)); @@ -1438,7 +1435,6 @@ void debug_imgui::update() break; } ++view_ptr; - count++; } // check for a closed window if(to_delete != nullptr)