Silence fall-through warnings.
authorWayne Davison <wayned@samba.org>
Fri, 4 Jan 2019 23:06:30 +0000 (15:06 -0800)
committerWayne Davison <wayned@samba.org>
Fri, 4 Jan 2019 23:06:30 +0000 (15:06 -0800)
acls.c
case_N.h
cleanup.c
hashtable.c
tls.c
util.c
zlib/inflate.c

diff --git a/acls.c b/acls.c
index 8d97df636b839a7d52efe60ff798b672cfced249..7351ad687385ce744ea93481b4db89054fce219a 100644 (file)
--- a/acls.c
+++ b/acls.c
@@ -1117,14 +1117,12 @@ int default_perms_for_dir(const char *dir)
                case ENOSYS:
                        /* No ACLs are available. */
                        break;
-               case ENOENT:
-                       if (dry_run) {
+               default:
+                       if (dry_run && errno == ENOENT) {
                                /* We're doing a dry run, so the containing directory
                                 * wasn't actually created.  Don't worry about it. */
                                break;
                        }
-                       /* Otherwise fall through. */
-               default:
                        rprintf(FWARNING,
                                "default_perms_for_dir: sys_acl_get_file(%s, %s): %s, falling back on umask\n",
                                dir, str_acl_type(SMB_ACL_TYPE_DEFAULT), strerror(errno));
index a21cf94d1c2622354e1dc74d91f782f753389710..f15d1d607efa7d7c1f7b6dda7e68a954d1feeb79 100644 (file)
--- a/case_N.h
+++ b/case_N.h
        case 0:
 #elif !defined CASE_N_STATE_1
 #define CASE_N_STATE_1
+       /* FALLTHROUGH */
        case 1:
 #elif !defined CASE_N_STATE_2
 #define CASE_N_STATE_2
+       /* FALLTHROUGH */
        case 2:
 #elif !defined CASE_N_STATE_3
 #define CASE_N_STATE_3
+       /* FALLTHROUGH */
        case 3:
 #elif !defined CASE_N_STATE_4
 #define CASE_N_STATE_4
+       /* FALLTHROUGH */
        case 4:
 #elif !defined CASE_N_STATE_5
 #define CASE_N_STATE_5
+       /* FALLTHROUGH */
        case 5:
 #elif !defined CASE_N_STATE_6
 #define CASE_N_STATE_6
+       /* FALLTHROUGH */
        case 6:
 #elif !defined CASE_N_STATE_7
 #define CASE_N_STATE_7
+       /* FALLTHROUGH */
        case 7:
 #elif !defined CASE_N_STATE_8
 #define CASE_N_STATE_8
+       /* FALLTHROUGH */
        case 8:
 #elif !defined CASE_N_STATE_9
 #define CASE_N_STATE_9
+       /* FALLTHROUGH */
        case 9:
 #elif !defined CASE_N_STATE_10
 #define CASE_N_STATE_10
+       /* FALLTHROUGH */
        case 10:
 #elif !defined CASE_N_STATE_11
 #define CASE_N_STATE_11
+       /* FALLTHROUGH */
        case 11:
 #elif !defined CASE_N_STATE_12
 #define CASE_N_STATE_12
+       /* FALLTHROUGH */
        case 12:
 #elif !defined CASE_N_STATE_13
 #define CASE_N_STATE_13
+       /* FALLTHROUGH */
        case 13:
 #elif !defined CASE_N_STATE_14
 #define CASE_N_STATE_14
+       /* FALLTHROUGH */
        case 14:
 #elif !defined CASE_N_STATE_15
 #define CASE_N_STATE_15
+       /* FALLTHROUGH */
        case 15:
 #elif !defined CASE_N_STATE_16
 #define CASE_N_STATE_16
+       /* FALLTHROUGH */
        case 16:
 #else
 #error Need to add more case statements!
index 95595f10c23a80cf4c23428b14efff7e9819bbdd..c3ae799925b2531373bf03cc3ca76c853c40a563 100644 (file)
--- a/cleanup.c
+++ b/cleanup.c
@@ -138,7 +138,6 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
                                who_am_i(), code, file, line);
                }
 
-               /* FALLTHROUGH */
 #include "case_N.h"
                switch_step++;
 
@@ -152,7 +151,6 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
                        }
                }
 
-               /* FALLTHROUGH */
 #include "case_N.h"
                switch_step++;
 
@@ -183,7 +181,6 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
                        }
                }
 
-               /* FALLTHROUGH */
 #include "case_N.h"
                switch_step++;
 
@@ -195,7 +192,6 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
                if (!exit_code && !code)
                        io_flush(FULL_FLUSH);
 
