зеркало из https://github.com/mozilla/pjs.git
Bug 631657 - Bogus WARNING: Overflowed nscoord_MAX in conversion to nscoord; r=roc, a2.0=dbaron
This commit is contained in:
Родитель
e4692b74c3
Коммит
bff443d30e
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче