diff --git a/src/BlockFile.cpp b/src/BlockFile.cpp index b56329302..ee423eff1 100644 --- a/src/BlockFile.cpp +++ b/src/BlockFile.cpp @@ -556,7 +556,7 @@ size_t BlockFile::CommonReadData( else { auto channels = info.channels; wxASSERT(channels >= 1); - wxASSERT(channel < (unsigned int)channels); + wxASSERT((int)channel < channels); if (channels == 1 && format == int16Sample && diff --git a/src/Envelope.cpp b/src/Envelope.cpp index 5750422df..2d702cb8a 100644 --- a/src/Envelope.cpp +++ b/src/Envelope.cpp @@ -77,14 +77,14 @@ bool Envelope::ConsistencyCheck() while ( nextI - ii > 2 ) { // too many coincident time values - if (ii == (size_t)mDragPoint || (int)(nextI - 1) == mDragPoint) + if ((int)ii == mDragPoint || (int)nextI - 1 == mDragPoint) // forgivable ; else { consistent = false; // repair it Delete( nextI - 2 ); - if (mDragPoint >= (int)(nextI - 2)) + if (mDragPoint >= (int)nextI - 2) --mDragPoint; --nextI, --count; // wxLogError @@ -731,7 +731,7 @@ void Envelope::CollapseRegion( double t0, double t1, double sampleDur ) auto len = mEnv.size(); for ( size_t i = begin; i < len; ++i ) { auto &point = mEnv[i]; - if (rightPoint && i == (size_t)begin) + if (rightPoint && (int)i == begin) // Avoid roundoff error. // Make exactly equal times of neighboring points so that we have // a real discontinuity. @@ -884,7 +884,7 @@ void Envelope::RemoveUnneededPoints // Stop at any discontinuity if ( index > 0 && isDiscontinuity( index - 1 ) ) break; - if ( (unsigned int)(index + 1) < len && isDiscontinuity( index ) ) + if ( (index + 1) < (int)len && isDiscontinuity( index ) ) break; if ( ! remove( index, false ) ) @@ -1627,7 +1627,7 @@ double Envelope::SolveIntegralOfInverse( double t0, double area ) const if(area == 0.0) return t0; - unsigned int count = mEnv.size(); + const auto count = mEnv.size(); if(count == 0) // 'empty' envelope return t0 + area * mDefaultValue; @@ -1655,7 +1655,7 @@ double Envelope::SolveIntegralOfInverse( double t0, double area ) const else if(t0 >= mEnv[count - 1].GetT()) // t0 at or following the last point { if (area < 0) { - i = count - 2; + i = (int)count - 2; lastT = mEnv[count - 1].GetT(); lastVal = mEnv[count - 1].GetVal(); double added = (lastT - t0) / lastVal; // negative diff --git a/src/Sequence.cpp b/src/Sequence.cpp index b7847fb72..0326dd922 100644 --- a/src/Sequence.cpp +++ b/src/Sequence.cpp @@ -1217,7 +1217,7 @@ void Sequence::SetSamples(samplePtr buffer, sampleFormat format, // but it guards against infinite loop in case of inconsistencies // (too-small files, not yet seen?) // that cause the loop to make no progress because blen == 0 - && (unsigned int)b < size + && b < (int)size ) { newBlock.push_back( mBlock[b] ); SeqBlock &block = newBlock.back(); diff --git a/src/TrackArtist.cpp b/src/TrackArtist.cpp index f15a131bc..79aac850d 100644 --- a/src/TrackArtist.cpp +++ b/src/TrackArtist.cpp @@ -2297,7 +2297,7 @@ void TrackArtist::DrawClipSpectrum(WaveTrackCache &waveTrackCache, #endif //EXPERIMENTAL_FFT_Y_GRID if (!updated && clip->mSpecPxCache->valid && - (clip->mSpecPxCache->len == (size_t)(hiddenMid.height * hiddenMid.width)) + ((int)clip->mSpecPxCache->len == hiddenMid.height * hiddenMid.width) && scaleType == clip->mSpecPxCache->scaleType && gain == clip->mSpecPxCache->gain && range == clip->mSpecPxCache->range diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index cffc29f87..8eec62ad6 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -914,7 +914,7 @@ void TrackPanel::HandleMotion auto begin = mTargets.begin(), end = mTargets.end(), iter = std::find(begin, end, oldHandle); if (iter != end) { - unsigned int newPosition = iter - begin; + size_t newPosition = iter - begin; if (newPosition <= oldPosition) mTarget = newPosition; // else, some NEW hit and this position takes priority diff --git a/src/WaveClip.cpp b/src/WaveClip.cpp index a6ee5d5bf..795b3cc31 100644 --- a/src/WaveClip.cpp +++ b/src/WaveClip.cpp @@ -133,12 +133,12 @@ public: //for some reason, the cache is set up to access up to array[len], not array[len-1] if(invalStart <0) invalStart =0; - else if((size_t)invalStart > len) + else if(invalStart > (long)len) invalStart = len; if(invalEnd <0) invalEnd =0; - else if((size_t)invalEnd > len) + else if(invalEnd > (long)len) invalEnd = len; @@ -153,13 +153,13 @@ public: { //if the regions intersect OR are pixel adjacent InvalidRegion ®ion = mRegions[i]; - if(region.start <= (size_t)(invalEnd+1) - && (region.end + 1) >= (size_t)invalStart) + if((long)region.start <= (invalEnd+1) + && ((long)region.end + 1) >= invalStart) { //take the union region - if(region.start > (size_t)invalStart) + if((long)region.start > invalStart) region.start = invalStart; - if((int)region.end < invalEnd) + if((long)region.end < invalEnd) region.end = invalEnd; added=true; break; @@ -206,7 +206,7 @@ public: } //if we are past the end of the region we added, we are past the area of regions that might be oversecting. - if(invalEnd < 0 || region.start > (size_t)invalEnd) + if(invalEnd < 0 || (long)region.start > invalEnd) { break; } @@ -842,7 +842,7 @@ bool SpecCache::CalculateOneSpectrum from = sampleCount( where[0].as_double() + xx * (rate / pixelsPerSecond) ); - else if ((size_t)xx > len) + else if (xx > (int)len) from = sampleCount( where[len].as_double() + (xx - len) * (rate / pixelsPerSecond) ); diff --git a/src/effects/ClickRemoval.cpp b/src/effects/ClickRemoval.cpp index f54927471..ecaa0eece 100644 --- a/src/effects/ClickRemoval.cpp +++ b/src/effects/ClickRemoval.cpp @@ -307,7 +307,7 @@ bool EffectClickRemoval::RemoveClicks(size_t len, float *buffer) left = i+s2; } } else { - if(left != 0 && (int)(i-left+s2) <= ww*2) { + if(left != 0 && ((int)i-left+s2) <= ww*2) { float lv = buffer[left]; float rv = buffer[i+ww+s2]; for(j=left; jGetBuffer(); - if (blockLen < (unsigned int)inSamples) { + if ((int)blockLen < inSamples) { if (channels > 1) { bytes = exporter.EncodeRemainder(mixed, blockLen, buffer.get()); } diff --git a/src/import/ImportFFmpeg.cpp b/src/import/ImportFFmpeg.cpp index bf737fae1..c044c8d13 100644 --- a/src/import/ImportFFmpeg.cpp +++ b/src/import/ImportFFmpeg.cpp @@ -743,7 +743,7 @@ ProgressResult FFmpegImportFileHandle::WriteData(streamContext *sc) unsigned int pos = 0; while (pos < insamples) { - for (size_t chn = 0; chn < (size_t)sc->m_stream->codec->channels; chn++) + for (size_t chn = 0; (int)chn < sc->m_stream->codec->channels; chn++) { if (chn < nChannels) { diff --git a/src/widgets/Meter.cpp b/src/widgets/Meter.cpp index c1c914ed7..9b8204459 100644 --- a/src/widgets/Meter.cpp +++ b/src/widgets/Meter.cpp @@ -133,13 +133,13 @@ void MeterUpdateQueue::Clear() // queue was full. bool MeterUpdateQueue::Put(MeterUpdateMsg &msg) { - // mStart cnan be greater than mEnd because it is all mod mBufferSize + // mStart can be greater than mEnd because it is all mod mBufferSize wxASSERT( (mEnd + mBufferSize - mStart) >= 0 ); int len = (mEnd + mBufferSize - mStart) % mBufferSize; // Never completely fill the queue, because then the // state is ambiguous (mStart==mEnd) - if (len >= (int)(mBufferSize-1)) + if (len + 1 >= (int)(mBufferSize)) return false; //wxLogDebug(wxT("Put: %s"), msg.toString());