diff --git a/browser/components/shell/WindowsUserChoice.cpp b/browser/components/shell/WindowsUserChoice.cpp index 2744a9a4269a..4d6f24704a16 100644 --- a/browser/components/shell/WindowsUserChoice.cpp +++ b/browser/components/shell/WindowsUserChoice.cpp @@ -230,7 +230,7 @@ static UniquePtr HashString(const wchar_t* inputString) { DWORD h1Acc = 0; for (int i = 0; i < blockCount; ++i) { - for (int j = 0; j < DWORDS_PER_BLOCK; ++j) { + for (size_t j = 0; j < DWORDS_PER_BLOCK; ++j) { const DWORD* C0 = C0s[j]; const DWORD* C1 = C1s[j]; @@ -385,7 +385,7 @@ bool CheckBrowserUserChoiceHashes() { const wchar_t* exts[] = {L"https", L"http", L".html", L".htm"}; - for (int i = 0; i < ArrayLength(exts); ++i) { + for (size_t i = 0; i < ArrayLength(exts); ++i) { switch (CheckUserChoiceHash(exts[i], userSid.get())) { case CheckUserChoiceHashResult::OK_V1: break; diff --git a/browser/components/shell/nsWindowsShellService.cpp b/browser/components/shell/nsWindowsShellService.cpp index bf171bb084fe..e3c4aa5bcb6b 100644 --- a/browser/components/shell/nsWindowsShellService.cpp +++ b/browser/components/shell/nsWindowsShellService.cpp @@ -1272,7 +1272,7 @@ static nsresult PinCurrentAppToTaskbarImpl(bool aCheckOnly, int shortcutCSIDLs[] = {CSIDL_COMMON_PROGRAMS, CSIDL_PROGRAMS, CSIDL_COMMON_DESKTOPDIRECTORY, CSIDL_DESKTOPDIRECTORY}; - for (int i = 0; i < ArrayLength(shortcutCSIDLs); ++i) { + for (size_t i = 0; i < ArrayLength(shortcutCSIDLs); ++i) { // GetMatchingShortcut may fail when the exe path doesn't match, even // if it refers to the same file. This should be rare, and the worst // outcome would be failure to pin, so the risk is acceptable. @@ -1539,7 +1539,7 @@ nsWindowsShellService::ClassifyShortcut(const nsAString& aPath, {FOLDERID_UserPinned, u"\\TaskBar\\", u"Taskbar"}, {FOLDERID_UserPinned, u"\\StartMenu\\", u"StartMenu"}}; - for (int i = 0; i < ArrayLength(folders); ++i) { + for (size_t i = 0; i < ArrayLength(folders); ++i) { nsAutoString knownPath; // These flags are chosen to avoid I/O, see bug 1363398. diff --git a/build/moz.configure/warnings.configure b/build/moz.configure/warnings.configure index 7b14383c9395..9823560cc173 100755 --- a/build/moz.configure/warnings.configure +++ b/build/moz.configure/warnings.configure @@ -55,7 +55,7 @@ add_warning("-Wpointer-arith") check_and_add_warning("-Wshadow-field-in-constructor-modified") # catches comparing signed/unsigned ints -add_warning("-Wsign-compare", when=not_clang_cl) +add_warning("-Wsign-compare") # catches overflow bugs, few false positives add_warning("-Wtype-limits") diff --git a/dom/media/platforms/wmf/MFTDecoder.cpp b/dom/media/platforms/wmf/MFTDecoder.cpp index ad9d29967f28..50d92e00cafa 100644 --- a/dom/media/platforms/wmf/MFTDecoder.cpp +++ b/dom/media/platforms/wmf/MFTDecoder.cpp @@ -83,7 +83,7 @@ MFTDecoder::Create(const GUID& aCategory, const GUID& aInSubtype, } auto guard = MakeScopeExit([&] { // Start from index 1, acts[0] will be stored as a RefPtr to release later. - for (int i = 1; i < actsNum; i++) { + for (UINT32 i = 1; i < actsNum; i++) { acts[i]->Release(); } CoTaskMemFree(acts); diff --git a/gfx/2d/Factory.cpp b/gfx/2d/Factory.cpp index cf18c3be274e..ebd2d8c54030 100644 --- a/gfx/2d/Factory.cpp +++ b/gfx/2d/Factory.cpp @@ -1273,7 +1273,7 @@ bool Factory::ReadbackTexture(uint8_t* aDestData, int32_t aDestStride, uint32_t width = srcDesc.Width; uint32_t height = srcDesc.Height; int bpp = BytesPerPixel(gfx::ToPixelFormat(srcDesc.Format)); - for (int y = 0; y < height; y++) { + for (uint32_t y = 0; y < height; y++) { memcpy(aDestData + aDestStride * y, (unsigned char*)(srcMap.pData) + srcMap.RowPitch * y, width * bpp); } diff --git a/gfx/layers/d3d11/CompositorD3D11.cpp b/gfx/layers/d3d11/CompositorD3D11.cpp index 964a16dae018..2a3c4915f213 100644 --- a/gfx/layers/d3d11/CompositorD3D11.cpp +++ b/gfx/layers/d3d11/CompositorD3D11.cpp @@ -1092,8 +1092,8 @@ bool CompositorD3D11::VerifyBufferSize() { return false; } - if (((swapDesc.BufferDesc.Width == mSize.width && - swapDesc.BufferDesc.Height == mSize.height) || + if (((static_cast(swapDesc.BufferDesc.Width) == mSize.width && + static_cast(swapDesc.BufferDesc.Height) == mSize.height) || mSize.width <= 0 || mSize.height <= 0) && !mVerifyBuffersFailed) { return true; diff --git a/gfx/layers/d3d11/TextureD3D11.cpp b/gfx/layers/d3d11/TextureD3D11.cpp index 023565e800d4..0ba7254e747b 100644 --- a/gfx/layers/d3d11/TextureD3D11.cpp +++ b/gfx/layers/d3d11/TextureD3D11.cpp @@ -1274,8 +1274,8 @@ bool DataTextureSourceD3D11::Update(DataSourceSurface* aSurface, mTexture->GetDesc(¤tDesc); // Make sure there's no size mismatch, if there is, recreate. - if (currentDesc.Width != mSize.width || - currentDesc.Height != mSize.height || + if (static_cast(currentDesc.Width) != mSize.width || + static_cast(currentDesc.Height) != mSize.height || currentDesc.Format != dxgiFormat) { mTexture = nullptr; // Make sure we upload the whole surface. diff --git a/gfx/layers/ipc/ContentCompositorBridgeParent.cpp b/gfx/layers/ipc/ContentCompositorBridgeParent.cpp index 44a976256f99..54abab457918 100644 --- a/gfx/layers/ipc/ContentCompositorBridgeParent.cpp +++ b/gfx/layers/ipc/ContentCompositorBridgeParent.cpp @@ -245,7 +245,7 @@ mozilla::ipc::IPCResult ContentCompositorBridgeParent::RecvCheckContentOnlyTDR( gfx::D3D11DeviceStatus status; dm->ExportDeviceInfo(&status); - if (sequenceNum == status.sequenceNumber() && !dm->HasDeviceReset()) { + if (sequenceNum == static_cast(status.sequenceNumber()) && !dm->HasDeviceReset()) { *isContentOnlyTDR = true; } diff --git a/gfx/thebes/D3D11Checks.cpp b/gfx/thebes/D3D11Checks.cpp index 91720e1b9ad2..2bf167efd3b1 100644 --- a/gfx/thebes/D3D11Checks.cpp +++ b/gfx/thebes/D3D11Checks.cpp @@ -120,7 +120,7 @@ bool D3D11Checks::DoesRenderTargetViewNeedRecreating(ID3D11Device* aDevice) { gfxCriticalNote << "DoesRecreatingMapFailed " << hexa(hr); return false; } - int resultColor = *(int*)mapped.pData; + uint32_t resultColor = *(uint32_t*)mapped.pData; deviceContext->Unmap(cpuTexture, 0); cpuTexture = nullptr; @@ -151,7 +151,7 @@ bool D3D11Checks::DoesDeviceWork() { if (GetModuleHandleW(L"igd10umd32.dll")) { const wchar_t* checkModules[] = {L"dlumd32.dll", L"dlumd11.dll", L"dlumd10.dll"}; - for (int i = 0; i < PR_ARRAY_SIZE(checkModules); i += 1) { + for (size_t i = 0; i < PR_ARRAY_SIZE(checkModules); i += 1) { if (GetModuleHandleW(checkModules[i])) { nsString displayLinkModuleVersionString; gfxWindowsPlatform::GetDLLVersion(checkModules[i], @@ -406,7 +406,7 @@ void D3D11Checks::WarnOnAdapterMismatch(ID3D11Device* device) { gfxInfo->GetAdapterVendorID(vendorID); nsresult ec; int32_t vendor = vendorID.ToInteger(&ec, 16); - if (vendor != desc.VendorId) { + if (vendor != static_cast(desc.VendorId)) { gfxCriticalNote << "VendorIDMismatch V " << hexa(vendor) << " " << hexa(desc.VendorId); } diff --git a/gfx/thebes/gfxDWriteFontList.cpp b/gfx/thebes/gfxDWriteFontList.cpp index de22739d7ae4..8046e15d94e2 100644 --- a/gfx/thebes/gfxDWriteFontList.cpp +++ b/gfx/thebes/gfxDWriteFontList.cpp @@ -1247,7 +1247,7 @@ void gfxDWriteFontList::AppendFamiliesFromCollection( sysLocIndex = 1; } for (unsigned index = 0; index < names.Length(); ++index) { - addFamily(names[index], index != sysLocIndex); + addFamily(names[index], index != static_cast(sysLocIndex)); } } } diff --git a/intl/lwbrk/nsUniscribeBreaker.cpp b/intl/lwbrk/nsUniscribeBreaker.cpp index e4298cd0c315..8110b71b11e7 100644 --- a/intl/lwbrk/nsUniscribeBreaker.cpp +++ b/intl/lwbrk/nsUniscribeBreaker.cpp @@ -118,7 +118,7 @@ void NS_GetComplexLineBreaks(const char16_t* aText, uint32_t aLength, } bool mismatch = false; - for (int i = 0; i < aLength; ++i) { + for (uint32_t i = 0; i < aLength; ++i) { if (aBreakBefore[i] != brokeredBreaks[i]) { mismatch = true; break; @@ -129,13 +129,13 @@ void NS_GetComplexLineBreaks(const char16_t* aText, uint32_t aLength, // The logging here doesn't handle surrogates, but we only have tests using // Thai currently, which is BMP-only. printf_stderr("uniscribe: "); - for (int i = 0; i < aLength; ++i) { + for (uint32_t i = 0; i < aLength; ++i) { if (aBreakBefore[i]) printf_stderr("#"); printf_stderr("%s", NS_ConvertUTF16toUTF8(aText + i, 1).get()); } printf_stderr("\n"); printf_stderr("brokered : "); - for (int i = 0; i < aLength; ++i) { + for (uint32_t i = 0; i < aLength; ++i) { if (brokeredBreaks[i]) printf_stderr("#"); printf_stderr("%s", NS_ConvertUTF16toUTF8(aText + i, 1).get()); } diff --git a/mozglue/misc/PreXULSkeletonUI.cpp b/mozglue/misc/PreXULSkeletonUI.cpp index 662165b85b00..2ed725956afc 100644 --- a/mozglue/misc/PreXULSkeletonUI.cpp +++ b/mozglue/misc/PreXULSkeletonUI.cpp @@ -315,7 +315,7 @@ static bool ProfileDbHasStartWithLastProfile(IFStream& iniContents) { bool inGeneral = false; std::string line; while (std::getline(iniContents, line)) { - int whitespace = 0; + size_t whitespace = 0; while (line.length() > whitespace && (line[whitespace] == ' ' || line[whitespace] == '\t')) { whitespace++; @@ -1000,7 +1000,7 @@ Result DrawSkeletonUI( } } - for (int i = 1; i < noPlaceholderSpans.length(); i++) { + for (size_t i = 1; i < noPlaceholderSpans.length(); i++) { int start = noPlaceholderSpans[i - 1].end + placeholderMargin; int end = noPlaceholderSpans[i].start - placeholderMargin; if (start + 2 * placeholderBorderRadius >= end) { @@ -1705,7 +1705,7 @@ static Result, PreXULSkeletonUIError> ReadRegCSSPixelSpans( Vector resultVector; double* asDoubles = reinterpret_cast(buffer.get()); - for (int i = 0; i < dataLen / (2 * sizeof(double)); i++) { + for (size_t i = 0; i < dataLen / (2 * sizeof(double)); i++) { CSSPixelSpan span = {}; span.start = *(asDoubles++); span.end = *(asDoubles++); diff --git a/security/sandbox/chromium-shim/sandbox/win/permissionsService.cpp b/security/sandbox/chromium-shim/sandbox/win/permissionsService.cpp index bdea6806123e..ccd5828ca2de 100644 --- a/security/sandbox/chromium-shim/sandbox/win/permissionsService.cpp +++ b/security/sandbox/chromium-shim/sandbox/win/permissionsService.cpp @@ -36,7 +36,7 @@ IsFlashTempFile(std::wstring aFilename, std::wstring* aFolder=nullptr) { // Assume its a flash file if the base name begins with "FlashTmp", // ends with ".tmp" and has an int in-between them. - int slashIdx = aFilename.find_last_of(L'\\'); + size_t slashIdx = aFilename.find_last_of(L'\\'); if (slashIdx != std::wstring::npos) { if (aFolder) { *aFolder = aFilename.substr(0, slashIdx + 1); diff --git a/storage/TelemetryVFS.cpp b/storage/TelemetryVFS.cpp index 65d794e0dc3b..51a01db00470 100644 --- a/storage/TelemetryVFS.cpp +++ b/storage/TelemetryVFS.cpp @@ -576,7 +576,7 @@ int xFullPathname(sqlite3_vfs* vfs, const char* zName, int nOut, char* zOut) { (zName[0] == '\\' && zName[1] == '\\' && zName[2] == '?' && zName[3] == '\\'))) { MOZ_ASSERT(nOut >= vfs->mxPathname); - MOZ_ASSERT(nOut > strlen(zName)); + MOZ_ASSERT(static_cast(nOut) > strlen(zName)); size_t index = 0; while (zName[index] != '\0') { diff --git a/toolkit/components/aboutthirdparty/tests/gtest/TestAboutThirdParty.cpp b/toolkit/components/aboutthirdparty/tests/gtest/TestAboutThirdParty.cpp index 7defc2c7acf6..c8fb9c016f57 100644 --- a/toolkit/components/aboutthirdparty/tests/gtest/TestAboutThirdParty.cpp +++ b/toolkit/components/aboutthirdparty/tests/gtest/TestAboutThirdParty.cpp @@ -104,7 +104,7 @@ TEST(AboutThirdParty, InstallLocations) }; nsTArray locations(ArrayLength(kDirectoriesUnsorted)); - for (int i = 0; i < ArrayLength(kDirectoriesUnsorted); ++i) { + for (size_t i = 0; i < ArrayLength(kDirectoriesUnsorted); ++i) { locations.EmplaceBack(kDirectoriesUnsorted[i], new InstalledApplication()); } diff --git a/toolkit/crashreporter/breakpad-client/windows/crash_generation/crash_generation_server.cc b/toolkit/crashreporter/breakpad-client/windows/crash_generation/crash_generation_server.cc index 102f47dab448..f4def22d8ff9 100644 --- a/toolkit/crashreporter/breakpad-client/windows/crash_generation/crash_generation_server.cc +++ b/toolkit/crashreporter/breakpad-client/windows/crash_generation/crash_generation_server.cc @@ -954,7 +954,7 @@ bool CrashGenerationServer::GenerateDump(const ClientInfo& client, } // Allocate AppMemory instances for exception context. - for (int i = 0; i < kExceptionAppMemoryRegions; i++) { + for (size_t i = 0; i < kExceptionAppMemoryRegions; i++) { AppMemory app_memory; app_memory.ptr = reinterpret_cast(nullptr); app_memory.length = 0; diff --git a/toolkit/crashreporter/breakpad-patches/30-sign-compare.patch b/toolkit/crashreporter/breakpad-patches/30-sign-compare.patch new file mode 100644 index 000000000000..5fbf0758105b --- /dev/null +++ b/toolkit/crashreporter/breakpad-patches/30-sign-compare.patch @@ -0,0 +1,11 @@ +--- a/src/client/windows/crash_generation/crash_generation_server.cc ++++ b/src/client/windows/crash_generation/crash_generation_server.cc +@@ -954,7 +954,7 @@ bool CrashGenerationServer::GenerateDump(const ClientInfo& client, + } + + // Allocate AppMemory instances for exception context. +- for (int i = 0; i < kExceptionAppMemoryRegions; i++) { ++ for (size_t i = 0; i < kExceptionAppMemoryRegions; i++) { + AppMemory app_memory; + app_memory.ptr = reinterpret_cast(nullptr); + app_memory.length = 0; diff --git a/toolkit/crashreporter/client/crashreporter_win.cpp b/toolkit/crashreporter/client/crashreporter_win.cpp index b33f8ff509a8..77621779e6d8 100644 --- a/toolkit/crashreporter/client/crashreporter_win.cpp +++ b/toolkit/crashreporter/client/crashreporter_win.cpp @@ -370,7 +370,7 @@ static void MaybeResizeProgressText(HWND hwndDlg) { StretchDialog(hwndDlg, diff); - for (int i = 0; i < sizeof(kDefaultAttachedBottom) / sizeof(UINT); i++) { + for (size_t i = 0; i < sizeof(kDefaultAttachedBottom) / sizeof(UINT); i++) { gAttachedBottom.insert(kDefaultAttachedBottom[i]); } } @@ -668,7 +668,7 @@ static void StretchControlsToFit(HWND hwndDlg) { RECT dlgRect; GetClientRect(hwndDlg, &dlgRect); - for (int i = 0; i < sizeof(controls) / sizeof(controls[0]); i++) { + for (size_t i = 0; i < sizeof(controls) / sizeof(controls[0]); i++) { RECT r; HWND hwndControl = GetDlgItem(hwndDlg, controls[i]); GetRelativeRect(hwndControl, hwndDlg, &r); @@ -1045,7 +1045,7 @@ string WideToUTF8(const wstring& wide, bool* success) { /* === Crashreporter UI Functions === */ bool UIInit() { - for (int i = 0; i < sizeof(kDefaultAttachedBottom) / sizeof(UINT); i++) { + for (size_t i = 0; i < sizeof(kDefaultAttachedBottom) / sizeof(UINT); i++) { gAttachedBottom.insert(kDefaultAttachedBottom[i]); } diff --git a/toolkit/mozapps/defaultagent/SetDefaultBrowser.cpp b/toolkit/mozapps/defaultagent/SetDefaultBrowser.cpp index fc9aa87ee5ae..c16255a48a57 100644 --- a/toolkit/mozapps/defaultagent/SetDefaultBrowser.cpp +++ b/toolkit/mozapps/defaultagent/SetDefaultBrowser.cpp @@ -245,7 +245,7 @@ HRESULT SetDefaultBrowserUserChoice( {L"http", urlProgID.get()}, {L".html", htmlProgID.get()}, {L".htm", htmlProgID.get()}}; - for (int i = 0; i < mozilla::ArrayLength(associations); ++i) { + for (size_t i = 0; i < mozilla::ArrayLength(associations); ++i) { if (!SetUserChoice(associations[i].ext, sid.get(), associations[i].progID)) { ok = false; diff --git a/toolkit/system/windowsproxy/ProxyUtils.cpp b/toolkit/system/windowsproxy/ProxyUtils.cpp index 37af2f8f4afc..8bfe05d458a2 100644 --- a/toolkit/system/windowsproxy/ProxyUtils.cpp +++ b/toolkit/system/windowsproxy/ProxyUtils.cpp @@ -23,7 +23,7 @@ static void NormalizeAddr(const nsACString& aAddr, nsCString& aNormalized) { nsTArray addr; ParseString(aAddr, '.', addr); aNormalized = StringJoin("."_ns, IntegerRange(4), - [&addr](nsACString& dst, const int i) { + [&addr](nsACString& dst, size_t i) { if (i < addr.Length()) { dst.Append(addr[i]); } else { diff --git a/toolkit/xre/dllservices/mozglue/interceptor/Arm64.h b/toolkit/xre/dllservices/mozglue/interceptor/Arm64.h index ebb30ecd6b22..4070fbf99f45 100644 --- a/toolkit/xre/dllservices/mozglue/interceptor/Arm64.h +++ b/toolkit/xre/dllservices/mozglue/interceptor/Arm64.h @@ -171,7 +171,7 @@ inline static Maybe BuildUnconditionalBranchImm( return Nothing(); } - int32_t signbits = offset.value() & 0xFE000000; + uint32_t signbits = static_cast(offset.value()) & 0xFE000000; // Ensure that offset is small enough to fit into the 26 bit region. // We check that the sign bits are either all ones or all zeros. MOZ_ASSERT(signbits == 0xFE000000 || !signbits); @@ -179,7 +179,7 @@ inline static Maybe BuildUnconditionalBranchImm( return Nothing(); } - int32_t masked = offset.value() & 0x03FFFFFF; + uint32_t masked = static_cast(offset.value()) & 0x03FFFFFF; // B imm26 return Some(0x14000000U | masked); diff --git a/toolkit/xre/dllservices/tests/gtest/TestUntrustedModules.cpp b/toolkit/xre/dllservices/tests/gtest/TestUntrustedModules.cpp index bebe503274ff..c155e34f3477 100644 --- a/toolkit/xre/dllservices/tests/gtest/TestUntrustedModules.cpp +++ b/toolkit/xre/dllservices/tests/gtest/TestUntrustedModules.cpp @@ -22,15 +22,15 @@ class ModuleLoadCounter final { nsTHashMap mCounters; public: - template + template ModuleLoadCounter(const nsString (&aNames)[N], const int (&aCounts)[N]) : mCounters(N) { - for (int i = 0; i < N; ++i) { + for (size_t i = 0; i < N; ++i) { mCounters.InsertOrUpdate(aNames[i], aCounts[i]); } } - template + template bool Remains(const nsString (&aNames)[N], const int (&aCounts)[N]) { EXPECT_EQ(mCounters.Count(), N); if (mCounters.Count() != N) { @@ -38,7 +38,7 @@ class ModuleLoadCounter final { } bool result = true; - for (int i = 0; i < N; ++i) { + for (size_t i = 0; i < N; ++i) { auto entry = mCounters.Lookup(aNames[i]); if (!entry) { wprintf(L"%s is not registered.\n", aNames[i].get()); diff --git a/toolkit/xre/test/gtest/TestAssembleCommandLineWin.cpp b/toolkit/xre/test/gtest/TestAssembleCommandLineWin.cpp index 39918e047ab9..6831303de633 100644 --- a/toolkit/xre/test/gtest/TestAssembleCommandLineWin.cpp +++ b/toolkit/xre/test/gtest/TestAssembleCommandLineWin.cpp @@ -135,8 +135,8 @@ TEST(WinRemoteMessage, SendReceive) receiver.Parse(v0.CopyData()); EXPECT_TRUE(NS_SUCCEEDED(receiver.CommandLineRunner()->GetLength(&len))); - EXPECT_EQ(len, ArrayLength(kExpectedArgsW)); - for (int i = 0; i < ArrayLength(kExpectedArgsW); ++i) { + EXPECT_EQ(static_cast(len), ArrayLength(kExpectedArgsW)); + for (size_t i = 0; i < ArrayLength(kExpectedArgsW); ++i) { EXPECT_TRUE( NS_SUCCEEDED(receiver.CommandLineRunner()->GetArgument(i, arg))); EXPECT_STREQ(arg.get(), kExpectedArgsW[i]); @@ -147,8 +147,8 @@ TEST(WinRemoteMessage, SendReceive) receiver.Parse(v1.CopyData()); EXPECT_TRUE(NS_SUCCEEDED(receiver.CommandLineRunner()->GetLength(&len))); - EXPECT_EQ(len, ArrayLength(kExpectedArgsW)); - for (int i = 0; i < ArrayLength(kExpectedArgsW); ++i) { + EXPECT_EQ(static_cast(len), ArrayLength(kExpectedArgsW)); + for (size_t i = 0; i < ArrayLength(kExpectedArgsW); ++i) { EXPECT_TRUE( NS_SUCCEEDED(receiver.CommandLineRunner()->GetArgument(i, arg))); EXPECT_STREQ(arg.get(), kExpectedArgsW[i]); @@ -160,8 +160,8 @@ TEST(WinRemoteMessage, SendReceive) receiver.Parse(v2.CopyData()); EXPECT_TRUE(NS_SUCCEEDED(receiver.CommandLineRunner()->GetLength(&len))); - EXPECT_EQ(len, ArrayLength(kExpectedArgsW)); - for (int i = 0; i < ArrayLength(kExpectedArgsW); ++i) { + EXPECT_EQ(static_cast(len), ArrayLength(kExpectedArgsW)); + for (size_t i = 0; i < ArrayLength(kExpectedArgsW); ++i) { EXPECT_TRUE( NS_SUCCEEDED(receiver.CommandLineRunner()->GetArgument(i, arg))); EXPECT_STREQ(arg.get(), kExpectedArgsW[i]); diff --git a/widget/windows/TSFTextStore.cpp b/widget/windows/TSFTextStore.cpp index aa34f73cb408..e0ae2c15aaf9 100644 --- a/widget/windows/TSFTextStore.cpp +++ b/widget/windows/TSFTextStore.cpp @@ -3451,8 +3451,10 @@ TSFTextStore::RecordCompositionUpdateAction() { TextRange& range = action->mRanges->ElementAt(0); LONG start = selectionForTSF->MinOffset(); LONG end = selectionForTSF->MaxOffset(); - if (range.mStartOffset == start - mComposition->StartOffset() && - range.mEndOffset == end - mComposition->StartOffset() && + if (static_cast(range.mStartOffset) == + start - mComposition->StartOffset() && + static_cast(range.mEndOffset) == + end - mComposition->StartOffset() && range.mRangeStyle.IsNoChangeStyle()) { range.mRangeStyle.Clear(); // The looks of selected type is better than others. diff --git a/xpfe/appshell/AppWindow.cpp b/xpfe/appshell/AppWindow.cpp index 3071a90356c0..df2801539f3f 100644 --- a/xpfe/appshell/AppWindow.cpp +++ b/xpfe/appshell/AppWindow.cpp @@ -1897,7 +1897,7 @@ nsresult AppWindow::MaybeSaveEarlyWindowPersistentValues( return NS_ERROR_FAILURE; } mozilla::Vector springs; - for (int i = 0; i < toolbarSprings->Length(); i++) { + for (size_t i = 0; i < toolbarSprings->Length(); i++) { RefPtr springEl = toolbarSprings->Item(i); RefPtr springRect; rv = utils->GetBoundsWithoutFlushing(springEl, getter_AddRefs(springRect));