Fix signed/unsigned comparison warnings.

This commit is contained in:
James Crook 2019-12-06 11:33:22 +00:00
parent 7f3c40eb43
commit 23f05c618c
7 changed files with 11 additions and 14 deletions

View File

@ -278,7 +278,7 @@ const wxArrayStringEx &EnumValueSymbols::GetInternals() const
//////////
const EnumValueSymbol &ChoiceSetting::Default() const
{
if ( mDefaultSymbol >= 0 && mDefaultSymbol < mSymbols.size() )
if ( mDefaultSymbol >= 0 && mDefaultSymbol < (long)mSymbols.size() )
return mSymbols[ mDefaultSymbol ];
static EnumValueSymbol empty;
return empty;
@ -399,9 +399,9 @@ void EnumSettingBase::Migrate( wxString &value )
// Audacity. But further changes will be stored only to the NEW key
// and won't be seen then.
auto index = (long) FindInt( intValue );
if ( index >= mSymbols.size() )
if ( index >= (long)mSymbols.size() )
index = mDefaultSymbol;
if ( index >= 0 && index < mSymbols.size() ) {
if ( index >= 0 && index < (long)mSymbols.size() ) {
value = mSymbols[index].Internal();
Write(value);
gPrefs->Flush();

View File

@ -1242,8 +1242,6 @@ void ProjectWindow::OnIconize(wxIconizeEvent &event)
// void return? I don't know.
mIconized = event.IsIconized();
unsigned int i;
// VisibileProjectCount seems to be just a counter for debugging.
// It's not used outside this function.
auto VisibleProjectCount = std::count_if(

View File

@ -395,7 +395,7 @@ wxChoice * ShuttleGuiBase::AddChoice( const wxString &Prompt,
#endif
#endif
pChoice->SetName(wxStripMenuCodes(Prompt));
if ( Selected >= 0 && Selected < choices.size() )
if ( Selected >= 0 && Selected < (int)choices.size() )
pChoice->SetSelection( Selected );
UpdateSizers();
@ -1499,7 +1499,7 @@ wxRadioButton * ShuttleGuiBase::TieRadioButton()
wxASSERT( mRadioCount >= 0); // Did you remember to use StartRadioButtonGroup() ?
EnumValueSymbol symbol;
if (mRadioCount >= 0 && mRadioCount < mRadioSymbols.size() )
if (mRadioCount >= 0 && mRadioCount < (int)mRadioSymbols.size() )
symbol = mRadioSymbols[ mRadioCount ];
// In what follows, WrappedRef is used in read only mode, but we
@ -1976,7 +1976,7 @@ wxChoice * ShuttleGuiBase::TieNumberAsChoice(
InternalChoices =
transform_container<wxArrayStringEx>(*pInternalChoices, fn);
else
for ( int ii = 0; ii < Choices.size(); ++ii )
for ( int ii = 0; ii < (int)Choices.size(); ++ii )
InternalChoices.push_back( fn( ii ) );
@ -1989,7 +1989,7 @@ wxChoice * ShuttleGuiBase::TieNumberAsChoice(
defaultIndex = make_iterator_range( *pInternalChoices ).index( Default );
else
defaultIndex = Default;
if ( defaultIndex < 0 || defaultIndex >= Choices.size() )
if ( defaultIndex < 0 || defaultIndex >= (int)Choices.size() )
defaultIndex = -1;
ChoiceSetting choiceSetting{

View File

@ -48,7 +48,6 @@ SoundActivatedRecordDialog::~SoundActivatedRecordDialog()
void SoundActivatedRecordDialog::PopulateOrExchange(ShuttleGui & S)
{
S.SetBorder(5);
int dBRange;
S.StartVerticalLay();
{

View File

@ -76,7 +76,7 @@ bool SetLabelCommand::Apply(const CommandContext & context)
for (auto lt : tracks.Any<LabelTrack>()) {
const auto &labels = lt->GetLabels();
const auto nLabels = labels.size();
if( ii >= nLabels )
if( ii >= (int)nLabels )
ii -= nLabels;
else {
labelTrack = lt;

View File

@ -844,7 +844,7 @@ void LabelTrackView::Draw(
void LabelTrackView::SetSelectedIndex( int index )
{
if ( index >= 0 && index < FindLabelTrack()->GetLabels().size() )
if ( index >= 0 && index < (int)FindLabelTrack()->GetLabels().size() )
mSelIndex = index;
else
mSelIndex = -1;

View File

@ -133,14 +133,14 @@ struct SubViewAdjuster
} );
auto index = iter - begin;
auto size = mPermutation.size();
if ( index < size ) {
if ( index < (int)size ) {
yy -= top;
if ( yy >= 0 && yy < HotZoneSize && index > 0 )
return { index, true }; // top hit
if ( yy < height && yy >= height - HotZoneSize &&
// Have not yet called ModifyPermutation; dragging bottom of
// bottommost view allowed only if at least one view is invisible
( index < size - 1 || mFirstSubView > 0 ) )
( index < (int)size - 1 || mFirstSubView > 0 ) )
return { index, false }; // bottom hit
}
return { size, false }; // not hit