From df2ebdea8d7c261d7e659593df32eaead1bd3fdd Mon Sep 17 00:00:00 2001 From: Cowering Date: Thu, 23 Jul 2015 10:48:28 -0500 Subject: [PATCH] please bear with me.. these are needed to compile in GCC 5.2 and I want mingw guys to see them. with luck they can be reverted in a couple of days (nw) --- src/emu/audit.c | 11 +++++++++++ src/emu/cpu/sh2/sh2comn.c | 28 ++++++++++++++++++++-------- src/emu/machine/nvram.c | 11 +++++++++++ src/emu/machine/pci.c | 11 +++++++++++ src/emu/machine/pit8253.c | 10 ++++++++++ src/emu/netlist/nl_parser.c | 11 +++++++++++ src/emu/netlist/plib/pconfig.h | 12 ++++++++++++ src/emu/netlist/plib/pparser.c | 12 ++++++++++++ src/emu/netlist/solver/nld_solver.c | 12 ++++++++++++ src/emu/netlist/tools/nl_convert.c | 12 ++++++++++++ src/emu/schedule.c | 12 ++++++++++++ src/emu/sound/discrete.c | 13 +++++++++++++ src/emu/video/rgbsse.h | 8 ++++---- src/mame/drivers/chihiro.c | 12 ++++++++++++ src/mame/drivers/model3.c | 11 +++++++++++ src/mame/drivers/naomi.c | 16 ++++++++++++++-- src/mame/machine/dc.c | 11 +++++++++++ src/mess/drivers/ssem.c | 11 +++++++++++ 18 files changed, 210 insertions(+), 14 deletions(-) diff --git a/src/emu/audit.c b/src/emu/audit.c index b8ab208d6a0..f6d90cee7d3 100644 --- a/src/emu/audit.c +++ b/src/emu/audit.c @@ -14,6 +14,13 @@ #include "chd.h" #include "sound/samples.h" +// for now, make buggy GCC/Mingw STFU about I64FMT +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat" +#pragma GCC diagnostic ignored "-Wformat-extra-args" +#endif + //************************************************************************** // CORE FUNCTIONS @@ -607,3 +614,7 @@ audit_record::audit_record(const char *name, media_type type) m_shared_device(NULL) { } + +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic pop +#endif diff --git a/src/emu/cpu/sh2/sh2comn.c b/src/emu/cpu/sh2/sh2comn.c index f6883649ee9..38b6d633c22 100644 --- a/src/emu/cpu/sh2/sh2comn.c +++ b/src/emu/cpu/sh2/sh2comn.c @@ -13,6 +13,14 @@ #include "sh2.h" #include "sh2comn.h" + +// for now, make buggy GCC/Mingw STFU about I64FMT +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat" +#pragma GCC diagnostic ignored "-Wformat-extra-args" +#endif + #define VERBOSE 0 #define LOG(x) do { if (VERBOSE) logerror x; } while (0) @@ -887,7 +895,7 @@ void sh2_device::sh2_exception(const char *message, int irqline) /* SH-7021 on-chip device */ - + void sh2a_device::sh7032_dma_exec(int ch) { const short dma_word_size[4] = { 0, +1, -1, 0 }; @@ -897,11 +905,11 @@ void sh2a_device::sh7032_dma_exec(int ch) logerror("Warning: SH7032 DMA enables non auto-request transfer\n"); return; } - + // channel enable & master enable if((m_dma[ch].chcr & 1) == 0 || (m_dmaor & 1) == 0) return; - + printf("%08x %08x %04x\n",m_dma[ch].sar,m_dma[ch].dar,m_dma[ch].chcr); UINT8 dm = (m_dma[ch].chcr >> 14) & 3; /**< Destination Address Mode bits */ UINT8 sm = (m_dma[ch].chcr >> 12) & 3; /**< Source Address Mode bits */ @@ -909,25 +917,25 @@ void sh2a_device::sh7032_dma_exec(int ch) int src_word_size = dma_word_size[sm] * ((ts == true) ? 2 : 1); int dst_word_size = dma_word_size[dm] * ((ts == true) ? 2 : 1); UINT32 src_addr = m_dma[ch].sar; - UINT32 dst_addr = m_dma[ch].dar; + UINT32 dst_addr = m_dma[ch].dar; UINT32 size_index = m_dma[ch].tcr; if(size_index == 0) size_index = 0x10000; - + if(ts == false) logerror("SH7032: DMA byte mode check\n"); - + for(int index = size_index;index>-1;index--) { if(ts == true) m_program->write_word(dst_addr,m_program->read_word(src_addr)); else m_program->write_byte(dst_addr,m_program->read_byte(src_addr)); - + src_addr += src_word_size; dst_addr += dst_word_size; } - + m_dma[ch].chcr &= ~1; /**< @todo non-instant DMA */ printf("%02x %02x %02x %1d\n",sm,dm,rs,ts); } @@ -1014,3 +1022,7 @@ WRITE16_MEMBER(sh2a_device::sh7021_w) { COMBINE_DATA(&m_sh7021_regs[offset]); } +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic pop +#endif + diff --git a/src/emu/machine/nvram.c b/src/emu/machine/nvram.c index 17a8fbcf60c..343d246176c 100644 --- a/src/emu/machine/nvram.c +++ b/src/emu/machine/nvram.c @@ -12,6 +12,12 @@ #include "machine/nvram.h" +// for now, make buggy GCC/Mingw STFU about I64FMT +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat" +#pragma GCC diagnostic ignored "-Wformat-extra-args" +#endif //************************************************************************** // LIVE DEVICE @@ -169,3 +175,8 @@ void nvram_device::determine_final_base() if (m_region != NULL && m_region->bytes() != m_length) throw emu_fatalerror("NVRAM device '%s' has a default region, but it should be 0x%" SIZETFMT "X bytes", tag(), m_length); } + +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic pop +#endif + diff --git a/src/emu/machine/pci.c b/src/emu/machine/pci.c index 079444f379b..ef2e0f4ee0e 100644 --- a/src/emu/machine/pci.c +++ b/src/emu/machine/pci.c @@ -2,6 +2,13 @@ // copyright-holders:Olivier Galibert #include "pci.h" +// for now, make buggy GCC/Mingw STFU about I64FMT +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat" +#pragma GCC diagnostic ignored "-Wformat-extra-args" +#endif + const device_type PCI_ROOT = &device_creator; const device_type PCI_BRIDGE = &device_creator; @@ -895,3 +902,7 @@ void pci_root_device::device_start() void pci_root_device::device_reset() { } + +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic pop +#endif \ No newline at end of file diff --git a/src/emu/machine/pit8253.c b/src/emu/machine/pit8253.c index ebd243899fc..006992f7073 100644 --- a/src/emu/machine/pit8253.c +++ b/src/emu/machine/pit8253.c @@ -23,6 +23,12 @@ #include "emu.h" #include "machine/pit8253.h" +// for now, make buggy GCC/Mingw STFU about I64FMT +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat" +#pragma GCC diagnostic ignored "-Wformat-extra-args" +#endif /* device types */ enum @@ -1129,3 +1135,7 @@ WRITE_LINE_MEMBER( pit8253_device::write_clk2 ) { set_clock_signal(2, state); } + +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic pop +#endif diff --git a/src/emu/netlist/nl_parser.c b/src/emu/netlist/nl_parser.c index 23ee63d0ee2..06ff0c8e932 100644 --- a/src/emu/netlist/nl_parser.c +++ b/src/emu/netlist/nl_parser.c @@ -9,6 +9,13 @@ #include "nl_factory.h" #include "devices/nld_truthtable.h" +// for now, make buggy GCC/Mingw STFU about I64FMT +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat" +#pragma GCC diagnostic ignored "-Wformat-extra-args" +#endif + //#undef NL_VERBOSE_OUT //#define NL_VERBOSE_OUT(x) printf x @@ -466,3 +473,7 @@ nl_double parser_t::eval_param(const token_t tok) #endif } } + +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic pop +#endif diff --git a/src/emu/netlist/plib/pconfig.h b/src/emu/netlist/plib/pconfig.h index b39701c90e9..45958b85468 100644 --- a/src/emu/netlist/plib/pconfig.h +++ b/src/emu/netlist/plib/pconfig.h @@ -5,6 +5,13 @@ * */ +// for now, make buggy GCC/Mingw STFU about I64FMT +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat" +#pragma GCC diagnostic ignored "-Wformat-extra-args" +#endif + #ifndef PCONFIG_H_ #define PCONFIG_H_ @@ -223,3 +230,8 @@ private: #endif #endif /* PCONFIG_H_ */ + +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic pop +#endif + diff --git a/src/emu/netlist/plib/pparser.c b/src/emu/netlist/plib/pparser.c index 954b9048810..9ea2505c327 100644 --- a/src/emu/netlist/plib/pparser.c +++ b/src/emu/netlist/plib/pparser.c @@ -10,6 +10,13 @@ #include "pparser.h" +// for now, make buggy GCC/Mingw STFU about I64FMT +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat" +#pragma GCC diagnostic ignored "-Wformat-extra-args" +#endif + //#undef NL_VERBOSE_OUT //#define NL_VERBOSE_OUT(x) printf x @@ -480,3 +487,8 @@ pstring ppreprocessor::process(const pstring &contents) } return pstring(ret.cstr()); } + + +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic pop +#endif diff --git a/src/emu/netlist/solver/nld_solver.c b/src/emu/netlist/solver/nld_solver.c index acf9a6fdaae..9bae485e2f9 100644 --- a/src/emu/netlist/solver/nld_solver.c +++ b/src/emu/netlist/solver/nld_solver.c @@ -9,6 +9,14 @@ * the vectorizations fast-math enables pretty expensive */ +// for now, make buggy GCC/Mingw STFU about I64FMT +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat" +#pragma GCC diagnostic ignored "-Wformat-extra-args" +#endif + + //#pragma GCC optimize "-ffast-math" #if 0 #pragma GCC optimize "-ffast-math" @@ -600,3 +608,7 @@ ATTR_COLD void NETLIB_NAME(solver)::post_start() } NETLIB_NAMESPACE_DEVICES_END() + +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic pop +#endif diff --git a/src/emu/netlist/tools/nl_convert.c b/src/emu/netlist/tools/nl_convert.c index 23e5c537b12..bee0c2e8c36 100644 --- a/src/emu/netlist/tools/nl_convert.c +++ b/src/emu/netlist/tools/nl_convert.c @@ -10,6 +10,14 @@ #include #include "nl_convert.h" + +// for now, make buggy GCC/Mingw STFU about I64FMT +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat" +#pragma GCC diagnostic ignored "-Wformat-extra-args" +#endif + template static plist_t bubble(const pnamedlist_t &sl) { @@ -455,3 +463,7 @@ void nl_convert_eagle_t::convert(const pstring &contents) } } + +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic pop +#endif diff --git a/src/emu/schedule.c b/src/emu/schedule.c index 1695936fa26..46aae22c078 100644 --- a/src/emu/schedule.c +++ b/src/emu/schedule.c @@ -11,6 +11,13 @@ #include "emu.h" #include "debugger.h" +// for now, make buggy GCC/Mingw STFU about I64FMT +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat" +#pragma GCC diagnostic ignored "-Wformat-extra-args" +#endif + //************************************************************************** // DEBUGGING @@ -982,3 +989,8 @@ void device_scheduler::dump_timers() const timer->dump(); logerror("=============================================\n"); } + +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic pop +#endif + diff --git a/src/emu/sound/discrete.c b/src/emu/sound/discrete.c index 5270f37ebb9..e35ee545b47 100644 --- a/src/emu/sound/discrete.c +++ b/src/emu/sound/discrete.c @@ -39,6 +39,14 @@ #include "wavwrite.h" #include "discrete.h" +// for now, make buggy GCC/Mingw STFU about I64FMT +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat" +#pragma GCC diagnostic ignored "-Wformat-extra-args" +#endif + + /* for_each collides with c++ standard libraries - include it here */ #define for_each(_T, _e, _l) for (_T _e = (_l)->begin_ptr() ; _e <= (_l)->end_ptr(); _e++) @@ -1134,3 +1142,8 @@ WRITE8_MEMBER( discrete_device::write ) discrete_log("discrete_sound_w write to non-existent NODE_%02d\n", offset-NODE_00); } } + +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic pop +#endif + diff --git a/src/emu/video/rgbsse.h b/src/emu/video/rgbsse.h index 5f88e0e717c..a29dd879ec8 100644 --- a/src/emu/video/rgbsse.h +++ b/src/emu/video/rgbsse.h @@ -512,10 +512,10 @@ protected: struct _statics { __m128 dummy_for_alignment; - INT16 alpha_mask[8]; - INT16 red_mask[8]; - INT16 green_mask[8]; - INT16 blue_mask[8]; + UINT16 alpha_mask[8]; + UINT16 red_mask[8]; + UINT16 green_mask[8]; + UINT16 blue_mask[8]; INT16 scale_table[256][8]; }; diff --git a/src/mame/drivers/chihiro.c b/src/mame/drivers/chihiro.c index cc9fe4c26b6..cbe964e9680 100644 --- a/src/mame/drivers/chihiro.c +++ b/src/mame/drivers/chihiro.c @@ -377,6 +377,14 @@ Thanks to Alex, Mr Mudkips, and Philip Burke for this info. #include "debug/debugcpu.h" #include "includes/chihiro.h" + +// for now, make buggy GCC/Mingw STFU about I64FMT +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat" +#pragma GCC diagnostic ignored "-Wformat-extra-args" +#endif + #define LOG_PCI //#define LOG_OHCI //#define LOG_BASEBOARD @@ -3028,3 +3036,7 @@ ROM_END // 0023 // 0024 GAME( 2009, ccfboxo, ccfboxa, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Chihiro Firmware Update For Compact Flash Box (GDX-0024)", GAME_NO_SOUND|GAME_NOT_WORKING ) /* 0024A */ GAME( 2009, ccfboxa, chihiro, chihirogd, chihiro, driver_device, 0, ROT0, "Sega", "Chihiro Firmware Update For Compact Flash Box (Rev A) (GDX-0024A)", GAME_NO_SOUND|GAME_NOT_WORKING ) + +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic pop +#endif diff --git a/src/mame/drivers/model3.c b/src/mame/drivers/model3.c index 8509fb90664..d83eb262f99 100644 --- a/src/mame/drivers/model3.c +++ b/src/mame/drivers/model3.c @@ -667,6 +667,13 @@ ALL VROM ROMs are 16M MASK #include "includes/model3.h" +// for now, make buggy GCC/Mingw STFU about I64FMT +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat" +#pragma GCC diagnostic ignored "-Wformat-extra-args" +#endif + void model3_state::update_irq_state() { @@ -6052,3 +6059,7 @@ GAME( 1998, magtruck, 0, model3_21_5881, eca, model3_state, magtruc GAME( 1999, eca, 0, model3_21_5881, eca, model3_state, eca, ROT0, "Sega", "Emergency Call Ambulance (Export)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) GAME( 1999, ecau, eca, model3_21_5881, eca, model3_state, eca, ROT0, "Sega", "Emergency Call Ambulance (USA)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) GAME( 1999, ecap, eca, model3_21_5881, eca, model3_state, eca, ROT0, "Sega", "Emergency Call Ambulance (US location test?)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) + +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic pop +#endif \ No newline at end of file diff --git a/src/mame/drivers/naomi.c b/src/mame/drivers/naomi.c index ecd32a47570..a27cd8d3a03 100644 --- a/src/mame/drivers/naomi.c +++ b/src/mame/drivers/naomi.c @@ -1533,10 +1533,17 @@ Sushi Bar */ #include "emu.h" - - #include "includes/naomi.h" + +// for now, make buggy GCC/Mingw STFU about I64FMT +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat" +#pragma GCC diagnostic ignored "-Wformat-extra-args" +#endif + + #define CPU_CLOCK (200000000) READ64_MEMBER(naomi_state::naomi_arm_r ) @@ -9377,3 +9384,8 @@ GAME( 2006, mslug6, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Sega GAME( 2006, xtrmhnt2, awbios, aw2c, aw2c, naomi_state, xtrmhnt2, ROT0, "Sega", "Extreme Hunting 2", GAME_FLAGS ) GAME( 2008, claychal, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Sega", "Sega Clay Challenge", GAME_FLAGS ) GAME( 2009, basschal, awbios, aw2c, aw2c, naomi_state, atomiswave, ROT0, "Sega", "Sega Bass Fishing Challenge", GAME_FLAGS ) + +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic pop +#endif + diff --git a/src/mame/machine/dc.c b/src/mame/machine/dc.c index 324a1a1dfe6..341f584a327 100644 --- a/src/mame/machine/dc.c +++ b/src/mame/machine/dc.c @@ -14,6 +14,13 @@ #include "machine/naomig1.h" #include "video/powervr2.h" +// for now, make buggy GCC/Mingw STFU about I64FMT +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat" +#pragma GCC diagnostic ignored "-Wformat-extra-args" +#endif + #define DEBUG_REGISTERS (1) #if DEBUG_REGISTERS @@ -722,3 +729,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(dc_state::dc_scanline) { m_powervr2->pvr_scanline_timer(param); } +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic pop +#endif + diff --git a/src/mess/drivers/ssem.c b/src/mess/drivers/ssem.c index 7e28ffc5b99..b28b5ae7ee6 100644 --- a/src/mess/drivers/ssem.c +++ b/src/mess/drivers/ssem.c @@ -11,6 +11,13 @@ #include "cpu/ssem/ssem.h" #include "imagedev/snapquik.h" +// for now, make buggy GCC/Mingw STFU about I64FMT +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat" +#pragma GCC diagnostic ignored "-Wformat-extra-args" +#endif + class ssem_state : public driver_device { public: @@ -642,3 +649,7 @@ ROM_END /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */ COMP(1948, ssem, 0, 0, ssem, ssem, driver_device, 0, "Manchester University", "Small-Scale Experimental Machine (SSEM), 'Baby'", GAME_NO_SOUND_HW | GAME_SUPPORTS_SAVE ) + +#if (defined(__MINGW32__) && (__GNUC__ >= 5)) +#pragma GCC diagnostic pop +#endif