FIxed a few clang warnings.
This commit is contained in:
parent
5d8f7ba0e6
commit
e6a10faab7
|
@ -242,7 +242,6 @@ set( COMMON_SRCS
|
|||
geometry/seg.cpp
|
||||
geometry/shape_line_chain.cpp
|
||||
geometry/shape_collisions.cpp
|
||||
geometry/shape_index.cpp
|
||||
)
|
||||
add_library( common STATIC ${COMMON_SRCS} )
|
||||
add_dependencies( common lib-dependencies )
|
||||
|
|
|
@ -157,10 +157,10 @@ void GAL::DrawGrid()
|
|||
assert( gridEndY >= gridStartY );
|
||||
|
||||
// Correct the index, else some lines are not correctly painted
|
||||
gridStartX -= abs( gridOrigin.x / gridSize.x ) + 1;
|
||||
gridStartY -= abs( gridOrigin.y / gridSize.y ) + 1;
|
||||
gridEndX += abs( gridOrigin.x / gridSize.x ) + 1;
|
||||
gridEndY += abs( gridOrigin.y / gridSize.y ) + 1;
|
||||
gridStartX -= std::abs( gridOrigin.x / gridSize.x ) + 1;
|
||||
gridStartY -= std::abs( gridOrigin.y / gridSize.y ) + 1;
|
||||
gridEndX += std::abs( gridOrigin.x / gridSize.x ) + 1;
|
||||
gridEndY += std::abs( gridOrigin.y / gridSize.y ) + 1;
|
||||
|
||||
// Draw the grid behind all other layers
|
||||
SetLayerDepth( depthRange.y * 0.75 );
|
||||
|
|
|
@ -137,12 +137,9 @@ static inline bool Collide( const SHAPE_CIRCLE& aA, const SHAPE_LINE_CHAIN& aB,
|
|||
bool aNeedMTV, VECTOR2I& aMTV )
|
||||
{
|
||||
bool found = false;
|
||||
VECTOR2I::extended_type clSq = (VECTOR2I::extended_type) aClearance * aClearance;
|
||||
|
||||
|
||||
for( int s = 0; s < aB.SegmentCount(); s++ )
|
||||
{
|
||||
|
||||
if( aA.Collide( aB.CSegment( s ), aClearance ) )
|
||||
{
|
||||
found = true;
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2013 CERN
|
||||
* @author Jacobo Aragunde Pérez
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <geometry/shape_index.h>
|
||||
|
||||
template <>
|
||||
const SHAPE* shapeFunctor( SHAPE* aItem )
|
||||
{
|
||||
return aItem;
|
||||
}
|
|
@ -138,7 +138,7 @@ void WX_VIEW_CONTROLS::onWheel( wxMouseEvent& aEvent )
|
|||
( (double) aEvent.GetWheelRotation() * wheelPanSpeed );
|
||||
double scrollSpeed;
|
||||
|
||||
if( abs( scrollVec.x ) > abs( scrollVec.y ) )
|
||||
if( std::abs( scrollVec.x ) > std::abs( scrollVec.y ) )
|
||||
scrollSpeed = scrollVec.x;
|
||||
else
|
||||
scrollSpeed = scrollVec.y;
|
||||
|
|
|
@ -344,7 +344,7 @@ inline int SEG::LineDistance( const VECTOR2I& aP, bool aDetermineSide ) const
|
|||
|
||||
ecoord dist = ( p * aP.x + q * aP.y + r ) / sqrt( p * p + q * q );
|
||||
|
||||
return aDetermineSide ? dist : abs( dist );
|
||||
return aDetermineSide ? dist : std::abs( dist );
|
||||
}
|
||||
|
||||
inline SEG::ecoord SEG::TCoef( const VECTOR2I& aP ) const
|
||||
|
|
|
@ -46,13 +46,6 @@ static const SHAPE* shapeFunctor( T aItem )
|
|||
return aItem->Shape();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* shapeFunctor template function: specialization for T = SHAPE*
|
||||
*/
|
||||
template <>
|
||||
const SHAPE* shapeFunctor( SHAPE* aItem );
|
||||
|
||||
/**
|
||||
* boundingBox template method
|
||||
*
|
||||
|
@ -68,7 +61,6 @@ BOX2I boundingBox( T aObject )
|
|||
return shapeFunctor( aObject )->BBox();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* acceptVisitor template method
|
||||
*
|
||||
|
@ -84,7 +76,6 @@ void acceptVisitor( T aObject, V aVisitor )
|
|||
aVisitor( aObject );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* collide template method
|
||||
*
|
||||
|
|
|
@ -446,9 +446,9 @@ void DIALOG_CREATE_ARRAY::ARRAY_GRID_OPTIONS::TransformItem( int n, BOARD_ITEM*
|
|||
point.x = coords.x * m_delta.x + coords.y * m_offset.x;
|
||||
point.y = coords.y * m_delta.y + coords.x * m_offset.y;
|
||||
|
||||
if( abs( m_stagger ) > 1 )
|
||||
if( std::abs( m_stagger ) > 1 )
|
||||
{
|
||||
const int stagger = abs( m_stagger );
|
||||
const int stagger = std::abs( m_stagger );
|
||||
const bool sr = m_stagger_rows;
|
||||
const int stagger_idx = ( ( sr ? coords.y : coords.x ) % stagger );
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ void LENGTH_TUNER_TOOL::updateStatusPopup( PNS_TUNE_STATUS_POPUP& aPopup )
|
|||
p.x += 20;
|
||||
p.y += 20;
|
||||
|
||||
aPopup.Update( m_router );
|
||||
aPopup.UpdateStatus( m_router );
|
||||
aPopup.Move( p );
|
||||
}
|
||||
|
||||
|
@ -207,7 +207,6 @@ void LENGTH_TUNER_TOOL::performTuning()
|
|||
end = evt->Position();
|
||||
m_router->Move( end, NULL );
|
||||
updateStatusPopup( statusPopup );
|
||||
|
||||
}
|
||||
else if( evt->IsClick( BUT_LEFT ) )
|
||||
{
|
||||
|
|
|
@ -332,7 +332,7 @@ bool PNS_DP_GATEWAYS::FitGateways( PNS_DP_GATEWAYS& aEntry, PNS_DP_GATEWAYS& aTa
|
|||
|
||||
int bestScore = -1000;
|
||||
DP_CANDIDATE best;
|
||||
bool found;
|
||||
bool found = false;
|
||||
|
||||
BOOST_FOREACH( DP_CANDIDATE c, candidates )
|
||||
{
|
||||
|
|
|
@ -362,9 +362,6 @@ private:
|
|||
///> routing "tail": part of the track that has been already fixed due to collisions with obstacles
|
||||
PNS_LINE m_tail;
|
||||
|
||||
///> current algorithm iteration
|
||||
int m_iteration;
|
||||
|
||||
///> pointer to world to search colliding items
|
||||
PNS_NODE* m_world;
|
||||
|
||||
|
@ -385,20 +382,9 @@ private:
|
|||
///> Are we placing a via?
|
||||
bool m_placingVia;
|
||||
|
||||
///> current via diameter
|
||||
int m_viaDiameter;
|
||||
|
||||
///> current via drill
|
||||
int m_viaDrill;
|
||||
|
||||
///> current track width
|
||||
int m_currentWidth;
|
||||
|
||||
int m_currentNet;
|
||||
int m_currentLayer;
|
||||
|
||||
bool m_startsOnVia;
|
||||
|
||||
VECTOR2I m_currentEnd, m_currentStart;
|
||||
PNS_LINE m_currentTrace;
|
||||
|
||||
|
|
|
@ -335,7 +335,6 @@ void PNS_ROUTER::SyncWorld()
|
|||
}
|
||||
|
||||
|
||||
|
||||
PNS_ROUTER::PNS_ROUTER()
|
||||
{
|
||||
theRouter = this;
|
||||
|
@ -947,7 +946,7 @@ void PNS_ROUTER::DumpLog()
|
|||
bool PNS_ROUTER::IsPlacingVia() const
|
||||
{
|
||||
if( !m_placer )
|
||||
return NULL;
|
||||
return false;
|
||||
|
||||
return m_placer->IsPlacingVia();
|
||||
}
|
||||
|
|
|
@ -161,7 +161,6 @@ private:
|
|||
int m_iter;
|
||||
int m_forceClearance;
|
||||
bool m_multiLineMode;
|
||||
bool m_headModified;
|
||||
};
|
||||
|
||||
#endif // __PNS_SHOVE_H
|
||||
|
|
|
@ -36,7 +36,7 @@ PNS_TUNE_STATUS_POPUP::~PNS_TUNE_STATUS_POPUP()
|
|||
}
|
||||
|
||||
|
||||
void PNS_TUNE_STATUS_POPUP::Update( PNS_ROUTER* aRouter )
|
||||
void PNS_TUNE_STATUS_POPUP::UpdateStatus( PNS_ROUTER* aRouter )
|
||||
{
|
||||
PNS_MEANDER_PLACER_BASE* placer = dynamic_cast<PNS_MEANDER_PLACER_BASE*>( aRouter->Placer() );
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
PNS_TUNE_STATUS_POPUP( PCB_EDIT_FRAME* aParent );
|
||||
~PNS_TUNE_STATUS_POPUP();
|
||||
|
||||
void Update( PNS_ROUTER* aRouter );
|
||||
void UpdateStatus( PNS_ROUTER* aRouter );
|
||||
|
||||
private:
|
||||
wxStaticText* m_statusLine;
|
||||
|
|
Loading…
Reference in New Issue