Browse Source

Fix a few coverity warnings

pull/16/head
jean-pierre charras 6 years ago
parent
commit
ad3c4b37ab
  1. 6
      common/gal/cairo/cairo_gal.cpp
  2. 5
      common/gal/opengl/opengl_gal.cpp
  3. 7
      utils/kicad2step/pcb/oce_utils.cpp

6
common/gal/cairo/cairo_gal.cpp

@ -2,7 +2,7 @@
* 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-2019 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2012-2020 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2017-2018 CERN
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
@ -67,6 +67,10 @@ CAIRO_GAL_BASE::CAIRO_GAL_BASE( GAL_DISPLAY_OPTIONS& aDisplayOptions ) :
// Grid color settings are different in Cairo and OpenGL
SetGridColor( COLOR4D( 0.1, 0.1, 0.1, 0.8 ) );
SetAxesColor( COLOR4D( BLUE ) );
// Avoid unitialized variables:
cairo_matrix_init_identity( &currentXform );
cairo_matrix_init_identity( &currentWorld2Screen );
}

5
common/gal/opengl/opengl_gal.cpp

@ -285,6 +285,11 @@ OPENGL_GAL::OPENGL_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions, wxWindow* aParent,
gluTessProperty( tesselator, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_POSITIVE );
SetTarget( TARGET_NONCACHED );
// Avoid unitialized variables:
ufm_worldPixelSize = 1;
ufm_screenPixelSize = 1;
ufm_pixelSizeMultiplier = 1;
}

7
utils/kicad2step/pcb/oce_utils.cpp

@ -735,12 +735,13 @@ bool PCBMODEL::CreatePCB()
}
std::list< KICADCURVE >::iterator sC = m_curves.begin();
std::list< KICADCURVE >::iterator eC = m_curves.end();
bool added = false;
while( sC != eC )
while( sC != m_curves.end() )
{
if( oln.AddSegment( *sC ) )
{
added = true;
m_curves.erase( sC );
break;
}
@ -748,7 +749,7 @@ bool PCBMODEL::CreatePCB()
++sC;
}
if( sC == eC && !oln.m_curves.empty() )
if( !added && !oln.m_curves.empty() )
{
std::ostringstream ostr;
#ifdef DEBUG

Loading…
Cancel
Save