-               /* FALLTHROUGH */
 #include "case_N.h"
                switch_step++;
 
@@ -226,7 +222,6 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
                 || am_daemon || (logfile_name && (am_server || !INFO_GTE(STATS, 1))))
                        log_exit(exit_code, exit_file, exit_line);
 
-               /* FALLTHROUGH */
 #include "case_N.h"
                switch_step++;
 
@@ -238,7 +233,6 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
                                dry_run ? " (DRY RUN)" : "");
                }
 
-               /* FALLTHROUGH */
 #include "case_N.h"
                switch_step++;
 
@@ -254,7 +248,6 @@ NORETURN void _exit_cleanup(int code, const char *file, int line)
                        noop_io_until_death();
                }
 
-               /* FALLTHROUGH */
 #include "case_N.h"
                switch_step++;
 
index 2d06a66ea4f63f5412e8f3a94e8257d07fe38c4d..2fc2310ae65c2c201038eb671e1c2e0901322071 100644 (file)
@@ -453,16 +453,27 @@ uint32_t hashlittle(const void *key, size_t length)
     switch(length)                   /* all the case statements fall through */
     {
     case 12: c+=((uint32_t)k[11])<<24;
+            /* FALLTHROUGH */
     case 11: c+=((uint32_t)k[10])<<16;
+            /* FALLTHROUGH */
     case 10: c+=((uint32_t)k[9])<<8;
+            /* FALLTHROUGH */
     case 9 : c+=k[8];
+            /* FALLTHROUGH */
     case 8 : b+=((uint32_t)k[7])<<24;
+            /* FALLTHROUGH */
     case 7 : b+=((uint32_t)k[6])<<16;
+            /* FALLTHROUGH */
     case 6 : b+=((uint32_t)k[5])<<8;
+            /* FALLTHROUGH */
     case 5 : b+=k[4];
+            /* FALLTHROUGH */
     case 4 : a+=((uint32_t)k[3])<<24;
+            /* FALLTHROUGH */
     case 3 : a+=((uint32_t)k[2])<<16;
+            /* FALLTHROUGH */
     case 2 : a+=((uint32_t)k[1])<<8;
+            /* FALLTHROUGH */
     case 1 : a+=k[0];
              break;
     case 0 : return c;
diff --git a/tls.c b/tls.c
index 4ffca33edbe5e409458e7b3011d73bc70c5d04b8..0d5b7a4ab47ab496cf867005a371fbd68ce8be51 100644 (file)
--- a/tls.c
+++ b/tls.c
@@ -214,7 +214,7 @@ static struct poptOption long_options[] = {
   {0,0,0,0,0,0,0}
 };
 
-static void tls_usage(int ret)
+static void NORETURN tls_usage(int ret)
 {
   FILE *F = ret ? stderr : stdout;
   fprintf(F,"usage: " PROGRAM " [OPTIONS] FILE ...\n");
diff --git a/util.c b/util.c
index 8723248fbcca0c8b2d17ba5ad1b9526aae759ce5..72b3944ffe4b5eabca48b12d4f0e95382f2ce44b 100644 (file)
--- a/util.c
+++ b/util.c
@@ -135,7 +135,6 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
                if (errno != ENOSYS)
                        return -1;
                switch_step++;
-               /* FALLTHROUGH */
 #endif
 
 #ifdef HAVE_UTIMENSAT
@@ -145,7 +144,6 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
                if (errno != ENOSYS)
                        return -1;
                switch_step++;
-               /* FALLTHROUGH */
 #endif
 
 #ifdef HAVE_LUTIMES
@@ -155,7 +153,6 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
                if (errno != ENOSYS)
                        return -1;
                switch_step++;
-               /* FALLTHROUGH */
 #endif
 
 #include "case_N.h"
@@ -165,7 +162,6 @@ int set_modtime(const char *fname, time_t modtime, uint32 mod_nsec, mode_t mode)
                        if (S_ISLNK(mode))
                                return 1;
                }
-               /* FALLTHROUGH */
 
 #include "case_N.h"
 #ifdef HAVE_UTIMES
index cea8e7e4ed3357f8ab9312716d9a92c07145854a..5ed2390d20aea7b88613b8909f145c87388cc0e8 100644 (file)
@@ -885,9 +885,10 @@ int flush;
             INITBITS();
             state->mode = COPY_;
             if (flush == Z_TREES) goto inf_leave;
+           /* FALLTHROUGH */
         case COPY_:
             state->mode = COPY;
-           /* FALL THROUGH */
+           /* FALLTHROUGH */
         case COPY:
             copy = state->length;
             if (copy) {