MESS part of ATTR_PRINTF review (nw)

This commit is contained in:
Oliver Stöneberg 2014-02-25 12:13:30 +00:00
parent 5c27ec48a2
commit d0ec062e2c
20 changed files with 53 additions and 66 deletions

View File

@ -14,23 +14,6 @@
#define ENABLE_VERBOSE_LOG (0)
#if ENABLE_VERBOSE_LOG
inline void craft_state::verboselog(int n_level, const char *s_fmt, ...)
{
if( VERBOSE_LEVEL >= n_level )
{
va_list v;
char buf[ 32768 ];
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
logerror( "%08x: %s", m_maincpu->safe_pc(), buf );
}
}
#else
#define verboselog(x,y,z,...)
#endif
#define MASTER_CLOCK 20000000
#define VISIBLE_CYCLES 480
@ -77,12 +60,25 @@ public:
DECLARE_DRIVER_INIT(craft);
virtual void machine_reset();
UINT32 screen_update_craft(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
#if ENABLE_VERBOSE_LOG
inline void verboselog(int n_level, const char *s_fmt, ...);
#endif
inline void verboselog(int n_level, const char *s_fmt, ...) ATTR_PRINTF(3,4);
required_device<dac_device> m_dac;
};
inline void craft_state::verboselog(int n_level, const char *s_fmt, ...)
{
#if ENABLE_VERBOSE_LOG
if( VERBOSE_LEVEL >= n_level )
{
va_list v;
char buf[ 32768 ];
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
logerror( "%08x: %s", m_maincpu->safe_pc(), buf );
}
#endif
}
void craft_state::machine_start()
{
}

View File

