Skip to content

Commit a78659e

Browse files
committedMay 28, 2018
Fix more GCC 8.1 warnings   1   master 
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)); ```
1 parent b620f2f commit a78659e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed
 

Diff for: ‎src/client/gameui.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ void GameUI::update(const RunStats &stats, Client *client, MapDrawControl *draw_
188188

189189
void GameUI::initFlags()
190190
{
191-
memset(&m_flags, 0, sizeof(GameUI::Flags));
191+
m_flags = GameUI::Flags();
Has conversations. Original line has conversations.
192192
m_flags.show_chat = true;
193193
m_flags.show_hud = true;
194194
m_flags.show_debug = g_settings->getBool("show_debug");

Diff for: ‎src/game.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,8 @@ bool Game::startup(bool *kill,
10141014
RenderingEngine::get_scene_manager()->getParameters()->
10151015
setAttribute(scene::OBJ_LOADER_IGNORE_MATERIAL_FILES, true);
10161016

1017-
memset(&runData, 0, sizeof(runData));
1017+
// Reinit runData
1018+
runData = GameRunData();
10181019
runData.time_from_last_punch = 10.0;
10191020
runData.update_wielded_item_trigger = true;
10201021

Diff for: ‎src/gui/guiTable.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,6 @@ void GUITable::setTable(const TableOptions &options,
334334

335335
// Make template for new cells
336336
Cell newcell;
337-
memset(&newcell, 0, sizeof newcell);
338337
newcell.content_type = columntype;
339338
newcell.tooltip_index = tooltip_index;
340339
newcell.reported_column = j+1;

0 commit comments

Comments
 (0)
Please sign in to comment.