Bug 1540357 - Fix implicit int truncation in dom/canvas's xpcom/* includes. r=mccr8
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 02 Apr 2019 17:00:51 +0000
changeset 467636 54d64288d7de94ed6ea0f1f6e5be9bdb605e3a29
parent 467635 c941cc70ee3e8a3f64c6c799535f63d48793c5d6
child 467637 093c37e856fbcfa76a3ae067fbd99278303b62b9
push id112638
push userdvarga@mozilla.com
push dateWed, 03 Apr 2019 06:18:49 +0000
treeherdermozilla-inbound@7dd52a4bdab5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1540357
milestone68.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 1540357 - Fix implicit int truncation in dom/canvas's xpcom/* includes. r=mccr8 Depends on D25499 Differential Revision: https://phabricator.services.mozilla.com/D25500
xpcom/reflect/xptinfo/xptinfo.h
--- a/xpcom/reflect/xptinfo/xptinfo.h
+++ b/xpcom/reflect/xptinfo/xptinfo.h
@@ -208,17 +208,17 @@ struct nsXPTType {
   uint8_t ArgNum() const {
     MOZ_ASSERT(Tag() == TD_INTERFACE_IS_TYPE || Tag() == TD_PSTRING_SIZE_IS ||
                Tag() == TD_PWSTRING_SIZE_IS || Tag() == TD_LEGACY_ARRAY);
     return mData1;
   }
 
  private:
   // Helper for reading 16-bit data values split between mData1 and mData2.
-  uint16_t Data16() const { return ((uint16_t)mData1 << 8) | mData2; }
+  uint16_t Data16() const { return static_cast<uint16_t>(mData1 << 8) | mData2; }
 
  public:
   // Get the type of the element in the current array or sequence. Arrays only
   // fit 8 bits of type data, while sequences support up to 16 bits of type data
   // due to not needing to store an ArgNum.
   const nsXPTType& ArrayElementType() const {
     if (Tag() == TD_LEGACY_ARRAY) {
       return xpt::detail::GetType(mData2);