Minor fixes: remove a few useless includes and move a few others to the right file. Remove a few coverity warnings about not initialized members.

Minor bug fix: Zone duplicate zone in legacy mode: duplicate a zone to the same layer (and therefore  the same location) is no more allowed.
This commit is contained in:
jean-pierre charras 2015-05-15 14:49:11 +02:00
parent c7b8f790a7
commit 77249d9b2d
19 changed files with 60 additions and 25 deletions

View File

@ -46,6 +46,7 @@
#error "Cannot resolve units formatting due to no definition of EESCHEMA or PCBNEW."
#endif
#include <convert_to_biu.h>
EDA_TEXT::EDA_TEXT( const wxString& text )
{

View File

@ -25,6 +25,7 @@
#include <pgm_base.h>
#include <common.h>
#include <config.h> // to define DEFAULT_INSTALL_PATH
/**

View File

@ -28,6 +28,7 @@
#include <common.h>
#include <search_stack.h>
#include <pgm_base.h>
#include <config.h> // to define DEFAULT_INSTALL_PATH
// put your best guesses in here, send the computer on a wild goose chase, its

View File

@ -39,7 +39,6 @@
#include <wx/fileconf.h>
#include <richio.h>
#include <convert_to_biu.h>
#include <colors.h>

View File

@ -31,7 +31,6 @@
#ifndef _CONVERT_FROM_IU_
#define _CONVERT_FROM_IU_
#include <config.h>
/// Convert from internal units to user units.
#if defined(PCBNEW) || defined(CVPCB) || defined(GERBVIEW)

View File

@ -25,8 +25,6 @@
#ifndef CONVERT_TO_BIU_H_
#define CONVERT_TO_BIU_H_
#include <config.h>
/**
* @file convert_to_biu.h
*/

View File

@ -850,7 +850,7 @@ void PCB_BASE_FRAME::updateZoomSelectBox()
void PCB_BASE_FRAME::SetFastGrid1()
{
if( m_FastGrid1 >= GetScreen()->GetGridCount() )
if( m_FastGrid1 >= (int)GetScreen()->GetGridCount() )
return;
int cmdId = GetScreen()->GetGrids()[m_FastGrid1].m_CmdId;
@ -869,7 +869,7 @@ void PCB_BASE_FRAME::SetFastGrid1()
void PCB_BASE_FRAME::SetFastGrid2()
{
if( m_FastGrid2 >= GetScreen()->GetGridCount() )
if( m_FastGrid2 >= (int)GetScreen()->GetGridCount() )
return;
int cmdId = GetScreen()->GetGrids()[m_FastGrid2].m_CmdId;

View File

@ -445,6 +445,14 @@ int ZONE_CONTAINER::GetThermalReliefCopperBridge( D_PAD* aPad ) const
}
void ZONE_CONTAINER::SetCornerRadius( unsigned int aRadius )
{
m_cornerRadius = aRadius;
if( m_cornerRadius > (unsigned int) Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS ) )
m_cornerRadius = Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS );
};
bool ZONE_CONTAINER::HitTest( const wxPoint& aPosition ) const
{
if( HitTestForCorner( aPosition ) >= 0 )

View File

@ -538,12 +538,7 @@ public:
int GetCornerSmoothingType() const { return m_cornerSmoothingType; };
void SetCornerRadius( unsigned int aRadius )
{
m_cornerRadius = aRadius;
if( m_cornerRadius > (unsigned int) Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS ) )
m_cornerRadius = Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS );
};
void SetCornerRadius( unsigned int aRadius );
unsigned int GetCornerRadius() const { return m_cornerRadius; };

View File

