Bug 1247505 - Fix woff2 compile error on big endian. r=fredw
authorSteve Singer <steve@ssinger.info>
Sat, 13 Feb 2016 13:19:30 -0500
changeset 321514 ecf4dfdbf9e83e32299847a994f0d7993c69835c
parent 321513 889569f164d25c9b996ab036ca51333e56f766b1
child 321515 09d06de1aba41dc2ea36772cae88cef75f174730
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfredw
bugs1247505
milestone47.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 1247505 - Fix woff2 compile error on big endian. r=fredw
modules/woff2/src/store_bytes.h
--- a/modules/woff2/src/store_bytes.h
+++ b/modules/woff2/src/store_bytes.h
@@ -32,17 +32,17 @@ inline size_t StoreU32(uint8_t* dst, siz
   return offset + 4;
 }
 
 inline size_t Store16(uint8_t* dst, size_t offset, int x) {
 #if (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
   *reinterpret_cast<uint16_t*>(dst + offset) =
       ((x & 0xFF) << 8) | ((x & 0xFF00) >> 8);
 #elif (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))
-  *reinterpret_cast<uint16_t*>(dst + offset) = reinterpret_cast<uint16_t>(x);
+  *reinterpret_cast<uint16_t*>(dst + offset) = static_cast<uint16_t>(x);
 #else
   dst[offset] = x >> 8;
   dst[offset + 1] = x;
 #endif
   return offset + 2;
 }
 
 inline void StoreU32(uint32_t val, size_t* offset, uint8_t* dst) {
@@ -54,17 +54,17 @@ inline void StoreU32(uint32_t val, size_
 
 inline void Store16(int val, size_t* offset, uint8_t* dst) {
 #if (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
   *reinterpret_cast<uint16_t*>(dst + *offset) =
       ((val & 0xFF) << 8) | ((val & 0xFF00) >> 8);
   *offset += 2;
 #elif (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))
   *reinterpret_cast<uint16_t*>(dst + *offset) =
-      reinterpret_cast<uint16_t>(val);
+      static_cast<uint16_t>(val);
   *offset += 2;
 #else
   dst[(*offset)++] = val >> 8;
   dst[(*offset)++] = val;
 #endif
 }
 
 inline void StoreBytes(const uint8_t* data, size_t len,