зеркало из https://github.com/mozilla/gecko-dev.git
Bug 631657 - Bogus WARNING: Overflowed nscoord_MAX in conversion to nscoord; r=roc, a2.0=dbaron
This commit is contained in:
Родитель
6334d5e4de
Коммит
f3c7895934
|
@ -101,12 +101,14 @@ inline nscoord NSToCoordRoundWithClamp(float aValue)
|
|||
{
|
||||
#ifndef NS_COORD_IS_FLOAT
|
||||
// Bounds-check before converting out of float, to avoid overflow
|
||||
NS_WARN_IF_FALSE(aValue <= nscoord_MAX,
|
||||
"Overflowed nscoord_MAX in conversion to nscoord");
|
||||
if (aValue >= nscoord_MAX) {
|
||||
NS_WARNING("Overflowed nscoord_MAX in conversion to nscoord");
|
||||
return nscoord_MAX;
|
||||
}
|
||||
NS_WARN_IF_FALSE(aValue >= nscoord_MIN,
|
||||
"Overflowed nscoord_MIN in conversion to nscoord");
|
||||
if (aValue <= nscoord_MIN) {
|
||||
NS_WARNING("Overflowed nscoord_MIN in conversion to nscoord");
|
||||
return nscoord_MIN;
|
||||
}
|
||||
#endif
|
||||
|
@ -355,12 +357,14 @@ inline nscoord NSToCoordFloorClamped(float aValue)
|
|||
{
|
||||
#ifndef NS_COORD_IS_FLOAT
|
||||
// Bounds-check before converting out of float, to avoid overflow
|
||||
NS_WARN_IF_FALSE(aValue <= nscoord_MAX,
|
||||
"Overflowed nscoord_MAX in conversion to nscoord");
|
||||
if (aValue >= nscoord_MAX) {
|
||||
NS_WARNING("Overflowed nscoord_MAX in conversion to nscoord");
|
||||
return nscoord_MAX;
|
||||
}
|
||||
NS_WARN_IF_FALSE(aValue >= nscoord_MIN,
|
||||
"Overflowed nscoord_MIN in conversion to nscoord");
|
||||
if (aValue <= nscoord_MIN) {
|
||||
NS_WARNING("Overflowed nscoord_MIN in conversion to nscoord");
|
||||
return nscoord_MIN;
|
||||
}
|
||||
#endif
|
||||
|
@ -376,12 +380,14 @@ inline nscoord NSToCoordCeilClamped(float aValue)
|
|||
{
|
||||
#ifndef NS_COORD_IS_FLOAT
|
||||
// Bounds-check before converting out of float, to avoid overflow
|
||||
NS_WARN_IF_FALSE(aValue <= nscoord_MAX,
|
||||
"Overflowed nscoord_MAX in conversion to nscoord");
|
||||
if (aValue >= nscoord_MAX) {
|
||||
NS_WARNING("Overflowed nscoord_MAX in conversion to nscoord");
|
||||
return nscoord_MAX;
|
||||
}
|
||||
NS_WARN_IF_FALSE(aValue >= nscoord_MIN,
|
||||
"Overflowed nscoord_MIN in conversion to nscoord");
|
||||
if (aValue <= nscoord_MIN) {
|
||||
NS_WARNING("Overflowed nscoord_MIN in conversion to nscoord");
|
||||
return nscoord_MIN;
|
||||
}
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче