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
diff --git a/src/common_video/libyuv/libyuv.cc b/src/common_video/libyuv/libyuv.cc
index 4a70747..b4e8122 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 @@
return libyuv::kRotate180;
case kRotate270:
return libyuv::kRotate270;
- default:
- assert(false);
- return libyuv::kRotate0;
}
}
@@ -268,9 +265,6 @@
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 85912ef..d0a50c5 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 @@
bwest_str->send_bw_avg = INIT_BN_EST_SWB;
break;
}
- default:
- return -1;
}
switch(decoderSampRate)
@@ -86,8 +84,6 @@
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 2199d57..7e514bb 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 @@
streamLenUB = 0;
break;
}
- default:
- return -1;
}
if((streamLenUB < 0) &&
@@ -1666,8 +1664,6 @@
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 7b39161..ca39533 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 @@
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 @@
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 38c973d..072807a 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 @@
_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 4c3be52..8ce54c7 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 @@
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 @@
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 9f2cd73..1f0b0e2 100644
--- a/src/modules/audio_processing/echo_cancellation_impl.cc
+++ b/src/modules/audio_processing/echo_cancellation_impl.cc
@@ -32,8 +32,6 @@
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 20ca0ad..2e3da60 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 @@
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 0cbd736..a00eadb 100644
--- a/src/modules/audio_processing/gain_control_impl.cc
+++ b/src/modules/audio_processing/gain_control_impl.cc
@@ -47,8 +47,6 @@
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 9c81b5d..8ecc8b5 100644
--- a/src/modules/audio_processing/noise_suppression_impl.cc
+++ b/src/modules/audio_processing/noise_suppression_impl.cc
@@ -41,8 +41,6 @@
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 ecada4a..e6da00b 100644
--- a/src/modules/audio_processing/voice_detection_impl.cc
+++ b/src/modules/audio_processing/voice_detection_impl.cc
@@ -37,8 +37,6 @@
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 7dae241..3199c12 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 @@
return 0;
}
break;
-#ifdef WEBRTC_MODULE_UTILITY_VIDEO
case kFileFormatAviFile:
{
+#ifdef WEBRTC_MODULE_UTILITY_VIDEO
if(video)
{
bytesRead = _ptrFileUtilityObj->ReadAviVideoData(
@@ -218,13 +218,13 @@
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 @@
_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 @@
_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 @@
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 @@
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 a428609..962f8b2 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 @@
return _rtcpSender.SendRTCP(kRtcpNack, size, nackList);
case kNackOff:
return -1;
- default:
- assert(false);
};
return -1;
}
@@ -2259,9 +2257,6 @@
_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 c080e6c..73d92b8 100644
--- a/src/modules/utility/source/file_player_impl.cc
+++ b/src/modules/utility/source/file_player_impl.cc
@@ -39,12 +39,15 @@
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 a31d47d..11fd25c 100644
--- a/src/modules/utility/source/file_recorder_impl.cc
+++ b/src/modules/utility/source/file_recorder_impl.cc
@@ -41,12 +41,15 @@
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 b96187d..6339b05 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 @@
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 7e174ab..a862d85 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 @@
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 f44b644..445e6d6 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 @@
case TYPE_Float64:
StdSort<double>(data, numOfElements);
break;
- default:
- return -1;
}
#endif
return 0;
@@ -543,8 +541,6 @@
return StdKeySort<float>(data, key, numOfElements, sizeOfElement);
case TYPE_Float64:
return StdKeySort<double>(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 4023757..6e359f5 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 @@
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 b5094c1..ad908a3 100644
--- a/src/system_wrappers/source/trace_impl.cc
+++ b/src/system_wrappers/source/trace_impl.cc
@@ -283,9 +283,6 @@
sprintf(traceMessage, " VIDEO PROC:%5ld %5ld;", idEngine,
idChannel);
break;
- default:
- assert(false);
- return 0;
}
} else {
switch (module)
@@ -341,9 +338,6 @@
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 2eaa0e3..183ea46 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 @@
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 47c3265..3d71955 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 @@
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 2005700..fa8bf76 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 @@
"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 @@
"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 a8ef35e..cd9bd0c 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 @@
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 e3db010..98c5535 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 @@
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 1d2dd9a..009cddf 100644
--- a/src/video_engine/vie_rtp_rtcp_impl.cc
+++ b/src/video_engine/vie_rtp_rtcp_impl.cc
@@ -35,10 +35,6 @@
case kRtcpNonCompound_RFC5506:
return kRtcpNonCompound;
-
- default:
- assert(false);
- return kRtcpOff;
}
}
@@ -52,10 +48,6 @@
case kRtcpNonCompound:
return kRtcpNonCompound_RFC5506;
-
- default:
- assert(false);
- return kRtcpNone;
}
}
@@ -73,10 +65,6 @@
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 7b8b8f4..4fc1c8e 100644
--- a/src/voice_engine/main/source/channel.cc
+++ b/src/voice_engine/main/source/channel.cc
@@ -2143,11 +2143,6 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 25754ba..95800f4 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 @@
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 @@
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 @@
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 @@
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 @@
case kAecmLoudSpeakerphone:
aecmMode = EchoControlMobile::kLoudSpeakerphone;
break;
- default:
- _engineStatistics.SetLastError(VE_APM_ERROR, kTraceError,
- "GetEcStatus() invalid EC mode");
- return -1;
}
@@ -854,11 +832,6 @@
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 b0e4106..66a2370 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 @@
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 @@
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 02e069c..3fc3239 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 @@
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 @@
{
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 cf8cc01..7e676c0 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 @@
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 @@
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 9e61ec8..1f55f68 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 @@
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);