Bug 1073003 - Fix more -Wunused-variable and -Wunused-but-set-variable warnings. r=ehsan
authorBotond Ballo <botond@mozilla.com>
Wed, 17 Dec 2014 18:05:28 -0500
changeset 248379 41c2ffa3c09d1f73669e281ace58e3b37fc042f3
parent 248378 5aefc41261b0fd4808f1d67eee51cec820f19a25
child 248380 4d942e4e68f4f584193d1860e91f7b61bc843062
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1073003
milestone37.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 1073003 - Fix more -Wunused-variable and -Wunused-but-set-variable warnings. r=ehsan
dom/fmradio/FMRadioService.cpp
hal/gonk/GonkHal.cpp
media/webrtc/signaling/src/media-conduit/WebrtcOMXH264VideoCodec.cpp
netwerk/protocol/rtsp/rtsp/RTSPSource.cpp
--- a/dom/fmradio/FMRadioService.cpp
+++ b/dom/fmradio/FMRadioService.cpp
@@ -15,16 +15,17 @@
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/FMRadioChild.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "nsIObserverService.h"
 #include "nsISettingsService.h"
 #include "nsJSUtils.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/SettingChangeNotificationBinding.h"
+#include "mozilla/DebugOnly.h"
 
 #define TUNE_THREAD_TIMEOUT_MS  5000
 
 #define BAND_87500_108000_kHz 1
 #define BAND_76000_108000_kHz 2
 #define BAND_76000_90000_kHz  3
 
 #define MOZSETTINGS_CHANGED_ID "mozsettings-changed"
@@ -775,17 +776,17 @@ FMRadioService::CancelSeek(FMRadioReplyR
   NS_DispatchToMainThread(aReplyRunnable);
 }
 
 void
 FMRadioService::SetRDSGroupMask(uint32_t aRDSGroupMask)
 {
   mRDSGroupMask = aRDSGroupMask;
   if (IsFMRadioOn() && mRDSEnabled) {
-    bool enabled = hal::EnableRDS(mRDSGroupMask | DOM_PARSED_RDS_GROUPS);
+    DebugOnly<bool> enabled = hal::EnableRDS(mRDSGroupMask | DOM_PARSED_RDS_GROUPS);
     MOZ_ASSERT(enabled);
   }
 }
 
 void
 FMRadioService::EnableRDS(FMRadioReplyRunnable* aReplyRunnable)
 {
   MOZ_ASSERT(NS_IsMainThread(), "Wrong thread!");
--- a/hal/gonk/GonkHal.cpp
+++ b/hal/gonk/GonkHal.cpp
@@ -43,16 +43,17 @@
 
 #include "base/message_loop.h"
 
 #include "Hal.h"
 #include "HalImpl.h"
 #include "HalLog.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/dom/battery/Constants.h"
+#include "mozilla/DebugOnly.h"
 #include "mozilla/FileUtils.h"
 #include "mozilla/Monitor.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/Services.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/Preferences.h"
 #include "nsAlgorithm.h"
 #include "nsPrintfCString.h"
@@ -524,17 +525,17 @@ GetCurrentBatteryCharge(int* aCharge)
   #endif
 
   return (*aCharge >= 0) && (*aCharge <= 100);
 }
 
 static bool
 GetCurrentBatteryCharging(int* aCharging)
 {
-  static const int BATTERY_NOT_CHARGING = 0;
+  static const DebugOnly<int> BATTERY_NOT_CHARGING = 0;
   static const int BATTERY_CHARGING_USB = 1;
   static const int BATTERY_CHARGING_AC  = 2;
 
   // Generic device support
 
   int chargingSrc;
   bool success =
     ReadSysFile("/sys/class/power_supply/battery/charging_source", &chargingSrc);
@@ -1308,18 +1309,18 @@ EnsureKernelLowMemKillerParamsSet()
   // notify_trigger is a single integer.   If we set notify_trigger=Z, then
   // we'll get notified when there are fewer than Z pages of memory free.  (See
   // GonkMemoryPressureMonitoring.cpp.)
 
   // Build the adj and minfree strings.
   nsAutoCString adjParams;
   nsAutoCString minfreeParams;
 
-  int32_t lowerBoundOfNextOomScoreAdj = OOM_SCORE_ADJ_MIN - 1;
-  int32_t lowerBoundOfNextKillUnderKB = 0;
+  DebugOnly<int32_t> lowerBoundOfNextOomScoreAdj = OOM_SCORE_ADJ_MIN - 1;
+  DebugOnly<int32_t> lowerBoundOfNextKillUnderKB = 0;
   int32_t countOfLowmemorykillerParametersSets = 0;
 
   long page_size = sysconf(_SC_PAGESIZE);
 
   for (int i = NUM_PROCESS_PRIORITY - 1; i >= 0; i--) {
     // The system doesn't function correctly if we're missing these prefs, so
     // crash loudly.
 
--- a/media/webrtc/signaling/src/media-conduit/WebrtcOMXH264VideoCodec.cpp
+++ b/media/webrtc/signaling/src/media-conduit/WebrtcOMXH264VideoCodec.cpp
@@ -1164,17 +1164,16 @@ WebrtcOMXH264VideoDecoder::Decode(const 
       return WEBRTC_VIDEO_CODEC_UNINITIALIZED;
     }
     CODEC_LOGD("WebrtcOMXH264VideoDecoder:%p start OMX", this);
     mOMX = omx;
   }
 
   bool feedFrame = true;
   while (feedFrame) {
-    int64_t timeUs;
     status_t err = mOMX->FillInput(aInputImage, !configured, aRenderTimeMs);
     feedFrame = (err == -EAGAIN); // No input buffer available. Try again.
   }
 
   return WEBRTC_VIDEO_CODEC_OK;
 }
 
 int32_t
