refactor: add [[fallthrough]] annotation (#1886)
This commit is contained in:
parent
003685b40a
commit
f876a100a0
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -647,7 +647,7 @@ static int tr_lpdAnnounceMore(time_t const now, int const interval)
|
|||
announcePrio = 2;
|
||||
break;
|
||||
|
||||
default: /* fall through */
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
/***
|
||||
****
|
||||
***/
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue