From cdad02336d270d04406f06ead4a04ac55364dfc1 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 5 Dec 2017 18:02:53 +0100 Subject: [PATCH] fix minor compil warnings --- common/geometry/shape_poly_set.cpp | 2 +- common/md5_hash.cpp | 2 +- pcbnew/zone_filler.cpp | 12 ++++-------- pcbnew/zones_test_and_combine_areas.cpp | 3 +++ polygon/poly2tri/common/shapes.h | 2 +- polygon/poly2tri/sweep/sweep.cc | 2 +- .../test_polygon_triangulation.cpp | 16 ++++++++-------- 7 files changed, 19 insertions(+), 20 deletions(-) diff --git a/common/geometry/shape_poly_set.cpp b/common/geometry/shape_poly_set.cpp index a6ad767133..c11cf047cf 100644 --- a/common/geometry/shape_poly_set.cpp +++ b/common/geometry/shape_poly_set.cpp @@ -1946,7 +1946,7 @@ void SHAPE_POLY_SET::triangulateSingle( const POLYGON& aPoly, std::unique_ptr cdt( new p2t::CDT( outline ) ); - for( int i = 1; i < aPoly.size(); i++ ) + for( unsigned i = 1; i < aPoly.size(); i++ ) { std::vector hole; diff --git a/common/md5_hash.cpp b/common/md5_hash.cpp index 24acb2e742..0c9f650b8b 100644 --- a/common/md5_hash.cpp +++ b/common/md5_hash.cpp @@ -194,7 +194,7 @@ void MD5_HASH::md5_init(MD5_CTX *ctx) void MD5_HASH::md5_update(MD5_CTX *ctx, uint8_t data[], uint32_t len) { - uint32_t t,i; + uint32_t i; for (i=0; i < len; ++i) { ctx->data[ctx->datalen] = data[i]; diff --git a/pcbnew/zone_filler.cpp b/pcbnew/zone_filler.cpp index 4de16427f4..d5b509e980 100644 --- a/pcbnew/zone_filler.cpp +++ b/pcbnew/zone_filler.cpp @@ -97,8 +97,6 @@ void ZONE_FILLER::Fill( std::vector aZones ) // Remove segment zones m_board->m_Zone.DeleteAll(); - int ii; - for( auto zone : aZones ) { // Keepout zones are not filled @@ -110,9 +108,7 @@ void ZONE_FILLER::Fill( std::vector aZones ) toFill.push_back( l ); } - int zoneCount = m_board->GetAreaCount(); - - for( int i = 0; i < toFill.size(); i++ ) + for( unsigned i = 0; i < toFill.size(); i++ ) { if( m_commit ) { @@ -142,7 +138,7 @@ void ZONE_FILLER::Fill( std::vector aZones ) #ifdef USE_OPENMP #pragma omp for schedule(dynamic) #endif - for( int i = 0; i < toFill.size(); i++ ) + for( unsigned i = 0; i < toFill.size(); i++ ) { SHAPE_POLY_SET rawPolys, finalPolys; ZONE_SEGMENT_FILL segFill; @@ -204,7 +200,7 @@ void ZONE_FILLER::Fill( std::vector aZones ) #ifdef USE_OPENMP #pragma omp for schedule(dynamic) #endif - for( int i = 0; i < toFill.size(); i++ ) + for( unsigned i = 0; i < toFill.size(); i++ ) { if( m_progressReporter ) { @@ -228,7 +224,7 @@ void ZONE_FILLER::Fill( std::vector aZones ) } else { - for( int i = 0; i < toFill.size(); i++ ) + for( unsigned i = 0; i < toFill.size(); i++ ) { connectivity->Update( toFill[i].m_zone ); } diff --git a/pcbnew/zones_test_and_combine_areas.cpp b/pcbnew/zones_test_and_combine_areas.cpp index 729f18142f..a7eaeddc3c 100644 --- a/pcbnew/zones_test_and_combine_areas.cpp +++ b/pcbnew/zones_test_and_combine_areas.cpp @@ -53,7 +53,10 @@ bool BOARD::OnAreaPolygonModified( PICKED_ITEMS_LIST* aModifiedZonesList, bool modified = NormalizeAreaPolygon( aModifiedZonesList, modified_area ); // now see if we need to clip against other areas + /* LAYER_NUM layer = modified_area->GetLayer(); + */ + bool bCheckAllAreas = TestAreaIntersections( modified_area ); if( bCheckAllAreas ) diff --git a/polygon/poly2tri/common/shapes.h b/polygon/poly2tri/common/shapes.h index 8c19d91ef8..89b7458d0e 100644 --- a/polygon/poly2tri/common/shapes.h +++ b/polygon/poly2tri/common/shapes.h @@ -57,7 +57,7 @@ struct Point { std::vector edge_list; /// Construct using coordinates. - Point(double x, double y) : x(x), y(y) {} + Point(double ax, double ay) : x(ax), y(ay) {} /// Set this point to all zeros. void set_zero() diff --git a/polygon/poly2tri/sweep/sweep.cc b/polygon/poly2tri/sweep/sweep.cc index f8e89bb5fd..28e91fd527 100644 --- a/polygon/poly2tri/sweep/sweep.cc +++ b/polygon/poly2tri/sweep/sweep.cc @@ -789,7 +789,7 @@ void Sweep::FlipScanEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle& Sweep::~Sweep() { // Clean up memory - for(int i = 0; i < nodes_.size(); i++) { + for(unsigned i = 0; i < nodes_.size(); i++) { delete nodes_[i]; } diff --git a/qa/polygon_triangulation/test_polygon_triangulation.cpp b/qa/polygon_triangulation/test_polygon_triangulation.cpp index 2f85aa4ce8..c23af207dd 100644 --- a/qa/polygon_triangulation/test_polygon_triangulation.cpp +++ b/qa/polygon_triangulation/test_polygon_triangulation.cpp @@ -217,27 +217,27 @@ BOARD* loadBoard( const std::string& filename ) return brd; } -int main(int argc, char *argv[]) +int main( int argc, char *argv[] ) { - auto brd = loadBoard( argc > 1 ? argv[1] : "../../../../tests/dp.kicad_pcb"); + auto brd = loadBoard( argc > 1 ? argv[1] : "../../../../tests/dp.kicad_pcb" ); - if(!brd) - return -1; + if( !brd ) + return -1; - PROF_COUNTER cnt("allBoard"); + PROF_COUNTER cnt( "allBoard" ); #pragma omp parallel for schedule(dynamic) - for( int z = 0; zGetAreaCount(); z++) + for( int z = 0; zGetAreaCount(); z++ ) { - auto zone = brd->GetArea(z); + auto zone = brd->GetArea( z ); SHAPE_POLY_SET poly = zone->GetFilledPolysList(); poly.CacheTriangulation(); (void) poly; - printf("zone %d/%d\n", (z+1), brd->GetAreaCount() ); + printf("zone %d/%d\n", ( z+1 ), brd->GetAreaCount() ); #if 0 PROF_COUNTER unfrac("unfrac"); poly.Unfracture( SHAPE_POLY_SET::PM_FAST );