[Scummvm-git-logs] scummvm master -> aee09409e8b30dbd8ea10c9190b85037fe8458c9

digitall 547637+digitall at users.noreply.github.com
Sat Nov 30 22:12:24 UTC 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
aee09409e8 IMAGE: Fix Missing Default Switch Cases


Commit: aee09409e8b30dbd8ea10c9190b85037fe8458c9
    https://github.com/scummvm/scummvm/commit/aee09409e8b30dbd8ea10c9190b85037fe8458c9
Author: D G Turner (digitall at scummvm.org)
Date: 2019-11-30T22:08:44Z

Commit Message:
IMAGE: Fix Missing Default Switch Cases

These are flagged by GCC if -Wswitch-default is enabled.

Changed paths:
    image/codecs/bmp_raw.cpp
    image/codecs/indeo/indeo_dsp.cpp
    image/codecs/indeo4.cpp
    image/codecs/indeo5.cpp
    image/codecs/smc.cpp
    image/codecs/svq1.cpp
    image/iff.cpp
    image/jpeg.cpp
    image/pict.cpp


diff --git a/image/codecs/bmp_raw.cpp b/image/codecs/bmp_raw.cpp
index 149136c..257fa02 100644
--- a/image/codecs/bmp_raw.cpp
+++ b/image/codecs/bmp_raw.cpp
@@ -140,6 +140,8 @@ Graphics::PixelFormat BitmapRawDecoder::getPixelFormat() const {
 	case 24:
 	case 32:
 		return Graphics::PixelFormat(4, 8, 8, 8, 8, 8, 16, 24, 0);
+	default:
+		break;
 	}
 
 	error("Unhandled BMP raw %dbpp", _bitsPerPixel);
diff --git a/image/codecs/indeo/indeo_dsp.cpp b/image/codecs/indeo/indeo_dsp.cpp
index 95ce3f3..8e281aa 100644
--- a/image/codecs/indeo/indeo_dsp.cpp
+++ b/image/codecs/indeo/indeo_dsp.cpp
@@ -563,6 +563,8 @@ static void iviMc ## size ##x## size ## suffix(int16 *buf, \
 			for (int j = 0; j < size; j++) \
 				OP(buf[j], (refBuf[j] + refBuf[j+1] + wptr[j] + wptr[j+1]) >> 2); \
 		break; \
+	default: \
+		break; \
 	} \
 } \
 \
diff --git a/image/codecs/indeo4.cpp b/image/codecs/indeo4.cpp
index a4eba85..8385658 100644
--- a/image/codecs/indeo4.cpp
+++ b/image/codecs/indeo4.cpp
@@ -251,6 +251,8 @@ void Indeo4Decoder::switchBuffers() {
 	case IVI4_FRAMETYPE_INTER:
 		isPrevRef = 1;
 		break;
+	default:
+		break;
 	}
 
 	switch (_ctx._frameType) {
diff --git a/image/codecs/indeo5.cpp b/image/codecs/indeo5.cpp
index 790bdec..e36fb55 100644
--- a/image/codecs/indeo5.cpp
+++ b/image/codecs/indeo5.cpp
@@ -176,6 +176,7 @@ void Indeo5Decoder::switchBuffers() {
 		break;
 
 	case FRAMETYPE_INTER_NOREF:
+	default:
 		break;
 	}
 
@@ -192,6 +193,7 @@ void Indeo5Decoder::switchBuffers() {
 	case FRAMETYPE_INTER_SCAL:
 	case FRAMETYPE_INTER_NOREF:
 	case FRAMETYPE_NULL:
+	default:
 		break;
 	}
 }
@@ -513,6 +515,9 @@ int Indeo5Decoder::decode_gop_header() {
 				band->_scan = _ffIviDirectScan4x4;
 				band->_transformSize = 4;
 				break;
+
+			default:
+				break;
 			}
 
 			band->_is2dTrans = band->_invTransform == IndeoDSP::ffIviInverseSlant8x8 ||
diff --git a/image/codecs/smc.cpp b/image/codecs/smc.cpp
index 54493d0..716b2f9 100644
--- a/image/codecs/smc.cpp
+++ b/image/codecs/smc.cpp
@@ -380,6 +380,9 @@ const Graphics::Surface *SMCDecoder::decodeFrame(Common::SeekableReadStream &str
 		case 0xF0:
 			warning("0xF0 opcode seen in SMC chunk (contact the developers)");
 			break;
+
+		default:
+			break;
 		}
 	}
 
diff --git a/image/codecs/svq1.cpp b/image/codecs/svq1.cpp
index eba5fb8..5481967 100644
--- a/image/codecs/svq1.cpp
+++ b/image/codecs/svq1.cpp
@@ -657,6 +657,8 @@ bool SVQ1Decoder::svq1MotionInterBlock(Common::BitStream32BEMSB *ss, byte *curre
 	case 3:
 		putPixels16XY2C(dst, src, pitch, 16);
 		break;
+	default:
+		break;
 	}
 
 	return true;
@@ -737,6 +739,8 @@ bool SVQ1Decoder::svq1MotionInter4vBlock(Common::BitStream32BEMSB *ss, byte *cur
 		case 3:
 			putPixels8XY2C(dst, src, pitch, 8);
 			break;
+		default:
+			break;
 		}
 
 		// select next block
@@ -789,6 +793,8 @@ bool SVQ1Decoder::svq1DecodeDeltaBlock(Common::BitStream32BEMSB *ss, byte *curre
 	case SVQ1_BLOCK_INTRA:
 		resultValid = svq1DecodeBlockIntra(ss, current, pitch);
 		break;
+	default:
+		break;
 	}
 
 	return resultValid;
diff --git a/image/iff.cpp b/image/iff.cpp
index d75fffb..e0ac108 100644
--- a/image/iff.cpp
+++ b/image/iff.cpp
@@ -82,6 +82,10 @@ bool IFFDecoder::loadStream(Common::SeekableReadStream &stream) {
 		case ID_PBM:
 			_type = TYPE_PBM;
 			break;
+		case TYPE_UNKNOWN:
+		default:
+			_type = TYPE_UNKNOWN;
+			break;
 	}
 
 	if (type == TYPE_UNKNOWN) {
diff --git a/image/jpeg.cpp b/image/jpeg.cpp
index 2975cb1..89e40dd 100644
--- a/image/jpeg.cpp
+++ b/image/jpeg.cpp
@@ -268,6 +268,8 @@ bool JPEGDecoder::loadStream(Common::SeekableReadStream &stream) {
 	case kColorSpaceYUV:
 		cinfo.out_color_space = JCS_YCbCr;
 		break;
+	default:
+		break;
 	}
 
 	// Actually start decompressing the image
@@ -290,6 +292,8 @@ bool JPEGDecoder::loadStream(Common::SeekableReadStream &stream) {
 		// This is pretty ugly since our PixelFormat cannot express YUV...
 		_surface.create(cinfo.output_width, cinfo.output_height, Graphics::PixelFormat(3, 0, 0, 0, 0, 0, 0, 0, 0));
 		break;
+	default:
+		break;
 	}
 
 	// Allocate buffer for one scanline
diff --git a/image/pict.cpp b/image/pict.cpp
index a82bba0..e7a65b8 100644
--- a/image/pict.cpp
+++ b/image/pict.cpp
@@ -421,6 +421,8 @@ void PICTDecoder::unpackBitsRect(Common::SeekableReadStream &stream, bool withPa
 			}
 		}
 		break;
+	default:
+		break;
 	}
 
 	delete[] buffer;




More information about the Scummvm-git-logs mailing list