diff --git a/3d-viewer/3d_canvas/eda_3d_canvas.cpp b/3d-viewer/3d_canvas/eda_3d_canvas.cpp index 233f26a92c..ead38965f9 100644 --- a/3d-viewer/3d_canvas/eda_3d_canvas.cpp +++ b/3d-viewer/3d_canvas/eda_3d_canvas.cpp @@ -86,15 +86,27 @@ END_EVENT_TABLE() EDA_3D_CANVAS::EDA_3D_CANVAS( wxWindow* aParent, const int* aAttribList, BOARD* aBoard, BOARD_ADAPTER& aBoardAdapter, CCAMERA& aCamera, - S3D_CACHE* a3DCachePointer ) : - HIDPI_GL_CANVAS( aParent, wxID_ANY, aAttribList, wxDefaultPosition, wxDefaultSize, - wxFULL_REPAINT_ON_RESIZE ), - m_eventDispatcher( nullptr ), - m_parentStatusBar( nullptr ), - m_glRC( nullptr ), - m_boardAdapter( aBoardAdapter ), - m_camera( aCamera ), - m_3d_render( nullptr ) + S3D_CACHE* a3DCachePointer ) + : HIDPI_GL_CANVAS( aParent, wxID_ANY, aAttribList, wxDefaultPosition, wxDefaultSize, + wxFULL_REPAINT_ON_RESIZE ), + m_eventDispatcher( nullptr ), + m_parentStatusBar( nullptr ), + m_parentInfoBar( nullptr ), + m_glRC( nullptr ), + m_is_opengl_initialized( false ), + m_mouse_is_moving( false ), + m_mouse_was_moved( false ), + m_camera_is_moving( false ), + m_render_pivot( false ), + m_camera_moving_speed( 1.0f ), + m_strtime_camera_movement( 0 ), + m_animation_enabled( true ), + m_moving_speed_multiplier( 3 ), + m_boardAdapter( aBoardAdapter ), + m_camera( aCamera ), + m_3d_render( nullptr ), + m_opengl_supports_raytracing( false ), + m_render_raytracing_was_requested( false ) { wxLogTrace( m_logTrace, "EDA_3D_CANVAS::EDA_3D_CANVAS" ); @@ -112,21 +124,6 @@ EDA_3D_CANVAS::EDA_3D_CANVAS( wxWindow* aParent, const int* aAttribList, BOARD* NULL, this ); - m_mouse_was_moved = false; - m_mouse_is_moving = false; - m_camera_is_moving = false; - m_render_pivot = false; - m_camera_moving_speed = 1.0f; - m_animation_enabled = true; - m_moving_speed_multiplier = 3; - - m_strtime_camera_movement = 0; - - m_is_opengl_initialized = false; - - m_render_raytracing_was_requested = false; - m_opengl_supports_raytracing = false; - m_3d_render_raytracing = new C3D_RENDER_RAYTRACING( m_boardAdapter, m_camera ); m_3d_render_ogl_legacy = new C3D_RENDER_OGL_LEGACY( m_boardAdapter, m_camera ); diff --git a/3d-viewer/3d_viewer/3d_viewer_settings.cpp b/3d-viewer/3d_viewer/3d_viewer_settings.cpp index 00c5189389..8189e172ee 100644 --- a/3d-viewer/3d_viewer/3d_viewer_settings.cpp +++ b/3d-viewer/3d_viewer/3d_viewer_settings.cpp @@ -31,8 +31,10 @@ using KIGFX::COLOR4D; const int viewer3dSchemaVersion = 0; -EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() : - APP_SETTINGS_BASE( "3d_viewer", viewer3dSchemaVersion ), m_Render() +EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS() + : APP_SETTINGS_BASE( "3d_viewer", viewer3dSchemaVersion ), + m_Render(), + m_Camera() { m_params.emplace_back( new PARAM( "render.engine", &m_Render.engine, static_cast( RENDER_ENGINE::OPENGL_LEGACY ), @@ -180,4 +182,4 @@ bool EDA_3D_VIEWER_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg ) "SPasteColor_Red", "SPasteColor_Green", "SPasteColor_Blue", "colors.solderpaste" ); return ret; -} \ No newline at end of file +} diff --git a/common/dialogs/panel_color_settings.cpp b/common/dialogs/panel_color_settings.cpp index c5dbc3b1f3..18a02bc4ea 100644 --- a/common/dialogs/panel_color_settings.cpp +++ b/common/dialogs/panel_color_settings.cpp @@ -279,7 +279,7 @@ void PANEL_COLOR_SETTINGS::updateColor( int aLayer, const KIGFX::COLOR4D& aColor m_swatches[aLayer]->SetSwatchColor( aColor, false ); - if( aLayer == m_backgroundLayer ) + if( m_currentSettings && aLayer == m_backgroundLayer ) { COLOR4D background = m_currentSettings->GetColor( m_backgroundLayer ); diff --git a/common/tool/action_menu.cpp b/common/tool/action_menu.cpp index e97cf9f5b2..7f5d35d49a 100644 --- a/common/tool/action_menu.cpp +++ b/common/tool/action_menu.cpp @@ -404,8 +404,8 @@ void ACTION_MENU::OnMenuEvent( wxMenuEvent& aEvent ) keyEvent.m_shiftDown = ( acceleratorKey->GetFlags() & wxMOD_SHIFT ) > 0; keyEvent.m_altDown = ( acceleratorKey->GetFlags() & wxMOD_ALT ) > 0; - if( dynamic_cast( focus ) ) - TEXTENTRY_TRICKS::OnCharHook( dynamic_cast( focus ), keyEvent ); + if( auto ctrl = dynamic_cast( focus ) ) + TEXTENTRY_TRICKS::OnCharHook( ctrl, keyEvent ); else focus->HandleWindowEvent( keyEvent ); diff --git a/cvpcb/display_footprints_frame.cpp b/cvpcb/display_footprints_frame.cpp index cf7918e8cc..0eec6d0bdd 100644 --- a/cvpcb/display_footprints_frame.cpp +++ b/cvpcb/display_footprints_frame.cpp @@ -163,8 +163,9 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aPa // Restore last zoom. (If auto-zooming we'll adjust when we load the footprint.) CVPCB_SETTINGS* cfg = dynamic_cast( config() ); - wxASSERT( cfg ); - GetCanvas()->GetView()->SetScale( cfg->m_FootprintViewerZoom ); + + if( cfg ) + GetCanvas()->GetView()->SetScale( cfg->m_FootprintViewerZoom ); updateView(); @@ -524,7 +525,7 @@ BOARD_ITEM_CONTAINER* DISPLAY_FOOTPRINTS_FRAME::GetModel() const void DISPLAY_FOOTPRINTS_FRAME::SetAutoZoom( bool aAutoZoom ) { CVPCB_SETTINGS* cfg = dynamic_cast( config() ); - wxASSERT( cfg ); + wxCHECK( cfg, /* void */ ); cfg->m_FootprintViewerAutoZoom = aAutoZoom; } @@ -532,6 +533,6 @@ void DISPLAY_FOOTPRINTS_FRAME::SetAutoZoom( bool aAutoZoom ) bool DISPLAY_FOOTPRINTS_FRAME::GetAutoZoom() { CVPCB_SETTINGS* cfg = dynamic_cast( config() ); - wxASSERT( cfg ); + wxCHECK( cfg, false ); return cfg->m_FootprintViewerAutoZoom; } diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 4cca11409a..26d0e8107c 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -976,7 +976,8 @@ int SCH_EDITOR_CONTROL::UpdateNetHighlighting( const TOOL_EVENT& aEvent ) redraw |= item->IsBrightened(); - if( item->Type() == SCH_COMPONENT_T ) + // comp is only non-null if the item is a SCH_COMPONENT_T + if( comp ) { redraw |= comp->HasBrightenedPins(); diff --git a/include/reporter.h b/include/reporter.h index f594857969..5fb4e5ff54 100644 --- a/include/reporter.h +++ b/include/reporter.h @@ -293,7 +293,11 @@ private: public: INFOBAR_REPORTER( WX_INFOBAR* aInfoBar ) - : REPORTER(), m_messageSet( false ), m_infoBar( aInfoBar ) + : REPORTER(), + m_messageSet( false ), + m_infoBar( aInfoBar ), + m_message( wxEmptyString ), + m_severity( RPT_SEVERITY_UNDEFINED ) { } diff --git a/pcbnew/altium2kicadpcb_plugin/altium_parser_pcb.cpp b/pcbnew/altium2kicadpcb_plugin/altium_parser_pcb.cpp index 5e6b354fc3..f1bced6a2f 100644 --- a/pcbnew/altium2kicadpcb_plugin/altium_parser_pcb.cpp +++ b/pcbnew/altium2kicadpcb_plugin/altium_parser_pcb.cpp @@ -479,6 +479,7 @@ APOLYGON6::APOLYGON6( ALTIUM_PARSER& aReader ) ARULE6::ARULE6( ALTIUM_PARSER& aReader ) { // Initalize all variables and make Coverity happy + clearanceGap = 0; planeclearanceClearance = 0; polygonconnectAirgapwidth = 0; polygonconnectReliefconductorwidth = 0; diff --git a/pcbnew/exporters/gerber_jobfile_writer.cpp b/pcbnew/exporters/gerber_jobfile_writer.cpp index 6f4d2d947c..fb925f066b 100644 --- a/pcbnew/exporters/gerber_jobfile_writer.cpp +++ b/pcbnew/exporters/gerber_jobfile_writer.cpp @@ -452,7 +452,7 @@ void GERBER_JOBFILE_WRITER::addJSONDesignRules() bool hasInnerLayers = m_pcb->GetCopperLayerCount() > 2; // Search a smaller clearance in other net classes, if any. - for( const std::pair& entry : dsnSettings.m_NetClasses ) + for( const std::pair& entry : dsnSettings.m_NetClasses ) minclearanceOuter = std::min( minclearanceOuter, entry.second->GetClearance() ); // job file knows different clearance types. diff --git a/pcbnew/pcbnew_settings.cpp b/pcbnew/pcbnew_settings.cpp index 964bfea75d..c41f158d5e 100644 --- a/pcbnew/pcbnew_settings.cpp +++ b/pcbnew/pcbnew_settings.cpp @@ -45,8 +45,32 @@ const int pcbnewSchemaVersion = 0; PCBNEW_SETTINGS::PCBNEW_SETTINGS() : APP_SETTINGS_BASE( "pcbnew", pcbnewSchemaVersion ), + m_AuiPanels(), + m_Cleanup(), + m_DrcDialog(), + m_ExportIdf(), + m_ExportStep(), + m_ExportSvg(), + m_ExportVrml(), + m_FootprintWizardList(), + m_GenDrill(), + m_ImportGraphics(), + m_NetlistDialog(), + m_PlaceFile(), + m_Plot(), + m_FootprintChooser(), + m_UserGrid(), + m_Zones(), + m_FootprintViewer(), + m_FootprintWizard(), + m_Display(), + m_FastGrid1( 0 ), + m_FastGrid2( 0 ), m_Use45DegreeGraphicSegments( false ), m_FlipLeftRight( false ), + m_PolarCoords( false ), + m_RotationAngle( 900 ), + m_PlotLineWidth( 0.1 ), m_ShowPageLimits( true ), m_PnsSettings( nullptr ), m_FootprintViewerAutoZoom( false ),