Minor adjustments

This commit is contained in:
Dominik Wernberger 2020-12-20 19:50:45 +01:00 committed by Seth Hillbrand
parent ac94d72d2d
commit 07635d2fc7
21 changed files with 82 additions and 82 deletions

View File

@ -523,47 +523,47 @@ void EDA_TEXT::Format( OUTPUTFORMATTER* aFormatter, int aNestLevel, int aControl
// and does not define FormatInternalUnits, used here // and does not define FormatInternalUnits, used here
// however this function should exist // however this function should exist
aFormatter->Print( aNestLevel + 1, "(effects" ); aFormatter->Print( aNestLevel + 1, "(effects" );
// Text size // Text size
aFormatter->Print( 0, " (font" ); aFormatter->Print( 0, " (font" );
aFormatter->Print( 0, " (size %s %s)", aFormatter->Print( 0, " (size %s %s)",
FormatInternalUnits( GetTextHeight() ).c_str(), FormatInternalUnits( GetTextHeight() ).c_str(),
FormatInternalUnits( GetTextWidth() ).c_str() ); FormatInternalUnits( GetTextWidth() ).c_str() );
if( GetTextThickness() ) if( GetTextThickness() )
aFormatter->Print( 0, " (thickness %s)", FormatInternalUnits( GetTextThickness() ).c_str() ); aFormatter->Print( 0, " (thickness %s)", FormatInternalUnits( GetTextThickness() ).c_str() );
if( IsBold() ) if( IsBold() )
aFormatter->Print( 0, " bold" ); aFormatter->Print( 0, " bold" );
if( IsItalic() ) if( IsItalic() )
aFormatter->Print( 0, " italic" ); aFormatter->Print( 0, " italic" );
aFormatter->Print( 0, ")"); // (font aFormatter->Print( 0, ")"); // (font
if( IsMirrored() || if( IsMirrored() ||
GetHorizJustify() != GR_TEXT_HJUSTIFY_CENTER || GetHorizJustify() != GR_TEXT_HJUSTIFY_CENTER ||
GetVertJustify() != GR_TEXT_VJUSTIFY_CENTER ) GetVertJustify() != GR_TEXT_VJUSTIFY_CENTER )
{ {
aFormatter->Print( 0, " (justify"); aFormatter->Print( 0, " (justify");
if( GetHorizJustify() != GR_TEXT_HJUSTIFY_CENTER ) if( GetHorizJustify() != GR_TEXT_HJUSTIFY_CENTER )
aFormatter->Print( 0, (GetHorizJustify() == GR_TEXT_HJUSTIFY_LEFT) ? " left" : " right" ); aFormatter->Print( 0, (GetHorizJustify() == GR_TEXT_HJUSTIFY_LEFT) ? " left" : " right" );
if( GetVertJustify() != GR_TEXT_VJUSTIFY_CENTER ) if( GetVertJustify() != GR_TEXT_VJUSTIFY_CENTER )
aFormatter->Print( 0, (GetVertJustify() == GR_TEXT_VJUSTIFY_TOP) ? " top" : " bottom" ); aFormatter->Print( 0, (GetVertJustify() == GR_TEXT_VJUSTIFY_TOP) ? " top" : " bottom" );
if( IsMirrored() ) if( IsMirrored() )
aFormatter->Print( 0, " mirror" ); aFormatter->Print( 0, " mirror" );
aFormatter->Print( 0, ")" ); // (justify aFormatter->Print( 0, ")" ); // (justify
} }
if( !(aControlBits & CTL_OMIT_HIDE) && !IsVisible() ) if( !(aControlBits & CTL_OMIT_HIDE) && !IsVisible() )
aFormatter->Print( 0, " hide" ); aFormatter->Print( 0, " hide" );
aFormatter->Print( 0, ")\n" ); // (justify aFormatter->Print( 0, ")\n" ); // (justify
#endif #endif
} }

View File

