From 4f4d365aa598e933879081f852df9b32c2c979ee Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Wed, 9 Feb 2022 15:35:58 -0800 Subject: [PATCH] Fix cert-dcl16-c warnings Bug: 120614316 Test: make tidy-hardware-interfaces_subset Change-Id: I6bbeddb9990e4771155ec7d49a68f0e161789030 --- identity/support/include/cppbor/cppbor.h | 2 +- .../1.0/vts/functional/common/media_hidl_test_common.h | 5 ++--- sensors/common/default/2.X/Sensor.cpp | 8 ++++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/identity/support/include/cppbor/cppbor.h b/identity/support/include/cppbor/cppbor.h index a755db13a2..af5d82e8bd 100644 --- a/identity/support/include/cppbor/cppbor.h +++ b/identity/support/include/cppbor/cppbor.h @@ -274,7 +274,7 @@ class Nint : public Int { virtual std::unique_ptr clone() const override { return std::make_unique(mValue); } private: - uint64_t addlInfo() const { return -1ll - mValue; } + uint64_t addlInfo() const { return -1LL - mValue; } int64_t mValue; }; diff --git a/media/omx/1.0/vts/functional/common/media_hidl_test_common.h b/media/omx/1.0/vts/functional/common/media_hidl_test_common.h index eddf83f02d..6caac63100 100644 --- a/media/omx/1.0/vts/functional/common/media_hidl_test_common.h +++ b/media/omx/1.0/vts/functional/common/media_hidl_test_common.h @@ -203,9 +203,8 @@ struct CodecObserver : public IOmxObserver { } int64_t delayUs = finishBy - android::ALooper::GetNowUs(); if (delayUs < 0) return toStatus(android::TIMED_OUT); - (timeoutUs < 0) - ? msgCondition.wait(msgLock) - : msgCondition.waitRelative(msgLock, delayUs * 1000ll); + (timeoutUs < 0) ? msgCondition.wait(msgLock) + : msgCondition.waitRelative(msgLock, delayUs * 1000LL); } } diff --git a/sensors/common/default/2.X/Sensor.cpp b/sensors/common/default/2.X/Sensor.cpp index 23c98032d1..fd701fd399 100644 --- a/sensors/common/default/2.X/Sensor.cpp +++ b/sensors/common/default/2.X/Sensor.cpp @@ -59,10 +59,10 @@ const SensorInfo& Sensor::getSensorInfo() const { } void Sensor::batch(int64_t samplingPeriodNs) { - if (samplingPeriodNs < mSensorInfo.minDelay * 1000ll) { - samplingPeriodNs = mSensorInfo.minDelay * 1000ll; - } else if (samplingPeriodNs > mSensorInfo.maxDelay * 1000ll) { - samplingPeriodNs = mSensorInfo.maxDelay * 1000ll; + if (samplingPeriodNs < mSensorInfo.minDelay * 1000LL) { + samplingPeriodNs = mSensorInfo.minDelay * 1000LL; + } else if (samplingPeriodNs > mSensorInfo.maxDelay * 1000LL) { + samplingPeriodNs = mSensorInfo.maxDelay * 1000LL; } if (mSamplingPeriodNs != samplingPeriodNs) {