From 5350b0f11347e593fee1d14d1d06ddb7aa11f133 Mon Sep 17 00:00:00 2001 From: Timofey Titovets Date: Tue, 13 Jun 2017 18:05:38 +0300 Subject: [PATCH] Bees: fix [-Werror=implicit-fallthrough=] In gcc 7+ warning: implicit-fallthrough has been added In some places fallthrough is expectable, disable warning Signed-off-by: Timofey Titovets --- lib/extentwalker.cc | 17 +++++++++-------- src/bees-roots.cc | 1 + 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/extentwalker.cc b/lib/extentwalker.cc index 626255a..3f6001b 100644 --- a/lib/extentwalker.cc +++ b/lib/extentwalker.cc @@ -520,25 +520,26 @@ namespace crucible { auto type = call_btrfs_get(btrfs_stack_file_extent_type, i.m_data); off_t len = -1; - switch (type) { - default: + switch (type) { + default: cerr << "Unhandled file extent type " << type << " in root " << m_tree_id << " ino " << m_stat.st_ino << endl; break; - case BTRFS_FILE_EXTENT_INLINE: + case BTRFS_FILE_EXTENT_INLINE: len = ranged_cast(call_btrfs_get(btrfs_stack_file_extent_ram_bytes, i.m_data)); e.m_flags |= FIEMAP_EXTENT_DATA_INLINE | FIEMAP_EXTENT_NOT_ALIGNED; // Inline extents are never obscured, so don't bother filling in m_physical_len, etc. - break; - case BTRFS_FILE_EXTENT_PREALLOC: + break; + case BTRFS_FILE_EXTENT_PREALLOC: e.m_flags |= Extent::PREALLOC; - case BTRFS_FILE_EXTENT_REG: { + // fallthrough + case BTRFS_FILE_EXTENT_REG: { e.m_physical = call_btrfs_get(btrfs_stack_file_extent_disk_bytenr, i.m_data); // This is the length of the full extent (decompressed) - off_t ram = ranged_cast(call_btrfs_get(btrfs_stack_file_extent_ram_bytes, i.m_data)); + off_t ram = ranged_cast(call_btrfs_get(btrfs_stack_file_extent_ram_bytes, i.m_data)); // This is the length of the part of the extent appearing in the file (decompressed) - len = ranged_cast(call_btrfs_get(btrfs_stack_file_extent_num_bytes, i.m_data)); + len = ranged_cast(call_btrfs_get(btrfs_stack_file_extent_num_bytes, i.m_data)); // This is the offset from start of on-disk extent to the part we see in the file (decompressed) // May be negative due to the kind of bug we're stuck with forever, so no cast range check diff --git a/src/bees-roots.cc b/src/bees-roots.cc index 4fba68d..921132c 100644 --- a/src/bees-roots.cc +++ b/src/bees-roots.cc @@ -768,6 +768,7 @@ BeesCrawl::fetch_extents() break; case BTRFS_FILE_EXTENT_PREALLOC: BEESCOUNT(crawl_prealloc); + // fallthrough case BTRFS_FILE_EXTENT_REG: { auto physical = call_btrfs_get(btrfs_stack_file_extent_disk_bytenr, i.m_data); auto ram = call_btrfs_get(btrfs_stack_file_extent_ram_bytes, i.m_data);