Bug 1257350 - Use intptr_t to avoid C4312 on VS2015; r=tbsaunde
authorGregory Szorc <gps@mozilla.com>
Wed, 23 Mar 2016 16:42:29 -0700
changeset 290165 52a994f0744c9b2ad154906af5bb4508ed021438
parent 290164 ae01415f56b22fc573dac4cef502d808afb3c62f
child 290166 c6eaa736782322cd3bd63ed99728164f7e4948e0
push id30114
push usercbook@mozilla.com
push dateThu, 24 Mar 2016 15:15:54 +0000
treeherdermozilla-central@24c5fbde4488 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstbsaunde
bugs1257350
milestone48.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 1257350 - Use intptr_t to avoid C4312 on VS2015; r=tbsaunde Without this, we get several warnings like: reinterpret_cast': conversion from 'int32_t' to 'void *' of greater size MozReview-Commit-ID: sy2eTB2fjs
accessible/xul/XULTreeAccessible.cpp
--- a/accessible/xul/XULTreeAccessible.cpp
+++ b/accessible/xul/XULTreeAccessible.cpp
@@ -524,17 +524,17 @@ XULTreeAccessible::GetTreeItemAccessible
   if (aRow < 0 || IsDefunct() || !mTreeView)
     return nullptr;
 
   int32_t rowCount = 0;
   nsresult rv = mTreeView->GetRowCount(&rowCount);
   if (NS_FAILED(rv) || aRow >= rowCount)
     return nullptr;
 
-  void *key = reinterpret_cast<void*>(aRow);
+  void *key = reinterpret_cast<void*>(intptr_t(aRow));
   Accessible* cachedTreeItem = mAccessibleCache.GetWeak(key);
   if (cachedTreeItem)
     return cachedTreeItem;
 
   RefPtr<Accessible> treeItem = CreateTreeItemAccessible(aRow);
   if (treeItem) {
     mAccessibleCache.Put(key, treeItem);
     Document()->BindToDocument(treeItem, nullptr);
@@ -559,17 +559,17 @@ XULTreeAccessible::InvalidateCache(int32
   if (aCount > 0)
     return;
 
   DocAccessible* document = Document();
 
   // Fire destroy event for removed tree items and delete them from caches.
   for (int32_t rowIdx = aRow; rowIdx < aRow - aCount; rowIdx++) {
 
-    void* key = reinterpret_cast<void*>(rowIdx);
+    void* key = reinterpret_cast<void*>(intptr_t(rowIdx));
     Accessible* treeItem = mAccessibleCache.GetWeak(key);
 
     if (treeItem) {
       RefPtr<AccEvent> event =
         new AccEvent(nsIAccessibleEvent::EVENT_HIDE, treeItem);
       nsEventShell::FireEvent(event);
 
       // Unbind from document, shutdown and remove from tree cache.
@@ -585,17 +585,17 @@ XULTreeAccessible::InvalidateCache(int32
   nsresult rv = mTreeView->GetRowCount(&newRowCount);
   if (NS_FAILED(rv))
     return;
 
   int32_t oldRowCount = newRowCount - aCount;
 
   for (int32_t rowIdx = newRowCount; rowIdx < oldRowCount; ++rowIdx) {
 
-    void *key = reinterpret_cast<void*>(rowIdx);
+    void *key = reinterpret_cast<void*>(intptr_t(rowIdx));
     Accessible* treeItem = mAccessibleCache.GetWeak(key);
 
     if (treeItem) {
       // Unbind from document, shutdown and remove from tree cache.
       document->UnbindFromDocument(treeItem);
       mAccessibleCache.Remove(key);
     }
   }
@@ -638,17 +638,17 @@ XULTreeAccessible::TreeViewInvalidated(i
     if (NS_FAILED(rv))
       return;
 
     endCol = colCount - 1;
   }
 
   for (int32_t rowIdx = aStartRow; rowIdx <= endRow; ++rowIdx) {
 
-    void *key = reinterpret_cast<void*>(rowIdx);
+    void *key = reinterpret_cast<void*>(intptr_t(rowIdx));
     Accessible* accessible = mAccessibleCache.GetWeak(key);
 
     if (accessible) {
       RefPtr<XULTreeItemAccessibleBase> treeitemAcc = do_QueryObject(accessible);
       NS_ASSERTION(treeitemAcc, "Wrong accessible at the given key!");
 
       treeitemAcc->RowInvalidated(aStartCol, endCol);
     }