From 0e2fa09f52fd48b56eb54a6a8a2203815e426c91 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Thu, 2 Dec 2021 12:53:33 +0000 Subject: [PATCH] Games: Cast unused smart-pointer return values to void --- Userland/Games/2048/main.cpp | 2 +- Userland/Games/GameOfLife/main.cpp | 8 ++++---- Userland/Games/Minesweeper/main.cpp | 4 ++-- Userland/Games/Pong/main.cpp | 2 +- Userland/Games/Solitaire/Game.cpp | 4 ++-- Userland/Games/Spider/Game.cpp | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Userland/Games/2048/main.cpp b/Userland/Games/2048/main.cpp index 5c6c482b27e..8cc3570cabe 100644 --- a/Userland/Games/2048/main.cpp +++ b/Userland/Games/2048/main.cpp @@ -60,7 +60,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->resize(315, 336); auto main_widget = TRY(window->try_set_main_widget()); - TRY(main_widget->try_set_layout()); + (void)TRY(main_widget->try_set_layout()); main_widget->set_fill_with_background_color(true); Game game { board_size, target_tile, evil_ai }; diff --git a/Userland/Games/GameOfLife/main.cpp b/Userland/Games/GameOfLife/main.cpp index ce3c178b153..78f2e2e1579 100644 --- a/Userland/Games/GameOfLife/main.cpp +++ b/Userland/Games/GameOfLife/main.cpp @@ -98,27 +98,27 @@ ErrorOr serenity_main(Main::Arguments arguments) statusbar.set_text(click_tip); board_widget->run_generation(); }); - TRY(main_toolbar.try_add_action(run_one_generation_action)); + (void)TRY(main_toolbar.try_add_action(run_one_generation_action)); auto clear_board_action = GUI::Action::create("&Clear board", { Mod_Ctrl, Key_N }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/delete.png").release_value_but_fixme_should_propagate_errors(), [&](auto&) { statusbar.set_text(click_tip); board_widget->clear_cells(); board_widget->update(); }); - TRY(main_toolbar.try_add_action(clear_board_action)); + (void)TRY(main_toolbar.try_add_action(clear_board_action)); auto randomize_cells_action = GUI::Action::create("&Randomize board", { Mod_Ctrl, Key_R }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/reload.png").release_value_but_fixme_should_propagate_errors(), [&](auto&) { statusbar.set_text(click_tip); board_widget->randomize_cells(); board_widget->update(); }); - TRY(main_toolbar.try_add_action(randomize_cells_action)); + (void)TRY(main_toolbar.try_add_action(randomize_cells_action)); auto rotate_pattern_action = GUI::Action::create("&Rotate pattern", { 0, Key_R }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/redo.png").release_value_but_fixme_should_propagate_errors(), [&](auto&) { board_widget->selected_pattern()->rotate_clockwise(); }); rotate_pattern_action->set_enabled(false); - TRY(main_toolbar.try_add_action(rotate_pattern_action)); + (void)TRY(main_toolbar.try_add_action(rotate_pattern_action)); auto game_menu = TRY(window->try_add_menu("&Game")); diff --git a/Userland/Games/Minesweeper/main.cpp b/Userland/Games/Minesweeper/main.cpp index 29f5c45f657..301329d0167 100644 --- a/Userland/Games/Minesweeper/main.cpp +++ b/Userland/Games/Minesweeper/main.cpp @@ -43,7 +43,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->resize(139, 175); auto widget = TRY(window->try_set_main_widget()); - TRY(widget->try_set_layout()); + (void)TRY(widget->try_set_layout()); widget->layout()->set_spacing(0); auto top_line = TRY(widget->try_add(Gfx::Orientation::Horizontal)); @@ -52,7 +52,7 @@ ErrorOr serenity_main(Main::Arguments arguments) auto container = TRY(widget->try_add()); container->set_fill_with_background_color(true); container->set_fixed_height(36); - TRY(container->try_set_layout()); + (void)TRY(container->try_set_layout()); container->layout()->add_spacer(); diff --git a/Userland/Games/Pong/main.cpp b/Userland/Games/Pong/main.cpp index 7acefde12bc..c6dae50012a 100644 --- a/Userland/Games/Pong/main.cpp +++ b/Userland/Games/Pong/main.cpp @@ -31,7 +31,7 @@ ErrorOr serenity_main(Main::Arguments arguments) window->set_icon(app_icon.bitmap_for_size(16)); window->set_title("Pong"); window->set_double_buffering_enabled(false); - TRY(window->try_set_main_widget()); + (void)TRY(window->try_set_main_widget()); window->set_resizable(false); auto game_menu = TRY(window->try_add_menu("&Game")); diff --git a/Userland/Games/Solitaire/Game.cpp b/Userland/Games/Solitaire/Game.cpp index 7bccaa782d1..b079e47f03a 100644 --- a/Userland/Games/Solitaire/Game.cpp +++ b/Userland/Games/Solitaire/Game.cpp @@ -294,7 +294,7 @@ void Game::mouseup_event(GUI::MouseEvent& event) for (auto& to_intersect : m_focused_cards) { mark_intersecting_stacks_dirty(to_intersect); stack.push(to_intersect); - m_focused_stack->pop(); + (void)m_focused_stack->pop(); } remember_move_for_undo(*m_focused_stack, stack, m_focused_cards); @@ -629,7 +629,7 @@ void Game::perform_undo() for (auto& to_intersect : m_last_move.cards) { mark_intersecting_stacks_dirty(to_intersect); m_last_move.from->push(to_intersect); - m_last_move.to->pop(); + (void)m_last_move.to->pop(); } if (m_last_move.from->type() == CardStack::Type::Stock) { diff --git a/Userland/Games/Spider/Game.cpp b/Userland/Games/Spider/Game.cpp index 52d4756008f..92f924abd31 100644 --- a/Userland/Games/Spider/Game.cpp +++ b/Userland/Games/Spider/Game.cpp @@ -303,7 +303,7 @@ void Game::mouseup_event(GUI::MouseEvent& event) for (auto& to_intersect : m_focused_cards) { mark_intersecting_stacks_dirty(to_intersect); stack.push(to_intersect); - m_focused_stack->pop(); + (void)m_focused_stack->pop(); } update_score(-1);