mirror of
https://github.com/holub/mame
synced 2025-07-04 09:28:51 +03:00
More cleanups (nw)
This commit is contained in:
parent
a89530313f
commit
19ff46c113
@ -685,7 +685,7 @@ int floppy_image_device::find_index(UINT32 position, const std::vector<UINT32> &
|
||||
{
|
||||
int spos = (buf.size() >> 1)-1;
|
||||
int step;
|
||||
for(step=1; step<buf.size()+1; step<<=1);
|
||||
for(step=1; step<buf.size()+1; step<<=1) { }
|
||||
step >>= 1;
|
||||
|
||||
for(;;) {
|
||||
|
@ -20,17 +20,23 @@ const device_type SNAPSHOT = &device_creator<snapshot_image_device>;
|
||||
|
||||
snapshot_image_device::snapshot_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, SNAPSHOT, "Snapshot", tag, owner, clock, "snapshot_image", __FILE__),
|
||||
device_image_interface(mconfig, *this),
|
||||
m_interface(NULL),
|
||||
m_delay_attoseconds(0)
|
||||
device_image_interface(mconfig, *this),
|
||||
m_file_extensions(NULL),
|
||||
m_interface(NULL),
|
||||
m_delay_seconds(0),
|
||||
m_delay_attoseconds(0),
|
||||
m_timer(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
snapshot_image_device::snapshot_image_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
|
||||
device_t(mconfig, type, name, tag, owner, clock, shortname, source),
|
||||
device_image_interface(mconfig, *this),
|
||||
m_interface(NULL),
|
||||
m_delay_attoseconds(0)
|
||||
device_t(mconfig, type, name, tag, owner, clock, shortname, source),
|
||||
device_image_interface(mconfig, *this),
|
||||
m_file_extensions(NULL),
|
||||
m_interface(NULL),
|
||||
m_delay_seconds(0),
|
||||
m_delay_attoseconds(0),
|
||||
m_timer(NULL)
|
||||
{
|
||||
}
|
||||
//-------------------------------------------------
|
||||
|
@ -86,7 +86,7 @@ void config_register(running_machine &machine, const char *nodename, config_save
|
||||
newtype->save = save;
|
||||
|
||||
/* add us to the end */
|
||||
for (ptype = &typelist; *ptype; ptype = &(*ptype)->next) ;
|
||||
for (ptype = &typelist; *ptype; ptype = &(*ptype)->next) { }
|
||||
*ptype = newtype;
|
||||
}
|
||||
|
||||
|
@ -441,7 +441,7 @@ void debug_view_manager::flush_osd_updates()
|
||||
debug_view *debug_view_manager::append(debug_view *view)
|
||||
{
|
||||
debug_view **viewptr;
|
||||
for (viewptr = &m_viewlist; *viewptr != NULL; viewptr = &(*viewptr)->m_next) ;
|
||||
for (viewptr = &m_viewlist; *viewptr != NULL; viewptr = &(*viewptr)->m_next) { }
|
||||
*viewptr = view;
|
||||
return view;
|
||||
}
|
||||
|
@ -853,7 +853,7 @@ device_interface::device_interface(device_t &device, const char *type)
|
||||
m_type(type)
|
||||
{
|
||||
device_interface **tailptr;
|
||||
for (tailptr = &device.m_interface_list; *tailptr != NULL; tailptr = &(*tailptr)->m_interface_next) ;
|
||||
for (tailptr = &device.m_interface_list; *tailptr != NULL; tailptr = &(*tailptr)->m_interface_next) { }
|
||||
*tailptr = this;
|
||||
}
|
||||
|
||||
|
@ -290,7 +290,7 @@ void emu_options::update_slot_options()
|
||||
}
|
||||
}
|
||||
}
|
||||
while (add_slot_options(false));
|
||||
while (add_slot_options(false)) { }
|
||||
add_device_options(false);
|
||||
}
|
||||
|
||||
@ -359,13 +359,15 @@ void emu_options::remove_device_options()
|
||||
bool emu_options::parse_slot_devices(int argc, char *argv[], std::string &error_string, const char *name, const char *value)
|
||||
{
|
||||
// an initial parse to capture the initial set of values
|
||||
bool result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string);
|
||||
bool result;
|
||||
|
||||
core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string);
|
||||
|
||||
// keep adding slot options until we stop seeing new stuff
|
||||
bool isfirstpass = true;
|
||||
while (add_slot_options(isfirstpass))
|
||||
{
|
||||
result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string);
|
||||
core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string);
|
||||
isfirstpass = false;
|
||||
}
|
||||
|
||||
@ -373,9 +375,9 @@ bool emu_options::parse_slot_devices(int argc, char *argv[], std::string &error_
|
||||
add_device_options(true);
|
||||
if (name != NULL && exists(name))
|
||||
set_value(name, value, OPTION_PRIORITY_CMDLINE, error_string);
|
||||
result = core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string);
|
||||
core_options::parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string);
|
||||
|
||||
int num = 0;
|
||||
int num;
|
||||
do {
|
||||
num = options_count();
|
||||
update_slot_options();
|
||||
@ -528,7 +530,7 @@ void emu_options::set_system_name(const char *name)
|
||||
|
||||
// then add the options
|
||||
add_device_options(true);
|
||||
int num = 0;
|
||||
int num;
|
||||
do {
|
||||
num = options_count();
|
||||
update_slot_options();
|
||||
|
@ -292,8 +292,6 @@ bool hash_collection::from_internal_string(const char *string)
|
||||
// non-hex alpha values specify a hash type
|
||||
if (uc >= 'G' && uc <= 'Z')
|
||||
{
|
||||
if (skip_digits != 0)
|
||||
errors = true;
|
||||
skip_digits = 0;
|
||||
if (uc == HASH_CRC)
|
||||
{
|
||||
|
@ -539,7 +539,7 @@ const char *extra_info = NULL;
|
||||
|
||||
bool read_hash_config(device_image_interface &image, const char *sysname, std::string &result)
|
||||
{
|
||||
hash_file *hashfile = NULL;
|
||||
hash_file *hashfile;
|
||||
const hash_info *info;
|
||||
|
||||
/* open the hash file */
|
||||
|
@ -510,7 +510,7 @@ bool render_font::load_bdf()
|
||||
else if (strncmp(ptr, "BITMAP", 6) == 0)
|
||||
{
|
||||
// stash the raw pointer and scan for the end of the character
|
||||
for (rawdata = ptr = next_line(ptr); ptr != NULL && strncmp(ptr, "ENDCHAR", 7) != 0; ptr = next_line(ptr)) ;
|
||||
for (rawdata = ptr = next_line(ptr); ptr != NULL && strncmp(ptr, "ENDCHAR", 7) != 0; ptr = next_line(ptr)) { }
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -271,7 +271,7 @@ void ui_menu_file_create::populate()
|
||||
item_append("New Image Name:", new_image_name, 0, ITEMREF_NEW_IMAGE_NAME);
|
||||
|
||||
// do we support multiple formats?
|
||||
format = m_image->formatlist();
|
||||
if (ENABLE_FORMATS) format = m_image->formatlist();
|
||||
if (ENABLE_FORMATS && (format != NULL))
|
||||
{
|
||||
item_append("Image Format:", m_current_format->description(), 0, ITEMREF_FORMAT);
|
||||
|
@ -369,7 +369,7 @@ void ui_manager::display_startup_screens(bool first_time, bool show_disclaimer)
|
||||
|
||||
// clear the input memory
|
||||
machine().input().reset_polling();
|
||||
while (machine().input().poll_switches() != INPUT_CODE_INVALID) ;
|
||||
while (machine().input().poll_switches() != INPUT_CODE_INVALID) { }
|
||||
|
||||
// loop while we have a handler
|
||||
while (m_handler_callback != handler_ingame && !machine().scheduled_event_pending() && !ui_menu::stack_has_special_main_menu())
|
||||
|
@ -192,7 +192,7 @@ static void ui_gfx_count_devices(running_machine &machine, ui_gfx_state &state)
|
||||
i < tempcount && state.gfxset.devcount < MAX_GFX_DECODERS;
|
||||
i++, interface = gfx_iter.next())
|
||||
{
|
||||
for (count = 0; count < MAX_GFX_ELEMENTS && interface->gfx(count) != NULL; count++);
|
||||
for (count = 0; count < MAX_GFX_ELEMENTS && interface->gfx(count) != NULL; count++) { }
|
||||
|
||||
// count = index of first NULL
|
||||
if (count > 0)
|
||||
@ -1006,8 +1006,8 @@ static void tilemap_handler(running_machine &machine, render_container *containe
|
||||
pixelscale = state.tilemap.zoom;
|
||||
if (pixelscale == 0)
|
||||
{
|
||||
for (maxxscale = 1; mapwidth * (maxxscale + 1) < mapboxwidth; maxxscale++) ;
|
||||
for (maxyscale = 1; mapheight * (maxyscale + 1) < mapboxheight; maxyscale++) ;
|
||||
for (maxxscale = 1; mapwidth * (maxxscale + 1) < mapboxwidth; maxxscale++) { }
|
||||
for (maxyscale = 1; mapheight * (maxyscale + 1) < mapboxheight; maxyscale++) { }
|
||||
pixelscale = MIN(maxxscale, maxyscale);
|
||||
}
|
||||
|
||||
|
@ -719,11 +719,11 @@ void validity_checker::validate_analog_input_field(ioport_field &field)
|
||||
if (field.type() == IPT_POSITIONAL || field.type() == IPT_POSITIONAL_V)
|
||||
{
|
||||
int shift;
|
||||
for (shift = 0; shift <= 31 && (~field.mask() & (1 << shift)) != 0; shift++) ;
|
||||
for (shift = 0; shift <= 31 && (~field.mask() & (1 << shift)) != 0; shift++) { }
|
||||
|
||||
// convert the positional max value to be in the bitmask for testing
|
||||
INT32 analog_max = field.maxval();
|
||||
analog_max = (analog_max - 1) << shift;
|
||||
//INT32 analog_max = field.maxval();
|
||||
//analog_max = (analog_max - 1) << shift;
|
||||
|
||||
// positional port size must fit in bits used
|
||||
if ((field.mask() >> shift) + 1 < field.maxval())
|
||||
|
Loading…
Reference in New Issue
Block a user