diff options
author | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2012-08-24 12:12:24 +0200 |
---|---|---|
committer | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2012-11-14 13:08:21 +0100 |
commit | 300b069c424e2b3cd961a0241914f822b2cccf97 (patch) | |
tree | 501148d5ef92dd65fb2d0be3b7a5da12a910f68b | |
parent | ddf144e4da3af0fc5bf4a985825dbbc778467764 (diff) |
frameworks/av: Fix build in ISO C++ 11 mode
Fix build in ISO C++ 11 mode: constructs that are being interpreted as
new string literals and const vs. constexpr
Change-Id: Ibdf4867da37b819b1a499180edcf7ad480b6b9de
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
-rw-r--r-- | include/media/ToneGenerator.h | 18 | ||||
-rwxr-xr-x | media/libstagefright/OMXCodec.cpp | 6 |
2 files changed, 14 insertions, 10 deletions
diff --git a/include/media/ToneGenerator.h b/include/media/ToneGenerator.h index 29c8fd97..ac1fce0e 100644 --- a/include/media/ToneGenerator.h +++ b/include/media/ToneGenerator.h @@ -23,6 +23,10 @@ #include <media/AudioSystem.h> #include <media/AudioTrack.h> +#if __cplusplus < 201103L && !defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(constexpr) +#define constexpr const +#endif + namespace android { class ToneGenerator { @@ -204,10 +208,10 @@ private: static const unsigned char sToneMappingTable[NUM_REGIONS-1][NUM_SUP_TONES]; - static const unsigned int TONEGEN_MAX_WAVES = 3; // Maximun number of sine waves in a tone segment - static const unsigned int TONEGEN_MAX_SEGMENTS = 12; // Maximun number of segments in a tone descriptor - static const unsigned int TONEGEN_INF = 0xFFFFFFFF; // Represents infinite time duration - static const float TONEGEN_GAIN = 0.9; // Default gain passed to WaveGenerator(). + static constexpr unsigned int TONEGEN_MAX_WAVES = 3; // Maximun number of sine waves in a tone segment + static constexpr unsigned int TONEGEN_MAX_SEGMENTS = 12; // Maximun number of segments in a tone descriptor + static constexpr unsigned int TONEGEN_INF = 0xFFFFFFFF; // Represents infinite time duration + static constexpr float TONEGEN_GAIN = 0.9; // Default gain passed to WaveGenerator(). // ToneDescriptor class contains all parameters needed to generate a tone: // - The array waveFreq[]: @@ -296,9 +300,9 @@ private: unsigned int command); private: - static const short GEN_AMP = 32000; // amplitude of generator - static const short S_Q14 = 14; // shift for Q14 - static const short S_Q15 = 15; // shift for Q15 + static constexpr short GEN_AMP = 32000; // amplitude of generator + static constexpr short S_Q14 = 14; // shift for Q14 + static constexpr short S_Q15 = 15; // shift for Q15 short mA1_Q14; // Q14 coefficient // delay line of full amplitude generator diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index 70de1749..6b1d9651 100755 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -90,9 +90,9 @@ static sp<MediaSource> InstantiateSoftwareEncoder( #undef FACTORY_CREATE_ENCODER #undef FACTORY_REF -#define CODEC_LOGI(x, ...) ALOGI("[%s] "x, mComponentName, ##__VA_ARGS__) -#define CODEC_LOGV(x, ...) ALOGV("[%s] "x, mComponentName, ##__VA_ARGS__) -#define CODEC_LOGE(x, ...) ALOGE("[%s] "x, mComponentName, ##__VA_ARGS__) +#define CODEC_LOGI(x, ...) ALOGI("[%s] " x, mComponentName, ##__VA_ARGS__) +#define CODEC_LOGV(x, ...) ALOGV("[%s] " x, mComponentName, ##__VA_ARGS__) +#define CODEC_LOGE(x, ...) ALOGE("[%s] " x, mComponentName, ##__VA_ARGS__) struct OMXCodecObserver : public BnOMXObserver { OMXCodecObserver() { |