Bug 1486329 - Fix some clang-cl warnings in accessible. r=eeejay
authorXidorn Quan <me@upsuper.org>
Mon, 27 Aug 2018 15:49:01 +0000
changeset 433488 351b9c51222159656a05739ed463975451d04604
parent 433487 9837816f6c79bfe4940d825b0870ff32d3848e79
child 433489 d780fec723962fa39955f494c8a53a984fe5fa99
push id34517
push useraciure@mozilla.com
push dateTue, 28 Aug 2018 21:56:57 +0000
treeherdermozilla-central@9494c03553b9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerseeejay
bugs1486329
milestone63.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 1486329 - Fix some clang-cl warnings in accessible. r=eeejay Specifically this fixes pessimizing-move warnings and some others. Differential Revision: https://phabricator.services.mozilla.com/D4302
accessible/ipc/DocAccessibleParent.cpp
accessible/ipc/win/HandlerProvider.cpp
accessible/ipc/win/PlatformChild.cpp
accessible/ipc/win/ProxyAccessible.cpp
accessible/windows/msaa/AccessibleWrap.cpp
--- a/accessible/ipc/DocAccessibleParent.cpp
+++ b/accessible/ipc/DocAccessibleParent.cpp
@@ -755,17 +755,17 @@ DocAccessibleParent::SendParentCOMProxy(
 
   IDispatchHolder::COMPtrType ptr(mscom::ToProxyUniquePtr(std::move(wrapped)));
   IDispatchHolder holder(std::move(ptr));
   if (!PDocAccessibleParent::SendParentCOMProxy(holder)) {
     return;
   }
 
 #if defined(MOZ_CONTENT_SANDBOX)
-  mParentProxyStream = std::move(holder.GetPreservedStream());
+  mParentProxyStream = holder.GetPreservedStream();
 #endif // defined(MOZ_CONTENT_SANDBOX)
 }
 
 void
 DocAccessibleParent::SetEmulatedWindowHandle(HWND aWindowHandle)
 {
   if (!aWindowHandle && mEmulatedWindowHandle && IsTopLevel()) {
     ::DestroyWindow(mEmulatedWindowHandle);
--- a/accessible/ipc/win/HandlerProvider.cpp
+++ b/accessible/ipc/win/HandlerProvider.cpp
@@ -242,17 +242,17 @@ HandlerProvider::BuildDynamicIA2Data(Dyn
   }
 
   hr = E_UNEXPECTED;
 
   auto hasFailed = [&hr]() -> bool {
     return FAILED(hr);
   };
 
-  auto cleanup = [this, aOutIA2Data]() -> void {
+  auto cleanup = [aOutIA2Data]() -> void {
     CleanupDynamicIA2Data(*aOutIA2Data);
   };
 
   mscom::ExecuteWhen<decltype(hasFailed), decltype(cleanup)>
     onFail(hasFailed, cleanup);
 
   const VARIANT kChildIdSelf = {VT_I4};
   VARIANT varVal;
--- a/accessible/ipc/win/PlatformChild.cpp
+++ b/accessible/ipc/win/PlatformChild.cpp
@@ -65,23 +65,23 @@ PlatformChild::PlatformChild()
   mActCtxMTA = std::move(tmpActCtxMTA);
 
   mozilla::mscom::InterceptorLog::Init();
   mozilla::mscom::RegisterArrayData(sPlatformChildArrayData);
 
 
   UniquePtr<mozilla::mscom::RegisteredProxy> customProxy;
   mozilla::mscom::EnsureMTA([&customProxy]() -> void {
-    customProxy = std::move(mozilla::mscom::RegisterProxy());
+    customProxy = mozilla::mscom::RegisterProxy();
   });
   mCustomProxy = std::move(customProxy);
 
   // IA2 needs to be registered in both the main thread's STA as well as the MTA
   UniquePtr<mozilla::mscom::RegisteredProxy> ia2ProxyMTA;
   mozilla::mscom::EnsureMTA([&ia2ProxyMTA]() -> void {
-    ia2ProxyMTA = std::move(mozilla::mscom::RegisterProxy(L"ia2marshal.dll"));
+    ia2ProxyMTA = mozilla::mscom::RegisterProxy(L"ia2marshal.dll");
   });
   mIA2ProxyMTA = std::move(ia2ProxyMTA);
 }
 
 } // namespace a11y
 } // namespace mozilla
 
--- a/accessible/ipc/win/ProxyAccessible.cpp
+++ b/accessible/ipc/win/ProxyAccessible.cpp
@@ -239,17 +239,17 @@ nsIntRect
 ProxyAccessible::BoundsInCSSPixels()
 {
   RefPtr<IGeckoCustom> custom = QueryInterface<IGeckoCustom>(this);
   if (!custom) {
     return nsIntRect();
   }
 
   nsIntRect rect;
-  HRESULT hr = custom->get_boundsInCSSPixels(&rect.x, &rect.y, &rect.width, &rect.height);
+  Unused << custom->get_boundsInCSSPixels(&rect.x, &rect.y, &rect.width, &rect.height);
   return rect;
 }
 
 void
 ProxyAccessible::Language(nsString& aLocale)
 {
   aLocale.Truncate();
 
@@ -411,17 +411,17 @@ ProxyAccessible::RelationByType(Relation
   nsTArray<ProxyAccessible*> proxies;
   for (long idx = 0; idx < nTargets; idx++) {
     IUnknown* target = targets[idx];
     proxies.AppendElement(GetProxyFor(Document(), target));
     target->Release();
   }
   CoTaskMemFree(targets);
 
-  return std::move(proxies);
+  return proxies;
 }
 
 double
 ProxyAccessible::CurValue()
 {
   RefPtr<IAccessibleValue> acc = QueryInterface<IAccessibleValue>(this);
   if (!acc) {
     return UnspecifiedNaN<double>();
--- a/accessible/windows/msaa/AccessibleWrap.cpp
+++ b/accessible/windows/msaa/AccessibleWrap.cpp
@@ -1765,17 +1765,17 @@ AccessibleWrap::InvalidateHandlers()
     ASYNC_INVOKER_FOR(IHandlerControl) invoker(controller.mCtrl,
                                                Some(controller.mIsProxy));
 
     HRESULT hr = ASYNC_INVOKE(invoker, Invalidate);
 
     if (hr == CO_E_OBJNOTCONNECTED || hr == kErrorServerDied) {
       sHandlerControllers->RemoveElement(controller);
     } else {
-      NS_WARN_IF(FAILED(hr));
+      Unused << NS_WARN_IF(FAILED(hr));
     }
   }
 }
 
 bool
 AccessibleWrap::DispatchTextChangeToHandler(bool aIsInsert,
                                             const nsString& aText,
                                             int32_t aStart, uint32_t aLen)