--- a/netwerk/protocol/rtsp/rtsp/RTSPSource.cpp
+++ b/netwerk/protocol/rtsp/rtsp/RTSPSource.cpp
@@ -24,16 +24,17 @@
 #include <media/stagefright/foundation/AString.h>
 #include <media/stagefright/foundation/ALooper.h>
 #include <media/stagefright/foundation/AMessage.h>
 
 #include "nsDebug.h"
 #include "nsString.h"
 #include "nsStringStream.h"
 #include "nsAutoPtr.h"
+#include "mozilla/DebugOnly.h"
 
 using namespace mozilla;
 using namespace mozilla::net;
 
 namespace android {
 
 RTSPSource::RTSPSource(
         nsIStreamingProtocolListener *aListener,
@@ -590,17 +591,17 @@ void RTSPSource::onConnected(bool isSeek
         nsRefPtr<nsIStreamingProtocolMetaData> meta;
         int32_t int32Value;
         int64_t int64Value;
 
         meta = new mozilla::net::RtspMetaData();
         meta->SetTotalTracks(numTracks);
         meta->SetMimeType(mimeType);
 
-        bool success;
+        DebugOnly<bool> success;
         success = format->findInt64(kKeyDuration, &int64Value);
         MOZ_ASSERT(success);
         meta->SetDuration(int64Value);
 
         if (isAudio) {
             success = format->findInt32(kKeyChannelCount, &int32Value);
             MOZ_ASSERT(success);
             meta->SetChannelCount(int32Value);
@@ -708,17 +709,17 @@ void RTSPSource::onTrackDataAvailable(si
     }
 
     nsRefPtr<nsIStreamingProtocolMetaData> meta;
     int64_t int64Value;
 
     meta = new mozilla::net::RtspMetaData();
 
     MOZ_ASSERT(accessUnit != NULL);
-    bool success = accessUnit->meta()->findInt64("timeUs", &int64Value);
+    DebugOnly<bool> success = accessUnit->meta()->findInt64("timeUs", &int64Value);
     MOZ_ASSERT(success);
     meta->SetTimeStamp(int64Value);
 
     meta->SetFrameType(MEDIASTREAM_FRAMETYPE_NORMAL);
     data.Assign((const char *) accessUnit->data(), accessUnit->size());
 
     if (mListener) {
         mListener->OnMediaDataAvailable(trackIndex, data, data.Length(), 0, meta.get());