fixed some clang-tidy warnings (nw) (#6236)

* fixed some modernize-redundant-void-arg clang-tidy warnings (nw)

* fixed some modernize-use-bool-literals clang-tidy warnings (nw)

* fixed some modernize-use-emplace clang-tidy warnings (nw)

* fixed some performance-move-const-arg clang-tidy warnings (nw)

* fixed some readability-redundant-control-flow clang-tidy warnings (nw)

* fixed some readability-redundant-string-cstr clang-tidy warnings (nw)

* fixed some performance-unnecessary-value-param clang-tidy warnings (nw)
This commit is contained in:
Oliver Stöneberg 2020-01-31 02:01:48 +01:00 committed by GitHub
parent 06ecc1ca0d
commit 059243f68e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
43 changed files with 97 additions and 102 deletions

View File

@ -245,7 +245,7 @@ void drc_cache::request_oob_codegen(drc_oob_delegate callback, void *param1, voi
new (oob) oob_handler();
// fill it in
oob->m_callback = callback;
oob->m_callback = std::move(callback);
oob->m_param1 = param1;
oob->m_param2 = param2;

View File

@ -307,7 +307,7 @@ void uml::instruction::configure(opcode_t op, u8 size, condition_t condition)
// parameter
//-------------------------------------------------
void uml::instruction::configure(opcode_t op, u8 size, parameter p0, condition_t condition)
void uml::instruction::configure(opcode_t op, u8 size, const parameter &p0, condition_t condition)
{
// fill in the instruction
m_opcode = opcode_t(u8(op));
@ -327,7 +327,7 @@ void uml::instruction::configure(opcode_t op, u8 size, parameter p0, condition_t
// parameters
//-------------------------------------------------
void uml::instruction::configure(opcode_t op, u8 size, parameter p0, parameter p1, condition_t condition)
void uml::instruction::configure(opcode_t op, u8 size, const parameter &p0, const parameter &p1, condition_t condition)
{
// fill in the instruction
m_opcode = opcode_t(u8(op));
@ -348,7 +348,7 @@ void uml::instruction::configure(opcode_t op, u8 size, parameter p0, parameter p
// parameters
//-------------------------------------------------
void uml::instruction::configure(opcode_t op, u8 size, parameter p0, parameter p1, parameter p2, condition_t condition)
void uml::instruction::configure(opcode_t op, u8 size, const parameter &p0, const parameter &p1, const parameter &p2, condition_t condition)
{
// fill in the instruction
m_opcode = opcode_t(u8(op));
@ -370,7 +370,7 @@ void uml::instruction::configure(opcode_t op, u8 size, parameter p0, parameter p
// parameters
//-------------------------------------------------
void uml::instruction::configure(opcode_t op, u8 size, parameter p0, parameter p1, parameter p2, parameter p3, condition_t condition)
void uml::instruction::configure(opcode_t op, u8 size, const parameter &p0, const parameter &p1, const parameter &p2, const parameter &p3, condition_t condition)
{
// fill in the instruction
m_opcode = opcode_t(u8(op));

View File

@ -577,10 +577,10 @@ namespace uml
private:
// internal configuration
void configure(opcode_t op, u8 size, condition_t cond = COND_ALWAYS);
void configure(opcode_t op, u8 size, parameter p0, condition_t cond = COND_ALWAYS);
void configure(opcode_t op, u8 size, parameter p0, parameter p1, condition_t cond = COND_ALWAYS);
void configure(opcode_t op, u8 size, parameter p0, parameter p1, parameter p2, condition_t cond = COND_ALWAYS);
void configure(opcode_t op, u8 size, parameter p0, parameter p1, parameter p2, parameter p3, condition_t cond = COND_ALWAYS);
void configure(opcode_t op, u8 size, const parameter &p0, condition_t cond = COND_ALWAYS);
void configure(opcode_t op, u8 size, const parameter &p0, const parameter &p1, condition_t cond = COND_ALWAYS);
void configure(opcode_t op, u8 size, const parameter &p0, const parameter &p1, const parameter &p2, condition_t cond = COND_ALWAYS);
void configure(opcode_t op, u8 size, const parameter &p0, const parameter &p1, const parameter &p2, const parameter &p3, condition_t cond = COND_ALWAYS);
// opcode validation and simplification
void validate();

View File

@ -40,8 +40,8 @@ void configuration_manager::config_register(const char* nodename, config_load_de
{
config_element element;
element.name = nodename;
element.load = load;
element.save = save;
element.load = std::move(load);
element.save = std::move(save);
m_typelist.push_back(element);
}

View File

@ -95,7 +95,7 @@ void debugger_console::exit()
***************************************************************************/
debugger_console::debug_command::debug_command(const char *_command, u32 _flags, int _ref, int _minparams, int _maxparams, std::function<void(int, const std::vector<std::string> &)> _handler)
: params(nullptr), help(nullptr), handler(_handler), flags(_flags), ref(_ref), minparams(_minparams), maxparams(_maxparams)
: params(nullptr), help(nullptr), handler(std::move(_handler)), flags(_flags), ref(_ref), minparams(_minparams), maxparams(_maxparams)
{
strcpy(command, _command);
}

View File

@ -252,8 +252,8 @@ integer_symbol_entry::integer_symbol_entry(symbol_table &table, const char *name
integer_symbol_entry::integer_symbol_entry(symbol_table &table, const char *name, symbol_table::getter_func getter, symbol_table::setter_func setter, const std::string &format)
: symbol_entry(table, SMT_INTEGER, name, format),
m_getter(getter),
m_setter(setter),
m_getter(std::move(getter)),
m_setter(std::move(setter)),
m_value(0)
{
}
@ -305,7 +305,7 @@ function_symbol_entry::function_symbol_entry(symbol_table &table, const char *na
: symbol_entry(table, SMT_FUNCTION, name, ""),
m_minparams(minparams),
m_maxparams(maxparams),
m_execute(execute)
m_execute(std::move(execute))
{
}
@ -381,9 +381,9 @@ symbol_table::symbol_table(void *globalref, symbol_table *parent)
void symbol_table::configure_memory(void *param, valid_func valid, read_func read, write_func write)
{
m_memory_param = param;
m_memory_valid = valid;
m_memory_read = read;
m_memory_write = write;
m_memory_valid = std::move(valid);
m_memory_read = std::move(read);
m_memory_write = std::move(write);
}

View File

@ -130,7 +130,7 @@ device_t::~device_t()
memory_region *device_t::memregion(std::string _tag) const
{
// build a fully-qualified name and look it up
auto search = machine().memory().regions().find(subtag(_tag));
auto search = machine().memory().regions().find(subtag(std::move(_tag)));
if (search != machine().memory().regions().end())
return search->second.get();
else
@ -146,7 +146,7 @@ memory_region *device_t::memregion(std::string _tag) const
memory_share *device_t::memshare(std::string _tag) const
{
// build a fully-qualified name and look it up
auto search = machine().memory().shares().find(subtag(_tag));
auto search = machine().memory().shares().find(subtag(std::move(_tag)));
if (search != machine().memory().shares().end())
return search->second.get();
else
@ -161,7 +161,7 @@ memory_share *device_t::memshare(std::string _tag) const
memory_bank *device_t::membank(std::string _tag) const
{
auto search = machine().memory().banks().find(subtag(_tag));
auto search = machine().memory().banks().find(subtag(std::move(_tag)));
if (search != machine().memory().banks().end())
return search->second.get();
else
@ -177,7 +177,7 @@ memory_bank *device_t::membank(std::string _tag) const
ioport_port *device_t::ioport(std::string tag) const
{
// build a fully-qualified name and look it up
return machine().ioport().port(subtag(tag).c_str());
return machine().ioport().port(subtag(std::move(tag)).c_str());
}

View File

@ -71,7 +71,7 @@ void driver_device::set_game_driver(const game_driver &game)
void driver_device::static_set_callback(device_t &device, callback_type type, driver_callback_delegate callback)
{
downcast<driver_device &>(device).m_callbacks[type] = callback;
downcast<driver_device &>(device).m_callbacks[type] = std::move(callback);
}

View File

@ -2321,7 +2321,7 @@ bool address_space::needs_backing_store(const address_map_entry &entry)
int address_space::add_change_notifier(std::function<void (read_or_write)> n)
{
int id = m_notifier_id++;
m_notifiers.emplace_back(notifier_t{ n, id });
m_notifiers.emplace_back(notifier_t{ std::move(n), id });
return id;
}
@ -2593,7 +2593,7 @@ void memory_bank::set_base(void *base)
//-------------------------------------------------
void memory_bank::add_notifier(std::function<void (void *)> cb)
{
m_alloc_notifier.emplace_back(cb);
m_alloc_notifier.emplace_back(std::move(cb));
}
//-------------------------------------------------

View File

@ -127,7 +127,7 @@ public:
std::size_t m_path_end;
std::size_t m_query_end;
http_request_impl(std::shared_ptr<webpp::Request> request) : m_request(request) {
http_request_impl(std::shared_ptr<webpp::Request> request) : m_request(std::move(request)) {
std::size_t len = m_request->path.length();
m_fragment = m_request->path.find('#');
@ -195,7 +195,7 @@ struct http_response_impl : public http_manager::http_response {
std::stringstream m_headers;
std::stringstream m_body;
http_response_impl(std::shared_ptr<webpp::Response> response) : m_response(response) { }
http_response_impl(std::shared_ptr<webpp::Response> response) : m_response(std::move(response)) { }
virtual ~http_response_impl() = default;
@ -238,10 +238,10 @@ struct websocket_endpoint_impl : public http_manager::websocket_endpoint {
http_manager::websocket_close_handler on_close,
http_manager::websocket_error_handler on_error)
: m_endpoint(endpoint) {
this->on_open = on_open;
this->on_message = on_message;
this->on_close = on_close;
this->on_error = on_error;
this->on_open = std::move(on_open);
this->on_message = std::move(on_message);
this->on_close = std::move(on_close);
this->on_error = std::move(on_error);
}
};
@ -545,21 +545,21 @@ http_manager::websocket_endpoint_ptr http_manager::add_endpoint(const std::strin
auto endpoint_impl = std::make_shared<websocket_endpoint_impl>(endpoint_ptr, on_open, on_message, on_close, on_error);
endpoint.on_open = [&, this, endpoint_impl](std::shared_ptr<webpp::Connection> connection) {
this->on_open(endpoint_impl, connection);
this->on_open(endpoint_impl, std::move(connection));
};
endpoint.on_message = [&, this, endpoint_impl](std::shared_ptr<webpp::Connection> connection, std::shared_ptr<webpp::ws_server::Message> message) {
std::string payload = message->string();
int opcode = message->fin_rsv_opcode & 0x0f;
this->on_message(endpoint_impl, connection, payload, opcode);
this->on_message(endpoint_impl, std::move(connection), payload, opcode);
};
endpoint.on_close = [&, this, endpoint_impl](std::shared_ptr<webpp::Connection> connection, int status, const std::string& reason) {
this->on_close(endpoint_impl, connection, status, reason);
this->on_close(endpoint_impl, std::move(connection), status, reason);
};
endpoint.on_error = [&, this, endpoint_impl](std::shared_ptr<webpp::Connection> connection, const std::error_code& error_code) {
this->on_error(endpoint_impl, connection, error_code);
this->on_error(endpoint_impl, std::move(connection), error_code);
};
m_endpoints[path] = endpoint_impl;

View File

@ -1240,7 +1240,7 @@ running_machine::notifier_callback_item::notifier_callback_item(machine_notify_d
//-------------------------------------------------
running_machine::logerror_callback_item::logerror_callback_item(logerror_callback func)
: m_func(func)
: m_func(std::move(func))
{
}

View File

@ -350,9 +350,9 @@ natural_keyboard::natural_keyboard(running_machine &machine)
void natural_keyboard::configure(ioport_queue_chars_delegate queue_chars, ioport_accept_char_delegate accept_char, ioport_charqueue_empty_delegate charqueue_empty)
{
// set the callbacks
m_queue_chars = queue_chars;
m_accept_char = accept_char;
m_charqueue_empty = charqueue_empty;
m_queue_chars = std::move(queue_chars);
m_accept_char = std::move(accept_char);
m_charqueue_empty = std::move(charqueue_empty);
}

View File

@ -504,7 +504,7 @@ void XTAL::validate(const std::string &message) const
fail(m_base_clock, message);
}
void XTAL::fail(double base_clock, std::string message)
void XTAL::fail(double base_clock, const std::string &message)
{
std::string full_message = util::string_format("Unknown crystal value %.0f. ", base_clock);
if(xtal_error_low && xtal_error_high)

View File

@ -69,7 +69,7 @@ private:
static const double known_xtals[];
static double last_correct_value, xtal_error_low, xtal_error_high;
static void fail(double base_clock, std::string message);
static void fail(double base_clock, const std::string &message);
static bool validate(double base_clock);
static void check_ordering();
};

View File

@ -2947,7 +2947,7 @@ chd_error chd_file_compressor::compress_continue(double &progress, double &ratio
hunk_write_compressed(item.m_hunknum, item.m_compression, item.m_compressed, item.m_complen, item.m_hash[0].m_crc16);
m_total_out += item.m_complen;
m_current_map.add(item.m_hunknum, item.m_hash[0].m_crc16, item.m_hash[0].m_sha1);
} while (0);
} while (false);
// reset the item and advance
item.m_status = WS_READY;

View File

@ -262,7 +262,7 @@ static uint32_t parse_wav_sample(const char *filename, uint32_t *dataoffs)
}
/* seek until we find a format tag */
while (1)
while (true)
{
file->read(buf, offset, 4, actual);
offset += actual;
@ -329,7 +329,7 @@ static uint32_t parse_wav_sample(const char *filename, uint32_t *dataoffs)
offset += length - 16;
/* seek until we find a data tag */
while (1)
while (true)
{
file->read(buf, offset, 4, actual);
offset += actual;

View File

@ -647,7 +647,7 @@ bool core_in_memory_file::eof() const
{
// check for buffered chars
if (has_putback())
return 0;
return false;
// if the offset == length, we're at EOF
return (m_offset >= m_length);

View File

@ -431,7 +431,7 @@ huffman_error huffman_context_base::compute_tree_from_histo()
// binary search to achieve the optimum encoding
uint32_t lowerweight = 0;
uint32_t upperweight = sdatacount * 2;
while (1)
while (true)
{
// build a tree using the current weight
uint32_t curweight = (upperweight + lowerweight) / 2;

View File

@ -657,7 +657,7 @@ void core_options::parse_command_line(const std::vector<std::string> &args, int
// special case - collect unadorned arguments after commands into a special place
if (is_unadorned && !m_command.empty())
{
m_command_arguments.push_back(std::move(args[arg]));
m_command_arguments.push_back(args[arg]);
command_argument_processed();
continue;
}

View File

@ -578,7 +578,7 @@ static void memory_error(const char *message)
* @return An int.
*/
bool test_memory_pools(void)
bool test_memory_pools()
{
object_pool *pool;
void *ptrs[16];

View File

@ -1159,7 +1159,7 @@ archive_file::error zip_file_impl::decompress_data_type_8(std::uint64_t offset,
}
// loop until we're done
while (1)
while (true)
{
// read in the next chunk of data
std::uint32_t read_length(0);

View File

@ -100,7 +100,7 @@ public:
auto kbrst_cb() { return m_kbrst_cb.bind(); }
a1000_kbreset_device &set_delays(attotime detect, attotime stray, attotime output)
a1000_kbreset_device &set_delays(const attotime &detect, const attotime &stray, const attotime &output)
{
m_detect_time = detect;
m_stray_time = stray;

View File

@ -1337,7 +1337,7 @@ void gba_state::machine_start()
m_maincpu->space(AS_PROGRAM).install_read_bank(0x0c000000, 0x0cffffff, "rom3");
std::string region_tag;
memory_region *cart_rom = memregion(region_tag.assign(m_cart->tag()).append(GBASLOT_ROM_REGION_TAG).c_str());
memory_region *cart_rom = memregion(region_tag.assign(m_cart->tag()).append(GBASLOT_ROM_REGION_TAG));
// install ROM accesses
membank("rom1")->set_base(cart_rom->base());
@ -1387,7 +1387,7 @@ void gba_state::machine_start()
if (m_cart->get_type() == GBA_3DMATRIX)
{
m_maincpu->space(AS_PROGRAM).install_write_handler(0x08800000, 0x088001ff, write32_delegate(*m_cart, FUNC(gba_cart_slot_device::write_mapper)));
memory_region *cart_romhlp = memregion(region_tag.assign(m_cart->tag()).append(GBAHELP_ROM_REGION_TAG).c_str());
memory_region *cart_romhlp = memregion(region_tag.assign(m_cart->tag()).append(GBAHELP_ROM_REGION_TAG));
membank("rom1")->set_base(cart_romhlp->base());
}

View File

@ -301,7 +301,6 @@ void atari_fdc_device::atari_load_proc(device_image_interface &image, bool is_cr
(m_drv[id].heads == 1) ? "SS" : "DS",
(m_drv[id].density == 0) ? "SD" : (m_drv[id].density == 1) ? "MD" : "DD",
m_drv[id].seclen);
return;
}

View File

@ -396,7 +396,6 @@ WRITE32_MEMBER(atari_136095_0072_device::polylsb_write)
{
m_update.addr = offset;
m_update.data[offset] = data;
return;
}
READ32_MEMBER(atari_136095_0072_device::polylsb_read)
@ -470,8 +469,6 @@ WRITE32_MEMBER(atari_136095_0072_device::write)
default:
break;
}
return;
}
READ32_MEMBER(atari_136095_0072_device::read)

View File

@ -421,7 +421,7 @@ void cuda_device::device_start()
save_item(NAME(pram));
save_item(NAME(disk_pram));
uint8_t *rom = device().machine().root_device().memregion(device().subtag(CUDA_CPU_TAG).c_str())->base();
uint8_t *rom = device().machine().root_device().memregion(device().subtag(CUDA_CPU_TAG))->base();
if (rom)
{

View File

@ -370,7 +370,7 @@ void egret_device::device_start()
save_item(NAME(pram));
save_item(NAME(disk_pram));
uint8_t *rom = device().machine().root_device().memregion(device().subtag(EGRET_CPU_TAG).c_str())->base();
uint8_t *rom = device().machine().root_device().memregion(device().subtag(EGRET_CPU_TAG))->base();
if (rom)
{

View File

@ -1482,7 +1482,6 @@ WRITE8_MEMBER(mac_state::mac_via_out_a_pmu)
// printf("%02x to PM\n", data);
#endif
m_pm_data_send = data;
return;
}
WRITE8_MEMBER(mac_state::mac_via_out_b)

View File

@ -346,9 +346,9 @@ public:
bool is_thread_id_ok(const char *buf);
void handle_character(char ch);
void send_nack(void);
void send_ack(void);
void handle_packet(void);
void send_nack();
void send_ack();
void handle_packet();
enum cmd_reply
{
@ -387,12 +387,12 @@ public:
readbuf_state m_readbuf_state;
void generate_target_xml(void);
void generate_target_xml();
int readchar(void);
int readchar();
void send_reply(const char *str);
void send_stop_packet(void);
void send_stop_packet();
private:
running_machine *m_machine;
@ -449,7 +449,7 @@ int debug_gdbstub::init(const osd_options &options)
}
//-------------------------------------------------------------------------
void debug_gdbstub::exit(void)
void debug_gdbstub::exit()
{
}
@ -460,7 +460,7 @@ void debug_gdbstub::init_debugger(running_machine &machine)
}
//-------------------------------------------------------------------------
int debug_gdbstub::readchar(void)
int debug_gdbstub::readchar()
{
// NOTE: we don't use m_socket.getc() because it does not work with
// sockets (it assumes seeking is possible).
@ -497,7 +497,7 @@ static std::string escape_packet(const std::string src)
}
//-------------------------------------------------------------------------
void debug_gdbstub::generate_target_xml(void)
void debug_gdbstub::generate_target_xml()
{
// Note: we do not attempt to replicate the regnum values from old
// GDB clients that did not support target.xml.
@ -622,7 +622,7 @@ void debug_gdbstub::wait_for_debugger(device_t &device, bool firststop)
}
//-------------------------------------------------------------------------
void debug_gdbstub::debugger_update(void)
void debug_gdbstub::debugger_update()
{
while ( true )
{
@ -634,13 +634,13 @@ void debug_gdbstub::debugger_update(void)
}
//-------------------------------------------------------------------------
void debug_gdbstub::send_nack(void)
void debug_gdbstub::send_nack()
{
m_socket.puts("-");
}
//-------------------------------------------------------------------------
void debug_gdbstub::send_ack(void)
void debug_gdbstub::send_ack()
{
m_socket.puts("+");
}
@ -1090,7 +1090,7 @@ debug_gdbstub::cmd_reply debug_gdbstub::handle_Z(const char *buf)
//-------------------------------------------------------------------------
void debug_gdbstub::send_stop_packet(void)
void debug_gdbstub::send_stop_packet()
{
int signal = 5; // GDB_SIGNAL_TRAP
std::string reply = string_format("T%02x", signal);
@ -1119,7 +1119,7 @@ void debug_gdbstub::send_stop_packet(void)
}
//-------------------------------------------------------------------------
void debug_gdbstub::handle_packet(void)
void debug_gdbstub::handle_packet()
{
// For any command not supported by the stub, an empty response
// ($#00) should be returned. That way it is possible to extend

View File

@ -522,7 +522,7 @@ void debug_imgui::handle_console(running_machine* machine)
// don't bother adding to history if the current command matches the previous one
if(view_main_console->console_prev != view_main_console->console_input)
{
view_main_console->console_history.push_back(std::string(view_main_console->console_input));
view_main_console->console_history.emplace_back(std::string(view_main_console->console_input));
view_main_console->console_prev = view_main_console->console_input;
}
history_pos = view_main_console->console_history.size();

View File

@ -192,7 +192,7 @@ static std::string convert_ansi(LPCVOID data)
// osd_get_clipboard_text
//============================================================
std::string osd_get_clipboard_text(void)
std::string osd_get_clipboard_text()
{
std::string result;
@ -210,7 +210,7 @@ std::string osd_get_clipboard_text(void)
// osd_getpid
//============================================================
int osd_getpid(void)
int osd_getpid()
{
return GetCurrentProcessId();
}

View File

@ -27,7 +27,7 @@ public:
virtual void exit() override;
virtual osd_midi_device *create_midi_device() override;
virtual void list_midi_devices(void) override;
virtual void list_midi_devices() override;
};
@ -58,7 +58,7 @@ void none_module::exit()
{
}
void none_module::list_midi_devices(void)
void none_module::list_midi_devices()
{
osd_printf_warning("\nMIDI is not supported in this build\n");
}

View File

@ -30,7 +30,7 @@ public:
virtual void exit()override;
virtual osd_midi_device *create_midi_device() override;
virtual void list_midi_devices(void) override;
virtual void list_midi_devices() override;
};
@ -77,7 +77,7 @@ void pm_module::exit()
Pm_Terminate();
}
void pm_module::list_midi_devices(void)
void pm_module::list_midi_devices()
{
int num_devs = Pm_CountDevices();
const PmDeviceInfo *pmInfo;

View File

@ -60,7 +60,7 @@ std::vector<bgfx_slider*> slider_reader::read_from_value(const Value& value, std
{
return sliders;
}
strings.push_back(std::string(string_array[i].GetString()));
strings.emplace_back(std::string(string_array[i].GetString()));
}
}

View File

@ -95,7 +95,7 @@ bool target_manager::update_target_sizes(uint32_t screen, uint16_t width, uint16
// Ensure that there's an entry to fill
while (sizes.size() <= screen)
{
sizes.push_back(osd_dim(0, 0));
sizes.emplace_back(osd_dim(0, 0));
}
if (width != sizes[screen].width() || height != sizes[screen].height())
@ -144,7 +144,7 @@ void target_manager::update_screen_count(uint32_t count)
// Ensure that there's an entry to fill
while (count > m_native_dims.size())
{
m_native_dims.push_back(osd_dim(0, 0));
m_native_dims.emplace_back(osd_dim(0, 0));
}
if (count != m_screen_count)

View File

@ -19,7 +19,7 @@ bool rectangle_packer::pack(const std::vector<packable_rectangle>& rects, std::v
// Add rects to member array, and check to make sure none is too big
for (size_t rect = 0; rect < rects.size(); rect++)
{
m_rects.push_back(rectangle(0, 0, rects[rect].width(), rects[rect].height(), rects[rect].hash(), rects[rect].format(), rects[rect].rowpixels(), rects[rect].palette(), rects[rect].base()));
m_rects.emplace_back(rectangle(0, 0, rects[rect].width(), rects[rect].height(), rects[rect].hash(), rects[rect].format(), rects[rect].rowpixels(), rects[rect].palette(), rects[rect].base()));
}
// Sort from greatest to least area
@ -29,7 +29,7 @@ bool rectangle_packer::pack(const std::vector<packable_rectangle>& rects, std::v
while (m_num_packed < (int)m_rects.size())
{
int i = m_packs.size();
m_packs.push_back(rectangle(m_pack_size));
m_packs.emplace_back(rectangle(m_pack_size));
m_roots.push_back(i);
if (!fill(i))
{
@ -179,7 +179,7 @@ void rectangle_packer::add_pack_to_array(int pack, std::vector<packed_rectangle>
{
if (m_packs[pack].hash != 0)
{
array.push_back(packed_rectangle(m_packs[pack].hash, m_packs[pack].format,
array.emplace_back(packed_rectangle(m_packs[pack].hash, m_packs[pack].format,
m_packs[pack].w, m_packs[pack].h, m_packs[pack].x, m_packs[pack].y,
m_packs[pack].rowpixels, m_packs[pack].palette, m_packs[pack].base));

View File

@ -1649,7 +1649,7 @@ void renderer_ogl::texture_compute_size_type(const render_texinfo *texsource, og
// texture_create
//============================================================
static int gl_checkFramebufferStatus(void)
static int gl_checkFramebufferStatus()
{
GLenum status;
status=(GLenum)pfn_glCheckFramebufferStatus(GL_FRAMEBUFFER_EXT);

View File

@ -541,7 +541,7 @@ error:
// destroy_buffers
//============================================================
void sound_direct_sound::destroy_buffers(void)
void sound_direct_sound::destroy_buffers()
{
// stop any playback
if (m_stream_buffer)

View File

@ -137,7 +137,7 @@ void osd_vprintf_debug(util::format_argument_pack<std::ostream> const &args)
// osd_ticks
//============================================================
osd_ticks_t osd_ticks(void)
osd_ticks_t osd_ticks()
{
return std::chrono::high_resolution_clock::now().time_since_epoch().count();
}
@ -147,7 +147,7 @@ osd_ticks_t osd_ticks(void)
// osd_ticks_per_second
//============================================================
osd_ticks_t osd_ticks_per_second(void)
osd_ticks_t osd_ticks_per_second()
{
return std::chrono::high_resolution_clock::period::den / std::chrono::high_resolution_clock::period::num;
}

View File

@ -116,7 +116,7 @@ int netdev_count()
return netdev_list.size();
}
void osd_list_network_adapters(void)
void osd_list_network_adapters()
{
#ifdef USE_NETWORK
int num_devs = netdev_list.size();

View File

@ -85,7 +85,7 @@ static void spin_while_not(const volatile _AtomType * volatile atom, const _Main
// osd_num_processors
//============================================================
int osd_get_num_processors(void)
int osd_get_num_processors()
{
#if defined(SDLMAME_EMSCRIPTEN)
// multithreading is not supported at this time
@ -211,7 +211,7 @@ int osd_num_processors = 0;
// FUNCTION PROTOTYPES
//============================================================
static int effective_num_processors(void);
static int effective_num_processors();
static void * worker_thread_entry(void *param);
static void worker_thread_process(osd_work_queue *queue, work_thread_info *thread);
static bool queue_has_list_items(osd_work_queue *queue);
@ -639,7 +639,7 @@ void osd_work_item_release(osd_work_item *item)
// effective_num_processors
//============================================================
static int effective_num_processors(void)
static int effective_num_processors()
{
int physprocs = osd_get_num_processors();

View File

@ -116,7 +116,7 @@ static bool s_aggressive_focus;
//============================================================
static void create_window_class(void);
static void create_window_class();
//============================================================
// window_init
@ -577,7 +577,7 @@ void winwindow_dispatch_message(running_machine &machine, MSG *message)
// (main thread)
//============================================================
void winwindow_take_snap(void)
void winwindow_take_snap()
{
assert(GetCurrentThreadId() == main_threadid);
@ -595,7 +595,7 @@ void winwindow_take_snap(void)
// (main thread)
//============================================================
void winwindow_toggle_fsfx(void)
void winwindow_toggle_fsfx()
{
assert(GetCurrentThreadId() == main_threadid);
@ -613,7 +613,7 @@ void winwindow_toggle_fsfx(void)
// (main thread)
//============================================================
void winwindow_take_video(void)
void winwindow_take_video()
{
assert(GetCurrentThreadId() == main_threadid);
@ -631,7 +631,7 @@ void winwindow_take_video(void)
// (main thread)
//============================================================
void winwindow_toggle_full_screen(void)
void winwindow_toggle_full_screen()
{
assert(GetCurrentThreadId() == main_threadid);
@ -658,7 +658,7 @@ void winwindow_toggle_full_screen(void)
// (main or window thread)
//============================================================
bool winwindow_has_focus(void)
bool winwindow_has_focus()
{
// see if one of the video windows has focus
for (const auto &window : osd_common_t::s_window_list)
@ -930,7 +930,7 @@ void win_window_info::update()
// (main thread)
//============================================================
static void create_window_class(void)
static void create_window_class()
{
static int classes_created = FALSE;

View File

@ -51,7 +51,7 @@ std::chrono::system_clock::time_point win_time_point_from_filetime(LPFILETIME fi
// win_is_gui_application
//============================================================
BOOL win_is_gui_application(void)
BOOL win_is_gui_application()
{
static BOOL is_gui_frontend;
static BOOL is_first_time = TRUE;