Cleanup some compiler and Coverity warnings

This commit is contained in:
Ian McInerney 2020-11-15 21:41:38 +00:00
parent 1db15052b0
commit 8c08b861ab
3 changed files with 9 additions and 6 deletions

View File

@ -60,7 +60,7 @@ public:
};
private:
using drc_rtree = RTree<ITEM_WITH_SHAPE*, int, 2, double>;
public:
@ -113,7 +113,7 @@ public:
}
};
if( aItem->Type() == PCB_FP_TEXT_T && !dynamic_cast<FP_TEXT*>( aItem )->IsVisible() )
if( aItem->Type() == PCB_FP_TEXT_T && !static_cast<FP_TEXT*>( aItem )->IsVisible() )
return;
if( aLayer != UNDEFINED_LAYER )

View File

@ -2317,12 +2317,13 @@ void ALTIUM_PCB::ParseTexts6Data( const CFB::CompoundFileReader& aReader,
if( elem.component != ALTIUM_COMPONENT_NONE )
{
FP_TEXT* fpText = dynamic_cast<FP_TEXT*>( tx );
FOOTPRINT* parentFootprint = static_cast<FOOTPRINT*>( fpText->GetParent() );
FP_TEXT* fpText = dynamic_cast<FP_TEXT*>( tx );
if( fpText )
{
double orientation = parentFootprint->GetOrientation();
FOOTPRINT* parentFootprint = static_cast<FOOTPRINT*>( fpText->GetParent() );
double orientation = parentFootprint->GetOrientation();
fpText->SetTextAngle( fpText->GetTextAngle() - orientation );
fpText->SetLocalCoord();
}

View File

@ -2522,15 +2522,17 @@ void EAGLE_PLUGIN::mapEagleLayersToKicad()
{
std::vector<INPUT_LAYER_DESC> inputDescs;
for ( const std::pair<int, ELAYER>& layerPair : m_eagleLayers )
for ( const std::pair<const int, ELAYER>& layerPair : m_eagleLayers )
{
const ELAYER& eLayer = layerPair.second;
INPUT_LAYER_DESC layerDesc;
std::tie( layerDesc.AutoMapLayer, layerDesc.PermittedLayers, layerDesc.Required ) =
defaultKicadLayer( eLayer.number );
if( layerDesc.AutoMapLayer == UNDEFINED_LAYER )
continue; // Ignore unused copper layers
layerDesc.Name = eLayer.name;
inputDescs.push_back( layerDesc );