[PATCH 6/8] core: Fix gcc-7 -Wimplicit-fallthrough= warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



the comment /* Fall through. */ fixes the warning, but gcc-7 seems to be more
picky about the position in the code

pulsecore/sink-input.c: In function â??pa_sink_input_update_proplistâ??:
pulsecore/sink-input.c:1531:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
             for (state = NULL; (key = pa_proplist_iterate(i->proplist, &state));) {
             ^~~
pulsecore/sink-input.c:1539:9: note: here
         case PA_UPDATE_REPLACE: {
         ^~~~

Signed-off-by: Peter Meerwald-Stadler <pmeerw at pmeerw.net>
---
 src/pulsecore/sink-input.c    | 11 +++--------
 src/pulsecore/source-output.c | 11 +++--------
 2 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 4155b69..d1e16ee 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -1526,7 +1526,7 @@ void pa_sink_input_update_proplist(pa_sink_input *i, pa_update_mode_t mode, pa_p
     pa_assert_ctl_context();
 
     switch (mode) {
-        case PA_UPDATE_SET: {
+        case PA_UPDATE_SET:
             /* Delete everything that is not in p. */
             for (state = NULL; (key = pa_proplist_iterate(i->proplist, &state));) {
                 if (!pa_proplist_contains(p, key))
@@ -1534,18 +1534,14 @@ void pa_sink_input_update_proplist(pa_sink_input *i, pa_update_mode_t mode, pa_p
             }
 
             /* Fall through. */
-        }
-
-        case PA_UPDATE_REPLACE: {
+        case PA_UPDATE_REPLACE:
             for (state = NULL; (key = pa_proplist_iterate(p, &state));) {
                 pa_proplist_get(p, key, (const void **) &value, &nbytes);
                 pa_sink_input_set_property_arbitrary(i, key, value, nbytes);
             }
 
             break;
-        }
-
-        case PA_UPDATE_MERGE: {
+        case PA_UPDATE_MERGE:
             for (state = NULL; (key = pa_proplist_iterate(p, &state));) {
                 if (pa_proplist_contains(i->proplist, key))
                     continue;
@@ -1555,7 +1551,6 @@ void pa_sink_input_update_proplist(pa_sink_input *i, pa_update_mode_t mode, pa_p
             }
 
             break;
-        }
     }
 }
 
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index a4c99af..d2b645c 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -1171,7 +1171,7 @@ void pa_source_output_update_proplist(pa_source_output *o, pa_update_mode_t mode
     pa_assert_ctl_context();
 
     switch (mode) {
-        case PA_UPDATE_SET: {
+        case PA_UPDATE_SET:
             /* Delete everything that is not in p. */
             for (state = NULL; (key = pa_proplist_iterate(o->proplist, &state));) {
                 if (!pa_proplist_contains(p, key))
@@ -1179,18 +1179,14 @@ void pa_source_output_update_proplist(pa_source_output *o, pa_update_mode_t mode
             }
 
             /* Fall through. */
-        }
-
-        case PA_UPDATE_REPLACE: {
+        case PA_UPDATE_REPLACE:
             for (state = NULL; (key = pa_proplist_iterate(p, &state));) {
                 pa_proplist_get(p, key, (const void **) &value, &nbytes);
                 pa_source_output_set_property_arbitrary(o, key, value, nbytes);
             }
 
             break;
-        }
-
-        case PA_UPDATE_MERGE: {
+        case PA_UPDATE_MERGE:
             for (state = NULL; (key = pa_proplist_iterate(p, &state));) {
                 if (pa_proplist_contains(o->proplist, key))
                     continue;
@@ -1200,7 +1196,6 @@ void pa_source_output_update_proplist(pa_source_output *o, pa_update_mode_t mode
             }
 
             break;
-        }
     }
 }
 
-- 
2.7.4



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux