Bug 1156398: Pass ProcessOrientation.cpp's unused-by-default bools to mozilla::unused. r=mwu
authorDaniel Holbert <dholbert@cs.stanford.edu>
Tue, 21 Apr 2015 10:24:34 -0700
changeset 259171 6ef45d22c467311289b484aa5a99c550ada9b7b4
parent 259170 b0b7eb86d1158d53cab2f20a73963f72bae51053
child 259172 d22a980dd1e13973adb536d10c1a541fce133c6a
child 259288 056853ed228d6fdab3c22dbcd188b6db289774f7
push id8007
push userraliiev@mozilla.com
push dateMon, 11 May 2015 19:23:16 +0000
treeherdermozilla-aurora@e2ce1aac996e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmwu
bugs1156398
milestone40.0a1
Bug 1156398: Pass ProcessOrientation.cpp's unused-by-default bools to mozilla::unused. r=mwu
widget/gonk/ProcessOrientation.cpp
--- a/widget/gonk/ProcessOrientation.cpp
+++ b/widget/gonk/ProcessOrientation.cpp
@@ -13,16 +13,17 @@
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 #include "base/basictypes.h"
 #include "mozilla/Hal.h"
+#include "mozilla/unused.h"
 #include "nsIScreen.h"
 #include "nsIScreenManager.h"
 #include "OrientationObserver.h"
 #include "ProcessOrientation.h"
 #include "mozilla/HalSensor.h"
 #include "math.h"
 #include "limits.h"
 #include "android/log.h"
@@ -316,16 +317,23 @@ ProcessOrientation::OnSensorChanged(cons
                  mAccelerationTimestampNanos +
                  PROPOSAL_MIN_TIME_SINCE_ACCELERATION_ENDED_NANOS),
      RemainingMS(now,
                  mFlatTimestampNanos +
                  PROPOSAL_MIN_TIME_SINCE_FLAT_ENDED_NANOS),
      RemainingMS(now,
                  mSwingTimestampNanos +
                  PROPOSAL_MIN_TIME_SINCE_SWING_ENDED_NANOS));
+
+  // Avoid unused-but-set compile warnings for these variables, when LOGD is
+  // a no-op, as it is by default:
+  unused << isAccelerating;
+  unused << isFlat;
+  unused << isSwinging;
+
   // Tell the listener.
   if (mProposedRotation != oldProposedRotation && mProposedRotation >= 0) {
     LOGD
       ("ProcessOrientation: Proposed rotation changed!  proposedRotation=%d, "
        "oldProposedRotation=%d",
        mProposedRotation,
        oldProposedRotation);
     return mProposedRotation;