From 004709fcc10685b429c7fc90ad91980aeeb7aa8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Sun, 8 Mar 2020 09:38:00 +0100 Subject: [PATCH] Silenced warnings about fallthrough situations in switch cases of ntfsprogs Insert comments to silence compiler about fallthrough situations when they are wanted. --- ntfsprogs/ntfsclone.c | 1 + ntfsprogs/ntfsdecrypt.c | 4 ++++ ntfsprogs/ntfsfallocate.c | 5 +++++ ntfsprogs/ntfsresize.c | 2 ++ ntfsprogs/ntfsundelete.c | 5 +++++ ntfsprogs/ntfswipe.c | 1 + ntfsprogs/utils.c | 4 ++++ 7 files changed, 22 insertions(+) diff --git a/ntfsprogs/ntfsclone.c b/ntfsprogs/ntfsclone.c index bbf6d1f0..00876313 100644 --- a/ntfsprogs/ntfsclone.c +++ b/ntfsprogs/ntfsclone.c @@ -465,6 +465,7 @@ static void parse_options(int argc, char **argv) break; case 'O': opt.overwrite++; + /* FALLTHRU */ case 'o': if (opt.output) usage(1); diff --git a/ntfsprogs/ntfsdecrypt.c b/ntfsprogs/ntfsdecrypt.c index dbffc946..3fc34312 100644 --- a/ntfsprogs/ntfsdecrypt.c +++ b/ntfsprogs/ntfsdecrypt.c @@ -557,6 +557,7 @@ check_again: switch (err) { case GNUTLS_BAG_PKCS8_KEY: flags = GNUTLS_PKCS_PLAIN; + /* FALLTHRU */ case GNUTLS_BAG_PKCS8_ENCRYPTED_KEY: err = gnutls_pkcs12_bag_get_data(bag, 0, &dkey); if (err < 0) { @@ -1481,12 +1482,15 @@ static int ntfs_feed_encrypt(ntfs_inode *inode, ntfs_fek *fek) default : *b++ = val; val >>= 8; + /* FALLTHRU */ case 3 : *b++ = val; val >>= 8; + /* FALLTHRU */ case 2 : *b++ = val; val >>= 8; + /* FALLTHRU */ case 1 : *b++ = val; val >>= 8; diff --git a/ntfsprogs/ntfsfallocate.c b/ntfsprogs/ntfsfallocate.c index b0a7c4ec..7a2df7d1 100644 --- a/ntfsprogs/ntfsfallocate.c +++ b/ntfsprogs/ntfsfallocate.c @@ -214,10 +214,15 @@ static s64 option_value(const char *arg) count = 0; switch (*s++) { case 'E' : count++; + /* FALLTHRU */ case 'P' : count++; + /* FALLTHRU */ case 'T' : count++; + /* FALLTHRU */ case 'G' : count++; + /* FALLTHRU */ case 'M' : count++; + /* FALLTHRU */ case 'K' : count++; switch (*s++) { case 'i' : diff --git a/ntfsprogs/ntfsresize.c b/ntfsprogs/ntfsresize.c index a912f9df..48bb76ee 100644 --- a/ntfsprogs/ntfsresize.c +++ b/ntfsprogs/ntfsresize.c @@ -453,8 +453,10 @@ static s64 get_new_volume_size(char *s) switch (*suffix) { case 'G': size *= prefix_kind; + /* FALLTHRU */ case 'M': size *= prefix_kind; + /* FALLTHRU */ case 'k': size *= prefix_kind; break; diff --git a/ntfsprogs/ntfsundelete.c b/ntfsprogs/ntfsundelete.c index 746eac7b..caa1a128 100644 --- a/ntfsprogs/ntfsundelete.c +++ b/ntfsprogs/ntfsundelete.c @@ -567,10 +567,15 @@ static int parse_time(const char *value, time_t *since) switch (suffix[0]) { case 'y': case 'Y': result *= 12; + /* FALLTHRU */ case 'm': case 'M': result *= 4; + /* FALLTHRU */ case 'w': case 'W': result *= 7; + /* FALLTHRU */ case 'd': case 'D': result *= 24; + /* FALLTHRU */ case 'h': case 'H': result *= 3600; + /* FALLTHRU */ case 0: break; diff --git a/ntfsprogs/ntfswipe.c b/ntfsprogs/ntfswipe.c index b41f6168..ef67101e 100644 --- a/ntfsprogs/ntfswipe.c +++ b/ntfsprogs/ntfswipe.c @@ -314,6 +314,7 @@ static int parse_options(int argc, char *argv[]) case 'i': opts.info++; /* and fall through */ + /* FALLTHRU */ case 'a': opts.directory++; opts.logfile++; diff --git a/ntfsprogs/utils.c b/ntfsprogs/utils.c index 45a03a4f..393c34a4 100644 --- a/ntfsprogs/utils.c +++ b/ntfsprogs/utils.c @@ -364,9 +364,13 @@ int utils_parse_size(const char *value, s64 *size, BOOL scale) if (scale) { switch (suffix[0]) { case 't': case 'T': result *= 1000; + /* FALLTHRU */ case 'g': case 'G': result *= 1000; + /* FALLTHRU */ case 'm': case 'M': result *= 1000; + /* FALLTHRU */ case 'k': case 'K': result *= 1000; + /* FALLTHRU */ case '-': case 0: break; default: