aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorD G Turner2019-11-17 10:11:25 +0000
committerD G Turner2019-11-17 10:11:25 +0000
commitbe56e9afed697dd580c7348e8a9467281bac3517 (patch)
tree21838ac55e5b55c495d12c03d6d0b13cc6975321
parentb46f07b823fbde7b7e0aadf1bbf583fb07377332 (diff)
downloadscummvm-rg350-be56e9afed697dd580c7348e8a9467281bac3517.tar.gz
scummvm-rg350-be56e9afed697dd580c7348e8a9467281bac3517.tar.bz2
scummvm-rg350-be56e9afed697dd580c7348e8a9467281bac3517.zip
GRAPHICS: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
-rw-r--r--graphics/VectorRendererSpec.cpp27
-rw-r--r--graphics/fontman.cpp3
-rw-r--r--graphics/fonts/ttf.cpp5
-rw-r--r--graphics/scaler/aspect.cpp4
-rw-r--r--graphics/scaler/hq2x.cpp2
-rw-r--r--graphics/scaler/hq3x.cpp2
-rw-r--r--graphics/scaler/scalebit.cpp8
7 files changed, 51 insertions, 0 deletions
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index cbd5d78d0d..457e9ff149 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -448,6 +448,7 @@ void colorFill(PixelType *first, PixelType *last, PixelType color) {
return;
int n = (count + 7) >> 3;
switch (count % 8) {
+ default:
case 0: do {
*first++ = color; // fall through
case 7: *first++ = color; // fall through
@@ -488,6 +489,7 @@ void colorFillClip(PixelType *first, PixelType *last, PixelType color, int realX
int n = (count + 7) >> 3;
switch (count % 8) {
+ default:
case 0: do {
*first++ = color; // fall through
case 7: *first++ = color; // fall through
@@ -1205,6 +1207,9 @@ drawCircle(int x, int y, int r) {
case kFillGradient:
break;
+
+ default:
+ break;
}
}
@@ -1263,6 +1268,9 @@ drawSquare(int x, int y, int w, int h) {
drawSquareAlg(x, y, w, h, _fgColor, kFillDisabled);
}
break;
+
+ default:
+ break;
}
}
@@ -1350,6 +1358,9 @@ drawTab(int x, int y, int r, int w, int h) {
else
drawTabAlg(x, y, w, h, r, _fgColor, Base::_fillMode);
break;
+
+ default:
+ break;
}
}
@@ -1392,6 +1403,7 @@ drawTriangle(int x, int y, int w, int h, TriangleOrientation orient) {
case kTriangleLeft:
case kTriangleRight:
case kTriangleAuto:
+ default:
break;
}
@@ -1418,6 +1430,7 @@ drawTriangle(int x, int y, int w, int h, TriangleOrientation orient) {
case kTriangleLeft:
case kTriangleRight:
case kTriangleAuto:
+ default:
break;
}
@@ -2286,6 +2299,8 @@ drawTriangleVertAlg(int x1, int y1, int w, int h, bool inverted, PixelType color
blendPixelPtr(ptr_right, color, rfpart(intery));
blendPixelPtr(ptr_left, color, rfpart(intery));
break;
+ default:
+ break;
}
}
@@ -2339,6 +2354,8 @@ drawTriangleVertAlg(int x1, int y1, int w, int h, bool inverted, PixelType color
blendPixelPtr(ptr_right, color, rfpart(interx));
blendPixelPtr(ptr_left, color, rfpart(interx));
break;
+ default:
+ break;
}
}
@@ -2382,6 +2399,8 @@ drawTriangleVertAlg(int x1, int y1, int w, int h, bool inverted, PixelType color
blendPixelPtr(ptr_right, color, rfpart(interx));
blendPixelPtr(ptr_left, color, rfpart(interx));
break;
+ default:
+ break;
}
}
@@ -2480,6 +2499,8 @@ drawTriangleVertAlgClip(int x1, int y1, int w, int h, bool inverted, PixelType c
blendPixelPtrClip(ptr_right, color, rfpart(intery), x_right, y_right);
blendPixelPtrClip(ptr_left, color, rfpart(intery), x_left, y_left);
break;
+ default:
+ break;
}
}
@@ -2539,6 +2560,8 @@ drawTriangleVertAlgClip(int x1, int y1, int w, int h, bool inverted, PixelType c
blendPixelPtrClip(ptr_right, color, rfpart(interx), x_right, y_right);
blendPixelPtrClip(ptr_left, color, rfpart(interx), x_left, y_left);
break;
+ default:
+ break;
}
}
@@ -2587,6 +2610,8 @@ drawTriangleVertAlgClip(int x1, int y1, int w, int h, bool inverted, PixelType c
blendPixelPtrClip(ptr_right, color, rfpart(interx), x_right, y_right);
blendPixelPtrClip(ptr_left, color, rfpart(interx), x_left, y_left);
break;
+ default:
+ break;
}
}
}
@@ -2634,6 +2659,8 @@ drawTriangleFast(int x1, int y1, int size, bool inverted, PixelType color, Vecto
case kFillGradient:
colorFill<PixelType>(ptr_right, ptr_left, calcGradient(gradient_h++, size));
break;
+ default:
+ break;
}
if (x1 == x2 && y1 == y2)
diff --git a/graphics/fontman.cpp b/graphics/fontman.cpp
index 5cf52416cf..98a7e8320c 100644
--- a/graphics/fontman.cpp
+++ b/graphics/fontman.cpp
@@ -187,6 +187,9 @@ const Font *FontManager::getFontByUsage(FontUsage usage) const {
return g_sysfont_big;
else
return _fontMap[_localizedFontName];
+ break;
+ default:
+ break;
}
return 0;
diff --git a/graphics/fonts/ttf.cpp b/graphics/fonts/ttf.cpp
index 89f26c7727..8c75aaa831 100644
--- a/graphics/fonts/ttf.cpp
+++ b/graphics/fonts/ttf.cpp
@@ -239,6 +239,9 @@ bool TTFFont::load(Common::SeekableReadStream &stream, int size, TTFSizeMode siz
_loadFlags = FT_LOAD_TARGET_MONO;
_renderMode = FT_RENDER_MODE_MONO;
break;
+
+ default:
+ break;
}
FT_Fixed yScale = _face->size->metrics.y_scale;
@@ -298,6 +301,8 @@ int TTFFont::computePointSize(int size, TTFSizeMode sizeMode) const {
case kTTFSizeModeCharacter:
ptSize = size;
break;
+ default:
+ break;
}
return ptSize;
diff --git a/graphics/scaler/aspect.cpp b/graphics/scaler/aspect.cpp
index f85d043a83..0f2b2aed40 100644
--- a/graphics/scaler/aspect.cpp
+++ b/graphics/scaler/aspect.cpp
@@ -252,6 +252,8 @@ int stretch200To240Interpolated(uint8 *buf, uint32 pitch, int width, int height,
case 4:
interpolate5Line<ColorMask, 1>((uint16 *)dstPtr, (const uint16 *)srcPtr, (const uint16 *)(srcPtr - pitch), width);
break;
+ default:
+ break;
}
dstPtr -= pitch;
}
@@ -315,6 +317,8 @@ void Normal1xAspectTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr,
srcPtr -= srcPitch;
memcpy(dstPtr, srcPtr, sizeof(uint16) * width);
break;
+ default:
+ break;
}
#endif
diff --git a/graphics/scaler/hq2x.cpp b/graphics/scaler/hq2x.cpp
index 7efbef305c..04babb2c5b 100644
--- a/graphics/scaler/hq2x.cpp
+++ b/graphics/scaler/hq2x.cpp
@@ -1940,6 +1940,8 @@ static void HQ2x_implementation(const uint8 *srcPtr, uint32 srcPitch, uint8 *dst
PIXEL11_100
}
break;
+ default:
+ break;
}
w1 = w2;
diff --git a/graphics/scaler/hq3x.cpp b/graphics/scaler/hq3x.cpp
index 8ef82aea3d..713c4406cf 100644
--- a/graphics/scaler/hq3x.cpp
+++ b/graphics/scaler/hq3x.cpp
@@ -2917,6 +2917,8 @@ static void HQ3x_implementation(const uint8 *srcPtr, uint32 srcPitch, uint8 *dst
PIXEL22_2
}
break;
+ default:
+ break;
}
w1 = w2;
diff --git a/graphics/scaler/scalebit.cpp b/graphics/scaler/scalebit.cpp
index bcba5793e2..2c79cfcd27 100644
--- a/graphics/scaler/scalebit.cpp
+++ b/graphics/scaler/scalebit.cpp
@@ -59,6 +59,7 @@ static inline void stage_scale2x(void* dst0, void* dst1, const void* src0, const
case 2: scale2x_16_def(DST(16,0), DST(16,1), SRC(16,0), SRC(16,1), SRC(16,2), pixel_per_row); break;
case 4: scale2x_32_def(DST(32,0), DST(32,1), SRC(32,0), SRC(32,1), SRC(32,2), pixel_per_row); break;
#endif
+ default: break;
}
}
@@ -70,6 +71,7 @@ static inline void stage_scale3x(void* dst0, void* dst1, void* dst2, const void*
case 1: scale3x_8_def( DST( 8,0), DST( 8,1), DST( 8,2), SRC( 8,0), SRC( 8,1), SRC( 8,2), pixel_per_row); break;
case 2: scale3x_16_def(DST(16,0), DST(16,1), DST(16,2), SRC(16,0), SRC(16,1), SRC(16,2), pixel_per_row); break;
case 4: scale3x_32_def(DST(32,0), DST(32,1), DST(32,2), SRC(32,0), SRC(32,1), SRC(32,2), pixel_per_row); break;
+ default: break;
}
}
@@ -290,6 +292,8 @@ int scale_precondition(unsigned scale, unsigned pixel, unsigned width, unsigned
if (height < 4)
return -1;
break;
+ default:
+ break;
}
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
@@ -305,6 +309,8 @@ int scale_precondition(unsigned scale, unsigned pixel, unsigned width, unsigned
if (width < 2)
return -1;
break;
+ default:
+ break;
}
#else
if (width < 2)
@@ -338,5 +344,7 @@ void scale(unsigned scale, void* void_dst, unsigned dst_slice, const void* void_
case 4:
scale4x(void_dst, dst_slice, void_src, src_slice, pixel, width, height);
break;
+ default:
+ break;
}
}