From 5433684d3c4491d475fb59e6ed8066989c0ad0c5 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 23 Dec 2021 23:59:48 +0000 Subject: [PATCH] Try to make gcc happy. --- pcbnew/drc/drc_engine.cpp | 80 --------------------------------------- 1 file changed, 80 deletions(-) diff --git a/pcbnew/drc/drc_engine.cpp b/pcbnew/drc/drc_engine.cpp index c279e42d7f..2f95712ba0 100644 --- a/pcbnew/drc/drc_engine.cpp +++ b/pcbnew/drc/drc_engine.cpp @@ -475,86 +475,6 @@ void DRC_ENGINE::loadImplicitRules() } -static wxString formatConstraint( const DRC_CONSTRAINT& constraint ) -{ - struct FORMATTER - { - DRC_CONSTRAINT_T type; - wxString name; - std::function formatter; - }; - - auto formatMinMax = - []( const DRC_CONSTRAINT& c ) -> wxString - { - wxString str; - const auto value = c.GetValue(); - - if ( value.HasMin() ) - str += wxString::Format( " min: %d", value.Min() ); - - if ( value.HasOpt() ) - str += wxString::Format( " opt: %d", value.Opt() ); - - if ( value.HasMax() ) - str += wxString::Format( " max: %d", value.Max() ); - - return str; - }; - - auto formatMin = - []( const DRC_CONSTRAINT& c ) -> wxString - { - wxString str; - const auto value = c.GetValue(); - - if ( value.HasMin() ) - str += wxString::Format( " min: %d", value.Min() ); - - return str; - }; - - std::vector formats = - { - { CLEARANCE_CONSTRAINT, "clearance", formatMinMax }, - { HOLE_CLEARANCE_CONSTRAINT, "hole_clearance", formatMinMax }, - { HOLE_TO_HOLE_CONSTRAINT, "hole_to_hole", formatMinMax }, - { EDGE_CLEARANCE_CONSTRAINT, "edge_clearance", formatMinMax }, - { HOLE_SIZE_CONSTRAINT, "hole_size", formatMinMax }, - { COURTYARD_CLEARANCE_CONSTRAINT, "courtyard_clearance", formatMinMax }, - { SILK_CLEARANCE_CONSTRAINT, "silk_clearance", formatMinMax }, - { TEXT_HEIGHT_CONSTRAINT, "text_height", formatMinMax }, - { TEXT_THICKNESS_CONSTRAINT, "text_thickness", formatMinMax }, - { TRACK_WIDTH_CONSTRAINT, "track_width", formatMinMax }, - { ANNULAR_WIDTH_CONSTRAINT, "annular_width", formatMinMax }, - { ZONE_CONNECTION_CONSTRAINT, "zone_connection", nullptr }, - { THERMAL_RELIEF_GAP_CONSTRAINT, "thermal_relief_gap", formatMinMax }, - { THERMAL_SPOKE_WIDTH_CONSTRAINT, "thermal_spoke_width", formatMinMax }, - { MIN_RESOLVED_SPOKES_CONSTRAINT, "min_resolved_spokes", formatMin }, - { DISALLOW_CONSTRAINT, "disallow", nullptr }, - { VIA_DIAMETER_CONSTRAINT, "via_diameter", formatMinMax }, - { LENGTH_CONSTRAINT, "length", formatMinMax }, - { SKEW_CONSTRAINT, "skew", formatMinMax }, - { VIA_COUNT_CONSTRAINT, "via_count", formatMinMax } - }; - - for( FORMATTER& fmt : formats ) - { - if( fmt.type == constraint.m_Type ) - { - wxString rv = fmt.name + " "; - - if( fmt.formatter ) - rv += fmt.formatter( constraint ); - - return rv; - } - } - - return "?"; -} - - void DRC_ENGINE::loadRules( const wxFileName& aPath ) { if( aPath.FileExists() )