Removed default cases causing clang errors, -Wcovered-switch-default.

BUG=
TEST=Bulid with clang version 3.1 (trunk 148911)

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1604 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
mflodman@webrtc.org 2012-02-06 10:11:25 +00:00
parent 5eeaa38573
commit c80d9d9361
32 changed files with 48 additions and 230 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -229,9 +229,6 @@ libyuv::RotationMode ConvertRotationMode(VideoRotationMode rotation) {
return libyuv::kRotate180;
case kRotate270:
return libyuv::kRotate270;
default:
assert(false);
return libyuv::kRotate0;
}
}
@ -268,9 +265,6 @@ int ConvertVideoType(VideoType video_type) {
return libyuv::FOURCC_ARGB;
case kBGRA:
return libyuv::FOURCC_BGRA;
default:
assert(false);
return libyuv::FOURCC_ANY;
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -58,8 +58,6 @@ WebRtc_Word32 WebRtcIsac_InitBandwidthEstimator(
bwest_str->send_bw_avg = INIT_BN_EST_SWB;
break;
}
default:
return -1;
}
switch(decoderSampRate)
@ -86,8 +84,6 @@ WebRtc_Word32 WebRtcIsac_InitBandwidthEstimator(
bwest_str->rec_header_rate = INIT_HDR_RATE_SWB;
break;
}
default:
return -1;
}
bwest_str->prev_rec_rtp_number = 0;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -676,8 +676,6 @@ WebRtc_Word16 WebRtcIsac_Encode(
streamLenUB = 0;
break;
}
default:
return -1;
}
if((streamLenUB < 0) &&
@ -1666,8 +1664,6 @@ WebRtc_Word16 WebRtcIsac_DecodePlc(
numSamples = 960 * noOfLostFrames;
break;
}
default:
return -1;
}
/* Set output samples to zero */

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -417,10 +417,6 @@ ACMNetEQ::SetPlayoutMode(
case streaming:
playoutMode = kPlayoutStreaming;
break;
default:
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, _id,
"SetPlayoutMode: NetEq Error playout mode not recognized");
return -1;
}
if(WebRtcNetEQ_SetPlayoutMode(_inst[idx], playoutMode) < 0)
{
@ -1243,10 +1239,6 @@ ACMNetEQ::AddSlave(
case streaming:
playoutMode = kPlayoutStreaming;
break;
default:
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, _id,
"AddSlave: NetEq Error, playout mode not recognized");
return -1;
}
if(WebRtcNetEQ_SetPlayoutMode(_inst[slaveIdx], playoutMode) < 0)
{

View File

@ -396,13 +396,6 @@ AudioCodingModuleImpl::Process()
_isFirstRED = true;
break;
}
default:
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, _id,
"Process(): Wrong Encoding-Type");
return -1;
}
}
hasDataToSend = true;
_previousPayloadType = currentPayloadType;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -1979,7 +1979,6 @@ void AudioDeviceLinuxPulse::PaContextStateCallbackHandler(pa_context *c)
case PA_CONTEXT_CONNECTING:
case PA_CONTEXT_AUTHORIZING:
case PA_CONTEXT_SETTING_NAME:
default:
WEBRTC_TRACE(kTraceDebug, kTraceAudioDevice, _id,
" no state");
break;
@ -2127,10 +2126,6 @@ void AudioDeviceLinuxPulse::PaStreamStateCallbackHandler(pa_stream *p)
WEBRTC_TRACE(kTraceDebug, kTraceAudioDevice, _id,
" creating");
break;
default:
WEBRTC_TRACE(kTraceDebug, kTraceAudioDevice, _id,
" no state");
break;
case PA_STREAM_FAILED:
case PA_STREAM_TERMINATED:
WEBRTC_TRACE(kTraceDebug, kTraceAudioDevice, _id,

View File

@ -32,8 +32,6 @@ WebRtc_Word16 MapSetting(EchoCancellation::SuppressionLevel level) {
return kAecNlpModerate;
case EchoCancellation::kHighSuppression:
return kAecNlpAggressive;
default:
return -1;
}
}

View File

@ -36,8 +36,6 @@ WebRtc_Word16 MapSetting(EchoControlMobile::RoutingMode mode) {
return 3;
case EchoControlMobile::kLoudSpeakerphone:
return 4;
default:
return -1;
}
}

View File

@ -47,8 +47,6 @@ WebRtc_Word16 MapSetting(GainControl::Mode mode) {
case GainControl::kFixedDigital:
return kAgcModeFixedDigital;
break;
default:
return -1;
}
}
} // namespace

View File

