зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
7a211baa1a
Коммит
74bcab176b
|
@ -2884,7 +2884,7 @@ nsFontMetricsGTK::PickASizeAndLoad(nsFontStretch* aStretch,
|
||||||
if (aStretch->mOutlineScaled) {
|
if (aStretch->mOutlineScaled) {
|
||||||
scale_size = PR_MAX(mPixelSize, aCharSet->mOutlineScaleMin);
|
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;
|
use_scaled_font = 1;
|
||||||
SIZE_FONT_PRINTF(("outline font:______ %s\n"
|
SIZE_FONT_PRINTF(("outline font:______ %s\n"
|
||||||
" desired=%d, scaled=%d, bitmap=%d",
|
" desired=%d, scaled=%d, bitmap=%d",
|
||||||
|
@ -2921,7 +2921,7 @@ nsFontMetricsGTK::PickASizeAndLoad(nsFontStretch* aStretch,
|
||||||
double ratio = (bitmap_size / ((double) mPixelSize));
|
double ratio = (bitmap_size / ((double) mPixelSize));
|
||||||
if ((ratio < aCharSet->mBitmapUndersize)
|
if ((ratio < aCharSet->mBitmapUndersize)
|
||||||
|| (ratio > aCharSet->mBitmapOversize)) {
|
|| (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;
|
use_scaled_font = 1;
|
||||||
SIZE_FONT_PRINTF(("bitmap scaled font: %s\n"
|
SIZE_FONT_PRINTF(("bitmap scaled font: %s\n"
|
||||||
" desired=%d, scaled=%d, bitmap=%d",
|
" desired=%d, scaled=%d, bitmap=%d",
|
||||||
|
|
|
@ -105,10 +105,6 @@
|
||||||
#include "nsILE.h"
|
#include "nsILE.h"
|
||||||
#endif /* SUNCTL */
|
#endif /* SUNCTL */
|
||||||
|
|
||||||
#ifndef PR_ABS
|
|
||||||
#define PR_ABS(x) ((x) < 0 ? -(x) : (x))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
|
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
|
||||||
|
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
|
|
|
@ -105,10 +105,6 @@
|
||||||
#include "nsILE.h"
|
#include "nsILE.h"
|
||||||
#endif /* SUNCTL */
|
#endif /* SUNCTL */
|
||||||
|
|
||||||
#ifndef PR_ABS
|
|
||||||
#define PR_ABS(x) ((x) < 0 ? -(x) : (x))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
|
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
|
||||||
|
|
||||||
#ifdef NS_DEBUG
|
#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)
|
// plain TeX settings (TeXbook p.152)
|
||||||
#define NS_MATHML_DELIMITER_FACTOR 0.901f
|
#define NS_MATHML_DELIMITER_FACTOR 0.901f
|
||||||
|
|
|
@ -1262,10 +1262,6 @@ nsSplitterFrameInner::AddRemoveSpace(nscoord aDiff,
|
||||||
aSpaceLeft = 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.
|
* 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
|
* 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)
|
if (aCount == 0 || !mView)
|
||||||
return NS_OK; // Nothing to do.
|
return NS_OK; // Nothing to do.
|
||||||
|
|
||||||
PRInt32 count = aCount > 0 ? aCount : -aCount;
|
PRInt32 count = PR_ABS(aCount);
|
||||||
PRInt32 rowCount;
|
PRInt32 rowCount;
|
||||||
mView->GetRowCount(&rowCount);
|
mView->GetRowCount(&rowCount);
|
||||||
|
|
||||||
|
@ -2934,7 +2934,7 @@ nsOutlinerBodyFrame::ScrollInternal(PRInt32 aRow)
|
||||||
mStyleContext->GetStyleData(eStyleStruct_Background);
|
mStyleContext->GetStyleData(eStyleStruct_Background);
|
||||||
PRBool hasBackground = myColor->mBackgroundImage.Length() > 0;
|
PRBool hasBackground = myColor->mBackgroundImage.Length() > 0;
|
||||||
|
|
||||||
PRInt32 absDelta = delta > 0 ? delta : -delta;
|
PRInt32 absDelta = PR_ABS(delta);
|
||||||
if (hasBackground || absDelta*mRowHeight >= mRect.height)
|
if (hasBackground || absDelta*mRowHeight >= mRect.height)
|
||||||
Invalidate();
|
Invalidate();
|
||||||
else if (mOutlinerWidget)
|
else if (mOutlinerWidget)
|
||||||
|
|
|
@ -1482,7 +1482,7 @@ NS_IMETHODIMP nsOutlinerBodyFrame::RowCountChanged(PRInt32 aIndex, PRInt32 aCoun
|
||||||
if (aCount == 0 || !mView)
|
if (aCount == 0 || !mView)
|
||||||
return NS_OK; // Nothing to do.
|
return NS_OK; // Nothing to do.
|
||||||
|
|
||||||
PRInt32 count = aCount > 0 ? aCount : -aCount;
|
PRInt32 count = PR_ABS(aCount);
|
||||||
PRInt32 rowCount;
|
PRInt32 rowCount;
|
||||||
mView->GetRowCount(&rowCount);
|
mView->GetRowCount(&rowCount);
|
||||||
|
|
||||||
|
@ -2934,7 +2934,7 @@ nsOutlinerBodyFrame::ScrollInternal(PRInt32 aRow)
|
||||||
mStyleContext->GetStyleData(eStyleStruct_Background);
|
mStyleContext->GetStyleData(eStyleStruct_Background);
|
||||||
PRBool hasBackground = myColor->mBackgroundImage.Length() > 0;
|
PRBool hasBackground = myColor->mBackgroundImage.Length() > 0;
|
||||||
|
|
||||||
PRInt32 absDelta = delta > 0 ? delta : -delta;
|
PRInt32 absDelta = PR_ABS(delta);
|
||||||
if (hasBackground || absDelta*mRowHeight >= mRect.height)
|
if (hasBackground || absDelta*mRowHeight >= mRect.height)
|
||||||
Invalidate();
|
Invalidate();
|
||||||
else if (mOutlinerWidget)
|
else if (mOutlinerWidget)
|
||||||
|
|
|
@ -400,8 +400,8 @@ mime_generate_headers (nsMsgCompFields *fields,
|
||||||
PR_snprintf(buffer_tail, buffer + size - buffer_tail,
|
PR_snprintf(buffer_tail, buffer + size - buffer_tail,
|
||||||
"%c%02d%02d" CRLF,
|
"%c%02d%02d" CRLF,
|
||||||
(gmtoffset >= 0 ? '+' : '-'),
|
(gmtoffset >= 0 ? '+' : '-'),
|
||||||
((gmtoffset >= 0 ? gmtoffset : -gmtoffset) / 60),
|
(PR_ABS(gmtoffset) / 60),
|
||||||
((gmtoffset >= 0 ? gmtoffset : -gmtoffset) % 60));
|
(PR_ABS(gmtoffset) % 60));
|
||||||
buffer_tail += PL_strlen (buffer_tail);
|
buffer_tail += PL_strlen (buffer_tail);
|
||||||
|
|
||||||
if (pFrom && *pFrom) {
|
if (pFrom && *pFrom) {
|
||||||
|
|
|
@ -50,8 +50,6 @@
|
||||||
#include "nsIPlatformCharset.h"
|
#include "nsIPlatformCharset.h"
|
||||||
#include "nsIServiceManager.h"
|
#include "nsIServiceManager.h"
|
||||||
|
|
||||||
#define ABS(i) ( (i)<0 ? 0-(i) : (i) )
|
|
||||||
|
|
||||||
// Variables for grabbing
|
// Variables for grabbing
|
||||||
PRBool nsWindow::sIsGrabbing = PR_FALSE;
|
PRBool nsWindow::sIsGrabbing = PR_FALSE;
|
||||||
nsWindow *nsWindow::sGrabWindow = nsnull;
|
nsWindow *nsWindow::sGrabWindow = nsnull;
|
||||||
|
@ -679,21 +677,21 @@ NS_IMETHODIMP nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
|
||||||
|
|
||||||
if (aDx < 0 || aDy < 0)
|
if (aDx < 0 || aDy < 0)
|
||||||
{
|
{
|
||||||
srcX = mBounds.x + ABS(aDx);
|
srcX = mBounds.x + PR_ABS(aDx);
|
||||||
srcY = mBounds.y + ABS(aDy);
|
srcY = mBounds.y + PR_ABS(aDy);
|
||||||
destX = mBounds.x;
|
destX = mBounds.x;
|
||||||
destY = mBounds.y;
|
destY = mBounds.y;
|
||||||
width = mBounds.width - ABS(aDx);
|
width = mBounds.width - PR_ABS(aDx);
|
||||||
height = mBounds.height - ABS(aDy);
|
height = mBounds.height - PR_ABS(aDy);
|
||||||
}
|
}
|
||||||
else if (aDx > 0 || aDy > 0)
|
else if (aDx > 0 || aDy > 0)
|
||||||
{
|
{
|
||||||
srcX = mBounds.x;
|
srcX = mBounds.x;
|
||||||
srcY = mBounds.y;
|
srcY = mBounds.y;
|
||||||
destX = mBounds.x + ABS(aDx);
|
destX = mBounds.x + PR_ABS(aDx);
|
||||||
destY = mBounds.y + ABS(aDy);
|
destY = mBounds.y + PR_ABS(aDy);
|
||||||
width = mBounds.width - ABS(aDx);
|
width = mBounds.width - PR_ABS(aDx);
|
||||||
height = mBounds.height - ABS(aDy);
|
height = mBounds.height - PR_ABS(aDy);
|
||||||
}
|
}
|
||||||
|
|
||||||
XCopyArea(mDisplay, mBaseWindow, mBaseWindow, mScrollGC,
|
XCopyArea(mDisplay, mBaseWindow, mBaseWindow, mScrollGC,
|
||||||
|
|
|
@ -71,8 +71,6 @@
|
||||||
#include <malloc.h> // for _heapmin()
|
#include <malloc.h> // for _heapmin()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ABS(x) ((x)<0?-(x):x)
|
|
||||||
|
|
||||||
// XXX Get rid of this
|
// XXX Get rid of this
|
||||||
#pragma message("WARNING: XXX bad include, remove it.")
|
#pragma message("WARNING: XXX bad include, remove it.")
|
||||||
#include "nsIWebShellWindow.h"
|
#include "nsIWebShellWindow.h"
|
||||||
|
@ -1089,7 +1087,7 @@ void nsXULWindow::StaggerPosition(PRInt32 &aRequestedX, PRInt32 &aRequestedY,
|
||||||
if (listXULWindow != ourXULWindow) {
|
if (listXULWindow != ourXULWindow) {
|
||||||
listBaseWindow->GetPosition(&listX, &listY);
|
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
|
// collision! offset and stop. save the DOMWindow corresponding
|
||||||
// to the colliding window for later. (we'll need its nsIDOMScreen
|
// to the colliding window for later. (we'll need its nsIDOMScreen
|
||||||
nsCOMPtr<nsIDocShell> listDocShell;
|
nsCOMPtr<nsIDocShell> listDocShell;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче