Fix a number of signed/unsigned comparisons
This commit is contained in:
parent
a5500973a2
commit
a02d8a5993
|
@ -241,7 +241,8 @@ void EDA_DRAW_FRAME::OnUpdateSelectGrid( wxUpdateUIEvent& aEvent )
|
|||
|
||||
int idx = config()->m_Window.grid.last_size_idx;
|
||||
|
||||
if( idx >= 0 && idx < m_gridSelectBox->GetCount() && idx != m_gridSelectBox->GetSelection() )
|
||||
if( idx >= 0 && idx < int( m_gridSelectBox->GetCount() )
|
||||
&& idx != m_gridSelectBox->GetSelection() )
|
||||
m_gridSelectBox->SetSelection( idx );
|
||||
}
|
||||
|
||||
|
@ -261,14 +262,14 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
|
|||
|
||||
int idx = m_gridSelectBox->GetCurrentSelection();
|
||||
|
||||
if( idx == m_gridSelectBox->GetCount() - 2 )
|
||||
if( idx == int( m_gridSelectBox->GetCount() ) - 2 )
|
||||
{
|
||||
// wxWidgets will check the separator, which we don't want.
|
||||
// Re-check the current grid.
|
||||
wxUpdateUIEvent dummy;
|
||||
OnUpdateSelectGrid( dummy );
|
||||
}
|
||||
else if( idx == m_gridSelectBox->GetCount() - 1 )
|
||||
else if( idx == int( m_gridSelectBox->GetCount() ) - 1 )
|
||||
{
|
||||
// wxWidgets will check the Grid Settings... entry, which we don't want.
|
||||
// Re-check the current grid.
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2014-2016 CERN
|
||||
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
@ -355,7 +356,7 @@ int COMMON_TOOLS::GridNext( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
int& currentGrid = m_toolMgr->GetSettings()->m_Window.grid.last_size_idx;
|
||||
|
||||
if( currentGrid + 1 < m_grids.size() )
|
||||
if( currentGrid + 1 < int( m_grids.size() ) )
|
||||
currentGrid++;
|
||||
|
||||
return OnGridChanged();
|
||||
|
|
|
@ -63,7 +63,7 @@ OPT_TOOL_EVENT GRID_MENU::eventHandler( const wxMenuEvent& aEvent )
|
|||
void GRID_MENU::update()
|
||||
{
|
||||
APP_SETTINGS_BASE* settings = m_parent->config();
|
||||
int current = settings->m_Window.grid.last_size_idx;
|
||||
unsigned int current = settings->m_Window.grid.last_size_idx;
|
||||
wxArrayString gridsList;
|
||||
|
||||
BuildChoiceList( &gridsList, settings, m_parent->GetUserUnits() != EDA_UNITS::INCHES );
|
||||
|
|
|
@ -60,7 +60,7 @@ bool DIALOG_SET_GRID::TransferDataToWindow()
|
|||
for( const wxString& grid : grids )
|
||||
m_choiceGridSize->Append( grid );
|
||||
|
||||
if( idx >= 0 && idx < m_choiceGridSize->GetCount() )
|
||||
if( idx >= 0 && idx < int( m_choiceGridSize->GetCount() ) )
|
||||
m_choiceGridSize->SetSelection( idx );
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue