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
// however this function should exist
aFormatter->Print( aNestLevel + 1, "(effects" );
aFormatter->Print( aNestLevel + 1, "(effects" );
// Text size
aFormatter->Print( 0, " (font" );
// Text size
aFormatter->Print( 0, " (font" );
aFormatter->Print( 0, " (size %s %s)",
FormatInternalUnits( GetTextHeight() ).c_str(),
FormatInternalUnits( GetTextWidth() ).c_str() );
aFormatter->Print( 0, " (size %s %s)",
FormatInternalUnits( GetTextHeight() ).c_str(),
FormatInternalUnits( GetTextWidth() ).c_str() );
if( GetTextThickness() )
aFormatter->Print( 0, " (thickness %s)", FormatInternalUnits( GetTextThickness() ).c_str() );
if( GetTextThickness() )
aFormatter->Print( 0, " (thickness %s)", FormatInternalUnits( GetTextThickness() ).c_str() );
if( IsBold() )
aFormatter->Print( 0, " bold" );
if( IsBold() )
aFormatter->Print( 0, " bold" );
if( IsItalic() )
aFormatter->Print( 0, " italic" );
if( IsItalic() )
aFormatter->Print( 0, " italic" );
aFormatter->Print( 0, ")"); // (font
aFormatter->Print( 0, ")"); // (font
if( IsMirrored() ||
GetHorizJustify() != GR_TEXT_HJUSTIFY_CENTER ||
GetVertJustify() != GR_TEXT_VJUSTIFY_CENTER )
{
aFormatter->Print( 0, " (justify");
if( IsMirrored() ||
GetHorizJustify() != GR_TEXT_HJUSTIFY_CENTER ||
GetVertJustify() != GR_TEXT_VJUSTIFY_CENTER )
{
aFormatter->Print( 0, " (justify");
if( GetHorizJustify() != GR_TEXT_HJUSTIFY_CENTER )
aFormatter->Print( 0, (GetHorizJustify() == GR_TEXT_HJUSTIFY_LEFT) ? " left" : " right" );
if( GetHorizJustify() != GR_TEXT_HJUSTIFY_CENTER )
aFormatter->Print( 0, (GetHorizJustify() == GR_TEXT_HJUSTIFY_LEFT) ? " left" : " right" );
if( GetVertJustify() != GR_TEXT_VJUSTIFY_CENTER )
aFormatter->Print( 0, (GetVertJustify() == GR_TEXT_VJUSTIFY_TOP) ? " top" : " bottom" );
if( GetVertJustify() != GR_TEXT_VJUSTIFY_CENTER )
aFormatter->Print( 0, (GetVertJustify() == GR_TEXT_VJUSTIFY_TOP) ? " top" : " bottom" );
if( IsMirrored() )
aFormatter->Print( 0, " mirror" );
aFormatter->Print( 0, ")" ); // (justify
}
if( IsMirrored() )
aFormatter->Print( 0, " mirror" );
aFormatter->Print( 0, ")" ); // (justify
}
if( !(aControlBits & CTL_OMIT_HIDE) && !IsVisible() )
aFormatter->Print( 0, " hide" );
if( !(aControlBits & CTL_OMIT_HIDE) && !IsVisible() )
aFormatter->Print( 0, " hide" );
aFormatter->Print( 0, ")\n" ); // (justify
aFormatter->Print( 0, ")\n" ); // (justify
#endif
}

View File

