[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2-demos] master e2a055e: Silence gcc 7's fall-through warnings
From: |
Werner LEMBERG |
Subject: |
[freetype2-demos] master e2a055e: Silence gcc 7's fall-through warnings in `switch' blocks. |
Date: |
Thu, 30 May 2019 03:24:47 -0400 (EDT) |
branch: master
commit e2a055e732ca9dc95a4bb3c42578fd93c30b54d6
Author: Werner Lemberg <address@hidden>
Commit: Werner Lemberg <address@hidden>
Silence gcc 7's fall-through warnings in `switch' blocks.
Instead of an intentionally missing `break' statement there must be a
comment line containing `fall through' (and nothing else) right before the
next `case' statement.
See
https://stackoverflow.com/questions/45129741/gcc-7-wimplicit-fallthrough-warnings-and-portable-way-to-clear-them
---
graph/grblit.c | 13 +++++++------
graph/grfill.c | 2 ++
graph/x11/grx11.c | 1 +
src/ftcommon.c | 1 +
4 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/graph/grblit.c b/graph/grblit.c
index babfde6..02b515c 100644
--- a/graph/grblit.c
+++ b/graph/grblit.c
@@ -2024,6 +2024,7 @@
blit_lcdv_to_24( &blit, color, glyph->grays-1 );
break;
}
+ /* fall through */
case gr_pixel_mode_lcd2:
if ( mode == gr_pixel_mode_rgb24 )
@@ -2039,12 +2040,12 @@
break;
case gr_pixel_mode_lcdv2:
- if ( mode == gr_pixel_mode_rgb24 )
- {
- if ( glyph->grays > 1 )
- blit_lcdv2_to_24( &blit, color, glyph->grays-1 );
- }
- break;
+ if ( mode == gr_pixel_mode_rgb24 )
+ {
+ if ( glyph->grays > 1 )
+ blit_lcdv2_to_24( &blit, color, glyph->grays-1 );
+ }
+ break;
default:
/* we don't support the blitting of bitmaps of the following */
diff --git a/graph/grfill.c b/graph/grfill.c
index 9148f81..19056a8 100644
--- a/graph/grfill.c
+++ b/graph/grfill.c
@@ -257,8 +257,10 @@ grFillRect( grBitmap* target,
{
case gr_pixel_mode_rgb32:
size++;
+ /* fall through */
case gr_pixel_mode_rgb24:
size++;
+ /* fall through */
case gr_pixel_mode_rgb565:
case gr_pixel_mode_rgb555:
size += 2;
diff --git a/graph/x11/grx11.c b/graph/x11/grx11.c
index 78e5764..9282a1d 100644
--- a/graph/x11/grx11.c
+++ b/graph/x11/grx11.c
@@ -1275,6 +1275,7 @@ typedef unsigned long uint32;
surface->convert = format->gray_convert;
break;
}
+ /* fall through */
default:
/* we don't support other modes */
diff --git a/src/ftcommon.c b/src/ftcommon.c
index 8699add..fac9c99 100644
--- a/src/ftcommon.c
+++ b/src/ftcommon.c
@@ -565,6 +565,7 @@
/* some fonts use range 0x00-0x100, others have 0xF000-0xF0FF */
case FT_ENCODING_MS_SYMBOL:
font->num_indices = 0x10000L;
+ break;
default:
font->num_indices = 0x10000L;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2-demos] master e2a055e: Silence gcc 7's fall-through warnings in `switch' blocks.,
Werner LEMBERG <=