Bug 860457 - use uintptr_t instead of unsigned long in celldata.h; r=dholbert
authorNathan Froyd <froydnj@mozilla.com>
Wed, 10 Apr 2013 12:56:22 -0400
changeset 139644 efaa46a0e3e69a10fe55038e69dd33bca93f55b9
parent 139643 b0af4212cb8b22956fd8a5ab35e1c4ef3de975a0
child 139645 8c302ab916b3c56af80d1388cc2ceb8a10add1ea
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs860457
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 860457 - use uintptr_t instead of unsigned long in celldata.h; r=dholbert
layout/tables/celldata.h
layout/tables/nsCellMap.cpp
--- a/layout/tables/celldata.h
+++ b/layout/tables/celldata.h
@@ -3,16 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef CellData_h__
 #define CellData_h__
 
 #include "nsISupports.h"
 #include "nsCoord.h"
 #include "mozilla/gfx/Types.h"
+#include "mozilla/StandardInteger.h"
 
 class nsTableCellFrame;
 class nsCellMap;
 class BCCellData;
 
 
 #define MAX_ROWSPAN 65534 // the cellmap can not handle more.
 #define MAX_COLSPAN 1000 // limit as IE and opera do.  If this ever changes,
@@ -130,21 +131,20 @@ private:
   ~CellData(); // implemented in nsCellMap.cpp
 
 protected:
 
   // this union relies on the assumption that an object (not primitive type) does
   // not start on an odd bit boundary. If mSpan is 0 then mOrigCell is in effect
   // and the data does not represent a span. If mSpan is 1, then mBits is in
   // effect and the data represents a span.
-  // mBits must be an unsigned long because it must match the size of
-  // mOrigCell on both 32- and 64-bit platforms.
+  // mBits must match the size of mOrigCell on both 32- and 64-bit platforms.
   union {
     nsTableCellFrame* mOrigCell;
-    unsigned long     mBits;
+    uintptr_t         mBits;
   };
 };
 
 // Border Collapsing Cell Data
 enum BCBorderOwner
 {
   eTableOwner        =  0,
   eColGroupOwner     =  1,
--- a/layout/tables/nsCellMap.cpp
+++ b/layout/tables/nsCellMap.cpp
@@ -32,16 +32,18 @@ SetDamageArea(int32_t aXOrigin,
 // Empty static array used for SafeElementAt() calls on mRows.
 static nsCellMap::CellDataArray * sEmptyRow;
 
 // CellData
 
 CellData::CellData(nsTableCellFrame* aOrigCell)
 {
   MOZ_COUNT_CTOR(CellData);
+  MOZ_STATIC_ASSERT(sizeof(mOrigCell) == sizeof(mBits),
+                    "mOrigCell and mBits must be the same size");
   mOrigCell = aOrigCell;
 }
 
 CellData::~CellData()
 {
   MOZ_COUNT_DTOR(CellData);
 }