Merge branch 'wip/otte/fallthrough' into 'master'

Add G_GNUC_FALLTHROUGH for __attribute__(fallthrough))

See merge request GNOME/glib!296
This commit is contained in:
Philip Withnall
2018-09-04 22:06:26 +00:00
12 changed files with 45 additions and 7 deletions

View File

@@ -166,9 +166,11 @@ test_data_array (guchar *buffer, gsize len,
case TEST_DATA_INT16:
case TEST_DATA_UINT16:
g_assert_cmpint (len % 2, ==, 0);
G_GNUC_FALLTHROUGH;
case TEST_DATA_INT32:
case TEST_DATA_UINT32:
g_assert_cmpint (len % 4, ==, 0);
G_GNUC_FALLTHROUGH;
case TEST_DATA_INT64:
case TEST_DATA_UINT64:
g_assert_cmpint (len % 8, ==, 0);

View File

@@ -33,12 +33,14 @@ cook_piece (void)
{
case 26:
buffer[i++] = '\n';
G_GNUC_FALLTHROUGH;
case 27:
buffer[i++] = '\r';
break;
case 28:
buffer[i++] = '\r';
G_GNUC_FALLTHROUGH;
case 29:
buffer[i++] = '\n';
break;