@ -29,7 +29,7 @@
#include <fctsys.h>
#include <common.h>
#include <convert_to_biu.h>
#include <pcbnew.h>
#include <zones.h>
@ -122,3 +122,14 @@ void ZONE_SETTINGS::ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport ) c
// using new parameters values
aTarget.Outline()->SetHatch( m_Zone_HatchingStyle, Mils2iu( 20 ), true );
}
void ZONE_SETTINGS::SetCornerRadius( int aRadius )
{
if( aRadius > Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS ) )
m_cornerRadius = Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS );
else if( aRadius < 0 )
m_cornerRadius = 0;
else
m_cornerRadius = aRadius;
};

View File

@ -121,15 +121,7 @@ public:
int GetCornerSmoothingType() const { return m_cornerSmoothingType; }
void SetCornerRadius( int aRadius )
{
if( aRadius > Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS ) )
m_cornerRadius = Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS );
else if( aRadius < 0 )
m_cornerRadius = 0;
else
m_cornerRadius = aRadius;
};
void SetCornerRadius( int aRadius );
unsigned int GetCornerRadius() const { return m_cornerRadius; }

View File

@ -37,8 +37,13 @@
#include <3d_struct.h>
#include <build_version.h>
// assumed default graphical line thickness: 10000 IU == 0.1mm
#define LINE_WIDTH (100000)
#ifndef PCBNEW
#define PCBNEW // needed to define the right value of Millimeter2iu(x)
#endif
#include <convert_to_biu.h> // to define Millimeter2iu(x)
// assumed default graphical line thickness: == 0.1mm
#define LINE_WIDTH (Millimeter2iu( 0.1 ))
/**
* Function idf_export_outline

View File

@ -31,6 +31,7 @@
#include <wx/config.h>
#include <common.h>
#include <convert_to_biu.h>
#include <pcad2kicad_common.h>

View File

@ -33,6 +33,7 @@
#include <hashtables.h>
#include <layers_id_colors_and_visibility.h> // LAYER_ID
#include <common.h> // KiROUND
#include <convert_to_biu.h> // IU_PER_MM
class BOARD;

View File

@ -41,6 +41,11 @@ PNS_DP_MEANDER_PLACER::PNS_DP_MEANDER_PLACER( PNS_ROUTER* aRouter ) :
{
m_world = NULL;
m_currentNode = NULL;
// Init temporary variables (do not leave uninitialized members)
m_initialSegment = NULL;
m_lastLength = 0;
m_lastStatus = TOO_SHORT;
}

View File

@ -45,6 +45,17 @@ PNS_LINE_PLACER::PNS_LINE_PLACER( PNS_ROUTER* aRouter ) :
m_shove = NULL;
m_currentNode = NULL;
m_idle = true;
// Init temporary variables (do not leave uninitialized members)
m_lastNode = NULL;
m_placingVia = false;
m_currentNet = 0;
m_currentLayer = 0;
m_currentMode = RM_MarkObstacles;
m_startItem = NULL;
m_chainedPlacement = false;
m_splitSeg = false;
m_orthoMode = false;
}

View File

@ -38,6 +38,11 @@ PNS_MEANDER_PLACER::PNS_MEANDER_PLACER( PNS_ROUTER* aRouter ) :
m_world = NULL;
m_currentNode = NULL;
m_originLine = NULL;
// Init temporary variables (do not leave uninitialized members)
m_initialSegment = NULL;
m_lastLength = 0;
m_lastStatus = TOO_SHORT;
}

View File

@ -36,6 +36,8 @@
PNS_MEANDER_SKEW_PLACER::PNS_MEANDER_SKEW_PLACER ( PNS_ROUTER* aRouter ) :
PNS_MEANDER_PLACER ( aRouter )
{
// Init temporary variables (do not leave uninitialized members)
m_coupledLength = 0;
}

View File

@ -129,7 +129,7 @@ void PCB_EDIT_FRAME::duplicateZone( wxDC* aDC, ZONE_CONTAINER* aZone )
{
DisplayError( this,
_( "The duplicated zone is on the same layer as the initial zone, which has no sense.\n"
"Please, chose an other layer for the new zone") );
"Please, choose an other layer for the new zone") );
success = false;
}