Suppress implicit-fallthrough warnings in libaudioclient.

Add FALLTHROUGH_INTENDED for clang compiler.

Bug: 112564944
Test: build with global -Wimplicit-fallthrough.
Change-Id: Icafaff606364fe7bffaad1e9c2e763c444ea999c
gugelfrei
Chih-Hung Hsieh 6 years ago
parent f8d13dee65
commit ffe3558cb1

@ -53,7 +53,10 @@ cc_library_shared {
export_shared_lib_headers: ["libbinder"],
local_include_dirs: ["include/media", "aidl"],
header_libs: ["libaudioclient_headers"],
header_libs: [
"libaudioclient_headers",
"libbase_headers",
],
export_header_lib_headers: ["libaudioclient_headers"],
// for memory heap analysis

@ -19,6 +19,7 @@
#define LOG_TAG "AudioRecord"
#include <inttypes.h>
#include <android-base/macros.h>
#include <sys/resource.h>
#include <binder/IPCThreadState.h>
@ -1446,7 +1447,7 @@ bool AudioRecord::AudioRecordThread::threadLoop()
case NS_WHENEVER:
// Event driven: call wake() when callback notifications conditions change.
ns = INT64_MAX;
// fall through
FALLTHROUGH_INTENDED;
default:
LOG_ALWAYS_FATAL_IF(ns < 0, "processAudioBuffer() returned %" PRId64, ns);
pauseInternal(ns);

@ -22,6 +22,7 @@
#include <math.h>
#include <sys/resource.h>
#include <android-base/macros.h>
#include <audio_utils/clock.h>
#include <audio_utils/primitives.h>
#include <binder/IPCThreadState.h>
@ -2964,7 +2965,7 @@ bool AudioTrack::hasStarted()
if (mProxy->getStreamEndDone()) {
return true;
}
// fall through
FALLTHROUGH_INTENDED;
case STATE_ACTIVE:
case STATE_STOPPING:
break;
@ -3083,7 +3084,7 @@ bool AudioTrack::AudioTrackThread::threadLoop()
case NS_WHENEVER:
// Event driven: call wake() when callback notifications conditions change.
ns = INT64_MAX;
// fall through
FALLTHROUGH_INTENDED;
default:
LOG_ALWAYS_FATAL_IF(ns < 0, "processAudioBuffer() returned %" PRId64, ns);
pauseInternal(ns);

@ -17,6 +17,7 @@
#define LOG_TAG "AudioTrackShared"
//#define LOG_NDEBUG 0
#include <android-base/macros.h>
#include <private/media/AudioTrackShared.h>
#include <utils/Log.h>
@ -247,7 +248,7 @@ status_t ClientProxy::obtainBuffer(Buffer* buffer, const struct timespec *reques
ts = requested;
break;
}
// fall through
FALLTHROUGH_INTENDED;
case TIMEOUT_CONTINUE:
// FIXME we do not retry if requested < 10ms? needs documentation on this state machine
if (!measure || requested->tv_sec < total.tv_sec ||
@ -505,7 +506,7 @@ status_t AudioTrackClientProxy::waitStreamEndDone(const struct timespec *request
ts = requested;
break;
}
// fall through
FALLTHROUGH_INTENDED;
case TIMEOUT_CONTINUE:
// FIXME we do not retry if requested < 10ms? needs documentation on this state machine
if (requested->tv_sec < total.tv_sec ||

@ -16,6 +16,7 @@
#ifndef AUDIO_POLICY_HELPER_H_
#define AUDIO_POLICY_HELPER_H_
#include <android-base/macros.h>
#include <system/audio.h>
static inline
@ -81,7 +82,7 @@ void stream_type_to_audio_attributes(audio_stream_type_t streamType,
break;
case AUDIO_STREAM_ENFORCED_AUDIBLE:
attr->flags |= AUDIO_FLAG_AUDIBILITY_ENFORCED;
// intended fall through, attributes in common with STREAM_SYSTEM
FALLTHROUGH_INTENDED; // attributes in common with STREAM_SYSTEM
case AUDIO_STREAM_SYSTEM:
attr->content_type = AUDIO_CONTENT_TYPE_SONIFICATION;
attr->usage = AUDIO_USAGE_ASSISTANCE_SONIFICATION;

Loading…
Cancel
Save