From a5f36e70a5428d8418d26f940627baacf805a99c Mon Sep 17 00:00:00 2001 From: mogemimi Date: Fri, 5 Aug 2016 10:46:50 +0900 Subject: [PATCH] Add explicit type casts to suppress -Wformat warnings (#16306) --- cocos/audio/android/AudioEngine-inl.cpp | 2 +- cocos/audio/android/AudioMixerController.cpp | 4 ++-- cocos/audio/android/UrlAudioPlayer.cpp | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cocos/audio/android/AudioEngine-inl.cpp b/cocos/audio/android/AudioEngine-inl.cpp index 0aac0770fb..3e70d431fd 100644 --- a/cocos/audio/android/AudioEngine-inl.cpp +++ b/cocos/audio/android/AudioEngine-inl.cpp @@ -219,7 +219,7 @@ int AudioEngineImpl::play2d(const std::string &filePath ,bool loop ,float volume if (state != IAudioPlayer::State::OVER && state != IAudioPlayer::State::STOPPED) { - ALOGV("Ignore state: %d", state); + ALOGV("Ignore state: %d", static_cast(state)); return; } diff --git a/cocos/audio/android/AudioMixerController.cpp b/cocos/audio/android/AudioMixerController.cpp index d224d71823..b49ffac76e 100644 --- a/cocos/audio/android/AudioMixerController.cpp +++ b/cocos/audio/android/AudioMixerController.cpp @@ -220,7 +220,7 @@ void AudioMixerController::mixOneFrame() } else { - ALOGW("Previous state (%d) isn't PAUSED, couldn't resume!", track->getPrevState()); + ALOGW("Previous state (%d) isn't PAUSED, couldn't resume!", static_cast(track->getPrevState())); } } else if (state == Track::State::PAUSED) @@ -231,7 +231,7 @@ void AudioMixerController::mixOneFrame() } else { - ALOGW("Previous state (%d) isn't PLAYING, couldn't pause!", track->getPrevState()); + ALOGW("Previous state (%d) isn't PLAYING, couldn't pause!", static_cast(track->getPrevState())); } } else if (state == Track::State::STOPPED) diff --git a/cocos/audio/android/UrlAudioPlayer.cpp b/cocos/audio/android/UrlAudioPlayer.cpp index cb1b74a02c..6b2f76968f 100644 --- a/cocos/audio/android/UrlAudioPlayer.cpp +++ b/cocos/audio/android/UrlAudioPlayer.cpp @@ -169,7 +169,7 @@ void UrlAudioPlayer::stop() } else { - ALOGW("UrlAudioPlayer (%p, state:%d) isn't playing or paused, could not invoke stop!", this, _state); + ALOGW("UrlAudioPlayer (%p, state:%d) isn't playing or paused, could not invoke stop!", this, static_cast(_state)); } } @@ -183,7 +183,7 @@ void UrlAudioPlayer::pause() } else { - ALOGW("UrlAudioPlayer (%p, state:%d) isn't playing, could not invoke pause!", this, _state); + ALOGW("UrlAudioPlayer (%p, state:%d) isn't playing, could not invoke pause!", this, static_cast(_state)); } } @@ -197,7 +197,7 @@ void UrlAudioPlayer::resume() } else { - ALOGW("UrlAudioPlayer (%p, state:%d) isn't paused, could not invoke resume!", this, _state); + ALOGW("UrlAudioPlayer (%p, state:%d) isn't paused, could not invoke resume!", this, static_cast(_state)); } } @@ -211,7 +211,7 @@ void UrlAudioPlayer::play() } else { - ALOGW("UrlAudioPlayer (%p, state:%d) isn't paused or initialized, could not invoke play!", this, _state); + ALOGW("UrlAudioPlayer (%p, state:%d) isn't paused or initialized, could not invoke play!", this, static_cast(_state)); } }