Fix compil and Coverity warnings

This commit is contained in:
jean-pierre charras 2023-01-22 09:40:09 +01:00
parent 86c12d35b4
commit e900e472ce
3 changed files with 12 additions and 11 deletions

View File

@ -2,7 +2,7 @@
* This program source code file is part of KICAD, a free EDA CAD application. * This program source code file is part of KICAD, a free EDA CAD application.
* *
* Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de * Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
* Copyright (C) 2012-2021 Kicad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2012-2023 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2013-2017 CERN * Copyright (C) 2013-2017 CERN
* @author Maciej Suminski <maciej.suminski@cern.ch> * @author Maciej Suminski <maciej.suminski@cern.ch>
* *
@ -337,6 +337,7 @@ OPENGL_GAL::OPENGL_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions, wxWindow* aParent,
ufm_screenPixelSize = 1; ufm_screenPixelSize = 1;
ufm_pixelSizeMultiplier = 1; ufm_pixelSizeMultiplier = 1;
ufm_antialiasingOffset = 1; ufm_antialiasingOffset = 1;
m_swapInterval = 0;
} }

View File

@ -2708,13 +2708,13 @@ void SCH_ALTIUM_PLUGIN::ParseWire( const std::map<wxString, wxString>& aProperti
void SCH_ALTIUM_PLUGIN::ParseJunction( const std::map<wxString, wxString>& aProperties ) void SCH_ALTIUM_PLUGIN::ParseJunction( const std::map<wxString, wxString>& aProperties )
{ {
SCH_SCREEN* screen = getCurrentScreen();
wxCHECK( screen, /* void */ );
ASCH_JUNCTION elem( aProperties ); ASCH_JUNCTION elem( aProperties );
SCH_JUNCTION* junction = new SCH_JUNCTION( elem.location + m_sheetOffset ); SCH_JUNCTION* junction = new SCH_JUNCTION( elem.location + m_sheetOffset );
SCH_SCREEN* screen = getCurrentScreen();
wxCHECK( screen, /* void */ );
junction->SetFlags( IS_NEW ); junction->SetFlags( IS_NEW );
screen->Append( junction ); screen->Append( junction );
} }

View File

@ -269,10 +269,10 @@ int SYMBOL_EDITOR_EDIT_TOOL::DoDelete( const TOOL_EVENT& aEvent )
{ {
if( item->Type() == LIB_PIN_T ) if( item->Type() == LIB_PIN_T )
{ {
LIB_PIN* pin = static_cast<LIB_PIN*>( item ); LIB_PIN* curr_pin = static_cast<LIB_PIN*>( item );
VECTOR2I pos = pin->GetPosition(); VECTOR2I pos = curr_pin->GetPosition();
toDelete.insert( pin ); toDelete.insert( curr_pin );
// when pin editing is synchronized, pins in the same position, with the same name // when pin editing is synchronized, pins in the same position, with the same name
// in different units are also removed. But only one pin per unit (matching) // in different units are also removed. But only one pin per unit (matching)
@ -280,11 +280,11 @@ int SYMBOL_EDITOR_EDIT_TOOL::DoDelete( const TOOL_EVENT& aEvent )
{ {
std::vector<bool> got_unit( symbol->GetUnitCount() + 1 ); std::vector<bool> got_unit( symbol->GetUnitCount() + 1 );
got_unit[pin->GetUnit()] = true; got_unit[curr_pin->GetUnit()] = true;
int curr_convert = pin->GetConvert(); int curr_convert = curr_pin->GetConvert();
ELECTRICAL_PINTYPE etype = pin->GetType(); ELECTRICAL_PINTYPE etype = curr_pin->GetType();
wxString name = pin->GetName(); wxString name = curr_pin->GetName();
std::vector<LIB_PIN*> pins = symbol->GetAllLibPins(); std::vector<LIB_PIN*> pins = symbol->GetAllLibPins();
for( LIB_PIN* pin : pins ) for( LIB_PIN* pin : pins )