From b7b66c5049feb6748791bc514bf8869f470530f0 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Sat, 30 Nov 2019 19:47:06 +0000 Subject: VIDEO: Fix Missing Default Switch Cases These are flagged by GCC if -Wswitch-default is enabled. --- video/bink_decoder.cpp | 24 ++++++++++++++++-------- video/dxa_decoder.cpp | 3 +++ video/flic_decoder.cpp | 1 + video/mpegps_decoder.cpp | 2 ++ video/smk_decoder.cpp | 4 ++++ 5 files changed, 26 insertions(+), 8 deletions(-) (limited to 'video') diff --git a/video/bink_decoder.cpp b/video/bink_decoder.cpp index 4074043768..170fab6495 100644 --- a/video/bink_decoder.cpp +++ b/video/bink_decoder.cpp @@ -1164,6 +1164,9 @@ void BinkDecoder::BinkVideoTrack::readDCTCoeffs(VideoFrame &video, int32 *block, coefList[listPos] = 0; modeList[listPos++] = 0; break; + + default: + break; } } } @@ -1256,16 +1259,21 @@ void BinkDecoder::BinkVideoTrack::readResidue(VideoFrame &video, int16 *block, i break; case 3: - nzCoeff[nzCoeffCount++] = binkScan[ccoef]; + { + nzCoeff[nzCoeffCount++] = binkScan[ccoef]; + + int sign = -(int)video.bits->getBit(); + block[binkScan[ccoef]] = (mask ^ sign) - sign; - int sign = -(int)video.bits->getBit(); - block[binkScan[ccoef]] = (mask ^ sign) - sign; + coefList[listPos] = 0; + modeList[listPos++] = 0; + masksCount--; + if (masksCount < 0) + return; + } + break; - coefList[listPos] = 0; - modeList[listPos++] = 0; - masksCount--; - if (masksCount < 0) - return; + default: break; } } diff --git a/video/dxa_decoder.cpp b/video/dxa_decoder.cpp index b61f842341..97d13b05f3 100644 --- a/video/dxa_decoder.cpp +++ b/video/dxa_decoder.cpp @@ -381,6 +381,7 @@ void DXADecoder::DXAVideoTrack::decode13(int size) { switch (subMask & 0xC0) { // 00: skip case 0x00: + default: break; // 01: solid color case 0x40: { @@ -533,6 +534,8 @@ const Graphics::Surface *DXADecoder::DXAVideoTrack::decodeNextFrame() { case S_NONE: _surface->setPixels(_frameBuffer1); break; + default: + break; } // Copy in the relevant info to the Surface diff --git a/video/flic_decoder.cpp b/video/flic_decoder.cpp index 9e797869c0..a3d8ff6bc7 100644 --- a/video/flic_decoder.cpp +++ b/video/flic_decoder.cpp @@ -307,6 +307,7 @@ void FlicDecoder::FlicVideoTrack::decodeDeltaFLC(uint8 *data) { packetCount = opcode; break; case OP_UNDEFINED: + default: break; case OP_LASTPIXEL: *((byte *)_surface->getBasePtr(getWidth() - 1, currentLine)) = (opcode & 0xFF); diff --git a/video/mpegps_decoder.cpp b/video/mpegps_decoder.cpp index 9b232ec792..2ec3262477 100644 --- a/video/mpegps_decoder.cpp +++ b/video/mpegps_decoder.cpp @@ -222,6 +222,8 @@ MPEGPSDecoder::PrivateStreamType MPEGPSDecoder::detectPrivateStreamType(Common:: return kPrivateStreamAC3; case 0xA0: return kPrivateStreamDVDPCM; + default: + break; } return kPrivateStreamUnknown; diff --git a/video/smk_decoder.cpp b/video/smk_decoder.cpp index 55b43bd746..8db845f09b 100644 --- a/video/smk_decoder.cpp +++ b/video/smk_decoder.cpp @@ -675,6 +675,8 @@ void SmackerDecoder::SmackerVideoTrack::decodeFrame(Common::BitStreamMemory8LSB } } break; + default: + break; } ++block; } @@ -696,6 +698,8 @@ void SmackerDecoder::SmackerVideoTrack::decodeFrame(Common::BitStreamMemory8LSB ++block; } break; + default: + break; } } } -- cgit v1.2.3