Some coverity fixes

This commit is contained in:
Mark Roszko 2018-01-06 00:02:28 -05:00 committed by Chris Pavlina
parent 57fe3739ca
commit b98cc0b937
15 changed files with 22 additions and 11 deletions

View File

@ -37,6 +37,7 @@
C_OGL_3DMODEL::C_OGL_3DMODEL( const S3DMODEL &a3DModel,
MATERIAL_MODE aMaterialMode )
{
m_ogl_idx_list_meshes = 0;
m_ogl_idx_list_opaque = 0;
m_ogl_idx_list_transparent = 0;
m_nr_meshes = 0;

View File

@ -71,7 +71,7 @@ OPENGL_GAL::OPENGL_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions, wxWindow* aParent,
HIDPI_GL_CANVAS( aParent, wxID_ANY, (int*) glAttributes, wxDefaultPosition, wxDefaultSize,
wxEXPAND, aName ),
mouseListener( aMouseListener ), paintListener( aPaintListener ), currentManager( nullptr ),
cachedManager( nullptr ), nonCachedManager( nullptr ), overlayManager( nullptr )
cachedManager( nullptr ), nonCachedManager( nullptr ), overlayManager( nullptr ), mainBuffer( 0 ), overlayBuffer( 0 )
{
if( glMainContext == NULL )
{
@ -1583,6 +1583,7 @@ int OPENGL_GAL::drawBitmapChar( unsigned long aChar )
if( aChar == ' ' )
{
const FONT_GLYPH_TYPE* g = LookupGlyph( 'x' );
wxASSERT( g );
Translate( VECTOR2D( g->advance, 0 ) );
return g->advance;
}

View File

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

View File

@ -35,7 +35,7 @@
LIB_MANAGER::LIB_MANAGER( LIB_EDIT_FRAME& aFrame )
: m_frame( aFrame ), m_symbolTable( aFrame.Prj().SchSymbolLibTable() )
: m_frame( aFrame ), m_symbolTable( aFrame.Prj().SchSymbolLibTable() ), m_syncHash( 0 )
{
m_adapter = LIB_MANAGER_ADAPTER::Create( this );
m_adapter->ShowUnits( false );

View File

@ -1462,6 +1462,7 @@ bool SCH_SCREENS::HasNoFullyDefinedLibIds()
cnt += 1;
symbol = dynamic_cast< SCH_COMPONENT* >( item );
wxASSERT( symbol );
if( !symbol->GetLibId().GetLibNickname().empty() )
return false;
@ -1493,6 +1494,7 @@ size_t SCH_SCREENS::GetLibNicknames( wxArrayString& aLibNicknames )
continue;
symbol = dynamic_cast< SCH_COMPONENT* >( item );
wxASSERT( symbol );
nickname = symbol->GetLibId().GetLibNickname();
@ -1523,6 +1525,7 @@ int SCH_SCREENS::ChangeSymbolLibNickname( const wxString& aFrom, const wxString&
continue;
symbol = dynamic_cast< SCH_COMPONENT* >( item );
wxASSERT( symbol );
if( symbol->GetLibId().GetLibNickname() != aFrom )
continue;

View File

@ -905,8 +905,7 @@ void SIM_PLOT_FRAME::menuShowGridUpdate( wxUpdateUIEvent& event )
{
SIM_PLOT_PANEL* plot = CurrentPlot();
if( plot )
event.Check( plot ? plot->IsGridShown() : false );
event.Check( plot ? plot->IsGridShown() : false );
}

View File

@ -383,7 +383,7 @@ void GERBVIEW_PAINTER::draw( /*const*/ GERBER_DRAW_ITEM* aItem, int aLayer )
void GERBVIEW_PAINTER::drawPolygon( GERBER_DRAW_ITEM* aParent,
SHAPE_POLY_SET aPolygon,
SHAPE_POLY_SET& aPolygon,
bool aFilled )
{
for( auto it = aPolygon.Iterate( 0 ); it; ++it )

View File

@ -181,7 +181,7 @@ protected:
void draw( /*const*/ GERBER_DRAW_ITEM* aVia, int aLayer );
/// Helper routine to draw a polygon
void drawPolygon( GERBER_DRAW_ITEM* aParent, SHAPE_POLY_SET aPolygon, bool aFilled );
void drawPolygon( GERBER_DRAW_ITEM* aParent, SHAPE_POLY_SET& aPolygon, bool aFilled );
/// Helper to draw a flashed shape (aka spot)
void drawFlashedShape( GERBER_DRAW_ITEM* aItem, bool aFilled );

View File

@ -55,6 +55,8 @@ public:
m_Size( aSize )
{ }
virtual ~EDA_RECT() { };
wxPoint Centre() const
{
return wxPoint( m_Pos.x + ( m_Size.x >> 1 ),

View File

@ -199,7 +199,8 @@ public:
* construct a default OPTIONAL_XML_ATTRIBUTE, whose data is not available.
*/
OPTIONAL_XML_ATTRIBUTE() :
m_isAvailable( false )
m_isAvailable( false ),
m_data( T() )
{}
/**

View File

@ -135,7 +135,7 @@ private:
/*
* construction parameters
*/
bool m_angleSnap;
bool m_angleSnap = false;
};
} // PREVIEW
} // KIGFX

View File

@ -136,7 +136,8 @@ public:
m_running( false ),
m_args( 0 ),
m_callee( nullptr ),
m_retVal( 0 )
m_retVal( 0 ),
m_callContext( nullptr )
{
}

View File

@ -36,6 +36,7 @@
CONNECTIVITY_DATA::CONNECTIVITY_DATA()
{
m_connAlgo.reset( new CN_CONNECTIVITY_ALGO );
m_progressReporter = nullptr;
}

View File

@ -244,7 +244,7 @@ size_t FOOTPRINT_LIST_IMPL::CountFinished()
}
FOOTPRINT_LIST_IMPL::FOOTPRINT_LIST_IMPL() : m_loader( nullptr )
FOOTPRINT_LIST_IMPL::FOOTPRINT_LIST_IMPL() : m_loader( nullptr ), m_first_to_finish( false ), m_count_finished( 0 )
{
}

View File

@ -60,6 +60,7 @@ DXF2BRD_CONVERTER::DXF2BRD_CONVERTER() : DRW_Interface()
m_yOffset = 0.0; // Y coord offset for conversion (in mm)
m_DXF2mm = 1.0; // The scale factor to convert DXF units to mm
m_version = 0; // the dxf version, not yet used
m_defaultThickness = 0.2; // default thickness (in mm)
m_brdLayer = Dwgs_User; // The default import layer
m_importAsfootprintGraphicItems = true;
}