audio_processing: DestroyHandle() now returns void

The return value was not used anyhow and there is no proper action to be taken if we would have received an error. Hence, in line with issue441 we should return void upon free.

BUG=441
TESTED=trybots,modules_unittest
R=andrew@webrtc.org, aluebs@webrtc.org, kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/12269004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5949 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
bjornv@webrtc.org 2014-04-22 06:52:28 +00:00
parent 2a796720f8
commit 5964fe0f86
15 changed files with 20 additions and 23 deletions

View File

@ -351,9 +351,9 @@ void* EchoCancellationImpl::CreateHandle() const {
return handle;
}
int EchoCancellationImpl::DestroyHandle(void* handle) const {
void EchoCancellationImpl::DestroyHandle(void* handle) const {
assert(handle != NULL);
return WebRtcAec_Free(static_cast<Handle*>(handle));
WebRtcAec_Free(static_cast<Handle*>(handle));
}
int EchoCancellationImpl::InitializeHandle(void* handle) const {

View File

@ -60,7 +60,7 @@ class EchoCancellationImpl : public EchoCancellation,
virtual void* CreateHandle() const OVERRIDE;
virtual int InitializeHandle(void* handle) const OVERRIDE;
virtual int ConfigureHandle(void* handle) const OVERRIDE;
virtual int DestroyHandle(void* handle) const OVERRIDE;
virtual void DestroyHandle(void* handle) const OVERRIDE;
virtual int num_handles_required() const OVERRIDE;
virtual int GetHandleError(void* handle) const OVERRIDE;

View File

@ -260,8 +260,8 @@ void* EchoControlMobileImpl::CreateHandle() const {
return handle;
}
int EchoControlMobileImpl::DestroyHandle(void* handle) const {
return WebRtcAecm_Free(static_cast<Handle*>(handle));
void EchoControlMobileImpl::DestroyHandle(void* handle) const {
WebRtcAecm_Free(static_cast<Handle*>(handle));
}
int EchoControlMobileImpl::InitializeHandle(void* handle) const {

View File

@ -49,7 +49,7 @@ class EchoControlMobileImpl : public EchoControlMobile,
virtual void* CreateHandle() const OVERRIDE;
virtual int InitializeHandle(void* handle) const OVERRIDE;
virtual int ConfigureHandle(void* handle) const OVERRIDE;
virtual int DestroyHandle(void* handle) const OVERRIDE;
virtual void DestroyHandle(void* handle) const OVERRIDE;
virtual int num_handles_required() const OVERRIDE;
virtual int GetHandleError(void* handle) const OVERRIDE;

View File

@ -317,8 +317,8 @@ void* GainControlImpl::CreateHandle() const {
return handle;
}
int GainControlImpl::DestroyHandle(void* handle) const {
return WebRtcAgc_Free(static_cast<Handle*>(handle));
void GainControlImpl::DestroyHandle(void* handle) const {
WebRtcAgc_Free(static_cast<Handle*>(handle));
}
int GainControlImpl::InitializeHandle(void* handle) const {

View File

@ -60,7 +60,7 @@ class GainControlImpl : public GainControl,
virtual void* CreateHandle() const OVERRIDE;
virtual int InitializeHandle(void* handle) const OVERRIDE;
virtual int ConfigureHandle(void* handle) const OVERRIDE;
virtual int DestroyHandle(void* handle) const OVERRIDE;
virtual void DestroyHandle(void* handle) const OVERRIDE;
virtual int num_handles_required() const OVERRIDE;
virtual int GetHandleError(void* handle) const OVERRIDE;

View File

@ -148,9 +148,8 @@ void* HighPassFilterImpl::CreateHandle() const {
return new FilterState;
}
int HighPassFilterImpl::DestroyHandle(void* handle) const {
void HighPassFilterImpl::DestroyHandle(void* handle) const {
delete static_cast<Handle*>(handle);
return apm_->kNoError;
}
int HighPassFilterImpl::InitializeHandle(void* handle) const {

View File

@ -38,7 +38,7 @@ class HighPassFilterImpl : public HighPassFilter,
virtual void* CreateHandle() const OVERRIDE;
virtual int InitializeHandle(void* handle) const OVERRIDE;
virtual int ConfigureHandle(void* handle) const OVERRIDE;
virtual int DestroyHandle(void* handle) const OVERRIDE;
virtual void DestroyHandle(void* handle) const OVERRIDE;
virtual int num_handles_required() const OVERRIDE;
virtual int GetHandleError(void* handle) const OVERRIDE;

View File

@ -135,11 +135,10 @@ void* LevelEstimatorImpl::CreateHandle() const {
return new Level;
}
int LevelEstimatorImpl::DestroyHandle(void* handle) const {
void LevelEstimatorImpl::DestroyHandle(void* handle) const {
assert(handle != NULL);
Level* level = static_cast<Level*>(handle);
delete level;
return apm_->kNoError;
}
int LevelEstimatorImpl::InitializeHandle(void* handle) const {

View File

@ -40,7 +40,7 @@ class LevelEstimatorImpl : public LevelEstimator,
virtual void* CreateHandle() const OVERRIDE;
virtual int InitializeHandle(void* handle) const OVERRIDE;
virtual int ConfigureHandle(void* handle) const OVERRIDE;
virtual int DestroyHandle(void* handle) const OVERRIDE;
virtual void DestroyHandle(void* handle) const OVERRIDE;
virtual int num_handles_required() const OVERRIDE;
virtual int GetHandleError(void* handle) const OVERRIDE;

View File

@ -141,11 +141,11 @@ void* NoiseSuppressionImpl::CreateHandle() const {
return handle;
}
int NoiseSuppressionImpl::DestroyHandle(void* handle) const {
void NoiseSuppressionImpl::DestroyHandle(void* handle) const {
#if defined(WEBRTC_NS_FLOAT)
return WebRtcNs_Free(static_cast<Handle*>(handle));
WebRtcNs_Free(static_cast<Handle*>(handle));
#elif defined(WEBRTC_NS_FIXED)
return WebRtcNsx_Free(static_cast<Handle*>(handle));
WebRtcNsx_Free(static_cast<Handle*>(handle));
#endif
}

View File

@ -42,7 +42,7 @@ class NoiseSuppressionImpl : public NoiseSuppression,
virtual void* CreateHandle() const OVERRIDE;
virtual int InitializeHandle(void* handle) const OVERRIDE;
virtual int ConfigureHandle(void* handle) const OVERRIDE;
virtual int DestroyHandle(void* handle) const OVERRIDE;
virtual void DestroyHandle(void* handle) const OVERRIDE;
virtual int num_handles_required() const OVERRIDE;
virtual int GetHandleError(void* handle) const OVERRIDE;

View File

@ -38,7 +38,7 @@ class ProcessingComponent {
virtual void* CreateHandle() const = 0;
virtual int InitializeHandle(void* handle) const = 0;
virtual int ConfigureHandle(void* handle) const = 0;
virtual int DestroyHandle(void* handle) const = 0;
virtual void DestroyHandle(void* handle) const = 0;
virtual int num_handles_required() const = 0;
virtual int GetHandleError(void* handle) const = 0;

View File

@ -163,9 +163,8 @@ void* VoiceDetectionImpl::CreateHandle() const {
return handle;
}
int VoiceDetectionImpl::DestroyHandle(void* handle) const {
void VoiceDetectionImpl::DestroyHandle(void* handle) const {
WebRtcVad_Free(static_cast<Handle*>(handle));
return apm_->kNoError;
}
int VoiceDetectionImpl::InitializeHandle(void* handle) const {

View File

@ -47,7 +47,7 @@ class VoiceDetectionImpl : public VoiceDetection,
virtual void* CreateHandle() const OVERRIDE;
virtual int InitializeHandle(void* handle) const OVERRIDE;
virtual int ConfigureHandle(void* handle) const OVERRIDE;
virtual int DestroyHandle(void* handle) const OVERRIDE;
virtual void DestroyHandle(void* handle) const OVERRIDE;
virtual int num_handles_required() const OVERRIDE;
virtual int GetHandleError(void* handle) const OVERRIDE;