From 467a1168843fadda75b94ed82b93048042773b5c Mon Sep 17 00:00:00 2001 From: smf- Date: Sun, 7 Nov 2021 11:24:43 +0000 Subject: fixes for variables set but not used --- scripts/src/3rdparty.lua | 10 ++++++++++ src/devices/cpu/arcompact/arcompact_execute.cpp | 2 +- src/emu/debug/dvdisasm.cpp | 12 ++++++------ src/lib/formats/dfi_dsk.cpp | 4 +--- src/lib/formats/fdd_dsk.cpp | 2 +- src/lib/formats/ti99_dsk.cpp | 2 +- src/lib/formats/vt_dsk.cpp | 4 ++-- src/mame/drivers/cobra.cpp | 8 ++++---- src/mame/drivers/gunpey.cpp | 2 +- src/mame/drivers/nemesis.cpp | 2 +- src/mame/machine/seicopbl.cpp | 2 +- src/mame/video/3dom2_te.cpp | 2 +- src/mame/video/fmtowns.cpp | 2 +- src/mame/video/midtunit.cpp | 4 ++-- src/mame/video/model2.cpp | 2 +- 15 files changed, 34 insertions(+), 26 deletions(-) diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index 436a54a3e43..267b19d44df 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -1196,6 +1196,11 @@ project "bimg" end end + configuration { "gmake" } + buildoptions { + "-Wno-unused-but-set-variable", + } + defines { "__STDC_LIMIT_MACROS", "__STDC_FORMAT_MACROS", @@ -2220,6 +2225,11 @@ project "asmjit" end end + configuration { "gmake" } + buildoptions { + "-Wno-unused-but-set-variable", + } + files { MAME_DIR .. "3rdparty/asmjit/src/asmjit/asmjit.h", MAME_DIR .. "3rdparty/asmjit/src/asmjit/core.h", diff --git a/src/devices/cpu/arcompact/arcompact_execute.cpp b/src/devices/cpu/arcompact/arcompact_execute.cpp index 7d5d9383708..087969b385e 100644 --- a/src/devices/cpu/arcompact/arcompact_execute.cpp +++ b/src/devices/cpu/arcompact/arcompact_execute.cpp @@ -6564,7 +6564,7 @@ ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_21_p10(OPS_32) ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_21_p11_m0(OPS_32) // Jcc.D (no link, delay) { int size = 4; - uint32_t limm; + [[maybe_unused]] uint32_t limm; int got_limm = 0; COMMON32_GET_creg diff --git a/src/emu/debug/dvdisasm.cpp b/src/emu/debug/dvdisasm.cpp index 5c371b37426..0dcc0b98982 100644 --- a/src/emu/debug/dvdisasm.cpp +++ b/src/emu/debug/dvdisasm.cpp @@ -57,12 +57,12 @@ debug_view_disasm::debug_view_disasm(running_machine &machine, debug_view_osd_up throw std::bad_alloc(); // count the number of comments - int total_comments = 0; - for(auto &source : m_source_list) - { - const debug_view_disasm_source &dasmsource = downcast(*source); - total_comments += dasmsource.device()->debug()->comment_count(); - } + //int total_comments = 0; + //for(auto &source : m_source_list) + //{ + //const debug_view_disasm_source &dasmsource = downcast(*source); + //total_comments += dasmsource.device()->debug()->comment_count(); + //} // configure the view m_total.y = DEFAULT_DASM_LINES; diff --git a/src/lib/formats/dfi_dsk.cpp b/src/lib/formats/dfi_dsk.cpp index d78db94d772..79077ab2e12 100644 --- a/src/lib/formats/dfi_dsk.cpp +++ b/src/lib/formats/dfi_dsk.cpp @@ -85,7 +85,7 @@ bool dfi_format::load(util::random_read &io, uint32_t form_factor, const std::ve std::vector data; int onerev_time = 0; // time for one revolution, used to guess clock and rpm for DFE2 files unsigned long clock_rate = 100000000; // sample clock rate in megahertz - int rpm=360; // drive rpm + [[maybe_unused]] int rpm=360; // drive rpm while(pos < size) { uint8_t h[10]; io.read_at(pos, h, 10, actual); @@ -161,8 +161,6 @@ bool dfi_format::load(util::random_read &io, uint32_t form_factor, const std::ve osd_printf_verbose("dfi_dsk: Actual rpm based on index: %f\n", ((double)clock_rate/(double)onerev_time)*60); } - rpm += 0; // HACK: prevent GCC 4.6+ from warning "variable set but unused" - if(!index_time) index_time = total_time; diff --git a/src/lib/formats/fdd_dsk.cpp b/src/lib/formats/fdd_dsk.cpp index 1a5a1d54c1b..388bf1f3208 100644 --- a/src/lib/formats/fdd_dsk.cpp +++ b/src/lib/formats/fdd_dsk.cpp @@ -88,7 +88,7 @@ bool fdd_format::load(util::random_read &io, uint32_t form_factor, const std::ve for (int track = 0; track < 160; track++) { - int curr_num_sec = 0, curr_track_size = 0; + int curr_num_sec = 0; [[maybe_unused]] int curr_track_size = 0; for (int sect = 0; sect < 26; sect++) { // read sector map for this sector diff --git a/src/lib/formats/ti99_dsk.cpp b/src/lib/formats/ti99_dsk.cpp index 12ad80707e9..8c20ca376f7 100644 --- a/src/lib/formats/ti99_dsk.cpp +++ b/src/lib/formats/ti99_dsk.cpp @@ -570,7 +570,7 @@ int ti99_floppy_format::get_sectors(const std::vector &bitstream, int enco int seccount = 0; uint16_t shift_reg = 0; uint8_t databyte = 0; - uint8_t curbyte = 0; + [[maybe_unused]] uint8_t curbyte = 0; int rep = 0; int cursect = 0; diff --git a/src/lib/formats/vt_dsk.cpp b/src/lib/formats/vt_dsk.cpp index 15c6955bfcc..6758b5a27b2 100644 --- a/src/lib/formats/vt_dsk.cpp +++ b/src/lib/formats/vt_dsk.cpp @@ -119,7 +119,7 @@ std::vector vtech_common_format::flux_to_image(floppy_image *image) int pos = 0; int count = 0; uint8_t *dest = nullptr; - uint16_t checksum = 0; + [[maybe_unused]] uint16_t checksum = 0; uint64_t buf = 0; sz = bitstream.size(); if(sz < 128) @@ -283,7 +283,7 @@ bool vtech_dsk_format::load(util::random_read &io, uint32_t form_factor, const s int mode = 0; int count = 0; - uint16_t checksum = 0; + [[maybe_unused]] uint16_t checksum = 0; uint64_t buf = 0; uint8_t *dest = nullptr; diff --git a/src/mame/drivers/cobra.cpp b/src/mame/drivers/cobra.cpp index a79387caf7e..b6992fc4d42 100644 --- a/src/mame/drivers/cobra.cpp +++ b/src/mame/drivers/cobra.cpp @@ -881,8 +881,8 @@ void cobra_renderer::render_color_scan(int32_t scanline, const extent_t &extent, float dgg = extent.param[POLY_G].dpdx; float gb = extent.param[POLY_B].start; float dgb = extent.param[POLY_B].dpdx; - float ga = extent.param[POLY_A].start; - float dga = extent.param[POLY_A].dpdx; + [[maybe_unused]] float ga = extent.param[POLY_A].start; + [[maybe_unused]] float dga = extent.param[POLY_A].dpdx; uint32_t zmode = extradata.zmode; @@ -967,8 +967,8 @@ void cobra_renderer::render_texture_scan(int32_t scanline, const extent_t &exten float dgg = extent.param[POLY_G].dpdx; float gb = extent.param[POLY_B].start; float dgb = extent.param[POLY_B].dpdx; - float ga = extent.param[POLY_A].start; - float dga = extent.param[POLY_A].dpdx; + [[maybe_unused]] float ga = extent.param[POLY_A].start; + [[maybe_unused]] float dga = extent.param[POLY_A].dpdx; uint32_t *const fb = &m_backbuffer->pix(scanline); float *const zb = (float*)&m_zbuffer->pix(scanline); diff --git a/src/mame/drivers/gunpey.cpp b/src/mame/drivers/gunpey.cpp index 866157d1bf7..d6b3839763d 100644 --- a/src/mame/drivers/gunpey.cpp +++ b/src/mame/drivers/gunpey.cpp @@ -880,7 +880,7 @@ bool gunpey_state::decompress_sprite(unsigned char *buf, int ix, int iy, int ow, s.ox = 0; s.oy = 0; - int temp; + [[maybe_unused]] int temp; temp = get_next_bit(&s); temp |= get_next_bit(&s) << 1; temp |= get_next_bit(&s) << 2; diff --git a/src/mame/drivers/nemesis.cpp b/src/mame/drivers/nemesis.cpp index 0bce1dd7ed9..0360d59b0fe 100644 --- a/src/mame/drivers/nemesis.cpp +++ b/src/mame/drivers/nemesis.cpp @@ -3097,7 +3097,7 @@ void nemesis_state::bubsys_twinbeeb_init() for (int i = 0; i < 0x806; i++) { - uint16_t crc = 0; + [[maybe_unused]] uint16_t crc = 0; int sourcebase = i * 0x80; int destbase = i * 0x90; diff --git a/src/mame/machine/seicopbl.cpp b/src/mame/machine/seicopbl.cpp index 58ee8a54d25..b4e898bc505 100644 --- a/src/mame/machine/seicopbl.cpp +++ b/src/mame/machine/seicopbl.cpp @@ -269,7 +269,7 @@ void seibu_cop_bootleg_device::cmd_trigger_w(offs_t offset, uint16_t data) */ case 0x8100: { - uint16_t sin_offs; //= m_host_space->read_dword(m_reg[0]+(0x34)); + [[maybe_unused]] uint16_t sin_offs; //= m_host_space->read_dword(m_reg[0]+(0x34)); sin_offs = m_host_space->read_byte(m_reg[0]+(0x35)); sin_offs |= m_host_space->read_byte(m_reg[0]+(0x37)) << 8; int raw_angle = (m_host_space->read_word(m_reg[0]+(0x34^2)) & 0xff); diff --git a/src/mame/video/3dom2_te.cpp b/src/mame/video/3dom2_te.cpp index ecacdfbe6e7..96285178bbd 100644 --- a/src/mame/video/3dom2_te.cpp +++ b/src/mame/video/3dom2_te.cpp @@ -2433,7 +2433,7 @@ void m2_te_device::destination_blend(uint32_t x, uint32_t y, uint32_t w, const r bool winclipdis = false; // Z Status - uint32_t zgel = 0; + [[maybe_unused]] uint32_t zgel = 0; uint32_t zaddr; diff --git a/src/mame/video/fmtowns.cpp b/src/mame/video/fmtowns.cpp index 34b912b54f9..54f22f7af31 100644 --- a/src/mame/video/fmtowns.cpp +++ b/src/mame/video/fmtowns.cpp @@ -1422,7 +1422,7 @@ void towns_state::render_text_char(uint8_t x, uint8_t y, uint8_t ascii, uint16_t temp |= ((colour & 0x0f) << 4); if(data & (1<<(b+1))) temp |= (colour & 0x0f); - //m_towns_gfxvram[0x40000+vram_addr+(b/2)] = temp; + m_towns_gfxvram[0x40000+vram_addr+(b/2)] = temp; } vram_addr += linesize; diff --git a/src/mame/video/midtunit.cpp b/src/mame/video/midtunit.cpp index 14e463c72b8..f792cb075c5 100644 --- a/src/mame/video/midtunit.cpp +++ b/src/mame/video/midtunit.cpp @@ -440,7 +440,7 @@ void midtunit_video_device::dma_draw() while (iy < height) { int startskip = m_dma_state.startskip << 8; - int endskip = m_dma_state.endskip << 8; + [[maybe_unused]] int endskip = m_dma_state.endskip << 8; int width = m_dma_state.width << 8; int sx = m_dma_state.xpos; int ix = 0; @@ -922,7 +922,7 @@ void midtunit_video_device::log_bitmap(int command, int bpp, bool Skip) for (int y = 0; y < m_dma_state.height; y++) { int startskip = m_dma_state.startskip; - int endskip = m_dma_state.endskip; + [[maybe_unused]] int endskip = m_dma_state.endskip; int width = m_dma_state.width; int ix = 0; int tx; diff --git a/src/mame/video/model2.cpp b/src/mame/video/model2.cpp index 2c2b6387274..8f737bfb2f9 100644 --- a/src/mame/video/model2.cpp +++ b/src/mame/video/model2.cpp @@ -2420,7 +2420,7 @@ u32 *model2_state::geo_code_upload( geo_state *geo, u32 opcode, u32 *input ) for( i = 0; i < count; i++ ) { - u64 code; + [[maybe_unused]] u64 code; /* read the top part of the opcode */ code = *input++; -- cgit v1.2.3