Bug 1416086 Fix unused variable warnings when diagnostic assertions are disabled. r=baku
authorBen Kelly <ben@wanderview.com>
Fri, 10 Nov 2017 00:21:26 -0800
changeset 444427 29c29825ff3a5d6b08b5fb735af1722ff584f2aa
parent 444426 56b28c7bc989ff59dc6e076a08d175c954b3da86
child 444428 944b91410e49b8d3079b4cc14dcec0a612e0d019
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1416086
milestone58.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 1416086 Fix unused variable warnings when diagnostic assertions are disabled. r=baku
dom/clients/manager/ClientManager.cpp
--- a/dom/clients/manager/ClientManager.cpp
+++ b/dom/clients/manager/ClientManager.cpp
@@ -70,17 +70,20 @@ ClientManager::ClientManager()
 
 ClientManager::~ClientManager()
 {
   NS_ASSERT_OWNINGTHREAD(ClientManager);
 
   Shutdown();
 
   MOZ_DIAGNOSTIC_ASSERT(this == PR_GetThreadPrivate(sClientManagerThreadLocalIndex));
+
+#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
   PRStatus status =
+#endif
     PR_SetThreadPrivate(sClientManagerThreadLocalIndex, nullptr);
   MOZ_DIAGNOSTIC_ASSERT(status == PR_SUCCESS);
 }
 
 void
 ClientManager::Shutdown()
 {
   NS_ASSERT_OWNINGTHREAD(ClientManager);
@@ -166,17 +169,19 @@ ClientManager::GetOrCreateForCurrentThre
 {
   MOZ_DIAGNOSTIC_ASSERT(sClientManagerThreadLocalIndex != kBadThreadLocalIndex);
   RefPtr<ClientManager> cm =
     static_cast<ClientManager*>(PR_GetThreadPrivate(sClientManagerThreadLocalIndex));
 
   if (!cm) {
     cm = new ClientManager();
 
+#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
     PRStatus status =
+#endif
       PR_SetThreadPrivate(sClientManagerThreadLocalIndex, cm.get());
     MOZ_DIAGNOSTIC_ASSERT(status == PR_SUCCESS);
   }
 
   MOZ_ASSERT(cm);
   return cm.forget();
 }
 
@@ -188,17 +193,19 @@ ClientManager::GetWorkerPrivate() const
   return GetActor()->GetWorkerPrivate();
 }
 
 // static
 void
 ClientManager::Startup()
 {
   MOZ_ASSERT(NS_IsMainThread());
+#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
   PRStatus status =
+#endif
     PR_NewThreadPrivateIndex(&sClientManagerThreadLocalIndex, nullptr);
   MOZ_DIAGNOSTIC_ASSERT(status == PR_SUCCESS);
 }
 
 // static
 UniquePtr<ClientSource>
 ClientManager::CreateSource(ClientType aType, nsIPrincipal* aPrincipal)
 {