Bug 416998: Fix the order of member variable initializers for a few constructors. sr=bz, a=schrep
authorjag@tty.nl
Mon, 18 Feb 2008 23:36:50 -0800
changeset 11852 959e904ee82a9a7a0dbd914f13278124d04140b9
parent 11851 9723c3958c8e99672b6d31a941670ddda0c5ee80
child 11853 fd041ebe568043808079941a082958642df1f404
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, schrep
bugs416998
milestone1.9b4pre
Bug 416998: Fix the order of member variable initializers for a few constructors. sr=bz, a=schrep
editor/libeditor/html/nsHTMLEditor.cpp
gfx/thebes/src/gfxAtsuiFonts.cpp
layout/generic/nsBlockReflowState.cpp
layout/printing/nsPagePrintTimer.cpp
layout/printing/nsPrintEngine.cpp
layout/style/nsStyleStruct.cpp
modules/libjar/nsJARInputStream.h
modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp
xpfe/components/download-manager/src/nsDownloadManager.cpp
--- a/editor/libeditor/html/nsHTMLEditor.cpp
+++ b/editor/libeditor/html/nsHTMLEditor.cpp
@@ -156,19 +156,19 @@ nsHTMLEditor::nsHTMLEditor()
 , mIsObjectResizingEnabled(PR_TRUE)
 , mIsResizing(PR_FALSE)
 , mIsAbsolutelyPositioningEnabled(PR_TRUE)
 , mResizedObjectIsAbsolutelyPositioned(PR_FALSE)
 , mGrabberClicked(PR_FALSE)
 , mIsMoving(PR_FALSE)
 , mSnapToGridEnabled(PR_FALSE)
 , mIsInlineTableEditingEnabled(PR_TRUE)
-, mGridSize(0)
 , mInfoXIncrement(20)
 , mInfoYIncrement(20)
