Coverity fixes.

This commit is contained in:
Jeff Young 2022-09-20 00:19:15 +01:00
parent 7fe3999457
commit 30a4d3d2de
5 changed files with 10 additions and 7 deletions

View File

@ -1137,7 +1137,7 @@ void EDA_BASE_FRAME::OnDropFiles( wxDropFilesEvent& aEvent )
void EDA_BASE_FRAME::DoWithAcceptedFiles()
{
for( auto file : m_AcceptedFiles )
for( const wxFileName& file : m_AcceptedFiles )
{
wxString fn = file.GetFullPath();
m_toolManager->RunAction( *m_acceptedExts.at( file.GetExt() ), true, &fn );

View File

@ -231,10 +231,13 @@ bool EE_SELECTION_TOOL::Init()
if ( !m_isSymbolEditor )
return false;
SYMBOL_EDIT_FRAME* symEditFrame = dynamic_cast<SYMBOL_EDIT_FRAME*>( m_frame );
SYMBOL_EDIT_FRAME* symbolEditorFrame = dynamic_cast<SYMBOL_EDIT_FRAME*>( m_frame );
return symEditFrame->GetCurSymbol() && symEditFrame->GetCurSymbol()->IsMulti()
&& symEditFrame->IsSymbolEditable() && !symEditFrame->IsSymbolAlias();
return symbolEditorFrame
&& symbolEditorFrame->GetCurSymbol()
&& symbolEditorFrame->GetCurSymbol()->IsMulti()
&& symbolEditorFrame->IsSymbolEditable()
&& !symbolEditorFrame->IsSymbolAlias();
};
auto& menu = m_menu.GetMenu();

View File

@ -678,7 +678,7 @@ void GERBVIEW_FRAME::DoWithAcceptedFiles()
{
wxString gerbFn; // param to be sent with action event.
for( auto file : m_AcceptedFiles )
for( const wxFileName& file : m_AcceptedFiles )
{
if( IsExtensionAccepted( file.GetExt(), { ArchiveFileExtension } ) )
{

View File

@ -419,7 +419,7 @@ void KICAD_MANAGER_FRAME::DoWithAcceptedFiles()
// All fileNames are now in m_AcceptedFiles vector.
// Check if contains a project file name and load project.
// If not, open files in dedicated app.
for( auto fileName : m_AcceptedFiles )
for( const wxFileName& fileName : m_AcceptedFiles )
{
if( IsExtensionAccepted( fileName.GetExt(),
{ ProjectFileExtension, LegacyProjectFileExtension } ) )

View File

@ -324,6 +324,6 @@ bool PL_EDITOR_FRAME::SaveDrawingSheetFile( const wxString& aFullFileName )
void PL_EDITOR_FRAME::DoWithAcceptedFiles()
{
for( wxFileName file : m_AcceptedFiles )
for( const wxFileName& file : m_AcceptedFiles )
OpenProjectFiles( { file.GetFullPath() }, KICTL_CREATE );
}