Fix some Coverity uninitialized field warnings.

Fixes Coverity CIDs:

- 175824
- 169337
- 163191
- 175827
- 175440
- 175438
- 157136
This commit is contained in:
Wayne Stambaugh 2018-06-04 13:48:17 -04:00
parent 5dbfa6a9c1
commit 7343e78347
7 changed files with 94 additions and 82 deletions

View File

@ -1,5 +1,7 @@
/*
* Copyright (C) 2018 CERN
* Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors.
*
* Author: Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software: you can redistribute it and/or modify it
@ -27,6 +29,8 @@ DIALOG_FILE_DIR_PICKER::DIALOG_FILE_DIR_PICKER( wxWindow* parent, const wxString
: DIALOG_SHIM( parent, wxID_ANY, title, wxDefaultPosition,
wxSize( 500, 600 ), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
{
m_showHidden = nullptr;
wxString path = defaultPath.IsEmpty() ? wxGetCwd() : defaultPath;
m_filesOnly = style & FD_RETURN_FILESONLY;

View File

@ -108,6 +108,7 @@ CMP_TREE_NODE::CMP_TREE_NODE()
Type( INVALID ),
IntrinsicRank( 0 ),
Score( kLowestDefaultScore ),
SearchTextNormalized( false ),
Unit( 0 ),
IsRoot( false )
{}

View File

@ -115,7 +115,8 @@ protected:
public:
FIELDS_EDITOR_GRID_DATA_MODEL( SCH_EDIT_FRAME* aFrame, SCH_REFERENCE_LIST& aComponentList ) :
m_frame( aFrame ),
m_componentRefs( aComponentList )
m_componentRefs( aComponentList ),
m_sortAscending( false )
{
m_componentRefs.SplitReferences();
}

View File

@ -2,6 +2,8 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2016-2018 CERN
* Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors.
*
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
@ -37,7 +39,8 @@ using namespace std;
static const wxChar* const traceNgspice = wxT( "KICAD_NGSPICE" );
NGSPICE::NGSPICE()
NGSPICE::NGSPICE() :
m_error( false )
{
init_dll();
}

View File

@ -96,6 +96,7 @@ public:
aMainText, aMainText,
aMainPos, aMainPos );
m_hasSecondItem = false;
m_parent = nullptr;
}
/**

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2012-2016 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2012-2018 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2017 CERN
* @author Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
*
@ -214,6 +214,7 @@ public:
*/
OPTIONAL_XML_ATTRIBUTE( const wxString& aData )
{
m_data = T();
m_isAvailable = !aData.IsEmpty();
if( m_isAvailable )

View File

@ -84,6 +84,7 @@ struct TokenType
double dValue;
int iValue;
};
bool valid;
char text[32];
};
@ -170,7 +171,7 @@ private:
/* Token state for input string. */
struct TokenStat {
enum { OutLen=32 };
TokenStat() : input(0), token(0), inputLen(0) { /* empty */ }
TokenStat() : input(0), token(0), inputLen(0), pos(0) { /* empty */ }
const char* input; // current input string ("var=4")
char* token; // output token ("var", type:VAR; "4", type:VALUE)
size_t inputLen; // strlen(input)