Skip to content

Commit 133ff37

Browse files
Fix more code scan warnings related to uninitialized variables (CppMicroServices#973) (CppMicroServices#1140)
* Fix more code scan warnings related to uninitialized variables Fixes CppMicroServices#972 Fixes CppMicroServices#971 Fixes CppMicroServices#970 Signed-off-by: The MathWorks, Inc <jdicleme@mathworks.com> Co-authored-by: Jeff DiClemente <jeffdiclemente@users.noreply.github.com>
1 parent 51a4e73 commit 133ff37

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

framework/src/bundle/BundleArchive.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ namespace cppmicroservices
5656
BundleArchive::BundleArchive()
5757
: storage(nullptr)
5858
, bundleId(0)
59+
, lastModified(now())
60+
, autostartSetting(-1)
5961
, manifest(any_map::UNORDERED_MAP_CASEINSENSITIVE_KEYS)
6062
{
6163
}

framework/src/util/AnyMap.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ namespace cppmicroservices
184184

185185
any_map::const_iter::const_iter() = default;
186186

187-
any_map::const_iter::const_iter(any_map::const_iter const& it) : iterator_base(it.type)
187+
any_map::const_iter::const_iter(any_map::const_iter const& it) : iterator_base(it.type), it { nullptr }
188188
{
189189
switch (type)
190190
{
@@ -204,7 +204,7 @@ namespace cppmicroservices
204204
}
205205
}
206206

207-
any_map::const_iter::const_iter(any_map::iterator const& it) : iterator_base(it.type)
207+
any_map::const_iter::const_iter(any_map::iterator const& it) : iterator_base(it.type), it { nullptr }
208208
{
209209
switch (type)
210210
{
@@ -406,7 +406,7 @@ namespace cppmicroservices
406406

407407
any_map::iter::iter() = default;
408408

409-
any_map::iter::iter(iter const& it) : iterator_base(it.type)
409+
any_map::iter::iter(iter const& it) : iterator_base(it.type), it { nullptr }
410410
{
411411
switch (type)
412412
{

framework/src/util/FrameworkPrivate.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ namespace cppmicroservices
102102
*/
103103
struct FrameworkEventInternal
104104
{
105-
bool valid;
106-
FrameworkEvent::Type type;
105+
bool valid { false };
106+
FrameworkEvent::Type type { FrameworkEvent::FRAMEWORK_ERROR };
107107
std::string msg;
108108
std::exception_ptr excPtr;
109109
} stopEvent;

0 commit comments

Comments
 (0)