diff --git a/gtk/makemeta-ui.cc b/gtk/makemeta-ui.cc index 1bd74cc6f..5c6a9350a 100644 --- a/gtk/makemeta-ui.cc +++ b/gtk/makemeta-ui.cc @@ -161,8 +161,7 @@ static void onProgressDialogResponse(GtkDialog* d, int response, gpointer data) case GTK_RESPONSE_ACCEPT: addTorrent(ui); - - /* fall-through */ + [[fallthrough]]; case GTK_RESPONSE_CLOSE: gtk_widget_destroy(ui->builder->result ? GTK_WIDGET(d) : ui->dialog); diff --git a/libtransmission/bandwidth.cc b/libtransmission/bandwidth.cc index e94459109..af894e999 100644 --- a/libtransmission/bandwidth.cc +++ b/libtransmission/bandwidth.cc @@ -247,10 +247,12 @@ void tr_bandwidthAllocate(tr_bandwidth* b, tr_direction dir, unsigned int period switch (io->priority) { case TR_PRI_HIGH: - tr_ptrArrayAppend(&high, io); /* fall through */ + tr_ptrArrayAppend(&high, io); + [[fallthrough]]; case TR_PRI_NORMAL: - tr_ptrArrayAppend(&normal, io); /* fall through */ + tr_ptrArrayAppend(&normal, io); + [[fallthrough]]; default: tr_ptrArrayAppend(&low, io); diff --git a/libtransmission/tr-lpd.cc b/libtransmission/tr-lpd.cc index 5cd3346c4..6dad490f9 100644 --- a/libtransmission/tr-lpd.cc +++ b/libtransmission/tr-lpd.cc @@ -647,7 +647,7 @@ static int tr_lpdAnnounceMore(time_t const now, int const interval) announcePrio = 2; break; - default: /* fall through */ + default: break; } diff --git a/libtransmission/tr-macros.h b/libtransmission/tr-macros.h index e42978ecf..96719a04f 100644 --- a/libtransmission/tr-macros.h +++ b/libtransmission/tr-macros.h @@ -121,12 +121,6 @@ #define TR_GNUC_MALLOC #endif -#if __has_attribute(__fallthrough__) || TR_GNUC_CHECK_VERSION(7, 0) -#define TR_GNUC_FALLTHROUGH __attribute__((__fallthrough__)) -#else -#define TR_GNUC_FALLTHROUGH -#endif - /*** **** ***/ diff --git a/libtransmission/trevent.cc b/libtransmission/trevent.cc index eb8c71fa7..198607f54 100644 --- a/libtransmission/trevent.cc +++ b/libtransmission/trevent.cc @@ -120,8 +120,8 @@ static int piperead(tr_pipe_end_t s, void* buf, int len) case WSAECONNRESET: /* EOF on the pipe! (win32 socket based implementation) */ ret = 0; + [[fallthrough]]; - /* fall through */ default: errno = werror; break; diff --git a/qt/Session.cc b/qt/Session.cc index 97f67937c..67777d87d 100644 --- a/qt/Session.cc +++ b/qt/Session.cc @@ -1042,7 +1042,8 @@ void Session::addTorrent(AddData const& add_me, tr_variant* args, bool trash_ori dictAdd(args, TR_KEY_filename, add_me.url.toString()); break; - case AddData::FILENAME: /* fall-through */ + case AddData::FILENAME: + [[fallthrough]]; case AddData::METAINFO: dictAdd(args, TR_KEY_metainfo, add_me.toBase64()); break; diff --git a/utils/remote.cc b/utils/remote.cc index 5b8a83615..9bc211a20 100644 --- a/utils/remote.cc +++ b/utils/remote.cc @@ -2112,9 +2112,7 @@ static int processResponse(char const* rpcurl, void const* response, size_t len) { tr_snprintf(id, sizeof(id), "%" PRId64, i); } - - /* fall-through to default: to give success or failure msg */ - TR_GNUC_FALLTHROUGH; + [[fallthrough]]; } default: