Fix unintialized values (from coverity scan)

This commit is contained in:
Ian McInerney 2020-01-12 13:00:42 +00:00
parent ae91312416
commit 00e58cd974
12 changed files with 92 additions and 61 deletions

View File

@ -32,16 +32,17 @@ using namespace KIGFX;
RENDER_SETTINGS::RENDER_SETTINGS() RENDER_SETTINGS::RENDER_SETTINGS()
{ {
// Set the default initial values // Set the default initial values
m_highlightFactor = 0.5f; m_highlightFactor = 0.5f;
m_selectFactor = 0.5f; m_selectFactor = 0.5f;
m_layerOpacity = 0.8f; m_layerOpacity = 0.8f;
m_highlightEnabled = false; m_highlightItems = false;
m_hiContrastEnabled = false; m_highlightEnabled = false;
m_hiContrastFactor = 0.2f; //TODO: Make this user-configurable m_hiContrastEnabled = false;
m_highlightNetcode = -1; m_hiContrastFactor = 0.2f; //TODO: Make this user-configurable
m_outlineWidth = 1; m_highlightNetcode = -1;
m_outlineWidth = 1;
m_worksheetLineWidth = 100000; m_worksheetLineWidth = 100000;
m_showPageLimits = false; m_showPageLimits = false;
} }

View File

