From 03aeb1d463ad799e91baf620a2dcac87c6ea8763 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Fri, 4 Aug 2017 12:35:27 +0900 Subject: [PATCH] fix fallthrough warnings --- src/bin/e_comp.c | 2 + src/bin/e_dnd.c | 4 + src/bin/e_fm.c | 2 + src/bin/e_fm/e_fm_main_udisks2.c | 3 + src/bin/e_intl.c | 8 ++ src/bin/e_main.c | 14 ++- src/bin/e_randr2.c | 2 + src/modules/cpufreq/e_mod_main.c | 6 ++ .../mixer/lib/backends/pulseaudio/pulse.c | 98 ++++++++++--------- src/modules/sysinfo/cpuclock/cpuclock.c | 3 + src/modules/xwayland/e_mod_main.c | 1 + 11 files changed, 90 insertions(+), 53 deletions(-) diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c index aed07e6c7..6113d125c 100644 --- a/src/bin/e_comp.c +++ b/src/bin/e_comp.c @@ -1624,7 +1624,9 @@ e_comp_e_object_layer_get(const E_Object *obj) case E_GADCON_CLIENT_TYPE: gc = ((E_Gadcon_Client *)(void *)(obj))->gadcon; EINA_SAFETY_ON_NULL_RETURN_VAL(gc, 0); + EINA_FALLTHROUGH; /* no break */ + case E_GADCON_TYPE: if (!gc) gc = (E_Gadcon *)obj; if (gc->shelf) return gc->shelf->layer; diff --git a/src/bin/e_dnd.c b/src/bin/e_dnd.c index 28b855563..5bea50fec 100644 --- a/src/bin/e_dnd.c +++ b/src/bin/e_dnd.c @@ -718,7 +718,9 @@ _e_drag_win_get(const E_Drop_Handler *h, int xdnd) case E_GADCON_CLIENT_TYPE: gc = ((E_Gadcon_Client *)(void *)(h->obj))->gadcon; if (!gc) return 0; + EINA_FALLTHROUGH; /* no break */ + case E_GADCON_TYPE: if (!gc) gc = (E_Gadcon *)h->obj; @@ -821,7 +823,9 @@ _e_dnd_object_layer_get(E_Drop_Handler *h) case E_GADCON_CLIENT_TYPE: /* add 1 to ensure we're above a potential receiving gadcon */ adjust = 1; + EINA_FALLTHROUGH; /* no break */ + default: adjust += e_comp_e_object_layer_get(obj); } diff --git a/src/bin/e_fm.c b/src/bin/e_fm.c index d4b74d315..2047643b7 100644 --- a/src/bin/e_fm.c +++ b/src/bin/e_fm.c @@ -5945,6 +5945,8 @@ _e_fm2_typebuf_match(Evas_Object *obj, int next) x++; break; } + EINA_FALLTHROUGH; + /* no break */ case 1: _e_fm2_icon_desel_any(obj); diff --git a/src/bin/e_fm/e_fm_main_udisks2.c b/src/bin/e_fm/e_fm_main_udisks2.c index e6585d2f4..da5e3b6c8 100644 --- a/src/bin/e_fm/e_fm_main_udisks2.c +++ b/src/bin/e_fm/e_fm_main_udisks2.c @@ -1000,6 +1000,9 @@ _e_fm_main_udisks2_volume_mounts_update(E_Volume *v, Eldbus_Message_Iter *arr3, if (m) mounts = eina_list_append(mounts, m); } while (eldbus_message_iter_next(fuckyouglib)); + EINA_FALLTHROUGH; + /* no break */ + default: continue; } } diff --git a/src/bin/e_intl.c b/src/bin/e_intl.c index a4f3de82d..82dc718e9 100644 --- a/src/bin/e_intl.c +++ b/src/bin/e_intl.c @@ -713,17 +713,25 @@ e_intl_locale_parts_get(const char *locale) case 0: language[tmp_idx] = 0; tmp_idx = 0; + EINA_FALLTHROUGH; + /* no break */ case 1: territory[tmp_idx] = 0; tmp_idx = 0; + EINA_FALLTHROUGH; + /* no break */ case 2: codeset[tmp_idx] = 0; tmp_idx = 0; + EINA_FALLTHROUGH; + /* no break */ case 3: modifier[tmp_idx] = 0; + EINA_FALLTHROUGH; + /* no break */ default: break; diff --git a/src/bin/e_main.c b/src/bin/e_main.c index 01d0f0e53..ed076f72b 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -1570,20 +1570,24 @@ _e_main_test_formats(void) evas_object_image_file_set(im, buff, key); switch (evas_object_image_load_error_get(im)) { - default: - e_error_message_show(_("Enlightenment found Evas can't load '%s' files. " - "Check Evas has '%s' loader support.\n"), t, t); - if (i) _e_main_shutdown(-1); - break; case EVAS_LOAD_ERROR_CORRUPT_FILE: case EVAS_LOAD_ERROR_DOES_NOT_EXIST: case EVAS_LOAD_ERROR_PERMISSION_DENIED: e_error_message_show(_("Enlightenment cannot access test image for '%s' filetype. " "Check your install for setup issues.\n"), t); + EINA_FALLTHROUGH; + // fallthrough anyway as normally these files should work + case EVAS_LOAD_ERROR_NONE: snprintf(b, sizeof(b), ".%s", types[i]); efreet_icon_extension_add(b); break; + + default: + e_error_message_show(_("Enlightenment found Evas can't load '%s' files. " + "Check Evas has '%s' loader support.\n"), t, t); + if (i) _e_main_shutdown(-1); + break; } } diff --git a/src/bin/e_randr2.c b/src/bin/e_randr2.c index 484f15f49..4a67ff4df 100644 --- a/src/bin/e_randr2.c +++ b/src/bin/e_randr2.c @@ -407,6 +407,8 @@ _config_update(E_Randr2 *r, E_Config_Randr2 *cfg, Eina_Bool update_only) ecore_timer_loop_add(2, _config_ask_dialog, eina_strdup(s->info.name)); else ecore_timer_loop_add(0.01, _config_ask_dialog, eina_strdup(s->info.name)); + EINA_FALLTHROUGH; + /* no break */ case E_RANDR2_POLICY_NONE: cs->rel_mode = E_RANDR2_RELATIVE_NONE; break; diff --git a/src/modules/cpufreq/e_mod_main.c b/src/modules/cpufreq/e_mod_main.c index 65e168db6..409e217c1 100644 --- a/src/modules/cpufreq/e_mod_main.c +++ b/src/modules/cpufreq/e_mod_main.c @@ -1153,11 +1153,17 @@ _cpufreq_event_cb_powersave(void *data EINA_UNUSED, int type, void *event) _cpufreq_set_governor("conservative"); break; } + EINA_FALLTHROUGH; + /* no break */ case E_POWERSAVE_MODE_EXTREME: + case E_POWERSAVE_MODE_FREEZE: if (has_powersave) _cpufreq_set_governor("powersave"); break; + + default: + break; } return ECORE_CALLBACK_PASS_ON; diff --git a/src/modules/mixer/lib/backends/pulseaudio/pulse.c b/src/modules/mixer/lib/backends/pulseaudio/pulse.c index ec1bdc1b4..88c3b553c 100644 --- a/src/modules/mixer/lib/backends/pulseaudio/pulse.c +++ b/src/modules/mixer/lib/backends/pulseaudio/pulse.c @@ -716,66 +716,68 @@ _pulse_pa_state_cb(pa_context *context, void *data) break; case PA_CONTEXT_READY: - { - ctx->connect = NULL; - ctx->connected = EINA_TRUE; - pa_context_set_subscribe_callback(context, _subscribe_cb, ctx); - if (!(o = pa_context_subscribe(context, (pa_subscription_mask_t) - (PA_SUBSCRIPTION_MASK_SINK| - PA_SUBSCRIPTION_MASK_SOURCE| - PA_SUBSCRIPTION_MASK_SINK_INPUT| - PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT| - PA_SUBSCRIPTION_MASK_CLIENT| - PA_SUBSCRIPTION_MASK_SERVER| - PA_SUBSCRIPTION_MASK_CARD), - NULL, NULL))) - { - ERR("pa_context_subscribe() failed"); - return; - } - pa_operation_unref(o); + ctx->connect = NULL; + ctx->connected = EINA_TRUE; + pa_context_set_subscribe_callback(context, _subscribe_cb, ctx); + if (!(o = pa_context_subscribe(context, (pa_subscription_mask_t) + (PA_SUBSCRIPTION_MASK_SINK| + PA_SUBSCRIPTION_MASK_SOURCE| + PA_SUBSCRIPTION_MASK_SINK_INPUT| + PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT| + PA_SUBSCRIPTION_MASK_CLIENT| + PA_SUBSCRIPTION_MASK_SERVER| + PA_SUBSCRIPTION_MASK_CARD), + NULL, NULL))) + { + ERR("pa_context_subscribe() failed"); + return; + } + pa_operation_unref(o); - if (!(o = pa_context_get_sink_info_list(context, _sink_cb, ctx))) - { - ERR("pa_context_get_sink_info_list() failed"); - return; - } - pa_operation_unref(o); + if (!(o = pa_context_get_sink_info_list(context, _sink_cb, ctx))) + { + ERR("pa_context_get_sink_info_list() failed"); + return; + } + pa_operation_unref(o); - if (!(o = pa_context_get_sink_input_info_list(context, - _sink_input_cb, - ctx))) - { - ERR("pa_context_get_sink_input_info_list() failed"); - return; - } - pa_operation_unref(o); - - if (!(o = pa_context_get_source_info_list(context, _source_cb, + if (!(o = pa_context_get_sink_input_info_list(context, + _sink_input_cb, ctx))) - { - ERR("pa_context_get_source_info_list() failed"); - return; - } - pa_operation_unref(o); + { + ERR("pa_context_get_sink_input_info_list() failed"); + return; + } + pa_operation_unref(o); - if (!(o = pa_context_get_server_info(context, _server_info_cb, - ctx))) - { - ERR("pa_context_get_server_info() failed"); - return; - } - pa_operation_unref(o); - break; - } + if (!(o = pa_context_get_source_info_list(context, _source_cb, + ctx))) + { + ERR("pa_context_get_source_info_list() failed"); + return; + } + pa_operation_unref(o); + + if (!(o = pa_context_get_server_info(context, _server_info_cb, + ctx))) + { + ERR("pa_context_get_server_info() failed"); + return; + } + pa_operation_unref(o); + break; case PA_CONTEXT_FAILED: WRN("PA_CONTEXT_FAILED"); if (!ctx->connect) ctx->connect = ecore_timer_loop_add(1, _pulse_connect, data); goto err; + case PA_CONTEXT_TERMINATED: ERR("PA_CONTEXT_TERMINATE:"); + EINA_FALLTHROUGH; + /* no break */ + default: if (ctx->connect) { diff --git a/src/modules/sysinfo/cpuclock/cpuclock.c b/src/modules/sysinfo/cpuclock/cpuclock.c index 159cbcd7c..d446ca255 100644 --- a/src/modules/sysinfo/cpuclock/cpuclock.c +++ b/src/modules/sysinfo/cpuclock/cpuclock.c @@ -240,6 +240,9 @@ _cpuclock_event_cb_powersave(void *data, int type, void *event) _cpuclock_set_governor("conservative"); break; } + EINA_FALLTHROUGH; + /* no break */ + case E_POWERSAVE_MODE_EXTREME: default: if (has_powersave) diff --git a/src/modules/xwayland/e_mod_main.c b/src/modules/xwayland/e_mod_main.c index b7d01a16f..2f4f0b1f8 100644 --- a/src/modules/xwayland/e_mod_main.c +++ b/src/modules/xwayland/e_mod_main.c @@ -330,6 +330,7 @@ setup_lock(void) case EEXIST: exs->disp++; EINA_FALLTHROUGH; + /* no break */ case EAGAIN: continue; case 0: