Bug 125601�ABS()-->PR_ABS() && PR_ABS()-cleanup

patch by Roland.Mainz@informatik.med.uni-giessen.de r=timeless sr=sfraser
This commit is contained in:
timeless%mac.com 2002-02-15 01:01:06 +00:00
Родитель 7a211baa1a
Коммит 74bcab176b
10 изменённых файлов: 21 добавлений и 39 удалений

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

@ -2884,7 +2884,7 @@ nsFontMetricsGTK::PickASizeAndLoad(nsFontStretch* aStretch,
if (aStretch->mOutlineScaled) {
scale_size = PR_MAX(mPixelSize, aCharSet->mOutlineScaleMin);
if (ABS(mPixelSize-scale_size) < ABS(mPixelSize-bitmap_size)) {
if (PR_ABS(mPixelSize-scale_size) < PR_ABS(mPixelSize-bitmap_size)) {
use_scaled_font = 1;
SIZE_FONT_PRINTF(("outline font:______ %s\n"
" desired=%d, scaled=%d, bitmap=%d",
@ -2921,7 +2921,7 @@ nsFontMetricsGTK::PickASizeAndLoad(nsFontStretch* aStretch,
double ratio = (bitmap_size / ((double) mPixelSize));
if ((ratio < aCharSet->mBitmapUndersize)
|| (ratio > aCharSet->mBitmapOversize)) {
if ((ABS(mPixelSize-scale_size) < ABS(mPixelSize-bitmap_size))) {
if ((PR_ABS(mPixelSize-scale_size) < PR_ABS(mPixelSize-bitmap_size))) {
use_scaled_font = 1;
SIZE_FONT_PRINTF(("bitmap scaled font: %s\n"
" desired=%d, scaled=%d, bitmap=%d",

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

@ -105,10 +105,6 @@
#include "nsILE.h"
#endif /* SUNCTL */
#ifndef PR_ABS
#define PR_ABS(x) ((x) < 0 ? -(x) : (x))
#endif
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
#ifdef NS_DEBUG

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

@ -105,10 +105,6 @@
#include "nsILE.h"
#endif /* SUNCTL */
#ifndef PR_ABS
#define PR_ABS(x) ((x) < 0 ? -(x) : (x))
#endif
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
#ifdef NS_DEBUG

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

@ -1315,8 +1315,6 @@ nsMathMLChar::SetData(nsIPresContext* aPresContext,
*/
// -----------------------------------------------------------------------------------
#undef PR_ABS
#define PR_ABS(x) ((x) < 0 ? -(x) : (x))
// plain TeX settings (TeXbook p.152)
#define NS_MATHML_DELIMITER_FACTOR 0.901f

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

@ -1262,10 +1262,6 @@ nsSplitterFrameInner::AddRemoveSpace(nscoord aDiff,
aSpaceLeft = aDiff;
}
#ifndef PR_ABS
#define PR_ABS(x) ((x) < 0 ? -(x) : (x))
#endif
/**
* Ok if we want to resize a child we will know the actual size in pixels we want it to be.
* This is not the preferred size. But they only way we can change a child is my manipulating its

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

@ -1482,7 +1482,7 @@ NS_IMETHODIMP nsOutlinerBodyFrame::RowCountChanged(PRInt32 aIndex, PRInt32 aCoun
if (aCount == 0 || !mView)
return NS_OK; // Nothing to do.
PRInt32 count = aCount > 0 ? aCount : -aCount;
PRInt32 count = PR_ABS(aCount);
PRInt32 rowCount;
mView->GetRowCount(&rowCount);
@ -2934,7 +2934,7 @@ nsOutlinerBodyFrame::ScrollInternal(PRInt32 aRow)
mStyleContext->GetStyleData(eStyleStruct_Background);
PRBool hasBackground = myColor->mBackgroundImage.Length() > 0;
PRInt32 absDelta = delta > 0 ? delta : -delta;
PRInt32 absDelta = PR_ABS(delta);
if (hasBackground || absDelta*mRowHeight >= mRect.height)
Invalidate();
else if (mOutlinerWidget)

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

@ -1482,7 +1482,7 @@ NS_IMETHODIMP nsOutlinerBodyFrame::RowCountChanged(PRInt32 aIndex, PRInt32 aCoun
if (aCount == 0 || !mView)
return NS_OK; // Nothing to do.
PRInt32 count = aCount > 0 ? aCount : -aCount;
PRInt32 count = PR_ABS(aCount);
PRInt32 rowCount;
mView->GetRowCount(&rowCount);
@ -2934,7 +2934,7 @@ nsOutlinerBodyFrame::ScrollInternal(PRInt32 aRow)
mStyleContext->GetStyleData(eStyleStruct_Background);
PRBool hasBackground = myColor->mBackgroundImage.Length() > 0;
PRInt32 absDelta = delta > 0 ? delta : -delta;
PRInt32 absDelta = PR_ABS(delta);
if (hasBackground || absDelta*mRowHeight >= mRect.height)
Invalidate();
else if (mOutlinerWidget)

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

@ -400,8 +400,8 @@ mime_generate_headers (nsMsgCompFields *fields,
PR_snprintf(buffer_tail, buffer + size - buffer_tail,
"%c%02d%02d" CRLF,
(gmtoffset >= 0 ? '+' : '-'),
((gmtoffset >= 0 ? gmtoffset : -gmtoffset) / 60),
((gmtoffset >= 0 ? gmtoffset : -gmtoffset) % 60));
(PR_ABS(gmtoffset) / 60),
(PR_ABS(gmtoffset) % 60));
buffer_tail += PL_strlen (buffer_tail);
if (pFrom && *pFrom) {

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

@ -50,8 +50,6 @@
#include "nsIPlatformCharset.h"
#include "nsIServiceManager.h"
#define ABS(i) ( (i)<0 ? 0-(i) : (i) )
// Variables for grabbing
PRBool nsWindow::sIsGrabbing = PR_FALSE;
nsWindow *nsWindow::sGrabWindow = nsnull;
@ -679,21 +677,21 @@ NS_IMETHODIMP nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
if (aDx < 0 || aDy < 0)
{
srcX = mBounds.x + ABS(aDx);
srcY = mBounds.y + ABS(aDy);
destX = mBounds.x;
destY = mBounds.y;
width = mBounds.width - ABS(aDx);
height = mBounds.height - ABS(aDy);
srcX = mBounds.x + PR_ABS(aDx);
srcY = mBounds.y + PR_ABS(aDy);
destX = mBounds.x;
destY = mBounds.y;
width = mBounds.width - PR_ABS(aDx);
height = mBounds.height - PR_ABS(aDy);
}
else if (aDx > 0 || aDy > 0)
{
srcX = mBounds.x;
srcY = mBounds.y;
destX = mBounds.x + ABS(aDx);
destY = mBounds.y + ABS(aDy);
width = mBounds.width - ABS(aDx);
height = mBounds.height - ABS(aDy);
srcX = mBounds.x;
srcY = mBounds.y;
destX = mBounds.x + PR_ABS(aDx);
destY = mBounds.y + PR_ABS(aDy);
width = mBounds.width - PR_ABS(aDx);
height = mBounds.height - PR_ABS(aDy);
}
XCopyArea(mDisplay, mBaseWindow, mBaseWindow, mScrollGC,

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

@ -71,8 +71,6 @@
#include <malloc.h> // for _heapmin()
#endif
#define ABS(x) ((x)<0?-(x):x)
// XXX Get rid of this
#pragma message("WARNING: XXX bad include, remove it.")
#include "nsIWebShellWindow.h"
@ -1089,7 +1087,7 @@ void nsXULWindow::StaggerPosition(PRInt32 &aRequestedX, PRInt32 &aRequestedY,
if (listXULWindow != ourXULWindow) {
listBaseWindow->GetPosition(&listX, &listY);
if (ABS(listX-aRequestedX) <= kSlop && ABS(listY-aRequestedY) <= kSlop) {
if (PR_ABS(listX-aRequestedX) <= kSlop && PR_ABS(listY-aRequestedY) <= kSlop) {
// collision! offset and stop. save the DOMWindow corresponding
// to the colliding window for later. (we'll need its nsIDOMScreen
nsCOMPtr<nsIDocShell> listDocShell;