From a94a481574c943cc031841b60cc96f097d9f67cf Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Tue, 23 Mar 2021 19:46:49 +0000 Subject: [PATCH] Fix compile warnings Some simple warnings and also a deprecation warning from wx because they felt that a function should be renamed... --- common/build_version.cpp | 4 ++++ common/dialog_about/AboutDialog_main.cpp | 7 ++++++- pcbnew/pcb_expr_evaluator.cpp | 18 +++++++++--------- pcbnew/tools/zone_create_helper.cpp | 1 - 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/common/build_version.cpp b/common/build_version.cpp index c05fc41c8c..200db246fe 100644 --- a/common/build_version.cpp +++ b/common/build_version.cpp @@ -108,7 +108,11 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief ) aMsg << eol; aMsg << "Platform: " << wxGetOsDescription() << ", " +#if wxCHECK_VERSION( 3, 1, 5 ) + << platform.GetBitnessName() << ", " +#else << platform.GetArchName() << ", " +#endif << platform.GetEndiannessName() << ", " << platform.GetPortIdName(); diff --git a/common/dialog_about/AboutDialog_main.cpp b/common/dialog_about/AboutDialog_main.cpp index 9ace5a9fdb..80f5aa7643 100644 --- a/common/dialog_about/AboutDialog_main.cpp +++ b/common/dialog_about/AboutDialog_main.cpp @@ -99,7 +99,12 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf wxPlatformInfo platformInfo; - libVersion << "Platform: " << wxGetOsDescription() << ", " << platformInfo.GetArchName(); + libVersion << "Platform: " << wxGetOsDescription() << ", " +#if wxCHECK_VERSION( 3, 1, 5 ) + << platformInfo.GetBitnessName(); +#else + << platformInfo.GetArchName(); +#endif aInfo.SetLibVersion( libVersion ); diff --git a/pcbnew/pcb_expr_evaluator.cpp b/pcbnew/pcb_expr_evaluator.cpp index fecb65202b..75e3691b1f 100644 --- a/pcbnew/pcb_expr_evaluator.cpp +++ b/pcbnew/pcb_expr_evaluator.cpp @@ -213,10 +213,10 @@ static void insideCourtyard( LIBEVAL::CONTEXT* aCtx, void* self ) if( i != board->m_InsideCourtyardCache.end() ) return i->second; - bool result = insideFootprintCourtyard( item, itemBBox, shape, context, footprint ); + bool res = insideFootprintCourtyard( item, itemBBox, shape, context, footprint ); - board->m_InsideCourtyardCache[ key ] = result; - return result; + board->m_InsideCourtyardCache[ key ] = res; + return res; }; if( arg->AsString() == "A" ) @@ -290,11 +290,11 @@ static void insideFrontCourtyard( LIBEVAL::CONTEXT* aCtx, void* self ) if( i != board->m_InsideFCourtyardCache.end() ) return i->second; - bool result = insideFootprintCourtyard( item, itemBBox, shape, context, footprint, + bool res = insideFootprintCourtyard( item, itemBBox, shape, context, footprint, F_Cu ); - board->m_InsideFCourtyardCache[ key ] = result; - return result; + board->m_InsideFCourtyardCache[ key ] = res; + return res; }; if( arg->AsString() == "A" ) @@ -368,11 +368,11 @@ static void insideBackCourtyard( LIBEVAL::CONTEXT* aCtx, void* self ) if( i != board->m_InsideBCourtyardCache.end() ) return i->second; - bool result = insideFootprintCourtyard( item, itemBBox, shape, context, footprint, + bool res = insideFootprintCourtyard( item, itemBBox, shape, context, footprint, B_Cu ); - board->m_InsideBCourtyardCache[ key ] = result; - return result; + board->m_InsideBCourtyardCache[ key ] = res; + return res; }; if( arg->AsString() == "A" ) diff --git a/pcbnew/tools/zone_create_helper.cpp b/pcbnew/tools/zone_create_helper.cpp index 5179750d4c..0d4ae76dab 100644 --- a/pcbnew/tools/zone_create_helper.cpp +++ b/pcbnew/tools/zone_create_helper.cpp @@ -136,7 +136,6 @@ std::unique_ptr ZONE_CREATE_HELPER::createZoneFromExisting( const ZONE& aS void ZONE_CREATE_HELPER::performZoneCutout( ZONE& aZone, const ZONE& aCutout ) { BOARD_COMMIT commit( &m_tool ); - BOARD* board = m_tool.getModel(); std::vector newZones; // Clear the selection before removing the old zone