Bug 1256530 - Test reinterpret_cast fix draft
authorGregory Szorc <gps@mozilla.com>
Mon, 14 Mar 2016 21:34:32 -0700
changeset 340314 53e30d2c41bbcbb7f4a8a5d00607d949eac59f92
parent 340313 6f11ec74972f89126accf02960acb27878517f2e
child 340315 cc286902146123c92386827f3d321be8ab90ab77
push id12938
push usergszorc@mozilla.com
push dateTue, 15 Mar 2016 04:41:37 +0000
bugs1256530
milestone48.0a1
Bug 1256530 - Test reinterpret_cast fix MozReview-Commit-ID: BYMnxNwVCoa
parser/html/nsHtml5Highlighter.cpp
parser/html/nsHtml5TreeBuilderCppSupplement.h
--- a/parser/html/nsHtml5Highlighter.cpp
+++ b/parser/html/nsHtml5Highlighter.cpp
@@ -643,17 +643,17 @@ nsIContent**
 nsHtml5Highlighter::AllocateContentHandle()
 {
   if (mHandlesUsed == NS_HTML5_HIGHLIGHTER_HANDLE_ARRAY_LENGTH) {
     mOldHandles.AppendElement(Move(mHandles));
     mHandles = MakeUnique<nsIContent*[]>(NS_HTML5_HIGHLIGHTER_HANDLE_ARRAY_LENGTH);
     mHandlesUsed = 0;
   }
 #ifdef DEBUG
-  mHandles[mHandlesUsed] = (nsIContent*)0xC0DEDBAD;
+  mHandles[mHandlesUsed] = reinterpret_cast<nsIContent*>(0xC0DEDBAD);
 #endif
   return &mHandles[mHandlesUsed++];
 }
 
 nsIContent**
 nsHtml5Highlighter::CreateElement(nsIAtom* aName,
                                   nsHtml5HtmlAttributes* aAttributes,
                                   nsIContent** aIntendedParent)
--- a/parser/html/nsHtml5TreeBuilderCppSupplement.h
+++ b/parser/html/nsHtml5TreeBuilderCppSupplement.h
@@ -998,17 +998,17 @@ nsHtml5TreeBuilder::AllocateContentHandl
     return nullptr;
   }
   if (mHandlesUsed == NS_HTML5_TREE_BUILDER_HANDLE_ARRAY_LENGTH) {
     mOldHandles.AppendElement(Move(mHandles));
     mHandles = MakeUnique<nsIContent*[]>(NS_HTML5_TREE_BUILDER_HANDLE_ARRAY_LENGTH);
     mHandlesUsed = 0;
   }
 #ifdef DEBUG
-  mHandles[mHandlesUsed] = (nsIContent*)0xC0DEDBAD;
+  mHandles[mHandlesUsed] = reinterpret_cast<nsIContent*>(0xC0DEDBAD);
 #endif
   return &mHandles[mHandlesUsed++];
 }
 
 bool
 nsHtml5TreeBuilder::HasScript()
 {
   uint32_t len = mOpQueue.Length();