Bug 1411142 Cast enums to int to silence warning about comparing enums of different types draft
authorTom Ritter <tom@mozilla.com>
Mon, 23 Oct 2017 23:54:21 -0500
changeset 685509 8fe09ce76248f037003c6c1d5a479b1eb2283c19
parent 682741 6265f00e1fe6300de61f3ad95c4c55df18726e61
child 685510 1d93838089448033356e8dee86951c7225d355d3
push id85957
push userbmo:tom@mozilla.com
push dateTue, 24 Oct 2017 18:55:49 +0000
bugs1411142
milestone58.0a1
Bug 1411142 Cast enums to int to silence warning about comparing enums of different types MozReview-Commit-ID: LIbuzPuZ2mr
dom/plugins/ipc/hangui/MiniShmBase.h
old mode 100644
new mode 100755
--- a/dom/plugins/ipc/hangui/MiniShmBase.h
+++ b/dom/plugins/ipc/hangui/MiniShmBase.h
@@ -125,17 +125,17 @@ public:
    */
   template<typename T> nsresult
   GetWritePtr(T*& aPtr)
   {
     if (!mWriteHeader || !mGuard) {
       return NS_ERROR_NOT_INITIALIZED;
     }
     if (sizeof(T) > mPayloadMaxLen ||
-        T::identifier <= RESERVED_CODE_LAST) {
+        (int)T::identifier <= (int)RESERVED_CODE_LAST) {
       return NS_ERROR_ILLEGAL_VALUE;
     }
     if (::WaitForSingleObject(mGuard, mTimeout) != WAIT_OBJECT_0) {
       return NS_ERROR_NOT_AVAILABLE;
     }
     mWriteHeader->mId = T::identifier;
     mWriteHeader->mPayloadLen = sizeof(T);
     aPtr = reinterpret_cast<T*>(mWriteHeader + 1);
@@ -295,17 +295,17 @@ protected:
    */
   template<typename T> nsresult
   GetWritePtrInternal(T*& aPtr)
   {
     if (!mWriteHeader) {
       return NS_ERROR_NOT_INITIALIZED;
     }
     if (sizeof(T) > mPayloadMaxLen ||
-        T::identifier > RESERVED_CODE_LAST) {
+        (int)T::identifier > (int)RESERVED_CODE_LAST) {
       return NS_ERROR_ILLEGAL_VALUE;
     }
     mWriteHeader->mId = T::identifier;
     mWriteHeader->mPayloadLen = sizeof(T);
     aPtr = reinterpret_cast<T*>(mWriteHeader + 1);
     return NS_OK;
   }