From a78659ed0529226ad937f5e241ad72ba93702959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Mon, 28 May 2018 15:39:02 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20more=20GCC=208.1=20warnings=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=C2=A0=EE=82=B2=C2=A01=C2=A0?= =?UTF-8?q?=EE=82=B2=C2=A0=EE=82=A0=C2=A0master=C2=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix 3 warnings reported by GCC 8.1 of the following type ```src/client/gameui.cpp:191:43: warning: « void* memset(void*, int, size_t) » effacement d'un objet du type non trivial « struct GameUI::Flags »; use assignment or value-initialization instead [-Wclass-memaccess] memset(&m_flags, 0, sizeof(GameUI::Flags)); ``` --- src/client/gameui.cpp | 2 +- src/game.cpp | 3 ++- src/gui/guiTable.cpp | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/gameui.cpp b/src/client/gameui.cpp index 142d30922..7e0a7ef67 100644 --- a/src/client/gameui.cpp +++ b/src/client/gameui.cpp @@ -188,7 +188,7 @@ void GameUI::update(const RunStats &stats, Client *client, MapDrawControl *draw_ void GameUI::initFlags() { - memset(&m_flags, 0, sizeof(GameUI::Flags)); + m_flags = GameUI::Flags(); m_flags.show_chat = true; m_flags.show_hud = true; m_flags.show_debug = g_settings->getBool("show_debug"); diff --git a/src/game.cpp b/src/game.cpp index e74d42cd0..648c71774 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1014,7 +1014,8 @@ bool Game::startup(bool *kill, RenderingEngine::get_scene_manager()->getParameters()-> setAttribute(scene::OBJ_LOADER_IGNORE_MATERIAL_FILES, true); - memset(&runData, 0, sizeof(runData)); + // Reinit runData + runData = GameRunData(); runData.time_from_last_punch = 10.0; runData.update_wielded_item_trigger = true; diff --git a/src/gui/guiTable.cpp b/src/gui/guiTable.cpp index a2738afa9..501b425f8 100644 --- a/src/gui/guiTable.cpp +++ b/src/gui/guiTable.cpp @@ -334,7 +334,6 @@ void GUITable::setTable(const TableOptions &options, // Make template for new cells Cell newcell; - memset(&newcell, 0, sizeof newcell); newcell.content_type = columntype; newcell.tooltip_index = tooltip_index; newcell.reported_column = j+1;