]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Fix more GCC 8.1 warnings ...
authorLoïc Blot <loic.blot@unix-experience.fr>
Mon, 28 May 2018 13:39:02 +0000 (15:39 +0200)
committerLoïc Blot <loic.blot@unix-experience.fr>
Mon, 28 May 2018 13:39:04 +0000 (15:39 +0200)
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
src/game.cpp
src/gui/guiTable.cpp

index 142d30922d3e0fe5fd8cffc6b3f74b717a02bbb9..7e0a7ef67736a6fba20f4218e61c157cbd08268e 100644 (file)
@@ -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");
index e74d42cd0ac2bbb2fdb660a1e4a7ce8ea44f663a..648c71774be68c653538420ac29cafcea2e55d5b 100644 (file)
@@ -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;
 
index a2738afa9dac4d1f2d222a05a83a8bb85f8ea6ee..501b425f8b0f8d2c976840c89e610c4d635cc631 100644 (file)
@@ -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;