diff options
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 |
commit | 059243f68ec0c2e327a3105a9480f50e5e0b4abf (patch) | |
tree | cbf132320ebc93ae4c58d60fd3a5ed834c2e8862 /src/osd/modules | |
parent | 06ecc1ca0d96a7d9cc66aab6a5aa8b8f0265fa09 (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)
Diffstat (limited to 'src/osd/modules')
-rw-r--r-- | src/osd/modules/debugger/debuggdbstub.cpp | 28 | ||||
-rw-r--r-- | src/osd/modules/debugger/debugimgui.cpp | 2 | ||||
-rw-r--r-- | src/osd/modules/lib/osdlib_win32.cpp | 4 | ||||
-rw-r--r-- | src/osd/modules/midi/none.cpp | 4 | ||||
-rw-r--r-- | src/osd/modules/midi/portmidi.cpp | 4 | ||||
-rw-r--r-- | src/osd/modules/render/bgfx/sliderreader.cpp | 2 | ||||
-rw-r--r-- | src/osd/modules/render/bgfx/targetmanager.cpp | 4 | ||||
-rw-r--r-- | src/osd/modules/render/binpacker.cpp | 6 | ||||
-rw-r--r-- | src/osd/modules/render/drawogl.cpp | 2 | ||||
-rw-r--r-- | src/osd/modules/sound/direct_sound.cpp | 2 |
10 files changed, 29 insertions, 29 deletions
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) |