@ -205,8 +205,11 @@ public:
class CONNECTION_GRAPH class CONNECTION_GRAPH
{ {
public: public:
CONNECTION_GRAPH( SCH_EDIT_FRAME* aFrame) : CONNECTION_GRAPH( SCH_EDIT_FRAME* aFrame )
m_frame( aFrame ) : m_last_net_code( 1 ),
m_last_bus_code( 1 ),
m_last_subgraph_code( 1 ),
m_frame( aFrame )
{} {}
~CONNECTION_GRAPH() ~CONNECTION_GRAPH()

View File

@ -53,9 +53,8 @@
*/ */
DIALOG_MIGRATE_BUSES::DIALOG_MIGRATE_BUSES( SCH_EDIT_FRAME* aParent ) : DIALOG_MIGRATE_BUSES::DIALOG_MIGRATE_BUSES( SCH_EDIT_FRAME* aParent )
DIALOG_MIGRATE_BUSES_BASE( aParent ), : DIALOG_MIGRATE_BUSES_BASE( aParent ), m_frame( aParent ), m_selected_index( 0 )
m_frame( aParent )
{ {
m_migration_list->Bind( wxEVT_LIST_ITEM_SELECTED, m_migration_list->Bind( wxEVT_LIST_ITEM_SELECTED,
&DIALOG_MIGRATE_BUSES::onItemSelected, this ); &DIALOG_MIGRATE_BUSES::onItemSelected, this );

View File

@ -171,11 +171,12 @@ SCH_COMPONENT::SCH_COMPONENT(
SCH_COMPONENT::SCH_COMPONENT( const SCH_COMPONENT& aComponent ) : SCH_COMPONENT::SCH_COMPONENT( const SCH_COMPONENT& aComponent ) :
SCH_ITEM( aComponent ) SCH_ITEM( aComponent )
{ {
m_Parent = aComponent.m_Parent; m_Parent = aComponent.m_Parent;
m_Pos = aComponent.m_Pos; m_Pos = aComponent.m_Pos;
m_unit = aComponent.m_unit; m_unit = aComponent.m_unit;
m_convert = aComponent.m_convert; m_convert = aComponent.m_convert;
m_lib_id = aComponent.m_lib_id; m_lib_id = aComponent.m_lib_id;
m_isInNetlist = aComponent.m_isInNetlist;
if( aComponent.m_part ) if( aComponent.m_part )
m_part.reset( new LIB_PART( *aComponent.m_part.get() ) ); m_part.reset( new LIB_PART( *aComponent.m_part.get() ) );

View File

@ -362,9 +362,14 @@ void CURSOR::UpdateReference()
SIM_PLOT_PANEL::SIM_PLOT_PANEL( SIM_TYPE aType, wxWindow* parent, wxWindowID id, const wxPoint& pos, SIM_PLOT_PANEL::SIM_PLOT_PANEL( SIM_TYPE aType, wxWindow* parent, wxWindowID id, const wxPoint& pos,
const wxSize& size, long style, const wxString& name ) const wxSize& size, long style, const wxString& name )
: mpWindow( parent, id, pos, size, style ), m_colorIdx( 0 ), : mpWindow( parent, id, pos, size, style ),
m_axis_x( nullptr ), m_axis_y1( nullptr ), m_axis_y2( nullptr ), m_type( aType ) m_colorIdx( 0 ),
m_axis_x( nullptr ),
m_axis_y1( nullptr ),
m_axis_y2( nullptr ),
m_dotted_cp( false ),
m_type( aType )
{ {
LimitView( true ); LimitView( true );
SetMargins( 50, 80, 50, 80 ); SetMargins( 50, 80, 50, 80 );

View File

@ -39,17 +39,22 @@
AR_MATRIX::AR_MATRIX() AR_MATRIX::AR_MATRIX()
{ {
m_BoardSide[0] = m_BoardSide[1] = nullptr; m_BoardSide[0] = nullptr;
m_DistSide[0] = m_DistSide[1] = nullptr; m_BoardSide[1] = nullptr;
m_DirSide[0] = m_DirSide[1] = nullptr; m_DistSide[0] = nullptr;
m_opWriteCell = nullptr; m_DistSide[1] = nullptr;
m_InitMatrixDone = false; m_DirSide[0] = nullptr;
m_Nrows = 0; m_DirSide[1] = nullptr;
m_Ncols = 0; m_opWriteCell = nullptr;
m_MemSize = 0; m_InitMatrixDone = false;
m_Nrows = 0;
m_Ncols = 0;
m_MemSize = 0;
m_RoutingLayersCount = 1; m_RoutingLayersCount = 1;
m_GridRouting = 0; m_GridRouting = 0;
m_RouteCount = 0; m_RouteCount = 0;
m_routeLayerBottom = B_Cu;
m_routeLayerTop = F_Cu;
} }

View File

@ -517,6 +517,10 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() :
m_trackWidthIndex = 0; m_trackWidthIndex = 0;
m_diffPairIndex = 0; m_diffPairIndex = 0;
// Courtyard defaults
m_RequireCourtyards = false;
m_ProhibitOverlappingCourtyards = true;
// Default ref text on fp creation. If empty, use footprint name as default // Default ref text on fp creation. If empty, use footprint name as default
m_RefDefaultText = wxT( "REF**" ); m_RefDefaultText = wxT( "REF**" );
m_RefDefaultVisibility = true; m_RefDefaultVisibility = true;

View File

@ -320,11 +320,12 @@ BOARD_STACKUP::BOARD_STACKUP()
BOARD_STACKUP::BOARD_STACKUP( BOARD_STACKUP& aOther ) BOARD_STACKUP::BOARD_STACKUP( BOARD_STACKUP& aOther )
{ {
m_HasDielectricConstrains = aOther.m_HasDielectricConstrains; m_HasDielectricConstrains = aOther.m_HasDielectricConstrains;
m_HasThicknessConstrains = aOther.m_HasThicknessConstrains;
m_EdgeConnectorConstraints = aOther.m_EdgeConnectorConstraints; m_EdgeConnectorConstraints = aOther.m_EdgeConnectorConstraints;
m_CastellatedPads = aOther.m_CastellatedPads; m_CastellatedPads = aOther.m_CastellatedPads;
m_EdgePlating = aOther.m_EdgePlating; m_EdgePlating = aOther.m_EdgePlating;
m_FinishType = aOther.m_FinishType; m_FinishType = aOther.m_FinishType;
// All items in aOther.m_list have to be duplicated, because aOther.m_list // All items in aOther.m_list have to be duplicated, because aOther.m_list
// manage pointers to these items // manage pointers to these items
@ -338,11 +339,12 @@ BOARD_STACKUP::BOARD_STACKUP( BOARD_STACKUP& aOther )
BOARD_STACKUP& BOARD_STACKUP::operator=( const BOARD_STACKUP& aOther ) BOARD_STACKUP& BOARD_STACKUP::operator=( const BOARD_STACKUP& aOther )
{ {
m_HasDielectricConstrains = aOther.m_HasDielectricConstrains; m_HasDielectricConstrains = aOther.m_HasDielectricConstrains;
m_HasThicknessConstrains = aOther.m_HasThicknessConstrains;
m_EdgeConnectorConstraints = aOther.m_EdgeConnectorConstraints; m_EdgeConnectorConstraints = aOther.m_EdgeConnectorConstraints;
m_CastellatedPads = aOther.m_CastellatedPads; m_CastellatedPads = aOther.m_CastellatedPads;
m_EdgePlating = aOther.m_EdgePlating; m_EdgePlating = aOther.m_EdgePlating;
m_FinishType = aOther.m_FinishType; m_FinishType = aOther.m_FinishType;
RemoveAll(); RemoveAll();

View File

@ -74,9 +74,10 @@ PLACE_FILE_EXPORTER::PLACE_FILE_EXPORTER( BOARD* aBoard, bool aUnitsMM,
bool aForceSmdItems, bool aTopSide, bool aForceSmdItems, bool aTopSide,
bool aBottomSide, bool aFormatCSV ) bool aBottomSide, bool aFormatCSV )
{ {
m_board = aBoard; m_board = aBoard;
m_unitsMM = aUnitsMM; m_unitsMM = aUnitsMM;
m_forceSmdItems = aForceSmdItems; m_forceSmdItems = aForceSmdItems;
m_fpCount = 0;
if( aTopSide && aBottomSide ) if( aTopSide && aBottomSide )
m_side = PCB_BOTH_SIDES; m_side = PCB_BOTH_SIDES;

View File

@ -148,7 +148,10 @@ private:
class HYPERLYNX_EXPORTER : public BOARD_EXPORTER_BASE class HYPERLYNX_EXPORTER : public BOARD_EXPORTER_BASE
{ {
public: public:
HYPERLYNX_EXPORTER(){}; HYPERLYNX_EXPORTER() : m_polyId( 1 )
{
}
~HYPERLYNX_EXPORTER(){}; ~HYPERLYNX_EXPORTER(){};
virtual bool Run() override; virtual bool Run() override;
@ -226,8 +229,8 @@ private:
HYPERLYNX_PAD_STACK::HYPERLYNX_PAD_STACK( BOARD* aBoard, const D_PAD* aPad ) HYPERLYNX_PAD_STACK::HYPERLYNX_PAD_STACK( BOARD* aBoard, const D_PAD* aPad )
{ {
m_board = aBoard; m_board = aBoard;
m_sx = aPad->GetSize().x; m_sx = aPad->GetSize().x;
m_sy = aPad->GetSize().y; m_sy = aPad->GetSize().y;
m_angle = 180.0 - ( aPad->GetOrientation() / 10.0 ); m_angle = 180.0 - ( aPad->GetOrientation() / 10.0 );
if( m_angle < 0.0 ) if( m_angle < 0.0 )
@ -236,21 +239,24 @@ HYPERLYNX_PAD_STACK::HYPERLYNX_PAD_STACK( BOARD* aBoard, const D_PAD* aPad )
} }
m_layers = aPad->GetLayerSet(); m_layers = aPad->GetLayerSet();
m_drill = aPad->GetDrillSize().x; m_drill = aPad->GetDrillSize().x;
m_shape = aPad->GetShape(); m_shape = aPad->GetShape();
m_type = PAD_ATTRIB_STANDARD; m_type = PAD_ATTRIB_STANDARD;
m_id = 0;
} }
HYPERLYNX_PAD_STACK::HYPERLYNX_PAD_STACK( BOARD* aBoard, const VIA* aVia ) HYPERLYNX_PAD_STACK::HYPERLYNX_PAD_STACK( BOARD* aBoard, const VIA* aVia )
{ {
m_board = aBoard; m_board = aBoard;
m_sx = m_sy = aVia->GetWidth(); m_sx = aVia->GetWidth();
m_angle = 0; m_sy = aVia->GetWidth();
m_angle = 0;
m_layers = LSET::AllCuMask(); m_layers = LSET::AllCuMask();
m_drill = aVia->GetDrillValue(); m_drill = aVia->GetDrillValue();
m_shape = PAD_SHAPE_CIRCLE; m_shape = PAD_SHAPE_CIRCLE;
m_type = PAD_ATTRIB_STANDARD; m_type = PAD_ATTRIB_STANDARD;
m_id = 0;
} }

View File

@ -49,10 +49,11 @@ PLACEFILE_GERBER_WRITER::PLACEFILE_GERBER_WRITER( BOARD* aPcb )
{ {
m_pcb = aPcb; m_pcb = aPcb;
/* Set conversion scale depending on drill file units */ /* Set conversion scale depending on drill file units */
m_conversionUnits = 1.0 / IU_PER_MM; // Gerber units = mm m_conversionUnits = 1.0 / IU_PER_MM; // Gerber units = mm
m_forceSmdItems = false; m_forceSmdItems = false;
m_plotPad1Marker = true; // Place a marker to pin 1 (or A1) position m_plotPad1Marker = true; // Place a marker to pin 1 (or A1) position
m_plotOtherPadsMarker = true; // Place a marker to other pins position m_plotOtherPadsMarker = true; // Place a marker to other pins position
m_layer = PCB_LAYER_ID::UNDEFINED_LAYER; // No layer set
} }

View File

@ -36,13 +36,16 @@ namespace PNS {
DP_MEANDER_PLACER::DP_MEANDER_PLACER( ROUTER* aRouter ) : DP_MEANDER_PLACER::DP_MEANDER_PLACER( ROUTER* aRouter ) :
MEANDER_PLACER_BASE( aRouter ) MEANDER_PLACER_BASE( aRouter )
{ {
m_world = NULL; m_world = NULL;
m_currentNode = NULL; m_currentNode = NULL;
m_padToDieP = 0;
m_padToDieN = 0;
// Init temporary variables (do not leave uninitialized members) // Init temporary variables (do not leave uninitialized members)
m_initialSegment = NULL; m_initialSegment = NULL;
m_lastLength = 0; m_lastLength = 0;
m_lastStatus = TOO_SHORT; m_lastStatus = TOO_SHORT;
} }