From 88bd440ef630447d697ce1c0a9f42589f1289a3f Mon Sep 17 00:00:00 2001 From: "xians@google.com" Date: Thu, 4 Aug 2011 15:33:30 +0000 Subject: [PATCH] Removing the "initialized after" warnings. This CL tweat the order of the initialization in the constructor to adapt to the order of declaration of the members. Review URL: http://webrtc-codereview.appspot.com/92007 git-svn-id: http://webrtc.googlecode.com/svn/trunk@301 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../main/source/Dummy/audio_device_dummy.h | 2 +- .../Dummy/audio_device_utility_dummy.cc | 3 ++- .../source/Linux/audio_device_linux_alsa.cc | 26 +++++++++---------- .../source/Linux/audio_device_linux_alsa.h | 6 +---- .../Linux/audio_mixer_manager_linux_alsa.cc | 9 ++++--- .../main/source/audio_device_buffer.cc | 4 +-- .../main/source/audio_device_impl.cc | 8 +++--- .../main/test/func_test_manager.cc | 25 +++++++++++++----- 8 files changed, 47 insertions(+), 36 deletions(-) diff --git a/src/modules/audio_device/main/source/Dummy/audio_device_dummy.h b/src/modules/audio_device/main/source/Dummy/audio_device_dummy.h index 9edfc6358..e858c9684 100644 --- a/src/modules/audio_device/main/source/Dummy/audio_device_dummy.h +++ b/src/modules/audio_device/main/source/Dummy/audio_device_dummy.h @@ -155,8 +155,8 @@ private: EventWrapper& _recStartEvent; EventWrapper& _playStartEvent; - ThreadWrapper* _ptrThreadPlay; ThreadWrapper* _ptrThreadRec; + ThreadWrapper* _ptrThreadPlay; WebRtc_UWord32 _recThreadID; WebRtc_UWord32 _playThreadID; diff --git a/src/modules/audio_device/main/source/Dummy/audio_device_utility_dummy.cc b/src/modules/audio_device/main/source/Dummy/audio_device_utility_dummy.cc index f4415692e..8c1945964 100644 --- a/src/modules/audio_device/main/source/Dummy/audio_device_utility_dummy.cc +++ b/src/modules/audio_device/main/source/Dummy/audio_device_utility_dummy.cc @@ -17,7 +17,8 @@ namespace webrtc { AudioDeviceUtilityDummy::AudioDeviceUtilityDummy(const WebRtc_Word32 id) : - _critSect(*CriticalSectionWrapper::CreateCriticalSection()), _id(id), + _critSect(*CriticalSectionWrapper::CreateCriticalSection()), + _id(id), _lastError(AudioDeviceModule::kAdmErrNone) { WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, id, diff --git a/src/modules/audio_device/main/source/Linux/audio_device_linux_alsa.cc b/src/modules/audio_device/main/source/Linux/audio_device_linux_alsa.cc index 6d389cc43..42760a67b 100644 --- a/src/modules/audio_device/main/source/Linux/audio_device_linux_alsa.cc +++ b/src/modules/audio_device/main/source/Linux/audio_device_linux_alsa.cc @@ -70,11 +70,19 @@ AudioDeviceLinuxALSA::AudioDeviceLinuxALSA(const WebRtc_Word32 id) : _handlePlayout(NULL), _recSndcardBuffsize(ALSA_SNDCARD_BUFF_SIZE_REC), _playSndcardBuffsize(ALSA_SNDCARD_BUFF_SIZE_PLAY), + _samplingFreqRec(REC_SAMPLES_PER_MS), + _samplingFreqPlay(PLAY_SAMPLES_PER_MS), + _recChannels(1), + _playChannels(1), + _playbackBufferSize(0), + _recordBufferSize(0), + _recBuffer(NULL), + _playBufType(AudioDeviceModule::kAdaptiveBufferSize), _initialized(false), - _recIsInitialized(false), - _playIsInitialized(false), _recording(false), _playing(false), + _recIsInitialized(false), + _playIsInitialized(false), _startRec(false), _stopRec(false), _startPlay(false), @@ -83,11 +91,11 @@ AudioDeviceLinuxALSA::AudioDeviceLinuxALSA(const WebRtc_Word32 id) : _buffersizeFromZeroAvail(true), _buffersizeFromZeroDelay(true), _sndCardPlayDelay(0), - _sndCardRecDelay(0), - _numReadyRecSamples(0), _previousSndCardPlayDelay(0), _delayMonitorStatePlay(0), _largeDelayCountPlay(0), + _sndCardRecDelay(0), + _numReadyRecSamples(0), _bufferCheckMethodPlay(0), _bufferCheckMethodRec(0), _bufferCheckErrorsPlay(0), @@ -98,16 +106,8 @@ AudioDeviceLinuxALSA::AudioDeviceLinuxALSA(const WebRtc_Word32 id) : _playError(0), _recWarning(0), _recError(0), - _samplingFreqRec(REC_SAMPLES_PER_MS), - _samplingFreqPlay(PLAY_SAMPLES_PER_MS), - _recChannels(1), - _playChannels(1), - _playbackBufferSize(0), - _recordBufferSize(0), - _recBuffer(NULL), _playBufDelay(80), - _playBufDelayFixed(80), - _playBufType(AudioDeviceModule::kAdaptiveBufferSize) + _playBufDelayFixed(80) { WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, id, "%s created", __FUNCTION__); diff --git a/src/modules/audio_device/main/source/Linux/audio_device_linux_alsa.h b/src/modules/audio_device/main/source/Linux/audio_device_linux_alsa.h index 6f599ef4b..ecd2e12c1 100644 --- a/src/modules/audio_device/main/source/Linux/audio_device_linux_alsa.h +++ b/src/modules/audio_device/main/source/Linux/audio_device_linux_alsa.h @@ -212,8 +212,8 @@ private: EventWrapper& _recStartEvent; EventWrapper& _playStartEvent; - ThreadWrapper* _ptrThreadPlay; ThreadWrapper* _ptrThreadRec; + ThreadWrapper* _ptrThreadPlay; WebRtc_UWord32 _recThreadID; WebRtc_UWord32 _playThreadID; @@ -221,10 +221,6 @@ private: AudioMixerManagerLinuxALSA _mixerManager; - bool _usingInputDeviceIndex; - bool _usingOutputDeviceIndex; - AudioDeviceModule::WindowsDeviceType _inputDevice; - AudioDeviceModule::WindowsDeviceType _outputDevice; WebRtc_UWord16 _inputDeviceIndex; WebRtc_UWord16 _outputDeviceIndex; bool _inputDeviceIsSpecified; diff --git a/src/modules/audio_device/main/source/Linux/audio_mixer_manager_linux_alsa.cc b/src/modules/audio_device/main/source/Linux/audio_mixer_manager_linux_alsa.cc index 31d1c74d3..4f0ec75e7 100644 --- a/src/modules/audio_device/main/source/Linux/audio_mixer_manager_linux_alsa.cc +++ b/src/modules/audio_device/main/source/Linux/audio_mixer_manager_linux_alsa.cc @@ -25,9 +25,12 @@ namespace webrtc { AudioMixerManagerLinuxALSA::AudioMixerManagerLinuxALSA(const WebRtc_Word32 id) : - _critSect(*CriticalSectionWrapper::CreateCriticalSection()), _id(id), - _inputMixerHandle(NULL), _outputMixerHandle(NULL), - _inputMixerElement(NULL), _outputMixerElement(NULL) + _critSect(*CriticalSectionWrapper::CreateCriticalSection()), + _id(id), + _outputMixerHandle(NULL), + _inputMixerHandle(NULL), + _outputMixerElement(NULL), + _inputMixerElement(NULL) { WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, _id, "%s constructed", __FUNCTION__); diff --git a/src/modules/audio_device/main/source/audio_device_buffer.cc b/src/modules/audio_device/main/source/audio_device_buffer.cc index 5a77ff044..aac976384 100644 --- a/src/modules/audio_device/main/source/audio_device_buffer.cc +++ b/src/modules/audio_device/main/source/audio_device_buffer.cc @@ -39,13 +39,13 @@ AudioDeviceBuffer::AudioDeviceBuffer() : _recBytesPerSample(0), _playBytesPerSample(0), _recSamples(0), - _playSamples(0), _recSize(0), + _playSamples(0), _playSize(0), _recFile(*FileWrapper::Create()), _playFile(*FileWrapper::Create()), - _newMicLevel(0), _currentMicLevel(0), + _newMicLevel(0), _playDelayMS(0), _recDelayMS(0), _clockDrift(0), diff --git a/src/modules/audio_device/main/source/audio_device_impl.cc b/src/modules/audio_device/main/source/audio_device_impl.cc index 03eaef09e..a76e7fe8f 100644 --- a/src/modules/audio_device/main/source/audio_device_impl.cc +++ b/src/modules/audio_device/main/source/audio_device_impl.cc @@ -172,14 +172,14 @@ AudioDeviceModuleImpl::AudioDeviceModuleImpl(const WebRtc_Word32 id, const Audio _critSectEventCb(*CriticalSectionWrapper::CreateCriticalSection()), _critSectAudioCb(*CriticalSectionWrapper::CreateCriticalSection()), _ptrCbAudioDeviceObserver(NULL), + _ptrAudioDeviceUtility(NULL), + _ptrAudioDevice(NULL), _id(id), _platformAudioLayer(audioLayer), _lastProcessTime(AudioDeviceUtility::GetTimeInMS()), - _lastError(kAdmErrNone), _platformType(kPlatformNotSupported), - _ptrAudioDeviceUtility(NULL), - _ptrAudioDevice(NULL), - _initialized(false) + _initialized(false), + _lastError(kAdmErrNone) { WEBRTC_TRACE(kTraceMemory, kTraceAudioDevice, id, "%s created", __FUNCTION__); } diff --git a/src/modules/audio_device/main/test/func_test_manager.cc b/src/modules/audio_device/main/test/func_test_manager.cc index 9772af454..a37c45bca 100644 --- a/src/modules/audio_device/main/test/func_test_manager.cc +++ b/src/modules/audio_device/main/test/func_test_manager.cc @@ -101,11 +101,20 @@ void AudioEventObserver::OnWarningIsReported(const WarningCode warning) ; AudioTransportImpl::AudioTransportImpl(AudioDeviceModule* audioDevice) : - _audioDevice(audioDevice), _playFromFile(false), _fullDuplex(false), - _speakerVolume(false), _microphoneVolume(false), _speakerMute(false), - _microphoneMute(false), _microphoneBoost(false), - _loopBackMeasurements(false), _microphoneAGC(false), _recCount(0), - _playCount(0), _playFile(*FileWrapper::Create()), _audioList() + _audioDevice(audioDevice), + _playFromFile(false), + _fullDuplex(false), + _speakerVolume(false), + _speakerMute(false), + _microphoneVolume(false), + _microphoneMute(false), + _microphoneBoost(false), + _microphoneAGC(false), + _loopBackMeasurements(false), + _playFile(*FileWrapper::Create()), + _recCount(0), + _playCount(0), + _audioList() { _resampler.Reset(48000, 48000, kResamplerSynchronousStereo); } @@ -568,8 +577,10 @@ WebRtc_Word32 AudioTransportImpl::NeedMorePlayData( ; FuncTestManager::FuncTestManager() : - _audioDevice(NULL), _processThread(NULL), _audioEventObserver(NULL), - _audioTransport(NULL) + _processThread(NULL), + _audioDevice(NULL), + _audioEventObserver(NULL), + _audioTransport(NULL) { } ;