+, mGridSize(0)
 {
 } 
 
 nsHTMLEditor::~nsHTMLEditor()
 {
   // remove the rules as an action listener.  Else we get a bad
   // ownership loop later on.  it's ok if the rules aren't a listener;
   // we ignore the error.
--- a/gfx/thebes/src/gfxAtsuiFonts.cpp
+++ b/gfx/thebes/src/gfxAtsuiFonts.cpp
@@ -88,17 +88,17 @@ OSStatus ATSInitializeGlyphVector(int si
 OSStatus ATSClearGlyphVector(void *glyphVectorPtr);
 #endif
 
 eFontPrefLang GetFontPrefLangFor(PRUint8 aUnicodeRange);
 
 gfxAtsuiFont::gfxAtsuiFont(MacOSFontEntry *aFontEntry,
                            const gfxFontStyle *fontStyle)
     : gfxFont(aFontEntry->Name(), fontStyle),
-      mFontStyle(fontStyle), mFontEntry(aFontEntry), mATSUStyle(nsnull),
+      mFontStyle(fontStyle), mATSUStyle(nsnull), mFontEntry(aFontEntry),
       mHasMirroring(PR_FALSE), mHasMirroringLookedUp(PR_FALSE), mAdjustedSize(0.0f)
 {
     ATSUFontID fontID = mFontEntry->GetFontID();
     ATSFontRef fontRef = FMGetATSFontRefFromFont(fontID);
 
     InitMetrics(fontID, fontRef);
 
     mFontFace = cairo_atsui_font_face_create_for_atsu_font_id(fontID);
--- a/layout/generic/nsBlockReflowState.cpp
+++ b/layout/generic/nsBlockReflowState.cpp
@@ -63,21 +63,21 @@ nsBlockReflowState::nsBlockReflowState(c
                                        nsBlockFrame* aFrame,
                                        const nsHTMLReflowMetrics& aMetrics,
                                        PRBool aTopMarginRoot,
                                        PRBool aBottomMarginRoot,
                                        PRBool aBlockNeedsSpaceManager)
   : mBlock(aFrame),
     mPresContext(aPresContext),
     mReflowState(aReflowState),
+    mOverflowTracker(aPresContext, aFrame, PR_FALSE),
     mPrevBottomMargin(),
     mLineNumber(0),
     mFlags(0),
-    mFloatBreakType(NS_STYLE_CLEAR_NONE),
-    mOverflowTracker(aPresContext, aFrame, PR_FALSE)
+    mFloatBreakType(NS_STYLE_CLEAR_NONE)
 {
   SetFlag(BRS_ISFIRSTINFLOW, aFrame->GetPrevInFlow() == nsnull);
   SetFlag(BRS_ISOVERFLOWCONTAINER,
           IS_TRUE_OVERFLOW_CONTAINER(aFrame));
 
   const nsMargin& borderPadding = BorderPadding();
 
   if (aTopMarginRoot || 0 != aReflowState.mComputedBorderPadding.top) {
--- a/layout/printing/nsPagePrintTimer.cpp
+++ b/layout/printing/nsPagePrintTimer.cpp
@@ -39,18 +39,18 @@
 #include "nsIContentViewer.h"
 #include "nsIServiceManager.h"
 #include "nsPrintEngine.h"
 
 NS_IMPL_ISUPPORTS1(nsPagePrintTimer, nsITimerCallback)
 
 nsPagePrintTimer::nsPagePrintTimer() :
   mPrintEngine(nsnull),
-  mPrintObj(nsnull),
-  mDelay(0)
+  mDelay(0),
+  mPrintObj(nsnull)
 {
 }
 
 nsPagePrintTimer::~nsPagePrintTimer()
 {
   // "Destroy" the document viewer; this normally doesn't actually
   // destroy it because of the IncrementDestroyRefCount call below
   // XXX This is messy; the document viewer should use a single approach
--- a/layout/printing/nsPrintEngine.cpp
+++ b/layout/printing/nsPrintEngine.cpp
@@ -221,28 +221,28 @@ static NS_DEFINE_CID(kWidgetCID,        
 NS_IMPL_ISUPPORTS1(nsPrintEngine, nsIObserver)
 
 //---------------------------------------------------
 //-- nsPrintEngine Class Impl
 //---------------------------------------------------
 nsPrintEngine::nsPrintEngine() :
   mIsCreatingPrintPreview(PR_FALSE),
   mIsDoingPrinting(PR_FALSE),
+  mIsDoingPrintPreview(PR_FALSE),
+  mProgressDialogIsShown(PR_FALSE),
   mDocViewerPrint(nsnull),
   mContainer(nsnull),
   mDeviceContext(nsnull),
   mPrt(nsnull),
   mPagePrintTimer(nsnull),
   mPageSeqFrame(nsnull),
-  mIsDoingPrintPreview(PR_FALSE),
   mParentWidget(nsnull),
   mPrtPreview(nsnull),
   mOldPrtPreview(nsnull),
-  mDebugFile(nsnull),
-  mProgressDialogIsShown(PR_FALSE)
+  mDebugFile(nsnull)
 {
 }
 
 //-------------------------------------------------------
 nsPrintEngine::~nsPrintEngine()
 {
   Destroy(); // for insurance
 }
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -122,18 +122,18 @@ nsStyleFont::nsStyleFont(const nsFont& a
 
 nsStyleFont::nsStyleFont(const nsStyleFont& aSrc)
   : mFont(aSrc.mFont)
   , mSize(aSrc.mSize)
   , mFlags(aSrc.mFlags)
 #ifdef MOZ_MATHML
   , mScriptLevel(aSrc.mScriptLevel)
   , mScriptUnconstrainedSize(aSrc.mScriptUnconstrainedSize)
+  , mScriptMinSize(aSrc.mScriptMinSize)
   , mScriptSizeMultiplier(aSrc.mScriptSizeMultiplier)
-  , mScriptMinSize(aSrc.mScriptMinSize)
 #endif
 {
 }
 
 nsStyleFont::nsStyleFont(nsPresContext* aPresContext)
   : mFont(*(aPresContext->GetDefaultFont(kPresContext_DefaultVariableFont_ID))),
     mFlags(NS_STYLE_FONT_DEFAULT)
 {
--- a/modules/libjar/nsJARInputStream.h
+++ b/modules/libjar/nsJARInputStream.h
@@ -48,17 +48,17 @@
  * object returned by calls to nsJAR::GetInputStream(filename) for the
  * purpose of reading a file item out of a JAR file. 
  *------------------------------------------------------------------------*/
 class nsJARInputStream : public nsIInputStream
 {
   public:
     nsJARInputStream() : 
         mFd(nsnull), mInSize(0), mCurPos(0),
-        mClosed(PR_FALSE), mInflate(nsnull), mDirectory(0) { }
+        mInflate(nsnull), mDirectory(0), mClosed(PR_FALSE) { }
     
     ~nsJARInputStream() { Close(); }
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSIINPUTSTREAM
    
     // takes ownership of |fd|, even on failure
     nsresult InitFile(nsZipArchive* aZip, nsZipItem *item, PRFileDesc *fd);
--- a/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp
+++ b/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp
@@ -112,19 +112,19 @@ mailing address.
 // This is an adaptor between GIF2 and imgIDecoder
 
 NS_IMPL_ISUPPORTS1(nsGIFDecoder2, imgIDecoder)
 
 nsGIFDecoder2::nsGIFDecoder2()
   : mCurrentRow(-1)
   , mLastFlushedRow(-1)
   , mImageData(nsnull)
+  , mOldColor(0)
   , mCurrentPass(0)
   , mLastFlushedPass(0)
-  , mOldColor(0)
   , mGIFOpen(PR_FALSE)
   , mSawTransparency(PR_FALSE)
 {
   // Clear out the structure, excluding the arrays
   memset(&mGIFStruct, 0, sizeof(mGIFStruct));
 }
 
 nsGIFDecoder2::~nsGIFDecoder2()
--- a/xpfe/components/download-manager/src/nsDownloadManager.cpp
+++ b/xpfe/components/download-manager/src/nsDownloadManager.cpp
@@ -395,18 +395,18 @@ nsDownloadManager::AssertProgressInfoFor
     rv = mDataSource->Assert(res, gNC_ProgressPercent, intLiteral, PR_TRUE);
   if (NS_FAILED(rv)) return rv;
 
   // update transferred
   nsDownload::TransferInformation transferInfo =
                                  internalDownload->GetTransferInformation();
 
   // convert from bytes to kbytes for progress display
-  PRInt64 current = (PRFloat64)transferInfo.mCurrBytes / 1024 + .5;
-  PRInt64 max = (PRFloat64)transferInfo.mMaxBytes / 1024 + .5;
+  PRInt64 current = (transferInfo.mCurrBytes + 512) / 1024;
+  PRInt64 max = (transferInfo.mMaxBytes + 512) / 1024;
 
   nsAutoString currBytes; currBytes.AppendInt(current);
   nsAutoString maxBytes; maxBytes.AppendInt(max);
   const PRUnichar *strings[] = {
     currBytes.get(),
     maxBytes.get()
   };
   
@@ -901,18 +901,18 @@ nsDownload::nsDownload(nsDownloadManager
                          mTarget(aTarget),
                          mSource(aSource),
                          mCancelable(aCancelable),
                          mDownloadState(NOTSTARTED),
                          mPercentComplete(0),
                          mCurrBytes(LL_ZERO),
                          mMaxBytes(LL_ZERO),
                          mStartTime(LL_ZERO),
-                         mSpeed(0),
-                         mLastUpdate(PR_Now() - (PRUint32)gInterval)
+                         mLastUpdate(PR_Now() - (PRUint32)gInterval),
+                         mSpeed(0)
 {
 }
 
 nsDownload::~nsDownload()
 {  
   nsCAutoString path;
   nsresult rv = GetFilePathUTF8(mTarget, path);
   if (NS_FAILED(rv)) return;