@ -41,8 +41,6 @@ int MapSetting(NoiseSuppression::Level level) {
return 2;
case NoiseSuppression::kVeryHigh:
return 3;
default:
return -1;
}
}
} // namespace

View File

@ -37,8 +37,6 @@ int MapSetting(VoiceDetection::Likelihood likelihood) {
case VoiceDetection::kHighLikelihood:
return 0;
break;
default:
return -1;
}
}
} // namespace

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -202,9 +202,9 @@ WebRtc_Word32 MediaFileImpl::PlayoutData(WebRtc_Word8* buffer,
return 0;
}
break;
#ifdef WEBRTC_MODULE_UTILITY_VIDEO
case kFileFormatAviFile:
{
#ifdef WEBRTC_MODULE_UTILITY_VIDEO
if(video)
{
bytesRead = _ptrFileUtilityObj->ReadAviVideoData(
@ -218,13 +218,13 @@ WebRtc_Word32 MediaFileImpl::PlayoutData(WebRtc_Word8* buffer,
bufferLengthInBytes);
}
break;
}
#endif
default:
#else
WEBRTC_TRACE(kTraceError, kTraceFile, _id,
"Playing file, but file format invalid!");
"Invalid file format: %d", kFileFormatAviFile);
assert(false);
break;
#endif
}
}
if( bytesRead > 0)
@ -630,9 +630,9 @@ WebRtc_Word32 MediaFileImpl::StartPlayingStream(
_fileFormat = kFileFormatPreencodedFile;
break;
}
#ifdef WEBRTC_MODULE_UTILITY_VIDEO
case kFileFormatAviFile:
{
#ifdef WEBRTC_MODULE_UTILITY_VIDEO
if(_ptrFileUtilityObj->InitAviReading( filename, videoOnly, loop))
{
WEBRTC_TRACE(kTraceError, kTraceFile, _id,
@ -646,14 +646,12 @@ WebRtc_Word32 MediaFileImpl::StartPlayingStream(
_fileFormat = kFileFormatAviFile;
break;
}
#endif
default:
{
#else
WEBRTC_TRACE(kTraceError, kTraceFile, _id,
"Invalid file format specified!");
StopPlaying();
return -1;
"Invalid file format: %d", kFileFormatAviFile);
assert(false);
break;
#endif
}
}
if(_ptrFileUtilityObj->codec_info(codec_info_) == -1)
@ -813,8 +811,8 @@ WebRtc_Word32 MediaFileImpl::IncomingAudioVideoData(
bytesWritten = _ptrFileUtilityObj->WritePreEncodedData(
*_ptrOutStream, buffer, bufferLengthInBytes);
break;
#ifdef WEBRTC_MODULE_UTILITY_VIDEO
case kFileFormatAviFile:
#ifdef WEBRTC_MODULE_UTILITY_VIDEO
if(video)
{
bytesWritten = _ptrFileUtilityObj->WriteAviVideoData(
@ -825,11 +823,12 @@ WebRtc_Word32 MediaFileImpl::IncomingAudioVideoData(
buffer, bufferLengthInBytes);
}
break;
#endif
default:
#else
WEBRTC_TRACE(kTraceError, kTraceFile, _id,
"recording active, but file format invalid!");
"Invalid file format: %d", kFileFormatAviFile);
assert(false);
break;
#endif
}
} else {
// TODO (hellner): quick look at the code makes me think that this

View File

@ -2033,8 +2033,6 @@ ModuleRtpRtcpImpl::SendNACK(const WebRtc_UWord16* nackList,
return _rtcpSender.SendRTCP(kRtcpNack, size, nackList);
case kNackOff:
return -1;
default:
assert(false);
};
return -1;
}
@ -2259,9 +2257,6 @@ WebRtc_Word32 ModuleRtpRtcpImpl::RequestKeyFrame(const FrameType frameType) {
_rtcpReceiver.RTT(_rtpReceiver.SSRC(), &RTT, NULL, NULL, NULL);
return _rtcpSender.SendRTCP(kRtcpFir, 0, NULL, RTT);
}
default:
assert(false);
return -1;
}
}

View File

@ -39,12 +39,15 @@ FilePlayer* FilePlayer::CreateFilePlayer(WebRtc_UWord32 instanceID,
case kFileFormatPcm32kHzFile:
// audio formats
return new FilePlayerImpl(instanceID, fileFormat);
#ifdef WEBRTC_MODULE_UTILITY_VIDEO
case kFileFormatAviFile:
#ifdef WEBRTC_MODULE_UTILITY_VIDEO
return new VideoFilePlayerImpl(instanceID, fileFormat);
#endif
default:
#else
WEBRTC_TRACE(kTraceError, kTraceFile, -1,
"Invalid file format: %d", kFileFormatAviFile);
assert(false);
return NULL;
#endif
}
}

