mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 11:49:02 +08:00
Fix signed-unsigned return in RuqQueue
This commit is contained in:
parent
f0d42d2265
commit
7b837559a7
@ -208,7 +208,7 @@ class RunQueue {
|
|||||||
return CalculateSize(front, back);
|
return CalculateSize(front, back);
|
||||||
} else {
|
} else {
|
||||||
// This value will be 0 if the queue is empty, and undefined otherwise.
|
// This value will be 0 if the queue is empty, and undefined otherwise.
|
||||||
int maybe_zero = ((front ^ back) & kMask2);
|
unsigned maybe_zero = ((front ^ back) & kMask2);
|
||||||
eigen_assert(maybe_zero == 0 ? CalculateSize(front, back) == 0 : true);
|
eigen_assert(maybe_zero == 0 ? CalculateSize(front, back) == 0 : true);
|
||||||
return maybe_zero;
|
return maybe_zero;
|
||||||
}
|
}
|
||||||
@ -225,7 +225,7 @@ class RunQueue {
|
|||||||
// increment size before the corresponding pop has decremented it.
|
// increment size before the corresponding pop has decremented it.
|
||||||
// So the computed size can be up to kSize + 1, fix it.
|
// So the computed size can be up to kSize + 1, fix it.
|
||||||
if (size > static_cast<int>(kSize)) size = kSize;
|
if (size > static_cast<int>(kSize)) size = kSize;
|
||||||
return size;
|
return static_cast<unsigned>(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
RunQueue(const RunQueue&) = delete;
|
RunQueue(const RunQueue&) = delete;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user