diff options
author | Dan Albert <danalbert@google.com> | 2014-11-20 23:47:28 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-11-20 23:47:28 +0000 |
commit | d0e12a161471823d1ab269cb608be3f3b0a71ed1 (patch) | |
tree | f9a2f2ea19f528495278c1b651db5d75c8306869 /services/audioflinger | |
parent | 75cfc881e25a9d7647701526484b5885dc43c574 (diff) | |
parent | 902dc42d79b075395d484ce1c71f215b199aaa2a (diff) | |
download | frameworks_av-d0e12a161471823d1ab269cb608be3f3b0a71ed1.zip frameworks_av-d0e12a161471823d1ab269cb608be3f3b0a71ed1.tar.gz frameworks_av-d0e12a161471823d1ab269cb608be3f3b0a71ed1.tar.bz2 |
am 902dc42d: am 07715ac3: Merge "C++11 compatibility."
* commit '902dc42d79b075395d484ce1c71f215b199aaa2a':
C++11 compatibility.
Diffstat (limited to 'services/audioflinger')
-rw-r--r-- | services/audioflinger/AudioMixer.h | 12 | ||||
-rw-r--r-- | services/audioflinger/AudioResampler.h | 4 | ||||
-rw-r--r-- | services/audioflinger/AudioResamplerFirGen.h | 10 | ||||
-rw-r--r-- | services/audioflinger/StateQueue.cpp | 2 |
4 files changed, 16 insertions, 12 deletions
diff --git a/services/audioflinger/AudioMixer.h b/services/audioflinger/AudioMixer.h index 3b972bb..f4f142b 100644 --- a/services/audioflinger/AudioMixer.h +++ b/services/audioflinger/AudioMixer.h @@ -21,15 +21,15 @@ #include <stdint.h> #include <sys/types.h> +#include <hardware/audio_effect.h> +#include <media/AudioBufferProvider.h> +#include <media/nbaio/NBLog.h> +#include <system/audio.h> +#include <utils/Compat.h> #include <utils/threads.h> -#include <media/AudioBufferProvider.h> #include "AudioResampler.h" -#include <hardware/audio_effect.h> -#include <system/audio.h> -#include <media/nbaio/NBLog.h> - // FIXME This is actually unity gain, which might not be max in future, expressed in U.12 #define MAX_GAIN_INT AudioMixer::UNITY_GAIN_INT @@ -58,7 +58,7 @@ public: static const uint32_t MAX_NUM_CHANNELS_TO_DOWNMIX = AUDIO_CHANNEL_COUNT_MAX; static const uint16_t UNITY_GAIN_INT = 0x1000; - static const float UNITY_GAIN_FLOAT = 1.0f; + static const CONSTEXPR float UNITY_GAIN_FLOAT = 1.0f; enum { // names diff --git a/services/audioflinger/AudioResampler.h b/services/audioflinger/AudioResampler.h index cdc6d92..069d946 100644 --- a/services/audioflinger/AudioResampler.h +++ b/services/audioflinger/AudioResampler.h @@ -19,7 +19,9 @@ #include <stdint.h> #include <sys/types.h> + #include <cutils/compiler.h> +#include <utils/Compat.h> #include <media/AudioBufferProvider.h> #include <system/audio.h> @@ -47,7 +49,7 @@ public: DYN_HIGH_QUALITY=7, }; - static const float UNITY_GAIN_FLOAT = 1.0f; + static const CONSTEXPR float UNITY_GAIN_FLOAT = 1.0f; static AudioResampler* create(audio_format_t format, int inChannelCount, int32_t sampleRate, src_quality quality=DEFAULT_QUALITY); diff --git a/services/audioflinger/AudioResamplerFirGen.h b/services/audioflinger/AudioResamplerFirGen.h index d024b2f..f3718b6 100644 --- a/services/audioflinger/AudioResamplerFirGen.h +++ b/services/audioflinger/AudioResamplerFirGen.h @@ -17,6 +17,8 @@ #ifndef ANDROID_AUDIO_RESAMPLER_FIR_GEN_H #define ANDROID_AUDIO_RESAMPLER_FIR_GEN_H +#include "utils/Compat.h" + namespace android { /* @@ -187,22 +189,22 @@ static inline int64_t toint(double x, int64_t maxval) { template <int N> struct I0Term { - static const double value = I0Term<N-1>::value / (4. * N * N); + static const CONSTEXPR double value = I0Term<N-1>::value / (4. * N * N); }; template <> struct I0Term<0> { - static const double value = 1.; + static const CONSTEXPR double value = 1.; }; template <int N> struct I0ATerm { - static const double value = I0ATerm<N-1>::value * (2.*N-1.) * (2.*N-1.) / (8. * N); + static const CONSTEXPR double value = I0ATerm<N-1>::value * (2.*N-1.) * (2.*N-1.) / (8. * N); }; template <> struct I0ATerm<0> { // 1/sqrt(2*PI); - static const double value = 0.398942280401432677939946059934381868475858631164934657665925; + static const CONSTEXPR double value = 0.398942280401432677939946059934381868475858631164934657665925; }; #if USE_HORNERS_METHOD diff --git a/services/audioflinger/StateQueue.cpp b/services/audioflinger/StateQueue.cpp index 40d7bcd..9d4188f 100644 --- a/services/audioflinger/StateQueue.cpp +++ b/services/audioflinger/StateQueue.cpp @@ -48,7 +48,7 @@ template<typename T> StateQueue<T>::StateQueue() : , mObserverDump(&mObserverDummyDump), mMutatorDump(&mMutatorDummyDump) #endif { - atomic_init(&mNext, 0); + atomic_init(&mNext, static_cast<uintptr_t>(0)); } template<typename T> StateQueue<T>::~StateQueue() |