Skip to content

Commit

Permalink
Removed default cases causing clang errors, -Wcovered-switch-default.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
[email protected] committed Feb 6, 2012
1 parent 5eeaa38 commit c80d9d9
Show file tree
Hide file tree
Showing 32 changed files with 48 additions and 230 deletions.
8 changes: 1 addition & 7 deletions src/common_video/libyuv/libyuv.cc
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -229,9 +229,6 @@ libyuv::RotationMode ConvertRotationMode(VideoRotationMode rotation) {
return libyuv::kRotate180;
case kRotate270:
return libyuv::kRotate270;
default:
assert(false);
return libyuv::kRotate0;
}
}

Expand Down Expand Up @@ -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;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -58,8 +58,6 @@ WebRtc_Word32 WebRtcIsac_InitBandwidthEstimator(
bwest_str->send_bw_avg = INIT_BN_EST_SWB;
break;
}
default:
return -1;
}

switch(decoderSampRate)
Expand All @@ -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;
Expand Down
6 changes: 1 addition & 5 deletions src/modules/audio_coding/codecs/iSAC/main/source/isac.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -676,8 +676,6 @@ WebRtc_Word16 WebRtcIsac_Encode(
streamLenUB = 0;
break;
}
default:
return -1;
}

if((streamLenUB < 0) &&
Expand Down Expand Up @@ -1666,8 +1664,6 @@ WebRtc_Word16 WebRtcIsac_DecodePlc(
numSamples = 960 * noOfLostFrames;
break;
}
default:
return -1;
}

/* Set output samples to zero */
Expand Down
10 changes: 1 addition & 9 deletions src/modules/audio_coding/main/source/acm_neteq.cc
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions src/modules/audio_processing/echo_cancellation_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ WebRtc_Word16 MapSetting(EchoCancellation::SuppressionLevel level) {
return kAecNlpModerate;
case EchoCancellation::kHighSuppression:
return kAecNlpAggressive;
default:
return -1;
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/modules/audio_processing/echo_control_mobile_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ WebRtc_Word16 MapSetting(EchoControlMobile::RoutingMode mode) {
return 3;
case EchoControlMobile::kLoudSpeakerphone:
return 4;
default:
return -1;
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/modules/audio_processing/gain_control_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ WebRtc_Word16 MapSetting(GainControl::Mode mode) {
case GainControl::kFixedDigital:
return kAgcModeFixedDigital;
break;
default:
return -1;
}
}
} // namespace
Expand Down
2 changes: 0 additions & 2 deletions src/modules/audio_processing/noise_suppression_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ int MapSetting(NoiseSuppression::Level level) {
return 2;
case NoiseSuppression::kVeryHigh:
return 3;
default:
return -1;
}
}
} // namespace
Expand Down
2 changes: 0 additions & 2 deletions src/modules/audio_processing/voice_detection_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ int MapSetting(VoiceDetection::Likelihood likelihood) {
case VoiceDetection::kHighLikelihood:
return 0;
break;
default:
return -1;
}
}
} // namespace
Expand Down
35 changes: 17 additions & 18 deletions src/modules/media_file/source/media_file_impl.cc
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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)
Expand Down Expand Up @@ -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,
Expand All @@ -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)
Expand Down Expand Up @@ -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(
Expand All @@ -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
Expand Down
5 changes: 0 additions & 5 deletions src/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
}

Expand Down
9 changes: 6 additions & 3 deletions src/modules/utility/source/file_player_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
9 changes: 6 additions & 3 deletions src/modules/utility/source/file_recorder_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
7 changes: 1 addition & 6 deletions src/modules/video_coding/main/source/frame_buffer.cc
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
}
Expand Down
5 changes: 1 addition & 4 deletions src/modules/video_coding/main/source/video_coding_impl.cc
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -756,9 +756,6 @@ VideoCodingModuleImpl::SetVideoProtection(VCMVideoProtection videoProtection,
return _codecDataBase.SetPeriodicKeyFrames(enable);
break;
}

default:
return VCM_PARAMETER_ERROR;
}
return VCM_OK;
}
Expand Down
Loading

0 comments on commit c80d9d9

Please sign in to comment.