View File

@ -41,12 +41,15 @@ FileRecorder* FileRecorder::CreateFileRecorder(WebRtc_UWord32 instanceID,
case kFileFormatPcm8kHzFile:
case kFileFormatPcm32kHzFile:
return new FileRecorderImpl(instanceID, fileFormat);
#ifdef WEBRTC_MODULE_UTILITY_VIDEO
case kFileFormatAviFile:
#ifdef WEBRTC_MODULE_UTILITY_VIDEO
return new AviRecorder(instanceID, fileFormat);
#endif
default:
#else
WEBRTC_TRACE(kTraceError, kTraceFile, -1,
"Invalid file format: %d", kFileFormatAviFile);
assert(false);
return NULL;
#endif
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -327,11 +327,6 @@ VCMFrameBuffer::SetState(VCMFrameBufferStateEnum state)
assert(_state == kStateEmpty ||
_state == kStateIncomplete);
break;
default:
// Should never happen
assert(!"FrameBuffer::SetState Incorrect frame buffer state as input");
return;
}
_state = state;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -756,9 +756,6 @@ VideoCodingModuleImpl::SetVideoProtection(VCMVideoProtection videoProtection,
return _codecDataBase.SetPeriodicKeyFrames(enable);
break;
}
default:
return VCM_PARAMETER_ERROR;
}
return VCM_OK;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -412,8 +412,6 @@ namespace webrtc
case TYPE_Float64:
StdSort<double>(data, numOfElements);
break;
default:
return -1;
}
#endif
return 0;
@ -543,8 +541,6 @@ namespace webrtc
return StdKeySort<float>(data, key, numOfElements, sizeOfElement);
case TYPE_Float64:
return StdKeySort<double>(data, key, numOfElements, sizeOfElement);
default:
return -1;
}
#endif
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -182,8 +182,6 @@ bool ThreadPosix::Start(unsigned int& /*threadID*/)
case kRealtimePriority:
param.sched_priority = maxPrio - 1;
break;
default:
return false;
}
result = pthread_setschedparam(_thread, policy, &param);
if (result == EINVAL)

View File

@ -283,9 +283,6 @@ WebRtc_Word32 TraceImpl::AddModuleAndId(char* traceMessage,
sprintf(traceMessage, " VIDEO PROC:%5ld %5ld;", idEngine,
idChannel);
break;
default:
assert(false);
return 0;
}
} else {
switch (module)
@ -341,9 +338,6 @@ WebRtc_Word32 TraceImpl::AddModuleAndId(char* traceMessage,
case kTraceVideoPreocessing:
sprintf (traceMessage, " VIDEO PROC:%11ld;", idl);
break;
default:
assert(false);
return 0;
}
}
// All messages are 25 characters.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -119,9 +119,6 @@ void ViEAutoTest::PrintVideoCodec(const webrtc::VideoCodec videoCodec)
case webrtc::kVideoCodecUnknown:
ViETest::Log("\tcodecType: ????");
break;
default:
ViETest::Log("\tcodecType: ????");
break;
}
ViETest::Log("\theight: %u", videoCodec.height);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -54,8 +54,6 @@ public:
case webrtc::Dark:
ViETest::Log(" BrightnessAlarm Dark");
break;
default:
assert(!"Unknown brightness alarm");
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -1894,9 +1894,6 @@ void PrintRTCCPStatistics(webrtc::ViERTP_RTCP* ptrViERtpRtcp,
"ERROR: %s at line %d",
__FUNCTION__, __LINE__);
break;
default:
std::cout << "Invalid RTCP Statistics selected" << std::endl;
break;
}
std::cout << "\tRTCP fraction of lost packets: "
<< fractionLost << std::endl;
@ -2002,9 +1999,6 @@ void PrintCodecStatistics(webrtc::ViECodec* ptrViECodec, int videoChannel,
"ERROR: %s at line %d",
__FUNCTION__, __LINE__);
break;
default:
std::cout << "Invalid Codec Statistics selected" << std::endl;
break;
}
std::cout << "\tNumber of encoded key frames: "
<< keyFrames << std::endl;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -293,8 +293,6 @@ WebRtc_Word32 ViECapturer::SetRotateCapturedFrames(
case RotateCapturedFrame_270:
converted_rotation = kCameraRotate270;
break;
default:
break;
}
return capture_module_->SetCaptureRotation(converted_rotation);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -146,8 +146,6 @@ int ViEInputManager::GetOrientation(const WebRtc_UWord8* device_unique_idUTF8,
case kCameraRotate270:
orientation = RotateCapturedFrame_270;
break;
default:
assert(!"Unknown enum");
}
return result;
}

