diff options
Diffstat (limited to 'src/emu/cpu')
-rw-r--r-- | src/emu/cpu/apexc/apexc.c | 2 | ||||
-rw-r--r-- | src/emu/cpu/avr8/avr8.c | 4 | ||||
-rw-r--r-- | src/emu/cpu/drcuml.h | 4 | ||||
-rw-r--r-- | src/emu/cpu/es5510/es5510.c | 2 | ||||
-rw-r--r-- | src/emu/cpu/m68000/m68kmake.c | 10 | ||||
-rw-r--r-- | src/emu/cpu/psx/gte.c | 2 | ||||
-rw-r--r-- | src/emu/cpu/upd7725/upd7725.c | 8 | ||||
-rw-r--r-- | src/emu/cpu/x86log.h | 4 |
8 files changed, 21 insertions, 15 deletions
diff --git a/src/emu/cpu/apexc/apexc.c b/src/emu/cpu/apexc/apexc.c index 8ec78c15e74..45e7d84eab3 100644 --- a/src/emu/cpu/apexc/apexc.c +++ b/src/emu/cpu/apexc/apexc.c @@ -809,7 +809,7 @@ void apexc_cpu_device::state_string_export(const device_state_entry &entry, astr switch (entry.index()) { case STATE_GENFLAGS: - string.printf("%c", m_running ? "R" : "S" ); + string.printf("%c", m_running ? 'R' : 'S' ); break; } } diff --git a/src/emu/cpu/avr8/avr8.c b/src/emu/cpu/avr8/avr8.c index 36b3c87edc6..d0589abfff6 100644 --- a/src/emu/cpu/avr8/avr8.c +++ b/src/emu/cpu/avr8/avr8.c @@ -60,7 +60,7 @@ #define ENABLE_VERBOSE_LOG (0) #if ENABLE_VERBOSE_LOG -INLINE void verboselog(UINT16 pc, int n_level, const char *s_fmt, ...) +INLINE void ATTR_PRINTF(3,4) verboselog(UINT16 pc, int n_level, const char *s_fmt, ...) { if( VERBOSE_LEVEL >= n_level ) { @@ -73,7 +73,7 @@ INLINE void verboselog(UINT16 pc, int n_level, const char *s_fmt, ...) } } #else -#define verboselog(x,y,z,...) +#define verboselog(x,y,z, ...) #endif //************************************************************************** diff --git a/src/emu/cpu/drcuml.h b/src/emu/cpu/drcuml.h index 4699e6ab4f2..006246cfe17 100644 --- a/src/emu/cpu/drcuml.h +++ b/src/emu/cpu/drcuml.h @@ -110,7 +110,7 @@ public: // instruction appending uml::instruction &append(); - void append_comment(const char *format, ...); + void append_comment(const char *format, ...) ATTR_PRINTF(2,3); // this class is thrown if abort() is called class abort_compilation : public emu_exception @@ -194,7 +194,7 @@ public: // logging bool logging() const { return (m_umllog != NULL); } - void log_printf(const char *format, ...); + void log_printf(const char *format, ...) ATTR_PRINTF(2,3); void log_flush() { if (logging()) fflush(m_umllog); } private: diff --git a/src/emu/cpu/es5510/es5510.c b/src/emu/cpu/es5510/es5510.c index 82a9c048cad..18a192c420b 100644 --- a/src/emu/cpu/es5510/es5510.c +++ b/src/emu/cpu/es5510/es5510.c @@ -32,7 +32,7 @@ static inline INT64 SX64(INT64 x) { return (x & S64(0x0000800000000000)) ? x | S #define VERBOSE_EXEC 0 #if VERBOSE -void log_to_stderr(const char *format, ...) { +INLINE void ATTR_PRINTF(1,2) log_to_stderr(const char *format, ...) { va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); diff --git a/src/emu/cpu/m68000/m68kmake.c b/src/emu/cpu/m68000/m68kmake.c index d106149959a..c3c4c8e3cfe 100644 --- a/src/emu/cpu/m68000/m68kmake.c +++ b/src/emu/cpu/m68000/m68kmake.c @@ -72,6 +72,12 @@ static const char g_version[] = "4.90"; /* ============================= CONFIGURATION ============================ */ /* ======================================================================== */ +#if defined(__GNUC__) && (__GNUC__ >= 3) +#define ATTR_PRINTF(x,y) __attribute__((format(printf, x, y))) +#else +#define ATTR_PRINTF(x,y) +#endif + #define M68K_MAX_PATH 1024 #define M68K_MAX_DIR 1024 @@ -218,8 +224,8 @@ struct replace_struct /* Function Prototypes */ -static void error_exit(const char* fmt, ...); -static void perror_exit(const char* fmt, ...); +static void error_exit(const char* fmt, ...) ATTR_PRINTF(1,2); +static void perror_exit(const char* fmt, ...) ATTR_PRINTF(1,2); static int check_strsncpy(char* dst, char* src, int maxlength); static int check_atoi(char* str, int *result); static int skip_spaces(char* str); diff --git a/src/emu/cpu/psx/gte.c b/src/emu/cpu/psx/gte.c index 005bf863fa7..ca770994d67 100644 --- a/src/emu/cpu/psx/gte.c +++ b/src/emu/cpu/psx/gte.c @@ -11,7 +11,7 @@ #include "gte.h" #if 0 -void ATTR_PRINTF(2,3) GTELOG( UINT32 pc, const char *a,...) +void ATTR_PRINTF(2,3) GTELOG( UINT32 pc, const char *a, ...) { va_list va; char s_text[ 1024 ]; diff --git a/src/emu/cpu/upd7725/upd7725.c b/src/emu/cpu/upd7725/upd7725.c index 918abc2e529..ebfa62ef730 100644 --- a/src/emu/cpu/upd7725/upd7725.c +++ b/src/emu/cpu/upd7725/upd7725.c @@ -227,8 +227,8 @@ void necdsp_device::state_string_export(const device_state_entry &entry, astring string.printf("%s %s %c%c %s %s %s %s", regs.flaga.s1 ? "S1" : "s1", regs.flaga.s0 ? "S0" : "s0", - regs.flaga.c ? "C" : "c", - regs.flaga.z ? "Z" : "z", + regs.flaga.c ? 'C' : 'c', + regs.flaga.z ? 'Z' : 'z', regs.flaga.ov1 ? "OV1" : "ov1", regs.flaga.ov0 ? "OV0" : "ov0", regs.flaga.ov0p ? "OV0P" : "ov0p", @@ -239,8 +239,8 @@ void necdsp_device::state_string_export(const device_state_entry &entry, astring string.printf("%s %s %c%c %s %s %s %s", regs.flagb.s1 ? "S1" : "s1", regs.flagb.s0 ? "S0" : "s0", - regs.flagb.c ? "C" : "c", - regs.flagb.z ? "Z" : "z", + regs.flagb.c ? 'C' : 'c', + regs.flagb.z ? 'Z' : 'z', regs.flagb.ov1 ? "OV1" : "ov1", regs.flagb.ov0 ? "OV0" : "ov0", regs.flagb.ov0p ? "OV0P" : "ov0p", diff --git a/src/emu/cpu/x86log.h b/src/emu/cpu/x86log.h index 347b3bd2cd4..68ca2ec5257 100644 --- a/src/emu/cpu/x86log.h +++ b/src/emu/cpu/x86log.h @@ -35,7 +35,7 @@ x86log_context *x86log_create_context(const char *filename); void x86log_free_context(x86log_context *log); /* add a comment associated with a given code pointer */ -void x86log_add_comment(x86log_context *log, x86code *base, const char *format, ...) ATTR_PRINTF(3, 4); +void x86log_add_comment(x86log_context *log, x86code *base, const char *format, ...) ATTR_PRINTF(3,4); /* mark a given range as data for logging purposes */ void x86log_mark_as_data(x86log_context *log, x86code *base, x86code *end, int size); @@ -44,7 +44,7 @@ void x86log_mark_as_data(x86log_context *log, x86code *base, x86code *end, int s void x86log_disasm_code_range(x86log_context *log, const char *label, x86code *start, x86code *stop); /* manually printf information to the log file */ -void x86log_printf(x86log_context *log, const char *format, ...) ATTR_PRINTF(2, 3); +void x86log_printf(x86log_context *log, const char *format, ...) ATTR_PRINTF(2,3); #endif /* __X86LOG_H__ */ |