summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2018-09-13 14:16:02 -0700
committerChih-Hung Hsieh <chh@google.com>2018-09-17 12:50:12 -0700
commit2b48703770efab81143d389d7389166eb1a6c8db (patch)
treef309a4bbfbb4f716dee1af20f82ca95aa04b907e
parentf8d13dee65d3708ea527e9f565be85031d7021ba (diff)
downloadav-2b48703770efab81143d389d7389166eb1a6c8db.tar.gz
Suppress implicit-fallthrough warnings in audioflinger etc.
Add FALLTHROUGH_INTENDED for clang compiler. Bug: 112564944 Test: build with global -Wimplicit-fallthrough. Change-Id: I8875bc7ed073aae84d5df97eb39c8c745ca627ef
-rw-r--r--media/libaudioprocessing/tests/Android.mk2
-rw-r--r--media/libaudioprocessing/tests/test-resampler.cpp5
-rw-r--r--services/audioflinger/Effects.cpp2
-rw-r--r--services/audioflinger/Threads.cpp2
-rw-r--r--services/audioflinger/Tracks.cpp2
-rw-r--r--services/audiopolicy/enginedefault/Android.mk2
-rw-r--r--services/audiopolicy/enginedefault/src/Engine.cpp13
7 files changed, 17 insertions, 11 deletions
diff --git a/media/libaudioprocessing/tests/Android.mk b/media/libaudioprocessing/tests/Android.mk
index 23e1c3abe6..8e081a3379 100644
--- a/media/libaudioprocessing/tests/Android.mk
+++ b/media/libaudioprocessing/tests/Android.mk
@@ -78,6 +78,8 @@ LOCAL_SHARED_LIBRARIES := \
liblog \
libutils \
+LOCAL_HEADER_LIBRARIES := libbase_headers
+
LOCAL_MODULE := test-resampler
LOCAL_MODULE_TAGS := optional
diff --git a/media/libaudioprocessing/tests/test-resampler.cpp b/media/libaudioprocessing/tests/test-resampler.cpp
index fbc9326101..f178bdedda 100644
--- a/media/libaudioprocessing/tests/test-resampler.cpp
+++ b/media/libaudioprocessing/tests/test-resampler.cpp
@@ -27,6 +27,7 @@
#include <math.h>
#include <audio_utils/primitives.h>
#include <audio_utils/sndfile.h>
+#include <android-base/macros.h>
#include <utils/Vector.h>
#include <media/AudioBufferProvider.h>
#include <media/AudioResampler.h>
@@ -87,14 +88,14 @@ int parseCSV(const char *string, Vector<int>& values)
}
return numValues;
}
- // fall through
+ FALLTHROUGH_INTENDED;
case ',':
if (hadDigit) {
hadDigit = false;
numValues++;
break;
}
- // fall through
+ FALLTHROUGH_INTENDED;
default:
return -1;
}
diff --git a/services/audioflinger/Effects.cpp b/services/audioflinger/Effects.cpp
index a44b758fde..b3f5efd527 100644
--- a/services/audioflinger/Effects.cpp
+++ b/services/audioflinger/Effects.cpp
@@ -248,7 +248,7 @@ bool AudioFlinger::EffectModule::updateState() {
switch (mState) {
case RESTART:
reset_l();
- // FALL THROUGH
+ FALLTHROUGH_INTENDED;
case STARTING:
// clear auxiliary effect input buffer for next accumulation
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 4ca50d7286..c2320bc0ec 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -4357,7 +4357,7 @@ AudioFlinger::PlaybackThread::mixer_state AudioFlinger::MixerThread::prepareTrac
isActive = false;
break;
}
- // fall through
+ FALLTHROUGH_INTENDED;
case TrackBase::STOPPING_2:
case TrackBase::PAUSED:
case TrackBase::STOPPED:
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp
index a7c4253569..6d25fb9a5e 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -842,7 +842,7 @@ void AudioFlinger::PlaybackThread::Track::pause()
// Offloaded track was draining, we need to carry on draining when resumed
mResumeToStopping = true;
- // fall through...
+ FALLTHROUGH_INTENDED;
case ACTIVE:
case RESUMING:
mState = PAUSING;
diff --git a/services/audiopolicy/enginedefault/Android.mk b/services/audiopolicy/enginedefault/Android.mk
index cbbe30633b..837d5bb0ef 100644
--- a/services/audiopolicy/enginedefault/Android.mk
+++ b/services/audiopolicy/enginedefault/Android.mk
@@ -34,6 +34,8 @@ LOCAL_MULTILIB := $(AUDIOSERVER_MULTILIB)
LOCAL_MODULE := libaudiopolicyenginedefault
LOCAL_MODULE_TAGS := optional
+LOCAL_HEADER_LIBRARIES := libbase_headers
+
LOCAL_STATIC_LIBRARIES := \
libaudiopolicycomponents \
diff --git a/services/audiopolicy/enginedefault/src/Engine.cpp b/services/audiopolicy/enginedefault/src/Engine.cpp
index 267996c916..347641904e 100644
--- a/services/audiopolicy/enginedefault/src/Engine.cpp
+++ b/services/audiopolicy/enginedefault/src/Engine.cpp
@@ -25,6 +25,7 @@
#endif
#include "Engine.h"
+#include <android-base/macros.h>
#include <AudioPolicyManagerObserver.h>
#include <AudioPort.h>
#include <IOProfile.h>
@@ -302,7 +303,7 @@ audio_devices_t Engine::getDeviceForStrategyInt(routing_strategy strategy,
break;
}
// when in call, DTMF and PHONE strategies follow the same rules
- // FALL THROUGH
+ FALLTHROUGH_INTENDED;
case STRATEGY_PHONE:
// Force use of only devices on primary output if:
@@ -343,7 +344,7 @@ audio_devices_t Engine::getDeviceForStrategyInt(routing_strategy strategy,
device = availableOutputDevicesType & AUDIO_DEVICE_OUT_BLUETOOTH_SCO;
if (device) break;
// if SCO device is requested but no SCO device is available, fall back to default case
- // FALL THROUGH
+ FALLTHROUGH_INTENDED;
default: // FORCE_NONE
device = availableOutputDevicesType & AUDIO_DEVICE_OUT_HEARING_AID;
@@ -416,7 +417,7 @@ audio_devices_t Engine::getDeviceForStrategyInt(routing_strategy strategy,
outputDeviceTypesToIgnore);
break;
}
- // FALL THROUGH
+ FALLTHROUGH_INTENDED;
case STRATEGY_ENFORCED_AUDIBLE:
// strategy STRATEGY_ENFORCED_AUDIBLE uses same routing policy as STRATEGY_SONIFICATION
@@ -466,7 +467,7 @@ audio_devices_t Engine::getDeviceForStrategyInt(routing_strategy strategy,
}
}
// The second device used for sonification is the same as the device used by media strategy
- // FALL THROUGH
+ FALLTHROUGH_INTENDED;
case STRATEGY_ACCESSIBILITY:
if (strategy == STRATEGY_ACCESSIBILITY) {
@@ -496,7 +497,7 @@ audio_devices_t Engine::getDeviceForStrategyInt(routing_strategy strategy,
}
}
// For other cases, STRATEGY_ACCESSIBILITY behaves like STRATEGY_MEDIA
- // FALL THROUGH
+ FALLTHROUGH_INTENDED;
// FIXME: STRATEGY_REROUTING follow STRATEGY_MEDIA for now
case STRATEGY_REROUTING:
@@ -681,7 +682,7 @@ audio_devices_t Engine::getDeviceForInputSource(audio_source_t inputSource) cons
device = AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET;
break;
}
- // FALL THROUGH
+ FALLTHROUGH_INTENDED;
default: // FORCE_NONE
if (availableDeviceTypes & AUDIO_DEVICE_IN_WIRED_HEADSET) {