View File

@ -35,10 +35,6 @@ static RTCPMethod ViERTCPModeToRTCPMethod(ViERTCPMode api_mode) {
case kRtcpNonCompound_RFC5506:
return kRtcpNonCompound;
default:
assert(false);
return kRtcpOff;
}
}
@ -52,10 +48,6 @@ static ViERTCPMode RTCPMethodToViERTCPMode(RTCPMethod module_method) {
case kRtcpNonCompound:
return kRtcpNonCompound_RFC5506;
default:
assert(false);
return kRtcpNone;
}
}
@ -73,10 +65,6 @@ static KeyFrameRequestMethod APIRequestToModuleRequest(
case kViEKeyFrameRequestFirRtcp:
return kKeyFrameReqFirRtcp;
default:
assert(false);
return kKeyFrameReqFirRtp;
}
}

View File

@ -2143,11 +2143,6 @@ Channel::SetNetEQPlayoutMode(NetEqModes mode)
case kNetEqFax:
playoutMode = fax;
break;
default:
_engineStatisticsPtr->SetLastError(
VE_INVALID_ARGUMENT, kTraceError,
"SetNetEQPlayoutMode() invalid mode");
return -1;
}
if (_audioCodingModule.SetPlayoutMode(playoutMode) != 0)
{
@ -2174,11 +2169,6 @@ Channel::GetNetEQPlayoutMode(NetEqModes& mode)
case fax:
mode = kNetEqFax;
break;
default:
_engineStatisticsPtr->SetLastError(
VE_INVALID_ARGUMENT, kTraceError,
"GetNetEQPlayoutMode() invalid mode");
return -1;
}
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice,
VoEId(_instanceId,_channelId),
@ -2203,11 +2193,6 @@ Channel::SetNetEQBGNMode(NetEqBgnModes mode)
case kBgnOff:
noiseMode = Off;
break;
default:
_engineStatisticsPtr->SetLastError(
VE_INVALID_ARGUMENT, kTraceError,
"SetNetEQBGNMode() invalid mode");
return -1;
}
if (_audioCodingModule.SetBackgroundNoiseMode(noiseMode) != 0)
{
@ -2316,12 +2301,6 @@ Channel::GetNetEQBGNMode(NetEqBgnModes& mode)
case Off:
mode = kBgnOff;
break;
default:
_engineStatisticsPtr->SetLastError(
VE_INVALID_ARGUMENT,
kTraceError,
"GetNetEQBGNMode() invalid mode");
return -1;
}
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::GetNetEQBGNMode() => mode=%u", mode);
@ -4944,11 +4923,6 @@ Channel::SetRxNsStatus(const bool enable, const NsModes mode)
case kNsVeryHighSuppression:
nsLevel = NoiseSuppression::kVeryHigh;
break;
default:
_engineStatisticsPtr->SetLastError(
VE_INVALID_ARGUMENT, kTraceError,
"SetRxNsStatus() invalid Ns mode");
return -1;
}
if (_rxAudioProcessingModulePtr->noise_suppression()->set_level(nsLevel)
@ -5000,11 +4974,6 @@ Channel::GetRxNsStatus(bool& enabled, NsModes& mode)
case NoiseSuppression::kVeryHigh:
mode = kNsVeryHighSuppression;
break;
default:
_engineStatisticsPtr->SetLastError(
VE_APM_ERROR, kTraceError,
"GetRxNsStatus() invalid Ns mode");
return -1;
}
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice,

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -105,11 +105,6 @@ int VoEAudioProcessingImpl::SetNsStatus(bool enable, NsModes mode)
case kNsVeryHighSuppression:
nsLevel = NoiseSuppression::kVeryHigh;
break;
default:
_engineStatistics.SetLastError(
VE_INVALID_ARGUMENT, kTraceError,
"SetNsStatus() invalid Ns mode");
return -1;
}
if (_audioProcessingModulePtr->noise_suppression()->set_level(nsLevel) != 0)
@ -169,11 +164,6 @@ int VoEAudioProcessingImpl::GetNsStatus(bool& enabled, NsModes& mode)
case NoiseSuppression::kVeryHigh:
mode = kNsVeryHighSuppression;
break;
default:
_engineStatistics.SetLastError(
VE_APM_ERROR, kTraceError,
"GetNsStatus() invalid Ns mode");
return -1;
}
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId,-1),
@ -227,10 +217,6 @@ int VoEAudioProcessingImpl::SetAgcStatus(bool enable, AgcModes mode)
case kAgcAdaptiveDigital:
agcMode = GainControl::kAdaptiveDigital;
break;
default:
_engineStatistics.SetLastError(VE_INVALID_ARGUMENT, kTraceError,
"SetAgcStatus() invalid Agc mode");
return -1;
}
if (_audioProcessingModulePtr->gain_control()->set_mode(agcMode) != 0)
@ -302,10 +288,6 @@ int VoEAudioProcessingImpl::GetAgcStatus(bool& enabled, AgcModes& mode)
case GainControl::kAdaptiveDigital:
mode = kAgcAdaptiveDigital;
break;
default:
_engineStatistics.SetLastError(VE_APM_ERROR, kTraceError,
"GetAgcStatus() invalid Agc mode");
return -1;
}
WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId,-1),
@ -786,10 +768,6 @@ int VoEAudioProcessingImpl::SetAecmMode(AecmModes mode, bool enableCNG)
case kAecmLoudSpeakerphone:
aecmMode = EchoControlMobile::kLoudSpeakerphone;
break;
default:
_engineStatistics.SetLastError(VE_APM_ERROR, kTraceError,
"GetEcStatus() invalid EC mode");
return -1;
}
@ -854,11 +832,6 @@ int VoEAudioProcessingImpl::GetAecmMode(AecmModes& mode, bool& enabledCNG)
case EchoControlMobile::kLoudSpeakerphone:
mode = kAecmLoudSpeakerphone;
break;
default:
_engineStatistics.SetLastError(
VE_APM_ERROR, kTraceError,
"GetAECMMode() invalid EC mode");
return -1;
}
return 0;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -613,10 +613,6 @@ int VoECodecImpl::SetVADStatus(int channel, bool enable, VadModes mode,
case kVadAggressiveHigh:
vadMode = VADVeryAggr;
break;
default:
_engineStatistics.SetLastError(VE_INVALID_ARGUMENT, kTraceError,
"SetVADStatus() invalid VAD mode");
return -1;
}
return channelPtr->SetVADStatus(enable, vadMode, disableDTX);
}
@ -664,11 +660,6 @@ int VoECodecImpl::GetVADStatus(int channel, bool& enabled, VadModes& mode,
case VADVeryAggr:
mode = kVadAggressiveHigh;
break;
default:
_engineStatistics.SetLastError(VE_AUDIO_CODING_MODULE_ERROR,
kTraceError,
"GetVADStatus() invalid VAD mode");
return -1;
}
return 0;

