Add missing initialization values to variables

Flagged by Coverity.
This commit is contained in:
Ian McInerney 2021-12-30 23:42:06 +00:00
parent 9e6446a8dc
commit 0e9cfd0af2
11 changed files with 25 additions and 8 deletions

View File

@ -28,6 +28,8 @@ using namespace KIGFX;
RENDER_SETTINGS::RENDER_SETTINGS() :
m_highlightNetcodes(),
m_dashLengthRatio( 12 ), // From ISO 128-2
m_gapLengthRatio( 3 ), // From ISO 128-2
m_printDC( nullptr )
{
// Set the default initial values

View File

@ -53,7 +53,9 @@ COMMON_SETTINGS::COMMON_SETTINGS() :
m_Graphics(),
m_Session(),
m_System(),
m_NetclassPanel()
m_DoNotShowAgain(),
m_NetclassPanel(),
m_PackageManager()
{
/*
* Automatic dark mode detection works fine on Mac.

View File

@ -36,8 +36,8 @@ void STROKE_PARAMS::Stroke( const SHAPE* aShape, PLOT_DASH_TYPE aLineStyle, int
const KIGFX::RENDER_SETTINGS* aRenderSettings,
std::function<void( const wxPoint& a, const wxPoint& b )> aStroker )
{
double strokes[6];
int wrapAround;
double strokes[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
int wrapAround = 0;
switch( aLineStyle )
{

View File

@ -81,9 +81,9 @@ void SCH_SHAPE::Plot( PLOTTER* aPlotter ) const
{
int pen_size = std::max( GetPenWidth(), aPlotter->RenderSettings()->GetMinPenWidth() );
wxPoint center;
int radius;
int startAngle;
int endAngle;
int radius = 0;
int startAngle = 0;
int endAngle = 0;
static std::vector<wxPoint> cornerList;

View File

@ -612,7 +612,10 @@ void SCH_TEXT::Show( int nestLevel, std::ostream& os ) const
SCH_LABEL_BASE::SCH_LABEL_BASE( const wxPoint& aPos, const wxString& aText, KICAD_T aType ) :
SCH_TEXT( aPos, aText, aType )
SCH_TEXT( aPos, aText, aType ),
m_shape( L_UNSPECIFIED ),
m_connectionType( CONNECTION_TYPE::NONE ),
m_isDangling( true )
{
SetMultilineAllowed( false );
SetFieldsAutoplaced();

View File

@ -40,6 +40,8 @@ public:
// Angle type must be explicitly specified at creation, because
// there is no other way of knowing what an int or a double represents
EDA_ANGLE( int aValue, ANGLE_TYPE aAngleType ) :
m_value( 0 ),
m_radians( 0.0 ),
m_initial_type( aAngleType )
{
switch( aAngleType )
@ -55,6 +57,8 @@ public:
}
EDA_ANGLE( double aValue, ANGLE_TYPE aAngleType ) :
m_value( 0 ),
m_radians( 0.0 ),
m_initial_type( aAngleType )
{
switch( aAngleType )

View File

@ -60,6 +60,7 @@ public:
m_pos = (wxPoint) aBox.GetPosition();
m_size.x = aBox.GetWidth();
m_size.y = aBox.GetHeight();
m_init = true;
}
virtual ~EDA_RECT() { };

View File

@ -501,7 +501,7 @@ void PCB_EDIT_FRAME::ExchangeFootprint( FOOTPRINT* aExisting, FOOTPRINT* aNew,
bool* aUpdated )
{
PCB_GROUP* parentGroup = aExisting->GetParentGroup();
bool dummyBool;
bool dummyBool = false;
if( !aUpdated )
aUpdated = &dummyBool;

View File

@ -47,6 +47,9 @@ class DRC_TEST_PROVIDER_SOLDER_MASK : public ::DRC_TEST_PROVIDER
{
public:
DRC_TEST_PROVIDER_SOLDER_MASK ():
m_board( nullptr ),
m_webWidth( 0 ),
m_maxError( 0 ),
m_largestClearance( 0 )
{
m_bridgeRule.m_Name = _( "board setup solder mask min width" );

View File

@ -44,6 +44,7 @@ FOOTPRINT_EDITOR_SETTINGS::FOOTPRINT_EDITOR_SETTINGS() :
m_Display(),
m_UserGrid(),
m_PolarCoords( false ),
m_RotationAngle( 900 ),
m_Use45Limit( true ),
m_LibWidth( 250 ),
m_LastImportExportPath(),

View File

@ -52,6 +52,7 @@ LINE_PLACER::LINE_PLACER( ROUTER* aRouter ) :
m_currentNet = 0;
m_currentLayer = 0;
m_startItem = nullptr;
m_endItem = nullptr;
m_chainedPlacement = false;
m_orthoMode = false;
m_placementCorrect = false;