Fix a few Coverity warnings

This commit is contained in:
jean-pierre charras 2020-10-03 12:47:41 +02:00
parent bda275de46
commit e76736b7bf
4 changed files with 19 additions and 8 deletions

View File

@ -60,6 +60,11 @@ GERBER_PLOTTER::GERBER_PLOTTER()
m_gerberUnitFmt = 6; m_gerberUnitFmt = 6;
m_useX2format = true; m_useX2format = true;
m_useNetAttributes = true; m_useNetAttributes = true;
m_hasApertureRoundRect = false; // true is at least one round rect aperture is in use
m_hasApertureRotOval = false; // true is at least one oval rotated aperture is in use
m_hasApertureRotRect = false; // true is at least one rect. rotated aperture is in use
m_hasApertureOutline = false; // true is at least one rotated rect/trapezoid aperture is in use
} }
@ -71,10 +76,6 @@ void GERBER_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
plotOffset = aOffset; plotOffset = aOffset;
wxASSERT( aScale == 1 ); // aScale parameter is not used in Gerber wxASSERT( aScale == 1 ); // aScale parameter is not used in Gerber
plotScale = 1; // Plot scale is *always* 1.0 plotScale = 1; // Plot scale is *always* 1.0
m_hasApertureRoundRect = false; // true is at least one round rect aperture is in use
m_hasApertureRotOval = false; // true is at least one oval rotated aperture is in use
m_hasApertureRotRect = false; // true is at least one rect. rotated aperture is in use
m_hasApertureOutline = false; // true is at least one rotated rect/trapezoid aperture is in use
m_IUsPerDecimil = aIusPerDecimil; m_IUsPerDecimil = aIusPerDecimil;
// gives now a default value to iuPerDeviceUnit (because the units of the caller is now known) // gives now a default value to iuPerDeviceUnit (because the units of the caller is now known)
@ -184,6 +185,11 @@ void GERBER_PLOTTER::formatNetAttribute( GBR_NETLIST_METADATA* aData )
bool GERBER_PLOTTER::StartPlot() bool GERBER_PLOTTER::StartPlot()
{ {
m_hasApertureRoundRect = false; // true is at least one round rect aperture is in use
m_hasApertureRotOval = false; // true is at least one oval rotated aperture is in use
m_hasApertureRotRect = false; // true is at least one rect. rotated aperture is in use
m_hasApertureOutline = false; // true is at least one rotated rect/trapezoid aperture is in use
wxASSERT( outputFile ); wxASSERT( outputFile );
finalFile = outputFile; // the actual gerber file will be created later finalFile = outputFile; // the actual gerber file will be created later

View File

@ -37,6 +37,8 @@ SCH_IREF::SCH_IREF( const wxPoint& pos, const wxString& text, SCH_GLOBALLABEL* a
m_Layer = LAYER_GLOBLABEL; m_Layer = LAYER_GLOBLABEL;
m_parent = aParent; m_parent = aParent;
SetMultilineAllowed( false ); SetMultilineAllowed( false );
m_ownPageNumber = 0;
m_screen = nullptr;
} }

View File

@ -692,6 +692,7 @@ ORTHOGONAL_DIMENSION::ORTHOGONAL_DIMENSION( BOARD_ITEM* aParent ) :
{ {
// To preserve look of old dimensions, initialize extension height based on default arrow length // To preserve look of old dimensions, initialize extension height based on default arrow length
m_extensionHeight = static_cast<int>( m_arrowLength * std::sin( DEG2RAD( s_arrowAngle ) ) ); m_extensionHeight = static_cast<int>( m_arrowLength * std::sin( DEG2RAD( s_arrowAngle ) ) );
m_orientation = DIR::HORIZONTAL;
} }

View File

@ -51,7 +51,9 @@ namespace test {
class DRC_TEST_PROVIDER_SILK_TO_PAD : public ::DRC_TEST_PROVIDER class DRC_TEST_PROVIDER_SILK_TO_PAD : public ::DRC_TEST_PROVIDER
{ {
public: public:
DRC_TEST_PROVIDER_SILK_TO_PAD () DRC_TEST_PROVIDER_SILK_TO_PAD ():
m_board( nullptr ),
m_largestClearance( 0 )
{ {
} }