View File

@ -112,15 +112,8 @@ int VoEExternalMediaImpl::RegisterExternalMediaProcessing(
return _transmitMixerPtr->RegisterExternalMediaProcessing(
processObject);
}
default:
{
_engineStatistics.SetLastError(
VE_INVALID_ARGUMENT, kTraceError,
"RegisterExternalMediaProcessing() invalid process type");
return -1;
}
}
return 0;
return -1;
}
int VoEExternalMediaImpl::DeRegisterExternalMediaProcessing(
@ -161,14 +154,8 @@ int VoEExternalMediaImpl::DeRegisterExternalMediaProcessing(
{
return _transmitMixerPtr->DeRegisterExternalMediaProcessing();
}
default:
{
_engineStatistics.SetLastError(
VE_INVALID_ARGUMENT, kTraceError,
"RegisterExternalMediaProcessing() invalid process type");
return -1;
}
}
return -1;
}
int VoEExternalMediaImpl::SetExternalRecordingStatus(bool enable)

View File

@ -115,10 +115,6 @@ int VoEHardwareImpl::SetAudioDeviceLayer(AudioLayers audioLayer)
case kAudioLinuxPulse:
wantedLayer = AudioDeviceModule::kLinuxPulseAudio;
break;
default:
_engineStatistics.SetLastError(VE_INVALID_ARGUMENT, kTraceError,
" invalid audio layer");
return -1;
}
// Save the audio device layer for Init()
@ -390,11 +386,6 @@ int VoEHardwareImpl::SetRecordingDevice(int index,
case kStereoBoth:
// default setting kChannelBoth (<=> mono)
break;
default:
_engineStatistics.SetLastError(
VE_INVALID_ARGUMENT, kTraceError,
"SetRecordingDevice() unknown recording channel");
return -1;
}
if (_audioDevicePtr->SetRecordingChannel(recCh) != 0) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -127,8 +127,6 @@ int CalculateMetrics(VideoMetricsType video_metrics_type,
CalculateFrame(kSSIM, ref, test, width, height, frame_number,
ssim_result);
break;
default:
assert(false);
}
frame_number++;
ref_bytes = fread(ref, 1, frame_length, ref_fp);