@ -395,7 +395,7 @@ int OUTPUTFORMATTER::vprint( const char* fmt, va_list ap )
int OUTPUTFORMATTER::sprint( const char* fmt, ... )
{
va_list args;
va_list args;
va_start( args, fmt );
int ret = vprint( fmt, args);
@ -416,7 +416,7 @@ int OUTPUTFORMATTER::Print( int nestLevel, const char* fmt, ... )
int result = 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.
result = sprint( "%*c", NESTWIDTH, ' ' );
@ -438,11 +438,11 @@ std::string OUTPUTFORMATTER::Quotes( const std::string& aWrapee ) const
{
std::string ret;
ret.reserve( aWrapee.size()*2 + 2 );
ret.reserve( aWrapee.size() * 2 + 2 );
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 )
{
@ -493,13 +493,13 @@ void STRING_FORMATTER::write( const char* aOutBuf, int aCount )
void STRING_FORMATTER::StripUseless()
{
std::string copy = m_mystring;
std::string copy = m_mystring;
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;
}

View File

@ -135,7 +135,7 @@ public:
*/
SCH_COMPONENT( LIB_PART& aPart, LIB_ID aLibId, SCH_SHEET_PATH* aSheet,
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,
const wxPoint& pos = wxPoint( 0, 0 ) );
@ -186,7 +186,7 @@ public:
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.

View File

@ -61,4 +61,4 @@ protected:
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.
*/
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)

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
// 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();
if( aLayer == LAYER_SHEET_BACKGROUND )

View File

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

View File

@ -549,8 +549,8 @@ public:
bool CanConnect( const SCH_ITEM* aItem ) const override
{
return ( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_WIRE ) ||
( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_BUS ) ||
( aItem->Type() == SCH_NO_CONNECT_T );
( aItem->Type() == SCH_LINE_T && aItem->GetLayer() == LAYER_BUS ) ||
( aItem->Type() == SCH_NO_CONNECT_T );
}
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();
double max_size_x = page_info.GetWidthIU() * 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 );
}

View File

@ -297,7 +297,7 @@ public:
void TransformBoundingBoxWithClearanceToPolygon( SHAPE_POLY_SET* aCornerBuffer,
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.

View File

@ -398,7 +398,7 @@ private:
char quoteChar[2];
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
for( BOARD_STACKUP_ITEM* item: stackup.GetList() )
for( BOARD_STACKUP_ITEM* item : stackup.GetList() )
{
bool found = false;
// Search for initial settings:
@ -475,12 +475,12 @@ bool BOARD_STACKUP::SynchronizeWithBoard( BOARD_DESIGN_SETTINGS* aSettings )
}
// Transfer other stackup settings from aSettings
BOARD_STACKUP& source_stackup = aSettings->GetStackupDescriptor();
m_HasDielectricConstrains = source_stackup.m_HasDielectricConstrains;
const BOARD_STACKUP& source_stackup = aSettings->GetStackupDescriptor();
m_HasDielectricConstrains = source_stackup.m_HasDielectricConstrains;
m_EdgeConnectorConstraints = source_stackup.m_EdgeConnectorConstraints;
m_CastellatedPads = source_stackup.m_CastellatedPads;
m_EdgePlating = source_stackup.m_EdgePlating;
m_FinishType = source_stackup.m_FinishType;
m_EdgePlating = source_stackup.m_EdgePlating;
m_FinishType = source_stackup.m_FinishType;
*this = stackup;
@ -608,8 +608,8 @@ void BOARD_STACKUP::BuildDefaultStackupList( const BOARD_DESIGN_SETTINGS* aSetti
const BOARD_STACKUP& source_stackup = aSettings->GetStackupDescriptor();
m_EdgeConnectorConstraints = source_stackup.m_EdgeConnectorConstraints;
m_CastellatedPads = source_stackup.m_CastellatedPads;
m_EdgePlating = source_stackup.m_EdgePlating;
m_FinishType = source_stackup.m_FinishType;
m_EdgePlating = source_stackup.m_EdgePlating;
m_FinishType = source_stackup.m_FinishType;
}
}

View File

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

View File