@ -395,7 +395,7 @@ int OUTPUTFORMATTER::vprint( const char* fmt, va_list ap )
int OUTPUTFORMATTER::sprint( const char* fmt, ... ) int OUTPUTFORMATTER::sprint( const char* fmt, ... )
{ {
va_list args; va_list args;
va_start( args, fmt ); va_start( args, fmt );
int ret = vprint( fmt, args); int ret = vprint( fmt, args);
@ -416,7 +416,7 @@ int OUTPUTFORMATTER::Print( int nestLevel, const char* fmt, ... )
int result = 0; int result = 0;
int total = 0; int total = 0;
for( int i=0; i<nestLevel; ++i ) for( int i = 0; i < nestLevel; ++i )
{ {
// no error checking needed, an exception indicates an error. // no error checking needed, an exception indicates an error.
result = sprint( "%*c", NESTWIDTH, ' ' ); result = sprint( "%*c", NESTWIDTH, ' ' );
@ -438,11 +438,11 @@ std::string OUTPUTFORMATTER::Quotes( const std::string& aWrapee ) const
{ {
std::string ret; std::string ret;
ret.reserve( aWrapee.size()*2 + 2 ); ret.reserve( aWrapee.size() * 2 + 2 );
ret += '"'; ret += '"';
for( std::string::const_iterator it = aWrapee.begin(); it!=aWrapee.end(); ++it ) for( std::string::const_iterator it = aWrapee.begin(); it != aWrapee.end(); ++it )
{ {
switch( *it ) switch( *it )
{ {
@ -493,13 +493,13 @@ void STRING_FORMATTER::write( const char* aOutBuf, int aCount )
void STRING_FORMATTER::StripUseless() void STRING_FORMATTER::StripUseless()
{ {
std::string copy = m_mystring; std::string copy = m_mystring;
m_mystring.clear(); m_mystring.clear();
for( std::string::iterator i=copy.begin(); i!=copy.end(); ++i ) for( std::string::iterator i = copy.begin(); i != copy.end(); ++i )
{ {
if( !isspace( *i ) && *i!=')' && *i!='(' && *i!='"' ) if( !isspace( *i ) && *i != ')' && *i != '(' && *i != '"' )
{ {
m_mystring += *i; m_mystring += *i;
} }

View File

@ -135,7 +135,7 @@ public:
*/ */
SCH_COMPONENT( LIB_PART& aPart, LIB_ID aLibId, SCH_SHEET_PATH* aSheet, SCH_COMPONENT( LIB_PART& aPart, LIB_ID aLibId, SCH_SHEET_PATH* aSheet,
int unit = 0, int convert = 0, int unit = 0, int convert = 0,
const wxPoint& pos = wxPoint( 0, 0 ) ); const wxPoint& pos = wxPoint( 0, 0 ) );
SCH_COMPONENT( LIB_PART& aPart, SCH_SHEET_PATH* aSheet, PICKED_SYMBOL& aSel, SCH_COMPONENT( LIB_PART& aPart, SCH_SHEET_PATH* aSheet, PICKED_SYMBOL& aSel,
const wxPoint& pos = wxPoint( 0, 0 ) ); const wxPoint& pos = wxPoint( 0, 0 ) );
@ -186,7 +186,7 @@ public:
void SetLibId( const LIB_ID& aName ); void SetLibId( const LIB_ID& aName );
const LIB_ID& GetLibId() const { return m_lib_id; } const LIB_ID& GetLibId() const { return m_lib_id; }
/** /**
* The name of the symbol in the schematic library symbol list. * The name of the symbol in the schematic library symbol list.

View File

@ -61,4 +61,4 @@ protected:
void setDefaultLayerDeps(); ///> Sets rendering targets & dependencies for layers. void setDefaultLayerDeps(); ///> Sets rendering targets & dependencies for layers.
}; };
#endif #endif // __SCH_DRAW_PANEL_H

View File

@ -289,7 +289,7 @@ public:
* *
* @param aLayer The layer number. * @param aLayer The layer number.
*/ */
void SetLayer( SCH_LAYER_ID aLayer ) { m_layer = aLayer; } void SetLayer( SCH_LAYER_ID aLayer ) { m_layer = aLayer; }
/** /**
* Return the layers the item is drawn on (which may be more than its "home" layer) * Return the layers the item is drawn on (which may be more than its "home" layer)

View File

@ -254,7 +254,7 @@ float SCH_PAINTER::getShadowWidth() const
// For best visuals the selection width must be a cross between the zoom level and the // For best visuals the selection width must be a cross between the zoom level and the
// default line width. // default line width.
return (float) fabs( matrix.GetScale().x * 2.75 ) + Mils2iu( eeconfig()->m_Selection.thickness ); return (float) std::fabs( matrix.GetScale().x * 2.75 ) + Mils2iu( eeconfig()->m_Selection.thickness );
} }
@ -1682,7 +1682,7 @@ void SCH_PAINTER::draw( const SCH_SHEET *aSheet, int aLayer )
} }
} }
VECTOR2D pos = aSheet->GetPosition(); VECTOR2D pos = aSheet->GetPosition();
VECTOR2D size = aSheet->GetSize(); VECTOR2D size = aSheet->GetSize();
if( aLayer == LAYER_SHEET_BACKGROUND ) if( aLayer == LAYER_SHEET_BACKGROUND )

View File

@ -209,4 +209,4 @@ private:
}; // namespace KIGFX }; // namespace KIGFX
#endif #endif // __SCH_PAINTER_H

View File

@ -549,8 +549,8 @@ public:
bool CanConnect( const SCH_ITEM* aItem ) const override bool CanConnect( const SCH_ITEM* aItem ) const override
{ {
return ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_WIRE ) || return ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_WIRE ) ||
( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_BUS ) || ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_BUS ) ||
( aItem->Type() == SCH_NO_CONNECT_T ); ( aItem->Type() == SCH_NO_CONNECT_T );
} }
std::vector<wxPoint> GetConnectionPoints() const override; std::vector<wxPoint> GetConnectionPoints() const override;

View File

@ -87,7 +87,7 @@ void SCH_VIEW::ResizeSheetWorkingArea( const SCH_SCREEN* aScreen )
const PAGE_INFO& page_info = aScreen->GetPageSettings(); const PAGE_INFO& page_info = aScreen->GetPageSettings();
double max_size_x = page_info.GetWidthIU() * 3.0; double max_size_x = page_info.GetWidthIU() * 3.0;
double max_size_y = page_info.GetHeightIU() * 3.0; double max_size_y = page_info.GetHeightIU() * 3.0;
m_boundary.SetOrigin( -max_size_x/4, -max_size_y/4 ); m_boundary.SetOrigin( -max_size_x / 4, -max_size_y / 4 );
m_boundary.SetSize( max_size_x, max_size_y ); m_boundary.SetSize( max_size_x, max_size_y );
} }

View File

@ -297,7 +297,7 @@ public:
void TransformBoundingBoxWithClearanceToPolygon( SHAPE_POLY_SET* aCornerBuffer, void TransformBoundingBoxWithClearanceToPolygon( SHAPE_POLY_SET* aCornerBuffer,
int aClearanceValue ) const; int aClearanceValue ) const;
std::shared_ptr<SHAPE_COMPOUND> GetEffectiveTextShape( ) const; std::shared_ptr<SHAPE_COMPOUND> GetEffectiveTextShape() const;
/** /**
* Test if \a aPoint is within the bounds of this object. * Test if \a aPoint is within the bounds of this object.

View File

@ -398,7 +398,7 @@ private:
char quoteChar[2]; char quoteChar[2];
int sprint( const char* fmt, ... ); int sprint( const char* fmt, ... );
int vprint( const char* fmt, va_list ap ); int vprint( const char* fmt, va_list ap );
}; };

View File

@ -438,7 +438,7 @@ bool BOARD_STACKUP::SynchronizeWithBoard( BOARD_DESIGN_SETTINGS* aSettings )
} }
// Now initialize all stackup items to the initial values, when exist // Now initialize all stackup items to the initial values, when exist
for( BOARD_STACKUP_ITEM* item: stackup.GetList() ) for( BOARD_STACKUP_ITEM* item : stackup.GetList() )
{ {
bool found = false; bool found = false;
// Search for initial settings: // Search for initial settings:
@ -475,12 +475,12 @@ bool BOARD_STACKUP::SynchronizeWithBoard( BOARD_DESIGN_SETTINGS* aSettings )
} }
// Transfer other stackup settings from aSettings // Transfer other stackup settings from aSettings
BOARD_STACKUP& source_stackup = aSettings->GetStackupDescriptor(); const BOARD_STACKUP& source_stackup = aSettings->GetStackupDescriptor();
m_HasDielectricConstrains = source_stackup.m_HasDielectricConstrains; m_HasDielectricConstrains = source_stackup.m_HasDielectricConstrains;
m_EdgeConnectorConstraints = source_stackup.m_EdgeConnectorConstraints; m_EdgeConnectorConstraints = source_stackup.m_EdgeConnectorConstraints;
m_CastellatedPads = source_stackup.m_CastellatedPads; m_CastellatedPads = source_stackup.m_CastellatedPads;
m_EdgePlating = source_stackup.m_EdgePlating; m_EdgePlating = source_stackup.m_EdgePlating;
m_FinishType = source_stackup.m_FinishType; m_FinishType = source_stackup.m_FinishType;
*this = stackup; *this = stackup;
@ -608,8 +608,8 @@ void BOARD_STACKUP::BuildDefaultStackupList( const BOARD_DESIGN_SETTINGS* aSetti
const BOARD_STACKUP& source_stackup = aSettings->GetStackupDescriptor(); const BOARD_STACKUP& source_stackup = aSettings->GetStackupDescriptor();
m_EdgeConnectorConstraints = source_stackup.m_EdgeConnectorConstraints; m_EdgeConnectorConstraints = source_stackup.m_EdgeConnectorConstraints;
m_CastellatedPads = source_stackup.m_CastellatedPads; m_CastellatedPads = source_stackup.m_CastellatedPads;
m_EdgePlating = source_stackup.m_EdgePlating; m_EdgePlating = source_stackup.m_EdgePlating;
m_FinishType = source_stackup.m_FinishType; m_FinishType = source_stackup.m_FinishType;
} }
} }

View File

@ -168,7 +168,7 @@ public:
wxString FormatDielectricLayerName() const; wxString FormatDielectricLayerName() const;
// Getters: // Getters:
bool IsEnabled() const {return m_enabled; } bool IsEnabled() const { return m_enabled; }
BOARD_STACKUP_ITEM_TYPE GetType() const { return m_Type; } BOARD_STACKUP_ITEM_TYPE GetType() const { return m_Type; }
PCB_LAYER_ID GetBrdLayerId() const { return m_LayerId; } PCB_LAYER_ID GetBrdLayerId() const { return m_LayerId; }

View File

@ -175,9 +175,9 @@ private:
switch( aStack.m_shape ) switch( aStack.m_shape )
{ {
case PAD_SHAPE_CIRCLE: case PAD_SHAPE_CIRCLE:
case PAD_SHAPE_OVAL: shapeId = 0; break; case PAD_SHAPE_OVAL: shapeId = 0; break;
case PAD_SHAPE_ROUNDRECT: shapeId = 2; break; case PAD_SHAPE_ROUNDRECT: shapeId = 2; break;
case PAD_SHAPE_RECT: shapeId = 1; break; case PAD_SHAPE_RECT: shapeId = 1; break;
default: default:
shapeId = 0; shapeId = 0;

View File

@ -563,7 +563,7 @@ void GERBER_JOBFILE_WRITER::addJSONMaterialStackup()
m_json["MaterialStackup"] = nlohmann::ordered_json::array(); m_json["MaterialStackup"] = nlohmann::ordered_json::array();
// Build the candidates list: // Build the candidates list:
LSET maskLayer; LSET maskLayer;
BOARD_STACKUP brd_stackup = m_pcb->GetDesignSettings().GetStackupDescriptor(); BOARD_STACKUP brd_stackup = m_pcb->GetDesignSettings().GetStackupDescriptor();
// Ensure brd_stackup is up to date (i.e. no change made by SynchronizeWithBoard() ) // Ensure brd_stackup is up to date (i.e. no change made by SynchronizeWithBoard() )

View File

@ -279,7 +279,7 @@ FOOTPRINT& FOOTPRINT::operator=( FOOTPRINT&& aOther )
m_3D_Drawings.clear(); m_3D_Drawings.clear();
m_3D_Drawings = aOther.m_3D_Drawings; m_3D_Drawings = aOther.m_3D_Drawings;
m_doc = aOther.m_doc; m_doc = aOther.m_doc;
m_keywords = aOther.m_keywords; m_keywords = aOther.m_keywords;
m_properties = aOther.m_properties; m_properties = aOther.m_properties;
// Ensure auxiliary data is up to date // Ensure auxiliary data is up to date

View File

@ -48,8 +48,8 @@ public:
enum TEXT_TYPE enum TEXT_TYPE
{ {
TEXT_is_REFERENCE = 0, TEXT_is_REFERENCE = 0,
TEXT_is_VALUE = 1, TEXT_is_VALUE = 1,
TEXT_is_DIVERS = 2 TEXT_is_DIVERS = 2
}; };
FP_TEXT( FOOTPRINT* aParentFootprint, TEXT_TYPE text_type = TEXT_is_DIVERS ); FP_TEXT( FOOTPRINT* aParentFootprint, TEXT_TYPE text_type = TEXT_is_DIVERS );

View File

@ -556,7 +556,7 @@ void PCB_IO::formatBoardLayers( const BOARD* aBoard, int aNestLevel ) const
User_9 User_9
}; };
for( LSEQ seq = aBoard->GetEnabledLayers().Seq( non_cu, arrayDim( non_cu ) ); seq; ++seq ) for( LSEQ seq = aBoard->GetEnabledLayers().Seq( non_cu, arrayDim( non_cu ) ); seq; ++seq )
{ {
PCB_LAYER_ID layer = *seq; PCB_LAYER_ID layer = *seq;
@ -801,7 +801,7 @@ void PCB_IO::format( const PCB_SHAPE* aShape, int aNestLevel ) const
m_out->Print( aNestLevel, "(gr_poly (pts\n" ); m_out->Print( aNestLevel, "(gr_poly (pts\n" );
for( int ii = 0; ii < pointsCount; ++ii ) for( int ii = 0; ii < pointsCount; ++ii )
{ {
int nestLevel = 0; int nestLevel = 0;
@ -900,7 +900,7 @@ void PCB_IO::format( const FP_SHAPE* aFPShape, int aNestLevel ) const
m_out->Print( aNestLevel, "(fp_poly (pts" ); m_out->Print( aNestLevel, "(fp_poly (pts" );
for( int ii = 0; ii < pointsCount; ++ii ) for( int ii = 0; ii < pointsCount; ++ii )
{ {
int nestLevel = 0; int nestLevel = 0;
@ -986,8 +986,8 @@ void PCB_IO::format( const FOOTPRINT* aFootprint, int aNestLevel ) const
if( initial_comments ) if( initial_comments )
{ {
for( unsigned i=0; i<initial_comments->GetCount(); ++i ) for( unsigned i = 0; i < initial_comments->GetCount(); ++i )
m_out->Print( aNestLevel, "%s\n", TO_UTF8( (*initial_comments)[i] ) ); m_out->Print( aNestLevel, "%s\n", TO_UTF8( (*initial_comments)[i] ) );
m_out->Print( 0, "\n" ); // improve readability? m_out->Print( 0, "\n" ); // improve readability?
} }
@ -1177,7 +1177,7 @@ void PCB_IO::format( const FOOTPRINT* aFootprint, int aNestLevel ) const
void PCB_IO::formatLayers( LSET aLayerMask, int aNestLevel ) const void PCB_IO::formatLayers( LSET aLayerMask, int aNestLevel ) const
{ {
std::string output; std::string output;
if( aNestLevel == 0 ) if( aNestLevel == 0 )
output += ' '; output += ' ';
@ -1932,21 +1932,21 @@ void PCB_IO::format( const ZONE* aZone, int aNestLevel ) const
if( aZone->GetNumCorners() ) if( aZone->GetNumCorners() )
{ {
bool new_polygon = true; bool new_polygon = true;
bool is_closed = false; bool is_closed = false;
for( auto iterator = aZone->CIterateWithHoles(); iterator; ++iterator ) for( auto iterator = aZone->CIterateWithHoles(); iterator; ++iterator )
{ {
if( new_polygon ) if( new_polygon )
{ {
newLine = 0; newLine = 0;
m_out->Print( aNestLevel+1, "(polygon\n" ); m_out->Print( aNestLevel + 1, "(polygon\n" );
m_out->Print( aNestLevel+2, "(pts\n" ); m_out->Print( aNestLevel + 2, "(pts\n" );
new_polygon = false; new_polygon = false;
is_closed = false; is_closed = false;
} }
if( newLine == 0 ) if( newLine == 0 )
m_out->Print( aNestLevel+3, "(xy %s %s)", m_out->Print( aNestLevel + 3, "(xy %s %s)",
FormatInternalUnits( iterator->x ).c_str(), FormatInternalUnits( iterator->x ).c_str(),
FormatInternalUnits( iterator->y ).c_str() ); FormatInternalUnits( iterator->y ).c_str() );
else else
@ -1971,8 +1971,8 @@ void PCB_IO::format( const ZONE* aZone, int aNestLevel ) const
if( newLine != 0 ) if( newLine != 0 )
m_out->Print( 0, "\n" ); m_out->Print( 0, "\n" );
m_out->Print( aNestLevel+2, ")\n" ); m_out->Print( aNestLevel + 2, ")\n" );
m_out->Print( aNestLevel+1, ")\n" ); m_out->Print( aNestLevel + 1, ")\n" );
new_polygon = true; new_polygon = true;
} }
} }
@ -1982,8 +1982,8 @@ void PCB_IO::format( const ZONE* aZone, int aNestLevel ) const
if( newLine != 0 ) if( newLine != 0 )
m_out->Print( 0, "\n" ); m_out->Print( 0, "\n" );
m_out->Print( aNestLevel+2, ")\n" ); m_out->Print( aNestLevel + 2, ")\n" );
m_out->Print( aNestLevel+1, ")\n" ); m_out->Print( aNestLevel + 1, ")\n" );
} }
} }

View File

@ -1118,7 +1118,7 @@ void PCB_PARSER::parseBoardStackup()
int dielectric_idx = 1; // the index of dielectric layers int dielectric_idx = 1; // the index of dielectric layers
BOARD_STACKUP& stackup = m_board->GetDesignSettings().GetStackupDescriptor(); BOARD_STACKUP& stackup = m_board->GetDesignSettings().GetStackupDescriptor();
for( token = NextTok(); token != T_RIGHT; token = NextTok() ) for( token = NextTok(); token != T_RIGHT; token = NextTok() )
{ {
if( CurTok() != T_LEFT ) if( CurTok() != T_LEFT )
Expecting( T_LEFT ); Expecting( T_LEFT );
@ -2391,7 +2391,7 @@ PCB_TEXT* PCB_PARSER::parsePCB_TEXT()
Unexpected( CurText() ); Unexpected( CurText() );
} }
for( token = NextTok(); token != T_RIGHT; token = NextTok() ) for( token = NextTok(); token != T_RIGHT; token = NextTok() )
{ {
if( token != T_LEFT ) if( token != T_LEFT )
Expecting( T_LEFT ); Expecting( T_LEFT );

View File

@ -684,7 +684,7 @@ public:
/** /**
* Checks if a given filled polygon is an insulated island * Checks if a given filled polygon is an insulated island
* @param aLayer is the layer to test * @param aLayer is the layer to test
* @param aPolyIdx is an inndex into m_FilledPolysList[aLayer] * @param aPolyIdx is an index into m_FilledPolysList[aLayer]
* @return true if the given polygon is insulated (i.e. has no net connection) * @return true if the given polygon is insulated (i.e. has no net connection)
*/ */
bool IsIsland( PCB_LAYER_ID aLayer, int aPolyIdx ) const; bool IsIsland( PCB_LAYER_ID aLayer, int aPolyIdx ) const;

View File

@ -417,19 +417,19 @@ public:
bool Matches( double aDrillDia, double aPosX, double aPosY ) const; bool Matches( double aDrillDia, double aPosX, double aPosY ) const;
/** /**
* Function GettDrillDia * Function GetDrillDia
* returns the drill diameter in mm * returns the drill diameter in mm
*/ */
double GetDrillDia() const; double GetDrillDia() const;
/** /**
* Function GettDrillXPos * Function GetDrillXPos
* returns the drill's X position in mm * returns the drill's X position in mm
*/ */
double GetDrillXPos() const; double GetDrillXPos() const;
/** /**
* Function GettDrillYPos * Function GetDrillYPos
* returns the drill's Y position in mm * returns the drill's Y position in mm
*/ */
double GetDrillYPos() const; double GetDrillYPos() const;