mirror of
https://github.com/holub/mame
synced 2025-06-25 22:04:15 +03:00
first round of printf fixes (nw)
This commit is contained in:
parent
9d8fbd5274
commit
aa785afb99
@ -342,7 +342,7 @@ media_auditor::summary media_auditor::summarize(const char *name, astring *strin
|
|||||||
{
|
{
|
||||||
string->catprintf("%-12s: %s", name, record->name());
|
string->catprintf("%-12s: %s", name, record->name());
|
||||||
if (record->expected_length() > 0)
|
if (record->expected_length() > 0)
|
||||||
string->catprintf(" (%d bytes)", record->expected_length());
|
string->catprintf(" (%" I64FMT "d bytes)", record->expected_length());
|
||||||
string->catprintf(" - ");
|
string->catprintf(" - ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,7 +370,7 @@ media_auditor::summary media_auditor::summarize(const char *name, astring *strin
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case audit_record::SUBSTATUS_FOUND_WRONG_LENGTH:
|
case audit_record::SUBSTATUS_FOUND_WRONG_LENGTH:
|
||||||
if (string != NULL) string->catprintf("INCORRECT LENGTH: %d bytes\n", record->actual_length());
|
if (string != NULL) string->catprintf("INCORRECT LENGTH: %" I64FMT "d bytes\n", record->actual_length());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case audit_record::SUBSTATUS_NOT_FOUND:
|
case audit_record::SUBSTATUS_NOT_FOUND:
|
||||||
|
@ -198,7 +198,7 @@ int cli_frontend::execute(int argc, char **argv)
|
|||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
software_display_matches(config,m_options, NULL,m_options.software_name());
|
software_display_matches(config,m_options, NULL,m_options.software_name());
|
||||||
throw emu_fatalerror(MAMERR_FATALERROR, "");
|
throw emu_fatalerror(MAMERR_FATALERROR, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// parse the command line, adding any system-specific options
|
// parse the command line, adding any system-specific options
|
||||||
@ -1592,11 +1592,11 @@ void cli_frontend::romident(const char *filename)
|
|||||||
if (ident.matches() == ident.total())
|
if (ident.matches() == ident.total())
|
||||||
return;
|
return;
|
||||||
else if (ident.matches() == ident.total() - ident.nonroms())
|
else if (ident.matches() == ident.total() - ident.nonroms())
|
||||||
throw emu_fatalerror(MAMERR_IDENT_NONROMS, "");
|
throw emu_fatalerror(MAMERR_IDENT_NONROMS, NULL);
|
||||||
else if (ident.matches() > 0)
|
else if (ident.matches() > 0)
|
||||||
throw emu_fatalerror(MAMERR_IDENT_PARTIAL, "");
|
throw emu_fatalerror(MAMERR_IDENT_PARTIAL, NULL);
|
||||||
else
|
else
|
||||||
throw emu_fatalerror(MAMERR_IDENT_NONE, "");
|
throw emu_fatalerror(MAMERR_IDENT_NONE, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ void legacy_cpu_device::device_start()
|
|||||||
if (string != NULL && string[0] != 0)
|
if (string != NULL && string[0] != 0)
|
||||||
{
|
{
|
||||||
astring flagstr;
|
astring flagstr;
|
||||||
flagstr.printf("%%%ds", strlen(string));
|
flagstr.printf("%%%"SIZETFMT"s", strlen(string));
|
||||||
state_add(STATE_GENFLAGS, "GENFLAGS", m_state_io).callimport().callexport().formatstr(flagstr).noshow();
|
state_add(STATE_GENFLAGS, "GENFLAGS", m_state_io).callimport().callexport().formatstr(flagstr).noshow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ void device_memory_interface::static_set_addrmap(device_t &device, address_space
|
|||||||
if (!device.interface(memory))
|
if (!device.interface(memory))
|
||||||
throw emu_fatalerror("MCFG_DEVICE_ADDRESS_MAP called on device '%s' with no memory interface", device.tag());
|
throw emu_fatalerror("MCFG_DEVICE_ADDRESS_MAP called on device '%s' with no memory interface", device.tag());
|
||||||
if (spacenum >= ARRAY_LENGTH(memory->m_address_map))
|
if (spacenum >= ARRAY_LENGTH(memory->m_address_map))
|
||||||
throw emu_fatalerror("MCFG_DEVICE_ADDRESS_MAP called with out-of-range space number %d", device.tag(), spacenum);
|
throw emu_fatalerror("MCFG_DEVICE_ADDRESS_MAP called on device '%s' with out-of-range space number %d", device.tag(), spacenum);
|
||||||
memory->m_address_map[spacenum] = map;
|
memory->m_address_map[spacenum] = map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,5 +167,5 @@ void nvram_device::determine_final_base()
|
|||||||
|
|
||||||
// if we are region-backed for the default, find it now and make sure it's the right size
|
// if we are region-backed for the default, find it now and make sure it's the right size
|
||||||
if (m_region != NULL && m_region->bytes() != m_length)
|
if (m_region != NULL && m_region->bytes() != m_length)
|
||||||
throw emu_fatalerror("NVRAM device '%s' has a default region, but it should be 0x%X bytes", tag(), m_length);
|
throw emu_fatalerror("NVRAM device '%s' has a default region, but it should be 0x%"I64FMT"X bytes", tag(), m_length);
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
token_t get_token_internal();
|
token_t get_token_internal();
|
||||||
void error(const char *format, ...);
|
void error(const char *format, ...) ATTR_PRINTF(2,3);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void reset(const char *p) { m_px = p; m_line = 1; m_line_ptr = p; }
|
void reset(const char *p) { m_px = p; m_line = 1; m_line_ptr = p; }
|
||||||
@ -266,7 +266,7 @@ public:
|
|||||||
if (m_list[i].parse(setup, name))
|
if (m_list[i].parse(setup, name))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setup.netlist().error("unable to find %s in source collection");
|
setup.netlist().error("unable to find %s in source collection", name.cstr());
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -259,10 +259,10 @@ void netlist_setup_t::register_object(netlist_device_t &dev, const pstring &name
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case netlist_terminal_t::DEVICE:
|
case netlist_terminal_t::DEVICE:
|
||||||
netlist().error("Device registration not yet supported - \n", name.cstr());
|
netlist().error("Device registration not yet supported - %s\n", name.cstr());
|
||||||
break;
|
break;
|
||||||
case netlist_terminal_t::NETLIST:
|
case netlist_terminal_t::NETLIST:
|
||||||
netlist().error("Netlist registration not yet supported - \n", name.cstr());
|
netlist().error("Netlist registration not yet supported - %s\n", name.cstr());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1715,9 +1715,9 @@ void tilemap_device::device_start()
|
|||||||
{
|
{
|
||||||
// check configuration
|
// check configuration
|
||||||
if (m_get_info.isnull())
|
if (m_get_info.isnull())
|
||||||
throw emu_fatalerror("Tilemap device '%s' has no get info callback!");
|
throw emu_fatalerror("Tilemap device '%s' has no get info callback!", tag());
|
||||||
if (m_standard_mapper == TILEMAP_STANDARD_COUNT && m_mapper.isnull())
|
if (m_standard_mapper == TILEMAP_STANDARD_COUNT && m_mapper.isnull())
|
||||||
throw emu_fatalerror("Tilemap device '%s' has no mapper callback!");
|
throw emu_fatalerror("Tilemap device '%s' has no mapper callback!", tag());
|
||||||
|
|
||||||
// bind our callbacks
|
// bind our callbacks
|
||||||
m_get_info.bind_relative_to(*owner());
|
m_get_info.bind_relative_to(*owner());
|
||||||
|
@ -164,6 +164,12 @@ __extension__ typedef signed long long INT64;
|
|||||||
#define I64FMT "ll"
|
#define I64FMT "ll"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(_MSVC_VER) || defined(__MINGW32__)
|
||||||
|
#define SIZETFMT "I64u"
|
||||||
|
#else
|
||||||
|
#define SIZETFMT "zu"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Highly useful macro for compile-time knowledge of an array size */
|
/* Highly useful macro for compile-time knowledge of an array size */
|
||||||
#define ARRAY_LENGTH(x) (sizeof(x) / sizeof(x[0]))
|
#define ARRAY_LENGTH(x) (sizeof(x) / sizeof(x[0]))
|
||||||
|
@ -95,7 +95,7 @@ const int MODE_GDI = 2;
|
|||||||
|
|
||||||
typedef tagmap_t<astring *> parameters_t;
|
typedef tagmap_t<astring *> parameters_t;
|
||||||
|
|
||||||
static void report_error(int error, const char *format, ...);
|
static void report_error(int error, const char *format, ...) ATTR_PRINTF(2,3);
|
||||||
static void do_info(parameters_t ¶ms);
|
static void do_info(parameters_t ¶ms);
|
||||||
static void do_verify(parameters_t ¶ms);
|
static void do_verify(parameters_t ¶ms);
|
||||||
static void do_create_raw(parameters_t ¶ms);
|
static void do_create_raw(parameters_t ¶ms);
|
||||||
@ -2519,14 +2519,14 @@ static void do_extract_ld(parameters_t ¶ms)
|
|||||||
// read the hunk into the buffers
|
// read the hunk into the buffers
|
||||||
chd_error err = input_chd.read_hunk(framenum, NULL);
|
chd_error err = input_chd.read_hunk(framenum, NULL);
|
||||||
if (err != CHDERR_NONE)
|
if (err != CHDERR_NONE)
|
||||||
report_error(1, "Error reading hunk %d from CHD file (%s): %s\n", framenum, params.find(OPTION_INPUT)->cstr(), chd_file::error_string(err));
|
report_error(1, "Error reading hunk %"I64FMT"d from CHD file (%s): %s\n", framenum, params.find(OPTION_INPUT)->cstr(), chd_file::error_string(err));
|
||||||
|
|
||||||
// write audio
|
// write audio
|
||||||
for (int chnum = 0; chnum < channels; chnum++)
|
for (int chnum = 0; chnum < channels; chnum++)
|
||||||
{
|
{
|
||||||
avi_error avierr = avi_append_sound_samples(output_file, chnum, avconfig.audio[chnum], actsamples, 0);
|
avi_error avierr = avi_append_sound_samples(output_file, chnum, avconfig.audio[chnum], actsamples, 0);
|
||||||
if (avierr != AVIERR_NONE)
|
if (avierr != AVIERR_NONE)
|
||||||
report_error(1, "Error writing samples for hunk %d to file (%s): %s\n", framenum, output_file_str->cstr(), avi_error_string(avierr));
|
report_error(1, "Error writing samples for hunk %"I64FMT"d to file (%s): %s\n", framenum, output_file_str->cstr(), avi_error_string(avierr));
|
||||||
}
|
}
|
||||||
|
|
||||||
// write video
|
// write video
|
||||||
@ -2534,7 +2534,7 @@ static void do_extract_ld(parameters_t ¶ms)
|
|||||||
{
|
{
|
||||||
avi_error avierr = avi_append_video_frame(output_file, fullbitmap);
|
avi_error avierr = avi_append_video_frame(output_file, fullbitmap);
|
||||||
if (avierr != AVIERR_NONE)
|
if (avierr != AVIERR_NONE)
|
||||||
report_error(1, "Error writing video for hunk %d to file (%s): %s\n", framenum, output_file_str->cstr(), avi_error_string(avierr));
|
report_error(1, "Error writing video for hunk %"I64FMT"d to file (%s): %s\n", framenum, output_file_str->cstr(), avi_error_string(avierr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user