Bug 671417 - Incorrect use of PRBool when other types are more appropriate or vice versa, r=bz,ehsan,dwitte,joe,vlad,luke,mak,roc

This commit is contained in:
Michael Wu 2011-07-26 23:43:37 -07:00
Родитель ae7c998e7f
Коммит 46a170c5f0
18 изменённых файлов: 24 добавлений и 22 удалений

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

@ -229,7 +229,7 @@ private:
void FindHyphenationPoints(nsHyphenator *aHyphenator,
const PRUnichar *aTextStart,
const PRUnichar *aTextLimit,
PRPackedBool *aBreakState);
PRUint8 *aBreakState);
nsAutoTArray<PRUnichar,100> mCurrentWord;
// All the items that contribute to mCurrentWord

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

@ -4005,7 +4005,7 @@ nsINode::ReplaceOrInsertBefore(PRBool aReplace, nsINode* aNewChild,
PRBool appending =
!IsNodeOfType(eDOCUMENT) && PRUint32(insPos) == GetChildCount();
PRBool firstInsPos = insPos;
PRInt32 firstInsPos = insPos;
nsIContent* firstInsertedContent = fragChildren[0];
// Iterate through the fragment's children, and insert them in the new

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

@ -312,7 +312,7 @@ void
nsLineBreaker::FindHyphenationPoints(nsHyphenator *aHyphenator,
const PRUnichar *aTextStart,
const PRUnichar *aTextLimit,
PRPackedBool *aBreakState)
PRUint8 *aBreakState)
{
nsDependentSubstring string(aTextStart, aTextLimit);
nsAutoTArray<PRPackedBool,200> hyphens;
@ -414,7 +414,7 @@ nsLineBreaker::AppendText(nsIAtom* aLangGroup, const PRUint8* aText, PRUint32 aL
if (aSink && !(aFlags & BREAK_SUPPRESS_INSIDE)) {
// Save current start-of-word state because GetJISx4051Breaks will
// set it to false
PRPackedBool currentStart = breakState[wordStart];
PRUint8 currentStart = breakState[wordStart];
nsContentUtils::LineBreaker()->
GetJISx4051Breaks(aText + wordStart, offset - wordStart,
breakState.Elements() + wordStart);

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

@ -247,7 +247,7 @@ nsIURIFixup *nsDocShell::sURIFixup = 0;
// True means we validate window targets to prevent frameset
// spoofing. Initialize this to a non-bolean value so we know to check
// the pref on the creation of the first docshell.
static PRBool gValidateOrigin = (PRBool)0xffffffff;
static PRUint32 gValidateOrigin = 0xffffffff;
// Hint for native dispatch of events on how long to delay after
// all documents have loaded in milliseconds before favoring normal
@ -4504,7 +4504,7 @@ nsDocShell::Create()
mAllowSubframes =
Preferences::GetBool("browser.frames.enabled", mAllowSubframes);
if (gValidateOrigin == (PRBool)0xffffffff) {
if (gValidateOrigin == 0xffffffff) {
// Check pref to see if we should prevent frameset spoofing
gValidateOrigin =
Preferences::GetBool("browser.frame.validate_origin", PR_TRUE);

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

@ -5084,7 +5084,7 @@ nsHTMLEditRules::GetInnerContent(nsIDOMNode *aNode, nsCOMArray<nsIDOMNode> &outA
// ExpandSelectionForDeletion: this promotes our selection to include blocks
// that have all their children selected.
//
PRBool
nsresult
nsHTMLEditRules::ExpandSelectionForDeletion(nsISelection *aSelection)
{
NS_ENSURE_TRUE(aSelection, NS_ERROR_NULL_POINTER);

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

@ -226,7 +226,7 @@ protected:
PRBool *aHandled);
nsresult CheckForInvisibleBR(nsIDOMNode *aBlock, nsHTMLEditRules::BRLocation aWhere,
nsCOMPtr<nsIDOMNode> *outBRNode, PRInt32 aOffset=0);
PRBool ExpandSelectionForDeletion(nsISelection *aSelection);
nsresult ExpandSelectionForDeletion(nsISelection *aSelection);
PRBool IsFirstNode(nsIDOMNode *aNode);
PRBool IsLastNode(nsIDOMNode *aNode);
#ifdef XXX_DEAD_CODE

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

@ -2677,7 +2677,7 @@ nsHTMLEditor::GetTableLayoutObject(nsIDOMElement* aTable, nsITableLayout **table
}
//Return actual number of cells (a cell with colspan > 1 counts as just 1)
PRBool nsHTMLEditor::GetNumberOfCellsInRow(nsIDOMElement* aTable, PRInt32 rowIndex)
PRInt32 nsHTMLEditor::GetNumberOfCellsInRow(nsIDOMElement* aTable, PRInt32 rowIndex)
{
PRInt32 cellCount = 0;
nsCOMPtr<nsIDOMElement> cell;
@ -2689,7 +2689,7 @@ PRBool nsHTMLEditor::GetNumberOfCellsInRow(nsIDOMElement* aTable, PRInt32 rowInd
res = GetCellDataAt(aTable, rowIndex, colIndex, getter_AddRefs(cell),
&startRowIndex, &startColIndex, &rowSpan, &colSpan,
&actualRowSpan, &actualColSpan, &isSelected);
NS_ENSURE_SUCCESS(res, res);
NS_ENSURE_SUCCESS(res, 0);
if (cell)
{
// Only count cells that start in row we are working with

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

@ -178,9 +178,10 @@ nsCookiePermission::PrefChanged(nsIPrefBranch *aPrefBranch,
// save cookie lifetime in seconds instead of days
mCookiesLifetimeSec = val * 24 * 60 * 60;
PRBool bval;
if (PREF_CHANGED(kCookiesAlwaysAcceptSession) &&
NS_SUCCEEDED(aPrefBranch->GetBoolPref(kCookiesAlwaysAcceptSession, &val)))
mCookiesAlwaysAcceptSession = val;
NS_SUCCEEDED(aPrefBranch->GetBoolPref(kCookiesAlwaysAcceptSession, &bval)))
mCookiesAlwaysAcceptSession = bval;
}
NS_IMETHODIMP

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

@ -927,7 +927,7 @@ unacceptable performance overhead, so we go with perceptual. */
#define INTENT_MIN 0
#define INTENT_MAX 3
PRBool
int
gfxPlatform::GetRenderingIntent()
{
if (gCMSIntent == -2) {

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

@ -238,7 +238,7 @@ NS_IMETHODIMP nsUTF8ToUnicode::Convert(const char * aSrc,
PRInt32 mUcs4 = this->mUcs4;
PRUint8 mState = this->mState;
PRUint8 mBytes = this->mBytes;
PRUint8 mFirst = this->mFirst;
PRPackedBool mFirst = this->mFirst;
// Set mFirst to PR_FALSE now so we don't have to every time through the ASCII
// branch within the loop.

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

@ -8992,7 +8992,7 @@ EvalCmp(JSContext *cx, LOpcode op, JSString* l, JSString* r, JSBool *ret)
{
if (op == LIR_eqd)
return EqualStrings(cx, l, r, ret);
JSBool cmp;
int32 cmp;
if (!CompareStrings(cx, l, r, &cmp))
return false;
*ret = EvalCmp(op, cmp, 0);

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

@ -816,7 +816,7 @@ template void JS_FASTCALL stubs::DefFun<false>(VMFrame &f, JSFunction *fun);
THROWV(JS_FALSE); \
if (lval.isString() && rval.isString()) { \
JSString *l = lval.toString(), *r = rval.toString(); \
JSBool cmp; \
int32 cmp; \
if (!CompareStrings(cx, l, r, &cmp)) \
THROWV(JS_FALSE); \
cond = cmp OP 0; \

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

@ -107,7 +107,7 @@ public:
PRBool IsRunning();
nsCOMPtr<nsITimer> mRepeatTimer;
PRBool mDelta;
PRInt32 mDelta;
nsListBoxBodyFrame* mOuter;
};

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

@ -114,6 +114,7 @@ nsMenuPopupFrame::nsMenuPopupFrame(nsIPresShell* aShell, nsStyleContext* aContex
mPopupState(ePopupClosed),
mPopupAlignment(POPUPALIGNMENT_NONE),
mPopupAnchor(POPUPALIGNMENT_NONE),
mConsumeRollupEvent(nsIPopupBoxObject::ROLLUP_DEFAULT),
mFlipBoth(PR_FALSE),
mIsOpenChanged(PR_FALSE),
mIsContextMenu(PR_FALSE),
@ -121,7 +122,6 @@ nsMenuPopupFrame::nsMenuPopupFrame(nsIPresShell* aShell, nsStyleContext* aContex
mGeneratedChildren(PR_FALSE),
mMenuCanOverlapOSBar(PR_FALSE),
mShouldAutoPosition(PR_TRUE),
mConsumeRollupEvent(nsIPopupBoxObject::ROLLUP_DEFAULT),
mInContentShell(PR_TRUE),
mIsMenuLocked(PR_FALSE),
mHFlip(PR_FALSE),

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

@ -435,6 +435,8 @@ protected:
// popup alignment relative to the anchor node
PRInt8 mPopupAlignment;
PRInt8 mPopupAnchor;
// One of nsIPopupBoxObject::ROLLUP_DEFAULT/ROLLUP_CONSUME/ROLLUP_NO_CONSUME
PRInt8 mConsumeRollupEvent;
PRPackedBool mFlipBoth; // flip in both directions
PRPackedBool mIsOpenChanged; // true if the open state changed since the last layout
@ -445,7 +447,6 @@ protected:
PRPackedBool mMenuCanOverlapOSBar; // can we appear over the taskbar/menubar?
PRPackedBool mShouldAutoPosition; // Should SetPopupPosition be allowed to auto position popup?
PRPackedBool mConsumeRollupEvent; // Should the rollup event be consumed?
PRPackedBool mInContentShell; // True if the popup is in a content shell
PRPackedBool mIsMenuLocked; // Should events inside this menu be ignored?

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

@ -710,7 +710,7 @@ protected:
nsresult NotifyOnStateChange(PRUint16 aOldState);
nsCOMPtr<mozIStoragePendingStatement> mAsyncPendingStmt;
PRBool mAsyncCanceledState;
AsyncCanceledState mAsyncCanceledState;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsNavHistoryContainerResultNode,

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

@ -910,7 +910,7 @@ NS_IMETHODIMP nsPrintSettings::SetPlexName(const PRUnichar * aPlexName)
NS_IMETHODIMP nsPrintSettings::GetHowToEnableFrameUI(PRInt16 *aHowToEnableFrameUI)
{
NS_ENSURE_ARG_POINTER(aHowToEnableFrameUI);
*aHowToEnableFrameUI = (PRInt32)mHowToEnableFrameUI;
*aHowToEnableFrameUI = mHowToEnableFrameUI;
return NS_OK;
}
NS_IMETHODIMP nsPrintSettings::SetHowToEnableFrameUI(PRInt16 aHowToEnableFrameUI)

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

@ -98,7 +98,7 @@ protected:
PRInt16 mPrintFrameTypeUsage;
PRInt16 mPrintFrameType;
PRBool mHowToEnableFrameUI;
PRInt16 mHowToEnableFrameUI;
PRBool mIsCancelled;
PRBool mPrintSilent;
PRBool mPrintPreview;