@ -175,9 +175,9 @@ private:
switch( aStack.m_shape )
{
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_RECT: shapeId = 1; break;
case PAD_SHAPE_RECT: shapeId = 1; break;
default:
shapeId = 0;

View File

@ -563,7 +563,7 @@ void GERBER_JOBFILE_WRITER::addJSONMaterialStackup()
m_json["MaterialStackup"] = nlohmann::ordered_json::array();
// Build the candidates list:
LSET maskLayer;
LSET maskLayer;
BOARD_STACKUP brd_stackup = m_pcb->GetDesignSettings().GetStackupDescriptor();
// 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 = aOther.m_3D_Drawings;
m_doc = aOther.m_doc;
m_keywords = aOther.m_keywords;
m_keywords = aOther.m_keywords;
m_properties = aOther.m_properties;
// Ensure auxiliary data is up to date

View File

@ -48,8 +48,8 @@ public:
enum TEXT_TYPE
{
TEXT_is_REFERENCE = 0,
TEXT_is_VALUE = 1,
TEXT_is_DIVERS = 2
TEXT_is_VALUE = 1,
TEXT_is_DIVERS = 2
};
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
};
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;
@ -801,7 +801,7 @@ void PCB_IO::format( const PCB_SHAPE* aShape, int aNestLevel ) const
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;
@ -900,7 +900,7 @@ void PCB_IO::format( const FP_SHAPE* aFPShape, int aNestLevel ) const
m_out->Print( aNestLevel, "(fp_poly (pts" );
for( int ii = 0; ii < pointsCount; ++ii )
for( int ii = 0; ii < pointsCount; ++ii )
{
int nestLevel = 0;
@ -986,8 +986,8 @@ void PCB_IO::format( const FOOTPRINT* aFootprint, int aNestLevel ) const
if( initial_comments )
{
for( unsigned i=0; i<initial_comments->GetCount(); ++i )
m_out->Print( aNestLevel, "%s\n", TO_UTF8( (*initial_comments)[i] ) );
for( unsigned i = 0; i < initial_comments->GetCount(); ++i )
m_out->Print( aNestLevel, "%s\n", TO_UTF8( (*initial_comments)[i] ) );
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
{
std::string output;
std::string output;
if( aNestLevel == 0 )
output += ' ';
@ -1932,21 +1932,21 @@ void PCB_IO::format( const ZONE* aZone, int aNestLevel ) const
if( aZone->GetNumCorners() )
{
bool new_polygon = true;
bool is_closed = false;
bool is_closed = false;
for( auto iterator = aZone->CIterateWithHoles(); iterator; ++iterator )
{
if( new_polygon )
{
newLine = 0;
m_out->Print( aNestLevel+1, "(polygon\n" );
m_out->Print( aNestLevel+2, "(pts\n" );
m_out->Print( aNestLevel + 1, "(polygon\n" );
m_out->Print( aNestLevel + 2, "(pts\n" );
new_polygon = false;
is_closed = false;
}
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->y ).c_str() );
else
@ -1971,8 +1971,8 @@ void PCB_IO::format( const ZONE* aZone, int aNestLevel ) const
if( newLine != 0 )
m_out->Print( 0, "\n" );
m_out->Print( aNestLevel+2, ")\n" );
m_out->Print( aNestLevel+1, ")\n" );
m_out->Print( aNestLevel + 2, ")\n" );
m_out->Print( aNestLevel + 1, ")\n" );
new_polygon = true;
}
}
@ -1982,8 +1982,8 @@ void PCB_IO::format( const ZONE* aZone, int aNestLevel ) const
if( newLine != 0 )
m_out->Print( 0, "\n" );
m_out->Print( aNestLevel+2, ")\n" );
m_out->Print( aNestLevel+1, ")\n" );
m_out->Print( aNestLevel + 2, ")\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
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 )
Expecting( T_LEFT );
@ -2391,7 +2391,7 @@ PCB_TEXT* PCB_PARSER::parsePCB_TEXT()
Unexpected( CurText() );
}
for( token = NextTok(); token != T_RIGHT; token = NextTok() )
for( token = NextTok(); token != T_RIGHT; token = NextTok() )
{
if( token != T_LEFT )
Expecting( T_LEFT );

View File

@ -684,7 +684,7 @@ public:
/**
* Checks if a given filled polygon is an insulated island
* @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)
*/
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;
/**
* Function GettDrillDia
* Function GetDrillDia
* returns the drill diameter in mm
*/
double GetDrillDia() const;
/**
* Function GettDrillXPos
* Function GetDrillXPos
* returns the drill's X position in mm
*/
double GetDrillXPos() const;
/**
* Function GettDrillYPos
* Function GetDrillYPos
* returns the drill's Y position in mm
*/
double GetDrillYPos() const;