Bug 631657 - Bogus WARNING: Overflowed nscoord_MAX in conversion to nscoord; r=roc, a2.0=dbaron

This commit is contained in:
Philipp Wagner 2011-02-20 16:15:58 +01:00
Родитель 6334d5e4de
Коммит f3c7895934
1 изменённых файлов: 12 добавлений и 6 удалений

Просмотреть файл

@ -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