Bug 847480 - Blindly convert all existing mozilla::Abs users to mozilla::DeprecatedAbs. Individualized conversions to the reformed mozilla::Abs will continue until mozilla::DeprecatedAbs is unused, at which point it will be removed. r=Ms2ger

This commit is contained in:
Jeff Walden 2013-03-05 15:43:30 -08:00
parent cb19ca39bd
commit 5ec763f216
31 changed files with 79 additions and 79 deletions

View File

@ -3716,8 +3716,8 @@ CanvasRenderingContext2D::CreateImageData(JSContext* cx, double sw,
int32_t wi = JS_DoubleToInt32(sw);
int32_t hi = JS_DoubleToInt32(sh);
uint32_t w = Abs(wi);
uint32_t h = Abs(hi);
uint32_t w = DeprecatedAbs(wi);
uint32_t h = DeprecatedAbs(hi);
return mozilla::dom::CreateImageData(cx, this, w, h, error);
}

View File

@ -2052,8 +2052,8 @@ nsEventStateManager::GenerateDragGesture(nsPresContext* aPresContext,
// fire drag gesture if mouse has moved enough
nsIntPoint pt = aEvent->refPoint + aEvent->widget->WidgetToScreenOffset();
if (Abs(pt.x - mGestureDownPoint.x) > pixelThresholdX ||
Abs(pt.y - mGestureDownPoint.y) > pixelThresholdY) {
if (DeprecatedAbs(pt.x - mGestureDownPoint.x) > pixelThresholdX ||
DeprecatedAbs(pt.y - mGestureDownPoint.y) > pixelThresholdY) {
if (mClickHoldContextMenu) {
// stop the click-hold before we fire off the drag gesture, in case
// it takes a long time
@ -2880,14 +2880,14 @@ nsEventStateManager::DoScrollText(nsIScrollableFrame* aScrollableFrame,
nsIntSize devPixelPageSize(pc->AppUnitsToDevPixels(pageSize.width),
pc->AppUnitsToDevPixels(pageSize.height));
if (!WheelPrefs::GetInstance()->IsOverOnePageScrollAllowedX(aEvent) &&
Abs(actualDevPixelScrollAmount.x) > devPixelPageSize.width) {
DeprecatedAbs(actualDevPixelScrollAmount.x) > devPixelPageSize.width) {
actualDevPixelScrollAmount.x =
(actualDevPixelScrollAmount.x >= 0) ? devPixelPageSize.width :
-devPixelPageSize.width;
}
if (!WheelPrefs::GetInstance()->IsOverOnePageScrollAllowedY(aEvent) &&
Abs(actualDevPixelScrollAmount.y) > devPixelPageSize.height) {
DeprecatedAbs(actualDevPixelScrollAmount.y) > devPixelPageSize.height) {
actualDevPixelScrollAmount.y =
(actualDevPixelScrollAmount.y >= 0) ? devPixelPageSize.height :
-devPixelPageSize.height;
@ -5590,8 +5590,8 @@ nsEventStateManager::WheelPrefs::ComputeActionFor(widget::WheelEvent* aEvent)
Init(index);
bool deltaXPreferred =
(Abs(aEvent->deltaX) > Abs(aEvent->deltaY) &&
Abs(aEvent->deltaX) > Abs(aEvent->deltaZ));
(DeprecatedAbs(aEvent->deltaX) > DeprecatedAbs(aEvent->deltaY) &&
DeprecatedAbs(aEvent->deltaX) > DeprecatedAbs(aEvent->deltaZ));
Action* actions = deltaXPreferred ? mOverriddenActionsX : mActions;
if (actions[index] == ACTION_NONE || actions[index] == ACTION_SCROLL) {
return actions[index];
@ -5625,7 +5625,7 @@ nsEventStateManager::WheelPrefs::IsOverOnePageScrollAllowedX(
{
Index index = GetIndexFor(aEvent);
Init(index);
return Abs(mMultiplierX[index]) >=
return DeprecatedAbs(mMultiplierX[index]) >=
MIN_MULTIPLIER_VALUE_ALLOWING_OVER_ONE_PAGE_SCROLL;
}
@ -5635,6 +5635,6 @@ nsEventStateManager::WheelPrefs::IsOverOnePageScrollAllowedY(
{
Index index = GetIndexFor(aEvent);
Init(index);
return Abs(mMultiplierY[index]) >=
return DeprecatedAbs(mMultiplierY[index]) >=
MIN_MULTIPLIER_VALUE_ALLOWING_OVER_ONE_PAGE_SCROLL;
}

View File

@ -3382,10 +3382,10 @@ static double ClampPlaybackRate(double aPlaybackRate)
if (aPlaybackRate == 0.0) {
return aPlaybackRate;
}
if (Abs(aPlaybackRate) < MIN_PLAYBACKRATE) {
if (DeprecatedAbs(aPlaybackRate) < MIN_PLAYBACKRATE) {
return aPlaybackRate < 0 ? -MIN_PLAYBACKRATE : MIN_PLAYBACKRATE;
}
if (Abs(aPlaybackRate) > MAX_PLAYBACKRATE) {
if (DeprecatedAbs(aPlaybackRate) > MAX_PLAYBACKRATE) {
return aPlaybackRate < 0 ? -MAX_PLAYBACKRATE : MAX_PLAYBACKRATE;
}
return aPlaybackRate;

View File

@ -594,11 +594,11 @@ nsresult MediaDecoder::Seek(double aTime)
NS_ENSURE_SUCCESS(res, NS_OK);
res = seekable.Start(range + 1, &rightBound);
NS_ENSURE_SUCCESS(res, NS_OK);
double distanceLeft = Abs(leftBound - aTime);
double distanceRight = Abs(rightBound - aTime);
double distanceLeft = DeprecatedAbs(leftBound - aTime);
double distanceRight = DeprecatedAbs(rightBound - aTime);
if (distanceLeft == distanceRight) {
distanceLeft = Abs(leftBound - mCurrentTime);
distanceRight = Abs(rightBound - mCurrentTime);
distanceLeft = DeprecatedAbs(leftBound - mCurrentTime);
distanceRight = DeprecatedAbs(rightBound - mCurrentTime);
}
aTime = (distanceLeft < distanceRight) ? leftBound : rightBound;
} else {

View File

@ -1101,7 +1101,7 @@ nsSHistory::GloballyEvictContentViewers()
for (uint32_t j = 0; j < shTransactions.Length(); j++) {
TransactionAndDistance &container = shTransactions[j];
if (container.mViewer == contentViewer) {
container.mDistance = std::min(container.mDistance, Abs(i - shist->mIndex));
container.mDistance = std::min(container.mDistance, DeprecatedAbs(i - shist->mIndex));
found = true;
break;
}
@ -1110,7 +1110,7 @@ nsSHistory::GloballyEvictContentViewers()
// If we didn't find a TransactionAndDistance for this content viewer, make a new
// one.
if (!found) {
TransactionAndDistance container(trans, Abs(i - shist->mIndex));
TransactionAndDistance container(trans, DeprecatedAbs(i - shist->mIndex));
shTransactions.AppendElement(container);
}
}

View File

@ -1936,7 +1936,7 @@ nsHTMLEditRules::WillDeleteSelection(Selection* aSelection,
res = nsWSRunObject::PrepareToDeleteRange(mHTMLEditor, address_of(visNode), &so, address_of(visNode), &eo);
NS_ENSURE_SUCCESS(res, res);
nsCOMPtr<nsIDOMCharacterData> nodeAsText(do_QueryInterface(visNode));
res = mHTMLEditor->DeleteText(nodeAsText, std::min(so, eo), Abs(eo - so));
res = mHTMLEditor->DeleteText(nodeAsText, std::min(so, eo), DeprecatedAbs(eo - so));
*aHandled = true;
NS_ENSURE_SUCCESS(res, res);
res = InsertBRIfNeeded(aSelection);
@ -4396,7 +4396,7 @@ nsHTMLEditRules::CreateStyleForInsertText(nsISelection *aSelection,
if (relFontSize) {
// dir indicated bigger versus smaller. 1 = bigger, -1 = smaller
int32_t dir = relFontSize > 0 ? 1 : -1;
for (int32_t j = 0; j < Abs(relFontSize); j++) {
for (int32_t j = 0; j < DeprecatedAbs(relFontSize); j++) {
res = mHTMLEditor->RelativeFontChangeOnTextNode(dir, nodeAsText,
0, -1);
NS_ENSURE_SUCCESS(res, res);

View File

@ -875,8 +875,8 @@ nsHTMLEditor::MouseMove(nsIDOMEvent* aMouseEvent)
int32_t yThreshold =
LookAndFeel::GetInt(LookAndFeel::eIntID_DragThresholdY, 1);
if (Abs(clientX - mOriginalX) * 2 >= xThreshold ||
Abs(clientY - mOriginalY) * 2 >= yThreshold) {
if (DeprecatedAbs(clientX - mOriginalX) * 2 >= xThreshold ||
DeprecatedAbs(clientY - mOriginalY) * 2 >= yThreshold) {
mGrabberClicked = false;
StartMoving(nullptr);
}

View File

@ -376,7 +376,7 @@ BasicTiledThebesLayer::ComputeProgressiveUpdateRegion(BasicTiledLayerBuffer& aTi
if (!aRegionToPaint.IsEmpty()) {
break;
}
if (Abs(scrollDiffY) >= Abs(scrollDiffX)) {
if (DeprecatedAbs(scrollDiffY) >= DeprecatedAbs(scrollDiffX)) {
tileBounds.x += incX;
} else {
tileBounds.y += incY;

View File

@ -790,7 +790,7 @@ CalcStyleMatch(gfxFontEntry *aFontEntry, const gfxFontStyle *aStyle)
}
// measure of closeness of weight to the desired value
rank += 9 - Abs(aFontEntry->Weight() / 100 - aStyle->ComputeWeight());
rank += 9 - DeprecatedAbs(aFontEntry->Weight() / 100 - aStyle->ComputeWeight());
} else {
// if no font to match, prefer non-bold, non-italic fonts
if (!aFontEntry->IsItalic()) {
@ -2966,8 +2966,8 @@ gfxFont::InitMetricsFromSfntTables(Metrics& aMetrics)
uint16_t(os2->version) >= 2) {
// version 2 and later includes the x-height field
SET_SIGNED(xHeight, os2->sxHeight);
// Abs because of negative xHeight seen in Kokonor (Tibetan) font
aMetrics.xHeight = Abs(aMetrics.xHeight);
// DeprecatedAbs because of negative xHeight seen in Kokonor (Tibetan) font
aMetrics.xHeight = DeprecatedAbs(aMetrics.xHeight);
}
// this should always be present
if (os2data.Length() >= offsetof(OS2Table, yStrikeoutPosition) +

View File

@ -22,7 +22,7 @@
using namespace js;
using namespace js::ion;
using mozilla::Abs;
using mozilla::DeprecatedAbs;
// This algorithm is based on the paper "Eliminating Range Checks Using
// Static Single Assignment Form" by Gough and Klaren.
@ -672,7 +672,7 @@ MAbs::computeRange()
Range other(getOperand(0));
Range *range = new Range(0,
Max(Abs<int64_t>(other.lower()), Abs<int64_t>(other.upper())),
Max(DeprecatedAbs<int64_t>(other.lower()), DeprecatedAbs<int64_t>(other.upper())),
other.isDecimal(),
other.exponent());
setRange(range);
@ -719,8 +719,8 @@ MMod::computeRange()
return;
Range lhs(getOperand(0));
Range rhs(getOperand(1));
int64_t a = Abs<int64_t>(rhs.lower());
int64_t b = Abs<int64_t>(rhs.upper());
int64_t a = DeprecatedAbs<int64_t>(rhs.lower());
int64_t b = DeprecatedAbs<int64_t>(rhs.upper());
if (a == 0 && b == 0)
return;
int64_t bound = Max(1-a, b-1);

View File

@ -344,8 +344,8 @@ class Range : public TempObject {
return;
}
uint32_t max = Max(mozilla::Abs<int64_t>(lower()),
mozilla::Abs<int64_t>(upper()));
uint32_t max = Max(mozilla::DeprecatedAbs<int64_t>(lower()),
mozilla::DeprecatedAbs<int64_t>(upper()));
JS_ASSERT_IF(lower() == JSVAL_INT_MIN, max == (uint32_t) JSVAL_INT_MIN);
JS_ASSERT(max <= (uint32_t) JSVAL_INT_MIN);
// The number of bits needed to encode |max| is the power of 2 plus one.

View File

@ -705,7 +705,7 @@ class DtrOffImm : public DtrOff
{
public:
DtrOffImm(int32_t imm)
: DtrOff(datastore::Imm12Data(mozilla::Abs(imm)), imm >= 0 ? IsUp : IsDown)
: DtrOff(datastore::Imm12Data(mozilla::DeprecatedAbs(imm)), imm >= 0 ? IsUp : IsDown)
{
JS_ASSERT((imm < 4096) && (imm > -4096));
}
@ -790,7 +790,7 @@ class EDtrOffImm : public EDtrOff
{
public:
EDtrOffImm(int32_t imm)
: EDtrOff(datastore::Imm8Data(mozilla::Abs(imm)), (imm >= 0) ? IsUp : IsDown)
: EDtrOff(datastore::Imm8Data(mozilla::DeprecatedAbs(imm)), (imm >= 0) ? IsUp : IsDown)
{ }
};
@ -838,7 +838,7 @@ class VFPOffImm : public VFPOff
{
public:
VFPOffImm(int32_t imm)
: VFPOff(datastore::Imm8VFPOffData(mozilla::Abs(imm) >> 2), imm < 0 ? IsDown : IsUp)
: VFPOff(datastore::Imm8VFPOffData(mozilla::DeprecatedAbs(imm) >> 2), imm < 0 ? IsDown : IsUp)
{ }
};
class VFPAddr

View File

@ -14,7 +14,7 @@
using namespace js;
using namespace ion;
using mozilla::Abs;
using mozilla::DeprecatedAbs;
bool
isValueDTRDCandidate(ValueOperand &val)
@ -2526,7 +2526,7 @@ MacroAssemblerARMCompat::storeValue(ValueOperand val, Operand dst) {
void
MacroAssemblerARMCompat::storeValue(ValueOperand val, const BaseIndex &dest)
{
if (isValueDTRDCandidate(val) && Abs(dest.offset) <= 255) {
if (isValueDTRDCandidate(val) && DeprecatedAbs(dest.offset) <= 255) {
Register tmpIdx;
if (dest.offset == 0) {
if (dest.scale == TimesOne) {
@ -2550,7 +2550,7 @@ MacroAssemblerARMCompat::storeValue(ValueOperand val, const BaseIndex &dest)
void
MacroAssemblerARMCompat::loadValue(const BaseIndex &addr, ValueOperand val)
{
if (isValueDTRDCandidate(val) && Abs(addr.offset) <= 255) {
if (isValueDTRDCandidate(val) && DeprecatedAbs(addr.offset) <= 255) {
Register tmpIdx;
if (addr.offset == 0) {
if (addr.scale == TimesOne) {

View File

@ -31,7 +31,7 @@
using namespace js;
using mozilla::Abs;
using mozilla::DeprecatedAbs;
#ifndef M_E
#define M_E 2.7182818284590452354
@ -105,7 +105,7 @@ js_math_abs(JSContext *cx, unsigned argc, Value *vp)
}
if (!ToNumber(cx, vp[2], &x))
return JS_FALSE;
z = Abs(x);
z = DeprecatedAbs(x);
vp->setNumber(z);
return JS_TRUE;
}

View File

@ -21,7 +21,7 @@ using namespace js::mjit;
using namespace js::analyze;
using namespace JSC;
using mozilla::Abs;
using mozilla::DeprecatedAbs;
typedef JSC::MacroAssembler::FPRegisterID FPRegisterID;
@ -333,7 +333,7 @@ mjit::Compiler::jsop_binary_double(FrameEntry *lhs, FrameEntry *rhs, JSOp op,
(type == JSVAL_TYPE_INT32 ||
(type == JSVAL_TYPE_UNKNOWN &&
!(lhs->isConstant() && lhs->isType(JSVAL_TYPE_INT32) &&
Abs(lhs->getValue().toInt32()) == 1))))
DeprecatedAbs(lhs->getValue().toInt32()) == 1))))
{
RegisterID reg = frame.allocReg();
FPRegisterID fpReg = frame.allocFPReg();

View File

@ -19,7 +19,7 @@ using namespace js::mjit;
using namespace js::analyze;
using namespace js::types;
using mozilla::Abs;
using mozilla::DeprecatedAbs;
LoopState::LoopState(JSContext *cx, analyze::CrossScriptSSA *ssa,
mjit::Compiler *cc, FrameState *frame)
@ -2029,7 +2029,7 @@ LoopState::computeInterval(const CrossSSAValue &cv, int32_t *pmin, int32_t *pmax
if (!computeInterval(rhsv, &rhsmin, &rhsmax) || rhsmin != rhsmax)
return false;
int32_t rhs = Abs(rhsmax);
int32_t rhs = DeprecatedAbs(rhsmax);
*pmin = -(rhs - 1);
*pmax = rhs - 1;
return true;
@ -2063,8 +2063,8 @@ LoopState::computeInterval(const CrossSSAValue &cv, int32_t *pmin, int32_t *pmax
if (lhsmin == INT32_MIN || rhsmin == INT32_MIN)
return false;
int32_t nlhs = Max(Abs(lhsmin), Abs(lhsmax));
int32_t nrhs = Max(Abs(rhsmin), Abs(rhsmax));
int32_t nlhs = Max(DeprecatedAbs(lhsmin), DeprecatedAbs(lhsmax));
int32_t nrhs = Max(DeprecatedAbs(rhsmin), DeprecatedAbs(rhsmax));
if (!SafeMul(nlhs, nrhs, pmax))
return false;

View File

@ -358,7 +358,7 @@ PRMJ_Now(void)
itself, but I have only seen it triggered by another program
doing some kind of file I/O. The symptoms are a negative diff
followed by an equally large positive diff. */
if (mozilla::Abs(diff) > 2 * skewThreshold) {
if (mozilla::DeprecatedAbs(diff) > 2 * skewThreshold) {
/*fprintf(stderr,"Clock skew detected (diff = %f)!\n", diff);*/
if (calibrated) {

View File

@ -42,7 +42,7 @@ inline double
TimeClip(double time)
{
/* Steps 1-2. */
if (!MOZ_DOUBLE_IS_FINITE(time) || mozilla::Abs(time) > 8.64e15)
if (!MOZ_DOUBLE_IS_FINITE(time) || mozilla::DeprecatedAbs(time) > 8.64e15)
return js_NaN;
/* Step 3. */

View File

@ -17,7 +17,7 @@
// See http://www.w3.org/TR/AERT#color-contrast
#define NS_SUFFICIENT_LUMINOSITY_DIFFERENCE 125000
#define NS_LUMINOSITY_DIFFERENCE(a, b) \
mozilla::Abs(NS_GetLuminosity(a) - NS_GetLuminosity(b))
mozilla::DeprecatedAbs(NS_GetLuminosity(a) - NS_GetLuminosity(b))
// To determine colors based on the background brightness and border color
void NS_GetSpecial3DColors(nscolor aResult[2],

View File

@ -1984,10 +1984,10 @@ ComputeRadialGradientLine(nsPresContext* aPresContext,
// Compute gradient shape: the x and y radii of an ellipse.
double radiusX, radiusY;
double leftDistance = Abs(aLineStart->x);
double rightDistance = Abs(aBoxSize.width - aLineStart->x);
double topDistance = Abs(aLineStart->y);
double bottomDistance = Abs(aBoxSize.height - aLineStart->y);
double leftDistance = DeprecatedAbs(aLineStart->x);
double rightDistance = DeprecatedAbs(aBoxSize.width - aLineStart->x);
double topDistance = DeprecatedAbs(aLineStart->y);
double bottomDistance = DeprecatedAbs(aBoxSize.height - aLineStart->y);
switch (aGradient->mSize) {
case NS_STYLE_GRADIENT_SIZE_CLOSEST_SIDE:
radiusX = std::min(leftDistance, rightDistance);

View File

@ -5646,7 +5646,7 @@ nsTextFrame::PaintTextSelectionDecorations(gfxContext* aCtx,
if (type == aSelectionType) {
pt.x = (aFramePt.x + xOffset -
(mTextRun->IsRightToLeft() ? advance : 0)) / app;
gfxFloat width = Abs(advance) / app;
gfxFloat width = DeprecatedAbs(advance) / app;
gfxFloat xInFrame = pt.x - (aFramePt.x / app);
DrawSelectionDecorations(aCtx, dirtyRect, aSelectionType, this,
aTextPaintStyle, selectedStyle, pt, xInFrame,

View File

@ -747,7 +747,7 @@ IsSizeOK(nsPresContext* aPresContext, nscoord a, nscoord b, uint32_t aHint)
// or in sloppy markups without protective <mrow></mrow>
bool isNormal =
(aHint & NS_STRETCH_NORMAL)
&& bool(float(Abs(a - b))
&& bool(float(DeprecatedAbs(a - b))
< (1.0f - NS_MATHML_DELIMITER_FACTOR) * float(b));
// Nearer: True if 'a' is around max{ +/-10% of 'b' , 'b' - 5pt },
// as documented in The TeXbook, Ch.17, p.152.
@ -757,7 +757,7 @@ IsSizeOK(nsPresContext* aPresContext, nscoord a, nscoord b, uint32_t aHint)
float c = std::max(float(b) * NS_MATHML_DELIMITER_FACTOR,
float(b) - nsPresContext::
CSSPointsToAppUnits(NS_MATHML_DELIMITER_SHORTFALL_POINTS));
isNearer = bool(float(Abs(b - a)) <= (float(b) - c));
isNearer = bool(float(DeprecatedAbs(b - a)) <= (float(b) - c));
}
// Smaller: Mainly for transitory use, to compare two candidate
// choices
@ -784,7 +784,7 @@ IsSizeBetter(nscoord a, nscoord olda, nscoord b, uint32_t aHint)
return (a <= olda) ? (olda > b) : (a <= b);
// XXXkt prob want log scale here i.e. 1.5 is closer to 1 than 0.5
return Abs(a - b) < Abs(olda - b);
return DeprecatedAbs(a - b) < DeprecatedAbs(olda - b);
}
// We want to place the glyphs even when they don't fit at their

View File

@ -381,7 +381,7 @@ nsStyleAnimation::ComputeDistance(nsCSSProperty aProperty,
// just like eUnit_Integer.
int32_t startInt = aStartValue.GetIntValue();
int32_t endInt = aEndValue.GetIntValue();
aDistance = Abs(endInt - startInt);
aDistance = DeprecatedAbs(endInt - startInt);
return true;
}
default:
@ -404,19 +404,19 @@ nsStyleAnimation::ComputeDistance(nsCSSProperty aProperty,
case eUnit_Integer: {
int32_t startInt = aStartValue.GetIntValue();
int32_t endInt = aEndValue.GetIntValue();
aDistance = Abs(endInt - startInt);
aDistance = DeprecatedAbs(endInt - startInt);
return true;
}
case eUnit_Coord: {
nscoord startCoord = aStartValue.GetCoordValue();
nscoord endCoord = aEndValue.GetCoordValue();
aDistance = Abs<double>(endCoord - startCoord);
aDistance = DeprecatedAbs<double>(endCoord - startCoord);
return true;
}
case eUnit_Percent: {
float startPct = aStartValue.GetPercentValue();
float endPct = aEndValue.GetPercentValue();
aDistance = Abs<double>(endPct - startPct);
aDistance = DeprecatedAbs<double>(endPct - startPct);
return true;
}
case eUnit_Float: {
@ -434,7 +434,7 @@ nsStyleAnimation::ComputeDistance(nsCSSProperty aProperty,
float startFloat = aStartValue.GetFloatValue();
float endFloat = aEndValue.GetFloatValue();
aDistance = Abs<double>(endFloat - startFloat);
aDistance = DeprecatedAbs<double>(endFloat - startFloat);
return true;
}
case eUnit_Color: {
@ -1297,7 +1297,7 @@ Decompose2DMatrix(const gfxMatrix &aMatrix, gfxPoint3D &aScale,
XYshear /= scaleY;
// A*D - B*C should now be 1 or -1
NS_ASSERTION(0.99 < Abs(A*D - B*C) && Abs(A*D - B*C) < 1.01,
NS_ASSERTION(0.99 < DeprecatedAbs(A*D - B*C) && DeprecatedAbs(A*D - B*C) < 1.01,
"determinant should now be 1 or -1");
if (A * D < B * C) {
A = -A;

View File

@ -6246,7 +6246,7 @@ BCPaintBorderIterator::SetDamageArea(const nsRect& aDirtyRect)
if (!haveIntersect)
return false;
mDamageArea = nsIntRect(startColIndex, startRowIndex,
1 + Abs<int32_t>(endColIndex - startColIndex),
1 + DeprecatedAbs<int32_t>(endColIndex - startColIndex),
1 + endRowIndex - startRowIndex);
Reset();

View File

@ -1833,7 +1833,7 @@ nsTreeBodyFrame::RowCountChanged(int32_t aIndex, int32_t aCount)
NS_ASSERTION(rowCount == mRowCount, "row count did not change by the amount suggested, check caller");
#endif
int32_t count = Abs(aCount);
int32_t count = DeprecatedAbs(aCount);
int32_t last = GetLastVisibleRow();
if (aIndex >= mTopRowIndex && aIndex <= last)
InvalidateRange(aIndex, last);

View File

@ -99,7 +99,7 @@ delete_from_cursor_cb(GtkWidget *w, GtkDeleteType del_type,
if (!cmd)
return; // unsupported command
count = Abs(count);
count = DeprecatedAbs(count);
for (int i = 0; i < count; ++i) {
gCurrentCallback(cmd, gCurrentCallbackData);
}
@ -169,7 +169,7 @@ move_cursor_cb(GtkWidget *w, GtkMovementStep step, gint count,
return; // unsupported command
count = Abs(count);
count = DeprecatedAbs(count);
for (int i = 0; i < count; ++i) {
gCurrentCallback(cmd, gCurrentCallbackData);
}

View File

@ -1344,7 +1344,7 @@ public:
(lineOrPageDeltaX > 0 && lineOrPageDeltaY < 0)) {
return 0; // We cannot guess the answer in this case.
}
return (Abs(lineOrPageDeltaX) > Abs(lineOrPageDeltaY)) ?
return (DeprecatedAbs(lineOrPageDeltaX) > DeprecatedAbs(lineOrPageDeltaY)) ?
lineOrPageDeltaX : lineOrPageDeltaY;
}

View File

@ -3434,7 +3434,7 @@ nsWindow::OverrideSystemMouseScrollSpeed(int32_t aOriginalDelta,
// on the document of SystemParametersInfo in MSDN.
const uint32_t kSystemDefaultScrollingSpeed = 3;
int32_t absOriginDelta = Abs(aOriginalDelta);
int32_t absOriginDelta = DeprecatedAbs(aOriginalDelta);
// Compute the simple overridden speed.
int32_t absComputedOverriddenDelta;
@ -3862,8 +3862,8 @@ bool nsWindow::DispatchMouseEvent(uint32_t aEventType, WPARAM wParam,
sLastMouseMovePoint.y = mpScreen.y;
}
bool insideMovementThreshold = (Abs(sLastMousePoint.x - eventPoint.x) < (short)::GetSystemMetrics(SM_CXDOUBLECLK)) &&
(Abs(sLastMousePoint.y - eventPoint.y) < (short)::GetSystemMetrics(SM_CYDOUBLECLK));
bool insideMovementThreshold = (DeprecatedAbs(sLastMousePoint.x - eventPoint.x) < (short)::GetSystemMetrics(SM_CXDOUBLECLK)) &&
(DeprecatedAbs(sLastMousePoint.y - eventPoint.y) < (short)::GetSystemMetrics(SM_CYDOUBLECLK));
BYTE eventButton;
switch (aButton) {
@ -6393,10 +6393,10 @@ bool nsWindow::OnGesture(WPARAM wParam, LPARAM lParam)
if (mDisplayPanFeedback) {
mGesture.UpdatePanFeedbackX(mWnd,
Abs(RoundDown(wheelEvent.overflowDeltaX)),
DeprecatedAbs(RoundDown(wheelEvent.overflowDeltaX)),
endFeedback);
mGesture.UpdatePanFeedbackY(mWnd,
Abs(RoundDown(wheelEvent.overflowDeltaY)),
DeprecatedAbs(RoundDown(wheelEvent.overflowDeltaY)),
endFeedback);
mGesture.PanFeedbackFinalize(mWnd, endFeedback);
}

View File

@ -356,7 +356,7 @@ TimeStampValue::CheckQPC(int64_t aDuration, const TimeStampValue &aOther) const
return false;
// Treat absolutely for calibration purposes
aDuration = Abs(aDuration);
aDuration = DeprecatedAbs(aDuration);
// Check QPC is sane before using it.

View File

@ -24,7 +24,7 @@
using namespace mozilla::ipc;
using mozilla::Abs;
using mozilla::DeprecatedAbs;
class nsMultiplexInputStream MOZ_FINAL : public nsIMultiplexInputStream,
public nsISeekableStream,
@ -515,7 +515,7 @@ nsMultiplexInputStream::Seek(int32_t aWhence, int64_t aOffset)
}
// See if we have enough data in the current stream.
if (Abs(remaining) < streamPos) {
if (DeprecatedAbs(remaining) < streamPos) {
rv = stream->Seek(NS_SEEK_END, remaining);
NS_ENSURE_SUCCESS(rv, rv);
@ -523,7 +523,7 @@ nsMultiplexInputStream::Seek(int32_t aWhence, int64_t aOffset)
mStartedReadingCurrent = true;
remaining = 0;
} else if (Abs(remaining) > streamPos) {
} else if (DeprecatedAbs(remaining) > streamPos) {
if (i > oldCurrentStream ||
(i == oldCurrentStream && !oldStartedReadingCurrent)) {
// We're already at start so no need to seek this stream
@ -533,7 +533,7 @@ nsMultiplexInputStream::Seek(int32_t aWhence, int64_t aOffset)
rv = stream->Tell(&avail);
NS_ENSURE_SUCCESS(rv, rv);
int64_t newPos = streamPos + XPCOM_MIN(avail, Abs(remaining));
int64_t newPos = streamPos + XPCOM_MIN(avail, DeprecatedAbs(remaining));
rv = stream->Seek(NS_SEEK_END, -newPos);
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -1349,7 +1349,7 @@ void nsXULWindow::StaggerPosition(int32_t &aRequestedX, int32_t &aRequestedY,
listY = NSToIntRound(listY / scale);
}
if (Abs(listX - aRequestedX) <= kSlop && Abs(listY - aRequestedY) <= kSlop) {
if (DeprecatedAbs(listX - aRequestedX) <= kSlop && DeprecatedAbs(listY - aRequestedY) <= kSlop) {
// collision! offset and start over
if (bouncedX & 0x1)
aRequestedX -= kOffset;