mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-16 06:03:49 +01:00
Re-fix some warnings about mixing signed and unsigned better...
... Assuming that large unsigned magnitudes with high order bit set are not the problem, but signed negatives of small magnitude may be: 1) Always cast the unsigned to signed in comparisons, not the other way. Also: 2) Cast unsigned TERM to signed by itself, before subtracting. Don't cast the result. 3) Rewrite some comparisons by moving subtracted term to other side. See commitsd2fe7b1757f463eda36c
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user