summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Oliver Stöneberg <firewave@users.noreply.github.com>2020-01-31 02:01:48 +0100
committer GitHub <noreply@github.com>2020-01-30 20:01:48 -0500
commit059243f68ec0c2e327a3105a9480f50e5e0b4abf (patch)
treecbf132320ebc93ae4c58d60fd3a5ed834c2e8862
parent06ecc1ca0d96a7d9cc66aab6a5aa8b8f0265fa09 (diff)
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)
-rw-r--r--src/devices/cpu/drccache.cpp2
-rw-r--r--src/devices/cpu/uml.cpp8
-rw-r--r--src/devices/cpu/uml.h8
-rw-r--r--src/emu/config.cpp4
-rw-r--r--src/emu/debug/debugcon.cpp2
-rw-r--r--src/emu/debug/express.cpp12
-rw-r--r--src/emu/device.cpp8
-rw-r--r--src/emu/driver.cpp2
-rw-r--r--src/emu/emumem.cpp4
-rw-r--r--src/emu/http.cpp20
-rw-r--r--src/emu/machine.cpp2
-rw-r--r--src/emu/natkeyboard.cpp6
-rw-r--r--src/emu/xtal.cpp2
-rw-r--r--src/emu/xtal.h2
-rw-r--r--src/lib/util/chd.cpp2
-rw-r--r--src/lib/util/chdcd.cpp4
-rw-r--r--src/lib/util/corefile.cpp2
-rw-r--r--src/lib/util/huffman.cpp2
-rw-r--r--src/lib/util/options.cpp2
-rw-r--r--src/lib/util/pool.cpp2
-rw-r--r--src/lib/util/unzip.cpp2
-rw-r--r--src/mame/drivers/amiga.cpp2
-rw-r--r--src/mame/drivers/gba.cpp4
-rw-r--r--src/mame/machine/atarifdc.cpp1
-rw-r--r--src/mame/machine/atarixga.cpp3
-rw-r--r--src/mame/machine/cuda.cpp2
-rw-r--r--src/mame/machine/egret.cpp2
-rw-r--r--src/mame/machine/mac.cpp1
-rw-r--r--src/osd/modules/debugger/debuggdbstub.cpp28
-rw-r--r--src/osd/modules/debugger/debugimgui.cpp2
-rw-r--r--src/osd/modules/lib/osdlib_win32.cpp4
-rw-r--r--src/osd/modules/midi/none.cpp4
-rw-r--r--src/osd/modules/midi/portmidi.cpp4
-rw-r--r--src/osd/modules/render/bgfx/sliderreader.cpp2
-rw-r--r--src/osd/modules/render/bgfx/targetmanager.cpp4
-rw-r--r--src/osd/modules/render/binpacker.cpp6
-rw-r--r--src/osd/modules/render/drawogl.cpp2
-rw-r--r--src/osd/modules/sound/direct_sound.cpp2
-rw-r--r--src/osd/osdcore.cpp4
-rw-r--r--src/osd/osdnet.cpp2
-rw-r--r--src/osd/osdsync.cpp6
-rw-r--r--src/osd/windows/window.cpp14
-rw-r--r--src/osd/windows/winutil.cpp2
43 files changed, 97 insertions, 102 deletions
diff --git a/src/devices/cpu/drccache.cpp b/src/devices/cpu/drccache.cpp
index 5906a641fee..fc86fd37cc6 100644
--- a/src/devices/cpu/drccache.cpp
+++ b/src/devices/cpu/drccache.cpp
@@ -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;
diff --git a/src/devices/cpu/uml.cpp b/src/devices/cpu/uml.cpp
index df52f5f1235..5c38c40b6dc 100644
--- a/src/devices/cpu/uml.cpp
+++ b/src/devices/cpu/uml.cpp
@@ -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));
diff --git a/src/devices/cpu/uml.h b/src/devices/cpu/uml.h
index 662a0dda2b6..c3c83944e85 100644
--- a/src/devices/cpu/uml.h
+++ b/src/devices/cpu/uml.h
@@ -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();
diff --git a/src/emu/config.cpp b/src/emu/config.cpp
index a27a77b1dd6..81a486f73af 100644
--- a/src/emu/config.cpp
+++ b/src/emu/config.cpp
@@ -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);
}
diff --git a/src/emu/debug/debugcon.cpp b/src/emu/debug/debugcon.cpp
index e24c6a2336e..9219df2f0ca 100644
--- a/src/emu/debug/debugcon.cpp
+++ b/src/emu/debug/debugcon.cpp
@@ -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);
}
diff --git a/src/emu/debug/express.cpp b/src/emu/debug/express.cpp
index d6b5560a51e..114ec589951 100644
--- a/src/emu/debug/express.cpp
+++ b/src/emu/debug/express.cpp
@@ -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);
}
diff --git a/src/emu/device.cpp b/src/emu/device.cpp
index 39897887628..055f0707135 100644
--- a/src/emu/device.cpp
+++ b/src/emu/device.cpp
@@ -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());
}
diff --git a/src/emu/driver.cpp b/src/emu/driver.cpp
index d13a4899136..7093b73615d 100644
--- a/src/emu/driver.cpp
+++ b/src/emu/driver.cpp
@@ -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);
}
diff --git a/src/emu/emumem.cpp b/src/emu/emumem.cpp
index 8f820606279..f800d09c91f 100644
--- a/src/emu/emumem.cpp
+++ b/src/emu/emumem.cpp
@@ -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));
}
//-------------------------------------------------
diff --git a/src/emu/http.cpp b/src/emu/http.cpp
index e00861ff4a0..48599258aaa 100644
--- a/src/emu/http.cpp
+++ b/src/emu/http.cpp
@@ -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;
diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp
index 830ee6c4d82..8ccb7b5907a 100644
--- a/src/emu/machine.cpp
+++ b/src/emu/machine.cpp
@@ -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))
{
}
diff --git a/src/emu/natkeyboard.cpp b/src/emu/natkeyboard.cpp
index 114ad581295..14b5e9578b4 100644
--- a/src/emu/natkeyboard.cpp
+++ b/src/emu/natkeyboard.cpp
@@ -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);
}
diff --git a/src/emu/xtal.cpp b/src/emu/xtal.cpp
index 0e47cffa87a..2e02b4ab0e0 100644
--- a/src/emu/xtal.cpp
+++ b/src/emu/xtal.cpp
@@ -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)
diff --git a/src/emu/xtal.h b/src/emu/xtal.h
index f3e9b7d0cbd..b58f00943b2 100644
--- a/src/emu/xtal.h
+++ b/src/emu/xtal.h
@@ -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();
};
diff --git a/src/lib/util/chd.cpp b/src/lib/util/chd.cpp
index d71eb436ea0..274c6a37aab 100644
--- a/src/lib/util/chd.cpp
+++ b/src/lib/util/chd.cpp
@@ -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;
diff --git a/src/lib/util/chdcd.cpp b/src/lib/util/chdcd.cpp
index aafac22e968..b2b0e141499 100644
--- a/src/lib/util/chdcd.cpp
+++ b/src/lib/util/chdcd.cpp
@@ -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;
diff --git a/src/lib/util/corefile.cpp b/src/lib/util/corefile.cpp
index 5b8babfc33a..9357f1cdb36 100644
--- a/src/lib/util/corefile.cpp
+++ b/src/lib/util/corefile.cpp
@@ -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);
diff --git a/src/lib/util/huffman.cpp b/src/lib/util/huffman.cpp
index 23b13bdaf09..1d531fdd634 100644
--- a/src/lib/util/huffman.cpp
+++ b/src/lib/util/huffman.cpp
@@ -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;
diff --git a/src/lib/util/options.cpp b/src/lib/util/options.cpp
index bc7b72f896d..3e5cb001378 100644
--- a/src/lib/util/options.cpp
+++ b/src/lib/util/options.cpp
@@ -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;
}
diff --git a/src/lib/util/pool.cpp b/src/lib/util/pool.cpp
index 481b8b97f7f..6bf049db03d 100644
--- a/src/lib/util/pool.cpp
+++ b/src/lib/util/pool.cpp
@@ -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];
diff --git a/src/lib/util/unzip.cpp b/src/lib/util/unzip.cpp
index 836d67f1113..a659445e1cc 100644
--- a/src/lib/util/unzip.cpp
+++ b/src/lib/util/unzip.cpp
@@ -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);
diff --git a/src/mame/drivers/amiga.cpp b/src/mame/drivers/amiga.cpp
index f8aed0bf07c..cd1e055da5a 100644
--- a/src/mame/drivers/amiga.cpp
+++ b/src/mame/drivers/amiga.cpp
@@ -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;
diff --git a/src/mame/drivers/gba.cpp b/src/mame/drivers/gba.cpp
index 95e05f76493..6f81073cd05 100644
--- a/src/mame/drivers/gba.cpp
+++ b/src/mame/drivers/gba.cpp
@@ -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());
}
diff --git a/src/mame/machine/atarifdc.cpp b/src/mame/machine/atarifdc.cpp
index 2aae1dd0402..b7f21c9ee58 100644
--- a/src/mame/machine/atarifdc.cpp
+++ b/src/mame/machine/atarifdc.cpp
@@ -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;
}
diff --git a/src/mame/machine/atarixga.cpp b/src/mame/machine/atarixga.cpp
index 968abee4048..119d8c42acd 100644
--- a/src/mame/machine/atarixga.cpp
+++ b/src/mame/machine/atarixga.cpp
@@ -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)
diff --git a/src/mame/machine/cuda.cpp b/src/mame/machine/cuda.cpp
index cd7de260827..2cc123d5a8a 100644
--- a/src/mame/machine/cuda.cpp
+++ b/src/mame/machine/cuda.cpp
@@ -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)
{
diff --git a/src/mame/machine/egret.cpp b/src/mame/machine/egret.cpp
index 0959485bfad..f909f8f5e1c 100644
--- a/src/mame/machine/egret.cpp
+++ b/src/mame/machine/egret.cpp
@@ -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)
{
diff --git a/src/mame/machine/mac.cpp b/src/mame/machine/mac.cpp
index 9bfb19f07e4..4f42dd272b5 100644
--- a/src/mame/machine/mac.cpp
+++ b/src/mame/machine/mac.cpp
@@ -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)
diff --git a/src/osd/modules/debugger/debuggdbstub.cpp b/src/osd/modules/debugger/debuggdbstub.cpp
index 713e79e1ed7..63dbd420184 100644
--- a/src/osd/modules/debugger/debuggdbstub.cpp
+++ b/src/osd/modules/debugger/debuggdbstub.cpp
@@ -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
diff --git a/src/osd/modules/debugger/debugimgui.cpp b/src/osd/modules/debugger/debugimgui.cpp
index fde6882a69b..3586b6d8d52 100644
--- a/src/osd/modules/debugger/debugimgui.cpp
+++ b/src/osd/modules/debugger/debugimgui.cpp
@@ -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();
diff --git a/src/osd/modules/lib/osdlib_win32.cpp b/src/osd/modules/lib/osdlib_win32.cpp
index 018161c6c0c..ca78d24dd89 100644
--- a/src/osd/modules/lib/osdlib_win32.cpp
+++ b/src/osd/modules/lib/osdlib_win32.cpp
@@ -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();
}
diff --git a/src/osd/modules/midi/none.cpp b/src/osd/modules/midi/none.cpp
index adacee7d634..822de79bd08 100644
--- a/src/osd/modules/midi/none.cpp
+++ b/src/osd/modules/midi/none.cpp
@@ -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");
}
diff --git a/src/osd/modules/midi/portmidi.cpp b/src/osd/modules/midi/portmidi.cpp
index 418295a7a5c..64f71ca6689 100644
--- a/src/osd/modules/midi/portmidi.cpp
+++ b/src/osd/modules/midi/portmidi.cpp
@@ -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;
diff --git a/src/osd/modules/render/bgfx/sliderreader.cpp b/src/osd/modules/render/bgfx/sliderreader.cpp
index 6d55c9b4db5..e74f10adcc9 100644
--- a/src/osd/modules/render/bgfx/sliderreader.cpp
+++ b/src/osd/modules/render/bgfx/sliderreader.cpp
@@ -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()));
}
}
diff --git a/src/osd/modules/render/bgfx/targetmanager.cpp b/src/osd/modules/render/bgfx/targetmanager.cpp
index 35973ee584f..9c84812c450 100644
--- a/src/osd/modules/render/bgfx/targetmanager.cpp
+++ b/src/osd/modules/render/bgfx/targetmanager.cpp
@@ -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)
diff --git a/src/osd/modules/render/binpacker.cpp b/src/osd/modules/render/binpacker.cpp
index aa80f600e2a..c213b99e1e8 100644
--- a/src/osd/modules/render/binpacker.cpp
+++ b/src/osd/modules/render/binpacker.cpp
@@ -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));
diff --git a/src/osd/modules/render/drawogl.cpp b/src/osd/modules/render/drawogl.cpp
index 6ee43cd57b7..ae030224e74 100644
--- a/src/osd/modules/render/drawogl.cpp
+++ b/src/osd/modules/render/drawogl.cpp
@@ -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);
diff --git a/src/osd/modules/sound/direct_sound.cpp b/src/osd/modules/sound/direct_sound.cpp
index 4d6c8c26c50..05333674541 100644
--- a/src/osd/modules/sound/direct_sound.cpp
+++ b/src/osd/modules/sound/direct_sound.cpp
@@ -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)
diff --git a/src/osd/osdcore.cpp b/src/osd/osdcore.cpp
index 0b0a0185837..fd696706e6b 100644
--- a/src/osd/osdcore.cpp
+++ b/src/osd/osdcore.cpp
@@ -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;
}
diff --git a/src/osd/osdnet.cpp b/src/osd/osdnet.cpp
index 3e1cb3596e1..070b4e96a2d 100644
--- a/src/osd/osdnet.cpp
+++ b/src/osd/osdnet.cpp
@@ -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();
diff --git a/src/osd/osdsync.cpp b/src/osd/osdsync.cpp
index 6e368eeb366..18b999201c4 100644
--- a/src/osd/osdsync.cpp
+++ b/src/osd/osdsync.cpp
@@ -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();
diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp
index ce63d28eba6..7def4360578 100644
--- a/src/osd/windows/window.cpp
+++ b/src/osd/windows/window.cpp
@@ -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;
diff --git a/src/osd/windows/winutil.cpp b/src/osd/windows/winutil.cpp
index c06b4d2eee2..b662974cfd1 100644
--- a/src/osd/windows/winutil.cpp
+++ b/src/osd/windows/winutil.cpp
@@ -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;