Bug 1411743 Resolve warnings in tests for MinGW: Cast -1 to DWORD, and ignore a result explicitly r=jimm
authorTom Ritter <tom@mozilla.com>
Wed, 25 Oct 2017 15:40:35 -0500
changeset 688107 553b2d547b68229f89f4230372fbe5a5a0309485
parent 688106 170e3ed76a389209e79b9f2200ece037950af813
child 688108 21a17ab8b0fc0af473ac0a3deb609f1192e71fb9
push id86669
push userhikezoe@mozilla.com
push dateSat, 28 Oct 2017 10:13:18 +0000
reviewersjimm
bugs1411743
milestone58.0a1
Bug 1411743 Resolve warnings in tests for MinGW: Cast -1 to DWORD, and ignore a result explicitly r=jimm MozReview-Commit-ID: 82r05lMszXd
build/win32/crashinjectdll/crashinjectdll.cpp
widget/windows/gtest/TestEMFConversion.cpp
--- a/build/win32/crashinjectdll/crashinjectdll.cpp
+++ b/build/win32/crashinjectdll/crashinjectdll.cpp
@@ -19,17 +19,17 @@ DWORD WINAPI CrashingThread(
 }
 
 BOOL WINAPI DllMain(
   HANDLE hinstDLL,
   DWORD dwReason,
   LPVOID lpvReserved
 )
 {
-  if (tid == -1)
+  if (tid == (DWORD)-1)
     // we have to crash on another thread because LoadLibrary() will
     // catch memory access errors and return failure to the calling process
     CreateThread(
                  nullptr,                // default security attributes
                  0,                      // use default stack size
                  CrashingThread,         // thread function name
                  nullptr,                // argument to thread function
                  0,                      // use default creation flags
old mode 100644
new mode 100755
--- a/widget/windows/gtest/TestEMFConversion.cpp
+++ b/widget/windows/gtest/TestEMFConversion.cpp
@@ -7,16 +7,17 @@
 #include "PDFViaEMFPrintHelper.h"
 #include "WindowsEMF.h"
 #include "gtest/gtest.h"
 #include "nsLocalFile.h"
 #include "nsFileStreams.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsString.h"
+#include "mozilla/Unused.h"
 
 using namespace mozilla;
 namespace mozilla {
 namespace widget {
 
 static already_AddRefed<nsIFile>
 GetFileViaSpecialDirectory(const char* aSpecialDirName,
                            const char* aFileName)
@@ -80,17 +81,17 @@ GetFileContents(const nsAutoString& aFil
   }
 
   int64_t size = 0;
   inputStream->GetSize(&size);
   if (size <= 0) {
     return 0;
   }
 
-  aBuf.initCapacity(size);
+  Unused << aBuf.initCapacity(size);
   uint32_t len = static_cast<uint32_t>(size);
   uint32_t read = 0;
   uint32_t haveRead = 0;
   while (len > haveRead) {
     rv = inputStream->Read(aBuf.begin() + haveRead, len - haveRead, &read);
     if (NS_FAILED(rv)) {
       return 0;
     }