Coverity fixes.

This commit is contained in:
Jeff Young 2022-01-02 13:20:59 +00:00
parent 89c0f8e297
commit 0365c6bf4b
2 changed files with 13 additions and 7 deletions

View File

@ -36,8 +36,9 @@ void STROKE_PARAMS::Stroke( const SHAPE* aShape, PLOT_DASH_TYPE aLineStyle, int
const KIGFX::RENDER_SETTINGS* aRenderSettings,
std::function<void( const VECTOR2I& a, const VECTOR2I& b )> aStroker )
{
double strokes[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
int wrapAround = 0;
double strokes[6] = { aWidth * 1.0, aWidth * 1.0, aWidth * 1.0, aWidth * 1.0, aWidth * 1.0,
aWidth * 1.0 };
int wrapAround = 6;
switch( aLineStyle )
{

View File

@ -21,6 +21,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <macros.h>
#include <pcb_text.h>
#include <fp_text.h>
#include <drc/drc_engine.h>
@ -105,8 +106,10 @@ bool DRC_TEST_PROVIDER_TEXT_DIMS::Run()
wxASSERT( item->Type() == PCB_TEXT_T || item->Type() == PCB_FP_TEXT_T );
int actualH = 0, actualT = 0;
bool visible;
DRC_CONSTRAINT constraint;
int actualH = 0;
int actualT = 0;
bool visible = false;
if( item->Type() == PCB_TEXT_T )
{
@ -115,15 +118,17 @@ bool DRC_TEST_PROVIDER_TEXT_DIMS::Run()
actualH = textItem->GetTextHeight();
actualT = textItem->GetTextThickness();
}
else if ( item->Type() == PCB_FP_TEXT_T )
else if( item->Type() == PCB_FP_TEXT_T )
{
FP_TEXT* fpTextItem = static_cast<FP_TEXT*>( item );
visible = fpTextItem->IsVisible();
actualH = fpTextItem->GetTextHeight();
actualT = fpTextItem->GetTextThickness();
}
DRC_CONSTRAINT constraint;
else
{
UNIMPLEMENTED_FOR( item->GetClass() );
}
if( !visible )
return true;