@ -148,13 +148,15 @@
static int shift = 32;
#endif
void print_to_stderr(const char *format, ...)
#if 0
static void ATTR_PRINTF(1,2) print_to_stderr(const char *format, ...)
{
va_list arg;
va_start(arg, format);
vfprintf(stderr, format, arg);
va_end(arg);
}
#endif
class esq5505_state : public driver_device
{

View File

@ -25,7 +25,7 @@
#define VERBOSE_LEVEL (0)
INLINE void verboselog(running_machine &machine, int n_level, const char *s_fmt, ...)
INLINE void ATTR_PRINTF(3,4) verboselog(running_machine &machine, int n_level, const char *s_fmt, ...)
{
if( VERBOSE_LEVEL >= n_level )
{

View File

@ -55,7 +55,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
DECLARE_INPUT_CHANGED_MEMBER(port_changed);
inline void ATTR_PRINTF(3,4) verboselog( int n_level, const char *s_fmt, ...);
inline void verboselog(int n_level, const char *s_fmt, ...) ATTR_PRINTF(3,4);
required_device<cpu_device> m_maincpu;
required_device<gf4500_device> m_gf4500;
DECLARE_READ32_MEMBER(s3c2440_gpio_port_r);
@ -65,7 +65,7 @@ public:
};
inline void ATTR_PRINTF(3,4) gizmondo_state::verboselog( int n_level, const char *s_fmt, ...)
inline void gizmondo_state::verboselog( int n_level, const char *s_fmt, ...)
{
if (VERBOSE_LEVEL >= n_level)
{

View File

@ -22,7 +22,7 @@
#define VERBOSE_LEVEL ( 0 )
INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ...)
INLINE void ATTR_PRINTF(3,4) verboselog(running_machine &machine, int n_level, const char *s_fmt, ...)
{
if (VERBOSE_LEVEL >= n_level)
{

View File

@ -37,7 +37,7 @@ public:
DECLARE_INPUT_CHANGED_MEMBER(port_changed);
DECLARE_READ32_MEMBER(s3c2410_gpio_port_r);
DECLARE_WRITE32_MEMBER(s3c2410_gpio_port_w);
inline void ATTR_PRINTF(3,4) verboselog( int n_level, const char *s_fmt, ...);
inline void verboselog(int n_level, const char *s_fmt, ...) ATTR_PRINTF(3,4);
void lcd_spi_reset( );
void lcd_spi_init( );
void lcd_spi_line_w( int line, int data);
@ -58,7 +58,7 @@ enum
LCD_SPI_LINE_3
};
inline void ATTR_PRINTF(3,4) hp49gp_state::verboselog( int n_level, const char *s_fmt, ...)
inline void hp49gp_state::verboselog(int n_level, const char *s_fmt, ...)
{
if (VERBOSE_LEVEL >= n_level)
{

View File

@ -50,7 +50,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
DECLARE_INPUT_CHANGED_MEMBER(port_changed);
inline void ATTR_PRINTF(3,4) verboselog( int n_level, const char *s_fmt, ...);
inline void verboselog(int n_level, const char *s_fmt, ...) ATTR_PRINTF(3,4);
void smc_reset( );
void smc_init( );
UINT8 smc_read( );
@ -60,7 +60,7 @@ public:
DECLARE_WRITE16_MEMBER(s3c44b0_i2s_data_w);
};
inline void ATTR_PRINTF(3,4) juicebox_state::verboselog( int n_level, const char *s_fmt, ...)
inline void juicebox_state::verboselog(int n_level, const char *s_fmt, ...)
{
if (VERBOSE_LEVEL >= n_level)
{

View File

@ -39,7 +39,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
DECLARE_INPUT_CHANGED_MEMBER(mini2440_input_changed);
inline void ATTR_PRINTF(3,4) verboselog( int n_level, const char *s_fmt, ...);
inline void verboselog(int n_level, const char *s_fmt, ...) ATTR_PRINTF(3,4);
DECLARE_READ32_MEMBER(s3c2440_gpio_port_r);
DECLARE_WRITE32_MEMBER(s3c2440_gpio_port_w);
DECLARE_READ32_MEMBER(s3c2440_core_pin_r);
@ -52,7 +52,7 @@ public:
};
inline void ATTR_PRINTF(3,4) mini2440_state::verboselog( int n_level, const char *s_fmt, ...)
inline void mini2440_state::verboselog(int n_level, const char *s_fmt, ...)
{
if (VERBOSE_LEVEL >= n_level)
{

View File

@ -89,7 +89,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
DECLARE_INPUT_CHANGED_MEMBER(palmz22_input_changed);
inline void ATTR_PRINTF(3,4) verboselog( int n_level, const char *s_fmt, ...);
inline void verboselog(int n_level, const char *s_fmt, ...) ATTR_PRINTF(3,4);
DECLARE_WRITE8_MEMBER( s3c2410_nand_command_w );
DECLARE_WRITE8_MEMBER( s3c2410_nand_address_w );
DECLARE_READ8_MEMBER( s3c2410_nand_data_r );
@ -102,7 +102,7 @@ public:
};
inline void ATTR_PRINTF(3,4) palmz22_state::verboselog( int n_level, const char *s_fmt, ...)
inline void palmz22_state::verboselog(int n_level, const char *s_fmt, ...)
{
if (VERBOSE_LEVEL >= n_level)
{

View File

@ -174,9 +174,9 @@ static const int CPU_FREQ[16] =
#define ENABLE_VERBOSE_LOG (0)
#if ENABLE_VERBOSE_LOG
inline void ATTR_PRINTF(3,4) pockstat_state::verboselog( int n_level, const char *s_fmt, ... )
{
#if ENABLE_VERBOSE_LOG
if( VERBOSE_LEVEL >= n_level )
{
va_list v;
@ -186,10 +186,8 @@ inline void ATTR_PRINTF(3,4) pockstat_state::verboselog( int n_level, const char
va_end( v );
logerror( "%s: %s", machine().describe_context(), buf );
}
}
#else
#define verboselog(x,y,z,...)
#endif
}
#define PS_INT_BTN_ACTION 0x00000001 // "Action button"
#define PS_INT_BTN_RIGHT 0x00000002 // "Right button"

View File

@ -118,9 +118,9 @@ private:
#define ENABLE_VERBOSE_LOG (0)
#if ENABLE_VERBOSE_LOG
inline void ATTR_PRINTF(3,4) sgi_ip2_state::verboselog( int n_level, const char *s_fmt, ... )
{
#if ENABLE_VERBOSE_LOG
if( VERBOSE_LEVEL >= n_level )
{
va_list v;
@ -130,10 +130,8 @@ inline void ATTR_PRINTF(3,4) sgi_ip2_state::verboselog( int n_level, const char
va_end( v );
logerror("%08x: %s", machine().device("maincpu")->safe_pc(), buf);
}
}
#else
#define verboselog(x,y,z,...)
#endif
}
/***************************************************************************
MACHINE FUNCTIONS

View File

@ -53,9 +53,9 @@ public:
#define ENABLE_VERBOSE_LOG (1)
#if ENABLE_VERBOSE_LOG
inline void ATTR_PRINTF(3,4) sgi_ip6_state::verboselog( int n_level, const char *s_fmt, ... )
{
#if ENABLE_VERBOSE_LOG
if( VERBOSE_LEVEL >= n_level )
{
va_list v;
@ -65,10 +65,8 @@ inline void ATTR_PRINTF(3,4) sgi_ip6_state::verboselog( int n_level, const char
va_end( v );
logerror("%08x: %s", machine().device("maincpu")->safe_pc(), buf);
}
}
#else
#define verboselog(x,y,z,...)
#endif
}
/***************************************************************************
VIDEO HARDWARE

View File

@ -26,7 +26,7 @@ public:
DECLARE_INPUT_CHANGED_MEMBER(panel_check);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(ssem_store);
inline UINT32 reverse(UINT32 v);
void glyph_print(bitmap_rgb32 &bitmap, INT32 x, INT32 y, const char *msg, ...);
void glyph_print(bitmap_rgb32 &bitmap, INT32 x, INT32 y, const char *msg, ...) ATTR_PRINTF(5,6);
void strlower(char *buf);
};
@ -489,7 +489,7 @@ UINT32 ssem_state::screen_update_ssem(screen_device &screen, bitmap_rgb32 &bitma
(m_store[(m_store_line << 2) | 1] << 16) |
(m_store[(m_store_line << 2) | 2] << 8) |
(m_store[(m_store_line << 2) | 3] << 0));
glyph_print(bitmap, 0, 272, "LINE:%02d VALUE:%08x HALT:%d", m_store_line, word, m_maincpu->state_int(SSEM_HALT));
glyph_print(bitmap, 0, 272, "LINE:%02d VALUE:%08x HALT:%"I64FMT"d", m_store_line, word, m_maincpu->state_int(SSEM_HALT));
return 0;
}

View File

@ -218,7 +218,7 @@ public:
TIMER_CALLBACK_MEMBER(supracan_line_off_callback);
TIMER_CALLBACK_MEMBER(supracan_video_callback);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(supracan_cart);
inline void verboselog(const char *tag, int n_level, const char *s_fmt, ...);
inline void verboselog(const char *tag, int n_level, const char *s_fmt, ...) ATTR_PRINTF(4,5);
int supracan_tilemap_get_region(int layer);
void supracan_tilemap_get_info_common(int layer, tile_data &tileinfo, int count);
void supracan_tilemap_get_info_roz(int layer, tile_data &tileinfo, int count);
@ -231,9 +231,9 @@ public:
#if ENABLE_VERBOSE_LOG
inline void supracan_state::verboselog(const char *tag, int n_level, const char *s_fmt, ...)
{
#if ENABLE_VERBOSE_LOG
if( VERBOSE_LEVEL >= n_level )
{
va_list v;
@ -243,11 +243,8 @@ inline void supracan_state::verboselog(const char *tag, int n_level, const char
va_end( v );
logerror( "%06x: %s: %s", machine().device(tag)->safe_pc(), tag, buf );
}
}
#else
#define verboselog(w,x,y,z,...)
#endif
}
int supracan_state::supracan_tilemap_get_region(int layer)
{

View File

@ -162,7 +162,7 @@ protected:
void vii_blit_page(bitmap_rgb32 &bitmap, const rectangle &cliprect, int depth, UINT32 bitmap_addr, UINT16 *regs);
void vii_blit_sprite(bitmap_rgb32 &bitmap, const rectangle &cliprect, int depth, UINT32 base_addr);
void vii_blit_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, int depth);
inline void verboselog(int n_level, const char *s_fmt, ...);
inline void verboselog(int n_level, const char *s_fmt, ...) ATTR_PRINTF(3,4);
inline UINT8 expand_rgb5_to_rgb8(UINT8 val);
inline UINT8 vii_mix_channel(UINT8 a, UINT8 b);
void vii_mix_pixel(UINT32 offset, UINT16 rgb);
@ -188,9 +188,9 @@ enum
#define ENABLE_VERBOSE_LOG (1)
#if ENABLE_VERBOSE_LOG
inline void vii_state::verboselog(int n_level, const char *s_fmt, ...)
{
#if ENABLE_VERBOSE_LOG
if( VERBOSE_LEVEL >= n_level )
{
va_list v;
@ -199,10 +199,8 @@ inline void vii_state::verboselog(int n_level, const char *s_fmt, ...)
vsprintf( buf, s_fmt, v );
va_end( v );
}
}
#else
#define verboselog(x,y,z,...)
#endif
}
/*************************
* Video Hardware *

View File

@ -14,7 +14,7 @@
#define VERBOSE_LEVEL (0)
INLINE void verboselog(running_machine &machine, int n_level, const char *s_fmt, ...)
INLINE void ATTR_PRINTF(3,4) verboselog(running_machine &machine, int n_level, const char *s_fmt, ...)
{
if (VERBOSE_LEVEL >= n_level)
{
@ -978,11 +978,11 @@ WRITE16_MEMBER( mc68328_device::write )
break;
case 0x310:
verboselog(machine(), 2, "mc68328_w: IPR(16) = %04x (Ignored)\n");
verboselog(machine(), 2, "mc68328_w: IPR(16) = %04x (Ignored)\n", data);
break;
case 0x312:
verboselog(machine(), 2, "mc68328_w: IPR(0) = %04x (Ignored)\n");
verboselog(machine(), 2, "mc68328_w: IPR(0) = %04x (Ignored)\n", data);
break;
case 0x400:
@ -1544,7 +1544,7 @@ WRITE16_MEMBER( mc68328_device::write )
{
verboselog(machine(), 2, "mc68328_w: LVPW = %02x\n", data & 0x00ff);
m_regs.lvpw = data & 0x00ff;
verboselog(machine(), 3, " Page Width: %d or %d\n", (m_regs.lvpw + 1) * ((m_regs.lpicf & 0x01) ? 8 : 16));
verboselog(machine(), 3, " Page Width: %d\n", (m_regs.lvpw + 1) * ((m_regs.lpicf & 0x01) ? 8 : 16));
}
else
{

View File

@ -1745,7 +1745,7 @@ DEVICE_IMAGE_LOAD_MEMBER( thomson_state, mo5_cartridge )
else
{
astring errmsg;
errmsg.printf("Invalid cartridge size "I64FMT, size);
errmsg.printf("Invalid cartridge size %"I64FMT"d", size);
image.seterror(IMAGE_ERROR_UNSUPPORTED, errmsg.cstr());
return IMAGE_INIT_FAIL;
}

View File

@ -62,7 +62,7 @@ static floppy_format_type floppy_formats[] = {
FLOPPY_RWTS18_FORMAT,
};
void CLIB_DECL logerror(const char *format, ...)
void CLIB_DECL ATTR_PRINTF(1,2) logerror(const char *format, ...)
{
va_list arg;
va_start(arg, format);

View File

@ -85,7 +85,7 @@ static int global_omit_untested;
static void (*global_warn)(const char *message);
void CLIB_DECL logerror(const char *format, ...)
void CLIB_DECL ATTR_PRINTF(1,2) logerror(const char *format, ...)
{
va_list arg;
va_start(arg, format);

View File

@ -13,7 +13,7 @@
#define VERBOSE_LEVEL (0)
INLINE void verboselog(running_machine &machine, int n_level, const char *s_fmt, ...)
INLINE void ATTR_PRINTF(3,4) verboselog(running_machine &machine, int n_level, const char *s_fmt, ...)
{
if( VERBOSE_LEVEL >= n_level )
{