From b3aa8a0c49b1c392e8771ab89fe218e8bf527c82 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 26 Aug 2023 09:40:09 +0200 Subject: [PATCH] Fix a few (minor) compil warnings. --- eeschema/dialogs/panel_setup_pinmap.cpp | 6 +++--- eeschema/widgets/search_handlers.h | 2 +- pcbnew/footprint_viewer_frame.cpp | 6 +++--- pcbnew/widgets/search_handlers.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/eeschema/dialogs/panel_setup_pinmap.cpp b/eeschema/dialogs/panel_setup_pinmap.cpp index 8a2f60181a..c10acb383b 100644 --- a/eeschema/dialogs/panel_setup_pinmap.cpp +++ b/eeschema/dialogs/panel_setup_pinmap.cpp @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -250,8 +250,8 @@ void PANEL_SETUP_PINMAP::changeErrorLevel( wxCommandEvent& event ) { int id = event.GetId(); int ii = id - ID_MATRIX_0; - int x = ii / ELECTRICAL_PINTYPES_TOTAL; - int y = ii % ELECTRICAL_PINTYPES_TOTAL; + ELECTRICAL_PINTYPE x = static_cast( ii / ELECTRICAL_PINTYPES_TOTAL ); + ELECTRICAL_PINTYPE y = static_cast( ii % ELECTRICAL_PINTYPES_TOTAL ); wxWindow* butt = static_cast( event.GetEventObject() ); int level = static_cast( m_schematic->ErcSettings().GetPinMapValue( y, x ) ); diff --git a/eeschema/widgets/search_handlers.h b/eeschema/widgets/search_handlers.h index e17aa9f10d..a89a86a2af 100644 --- a/eeschema/widgets/search_handlers.h +++ b/eeschema/widgets/search_handlers.h @@ -48,7 +48,7 @@ public: wxString GetResultCell( int aRow, int aCol ) override { - if( aRow >= m_hitlist.size() ) + if( aRow >= static_cast( m_hitlist.size() ) ) return wxEmptyString; const SCH_SEARCH_HIT& hit = m_hitlist[aRow]; diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index c5b151a793..1031f29d86 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -1063,7 +1063,7 @@ bool FOOTPRINT_VIEWER_FRAME::ShowModal( wxString* aFootprint, wxWindow* aParent if( fpid.IsValid() ) { wxString libraryName = fpid.GetLibNickname(); - wxHyperlinkCtrl* button; + wxHyperlinkCtrl* button = nullptr; if( !fpTable->HasLibrary( fpid.GetLibNickname(), false ) || !fpTable->HasLibrary( fpid.GetLibNickname(), true ) ) @@ -1073,12 +1073,12 @@ bool FOOTPRINT_VIEWER_FRAME::ShowModal( wxString* aFootprint, wxWindow* aParent if( WX_INFOBAR* infobar = GetInfoBar() ) { button = new wxHyperlinkCtrl( infobar, wxID_ANY, - _( "Manage symol libraries" ), + _( "Manage symol libraries" ), wxEmptyString ); button->Bind( wxEVT_COMMAND_HYPERLINK, std::function( [=]( wxHyperlinkEvent& aEvent ) { - InvokePcbLibTableEditor( &Kiway(), this ); + InvokePcbLibTableEditor( &Kiway(), this ); } ) ); } } diff --git a/pcbnew/widgets/search_handlers.h b/pcbnew/widgets/search_handlers.h index ff88a1d7de..49ac0c99ba 100644 --- a/pcbnew/widgets/search_handlers.h +++ b/pcbnew/widgets/search_handlers.h @@ -39,7 +39,7 @@ public: wxString GetResultCell( int aRow, int aCol ) override { - if( aRow >= m_hitlist.size() ) + if( aRow >= static_cast(m_hitlist.size() ) ) return wxEmptyString; BOARD_ITEM* item = m_hitlist[aRow];