diff --git a/src/common_video/libyuv/libyuv.cc b/src/common_video/libyuv/libyuv.cc index 4a70747bc..b4e812212 100644 --- a/src/common_video/libyuv/libyuv.cc +++ b/src/common_video/libyuv/libyuv.cc @@ -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; } } diff --git a/src/modules/audio_coding/codecs/iSAC/main/source/bandwidth_estimator.c b/src/modules/audio_coding/codecs/iSAC/main/source/bandwidth_estimator.c index 85912efbc..d0a50c529 100644 --- a/src/modules/audio_coding/codecs/iSAC/main/source/bandwidth_estimator.c +++ b/src/modules/audio_coding/codecs/iSAC/main/source/bandwidth_estimator.c @@ -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; diff --git a/src/modules/audio_coding/codecs/iSAC/main/source/isac.c b/src/modules/audio_coding/codecs/iSAC/main/source/isac.c index 2199d571f..7e514bb20 100644 --- a/src/modules/audio_coding/codecs/iSAC/main/source/isac.c +++ b/src/modules/audio_coding/codecs/iSAC/main/source/isac.c @@ -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 */ diff --git a/src/modules/audio_coding/main/source/acm_neteq.cc b/src/modules/audio_coding/main/source/acm_neteq.cc index 7b391613f..ca39533b3 100644 --- a/src/modules/audio_coding/main/source/acm_neteq.cc +++ b/src/modules/audio_coding/main/source/acm_neteq.cc @@ -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) { diff --git a/src/modules/audio_coding/main/source/audio_coding_module_impl.cc b/src/modules/audio_coding/main/source/audio_coding_module_impl.cc index 38c973db6..072807a25 100644 --- a/src/modules/audio_coding/main/source/audio_coding_module_impl.cc +++ b/src/modules/audio_coding/main/source/audio_coding_module_impl.cc @@ -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; diff --git a/src/modules/audio_device/main/source/linux/audio_device_pulse_linux.cc b/src/modules/audio_device/main/source/linux/audio_device_pulse_linux.cc index 4c3be521f..8ce54c798 100644 --- a/src/modules/audio_device/main/source/linux/audio_device_pulse_linux.cc +++ b/src/modules/audio_device/main/source/linux/audio_device_pulse_linux.cc @@ -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, diff --git a/src/modules/audio_processing/echo_cancellation_impl.cc b/src/modules/audio_processing/echo_cancellation_impl.cc index 9f2cd73a6..1f0b0e203 100644 --- a/src/modules/audio_processing/echo_cancellation_impl.cc +++ b/src/modules/audio_processing/echo_cancellation_impl.cc @@ -32,8 +32,6 @@ WebRtc_Word16 MapSetting(EchoCancellation::SuppressionLevel level) { return kAecNlpModerate; case EchoCancellation::kHighSuppression: return kAecNlpAggressive; - default: - return -1; } } diff --git a/src/modules/audio_processing/echo_control_mobile_impl.cc b/src/modules/audio_processing/echo_control_mobile_impl.cc index 20ca0ad55..2e3da60c0 100644 --- a/src/modules/audio_processing/echo_control_mobile_impl.cc +++ b/src/modules/audio_processing/echo_control_mobile_impl.cc @@ -36,8 +36,6 @@ WebRtc_Word16 MapSetting(EchoControlMobile::RoutingMode mode) { return 3; case EchoControlMobile::kLoudSpeakerphone: return 4; - default: - return -1; } } diff --git a/src/modules/audio_processing/gain_control_impl.cc b/src/modules/audio_processing/gain_control_impl.cc index 0cbd736ca..a00eadbff 100644 --- a/src/modules/audio_processing/gain_control_impl.cc +++ b/src/modules/audio_processing/gain_control_impl.cc @@ -47,8 +47,6 @@ WebRtc_Word16 MapSetting(GainControl::Mode mode) { case GainControl::kFixedDigital: return kAgcModeFixedDigital; break; - default: - return -1; } } } // namespace diff --git a/src/modules/audio_processing/noise_suppression_impl.cc b/src/modules/audio_processing/noise_suppression_impl.cc index 9c81b5d8e..8ecc8b5b7 100644 --- a/src/modules/audio_processing/noise_suppression_impl.cc +++ b/src/modules/audio_processing/noise_suppression_impl.cc @@ -41,8 +41,6 @@ int MapSetting(NoiseSuppression::Level level) { return 2; case NoiseSuppression::kVeryHigh: return 3; - default: - return -1; } } } // namespace diff --git a/src/modules/audio_processing/voice_detection_impl.cc b/src/modules/audio_processing/voice_detection_impl.cc index ecada4ad1..e6da00bfb 100644 --- a/src/modules/audio_processing/voice_detection_impl.cc +++ b/src/modules/audio_processing/voice_detection_impl.cc @@ -37,8 +37,6 @@ int MapSetting(VoiceDetection::Likelihood likelihood) { case VoiceDetection::kHighLikelihood: return 0; break; - default: - return -1; } } } // namespace diff --git a/src/modules/media_file/source/media_file_impl.cc b/src/modules/media_file/source/media_file_impl.cc index 7dae24180..3199c1246 100644 --- a/src/modules/media_file/source/media_file_impl.cc +++ b/src/modules/media_file/source/media_file_impl.cc @@ -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 diff --git a/src/modules/rtp_rtcp/source/rtp_rtcp_impl.cc b/src/modules/rtp_rtcp/source/rtp_rtcp_impl.cc index a42860903..962f8b2fc 100644 --- a/src/modules/rtp_rtcp/source/rtp_rtcp_impl.cc +++ b/src/modules/rtp_rtcp/source/rtp_rtcp_impl.cc @@ -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; } } diff --git a/src/modules/utility/source/file_player_impl.cc b/src/modules/utility/source/file_player_impl.cc index c080e6c7b..73d92b896 100644 --- a/src/modules/utility/source/file_player_impl.cc +++ b/src/modules/utility/source/file_player_impl.cc @@ -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 } } diff --git a/src/modules/utility/source/file_recorder_impl.cc b/src/modules/utility/source/file_recorder_impl.cc index a31d47d5c..11fd25c2f 100644 --- a/src/modules/utility/source/file_recorder_impl.cc +++ b/src/modules/utility/source/file_recorder_impl.cc @@ -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 } } diff --git a/src/modules/video_coding/main/source/frame_buffer.cc b/src/modules/video_coding/main/source/frame_buffer.cc index b96187d16..6339b057d 100644 --- a/src/modules/video_coding/main/source/frame_buffer.cc +++ b/src/modules/video_coding/main/source/frame_buffer.cc @@ -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; } diff --git a/src/modules/video_coding/main/source/video_coding_impl.cc b/src/modules/video_coding/main/source/video_coding_impl.cc index 7e174ab21..a862d8508 100644 --- a/src/modules/video_coding/main/source/video_coding_impl.cc +++ b/src/modules/video_coding/main/source/video_coding_impl.cc @@ -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; } diff --git a/src/system_wrappers/source/sort.cc b/src/system_wrappers/source/sort.cc index f44b64497..445e6d668 100644 --- a/src/system_wrappers/source/sort.cc +++ b/src/system_wrappers/source/sort.cc @@ -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(data, numOfElements); break; - default: - return -1; } #endif return 0; @@ -543,8 +541,6 @@ namespace webrtc return StdKeySort(data, key, numOfElements, sizeOfElement); case TYPE_Float64: return StdKeySort(data, key, numOfElements, sizeOfElement); - default: - return -1; } #endif } diff --git a/src/system_wrappers/source/thread_posix.cc b/src/system_wrappers/source/thread_posix.cc index 402375781..6e359f516 100644 --- a/src/system_wrappers/source/thread_posix.cc +++ b/src/system_wrappers/source/thread_posix.cc @@ -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, ¶m); if (result == EINVAL) diff --git a/src/system_wrappers/source/trace_impl.cc b/src/system_wrappers/source/trace_impl.cc index b5094c161..ad908a3ce 100644 --- a/src/system_wrappers/source/trace_impl.cc +++ b/src/system_wrappers/source/trace_impl.cc @@ -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. diff --git a/src/video_engine/test/auto_test/source/vie_autotest.cc b/src/video_engine/test/auto_test/source/vie_autotest.cc index 2eaa0e37c..183ea469b 100644 --- a/src/video_engine/test/auto_test/source/vie_autotest.cc +++ b/src/video_engine/test/auto_test/source/vie_autotest.cc @@ -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); diff --git a/src/video_engine/test/auto_test/source/vie_autotest_capture.cc b/src/video_engine/test/auto_test/source/vie_autotest_capture.cc index 47c326586..3d71955a0 100644 --- a/src/video_engine/test/auto_test/source/vie_autotest_capture.cc +++ b/src/video_engine/test/auto_test/source/vie_autotest_capture.cc @@ -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"); } } diff --git a/src/video_engine/test/auto_test/source/vie_autotest_custom_call.cc b/src/video_engine/test/auto_test/source/vie_autotest_custom_call.cc index 200570042..fa8bf760e 100644 --- a/src/video_engine/test/auto_test/source/vie_autotest_custom_call.cc +++ b/src/video_engine/test/auto_test/source/vie_autotest_custom_call.cc @@ -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; diff --git a/src/video_engine/vie_capturer.cc b/src/video_engine/vie_capturer.cc index a8ef35e8c..cd9bd0c15 100644 --- a/src/video_engine/vie_capturer.cc +++ b/src/video_engine/vie_capturer.cc @@ -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); } diff --git a/src/video_engine/vie_input_manager.cc b/src/video_engine/vie_input_manager.cc index e3db010d6..98c5535de 100644 --- a/src/video_engine/vie_input_manager.cc +++ b/src/video_engine/vie_input_manager.cc @@ -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; } diff --git a/src/video_engine/vie_rtp_rtcp_impl.cc b/src/video_engine/vie_rtp_rtcp_impl.cc index 1d2dd9a40..009cddf48 100644 --- a/src/video_engine/vie_rtp_rtcp_impl.cc +++ b/src/video_engine/vie_rtp_rtcp_impl.cc @@ -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; } } diff --git a/src/voice_engine/main/source/channel.cc b/src/voice_engine/main/source/channel.cc index 7b8b8f41b..4fc1c8e3e 100644 --- a/src/voice_engine/main/source/channel.cc +++ b/src/voice_engine/main/source/channel.cc @@ -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, diff --git a/src/voice_engine/main/source/voe_audio_processing_impl.cc b/src/voice_engine/main/source/voe_audio_processing_impl.cc index 25754ba1f..95800f495 100644 --- a/src/voice_engine/main/source/voe_audio_processing_impl.cc +++ b/src/voice_engine/main/source/voe_audio_processing_impl.cc @@ -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; diff --git a/src/voice_engine/main/source/voe_codec_impl.cc b/src/voice_engine/main/source/voe_codec_impl.cc index b0e41065d..66a237050 100644 --- a/src/voice_engine/main/source/voe_codec_impl.cc +++ b/src/voice_engine/main/source/voe_codec_impl.cc @@ -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; diff --git a/src/voice_engine/main/source/voe_external_media_impl.cc b/src/voice_engine/main/source/voe_external_media_impl.cc index 02e069c19..3fc323982 100644 --- a/src/voice_engine/main/source/voe_external_media_impl.cc +++ b/src/voice_engine/main/source/voe_external_media_impl.cc @@ -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) diff --git a/src/voice_engine/main/source/voe_hardware_impl.cc b/src/voice_engine/main/source/voe_hardware_impl.cc index cf8cc01d7..7e676c066 100644 --- a/src/voice_engine/main/source/voe_hardware_impl.cc +++ b/src/voice_engine/main/source/voe_hardware_impl.cc @@ -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) { diff --git a/test/testsupport/metrics/video_metrics.cc b/test/testsupport/metrics/video_metrics.cc index 9e61ec8ac..1f55f6831 100644 --- a/test/testsupport/metrics/video_metrics.cc +++ b/test/testsupport/metrics/video_metrics.cc @@ -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);