From 1d12136b59fbdcf42073dbeb04962932dac5b0f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 30 Apr 2019 20:45:48 +0200 Subject: [PATCH] Fixed Cppcheck uninitStructMember warnings --- .travis_suppressions | 1 - lib/library.cpp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis_suppressions b/.travis_suppressions index fe25b1a4d..7bbc5b558 100644 --- a/.travis_suppressions +++ b/.travis_suppressions @@ -8,7 +8,6 @@ shadowFunction # temporary suppressions - fix the warnings! missingOverride shiftTooManyBitsSigned -uninitStructMember unsignedLessThanZero unusedPrivateFunction useStlAlgorithm diff --git a/lib/library.cpp b/lib/library.cpp index c99d15269..d49efdf89 100644 --- a/lib/library.cpp +++ b/lib/library.cpp @@ -189,7 +189,7 @@ Library::Error Library::load(const tinyxml2::XMLDocument &doc) for (const tinyxml2::XMLElement *memorynode = node->FirstChildElement(); memorynode; memorynode = memorynode->NextSiblingElement()) { const std::string memorynodename = memorynode->Name(); if (memorynodename == "alloc") { - AllocFunc temp; + AllocFunc temp = {0}; temp.groupId = allocationId; if (memorynode->Attribute("init", "false")) @@ -227,7 +227,7 @@ Library::Error Library::load(const tinyxml2::XMLDocument &doc) mAlloc[memorynode->GetText()] = temp; } else if (memorynodename == "dealloc") { - AllocFunc temp; + AllocFunc temp = {0}; temp.groupId = allocationId; const char *arg = memorynode->Attribute("arg"); if (arg)