From 5cdec9e3996c59a0e40d8891de456f7e3c8baa04 Mon Sep 17 00:00:00 2001 From: "andrew@webrtc.org" Date: Tue, 16 Aug 2011 16:39:32 +0000 Subject: [PATCH] Fix common_audio warnings. - Unused variable. - Explicit operator precedence. Review URL: http://webrtc-codereview.appspot.com/112004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@380 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/common_audio/resampler/main/interface/resampler.h | 2 ++ src/common_audio/resampler/main/source/resampler.cc | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/common_audio/resampler/main/interface/resampler.h b/src/common_audio/resampler/main/interface/resampler.h index a03ff1803..b91009808 100644 --- a/src/common_audio/resampler/main/interface/resampler.h +++ b/src/common_audio/resampler/main/interface/resampler.h @@ -21,6 +21,8 @@ namespace webrtc { +// TODO(andrew): the implementation depends on the exact values of this enum. +// It should be rewritten in a less fragile way. enum ResamplerType { // 4 MSB = Number of channels diff --git a/src/common_audio/resampler/main/source/resampler.cc b/src/common_audio/resampler/main/source/resampler.cc index f86673975..b7d9ead82 100644 --- a/src/common_audio/resampler/main/source/resampler.cc +++ b/src/common_audio/resampler/main/source/resampler.cc @@ -62,8 +62,9 @@ Resampler::Resampler(int inFreq, int outFreq, ResamplerType type) slave_left_ = NULL; slave_right_ = NULL; - int res = Reset(inFreq, outFreq, type); - + // TODO(andrew): looks like this class should use an init method + // (and possibly a static create). + Reset(inFreq, outFreq, type); } Resampler::~Resampler() @@ -185,7 +186,8 @@ int Resampler::Reset(int inFreq, int outFreq, ResamplerType type) if ((my_type_ & 0xf0) == 0x20) { // Change type to mono - type = (ResamplerType)((int)type & 0x0f + 0x10); + type = static_cast( + ((static_cast(type) & 0x0f) + 0x10)); slave_left_ = new Resampler(inFreq, outFreq, type); slave_right_ = new Resampler(inFreq, outFreq, type); }